diff mbox series

[05/10] qla2xxx: Fix erroneous link up failure

Message ID 20230712090535.34894-6-njavali@marvell.com (mailing list archive)
State Superseded
Headers show
Series qla2xxx driver bug fixes | expand

Commit Message

Nilesh Javali July 12, 2023, 9:05 a.m. UTC
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>
---
 drivers/scsi/qla2xxx/qla_init.c | 3 ++-
 drivers/scsi/qla2xxx/qla_isr.c  | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

Comments

Himanshu Madhani July 13, 2023, 7:27 p.m. UTC | #1
> On Jul 12, 2023, at 2:05 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> 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>
> ---
> 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
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
diff mbox series

Patch

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;