linux/drivers/scsi/qla2xxx
Dmitry Bogdanov cd05e1a61a scsi: target: qla2xxx: Wait for stop_phase1 at WWN removal
[ Upstream commit 2ef7665dfd88830f15415ba007c7c9a46be7acd8 ]

Target de-configuration panics at high CPU load because TPGT and WWPN can
be removed on separate threads.

TPGT removal requests a reset HBA on a separate thread and waits for reset
complete (phase1). Due to high CPU load that HBA reset can be delayed for
some time.

WWPN removal does qlt_stop_phase2(). There it is believed that phase1 has
already completed and thus tgt.tgt_ops is subsequently cleared. However,
tgt.tgt_ops is needed to process incoming traffic and therefore this will
cause one of the following panics:

NIP qlt_reset+0x7c/0x220 [qla2xxx]
LR  qlt_reset+0x68/0x220 [qla2xxx]
Call Trace:
0xc000003ffff63a78 (unreliable)
qlt_handle_imm_notify+0x800/0x10c0 [qla2xxx]
qlt_24xx_atio_pkt+0x208/0x590 [qla2xxx]
qlt_24xx_process_atio_queue+0x33c/0x7a0 [qla2xxx]
qla83xx_msix_atio_q+0x54/0x90 [qla2xxx]

or

NIP qlt_24xx_handle_abts+0xd0/0x2a0 [qla2xxx]
LR  qlt_24xx_handle_abts+0xb4/0x2a0 [qla2xxx]
Call Trace:
qlt_24xx_handle_abts+0x90/0x2a0 [qla2xxx] (unreliable)
qlt_24xx_process_atio_queue+0x500/0x7a0 [qla2xxx]
qla83xx_msix_atio_q+0x54/0x90 [qla2xxx]

or

NIP qlt_create_sess+0x90/0x4e0 [qla2xxx]
LR  qla24xx_do_nack_work+0xa8/0x180 [qla2xxx]
Call Trace:
0xc0000000348fba30 (unreliable)
qla24xx_do_nack_work+0xa8/0x180 [qla2xxx]
qla2x00_do_work+0x674/0xbf0 [qla2xxx]
qla2x00_iocb_work_fn

The patch fixes the issue by serializing qlt_stop_phase1() and
qlt_stop_phase2() functions to make WWPN removal wait for phase1
completion.

Link: https://lore.kernel.org/r/20210415203554.27890-1-d.bogdanov@yadro.com
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-16 11:59:36 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
qla_attr.c scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats() 2021-05-11 14:04:09 +02:00
qla_bsg.c scsi: qla2xxx: Fix use after free in bsg 2021-05-11 14:04:10 +02:00
qla_bsg.h
qla_dbg.c scsi: qla2xxx: Add a shadow variable to hold disc_state history of fcport 2021-04-21 12:56:12 +02: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 2021-04-21 12:56:12 +02: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: Dual FCP-NVMe target port support 2021-04-21 12:56:12 +02:00
qla_gbl.h scsi: qla2xxx: Fix fabric scan hang 2021-04-21 12:56:12 +02:00
qla_gs.c scsi: qla2xxx: Add a shadow variable to hold disc_state history of fcport 2021-04-21 12:56:12 +02:00
qla_init.c scsi: qla2xxx: Fix fabric scan hang 2021-04-21 12:56:12 +02:00
qla_inline.h scsi: qla2xxx: Add a shadow variable to hold disc_state history of fcport 2021-04-21 12:56:12 +02:00
qla_iocb.c scsi: qla2xxx: Fix fabric scan hang 2021-04-21 12:56:12 +02:00
qla_isr.c scsi: qla2xxx: Fix unbound NVME response length 2020-02-11 04:35:32 -08:00
qla_mbx.c scsi: qla2xxx: Dual FCP-NVMe target port support 2021-04-21 12:56:12 +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 scsi: qla2xxx: Fix wrong return value in qla_nvme_register_hba() 2020-10-29 09:57:36 +01:00
qla_nvme.h scsi: qla2xxx: Modify NVMe include directives 2019-08-12 21:34:08 -04:00
qla_nx.c scsi: qla2xxx: Fix error return code in qla82xx_write_flash_dword() 2021-05-26 12:05:15 +02: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 crash in qla2xxx_mqueuecommand() 2021-05-11 14:04:02 +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: target: qla2xxx: Wait for stop_phase1 at WWN removal 2021-06-16 11:59:36 +02:00
qla_target.h scsi: qla2xxx: Fix broken #endif placement 2021-04-07 14:47:40 +02:00
qla_tmpl.c scsi: qla2xxx: Fix crash during driver load on big endian machines 2020-12-30 11:51:43 +01:00
qla_tmpl.h scsi: qla2xxx: Fix crash during driver load on big endian machines 2020-12-30 11:51:43 +01: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: Revert "qla2xxx: Make sure that aborted commands are freed" 2021-03-30 14:35:29 +02:00
tcm_qla2xxx.h