Thread (16 messages) 16 messages, 4 authors, 2009-08-04

Re: Kernel oops on setting sky2 interfaces down

From: Mike McCormack <hidden>
Date: 2009-08-04 11:21:29
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

2009/8/4 Rene Mayrhofer [off-list ref]:
Does anybody have an idea on what might be wrong in sky2_down?
I had a look into this, and noticed that we don't hold phy_lock when calling 
sky2_phy_power_down() in sky2_down(). sky2_phy_power_down() does some PCI
manipulation, so it's possible this could cause bad things to happen...

Does the following patch help?

Mike



Subject: [PATCH] sky2: Hold phy_lock when powering down phy

Make sure to hold phy_lock when calling sky2_phy_power_down(),
 as is done when calling sky2_phy_power_up(),

Signed-off-by: Mike McCormack <redacted>
---
 drivers/net/sky2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index e9cb1e7..47e5bae 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1894,7 +1894,9 @@ static int sky2_down(struct net_device *dev)
        synchronize_irq(hw->pdev->irq);
        napi_synchronize(&hw->napi);
 
+       spin_lock_bh(&sky2->phy_lock);
        sky2_phy_power_down(hw, port);
+       spin_unlock_bh(&sky2->phy_lock);
 
        /* turn off LED's */
        sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);
-- 
1.5.6.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