linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <vikas.chaudhary@qlogic.com>
To: jbottomley@parallels.com, michaelc@cs.wisc.edu
Cc: linux-scsi@vger.kernel.org, vikas.chaudhary@qlogic.com,
	lalit.chandivade@qlogic.com, Tej Parkash <tej.parkash@qlogic.com>
Subject: [PATCH 12/24] qla4xxx: Fix processing response queue during probe
Date: Mon, 16 Dec 2013 06:49:42 -0500	[thread overview]
Message-ID: <1387194594-29817-13-git-send-email-vikas.chaudhary@qlogic.com> (raw)
In-Reply-To: <1387194594-29817-1-git-send-email-vikas.chaudhary@qlogic.com>

From: Tej Parkash <tej.parkash@qlogic.com>

Issue:
While booting with kdump kernel, driver receive IOCB interrupts
for which it is not ready which results in processing them
before init_firmware during driver probe

Fix:
Two steps solution
1. Make driver ready to process the interrupt before interupts
   handlers is registered.
2. Stop driver processing iocb interrupts if not generated as per
   firmware protocol i.e R2H bit set

Signed-off-by: Tej Parkash <tej.parkash@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
 drivers/scsi/qla4xxx/ql4_isr.c | 15 ++++++++++++---
 drivers/scsi/qla4xxx/ql4_mbx.c |  3 ---
 drivers/scsi/qla4xxx/ql4_nx.c  |  4 ++++
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index 49032f6..df3fd9b 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -1022,7 +1022,8 @@ void qla4_82xx_interrupt_service_routine(struct scsi_qla_host *ha,
     uint32_t intr_status)
 {
 	/* Process response queue interrupt. */
-	if (intr_status & HSRX_RISC_IOCB_INT)
+	if ((intr_status & HSRX_RISC_IOCB_INT) &&
+	    test_bit(AF_INIT_DONE, &ha->flags))
 		qla4xxx_process_response_queue(ha);
 
 	/* Process mailbox/asynch event interrupt.*/
@@ -1399,6 +1400,7 @@ qla4_8xxx_msix_rsp_q(int irq, void *dev_id)
 {
 	struct scsi_qla_host *ha = dev_id;
 	unsigned long flags;
+	int intr_status;
 	uint32_t ival = 0;
 
 	spin_lock_irqsave(&ha->hardware_lock, flags);
@@ -1412,8 +1414,15 @@ qla4_8xxx_msix_rsp_q(int irq, void *dev_id)
 		qla4xxx_process_response_queue(ha);
 		writel(0, &ha->qla4_83xx_reg->iocb_int_mask);
 	} else {
-		qla4xxx_process_response_queue(ha);
-		writel(0, &ha->qla4_82xx_reg->host_int);
+		intr_status = readl(&ha->qla4_82xx_reg->host_status);
+		if (intr_status & HSRX_RISC_IOCB_INT) {
+			qla4xxx_process_response_queue(ha);
+			writel(0, &ha->qla4_82xx_reg->host_int);
+		} else {
+			ql4_printk(KERN_INFO, ha, "%s: spurious iocb interrupt...\n",
+				   __func__);
+			goto exit_msix_rsp_q;
+		}
 	}
 	ha->isr_count++;
 exit_msix_rsp_q:
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 1d8f485..cc27d7f 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -648,9 +648,6 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha)
 		goto exit_init_fw_cb;
 	}
 
-	/* Initialize request and response queues. */
-	qla4xxx_init_rings(ha);
-
 	/* Fill in the request and response queue information. */
 	init_fw_cb->rqq_consumer_idx = cpu_to_le16(ha->request_out);
 	init_fw_cb->compq_producer_idx = cpu_to_le16(ha->response_in);
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index cbc68f9..bcf3e43 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -3190,6 +3190,10 @@ int qla4_8xxx_load_risc(struct scsi_qla_host *ha)
 
 	retval = qla4_8xxx_device_state_handler(ha);
 
+	/* Initialize request and response queues. */
+	if (retval == QLA_SUCCESS)
+		qla4xxx_init_rings(ha);
+
 	if (retval == QLA_SUCCESS && !test_bit(AF_IRQ_ATTACHED, &ha->flags))
 		retval = qla4xxx_request_irqs(ha);
 
-- 
1.8.2.GIT


  parent reply	other threads:[~2013-12-16 12:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 11:49 [PATCH 0/24] qla4xxx: 5.04.00-k4: Updates for scsi "misc" branch vikas.chaudhary
2013-12-16 11:49 ` [PATCH 01/24] qla4xxx: ISP8xxx: Correct retry of adapter initialization vikas.chaudhary
2013-12-16 11:49 ` [PATCH 02/24] qla4xxx: Print WARN_ONCE() if iSCSI function presence bit removed vikas.chaudhary
2013-12-16 11:49 ` [PATCH 03/24] qla4xxx: Fix comments in code vikas.chaudhary
2013-12-16 11:49 ` [PATCH 04/24] qla4xxx: Use IDC_CTRL bit1 directly instead of AF_83XX_NO_FWDUMP flag vikas.chaudhary
2013-12-16 11:49 ` [PATCH 05/24] qla4xxx: Improve loopback failure messages vikas.chaudhary
2013-12-16 11:49 ` [PATCH 06/24] qla4xxx: Rename ACB_STATE macros with IP_ADDRSTATE macros vikas.chaudhary
2013-12-16 11:49 ` [PATCH 07/24] qla4xxx: Correctly handle msleep_interruptible vikas.chaudhary
2013-12-16 11:49 ` [PATCH 08/24] qla4xxx: Fixed AER reset sequence for ISP83xx/ISP84xx vikas.chaudhary
2013-12-16 11:49 ` [PATCH 09/24] qla4xxx: Return correct error status from func qla4xxx_request_irqs() vikas.chaudhary
2013-12-16 11:49 ` [PATCH 10/24] qla4xxx: Clear DDB index map upon connection close failure vikas.chaudhary
2013-12-16 11:49 ` [PATCH 11/24] qla4xxx: Fix failure of IDC Time Extend mailbox command vikas.chaudhary
2013-12-16 11:49 ` vikas.chaudhary [this message]
2013-12-16 11:49 ` [PATCH 13/24] qla4xxx: Fix pending IO completion in reset path before initiating chip reset vikas.chaudhary
2013-12-16 11:49 ` [PATCH 14/24] qla4xxx: Driver not able to collect minidump for ISP84xx vikas.chaudhary
2013-12-16 11:49 ` [PATCH 15/24] qla4xxx: Reduce rom-lock contention during reset recovery vikas.chaudhary
2013-12-16 11:49 ` [PATCH 16/24] qla4xxx: Fix failure of mbox 0x31 vikas.chaudhary
2014-01-17  8:30   ` Mike Christie
2014-01-17 10:34     ` Vikas Chaudhary
2013-12-16 11:49 ` [PATCH 17/24] qla4xxx: Remove unused code from qla4xxx_set_ifcb() vikas.chaudhary
2013-12-16 11:49 ` [PATCH 18/24] qla4xxx: Updated print for device login, logout path vikas.chaudhary
2013-12-16 11:49 ` [PATCH 19/24] qla4xxx: Update print statements in qla4xxx_mailbox_command() vikas.chaudhary
2013-12-16 11:49 ` [PATCH 20/24] qla4xxx: Update print statements in func qla4xxx_eh_abort() vikas.chaudhary
2013-12-16 11:49 ` [PATCH 21/24] qla4xxx: Update print statements in func qla4xxx_do_dpc() vikas.chaudhary
2013-12-16 11:49 ` [PATCH 22/24] qla4xxx: Handle IPv6 AEN notifications vikas.chaudhary
2013-12-16 11:49 ` [PATCH 23/24] qla4xxx: Fix sparse warnings vikas.chaudhary
2013-12-16 11:49 ` [PATCH 24/24] qla4xxx: Update driver version to 5.04.00-k4 vikas.chaudhary
2014-01-17 18:20 ` [PATCH 0/24] qla4xxx: 5.04.00-k4: Updates for scsi "misc" branch Mike Christie

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=1387194594-29817-13-git-send-email-vikas.chaudhary@qlogic.com \
    --to=vikas.chaudhary@qlogic.com \
    --cc=jbottomley@parallels.com \
    --cc=lalit.chandivade@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=tej.parkash@qlogic.com \
    /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).