aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2007-11-14 00:00:09 -0500
committerDavid S. Miller <davem@davemloft.net>2007-11-14 00:00:09 -0500
commitf0163ac45b40bd032b877c747796146d52d4e800 (patch)
tree8fe8cb9be1632f5685cf40b838ca826d0425d8ea
parente2ac455a18806b31c2d0da0a51d8740af5010b7a (diff)
[E1000]: Fix schedule while atomic when called from mii-tool.
mii-tool can cause the driver to call msleep during nway reset, bugzilla.kernel.org bug 8430. Fix by simply calling reinit_locked outside of the spinlock, which is safe from ethtool, so it should be safe from here. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/e1000/e1000_main.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 72deff0d4d90..cf39473ef90a 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4804,6 +4804,7 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
4804 spin_unlock_irqrestore(&adapter->stats_lock, flags); 4804 spin_unlock_irqrestore(&adapter->stats_lock, flags);
4805 return -EIO; 4805 return -EIO;
4806 } 4806 }
4807 spin_unlock_irqrestore(&adapter->stats_lock, flags);
4807 if (adapter->hw.media_type == e1000_media_type_copper) { 4808 if (adapter->hw.media_type == e1000_media_type_copper) {
4808 switch (data->reg_num) { 4809 switch (data->reg_num) {
4809 case PHY_CTRL: 4810 case PHY_CTRL:
@@ -4824,12 +4825,8 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
4824 DUPLEX_HALF; 4825 DUPLEX_HALF;
4825 retval = e1000_set_spd_dplx(adapter, 4826 retval = e1000_set_spd_dplx(adapter,
4826 spddplx); 4827 spddplx);
4827 if (retval) { 4828 if (retval)
4828 spin_unlock_irqrestore(
4829 &adapter->stats_lock,
4830 flags);
4831 return retval; 4829 return retval;
4832 }
4833 } 4830 }
4834 if (netif_running(adapter->netdev)) 4831 if (netif_running(adapter->netdev))
4835 e1000_reinit_locked(adapter); 4832 e1000_reinit_locked(adapter);
@@ -4838,11 +4835,8 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
4838 break; 4835 break;
4839 case M88E1000_PHY_SPEC_CTRL: 4836 case M88E1000_PHY_SPEC_CTRL:
4840 case M88E1000_EXT_PHY_SPEC_CTRL: 4837 case M88E1000_EXT_PHY_SPEC_CTRL:
4841 if (e1000_phy_reset(&adapter->hw)) { 4838 if (e1000_phy_reset(&adapter->hw))
4842 spin_unlock_irqrestore(
4843 &adapter->stats_lock, flags);
4844 return -EIO; 4839 return -EIO;
4845 }
4846 break; 4840 break;
4847 } 4841 }
4848 } else { 4842 } else {
@@ -4857,7 +4851,6 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
4857 break; 4851 break;
4858 } 4852 }
4859 } 4853 }
4860 spin_unlock_irqrestore(&adapter->stats_lock, flags);
4861 break; 4854 break;
4862 default: 4855 default:
4863 return -EOPNOTSUPP; 4856 return -EOPNOTSUPP;