Skip to content

Commit 49ef7d8

Browse files
hkallweitdavem330
authored andcommitted
r8169: prepare rtl_hw_aspm_clkreq_enable for usage in atomic context
Bail out if the function is used with chip versions that don't support ASPM configuration. In addition remove the delay, it tuned out that it's not needed, also vendor driver r8125 doesn't have it. Suggested-by: Kai-Heng Feng <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Kai-Heng Feng <[email protected]> Tested-by: Holger Hoffstätte <[email protected]> Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 59ee97c commit 49ef7d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2741,6 +2741,9 @@ static void rtl_disable_exit_l1(struct rtl8169_private *tp)
27412741

27422742
static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable)
27432743
{
2744+
if (tp->mac_version < RTL_GIGA_MAC_VER_32)
2745+
return;
2746+
27442747
/* Don't enable ASPM in the chip if OS can't control ASPM */
27452748
if (enable && tp->aspm_manageable) {
27462749
rtl_mod_config5(tp, 0, ASPM_en);
@@ -2770,8 +2773,6 @@ static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable)
27702773
rtl_mod_config2(tp, ClkReqEn, 0);
27712774
rtl_mod_config5(tp, ASPM_en, 0);
27722775
}
2773-
2774-
udelay(10);
27752776
}
27762777

27772778
static void rtl_set_fifo_size(struct rtl8169_private *tp, u16 rx_stat,

0 commit comments

Comments
 (0)