Saurav Kashyap
124e801e55
scsi: qla2xxx: Sync queue idx with queue_pair_map idx
...
commit c8fadf019964d0eb1da410ba8b629494d3339db9 upstream.
The first invocation of function find_first_zero_bit will return 0 and
queue_id gets set to 0.
An index of queue_pair_map also gets set to 0.
qpair_id = find_first_zero_bit(ha->qpair_qid_map, ha->max_qpairs);
set_bit(qpair_id, ha->qpair_qid_map);
ha->queue_pair_map[qpair_id] = qpair;
In the alloc_queue callback driver checks the map, if queue is already
allocated:
ha->queue_pair_map[qidx]
This works fine as long as max_qpairs is greater than nvme_max_hw_queues(8)
since the size of the queue_pair_map is equal to max_qpair. In case nr_cpus
is less than 8, max_qpairs is less than 8. This creates wrong value
returned as qpair.
[ 1572.353669] qla2xxx [0000:24:00.3]-2121:6: Returning existing qpair of 4e00000000000000 for idx=2
[ 1572.354458] general protection fault: 0000 [#1 ] SMP PTI
[ 1572.354461] CPU: 1 PID: 44 Comm: kworker/1:1H Kdump: loaded Tainted: G IOE --------- - - 4.18.0-304.el8.x86_64 #1
[ 1572.354462] Hardware name: HP ProLiant DL380p Gen8, BIOS P70 03/01/2013
[ 1572.354467] Workqueue: kblockd blk_mq_run_work_fn
[ 1572.354485] RIP: 0010:qla_nvme_post_cmd+0x92/0x760 [qla2xxx]
[ 1572.354486] Code: 84 24 5c 01 00 00 00 00 b8 0a 74 1e 66 83 79 48 00 0f 85 a8 03 00 00 48 8b 44 24 08 48 89 ee 4c 89 e7 8b 50 24 e8 5e 8e 00 00 <f0> 41 ff 47 04 0f ae f0 41 f6 47 24 04 74 19 f0 41 ff 4f 04 b8 f0
[ 1572.354487] RSP: 0018:ffff9c81c645fc90 EFLAGS: 00010246
[ 1572.354489] RAX: 0000000000000001 RBX: ffff8ea3e5070138 RCX: 0000000000000001
[ 1572.354490] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff8ea4c866b800
[ 1572.354491] RBP: ffff8ea4c866b800 R08: 0000000000005010 R09: ffff8ea4c866b800
[ 1572.354492] R10: 0000000000000001 R11: 000000069d1ca3ff R12: ffff8ea4bc460000
[ 1572.354493] R13: ffff8ea3e50702b0 R14: ffff8ea4c4c16a58 R15: 4e00000000000000
[ 1572.354494] FS: 0000000000000000(0000) GS:ffff8ea4dfd00000(0000) knlGS:0000000000000000
[ 1572.354495] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1572.354496] CR2: 000055884504fa58 CR3: 00000005a1410001 CR4: 00000000000606e0
[ 1572.354497] Call Trace:
[ 1572.354503] ? check_preempt_curr+0x62/0x90
[ 1572.354506] ? dma_direct_map_sg+0x72/0x1f0
[ 1572.354509] ? nvme_fc_start_fcp_op.part.32+0x175/0x460 [nvme_fc]
[ 1572.354511] ? blk_mq_dispatch_rq_list+0x11c/0x730
[ 1572.354515] ? __switch_to_asm+0x35/0x70
[ 1572.354516] ? __switch_to_asm+0x41/0x70
[ 1572.354518] ? __switch_to_asm+0x35/0x70
[ 1572.354519] ? __switch_to_asm+0x41/0x70
[ 1572.354521] ? __switch_to_asm+0x35/0x70
[ 1572.354522] ? __switch_to_asm+0x41/0x70
[ 1572.354523] ? __switch_to_asm+0x35/0x70
[ 1572.354525] ? entry_SYSCALL_64_after_hwframe+0xb9/0xca
[ 1572.354527] ? __switch_to_asm+0x41/0x70
[ 1572.354529] ? __blk_mq_sched_dispatch_requests+0xc6/0x170
[ 1572.354531] ? blk_mq_sched_dispatch_requests+0x30/0x60
[ 1572.354532] ? __blk_mq_run_hw_queue+0x51/0xd0
[ 1572.354535] ? process_one_work+0x1a7/0x360
[ 1572.354537] ? create_worker+0x1a0/0x1a0
[ 1572.354538] ? worker_thread+0x30/0x390
[ 1572.354540] ? create_worker+0x1a0/0x1a0
[ 1572.354541] ? kthread+0x116/0x130
[ 1572.354543] ? kthread_flush_work_fn+0x10/0x10
[ 1572.354545] ? ret_from_fork+0x35/0x40
Fix is to use index 0 for admin and first IO queue.
Link: https://lore.kernel.org/r/20210810043720.1137-14-njavali@marvell.com
Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration")
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-22 11:48:09 +02:00
..
2020-10-01 13:14:42 +02:00
2021-07-28 11:13:44 +02:00
2021-07-28 11:13:44 +02:00
2019-11-24 08:20:59 +01:00
2020-08-19 08:14:55 +02:00
2021-07-20 16:16:15 +02:00
2020-01-14 20:07:06 +01:00
2021-06-16 11:54:57 +02:00
2021-07-20 16:16:08 +02:00
2020-10-29 09:55:07 +01:00
2021-07-20 16:16:08 +02:00
2020-10-01 13:14:45 +02:00
2021-08-26 08:36:44 -04:00
2020-01-23 08:21:38 +01:00
2020-09-03 11:24:22 +02:00
2020-12-30 11:26:01 +01:00
2021-07-28 11:13:44 +02:00
2021-05-22 10:59:34 +02:00
2018-09-17 02:50:37 -04:00
2021-07-28 11:13:44 +02:00
2021-07-28 11:13:44 +02:00
2021-07-28 11:13:44 +02:00
2021-07-20 16:16:07 +02:00
2021-08-26 08:36:44 -04:00
2021-07-20 16:15:57 +02:00
2021-07-28 11:13:44 +02:00
2018-08-21 23:54:17 -04:00
2018-03-19 22:54:47 -04:00
2021-07-28 11:13:44 +02:00
2020-06-25 15:32:53 +02:00
2021-09-22 11:48:01 +02:00
2021-09-22 11:48:09 +02:00
2020-10-29 09:55:07 +01:00
2020-04-29 16:31:16 +02:00
2018-07-12 23:01:16 -04:00
2019-11-20 18:46:29 +01:00
2021-05-26 11:48:35 +02:00
2017-10-25 05:40:22 -04:00
2018-07-30 23:17:53 -04:00
2017-12-04 20:32:53 -05:00
2018-07-30 23:17:53 -04:00
2018-07-30 23:17:53 -04:00
2019-03-13 14:02:31 -07:00
2017-11-02 11:10:55 +01:00
2018-07-30 23:17:53 -04:00
2017-08-25 17:21:10 -04:00
2017-11-02 11:10:55 +01:00
2017-08-25 17:21:10 -04:00
2017-11-02 11:10:55 +01:00
2018-06-26 12:53:26 -04:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2018-05-01 23:29:41 -04:00
2020-01-04 19:12:56 +01:00
2018-07-30 23:17:53 -04:00
2017-11-02 11:10:55 +01:00
2021-09-22 11:48:09 +02:00
2021-06-03 08:38:10 +02:00
2019-10-29 09:19:50 +01:00
2017-11-02 11:10:55 +01:00
2019-12-01 09:16:32 +01:00
2017-11-02 11:10:55 +01:00
2017-08-25 17:21:11 -04:00
2018-05-18 12:03:51 -04:00
2018-03-15 00:25:37 -04:00
2018-11-13 11:08:32 -08:00
2018-11-13 11:08:32 -08:00
2021-07-20 16:15:55 +02:00
2017-08-25 17:21:11 -04:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2017-08-25 17:21:10 -04:00
2017-11-02 11:10:55 +01:00
2021-07-20 16:16:07 +02:00
2019-07-10 09:53:37 +02:00
2020-11-18 19:18:44 +01:00
2018-07-10 22:25:03 -04:00
2017-08-25 17:21:10 -04:00
2018-06-26 12:27:07 -04:00
2017-11-02 11:10:55 +01:00
2020-04-02 15:28:15 +02:00
2020-04-02 15:28:15 +02:00
2019-12-01 09:16:26 +01:00
2018-04-20 19:40:17 -04:00
2020-06-25 15:33:01 +02:00
2020-02-24 08:34:48 +01:00
2021-05-22 10:59:33 +02:00
2020-07-22 09:32:04 +02:00
2018-06-19 22:02:25 -04:00
2021-07-20 16:16:08 +02:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-11-13 11:08:32 -08:00
2020-01-04 19:12:56 +01:00
2018-08-15 22:06:26 -07:00
2019-10-29 09:19:29 +01:00
2018-06-19 22:02:25 -04:00
2020-08-19 08:14:59 +02:00
2017-11-02 11:10:55 +01:00
2018-03-19 22:54:47 -04:00
2017-11-02 11:10:55 +01:00
2020-10-30 10:38:28 +01:00
2018-07-10 22:42:47 -04:00
2020-01-04 19:13:04 +01:00
2019-11-20 18:47:49 +01:00
2018-06-19 22:02:25 -04:00
2017-10-16 22:38:44 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2018-02-13 21:49:15 -05:00
2017-12-04 20:32:52 -05:00
2017-11-02 11:10:55 +01:00
2017-10-05 15:01:17 +02:00
2017-10-05 15:01:17 +02:00
2017-08-25 17:21:11 -04:00
2017-11-02 11:10:55 +01:00
2017-08-25 17:21:11 -04:00
2018-06-26 12:53:26 -04:00
2017-11-02 11:10:55 +01:00
2018-12-19 19:19:49 +01:00
2017-12-11 21:39:39 -05:00
2020-08-19 08:14:57 +02:00
2018-04-20 19:14:28 -04:00
2021-06-30 08:48:12 -04:00
2019-05-08 07:21:49 +02:00
2019-10-29 09:19:49 +01:00
2018-06-26 12:27:06 -04:00
2017-11-02 11:10:55 +01:00
2021-07-20 16:15:38 +02:00
2019-10-07 18:57:04 +02:00
2017-11-14 16:23:44 -08:00
2019-01-22 21:40:32 +01:00
2017-12-07 21:13:45 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-08-26 08:36:44 -04:00
2019-10-29 09:19:50 +01:00
2020-01-23 08:21:38 +01:00
2017-11-02 11:10:55 +01:00
2018-08-15 22:06:26 -07:00
2021-07-28 11:13:48 +02:00
2018-06-10 13:01:12 -07:00
2021-01-12 20:10:16 +01:00
2021-04-28 13:16:49 +02:00
2018-06-26 12:53:26 -04:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-07-30 08:27:02 -06:00
2018-08-15 22:06:26 -07:00
2021-03-11 14:04:59 +01:00
2018-07-30 08:27:02 -06:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2020-05-20 08:18:34 +02:00
2017-08-25 17:21:10 -04:00
2021-05-22 10:59:34 +02:00
2018-08-02 15:22:13 -06:00
2020-07-22 09:32:04 +02:00
2021-08-12 13:19:39 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-04-07 12:48:48 +02:00
2017-11-02 11:10:55 +01:00
2019-05-08 07:21:49 +02:00
2020-01-04 19:12:56 +01:00
2021-05-22 10:59:34 +02:00
2019-03-23 20:09:59 +01:00
2021-06-16 11:54:57 +02:00
2017-08-25 17:21:10 -04:00
2018-05-01 23:30:12 -04:00
2017-11-02 11:10:55 +01:00
2018-06-19 14:54:41 +02:00
2019-12-17 20:36:03 +01:00