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>
Subject: [PATCH v2 07/13] qla2xxx: Fix hang due to session stuck
Date: Thu, 10 Mar 2022 01:25:58 -0800	[thread overview]
Message-ID: <20220310092604.22950-8-njavali@marvell.com> (raw)
In-Reply-To: <20220310092604.22950-1-njavali@marvell.com>

From: Quinn Tran <qutran@marvell.com>

User experience device lost. The log shows Get port data base
command was queued up, failed, and requeued again. Every time
it is requeued, it set the FCF_ASYNC_ACTIVE. This prevents any
recovery code from occurring because driver thinks a recovery is in
progress for this session. In essence, this session is hung.
The reason it gets into this place is the session deletion got
in front of this call due to link perturbation.

Break the requeue cycle and exit.
The session deletion code will trigger a session relogin.

Cc: stable@vger.kernel.org
Fixes: 726b85487067 ("qla2xxx: Add framework for async fabric discovery")
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_def.h  |  4 ++++
 drivers/scsi/qla2xxx/qla_init.c | 19 +++++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 47d7fa1c7ae8..25b884701267 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -5437,4 +5437,8 @@ struct ql_vnd_tgt_stats_resp {
 #include "qla_gbl.h"
 #include "qla_dbg.h"
 #include "qla_inline.h"
+
+#define IS_SESSION_DELETED(_fcport) (_fcport->disc_state == DSC_DELETE_PEND || \
+				      _fcport->disc_state == DSC_DELETED)
+
 #endif
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 6ffe44b805b6..3f05e87ac2d6 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -575,6 +575,14 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport,
 	struct srb_iocb *lio;
 	int rval = QLA_FUNCTION_FAILED;
 
+	if (IS_SESSION_DELETED(fcport)) {
+		ql_log(ql_log_warn, vha, 0xffff,
+		       "%s: %8phC is being delete - not sending command.\n",
+		       __func__, fcport->port_name);
+		fcport->flags &= ~FCF_ASYNC_ACTIVE;
+		return rval;
+	}
+
 	if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT))
 		return rval;
 
@@ -1338,8 +1346,15 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt)
 	struct port_database_24xx *pd;
 	struct qla_hw_data *ha = vha->hw;
 
-	if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT) ||
-	    fcport->loop_id == FC_NO_LOOP_ID) {
+	if (IS_SESSION_DELETED(fcport)) {
+		ql_log(ql_log_warn, vha, 0xffff,
+		       "%s: %8phC is being delete - not sending command.\n",
+		       __func__, fcport->port_name);
+		fcport->flags &= ~FCF_ASYNC_ACTIVE;
+		return rval;
+	}
+
+	if (!vha->flags.online || fcport->flags & FCF_ASYNC_SENT) {
 		ql_log(ql_log_warn, vha, 0xffff,
 		    "%s: %8phC online %d flags %x - not sending command.\n",
 		    __func__, fcport->port_name, vha->flags.online, fcport->flags);
-- 
2.19.0.rc0


  parent reply	other threads:[~2022-03-10  9:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10  9:25 [PATCH v2 00/13] qla2xxx driver fixes Nilesh Javali
2022-03-10  9:25 ` [PATCH v2 01/13] qla2xxx: Fix incorrect reporting of task management failure Nilesh Javali
2022-03-10  9:25 ` [PATCH v2 02/13] qla2xxx: Fix disk failure to rediscover Nilesh Javali
2022-03-10  9:25 ` [PATCH v2 03/13] qla2xxx: Fix loss of NVME namespaces after driver reload test Nilesh Javali
2022-03-10  9:25 ` [PATCH v2 04/13] qla2xxx: Fix missed DMA unmap for NVME ls requests Nilesh Javali
2022-03-10  9:25 ` [PATCH v2 05/13] qla2xxx: Fix crash during module load unload test Nilesh Javali
2022-03-10  9:25 ` [PATCH v2 06/13] qla2xxx: fix n2n inconsistent plogi Nilesh Javali
2022-03-10  9:25 ` Nilesh Javali [this message]
2022-03-10  9:25 ` [PATCH v2 08/13] qla2xxx: Fix laggy FC remote port session recovery Nilesh Javali
2022-03-10  9:26 ` [PATCH v2 09/13] qla2xxx: reduce false trigger to login Nilesh Javali
2022-03-10  9:26 ` [PATCH v2 10/13] qla2xxx: Fix stuck session of prli reject Nilesh Javali
2022-03-10  9:26 ` [PATCH v2 11/13] qla2xxx: Use correct feature type field during rffid processing Nilesh Javali
2022-03-10  9:26 ` [PATCH v2 12/13] qla2xxx: Increase max limit of ql2xnvme_queues Nilesh Javali
2022-03-10  9:26 ` [PATCH v2 13/13] qla2xxx: Update version to 10.02.07.400-k Nilesh Javali
2022-03-15  4:29 ` [PATCH v2 00/13] qla2xxx driver fixes Martin K. Petersen
2022-03-19  3:57 ` 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=20220310092604.22950-8-njavali@marvell.com \
    --to=njavali@marvell.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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.