mbox series

[0/2] scsi: mpi3mr: Fix two bugs in the new buffer allocation code

Message ID 20240810042701.661841-1-shinichiro.kawasaki@wdc.com
Headers show
Series scsi: mpi3mr: Fix two bugs in the new buffer allocation code | expand

Message

Shinichiro Kawasaki Aug. 10, 2024, 4:26 a.m. UTC
The commit fc4444941140 ("scsi: mpi3mr: HDB allocation and posting for
hardware and firmware buffers") in the kernel version v6.11-rc1
triggered an INFO and a WARN. Two patches in this series address them
respectively.

Shin'ichiro Kawasaki (2):
  scsi: mpi3mr: Add missing spin_lock_init() for mrioc->trigger_lock
  scsi: mpi3mr: Avoid MAX_PARE_ORDER WARNING for buffer allocations

 drivers/scsi/mpi3mr/mpi3mr_app.c | 11 ++++++++---
 drivers/scsi/mpi3mr/mpi3mr_os.c  |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

Comments

Sathya Prakash Veerichetty Aug. 12, 2024, 3:27 p.m. UTC | #1
On Fri, Aug 9, 2024 at 10:27 PM Shin'ichiro Kawasaki
<shinichiro.kawasaki@wdc.com> wrote:
>
> 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>
> ---

Acked-by: Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>

>  drivers/scsi/mpi3mr/mpi3mr_os.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
> index ca8f132e03ae..616894571c6a 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr_os.c
> +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
> @@ -5234,6 +5234,7 @@ mpi3mr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>         spin_lock_init(&mrioc->watchdog_lock);
>         spin_lock_init(&mrioc->chain_buf_lock);
>         spin_lock_init(&mrioc->sas_node_lock);
> +       spin_lock_init(&mrioc->trigger_lock);
>
>         INIT_LIST_HEAD(&mrioc->fwevt_list);
>         INIT_LIST_HEAD(&mrioc->tgtdev_list);
> --
> 2.45.2
>
Martin K. Petersen Aug. 13, 2024, 2:14 a.m. UTC | #2
On Sat, 10 Aug 2024 13:26:59 +0900, Shin'ichiro Kawasaki wrote:

> The commit fc4444941140 ("scsi: mpi3mr: HDB allocation and posting for
> hardware and firmware buffers") in the kernel version v6.11-rc1
> triggered an INFO and a WARN. Two patches in this series address them
> respectively.
> 
> Shin'ichiro Kawasaki (2):
>   scsi: mpi3mr: Add missing spin_lock_init() for mrioc->trigger_lock
>   scsi: mpi3mr: Avoid MAX_PAGE_ORDER WARNING for buffer allocations
> 
> [...]

Applied to 6.11/scsi-fixes, thanks!

[1/2] scsi: mpi3mr: Add missing spin_lock_init() for mrioc->trigger_lock
      https://git.kernel.org/mkp/scsi/c/6b9935da2a6b
[2/2] scsi: mpi3mr: Avoid MAX_PARE_ORDER WARNING for buffer allocations
      https://git.kernel.org/mkp/scsi/c/8c6b808c8c2a