diff options
author | Michael Chan <mchan@broadcom.com> | 2009-08-21 12:20:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-22 20:48:42 -0400 |
commit | 3767546cc24de8f104e745d59a0a43a09d9267df (patch) | |
tree | 91b6b1e9da1be490c5f632065b12b6aa19bb3041 /drivers/net/bnx2.c | |
parent | 155d5561f570c5b3af7a178670061927d89209fb (diff) |
bnx2: Check if_running() before touching chip registers.
Add this check to bnx2_netif_stop() and bnx2_vlan_rx_register() to
prevent bus lockups on some systems when the chip is in low power state.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index e75b6e94f652..9cfd46017e4e 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -619,6 +619,9 @@ bnx2_disable_int_sync(struct bnx2 *bp) | |||
619 | int i; | 619 | int i; |
620 | 620 | ||
621 | atomic_inc(&bp->intr_sem); | 621 | atomic_inc(&bp->intr_sem); |
622 | if (!netif_running(bp->dev)) | ||
623 | return; | ||
624 | |||
622 | bnx2_disable_int(bp); | 625 | bnx2_disable_int(bp); |
623 | for (i = 0; i < bp->irq_nvecs; i++) | 626 | for (i = 0; i < bp->irq_nvecs; i++) |
624 | synchronize_irq(bp->irq_tbl[i].vector); | 627 | synchronize_irq(bp->irq_tbl[i].vector); |
@@ -6254,9 +6257,14 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp) | |||
6254 | { | 6257 | { |
6255 | struct bnx2 *bp = netdev_priv(dev); | 6258 | struct bnx2 *bp = netdev_priv(dev); |
6256 | 6259 | ||
6257 | bnx2_netif_stop(bp); | 6260 | if (netif_running(dev)) |
6261 | bnx2_netif_stop(bp); | ||
6258 | 6262 | ||
6259 | bp->vlgrp = vlgrp; | 6263 | bp->vlgrp = vlgrp; |
6264 | |||
6265 | if (!netif_running(dev)) | ||
6266 | return; | ||
6267 | |||
6260 | bnx2_set_rx_mode(dev); | 6268 | bnx2_set_rx_mode(dev); |
6261 | if (bp->flags & BNX2_FLAG_CAN_KEEP_VLAN) | 6269 | if (bp->flags & BNX2_FLAG_CAN_KEEP_VLAN) |
6262 | bnx2_fw_sync(bp, BNX2_DRV_MSG_CODE_KEEP_VLAN_UPDATE, 0, 1); | 6270 | bnx2_fw_sync(bp, BNX2_DRV_MSG_CODE_KEEP_VLAN_UPDATE, 0, 1); |