[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cd427067-8768-4f87-8573-8f9c944fef68@acm.org>
Date: Tue, 20 Feb 2024 12:44:23 -0800
From: Bart Van Assche <bvanassche@....org>
To: Rohit Ner <rohitner@...gle.com>, Can Guo <quic_cang@...cinc.com>,
Bean Huo <beanhuo@...ron.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Cc: Avri Altman <avri.altman@....com>,
"Bao D. Nguyen" <quic_nguyenb@...cinc.com>, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org, Can Guo <quic_cang@...cinc.com>
Subject: Re: [PATCH] scsi: ufs: core: Fix mcq mac configuration
On 2/20/24 01:56, Rohit Ner wrote:
> As per JEDEC Standard No. 223E Section 5.9.2,
> the max # active commands value programmed by the host sw
> in MCQConfig.MAC should be one less than the actual value.
>
> Signed-off-by: Rohit Ner <rohitner@...gle.com>
> ---
> drivers/ufs/core/ufs-mcq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
> index 0787456c2b89..c873fd823942 100644
> --- a/drivers/ufs/core/ufs-mcq.c
> +++ b/drivers/ufs/core/ufs-mcq.c
> @@ -94,7 +94,7 @@ void ufshcd_mcq_config_mac(struct ufs_hba *hba, u32 max_active_cmds)
>
> val = ufshcd_readl(hba, REG_UFS_MCQ_CFG);
> val &= ~MCQ_CFG_MAC_MASK;
> - val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds);
> + val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds - 1);
> ufshcd_writel(hba, val, REG_UFS_MCQ_CFG);
> }
> EXPORT_SYMBOL_GPL(ufshcd_mcq_config_mac);
I'd like to hear the feedback from the UFS controller vendors about this patch
since the UFSHCI specification of the MaxActiveCommand controller field is
ambiguous. While the example shows that 32 should be configured as 1Fh, this is
not documented in any other way.
Thanks,
Bart.
Powered by blists - more mailing lists