netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Chan" <mchan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH -next 2/8] bnx2: Check if_running() before touching chip registers.
Date: Fri, 21 Aug 2009 19:20:44 -0700	[thread overview]
Message-ID: <1250907650-24672-2-git-send-email-mchan@broadcom.com> (raw)
In-Reply-To: <1250907650-24672-1-git-send-email-mchan@broadcom.com>

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>
---
 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 e75b6e9..9cfd460 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);
-- 
1.5.6.GIT



  reply	other threads:[~2009-08-22  2:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-22  2:20 [PATCH -next 1/8] bnx2: Zero out status block before chip reset Michael Chan
2009-08-22  2:20 ` Michael Chan [this message]
2009-08-22  2:20 ` [PATCH -next 3/8] bnx2: Close device if MTU change or ring size change fails Michael Chan
2009-08-22  2:20 ` [PATCH -next 4/8] bnx2: Apply BROKEN_STATS workaround to 5706 and 5708 Michael Chan
2009-08-22  2:20 ` [PATCH -next 5/8] bnx2: Report FTQ discard counter Michael Chan
2009-08-22  2:20 ` [PATCH -next 6/8] bnx2: Refine coalescing parameters Michael Chan
2009-08-22  2:20 ` [PATCH -next 7/8] bnx2: Use const on flash_table structure Michael Chan
2009-08-22  2:20 ` [PATCH -next 8/8] bnx2: Update version to 2.0.2 Michael Chan
2009-08-23  0:50 ` [PATCH -next 1/8] bnx2: Zero out status block before chip reset David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1250907650-24672-2-git-send-email-mchan@broadcom.com \
    --to=mchan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).