* [PATCH v2 net-next] r8169: fix failing WoL
@ 2020-06-03 20:29 Heiner Kallweit
2020-06-04 22:52 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2020-06-03 20:29 UTC (permalink / raw)
To: David Miller, Jakub Kicinski, Realtek linux nic maintainers; +Cc: netdev
Th referenced change added an extra hw reset to rtl8169_net_suspend()
what makes WoL fail on few chip versions. Therefore skip the extra
reset if we're going down and WoL is enabled.
In rtl_shutdown() rtl8169_hw_reset() is called by rtl8169_net_suspend()
already if needed, therefore avoid issues issue by removing the extra
call. The fix was tested on a system with RTL8168g.
Meanwhile rtl8169_hw_reset() does more than a hw reset and should be
renamed. But that's net-next material.
Fixes: 8ac8e8c64b53 ("r8169: make rtl8169_down central chip quiesce function")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
Uups, first version was cc'ed to Majordomo instead of the netdev mailing list.
---
drivers/net/ethernet/realtek/r8169_main.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 4d2ec9742..dad84ecf5 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -3928,7 +3928,7 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp)
netdev_reset_queue(tp->dev);
}
-static void rtl8169_hw_reset(struct rtl8169_private *tp)
+static void rtl8169_hw_reset(struct rtl8169_private *tp, bool going_down)
{
/* Give a racing hard_start_xmit a few cycles to complete. */
synchronize_rcu();
@@ -3938,6 +3938,9 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
rtl_rx_close(tp);
+ if (going_down && tp->dev->wol_enabled)
+ goto no_reset;
+
switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_27:
case RTL_GIGA_MAC_VER_28:
@@ -3959,7 +3962,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
}
rtl_hw_reset(tp);
-
+no_reset:
rtl8169_tx_clear(tp);
rtl8169_init_ring_indexes(tp);
}
@@ -3972,7 +3975,7 @@ static void rtl_reset_work(struct rtl8169_private *tp)
napi_disable(&tp->napi);
netif_stop_queue(dev);
- rtl8169_hw_reset(tp);
+ rtl8169_hw_reset(tp, false);
for (i = 0; i < NUM_RX_DESC; i++)
rtl8169_mark_to_asic(tp->RxDescArray + i);
@@ -4637,7 +4640,7 @@ static void rtl8169_down(struct rtl8169_private *tp)
phy_stop(tp->phydev);
napi_disable(&tp->napi);
- rtl8169_hw_reset(tp);
+ rtl8169_hw_reset(tp, true);
rtl_pll_power_down(tp);
@@ -4942,8 +4945,6 @@ static void rtl_shutdown(struct pci_dev *pdev)
/* Restore original MAC address */
rtl_rar_set(tp, tp->dev->perm_addr);
- rtl8169_hw_reset(tp);
-
if (system_state == SYSTEM_POWER_OFF) {
if (tp->saved_wolopts) {
rtl_wol_suspend_quirk(tp);
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 net-next] r8169: fix failing WoL
2020-06-03 20:29 [PATCH v2 net-next] r8169: fix failing WoL Heiner Kallweit
@ 2020-06-04 22:52 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-06-04 22:52 UTC (permalink / raw)
To: hkallweit1; +Cc: kuba, nic_swsd, netdev
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Wed, 3 Jun 2020 22:29:06 +0200
> Th referenced change added an extra hw reset to rtl8169_net_suspend()
> what makes WoL fail on few chip versions. Therefore skip the extra
> reset if we're going down and WoL is enabled.
> In rtl_shutdown() rtl8169_hw_reset() is called by rtl8169_net_suspend()
> already if needed, therefore avoid issues issue by removing the extra
> call. The fix was tested on a system with RTL8168g.
>
> Meanwhile rtl8169_hw_reset() does more than a hw reset and should be
> renamed. But that's net-next material.
>
> Fixes: 8ac8e8c64b53 ("r8169: make rtl8169_down central chip quiesce function")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-04 22:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 20:29 [PATCH v2 net-next] r8169: fix failing WoL Heiner Kallweit
2020-06-04 22:52 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).