Commit 3767546c authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

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: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 155d5561
...@@ -619,6 +619,9 @@ bnx2_disable_int_sync(struct bnx2 *bp) ...@@ -619,6 +619,9 @@ bnx2_disable_int_sync(struct bnx2 *bp)
int i; int i;
atomic_inc(&bp->intr_sem); atomic_inc(&bp->intr_sem);
if (!netif_running(bp->dev))
return;
bnx2_disable_int(bp); bnx2_disable_int(bp);
for (i = 0; i < bp->irq_nvecs; i++) for (i = 0; i < bp->irq_nvecs; i++)
synchronize_irq(bp->irq_tbl[i].vector); synchronize_irq(bp->irq_tbl[i].vector);
...@@ -6254,9 +6257,14 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp) ...@@ -6254,9 +6257,14 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp)
{ {
struct bnx2 *bp = netdev_priv(dev); struct bnx2 *bp = netdev_priv(dev);
bnx2_netif_stop(bp); if (netif_running(dev))
bnx2_netif_stop(bp);
bp->vlgrp = vlgrp; bp->vlgrp = vlgrp;
if (!netif_running(dev))
return;
bnx2_set_rx_mode(dev); bnx2_set_rx_mode(dev);
if (bp->flags & BNX2_FLAG_CAN_KEEP_VLAN) if (bp->flags & BNX2_FLAG_CAN_KEEP_VLAN)
bnx2_fw_sync(bp, BNX2_DRV_MSG_CODE_KEEP_VLAN_UPDATE, 0, 1); bnx2_fw_sync(bp, BNX2_DRV_MSG_CODE_KEEP_VLAN_UPDATE, 0, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment