The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <stable@xxxxxxxxxxxxxxx>. To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 39d22740712c7563a2e18c08f033deeacdaf66e7 # <resolve conflicts, build, test, etc.> git commit -s git send-email --to '<stable@xxxxxxxxxxxxxxx>' --in-reply-to '2023091354-fantasize-premiere-2530@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: 39d22740712c ("scsi: qla2xxx: Fix session hang in gnl") 31e6cdbe0eae ("scsi: qla2xxx: Implement ref count for SRB") d4523bd6fd5d ("scsi: qla2xxx: Refactor asynchronous command initialization") 2cabf10dbbe3 ("scsi: qla2xxx: Fix hang on NVMe command timeouts") e3d2612f583b ("scsi: qla2xxx: Fix use after free in debug code") 9efea843a906 ("scsi: qla2xxx: edif: Add detection of secure device") dd30706e73b7 ("scsi: qla2xxx: edif: Add key update") fac2807946c1 ("scsi: qla2xxx: edif: Add extraction of auth_els from the wire") 84318a9f01ce ("scsi: qla2xxx: edif: Add send, receive, and accept for auth_els") 7878f22a2e03 ("scsi: qla2xxx: edif: Add getfcinfo and statistic bsgs") 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs") d94d8158e184 ("scsi: qla2xxx: Add heartbeat check") f7a0ed479e66 ("scsi: qla2xxx: Fix crash in PCIe error handling") 2ce35c0821af ("scsi: qla2xxx: Fix use after free in bsg") 5777fef788a5 ("scsi: qla2xxx: Consolidate zio threshold setting for both FCP & NVMe") 960204ecca5e ("scsi: qla2xxx: Simplify if statement") a04658594399 ("scsi: qla2xxx: Wait for ABTS response on I/O timeouts for NVMe") dbf1f53cfd23 ("scsi: qla2xxx: Implementation to get and manage host, target stats and initiator port") 707531bc2626 ("scsi: qla2xxx: If fcport is undergoing deletion complete I/O with retry") 605e74025f95 ("scsi: qla2xxx: Move sess cmd list/lock to driver") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 39d22740712c7563a2e18c08f033deeacdaf66e7 Mon Sep 17 00:00:00 2001 From: Quinn Tran <qutran@xxxxxxxxxxx> Date: Fri, 14 Jul 2023 12:31:00 +0530 Subject: [PATCH] scsi: qla2xxx: Fix session hang in gnl Connection does not resume after a host reset / chip reset. The cause of the blockage is due to the FCF_ASYNC_ACTIVE left on. The gnl command was interrupted by the chip reset. On exiting the command, this flag should be turn off to allow relogin to reoccur. Clear this flag to prevent blockage. Cc: stable@xxxxxxxxxxxxxxx Fixes: 17e64648aa47 ("scsi: qla2xxx: Correct fcport flags handling") Signed-off-by: Quinn Tran <qutran@xxxxxxxxxxx> Signed-off-by: Nilesh Javali <njavali@xxxxxxxxxxx> Link: https://lore.kernel.org/r/20230714070104.40052-7-njavali@xxxxxxxxxxx Reviewed-by: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx> Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 1236acb1fd83..7ac4738fda25 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1141,7 +1141,7 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) u16 *mb; if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) - return rval; + goto done; ql_dbg(ql_dbg_disc, vha, 0x20d9, "Async-gnlist WWPN %8phC \n", fcport->port_name); @@ -1195,8 +1195,9 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) done_free_sp: /* ref: INIT */ kref_put(&sp->cmd_kref, qla2x00_sp_release); + fcport->flags &= ~(FCF_ASYNC_SENT); done: - fcport->flags &= ~(FCF_ASYNC_ACTIVE | FCF_ASYNC_SENT); + fcport->flags &= ~(FCF_ASYNC_ACTIVE); return rval; }