android_kernel_xiaomi_sm8450/drivers/scsi/qla2xxx
Dmitry Bogdanov bbb48789b6 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 12:01:37 +02:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile
qla_attr.c scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats() 2021-05-11 14:47:25 +02:00
qla_bsg.c scsi: qla2xxx: Fix use after free in bsg 2021-05-11 14:47:26 +02:00
qla_bsg.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_dbg.c scsi: qla2xxx: Fix mailbox Ch erroneous error 2021-03-04 11:37:18 +01:00
qla_dbg.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_def.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_devtbl.h
qla_dfs.c SCSI misc on 20201023 2020-10-23 16:19:02 -07:00
qla_dsd.h
qla_fw.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_gbl.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_gs.c SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_init.c scsi: qla2xxx: Prevent PRLI in target mode 2021-05-19 10:13:04 +02:00
qla_inline.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_iocb.c SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_isr.c SCSI misc on 20201023 2020-10-23 16:19:02 -07:00
qla_mbx.c scsi: qla2xxx: Fix mailbox Ch erroneous error 2021-03-04 11:37:18 +01:00
qla_mid.c SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_mr.c scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_mr.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_nvme.c scsi: qla2xxx: Return EBUSY on fcport deletion 2020-10-26 16:12:04 -04:00
qla_nvme.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_nx2.c SCSI misc on 20201023 2020-10-23 16:19:02 -07:00
qla_nx2.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_nx.c scsi: qla2xxx: Fix error return code in qla82xx_write_flash_dword() 2021-05-26 12:06:48 +02:00
qla_nx.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_os.c scsi: qla2xxx: Fix crash in qla2xxx_mqueuecommand() 2021-05-11 14:47:13 +02:00
qla_settings.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_sup.c scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_target.c scsi: target: qla2xxx: Wait for stop_phase1 at WWN removal 2021-06-16 12:01:37 +02:00
qla_target.h scsi: qla2xxx: Fix broken #endif placement 2021-04-07 15:00:05 +02:00
qla_tmpl.c scsi: qla2xxx: Fix crash during driver load on big endian machines 2020-12-30 11:54:23 +01:00
qla_tmpl.h scsi: qla2xxx: Fix crash during driver load on big endian machines 2020-12-30 11:54:23 +01:00
qla_version.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
tcm_qla2xxx.c scsi: Revert "qla2xxx: Make sure that aborted commands are freed" 2021-03-30 14:32:07 +02:00
tcm_qla2xxx.h