Fix a lock problem in generic phy code
authorHans-Jürgen Koch <hjk@linutronix.de>
Fri, 31 Aug 2007 12:30:08 +0000 (14:30 +0200)
committerJeff Garzik <jeff@garzik.org>
Thu, 13 Sep 2007 04:12:43 +0000 (00:12 -0400)
Lock debugging finds a problem in phy.c and phy_device.c,
this patch fixes it. Tested on an AT91SAM9263-EK board,
kernel 2.6.23-rc4.

Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/phy/phy.c
drivers/net/phy/phy_device.c

index e323efd..0cc4369 100644 (file)
@@ -755,7 +755,7 @@ out_unlock:
  */
 void phy_start(struct phy_device *phydev)
 {
-       spin_lock(&phydev->lock);
+       spin_lock_bh(&phydev->lock);
 
        switch (phydev->state) {
                case PHY_STARTING:
@@ -769,7 +769,7 @@ void phy_start(struct phy_device *phydev)
                default:
                        break;
        }
-       spin_unlock(&phydev->lock);
+       spin_unlock_bh(&phydev->lock);
 }
 EXPORT_SYMBOL(phy_stop);
 EXPORT_SYMBOL(phy_start);
index e275df8..49328e0 100644 (file)
@@ -644,7 +644,7 @@ static int phy_probe(struct device *dev)
        if (!(phydrv->flags & PHY_HAS_INTERRUPT))
                phydev->irq = PHY_POLL;
 
-       spin_lock(&phydev->lock);
+       spin_lock_bh(&phydev->lock);
 
        /* Start out supporting everything. Eventually,
         * a controller will attach, and may modify one
@@ -658,7 +658,7 @@ static int phy_probe(struct device *dev)
        if (phydev->drv->probe)
                err = phydev->drv->probe(phydev);
 
-       spin_unlock(&phydev->lock);
+       spin_unlock_bh(&phydev->lock);
 
        return err;