Skip to contentSkip to conversation

fs_enet: Don't call phy_mii_ioctl() in atomic context.

PATCH Applied Scott Wood 3 participants 3 messages Feb 15, 2008 – Feb 20, 2008

Subsystems (2)
lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH 1/1 fs_enet: Don't call phy_mii_ioctl() in atomic context.

The lock acquisition in fs_ioctl() does not appear to actually be necessary, and thus is simply removed.

---
This fixes the following bug:
http://ozlabs.org/pipermail/linuxppc-dev/2008-February/051564.html

 drivers/net/fs_enet/fs_enet-main.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
drivers/net/fs_enet/fs_enet-main.c +1 -6
index 42d94ed..af869cf 100644
@@ -946,16 +946,11 @@ static int fs_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct fs_enet_private *fep = netdev_priv(dev);
 	struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&rq->ifr_data;
-	unsigned long flags;
-	int rc;
 
 	if (!netif_running(dev))
 		return -EINVAL;
 
-	spin_lock_irqsave(&fep->lock, flags);
-	rc = phy_mii_ioctl(fep->phydev, mii, cmd);
-	spin_unlock_irqrestore(&fep->lock, flags);
-	return rc;
+	return phy_mii_ioctl(fep->phydev, mii, cmd);
 }
 
 extern int fs_mii_connect(struct net_device *dev);
Signature · 1 line
1.5.3.8
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Scott Wood

The lock acquisition in fs_ioctl() does not appear to actually be necessary, and thus is simply removed.

This fixes the following bug:
http://ozlabs.org/pipermail/linuxppc-dev/2008-February/051564.html

 drivers/net/fs_enet/fs_enet-main.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
drivers/net/fs_enet/fs_enet-main.c +0 -0
index 42d94ed..af869cf 100644

drivers/net/fs_enet/fs_enet-main.c static int fs_ioctl(struct net_device · line 949

Quoted 4 lines
drivers/net/fs_enet/fs_enet-main.c +0 -0
@@ -946,16 +946,11 @@ static int fs_ioctl(struct net_device
 *dev, struct ifreq *rq, int cmd)
 {
 	struct fs_enet_private *fep = netdev_priv(dev);
 	struct mii_ioctl_data *mii = (struct mii_ioctl_data

*)&rq->ifr_data;

Quoted 13 lines
drivers/net/fs_enet/fs_enet-main.c +1 -6
-	unsigned long flags;
-	int rc;
 
 	if (!netif_running(dev))
 		return -EINVAL;
 
-	spin_lock_irqsave(&fep->lock, flags);
-	rc = phy_mii_ioctl(fep->phydev, mii, cmd);
-	spin_unlock_irqrestore(&fep->lock, flags);
-	return rc;
+	return phy_mii_ioctl(fep->phydev, mii, cmd);
 }
 
Quoted 1 line

extern int fs_mii_connect(struct net_device *dev);

Tested it and it does indeed take care of the bug.