]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/bnx2x-block-nvram-access-when-device-is-inactive
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / bnx2x-block-nvram-access-when-device-is-inactive
CommitLineData
2cb7cef9
BS
1From: Eilon Greenstein <eilong@broadcom.com>
2Date: Wed, 14 Jan 2009 06:44:07 +0000 (+0000)
3Subject: bnx2x: Block nvram access when the device is inactive
4Patch-mainline: 2.6.29-rc3
5Git-commit: 2add3acb11a26cc14b54669433ae6ace6406cbf2
6References: bnc#470898
7
8bnx2x: Block nvram access when the device is inactive
9
10Don't dump eeprom when bnx2x adapter is down. Running ethtool -e causes an eeh
11without it when the device is down
12
13Signed-off-by: Paul Larson <pl@linux.vnet.ibm.com>
14Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
15Signed-off-by: David S. Miller <davem@davemloft.net>
16Acked-by: Jeff Mahoney <jeffm@suse.com>
17---
18
19 drivers/net/bnx2x_main.c | 3 +++
20 1 file changed, 3 insertions(+)
21
22Index: 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,