]>
Commit | Line | Data |
---|---|---|
5861a31d GKH |
1 | From 2add3acb11a26cc14b54669433ae6ace6406cbf2 Mon Sep 17 00:00:00 2001 |
2 | From: Eilon Greenstein <eilong@broadcom.com> | |
3 | Date: Wed, 14 Jan 2009 06:44:07 +0000 | |
4 | Subject: bnx2x: Block nvram access when the device is inactive | |
5 | ||
6 | From: Eilon Greenstein <eilong@broadcom.com> | |
7 | ||
8 | commit 2add3acb11a26cc14b54669433ae6ace6406cbf2 upstream. | |
9 | ||
10 | Don't dump eeprom when bnx2x adapter is down. Running ethtool -e causes an eeh | |
11 | without it when the device is down | |
12 | ||
13 | Signed-off-by: Paul Larson <pl@linux.vnet.ibm.com> | |
14 | Signed-off-by: Eilon Greenstein <eilong@broadcom.com> | |
15 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
16 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
17 | ||
18 | --- | |
19 | drivers/net/bnx2x_main.c | 3 +++ | |
20 | 1 file changed, 3 insertions(+) | |
21 | ||
22 | --- a/drivers/net/bnx2x_main.c | |
23 | +++ b/drivers/net/bnx2x_main.c | |
24 | @@ -8078,6 +8078,9 @@ static int bnx2x_get_eeprom(struct net_d | |
25 | struct bnx2x *bp = netdev_priv(dev); | |
26 | int rc; | |
27 | ||
28 | + if (!netif_running(dev)) | |
29 | + return -EAGAIN; | |
30 | + | |
31 | DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n" | |
32 | DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n", | |
33 | eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset, |