Subject: Re: Kernel oops on setting sky2 interfaces down

From: Mike McCormack <[email-masked]>
Date: Tue, 04 Aug 2009 20:18:36 +0900

2009/8/4 Rene Mayrhofer <[email-masked]>:

> 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 <[email-masked]>
---
 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