Commit 026d7917 authored by Hans-Jürgen Koch's avatar Hans-Jürgen Koch Committed by Jeff Garzik

Fix a lock problem in generic phy code

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: default avatarHans J. Koch <hjk@linutronix.de>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent d1b139c0
...@@ -755,7 +755,7 @@ out_unlock: ...@@ -755,7 +755,7 @@ out_unlock:
*/ */
void phy_start(struct phy_device *phydev) void phy_start(struct phy_device *phydev)
{ {
spin_lock(&phydev->lock); spin_lock_bh(&phydev->lock);
switch (phydev->state) { switch (phydev->state) {
case PHY_STARTING: case PHY_STARTING:
...@@ -769,7 +769,7 @@ void phy_start(struct phy_device *phydev) ...@@ -769,7 +769,7 @@ void phy_start(struct phy_device *phydev)
default: default:
break; break;
} }
spin_unlock(&phydev->lock); spin_unlock_bh(&phydev->lock);
} }
EXPORT_SYMBOL(phy_stop); EXPORT_SYMBOL(phy_stop);
EXPORT_SYMBOL(phy_start); EXPORT_SYMBOL(phy_start);
......
...@@ -644,7 +644,7 @@ static int phy_probe(struct device *dev) ...@@ -644,7 +644,7 @@ static int phy_probe(struct device *dev)
if (!(phydrv->flags & PHY_HAS_INTERRUPT)) if (!(phydrv->flags & PHY_HAS_INTERRUPT))
phydev->irq = PHY_POLL; phydev->irq = PHY_POLL;
spin_lock(&phydev->lock); spin_lock_bh(&phydev->lock);
/* Start out supporting everything. Eventually, /* Start out supporting everything. Eventually,
* a controller will attach, and may modify one * a controller will attach, and may modify one
...@@ -658,7 +658,7 @@ static int phy_probe(struct device *dev) ...@@ -658,7 +658,7 @@ static int phy_probe(struct device *dev)
if (phydev->drv->probe) if (phydev->drv->probe)
err = phydev->drv->probe(phydev); err = phydev->drv->probe(phydev);
spin_unlock(&phydev->lock); spin_unlock_bh(&phydev->lock);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment