linux/drivers/scsi/bnx2fc
Sebastian Andrzej Siewior 20f8932f97 scsi: bnx2fc: Avoid using get_cpu() in bnx2fc_cmd_alloc()
Using get_cpu() leads to disabling preemption and in this context it is not
possible to acquire the following spinlock_t on PREEMPT_RT because it
becomes a sleeping lock.

Commit 0ea5c27583 ("[SCSI] bnx2fc: common free list for cleanup
commands") says that it is using get_cpu() as a fix in case the CPU is
preempted.  While this might be true, the important part is that it is now
using the same CPU for locking and unlocking while previously it always
relied on smp_processor_id().  The date structure itself is protected with
a lock so it does not rely on CPU-local access.

Replace get_cpu() with raw_smp_processor_id() to obtain the current CPU
number which is used as an index for the per-CPU resource.

Link: https://lore.kernel.org/r/20220506105758.283887-5-bigeasy@linutronix.de
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-05-16 21:26:50 -04:00
..
57xx_hsi_bnx2fc.h scsi: Fix various misspellings of "connect" 2019-10-24 21:22:32 -04:00
bnx2fc_constants.h scsi: bnx2fc: Update copyright for 2017. 2017-06-27 21:39:09 -04:00
bnx2fc_debug.c scsi: bnx2fc: Update copyright for 2017. 2017-06-27 21:39:09 -04:00
bnx2fc_debug.h scsi: bnx2fc: Update copyright for 2017. 2017-06-27 21:39:09 -04:00
bnx2fc_els.c scsi: bnx2fc: fix bnx2fc_cmd refcount imbalance in send_srr 2019-06-26 22:43:02 -04:00
bnx2fc_fcoe.c scsi: fcoe: Use per-CPU API to update per-CPU statistics 2022-05-16 21:26:50 -04:00
bnx2fc_hwi.c scsi: bnx2fc: Fix spelling mistake "mis-match" -> "mismatch" 2022-03-30 00:06:44 -04:00
bnx2fc_io.c scsi: bnx2fc: Avoid using get_cpu() in bnx2fc_cmd_alloc() 2022-05-16 21:26:50 -04:00
bnx2fc_tgt.c scsi: bnx2fc: Fix typo in comments 2022-01-31 16:49:31 -05:00
bnx2fc.h scsi: bnx2fc: Stop using the SCSI pointer 2022-02-22 21:11:05 -05:00
Kconfig scsi: bnx2fc: Fix Kconfig warning & CNIC build errors 2021-02-22 22:26:39 -05:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00