From: Heiner Kallweit Date: Wed, 29 May 2019 05:44:01 +0000 (+0200) Subject: r8169: fix MAC address being lost in PCI D3 X-Git-Tag: v5.15~6256^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59715171fbd0172a579576f46821031800a63bc5;p=platform%2Fkernel%2Flinux-starfive.git r8169: fix MAC address being lost in PCI D3 (At least) RTL8168e forgets its MAC address in PCI D3. To fix this set the MAC address when resuming. For resuming from runtime-suspend we had this in place already, for resuming from S3/S5 it was missing. The commit referenced as being fixed isn't wrong, it's just the first one where the patch applies cleanly. Fixes: 0f07bd850d36 ("r8169: use dev_get_drvdata where possible") Signed-off-by: Heiner Kallweit Reported-by: Albert Astals Cid Tested-by: Albert Astals Cid Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 8e40418..d06a61f 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -6722,6 +6722,8 @@ static int rtl8169_resume(struct device *device) struct net_device *dev = dev_get_drvdata(device); struct rtl8169_private *tp = netdev_priv(dev); + rtl_rar_set(tp, dev->dev_addr); + clk_prepare_enable(tp->clk); if (netif_running(dev)) @@ -6755,6 +6757,7 @@ static int rtl8169_runtime_resume(struct device *device) { struct net_device *dev = dev_get_drvdata(device); struct rtl8169_private *tp = netdev_priv(dev); + rtl_rar_set(tp, dev->dev_addr); if (!tp->TxDescArray)