This is a note to let you know that I've just added the patch titled scsi: qla2xxx: Fix losing FCP-2 targets on long port disable with I/Os to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: scsi-qla2xxx-fix-losing-fcp-2-targets-on-long-port-disable-with-i-os.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 2416ccd3815ba1613e10a6da0a24ef21acfe5633 Mon Sep 17 00:00:00 2001 From: Arun Easi <aeasi@xxxxxxxxxxx> Date: Wed, 15 Jun 2022 22:35:06 -0700 Subject: scsi: qla2xxx: Fix losing FCP-2 targets on long port disable with I/Os From: Arun Easi <aeasi@xxxxxxxxxxx> commit 2416ccd3815ba1613e10a6da0a24ef21acfe5633 upstream. FCP-2 devices were not coming back online once they were lost, login retries exhausted, and then came back up. Fix this by accepting RSCN when the device is not online. Link: https://lore.kernel.org/r/20220616053508.27186-10-njavali@xxxxxxxxxxx Fixes: 44c57f205876 ("scsi: qla2xxx: Changes to support FCP2 Target") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Arun Easi <aeasi@xxxxxxxxxxx> Signed-off-by: Nilesh Javali <njavali@xxxxxxxxxxx> Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/scsi/qla2xxx/qla_init.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1836,7 +1836,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t case RSCN_PORT_ADDR: fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1); if (fcport) { - if (fcport->flags & FCF_FCP2_DEVICE) { + if (fcport->flags & FCF_FCP2_DEVICE && + atomic_read(&fcport->state) == FCS_ONLINE) { ql_dbg(ql_dbg_disc, vha, 0x2115, "Delaying session delete for FCP2 portid=%06x %8phC ", fcport->d_id.b24, fcport->port_name); @@ -1868,7 +1869,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t break; case RSCN_AREA_ADDR: list_for_each_entry(fcport, &vha->vp_fcports, list) { - if (fcport->flags & FCF_FCP2_DEVICE) + if (fcport->flags & FCF_FCP2_DEVICE && + atomic_read(&fcport->state) == FCS_ONLINE) continue; if ((ea->id.b24 & 0xffff00) == (fcport->d_id.b24 & 0xffff00)) { @@ -1879,7 +1881,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t break; case RSCN_DOM_ADDR: list_for_each_entry(fcport, &vha->vp_fcports, list) { - if (fcport->flags & FCF_FCP2_DEVICE) + if (fcport->flags & FCF_FCP2_DEVICE && + atomic_read(&fcport->state) == FCS_ONLINE) continue; if ((ea->id.b24 & 0xff0000) == (fcport->d_id.b24 & 0xff0000)) { @@ -1891,7 +1894,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t case RSCN_FAB_ADDR: default: list_for_each_entry(fcport, &vha->vp_fcports, list) { - if (fcport->flags & FCF_FCP2_DEVICE) + if (fcport->flags & FCF_FCP2_DEVICE && + atomic_read(&fcport->state) == FCS_ONLINE) continue; fcport->scan_needed = 1; Patches currently in stable-queue which might be from aeasi@xxxxxxxxxxx are queue-5.15/scsi-qla2xxx-fix-discovery-issues-in-fc-al-topology.patch queue-5.15/scsi-qla2xxx-fix-crash-due-to-stale-srb-access-around-i-o-timeouts.patch queue-5.15/scsi-qla2xxx-fix-excessive-i-o-error-messages-by-default.patch queue-5.15/scsi-qla2xxx-fix-losing-fcp-2-targets-during-port-perturbation-tests.patch queue-5.15/scsi-qla2xxx-fix-losing-target-when-it-reappears-during-delete.patch queue-5.15/scsi-qla2xxx-fix-losing-fcp-2-targets-on-long-port-disable-with-i-os.patch