Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: mpi3mr: Add missing spin_lock_init() for mrioc->trigger_lock

Commit fc4444941140 ("scsi: mpi3mr: HDB allocation and posting for hardware
and firmware buffers") added the spinlock trigger_lock to the struct
mpi3mr_ioc. However, spin_lock_init() call was not added for it, then the
lock does not work as expected. Also, the kernel reports the message below
when lockdep is enabled.

INFO: trying to register non-static key.
The code is fine but needs lockdep annotation, or maybe
you didn't initialize this object before use?

To fix the issue and to avoid the INFO message, add the missing
spin_lock_init() call.

Fixes: fc4444941140 ("scsi: mpi3mr: HDB allocation and posting for hardware and firmware buffers")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240810042701.661841-2-shinichiro.kawasaki@wdc.com
Acked-by: Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Shin'ichiro Kawasaki and committed by
Martin K. Petersen
6b9935da f874d721

+1
+1
drivers/scsi/mpi3mr/mpi3mr_os.c
··· 5234 5234 spin_lock_init(&mrioc->watchdog_lock); 5235 5235 spin_lock_init(&mrioc->chain_buf_lock); 5236 5236 spin_lock_init(&mrioc->sas_node_lock); 5237 + spin_lock_init(&mrioc->trigger_lock); 5237 5238 5238 5239 INIT_LIST_HEAD(&mrioc->fwevt_list); 5239 5240 INIT_LIST_HEAD(&mrioc->tgtdev_list);