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 01/12] qla2xxx: edif: Fix stale session
Date: Mon, 16 Aug 2021 22:13:04 -0700	[thread overview]
Message-ID: <20210817051315.2477-2-njavali@marvell.com> (raw)
In-Reply-To: <20210817051315.2477-1-njavali@marvell.com>

From: Quinn Tran <qutran@marvell.com>

FW indicates session has been torn down via UPDATE SA IOCB
or ELS Passthrough IOCB, driver need to also tear down the
session.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_edif.c | 8 ++++++++
 drivers/scsi/qla2xxx/qla_edif.h | 2 ++
 drivers/scsi/qla2xxx/qla_isr.c  | 1 +
 3 files changed, 11 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
index 2db954a7aaf1..7d16955383dd 100644
--- a/drivers/scsi/qla2xxx/qla_edif.c
+++ b/drivers/scsi/qla2xxx/qla_edif.c
@@ -2674,6 +2674,14 @@ qla28xx_sa_update_iocb_entry(scsi_qla_host_t *v, struct req_que *req,
 		    __func__, pkt->sa_index, nport_handle);
 		qla_edif_sadb_delete_sa_index(sp->fcport, nport_handle,
 		    le16_to_cpu(pkt->sa_index));
+		switch (le16_to_cpu(pkt->u.comp_sts)) {
+		case CS_PORT_EDIF_UNAVAIL:
+		case CS_PORT_EDIF_LOGOUT:
+			qlt_schedule_sess_for_deletion(sp->fcport);
+			break;
+		default:
+			break;
+		}
 	}
 
 	sp->done(sp, 0);
diff --git a/drivers/scsi/qla2xxx/qla_edif.h b/drivers/scsi/qla2xxx/qla_edif.h
index 1cff02e5bd43..88495df9a3c2 100644
--- a/drivers/scsi/qla2xxx/qla_edif.h
+++ b/drivers/scsi/qla2xxx/qla_edif.h
@@ -63,6 +63,8 @@ struct sa_update_28xx {
 	union {
 		__le16 nport_handle;  /* in: N_PORT handle. */
 		__le16 comp_sts;              /* out: completion status */
+#define CS_PORT_EDIF_UNAVAIL	0x28
+#define CS_PORT_EDIF_LOGOUT	0x29
 #define CS_PORT_EDIF_SUPP_NOT_RDY 0x64
 #define CS_PORT_EDIF_INV_REQ      0x66
 	} u;
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index cb02dade85f8..c2fc75a9ca61 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2235,6 +2235,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *v, struct req_que *req,
 			} else if (comp_status == CS_PORT_LOGGED_OUT) {
 				els->u.els_plogi.len = 0;
 				res = DID_IMM_RETRY << 16;
+				qlt_schedule_sess_for_deletion(sp->fcport);
 			} else {
 				els->u.els_plogi.len = 0;
 				res = DID_ERROR << 16;
-- 
2.23.1


  reply	other threads:[~2021-08-17  5:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17  5:13 [PATCH 00/12] qla2xxx driver bug fixes Nilesh Javali
2021-08-17  5:13 ` Nilesh Javali [this message]
2021-08-17  5:13 ` [PATCH 02/12] qla2xxx: edif: reject AUTH ELS on session down Nilesh Javali
2021-08-17  5:13 ` [PATCH 03/12] qla2xxx: edif: fix edif enable flag Nilesh Javali
2021-08-17  5:13 ` [PATCH 04/12] qla2xxx: Fix hang during NVME session tear down Nilesh Javali
2021-08-17  5:13 ` [PATCH 05/12] qla2xxx: edif: add N2N support for EDIF Nilesh Javali
2021-08-17  5:13 ` [PATCH 06/12] qla2xxx: edif: do secure plogi when auth app is present Nilesh Javali
2021-08-17  5:13 ` [PATCH 07/12] qla2xxx: fix NVME | FCP personality change Nilesh Javali
2021-08-17  5:13 ` [PATCH 08/12] qla2xxx: Fix hang on NVME command timeouts Nilesh Javali
2021-08-17  5:13 ` [PATCH 09/12] qla2xxx: fix NVME retry Nilesh Javali
2021-08-17  5:13 ` [PATCH 10/12] qla2xxx: fix NVME session down detection Nilesh Javali
2021-08-17  5:13 ` [PATCH 11/12] qla2xxx: edif: fix returnvar.cocci warnings Nilesh Javali
2021-08-17  5:13 ` [PATCH 12/12] qla2xxx: Update version to 10.02.06.200-k Nilesh Javali
2021-08-24  3:05 ` [PATCH 00/12] qla2xxx driver bug fixes Martin K. Petersen
2021-08-28  2:32 ` 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=20210817051315.2477-2-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.