linux/drivers/scsi/qla2xxx
Quinn Tran d3affdeb40 scsi: qla2xxx: Synchronize the IOCB count to be in order
A system hang was observed with the following call trace:

BUG: kernel NULL pointer dereference, address: 0000000000000000
PGD 0 P4D 0
Oops: 0000 [#1] PREEMPT SMP NOPTI
CPU: 15 PID: 86747 Comm: nvme Kdump: loaded Not tainted 6.2.0+ #1
Hardware name: Dell Inc. PowerEdge R6515/04F3CJ, BIOS 2.7.3 03/31/2022
RIP: 0010:__wake_up_common+0x55/0x190
Code: 41 f6 01 04 0f 85 b2 00 00 00 48 8b 43 08 4c 8d
      40 e8 48 8d 43 08 48 89 04 24 48 89 c6\
      49 8d 40 18 48 39 c6 0f 84 e9 00 00 00 <49> 8b 40 18 89 6c 24 14 31
      ed 4c 8d 60 e8 41 8b 18 f6 c3 04 75 5d
RSP: 0018:ffffb05a82afbba0 EFLAGS: 00010082
RAX: 0000000000000000 RBX: ffff8f9b83a00018 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffff8f9b83a00020 RDI: ffff8f9b83a00018
RBP: 0000000000000001 R08: ffffffffffffffe8 R09: ffffb05a82afbbf8
R10: 70735f7472617473 R11: 5f30307832616c71 R12: 0000000000000001
R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000
FS:  00007f815cf4c740(0000) GS:ffff8f9eeed80000(0000)
	knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000010633a000 CR4: 0000000000350ee0
Call Trace:
    <TASK>
    __wake_up_common_lock+0x83/0xd0
    qla_nvme_ls_req+0x21b/0x2b0 [qla2xxx]
    __nvme_fc_send_ls_req+0x1b5/0x350 [nvme_fc]
    nvme_fc_xmt_disconnect_assoc+0xca/0x110 [nvme_fc]
    nvme_fc_delete_association+0x1bf/0x220 [nvme_fc]
    ? nvme_remove_namespaces+0x9f/0x140 [nvme_core]
    nvme_do_delete_ctrl+0x5b/0xa0 [nvme_core]
    nvme_sysfs_delete+0x5f/0x70 [nvme_core]
    kernfs_fop_write_iter+0x12b/0x1c0
    vfs_write+0x2a3/0x3b0
    ksys_write+0x5f/0xe0
    do_syscall_64+0x5c/0x90
    ? syscall_exit_work+0x103/0x130
    ? syscall_exit_to_user_mode+0x12/0x30
    ? do_syscall_64+0x69/0x90
    ? exit_to_user_mode_loop+0xd0/0x130
    ? exit_to_user_mode_prepare+0xec/0x100
    ? syscall_exit_to_user_mode+0x12/0x30
    ? do_syscall_64+0x69/0x90
    ? syscall_exit_to_user_mode+0x12/0x30
    ? do_syscall_64+0x69/0x90
    entry_SYSCALL_64_after_hwframe+0x72/0xdc
    RIP: 0033:0x7f815cd3eb97

The IOCB counts are out of order and that would block any commands from
going out and subsequently hang the system. Synchronize the IOCB count to
be in correct order.

Fixes: 5f63a163ed ("scsi: qla2xxx: Fix exchange oversubscription for management commands")
Cc: stable@vger.kernel.org
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20230313043711.13500-3-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: John Meneghini <jmeneghi@redhat.com>
Tested-by: Lin Li <lilin@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-03-16 22:59:19 -04:00
..
Kconfig
Makefile scsi: qla2xxx: edif: Add start + stop bsgs 2021-07-27 00:06:42 -04:00
qla_attr.c scsi: qla2xxx: Remove dead code 2023-01-11 23:48:25 -05:00
qla_bsg.c scsi: qla2xxx: Check if port is online before sending ELS 2023-01-11 21:28:37 -05:00
qla_bsg.h scsi: qla2xxx: Add NVMe parameters support in Auxiliary Image Status 2022-09-01 00:30:55 -04:00
qla_dbg.c scsi: qla2xxx: Enhance driver tracing with separate tunable and more 2022-09-01 00:30:55 -04:00
qla_dbg.h scsi: qla2xxx: Enhance driver tracing with separate tunable and more 2022-09-01 00:30:55 -04:00
qla_def.h scsi: qla2xxx: Select qpair depending on which CPU post_cmd() gets called 2023-01-11 23:48:26 -05:00
qla_devtbl.h
qla_dfs.c scsi: qla2xxx: Fix exchange oversubscription for management commands 2023-01-11 21:28:37 -05:00
qla_dsd.h
qla_edif_bsg.h scsi: qla2xxx: edif: Fix clang warning 2023-01-11 23:48:26 -05:00
qla_edif.c scsi: qla2xxx: edif: Fix clang warning 2023-01-11 23:48:26 -05:00
qla_edif.h scsi: qla2xxx: Relocate/rename vp map 2023-01-11 23:48:25 -05:00
qla_fw.h scsi: qla2xxx: Add NVMe parameters support in Auxiliary Image Status 2022-09-01 00:30:55 -04:00
qla_gbl.h scsi: qla2xxx: Add option to disable FC2 Target support 2023-03-06 17:06:39 -05:00
qla_gs.c scsi: qla2xxx: Remove dead code (GNN ID) 2023-01-11 23:48:25 -05:00
qla_init.c scsi: qla2xxx: Add option to disable FC2 Target support 2023-03-06 17:06:39 -05:00
qla_inline.h scsi: qla2xxx: Select qpair depending on which CPU post_cmd() gets called 2023-01-11 23:48:26 -05:00
qla_iocb.c scsi: qla2xxx: edif: Fix performance dip due to lock contention 2023-01-11 23:48:25 -05:00
qla_isr.c scsi: qla2xxx: Synchronize the IOCB count to be in order 2023-03-16 22:59:19 -04:00
qla_mbx.c scsi: qla2xxx: Relocate/rename vp map 2023-01-11 23:48:25 -05:00
qla_mid.c scsi: qla2xxx: Make qla_trim_buf() and __qla_adjust_buf() static 2023-01-18 18:46:21 -05:00
qla_mr.c scsi: qla2xxx: Implement ref count for SRB 2022-01-24 23:57:30 -05:00
qla_mr.h scsi: qla2xxx: Suppress Coverity complaints about dseg_r* 2021-03-24 21:47:20 -04:00
qla_nvme.c scsi: qla2xxx: Select qpair depending on which CPU post_cmd() gets called 2023-01-11 23:48:26 -05:00
qla_nvme.h scsi: qla2xxx: Increase max limit of ql2xnvme_queues 2022-03-15 00:29:15 -04:00
qla_nx2.c scsi: qla2xxx: Use named initializers for q_dev_state 2022-02-22 21:11:07 -05:00
qla_nx2.h
qla_nx.c scsi: qla2xxx: Use named initializers for q_dev_state 2022-02-22 21:11:07 -05:00
qla_nx.h scsi: qla2xxx: Use named initializers for q_dev_state 2022-02-22 21:11:07 -05:00
qla_os.c scsi: qla2xxx: Perform lockless command completion in abort path 2023-03-16 22:59:19 -04:00
qla_settings.h
qla_sup.c scsi: qla2xxx: Add devids and conditionals for 28xx 2022-01-24 23:57:32 -05:00
qla_target.c scsi: qla2xxx: Simplify if condition evaluation 2023-01-23 21:18:16 -05:00
qla_target.h scsi: qla2xxx: Relocate/rename vp map 2023-01-11 23:48:25 -05:00
qla_tmpl.c scsi: qla2xxx: Fix premature hw access after PCI error 2022-01-24 23:57:30 -05:00
qla_tmpl.h scsi: qla2xxx: Fix crash during driver load on big endian machines 2020-12-09 11:34:17 -05:00
qla_version.h scsi: qla2xxx: Update version to 10.02.08.200-k 2023-01-11 23:48:26 -05:00
tcm_qla2xxx.c scsi: qla2xxx: Use a variable for repeated mem_size computation 2023-01-23 21:15:02 -05:00
tcm_qla2xxx.h