aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorHans-Jürgen Koch <hjk@linutronix.de>2007-08-31 08:30:08 -0400
committerJeff Garzik <jeff@garzik.org>2007-09-13 00:12:43 -0400
commit026d7917e592f91063861e002adf1c806d7756ae (patch)
tree02a5de4f89634c0e8a5b119df7fc4ee91f15da37 /drivers/net/phy
parentd1b139c039704c391ab47c6c9540c28f7fcaa489 (diff)
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: Hans J. Koch <hjk@linutronix.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/phy.c4
-rw-r--r--drivers/net/phy/phy_device.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index e323efd4ed18..0cc4369cacba 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -755,7 +755,7 @@ out_unlock:
755 */ 755 */
756void phy_start(struct phy_device *phydev) 756void phy_start(struct phy_device *phydev)
757{ 757{
758 spin_lock(&phydev->lock); 758 spin_lock_bh(&phydev->lock);
759 759
760 switch (phydev->state) { 760 switch (phydev->state) {
761 case PHY_STARTING: 761 case PHY_STARTING:
@@ -769,7 +769,7 @@ void phy_start(struct phy_device *phydev)
769 default: 769 default:
770 break; 770 break;
771 } 771 }
772 spin_unlock(&phydev->lock); 772 spin_unlock_bh(&phydev->lock);
773} 773}
774EXPORT_SYMBOL(phy_stop); 774EXPORT_SYMBOL(phy_stop);
775EXPORT_SYMBOL(phy_start); 775EXPORT_SYMBOL(phy_start);
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index e275df8c55bc..49328e050505 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -644,7 +644,7 @@ static int phy_probe(struct device *dev)
644 if (!(phydrv->flags & PHY_HAS_INTERRUPT)) 644 if (!(phydrv->flags & PHY_HAS_INTERRUPT))
645 phydev->irq = PHY_POLL; 645 phydev->irq = PHY_POLL;
646 646
647 spin_lock(&phydev->lock); 647 spin_lock_bh(&phydev->lock);
648 648
649 /* Start out supporting everything. Eventually, 649 /* Start out supporting everything. Eventually,
650 * a controller will attach, and may modify one 650 * a controller will attach, and may modify one
@@ -658,7 +658,7 @@ static int phy_probe(struct device *dev)
658 if (phydev->drv->probe) 658 if (phydev->drv->probe)
659 err = phydev->drv->probe(phydev); 659 err = phydev->drv->probe(phydev);
660 660
661 spin_unlock(&phydev->lock); 661 spin_unlock_bh(&phydev->lock);
662 662
663 return err; 663 return err;
664 664