]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
scsi: mpi3mr: Fixes around reply request queues
authorSreekanth Reddy <sreekanth.reddy@broadcom.com>
Mon, 20 Dec 2021 14:11:58 +0000 (19:41 +0530)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 10:03:00 +0000 (11:03 +0100)
BugLink: https://bugs.launchpad.net/bugs/1959376
[ Upstream commit 243bcc8efdb1f44b1a1d415e6821a246714c68ce ]

Set reply queue depth of 1K for B0 and 4K for A0.

While freeing the segmented request queues use the actual queue depth that
is used while creating them.

Link: https://lore.kernel.org/r/20211220141159.16117-25-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/scsi/mpi3mr/mpi3mr.h
drivers/scsi/mpi3mr/mpi3mr_fw.c

index 9787b53a2b598528df2a99845188c76712e2c4fb..2cc42432bd0c090e7f309a2221ff34fbc31b4881 100644 (file)
@@ -79,7 +79,8 @@ extern int prot_mask;
 
 /* Operational queue management definitions */
 #define MPI3MR_OP_REQ_Q_QD             512
-#define MPI3MR_OP_REP_Q_QD             4096
+#define MPI3MR_OP_REP_Q_QD             1024
+#define MPI3MR_OP_REP_Q_QD4K           4096
 #define MPI3MR_OP_REQ_Q_SEG_SIZE       4096
 #define MPI3MR_OP_REP_Q_SEG_SIZE       4096
 #define MPI3MR_MAX_SEG_LIST_SIZE       4096
index 4a8316c6bd41a5220ae561e87a5bf84f2358edf4..5af36c54cb5967d042594e6c0a8b35faa576d698 100644 (file)
@@ -1278,7 +1278,7 @@ static void mpi3mr_free_op_req_q_segments(struct mpi3mr_ioc *mrioc, u16 q_idx)
                        mrioc->op_reply_qinfo[q_idx].q_segment_list = NULL;
                }
        } else
-               size = mrioc->req_qinfo[q_idx].num_requests *
+               size = mrioc->req_qinfo[q_idx].segment_qd *
                    mrioc->facts.op_req_sz;
 
        for (j = 0; j < mrioc->req_qinfo[q_idx].num_segments; j++) {
@@ -1565,6 +1565,8 @@ static int mpi3mr_create_op_reply_q(struct mpi3mr_ioc *mrioc, u16 qidx)
 
        reply_qid = qidx + 1;
        op_reply_q->num_replies = MPI3MR_OP_REP_Q_QD;
+       if (!mrioc->pdev->revision)
+               op_reply_q->num_replies = MPI3MR_OP_REP_Q_QD4K;
        op_reply_q->ci = 0;
        op_reply_q->ephase = 1;
        atomic_set(&op_reply_q->pend_ios, 0);