linux/drivers/scsi/qla2xxx
Roman Bolshakov d3a251b847 scsi: qla2xxx: Keep initiator ports after RSCN
commit 632f24f09d upstream.

The driver performs SCR (state change registration) in all modes including
pure target mode.

For each RSCN, scan_needed flag is set in qla2x00_handle_rscn() for the
port mentioned in the RSCN and fabric rescan is scheduled. During the
rescan, GNN_FT handler, qla24xx_async_gnnft_done() deletes session of the
port that caused the RSCN.

In target mode, the session deletion has an impact on ATIO handler,
qlt_24xx_atio_pkt(). Target responds with SAM STATUS BUSY to I/O incoming
from the deleted session. qlt_handle_cmd_for_atio() and
qlt_handle_task_mgmt() return -EFAULT if they are not able to find session
of the command/TMF, and that results in invocation of qlt_send_busy():

  qlt_24xx_atio_pkt_all_vps: qla_target(0): type 6 ox_id 0014
  qla_target(0): Unable to send command to target, sending BUSY status

Such response causes command timeout on the initiator. Error handler thread
on the initiator will be spawned to abort the commands:

  scsi 23:0:0:0: tag#0 abort scheduled
  scsi 23:0:0:0: tag#0 aborting command
  qla2xxx [0000:af:00.0]-188c:23: Entered qla24xx_abort_command.
  qla2xxx [0000:af:00.0]-801c:23: Abort command issued nexus=23:0:0 -- 0 2003.

Command abort is rejected by target and fails (2003), error handler then
tries to perform DEVICE RESET and TARGET RESET but they're also doomed to
fail because TMFs are ignored for the deleted sessions.

Then initiator makes BUS RESET that resets the link via
qla2x00_full_login_lip(). BUS RESET succeeds and brings initiator port up,
SAN switch detects that and sends RSCN to the target port and it fails
again the same way as described above. It never goes out of the loop.

The change breaks the RSCN loop by keeping initiator sessions mentioned in
RSCN payload in all modes, including dual and pure target mode.

Link: https://lore.kernel.org/r/20200605144435.27023-1-r.bolshakov@yadro.com
Fixes: 2037ce49d3 ("scsi: qla2xxx: Fix stale session")
Cc: Quinn Tran <qutran@marvell.com>
Cc: Arun Easi <aeasi@marvell.com>
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Daniel Wagner <dwagner@suse.de>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: stable@vger.kernel.org # v5.4+
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Shyam Sundar <ssundar@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:50 -04:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
qla_attr.c scsi: qla2xxx: Do not log message when reading port speed via sysfs 2020-05-27 17:46:40 +02:00
qla_bsg.c scsi: qla2xxx: Correctly retrieve and interpret active flash region 2019-12-21 11:05:09 +01:00
qla_bsg.h scsi: qla2xxx: Add 28xx flash primary/secondary status/image mechanism 2019-03-19 12:22:55 -04:00
qla_dbg.c scsi: qla2xxx: Fix unbound NVME response length 2020-02-11 04:35:32 -08:00
qla_dbg.h scsi: qla2xxx: Fix unbound NVME response length 2020-02-11 04:35:32 -08:00
qla_def.h scsi: qla2xxx: Fix stuck login session using prli_pend_timer 2020-02-11 04:35:27 -08:00
qla_devtbl.h
qla_dfs.c scsi: qla2xxx: Reduce the number of casts in GID list code 2019-08-12 21:34:05 -04:00
qla_dsd.h scsi: qla2xxx: Include the <asm/unaligned.h> header file from qla_dsd.h 2019-08-12 21:34:04 -04:00
qla_fw.h scsi: qla2xxx: Added support for MPI and PEP regions for ISP28XX 2019-12-21 11:05:07 +01:00
qla_gbl.h scsi: qla2xxx: Introduce qla2x00_els_dcmd2_free() 2019-08-12 21:34:09 -04:00
qla_gs.c scsi: qla2xxx: Keep initiator ports after RSCN 2020-06-30 15:36:50 -04:00
qla_init.c scsi: qla2xxx: Fix stuck login session using prli_pend_timer 2020-02-11 04:35:27 -08:00
qla_inline.h scsi: qla2xxx: Introduce the function qla2xxx_init_sp() 2019-08-12 21:34:08 -04:00
qla_iocb.c scsi: qla2xxx: Fix PLOGI payload and ELS IOCB dump length 2020-01-09 10:19:45 +01:00
qla_isr.c scsi: qla2xxx: Fix unbound NVME response length 2020-02-11 04:35:32 -08:00
qla_mbx.c scsi: qla2xxx: Fix hang when issuing nvme disconnect-all in NPIV 2020-05-27 17:46:28 +02:00
qla_mid.c scsi: qla2xxx: Fix SRB leak on switch command timeout 2019-12-17 19:56:44 +01:00
qla_mr.c scsi: qla2xxx: Complain if sp->done() is not called from the completion path 2019-08-12 21:34:09 -04:00
qla_mr.h scsi: qla2xxx: Introduce the dsd32 and dsd64 data structures 2019-04-29 17:24:51 -04:00
qla_nvme.c nvme-fc: Revert "add module to ops template to allow module references" 2020-04-17 10:50:10 +02:00
qla_nvme.h scsi: qla2xxx: Modify NVMe include directives 2019-08-12 21:34:08 -04:00
qla_nx.c scsi: qla2xxx: Fix the endianness of the qla82xx_get_fw_size() return type 2020-02-11 04:35:44 -08:00
qla_nx.h scsi: qla2xxx: Improve Linux kernel coding style conformance 2019-08-12 21:34:04 -04:00
qla_nx2.c scsi: qla2xxx: Suppress a Coveritiy complaint about integer overflow 2019-08-12 21:34:07 -04:00
qla_nx2.h
qla_os.c scsi: qla2xxx: Fix warning after FC target reset 2020-06-24 17:50:24 +02:00
qla_settings.h
qla_sup.c scsi: qla2xxx: Fix incorrect SFUB length used for Secure Flash Update MB Cmd 2019-12-21 11:05:10 +01:00
qla_target.c scsi: qla2xxx: Fix stuck login session using prli_pend_timer 2020-02-11 04:35:27 -08:00
qla_target.h scsi: qla2xxx: Introduce the be_id_t and le_id_t data types for FC src/dst IDs 2019-08-12 21:34:07 -04:00
qla_tmpl.c scsi: qla2xxx: Complain if a soft reset fails 2019-08-12 21:34:07 -04:00
qla_tmpl.h scsi: qla2xxx: Correction and improvement to fwdt processing 2019-03-19 12:22:55 -04:00
qla_version.h scsi: qla2xxx: Update driver version to 10.01.00.19-k 2019-09-07 15:38:55 -04:00
tcm_qla2xxx.c scsi: qla2xxx: Fix issue with adapter's stopping state 2020-06-24 17:50:12 +02:00
tcm_qla2xxx.h