diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2007-09-29 01:42:12 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:54 -0400 |
commit | 9ff8c68b3c722f732c7a13d6631b149cca8c7091 (patch) | |
tree | ec0dd0762f9652d30fff30228406bcd0417f6063 /drivers/net/phy/phy_device.c | |
parent | 1f8f4559f8c5829348a010a9e0bbb423310060d1 (diff) |
PHYLIB: Spinlock fixes for softirqs
Use spin_lock_bh()/spin_unlock_bh() for the phydev lock throughout as it
is used in phy_timer() that is called as a softirq and all the other
operations may happen in the user context.
There has been a change recently that did such a conversion for some of the
operations on the lock, but some have been left intact. Many of them,
perhaps all, may be called in the user context and I was able to trigger
recursive spinlock acquisition indeed, so I think for the sake of long-term
maintenance it is best to convert them all, even if unnecessarily for one
or two -- better safe than sorry.
Perhaps one in phy_timer() could actually be skipped as only called as a
softirq -- I can send an update if that sounds like a good idea.
Checked with checkpatch.pl and at the runtime.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r-- | drivers/net/phy/phy_device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 49328e050505..c0461217b108 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -670,9 +670,9 @@ static int phy_remove(struct device *dev) | |||
670 | 670 | ||
671 | phydev = to_phy_device(dev); | 671 | phydev = to_phy_device(dev); |
672 | 672 | ||
673 | spin_lock(&phydev->lock); | 673 | spin_lock_bh(&phydev->lock); |
674 | phydev->state = PHY_DOWN; | 674 | phydev->state = PHY_DOWN; |
675 | spin_unlock(&phydev->lock); | 675 | spin_unlock_bh(&phydev->lock); |
676 | 676 | ||
677 | if (phydev->drv->remove) | 677 | if (phydev->drv->remove) |
678 | phydev->drv->remove(phydev); | 678 | phydev->drv->remove(phydev); |