* [PATCH v1 1/2] Regression fix: Fix pending IOs counter per reply queue
2025-04-11 11:14 [PATCH v1 0/2] mpi3mr: Few minor bug fixes Ranjan Kumar
@ 2025-04-11 11:14 ` Ranjan Kumar
2025-04-11 11:14 ` [PATCH v1 2/2] mpi3mr: resets the pending interrupt flag Ranjan Kumar
2025-04-12 10:28 ` [PATCH v1 0/2] mpi3mr: Few minor bug fixes Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Ranjan Kumar @ 2025-04-11 11:14 UTC (permalink / raw)
To: linux-scsi, martin.petersen
Cc: rajsekhar.chundru, sathya.prakash, sumit.saxena,
chandrakanth.patil, prayas.patel, tadamsjr, vishakhavc,
Ranjan Kumar, stable
Commit 199510e33dea ("scsi: mpi3mr: Update consumer index of
reply queues after every 100 replies") introduced a regression
with Per reply queue pending IOs counter was wrongly decremented
leading to counter getting negative.
Fixed the issue by dropping the extra atomic decrement for
pending IOs counter.
Fixes: 199510e33dea ("scsi: mpi3mr: Update consumer index of reply queues after every 100 replies")
Cc: stable@vger.kernel.org
Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com>
Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
---
drivers/scsi/mpi3mr/mpi3mr_fw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index 3fcb1ad3b070..d6e402aacb2a 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -565,7 +565,7 @@ int mpi3mr_process_op_reply_q(struct mpi3mr_ioc *mrioc,
WRITE_ONCE(op_req_q->ci, le16_to_cpu(reply_desc->request_queue_ci));
mpi3mr_process_op_reply_desc(mrioc, reply_desc, &reply_dma,
reply_qidx);
- atomic_dec(&op_reply_q->pend_ios);
+
if (reply_dma)
mpi3mr_repost_reply_buf(mrioc, reply_dma);
num_op_reply++;
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH v1 2/2] mpi3mr: resets the pending interrupt flag
2025-04-11 11:14 [PATCH v1 0/2] mpi3mr: Few minor bug fixes Ranjan Kumar
2025-04-11 11:14 ` [PATCH v1 1/2] Regression fix: Fix pending IOs counter per reply queue Ranjan Kumar
@ 2025-04-11 11:14 ` Ranjan Kumar
2025-04-12 10:28 ` [PATCH v1 0/2] mpi3mr: Few minor bug fixes Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Ranjan Kumar @ 2025-04-11 11:14 UTC (permalink / raw)
To: linux-scsi, martin.petersen
Cc: rajsekhar.chundru, sathya.prakash, sumit.saxena,
chandrakanth.patil, prayas.patel, tadamsjr, vishakhavc,
Ranjan Kumar, stable
If an admin interrupt is missed, admin_pend_isr may stay set and
trigger admin reply processing even when no admin IOs are pending.
Clearing/Resetting it in the admin completion path prevents this.
Fixes: ca41929b2ed5 ("scsi: mpi3mr: Check admin reply queue from Watchdog")
Cc: stable@vger.kernel.org
Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com>
Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
---
drivers/scsi/mpi3mr/mpi3mr_fw.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index d6e402aacb2a..003e1f7005c4 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -451,6 +451,7 @@ int mpi3mr_process_admin_reply_q(struct mpi3mr_ioc *mrioc)
return 0;
}
+ atomic_set(&mrioc->admin_pend_isr, 0);
reply_desc = (struct mpi3_default_reply_descriptor *)mrioc->admin_reply_base +
admin_reply_ci;
@@ -2925,6 +2926,7 @@ static int mpi3mr_setup_admin_qpair(struct mpi3mr_ioc *mrioc)
mrioc->admin_reply_ci = 0;
mrioc->admin_reply_ephase = 1;
atomic_set(&mrioc->admin_reply_q_in_use, 0);
+ atomic_set(&mrioc->admin_pend_isr, 0);
if (!mrioc->admin_req_base) {
mrioc->admin_req_base = dma_alloc_coherent(&mrioc->pdev->dev,
@@ -4653,6 +4655,7 @@ void mpi3mr_memset_buffers(struct mpi3mr_ioc *mrioc)
if (mrioc->admin_reply_base)
memset(mrioc->admin_reply_base, 0, mrioc->admin_reply_q_sz);
atomic_set(&mrioc->admin_reply_q_in_use, 0);
+ atomic_set(&mrioc->admin_pend_isr, 0);
if (mrioc->init_cmds.reply) {
memset(mrioc->init_cmds.reply, 0, sizeof(*mrioc->init_cmds.reply));
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v1 0/2] mpi3mr: Few minor bug fixes
2025-04-11 11:14 [PATCH v1 0/2] mpi3mr: Few minor bug fixes Ranjan Kumar
2025-04-11 11:14 ` [PATCH v1 1/2] Regression fix: Fix pending IOs counter per reply queue Ranjan Kumar
2025-04-11 11:14 ` [PATCH v1 2/2] mpi3mr: resets the pending interrupt flag Ranjan Kumar
@ 2025-04-12 10:28 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2025-04-12 10:28 UTC (permalink / raw)
To: linux-scsi, Ranjan Kumar
Cc: Martin K . Petersen, rajsekhar.chundru, sathya.prakash,
sumit.saxena, chandrakanth.patil, prayas.patel, tadamsjr,
vishakhavc
On Fri, 11 Apr 2025 16:44:17 +0530, Ranjan Kumar wrote:
> Few minor fixes of mpi3mr driver.
>
> Ranjan Kumar (2):
> Regression fix: Fix pending IOs counter per reply queue
> mpi3mr: resets the pending interrupt flag
>
> drivers/scsi/mpi3mr/mpi3mr_fw.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> [...]
Applied to 6.15/scsi-fixes, thanks!
[1/2] Regression fix: Fix pending IOs counter per reply queue
https://git.kernel.org/mkp/scsi/c/cdd445258db9
[2/2] mpi3mr: resets the pending interrupt flag
https://git.kernel.org/mkp/scsi/c/3b5091fee49f
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread