]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Eilon Greenstein <eilong@broadcom.com> |
2 | Date: Wed, 14 Jan 2009 06:44:07 +0000 (+0000) | |
3 | Subject: bnx2x: Block nvram access when the device is inactive | |
4 | Patch-mainline: 2.6.29-rc3 | |
5 | Git-commit: 2add3acb11a26cc14b54669433ae6ace6406cbf2 | |
6 | References: bnc#470898 | |
7 | ||
8 | bnx2x: Block nvram access when the device is inactive | |
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 | Acked-by: Jeff Mahoney <jeffm@suse.com> | |
17 | --- | |
18 | ||
19 | drivers/net/bnx2x_main.c | 3 +++ | |
20 | 1 file changed, 3 insertions(+) | |
21 | ||
22 | Index: linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c | |
23 | =================================================================== | |
24 | --- linux-2.6.27-bnx2x_2.orig/drivers/net/bnx2x_main.c | |
25 | +++ linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c | |
26 | @@ -8280,6 +8280,9 @@ static int bnx2x_set_eeprom(struct net_d | |
27 | struct bnx2x *bp = netdev_priv(dev); | |
28 | int rc; | |
29 | ||
30 | + if (!netif_running(dev)) | |
31 | + return -EAGAIN; | |
32 | + | |
33 | DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n" | |
34 | DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n", | |
35 | eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset, |