netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rasesh Mody <rmody@brocade.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: <adapter_linux_open_src_team@brocade.com>,
	Rasesh Mody <rmody@brocade.com>,
	Gurunatha Karaje <gkaraje@brocade.com>
Subject: [net-next,v4 09/12] bna: MBOX IRQ Flag Check after Locking
Date: Tue, 23 Aug 2011 10:56:05 -0700	[thread overview]
Message-ID: <1314122168-14314-10-git-send-email-rmody@brocade.com> (raw)
In-Reply-To: <1314122168-14314-1-git-send-email-rmody@brocade.com>

Change details:
 - Check the BNAD_RF_MBOX_IRQ_DISABLED flag after acquiring the bna_lock.

Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
---
 drivers/net/ethernet/brocade/bna/bnad.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index cf4e09c..ccc2cad 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -582,10 +582,11 @@ bnad_msix_mbox_handler(int irq, void *data)
 	unsigned long flags;
 	struct bnad *bnad = (struct bnad *)data;
 
-	if (unlikely(test_bit(BNAD_RF_MBOX_IRQ_DISABLED, &bnad->run_flags)))
-		return IRQ_HANDLED;
-
 	spin_lock_irqsave(&bnad->bna_lock, flags);
+	if (unlikely(test_bit(BNAD_RF_MBOX_IRQ_DISABLED, &bnad->run_flags))) {
+		spin_unlock_irqrestore(&bnad->bna_lock, flags);
+		return IRQ_HANDLED;
+	}
 
 	bna_intr_status_get(&bnad->bna, intr_status);
 
@@ -608,15 +609,18 @@ bnad_isr(int irq, void *data)
 	struct bnad_rx_ctrl *rx_ctrl;
 	struct bna_tcb *tcb = NULL;
 
-	if (unlikely(test_bit(BNAD_RF_MBOX_IRQ_DISABLED, &bnad->run_flags)))
+	spin_lock_irqsave(&bnad->bna_lock, flags);
+	if (unlikely(test_bit(BNAD_RF_MBOX_IRQ_DISABLED, &bnad->run_flags))) {
+		spin_unlock_irqrestore(&bnad->bna_lock, flags);
 		return IRQ_NONE;
+	}
 
 	bna_intr_status_get(&bnad->bna, intr_status);
 
-	if (unlikely(!intr_status))
+	if (unlikely(!intr_status)) {
+		spin_unlock_irqrestore(&bnad->bna_lock, flags);
 		return IRQ_NONE;
-
-	spin_lock_irqsave(&bnad->bna_lock, flags);
+	}
 
 	if (BNA_IS_MBOX_ERR_INTR(&bnad->bna, intr_status))
 		bna_mbox_handler(&bnad->bna, intr_status);
-- 
1.7.1


  parent reply	other threads:[~2011-08-23 17:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 17:55 [net-next,v4 00/12] bna: Update bna driver version to 3.0.2.1 Rasesh Mody
2011-08-23 17:55 ` [net-next,v4 01/12] bna: Naming Change and Minor Macro Fix Rasesh Mody
2011-08-23 17:55 ` [net-next,v4 02/12] bna: PCI Probe Fix Rasesh Mody
2011-08-23 17:55 ` [net-next,v4 03/12] bna: Interrupt Polling and NAPI Init Changes Rasesh Mody
2011-08-23 17:56 ` [net-next,v4 04/12] bna: TX Path and RX Path Changes Rasesh Mody
2011-08-23 23:22   ` David Miller
2011-08-23 23:24     ` David Miller
2011-08-23 17:56 ` [net-next,v4 05/12] bna: Formatting and Code Cleanup Rasesh Mody
2011-08-23 17:56 ` [net-next,v4 06/12] bna: Initialization and Locking Fix Rasesh Mody
2011-08-23 17:56 ` [net-next,v4 07/12] bna: Ethtool Enhancements and Fix Rasesh Mody
2011-08-23 17:56 ` [net-next,v4 08/12] bna: Async Mode Tx Rx Init Fix Rasesh Mody
2011-08-23 17:56 ` Rasesh Mody [this message]
2011-08-23 17:56 ` [net-next,v4 10/12] bna: Queue Depth and SKB Unmap Array Fix Rasesh Mody
2011-08-23 17:56 ` [net-next,v4 11/12] bna: SKB PCI UNMAP Fix Rasesh Mody
2011-08-23 17:56 ` [net-next,v4 12/12] bna: Driver Version changed to 3.0.2.1 Rasesh Mody

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=1314122168-14314-10-git-send-email-rmody@brocade.com \
    --to=rmody@brocade.com \
    --cc=adapter_linux_open_src_team@brocade.com \
    --cc=davem@davemloft.net \
    --cc=gkaraje@brocade.com \
    --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).