diff mbox series

[net,2/2] r8169: fix network lost after resume on DASH systems

Message ID 20231106151124.9175-3-hau@realtek.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series r8169: fix DASH deviceis network lost issue | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1312 this patch: 1312
netdev/cc_maintainers fail 2 blamed authors not CCed: romieu@fr.zoreil.com davem@davemloft.net; 5 maintainers not CCed: kuba@kernel.org pabeni@redhat.com davem@davemloft.net romieu@fr.zoreil.com edumazet@google.com
netdev/build_clang success Errors and warnings before: 1340 this patch: 1340
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1340 this patch: 1340
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

ChunHao Lin Nov. 6, 2023, 3:11 p.m. UTC
Device that support DASH may be reseted or powered off during suspend.
So driver needs to handle DASH during system suspend and resume. Or
DASH firmware will influence device behavior and causes network lost.

Fixes: b646d90053f8 ("r8169: magic.")
Signed-off-by: ChunHao Lin <hau@realtek.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Heiner Kallweit Nov. 7, 2023, 7:15 a.m. UTC | #1
On 06.11.2023 16:11, ChunHao Lin wrote:
> Device that support DASH may be reseted or powered off during suspend.
> So driver needs to handle DASH during system suspend and resume. Or
> DASH firmware will influence device behavior and causes network lost.
> 
> Fixes: b646d90053f8 ("r8169: magic.")
> Signed-off-by: ChunHao Lin <hau@realtek.com>

Also here: cc stable
With this:

Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
ChunHao Lin Nov. 8, 2023, 6:07 p.m. UTC | #2
> > Device that support DASH may be reseted or powered off during suspend.
> > So driver needs to handle DASH during system suspend and resume. Or
> > DASH firmware will influence device behavior and causes network lost.
> >
> > Fixes: b646d90053f8 ("r8169: magic.")
> > Signed-off-by: ChunHao Lin <hau@realtek.com>
> 
> Also here: cc stable
> With this:
> 
> Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>

Thanks for your advices. I will update the code and submit the patch again.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 8cbd7c96d9e1..cf32993992bc 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4659,10 +4659,16 @@  static void rtl8169_down(struct rtl8169_private *tp)
 	rtl8169_cleanup(tp);
 	rtl_disable_exit_l1(tp);
 	rtl_prepare_power_down(tp);
+
+	if (tp->dash_type != RTL_DASH_NONE)
+		rtl8168_driver_stop(tp);
 }
 
 static void rtl8169_up(struct rtl8169_private *tp)
 {
+	if (tp->dash_type != RTL_DASH_NONE)
+		rtl8168_driver_start(tp);
+
 	pci_set_master(tp->pci_dev);
 	phy_init_hw(tp->phydev);
 	phy_resume(tp->phydev);