[PATCH 1/1][SRU][H] UBUNTU: SAUCE: Revert "ethernet: alx: fix order of calls on resume"
chris.chiu at canonical.com
chris.chiu at canonical.com
Thu Jul 15 13:20:37 UTC 2021
From: Chris Chiu <chris.chiu at canonical.com>
BugLink: https://bugs.launchpad.net/bugs/1931301
This reverts commit 59a1c7f9fbbb6d69924aefb9318b9a7a26546116.
We don't really need the upstream commit a4dcfbc4ee22 ("ethernet:
alx: fix order of calls on resume") after WoL feature support code
been added back. The order of calls on resume is already correct.
The WoL version suspend will do netif_device_detach despite of the
status of netif_running, but the netif_device_attach is not there
on resume if the netif_running return false in the previous commit.
The network interface will not be present after resume if its state
is not up and running before suspend.
Signed-off-by: Chris Chiu <chris.chiu at canonical.com>
---
drivers/net/ethernet/atheros/alx/main.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index 20eabdda7466..a2d16630571e 100644
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -2011,18 +2011,17 @@ static int alx_resume(struct device *dev)
return -EIO;
}
- if (!netif_running(netdev))
- return 0;
-
- rtnl_lock();
- err = __alx_open(alx, true);
- rtnl_unlock();
- if (err)
- return err;
+ if (netif_running(netdev)) {
+ rtnl_lock();
+ err = __alx_open(alx, true);
+ rtnl_unlock();
+ if (err)
+ return err;
+ }
netif_device_attach(netdev);
- return 0;
+ return err;
}
#endif
--
2.25.1
More information about the kernel-team
mailing list