Skip to contentSkip to conversation

mpi3mr: Few minor bug fixes

PATCH Applied Ranjan Kumar 2 participants 4 messages Apr 11, 2025 – Apr 12, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover mpi3mr: Few minor bug fixes

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(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/2 Regression fix: Fix pending IOs counter per reply queue

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")
---
 drivers/scsi/mpi3mr/mpi3mr_fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpi3mr/mpi3mr_fw.c +1 -1
index 3fcb1ad3b070..d6e402aacb2a 100644
@@ -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++;
Signature · 1 line
2.31.1
#2 lore raw

PATCH 2/2 mpi3mr: resets the pending interrupt flag

In reply to Ranjan Kumar

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")
---
 drivers/scsi/mpi3mr/mpi3mr_fw.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/scsi/mpi3mr/mpi3mr_fw.c +3 -0
index d6e402aacb2a..003e1f7005c4 100644
@@ -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));
Signature · 1 line
2.31.1
#3 lore raw
In reply to Ranjan Kumar
Quoted 10 lines · Ranjan Kumar

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
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering