From: sashiko-bot@kernel.org
To: "Ranjan Kumar" <ranjan.kumar@broadcom.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 01/10] mpi3mr: Skip device shutdown during unload per controller configuration
Date: Wed, 08 Jul 2026 18:53:24 +0000 [thread overview]
Message-ID: <20260708185324.861D21F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260708183305.244485-2-ranjan.kumar@broadcom.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Pre-existing endianness bug when reading struct mpi3_driver_page1 fields in mpi3mr_alloc_diag_bufs().
--
--- Patch [1]: [PATCH v2 01/10] mpi3mr: Skip device shutdown during unload per controller configuration ---
commit 06e862cedaadd19cd270a091a6097fdfe30c2c71
Author: Ranjan Kumar <ranjan.kumar@broadcom.com>
mpi3mr: Skip device shutdown during unload per controller configuration
This patch allows the controller to skip device shutdown requests during
driver unload if configured in Driver Page 1. It caches this setting during
IOC initialization and properly handles endianness for the flag evaluation
to prevent failures on big-endian architectures.
Closes: https://sashiko.dev/#/patchset/20260626114109.43685-1-ranjan.kumar@broadcom.com?part=1
> diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
> index 31b19ed1528e5..59241038f689d 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
> +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
[ ... ]
> @@ -4107,26 +4107,35 @@ static int mpi3mr_repost_diag_bufs(struct mpi3mr_ioc *mrioc)
[ ... ]
> + mrioc->skip_dev_shutdown_on_unload =
> + (le32_to_cpu(driver_pg1.flags) &
> + MPI3_DRIVER1_FLAGS_DEVICE_SHUTDOWN_ON_UNLOAD_DISABLE) ? 1 : 0;
> }
[Severity: High]
This is a pre-existing issue, but since this patch corrects the endianness
for driver_pg1.flags, should similar endianness conversions be applied to
the buffer size fields read from driver_pg1 in mpi3mr_alloc_diag_bufs()?
Looking at drivers/scsi/mpi3mr/mpi3mr_app.c:mpi3mr_alloc_diag_bufs():
trace_size = driver_pg1.host_diag_trace_max_size * 1024;
trace_dec_size = driver_pg1.host_diag_trace_decrement_size * 1024;
trace_min_size = driver_pg1.host_diag_trace_min_size * 1024;
fw_size = driver_pg1.host_diag_fw_max_size * 1024;
These 16-bit little-endian fields are accessed without le16_to_cpu(), which
can result in wildly incorrect buffer size calculations on big-endian
architectures. For example, a 4KB size (0x0004) would be interpreted as
0x0400 (1024), causing memory allocation of 1MB instead of 4KB.
Are there plans to fix these missing conversions in a subsequent patch?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708183305.244485-1-ranjan.kumar@broadcom.com?part=1
next prev parent reply other threads:[~2026-07-08 18:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 18:32 [PATCH v2 00/10] mpi3mr: Few Enhancements and minor fixes Ranjan Kumar
2026-07-08 18:32 ` [PATCH v2 01/10] mpi3mr: Skip device shutdown during unload per controller configuration Ranjan Kumar
2026-07-08 18:53 ` sashiko-bot [this message]
2026-07-08 18:32 ` [PATCH v2 02/10] mpi3mr: Update MPI Headers to revision 41 Ranjan Kumar
2026-07-08 18:32 ` [PATCH v2 03/10] mpi3mr: Add early timestamp synchronization after driver load Ranjan Kumar
2026-07-08 18:32 ` [PATCH v2 04/10] mpi3mr: Fix NVMe page size caching for non-operational devices Ranjan Kumar
2026-07-08 19:18 ` sashiko-bot
2026-07-08 18:33 ` [PATCH v2 05/10] mpi3mr: Fix performance regression caused by extended IRQ poll sleep Ranjan Kumar
2026-07-08 19:30 ` sashiko-bot
2026-07-08 18:33 ` [PATCH v2 06/10] mpi3mr: Fix memory leak on operational queue creation failure Ranjan Kumar
2026-07-08 19:48 ` sashiko-bot
2026-07-08 18:33 ` [PATCH v2 07/10] mpi3mr: Fix firmware event reference leak during cleanup Ranjan Kumar
2026-07-08 19:59 ` sashiko-bot
2026-07-08 18:33 ` [PATCH v2 08/10] mpi3mr: Fix SAS port allocation and registration error handling Ranjan Kumar
2026-07-08 20:12 ` sashiko-bot
2026-07-08 18:33 ` [PATCH v2 09/10] mpi3mr: Fix SAS PHY cleanup in host addition error paths Ranjan Kumar
2026-07-08 18:33 ` [PATCH v2 10/10] mpi3mr: Driver version update to 8.18.0.8.50 Ranjan Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260708185324.861D21F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=ranjan.kumar@broadcom.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox