linux/drivers/scsi/qla2xxx
Roman Bolshakov 632f24f09d scsi: qla2xxx: Keep initiator ports after RSCN
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>
2020-06-23 23:49:55 -04:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile
qla_attr.c SCSI misc on 20200605 2020-06-05 15:11:50 -07:00
qla_bsg.c scsi: qla2xxx: Fix endianness annotations in source files 2020-05-19 21:43:28 -04: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 misc on 20200605 2020-06-05 15:11:50 -07:00
qla_dbg.h scsi: qla2xxx: Fix endianness annotations in header files 2020-05-19 21:43:24 -04:00
qla_def.h scsi: qla2xxx: Fix endianness annotations in header files 2020-05-19 21:43:24 -04:00
qla_devtbl.h
qla_dfs.c scsi: qla2xxx: fix FW resource count values 2020-02-28 20:32:31 -05: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: Fix endianness annotations in header files 2020-05-19 21:43:24 -04:00
qla_gbl.h scsi: qla2xxx: Simplify the functions for dumping firmware 2020-05-19 21:43:04 -04:00
qla_gs.c scsi: qla2xxx: Keep initiator ports after RSCN 2020-06-23 23:49:55 -04:00
qla_init.c SCSI misc on 20200605 2020-06-05 15:11:50 -07:00
qla_inline.h scsi: qla2xxx: Fix endianness annotations in header files 2020-05-19 21:43:24 -04:00
qla_iocb.c scsi: qla2xxx: Remove return value from qla_nvme_ls() 2020-05-26 15:48:33 -04:00
qla_isr.c SCSI misc on 20200605 2020-06-05 15:11:50 -07:00
qla_mbx.c SCSI misc on 20200605 2020-06-05 15:11:50 -07:00
qla_mid.c scsi: qla2xxx: Cast explicitly to uint16_t / uint32_t 2020-05-19 21:43:19 -04:00
qla_mr.c scsi: qla2xxx: Fix endianness annotations in source files 2020-05-19 21:43:28 -04:00
qla_mr.h scsi: qla2xxx: Fix endianness annotations in header files 2020-05-19 21:43:24 -04:00
qla_nvme.c scsi: qla2xxx: Set NVMe status code for failed NVMe FCP request 2020-06-23 23:48:26 -04:00
qla_nvme.h scsi: qla2xxx: Fix endianness annotations in header files 2020-05-19 21:43:24 -04:00
qla_nx2.c scsi: qla2xxx: Cast explicitly to uint16_t / uint32_t 2020-05-19 21:43:19 -04:00
qla_nx2.h scsi: qla2xxx: Remove unused symbols 2018-02-12 11:43:24 -05:00
qla_nx.c scsi: qla2xxx: Remove an unused function 2020-05-26 15:47:18 -04:00
qla_nx.h scsi: qla2xxx: Fix endianness annotations in header files 2020-05-19 21:43:24 -04:00
qla_os.c SCSI misc on 20200605 2020-06-05 15:11:50 -07:00
qla_settings.h
qla_sup.c scsi: qla2xxx: Fix endianness annotations in source files 2020-05-19 21:43:28 -04:00
qla_target.c scsi: qla2xxx: Fix endianness annotations in source files 2020-05-19 21:43:28 -04:00
qla_target.h scsi: qla2xxx: Fix endianness annotations in header files 2020-05-19 21:43:24 -04:00
qla_tmpl.c scsi: qla2xxx: Fix endianness annotations in source files 2020-05-19 21:43:28 -04:00
qla_tmpl.h scsi: qla2xxx: Fix endianness annotations in header files 2020-05-19 21:43:24 -04:00
qla_version.h scsi: qla2xxx: Update driver version to 10.01.00.25-k 2020-02-28 20:32:37 -05:00
tcm_qla2xxx.c scsi: qla2xxx: Add more BUILD_BUG_ON() statements 2020-05-19 21:43:05 -04:00
tcm_qla2xxx.h scsi: qla2xxx: deadlock by configfs_depend_item 2018-12-19 21:26:38 -05:00