From: Auke Kok <auke-jan.h.kok@intel•com>
To: davem@davemloft•net, jeff@garzik•org
Cc: netdev@vger•kernel.org, jesse.brandeburg@intel•com,
auke-jan.h.kok@intel•com
Subject: [PATCH 6/6] e1000: fix schedule while atomic when called from mii-tool
Date: Tue, 13 Nov 2007 15:11:38 -0800 [thread overview]
Message-ID: <20071113231138.13177.67320.stgit@localhost.localdomain> (raw)
In-Reply-To: <20071113231110.13177.27339.stgit@localhost.localdomain>
From: Jesse Brandeburg <jesse.brandeburg@intel•com>
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>
---
drivers/net/e1000/e1000_main.c | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index dc4934d..b7c3070 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4794,6 +4794,7 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
spin_unlock_irqrestore(&adapter->stats_lock, flags);
return -EIO;
}
+ spin_unlock_irqrestore(&adapter->stats_lock, flags);
if (adapter->hw.media_type == e1000_media_type_copper) {
switch (data->reg_num) {
case PHY_CTRL:
@@ -4814,12 +4815,8 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
DUPLEX_HALF;
retval = e1000_set_spd_dplx(adapter,
spddplx);
- if (retval) {
- spin_unlock_irqrestore(
- &adapter->stats_lock,
- flags);
+ if (retval)
return retval;
- }
}
if (netif_running(adapter->netdev))
e1000_reinit_locked(adapter);
@@ -4828,11 +4825,8 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
break;
case M88E1000_PHY_SPEC_CTRL:
case M88E1000_EXT_PHY_SPEC_CTRL:
- if (e1000_phy_reset(&adapter->hw)) {
- spin_unlock_irqrestore(
- &adapter->stats_lock, flags);
+ if (e1000_phy_reset(&adapter->hw))
return -EIO;
- }
break;
}
} else {
@@ -4847,7 +4841,6 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
break;
}
}
- spin_unlock_irqrestore(&adapter->stats_lock, flags);
break;
default:
return -EOPNOTSUPP;
next prev parent reply other threads:[~2007-11-13 23:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-13 23:11 [PATCH 1/6] e1000e: update netstats traffic counters realtime Auke Kok
2007-11-13 23:11 ` [PATCH 2/6] e1000: " Auke Kok
2007-11-14 4:51 ` David Miller
2007-11-13 23:11 ` [PATCH 3/6] e1000: convert regtest macro's to functions Auke Kok
2007-11-14 4:52 ` David Miller
2007-11-13 23:11 ` [PATCH 4/6] e1000e: convert register test macros " Auke Kok
2007-11-14 4:54 ` David Miller
2007-11-13 23:11 ` [PATCH 5/6] e1000: Secondary unicast address support Auke Kok
2007-11-14 0:16 ` Krzysztof Oledzki
2007-11-14 0:18 ` Ben Greear
2007-11-14 0:48 ` Krzysztof Oledzki
2007-11-14 1:05 ` Ben Greear
2007-11-14 1:17 ` Krzysztof Oledzki
2007-11-14 4:55 ` David Miller
2007-11-13 23:11 ` Auke Kok [this message]
2007-11-14 5:00 ` [PATCH 6/6] e1000: fix schedule while atomic when called from mii-tool David Miller
2007-11-14 4:48 ` [PATCH 1/6] e1000e: update netstats traffic counters realtime David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071113231138.13177.67320.stgit@localhost.localdomain \
--to=auke-jan.h.kok@intel$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=jeff@garzik$(echo .)org \
--cc=jesse.brandeburg@intel$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox