From: Michael Chan Date: Fri, 21 Aug 2009 16:20:44 +0000 (+0000) Subject: bnx2: Check if_running() before touching chip registers. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3767546cc24de8f104e745d59a0a43a09d9267df;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: David S. Miller --- 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) 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); @@ -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);