Re: [PATCH v1 06/16] ufs: core: mcq: Calculate queue depth

From: Asutosh Das
Date: Mon Sep 26 2022 - 17:24:28 EST


On Mon, Sep 26 2022 at 08:22 -0700, Manivannan Sadhasivam wrote:
On Thu, Sep 22, 2022 at 06:05:13PM -0700, Asutosh Das wrote:
The ufs device defines the supported queuedepth by
bqueuedepth which has a max value of 256.
The HC defines MAC (Max Active Commands) that define
the max number of commands that in flight to the ufs
device.
Calculate and configure the nutrs based on both these
values.

Co-developed-by: Can Guo <quic_cang@xxxxxxxxxxx>
Signed-off-by: Can Guo <quic_cang@xxxxxxxxxxx>
Signed-off-by: Asutosh Das <quic_asutoshd@xxxxxxxxxxx>
---

[...]


+/**
+ * ufshcd_mcq_decide_queue_depth - decide the queue depth

ufshcd_mcq_calc_queue_depth - Calculate MCQ queue depth

The name ufshcd_mcq_decide_queue_depth was suggested by Bart in his comments.
I don't have a strong opinion on the name, if you do, plmk and I'd change it.

+ * @hba - per adapter instance

[...]

+static int ufs_qcom_get_hba_mac(struct ufs_hba *hba)
+{
+ /* Default is 32, but Qualcomm HC supports upto 64 */

Hmm, then this should come from ufshcd, no?

I'm not sure I understand this comment, please can you elaborate?

Thanks,
Mani