John Meneghini
936bd03405
scsi: bnx2fc: Make bnx2fc_recv_frame() mp safe
...
Running tests with a debug kernel shows that bnx2fc_recv_frame() is
modifying the per_cpu lport stats counters in a non-mpsafe way. Just boot
a debug kernel and run the bnx2fc driver with the hardware enabled.
[ 1391.699147] BUG: using smp_processor_id() in preemptible [00000000] code: bnx2fc_
[ 1391.699160] caller is bnx2fc_recv_frame+0xbf9/0x1760 [bnx2fc]
[ 1391.699174] CPU: 2 PID: 4355 Comm: bnx2fc_l2_threa Kdump: loaded Tainted: G B
[ 1391.699180] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013
[ 1391.699183] Call Trace:
[ 1391.699188] dump_stack_lvl+0x57/0x7d
[ 1391.699198] check_preemption_disabled+0xc8/0xd0
[ 1391.699205] bnx2fc_recv_frame+0xbf9/0x1760 [bnx2fc]
[ 1391.699215] ? do_raw_spin_trylock+0xb5/0x180
[ 1391.699221] ? bnx2fc_npiv_create_vports.isra.0+0x4e0/0x4e0 [bnx2fc]
[ 1391.699229] ? bnx2fc_l2_rcv_thread+0xb7/0x3a0 [bnx2fc]
[ 1391.699240] bnx2fc_l2_rcv_thread+0x1af/0x3a0 [bnx2fc]
[ 1391.699250] ? bnx2fc_ulp_init+0xc0/0xc0 [bnx2fc]
[ 1391.699258] kthread+0x364/0x420
[ 1391.699263] ? _raw_spin_unlock_irq+0x24/0x50
[ 1391.699268] ? set_kthread_struct+0x100/0x100
[ 1391.699273] ret_from_fork+0x22/0x30
Restore the old get_cpu/put_cpu code with some modifications to reduce the
size of the critical section.
Link: https://lore.kernel.org/r/20220124145110.442335-1-jmeneghi@redhat.com
Fixes: d576a5e80cd0 ("bnx2fc: Improve stats update mechanism")
Tested-by: Guangwu Zhang <guazhang@redhat.com>
Acked-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-01-31 12:17:53 -05:00
..
2022-01-05 00:23:47 -05:00
2022-01-05 00:55:38 -05:00
2021-10-18 12:28:53 -07:00
2021-10-16 21:45:54 -04:00
2021-10-16 21:32:16 -04:00
2021-10-16 21:45:54 -04:00
2022-01-24 23:30:29 -05:00
2022-01-31 12:17:53 -05:00
2021-10-16 21:45:55 -04:00
2021-10-16 21:45:55 -04:00
2021-08-13 17:49:05 -07:00
2021-10-16 21:45:55 -04:00
2021-07-29 21:58:35 -04:00
2020-03-11 23:07:59 -04:00
2022-01-24 23:30:23 -05:00
2021-10-16 21:28:46 -04:00
2021-10-18 22:38:34 -04:00
2021-10-16 21:45:55 -04:00
2022-01-24 23:30:29 -05:00
2021-11-05 08:42:02 -07:00
2021-10-04 23:27:38 -04:00
2021-10-16 21:45:56 -04:00
2021-10-16 21:28:48 -04:00
2021-12-22 23:38:31 -05:00
2022-01-23 06:20:44 +02:00
2022-01-14 14:37:34 +01:00
2022-01-05 00:34:41 -05:00
2022-01-22 10:24:02 +02:00
2021-12-22 23:38:29 -05:00
2022-01-10 11:03:42 -05:00
2022-01-31 12:14:49 -05:00
2022-01-24 23:30:26 -05:00
2021-12-16 22:38:19 -05:00
2021-12-16 22:48:33 -05:00
2021-12-06 22:17:19 -05:00
2021-10-16 21:45:59 -04:00
2021-12-22 23:43:23 -05:00
2021-10-16 21:32:16 -04:00
2022-01-25 00:07:24 -05:00
2020-03-25 11:50:48 +01:00
2021-10-16 21:45:53 -04:00
2021-05-15 18:01:34 -04:00
2022-01-24 23:30:28 -05:00
2021-01-22 21:14:08 -05:00
2021-10-18 22:38:34 -04:00
2021-01-22 21:14:07 -05:00
2022-01-25 00:08:18 -05:00
2021-05-07 00:26:34 -07:00
2021-11-29 23:02:13 -05:00
2020-06-09 09:39:13 -07:00
2020-06-09 09:39:13 -07:00
2021-10-16 21:32:16 -04:00
2021-10-16 21:32:16 -04:00
2021-10-19 14:07:19 -04:00
2021-01-13 00:14:07 -05:00
2021-10-16 21:32:16 -04:00
2020-11-23 22:12:09 -05:00
2021-11-29 23:02:13 -05:00
2021-01-22 21:14:08 -05:00
2021-10-16 21:32:16 -04:00
2021-05-14 22:19:04 -04:00
2022-01-14 14:37:34 +01:00
2021-06-02 23:09:39 -04:00
2021-11-29 23:02:14 -05:00
2021-01-22 21:14:10 -05:00
2021-10-16 21:32:16 -04:00
2020-03-11 23:07:59 -04:00
2021-10-16 21:32:16 -04:00
2019-12-19 22:08:51 -05:00
2021-01-26 07:42:27 +01:00
2021-10-16 21:28:47 -04:00
2020-07-08 01:12:44 -04:00
2021-06-02 01:37:04 -04:00
2021-01-26 07:42:27 +01:00
2020-06-09 09:39:13 -07:00
2021-11-18 22:26:58 -05:00
2021-04-01 22:52:40 -04:00
2021-12-13 23:34:01 -05:00
2020-09-02 22:49:06 -04:00
2021-10-16 21:45:55 -04:00
2021-10-16 21:32:16 -04:00
2021-12-22 23:41:53 -05:00
2021-01-22 21:14:10 -05:00
2021-10-16 21:45:56 -04:00
2021-06-29 16:46:08 -04:00
2021-10-16 21:32:16 -04:00
2021-05-07 00:26:34 -07:00
2020-06-02 21:23:47 -04:00
2021-06-02 01:28:20 -04:00
2021-04-13 00:20:48 -04:00
2021-07-28 22:24:27 -04:00
2021-08-30 10:18:25 +02:00
2021-02-08 22:39:03 -05:00
2021-12-22 23:03:59 -05:00
2021-10-16 21:32:16 -04:00
2020-10-02 21:52:53 -04:00
2020-12-07 20:24:09 -05:00
2021-08-23 23:07:05 -04:00
2022-01-07 09:19:51 -05:00
2021-10-16 21:32:16 -04:00
2020-06-09 09:39:13 -07:00
2021-10-16 21:29:15 -04:00
2020-03-11 23:07:56 -04:00
2021-12-22 23:42:23 -05:00
2020-01-02 21:57:44 -05:00
2022-01-25 00:09:41 -05:00
2020-01-02 21:57:44 -05:00
2021-10-16 21:45:57 -04:00
2021-01-22 21:14:12 -05:00
2021-10-16 21:28:44 -04:00
2020-12-07 20:24:09 -05:00
2021-10-16 21:32:16 -04:00
2021-12-22 23:44:12 -05:00
2021-05-21 16:59:33 -04:00
2021-10-16 21:32:16 -04:00
2021-10-16 21:32:16 -04:00
2021-10-16 21:32:16 -04:00
2020-01-15 23:09:11 -05:00
2021-10-16 21:32:16 -04:00
2021-10-16 21:32:16 -04:00
2021-11-29 06:41:29 -07:00
2021-07-28 22:24:27 -04:00
2021-12-06 22:04:35 -05:00
2021-11-29 23:02:13 -05:00
2021-07-21 23:49:02 -04:00
2021-03-24 23:03:43 -04:00
2022-01-14 14:37:34 +01:00
2021-11-29 06:41:29 -07:00
2022-01-22 10:24:02 +02:00
2021-11-29 06:41:29 -07:00
2019-12-19 22:08:54 -05:00
2021-12-22 23:38:29 -05:00
2021-11-29 23:02:15 -05:00
2022-01-22 08:33:37 +02:00
2021-11-29 23:02:13 -05:00
2021-12-16 22:38:19 -05:00
2020-03-16 22:08:36 -04:00
2021-08-11 22:25:37 -04:00
2021-11-16 19:42:30 -05:00
2021-10-19 14:07:19 -04:00
2021-08-11 22:25:37 -04:00
2021-04-05 23:14:53 -04:00
2021-12-06 22:30:32 -05:00
2021-05-06 19:24:11 -07:00
2021-10-18 06:17:02 -06:00
2022-01-14 14:37:34 +01:00
2022-01-22 10:24:02 +02:00
2021-10-26 21:01:48 -06:00
2020-09-15 20:28:06 -04:00
2021-09-28 22:42:06 -04:00
2022-01-22 08:33:35 +02:00
2020-09-25 06:20:44 +02:00
2021-03-18 22:52:29 -04:00
2021-05-07 00:26:34 -07:00
2021-09-13 22:15:49 -04:00
2021-12-22 23:41:13 -05:00
2022-01-14 14:37:34 +01:00
2020-02-24 15:01:57 -05:00
2021-11-29 06:41:29 -07:00
2021-08-23 12:54:30 -06:00
2021-10-16 21:32:16 -04:00
2022-01-10 12:33:47 +00:00
2021-08-11 22:25:41 -04:00
2021-04-13 00:20:48 -04:00
2020-10-02 21:52:55 -04:00
2022-01-18 10:05:48 +02:00
2021-12-22 23:17:27 -05:00
2021-03-04 17:21:25 -05:00
2021-10-16 21:32:16 -04:00
2021-10-16 21:31:43 -04:00
2021-10-16 21:31:43 -04:00
2021-08-30 10:18:25 +02:00
2020-06-09 09:39:13 -07:00