All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nilesh Javali <njavali@marvell.com>
To: <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>,
	<GR-QLogic-Storage-Upstream@marvell.com>,
	<agurumurthy@marvell.com>, <sdeodhar@marvell.com>
Subject: [PATCH v2 05/10] qla2xxx: Fix erroneous link up failure
Date: Fri, 14 Jul 2023 12:30:59 +0530	[thread overview]
Message-ID: <20230714070104.40052-6-njavali@marvell.com> (raw)
In-Reply-To: <20230714070104.40052-1-njavali@marvell.com>

From: Quinn Tran <qutran@marvell.com>

Link up failure occurred where driver fail to see certain
events from FW indicating link up (AEN 8011) and fabric login completion
(AEN 8014). Without these 2 events driver would not proceed forward
to scan the fabric. The cause of this is due to delay in the receive
of interrupt for Mailbox 60 that cause qla to set the fw_started flag late.
The late setting of this flag cause other interrupts to be dropped.
These dropped interrupts happen to be the link up (AEN 8011) and
fabric login completion (AEN 8014).

Set fw_started flag early to prevent interrupts being dropped.

Cc: stable@vger.kernel.org
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 3 ++-
 drivers/scsi/qla2xxx/qla_isr.c  | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 3b32e65d6260..725806ca9572 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -4815,15 +4815,16 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
 	if (ha->flags.edif_enabled)
 		mid_init_cb->init_cb.frame_payload_size = cpu_to_le16(ELS_MAX_PAYLOAD);
 
+	QLA_FW_STARTED(ha);
 	rval = qla2x00_init_firmware(vha, ha->init_cb_size);
 next_check:
 	if (rval) {
+		QLA_FW_STOPPED(ha);
 		ql_log(ql_log_fatal, vha, 0x00d2,
 		    "Init Firmware **** FAILED ****.\n");
 	} else {
 		ql_dbg(ql_dbg_init, vha, 0x00d3,
 		    "Init Firmware -- success.\n");
-		QLA_FW_STARTED(ha);
 		vha->u_ql2xexchoffld = vha->u_ql2xiniexchg = 0;
 	}
 
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index a07c010b0843..eb8480a0d7b0 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -1121,8 +1121,12 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
 	unsigned long	flags;
 	fc_port_t	*fcport = NULL;
 
-	if (!vha->hw->flags.fw_started)
+	if (!vha->hw->flags.fw_started) {
+		ql_log(ql_log_warn, vha, 0x50ff,
+		    "Dropping AEN - %04x %04x %04x %04x.\n",
+		    mb[0], mb[1], mb[2], mb[3]);
 		return;
+	}
 
 	/* Setup to process RIO completion. */
 	handle_cnt = 0;
-- 
2.23.1


  parent reply	other threads:[~2023-07-14  7:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14  7:00 [PATCH v2 00/10] qla2xxx driver bug fixes Nilesh Javali
2023-07-14  7:00 ` [PATCH v2 01/10] qla2xxx: Fix deletion race condition Nilesh Javali
2023-07-14  7:00 ` [PATCH v2 02/10] qla2xxx: Adjust iocb resource on qpair create Nilesh Javali
2023-07-14  7:00 ` [PATCH v2 03/10] qla2xxx: Limit TMF to 8 per function Nilesh Javali
2023-07-14  7:00 ` [PATCH v2 04/10] qla2xxx: Fix command flush during TMF Nilesh Javali
2023-07-14  7:00 ` Nilesh Javali [this message]
2023-07-14  7:01 ` [PATCH v2 06/10] qla2xxx: Fix session hang in gnl Nilesh Javali
2023-07-14  7:01 ` [PATCH v2 07/10] qla2xxx: Turn off noisy message log Nilesh Javali
2023-07-14  7:01 ` [PATCH v2 08/10] qla2xxx: Fix TMF leak through Nilesh Javali
2023-07-14  7:01 ` [PATCH v2 09/10] qla2xxx: fix inconsistent TMF timeout Nilesh Javali
2023-07-14  7:01 ` [PATCH v2 10/10] qla2xxx: Update version to 10.02.08.500-k Nilesh Javali
2023-07-23 20:29 ` [PATCH v2 00/10] qla2xxx driver bug fixes Martin K. Petersen
2023-07-26  2:04 ` Martin K. Petersen

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=20230714070104.40052-6-njavali@marvell.com \
    --to=njavali@marvell.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=agurumurthy@marvell.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sdeodhar@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.