Commit 24cd804d authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

3c59x: Remove incorrect locking; correct documented lock hierarchy

vortex_ioctl() was grabbing vortex_private::lock around its call to
generic_mii_ioctl().  This is no longer necessary since there are more
specific locks which the mdio_{read,write}() functions will obtain.
Worse, those functions do not save and restore IRQ flags when locking
the MII state, so interrupts will be enabled when generic_mii_ioctl()
returns.

Since there is currently no need for any function to call
mdio_{read,write}() while holding another spinlock, do not change them
to save and restore IRQ flags but remove the specification of ordering
between vortex_private::lock and vortex_private::mii_lock.
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de6be6c1
...@@ -647,7 +647,7 @@ struct vortex_private { ...@@ -647,7 +647,7 @@ struct vortex_private {
u16 io_size; /* Size of PCI region (for release_region) */ u16 io_size; /* Size of PCI region (for release_region) */
/* Serialises access to hardware other than MII and variables below. /* Serialises access to hardware other than MII and variables below.
* The lock hierarchy is rtnl_lock > lock > mii_lock > window_lock. */ * The lock hierarchy is rtnl_lock > {lock, mii_lock} > window_lock. */
spinlock_t lock; spinlock_t lock;
spinlock_t mii_lock; /* Serialises access to MII */ spinlock_t mii_lock; /* Serialises access to MII */
...@@ -2984,7 +2984,6 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2984,7 +2984,6 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ {
int err; int err;
struct vortex_private *vp = netdev_priv(dev); struct vortex_private *vp = netdev_priv(dev);
unsigned long flags;
pci_power_t state = 0; pci_power_t state = 0;
if(VORTEX_PCI(vp)) if(VORTEX_PCI(vp))
...@@ -2994,9 +2993,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2994,9 +2993,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if(state != 0) if(state != 0)
pci_set_power_state(VORTEX_PCI(vp), PCI_D0); pci_set_power_state(VORTEX_PCI(vp), PCI_D0);
spin_lock_irqsave(&vp->lock, flags);
err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL); err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL);
spin_unlock_irqrestore(&vp->lock, flags);
if(state != 0) if(state != 0)
pci_set_power_state(VORTEX_PCI(vp), state); pci_set_power_state(VORTEX_PCI(vp), state);
......
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