Skip to content

Commit ef4d5fc

Browse files
hkallweitdavem330
authored andcommitted
r8169: improve runtime pm in rtl8169_check_link_status
This patch partially reverts commit e4fbce7 "r8169: Fix runtime power management" from 2010. At that time the suspend delay was 100ms and therefore suspending happened during initial aneg. Currently suspend delay is 5s, so suspend starts after aneg and the issue doesn't exist any longer. On my system aneg takes almost 3s, to be on the safe side let's increase the suspend delay to 10s. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b9aa1c7 commit ef4d5fc

File tree

1 file changed

+6
-15
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+6
-15
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,33 +1675,24 @@ static void rtl_link_chg_patch(struct rtl8169_private *tp)
16751675
}
16761676
}
16771677

1678-
static void __rtl8169_check_link_status(struct net_device *dev,
1679-
struct rtl8169_private *tp,
1680-
void __iomem *ioaddr, bool pm)
1678+
static void rtl8169_check_link_status(struct net_device *dev,
1679+
struct rtl8169_private *tp,
1680+
void __iomem *ioaddr)
16811681
{
16821682
if (tp->link_ok(ioaddr)) {
16831683
rtl_link_chg_patch(tp);
16841684
/* This is to cancel a scheduled suspend if there's one. */
1685-
if (pm)
1686-
pm_request_resume(&tp->pci_dev->dev);
1685+
pm_request_resume(&tp->pci_dev->dev);
16871686
netif_carrier_on(dev);
16881687
if (net_ratelimit())
16891688
netif_info(tp, ifup, dev, "link up\n");
16901689
} else {
16911690
netif_carrier_off(dev);
16921691
netif_info(tp, ifdown, dev, "link down\n");
1693-
if (pm)
1694-
pm_schedule_suspend(&tp->pci_dev->dev, 5000);
1692+
pm_schedule_suspend(&tp->pci_dev->dev, 10000);
16951693
}
16961694
}
16971695

1698-
static void rtl8169_check_link_status(struct net_device *dev,
1699-
struct rtl8169_private *tp,
1700-
void __iomem *ioaddr)
1701-
{
1702-
__rtl8169_check_link_status(dev, tp, ioaddr, false);
1703-
}
1704-
17051696
#define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
17061697

17071698
static u32 __rtl8169_get_wol(struct rtl8169_private *tp)
@@ -7746,7 +7737,7 @@ static void rtl_slow_event_work(struct rtl8169_private *tp)
77467737
rtl8169_pcierr_interrupt(dev);
77477738

77487739
if (status & LinkChg)
7749-
__rtl8169_check_link_status(dev, tp, tp->mmio_addr, true);
7740+
rtl8169_check_link_status(dev, tp, tp->mmio_addr);
77507741

77517742
rtl_irq_enable_all(tp);
77527743
}

0 commit comments

Comments
 (0)