Skip to content

Commit

Permalink
bnx2: Check if_running() before touching chip registers.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Chan authored and David S. Miller committed Aug 23, 2009
1 parent 155d556 commit 3767546
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,9 @@ bnx2_disable_int_sync(struct bnx2 *bp)
int i;

atomic_inc(&bp->intr_sem);
if (!netif_running(bp->dev))
return;

bnx2_disable_int(bp);
for (i = 0; i < bp->irq_nvecs; i++)
synchronize_irq(bp->irq_tbl[i].vector);
Expand Down Expand Up @@ -6254,9 +6257,14 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp)
{
struct bnx2 *bp = netdev_priv(dev);

bnx2_netif_stop(bp);
if (netif_running(dev))
bnx2_netif_stop(bp);

bp->vlgrp = vlgrp;

if (!netif_running(dev))
return;

bnx2_set_rx_mode(dev);
if (bp->flags & BNX2_FLAG_CAN_KEEP_VLAN)
bnx2_fw_sync(bp, BNX2_DRV_MSG_CODE_KEEP_VLAN_UPDATE, 0, 1);
Expand Down

0 comments on commit 3767546

Please sign in to comment.