Skip to content

Commit

Permalink
Fix a lock problem in generic phy code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans-Jürgen Koch authored and Jeff Garzik committed Sep 13, 2007
1 parent d1b139c commit 026d791
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ void phy_stop(struct phy_device *phydev)
*/
void phy_start(struct phy_device *phydev)
{
spin_lock(&phydev->lock);
spin_lock_bh(&phydev->lock);

switch (phydev->state) {
case PHY_STARTING:
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand Down

0 comments on commit 026d791

Please sign in to comment.