From: Minwoo Im <minwoo.im@samsung.com>
To: "James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Bart Van Assche <bvanassche@acm.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
Minwoo Im <minwoo.im@samsung.com>,
gost.dev@samsung.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, Jeuk Kim <jeuk20.kim@samsung.com>
Subject: [PATCH v2 2/2] ufs: mcq: Prevent no I/O queue case for MCQ
Date: Sat, 1 Jun 2024 06:22:44 +0900 [thread overview]
Message-ID: <20240531212244.1593535-3-minwoo.im@samsung.com> (raw)
In-Reply-To: <20240531212244.1593535-1-minwoo.im@samsung.com>
If hba_maxq equals poll_queues, which means there are no I/O queues
(HCTX_TYPE_DEFAULT, HCTX_TYPE_READ), the very first hw queue will be
allocated as HCTX_TYPE_POLL and it will be used as the dev_cmd_queue.
In this case, device commands such as QUERY cannot be properly handled.
This patch prevents the initialization of MCQ when the number of I/O
queues is not set and only the number of POLL queues is set.
Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/ufs/core/ufs-mcq.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
index 46faa54aea94..4bcae410c268 100644
--- a/drivers/ufs/core/ufs-mcq.c
+++ b/drivers/ufs/core/ufs-mcq.c
@@ -179,6 +179,15 @@ static int ufshcd_mcq_config_nr_queues(struct ufs_hba *hba)
return -EOPNOTSUPP;
}
+ /*
+ * Device should support at least one I/O queue to handle device
+ * commands via hba->dev_cmd_queue.
+ */
+ if (hba_maxq == poll_queues) {
+ dev_err(hba->dev, "At least one non-poll queue required\n");
+ return -EOPNOTSUPP;
+ }
+
rem = hba_maxq;
if (rw_queues) {
--
2.34.1
next prev parent reply other threads:[~2024-05-31 21:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240531213424epcas2p16d7360e12d310c9f299d449e66af07b3@epcas2p1.samsung.com>
2024-05-31 21:22 ` [PATCH v2 0/2] ufs: pci: Add support UFSHCI 4.0 MCQ Minwoo Im
[not found] ` <CGME20240531213425epcas2p2d6291fd4547354afbb067c27b7d1e12f@epcas2p2.samsung.com>
2024-05-31 21:22 ` [PATCH v2 1/2] ufs: pci: Add support MCQ for QEMU-based UFS Minwoo Im
[not found] ` <CGME20240531213425epcas2p477d443427f706b999e81432393bfdc8a@epcas2p4.samsung.com>
2024-05-31 21:22 ` Minwoo Im [this message]
2024-06-04 21:25 ` [PATCH v2 0/2] ufs: pci: Add support UFSHCI 4.0 MCQ Minwoo Im
2024-06-04 22:17 ` Bart Van Assche
2024-06-05 2:17 ` Martin K. Petersen
2024-06-12 1:59 ` Martin K. Petersen
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=20240531212244.1593535-3-minwoo.im@samsung.com \
--to=minwoo.im@samsung.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=gost.dev@samsung.com \
--cc=jeuk20.kim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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
all inboxes | Powered by JetHome®