Thread (17 messages) flat view 17 messages, 2 authors, 2012-12-31
STALE5001d

[PATCH RFC 01/15] via-rhine: YARB: fix broken resume of ifdown case (NetworkManager).

From: Andreas Mohr <hidden>
Date: 2012-12-31 15:34:43
Subsystem: networking drivers, the rest, via rhine network driver · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds, Kevin Brace

From: Andreas Mohr <redacted>

Well, it's probably not a *breakage* this time after all
(handling probably was never fully correct before).

resume() in the case of an ifdown iface
(as e.g. usually done by NetworkManager)
did not restore the card to proper full post-probe() card state
(see resume()s !netif_running() check),
thereby causing the subsequent iface open() as done by NM to fail,
since that one requires full post-probe() card state
(e.g. PHY available) yet the PHY was not available
(at least in the case of full-shutdown S2R).

Some related NetworkManager links are
  https://bugs.mageia.org/show_bug.cgi?id=7498
  http://crunchbang.org/forums/viewtopic.php?id=15169
  https://bugzilla.redhat.com/show_bug.cgi?id=477964
  https://bugzilla.redhat.com/show_bug.cgi?id=549089

Suspend/resume behaviour verified with both NM running and not running,
and with both mem (S2R) and standby.
Tested on Neoware CA10 (VIA C3), will also test on EPoX 8K5A2+.

Signed-off-by: Andreas Mohr <redacted>
---
 drivers/net/ethernet/via/via-rhine.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index 7992b3e..5facb0b 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -2324,13 +2324,20 @@ static int rhine_resume(struct device *device)
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct rhine_private *rp = netdev_priv(dev);
 
-	if (!netif_running(dev))
-		return 0;
-
 #ifdef USE_MMIO
 	enable_mmio(rp->pioaddr, rp->quirks);
 #endif
+	/*
+	 * FIXME: some power calls here are being done
+	 * internally in netdev setup parts below, too -
+	 * should be corrected eventually.
+	 */
 	rhine_power_init(dev);
+	rhine_hw_init(dev, rp->pioaddr);
+
+	if (!netif_running(dev))
+		return 0;
+
 	free_tbufs(dev);
 	free_rbufs(dev);
 	alloc_tbufs(dev);
-- 
1.7.2.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help