summaryrefslogtreecommitdiffstats
path: root/drivers/ufs/core
diff options
context:
space:
mode:
authorRohit Ner <rohitner@google.com>2024-02-20 01:56:37 -0800
committerMartin K. Petersen <martin.petersen@oracle.com>2024-03-10 17:10:15 -0400
commit767712f91de76abd22a45184e6e3440120b8bfce (patch)
tree23970dbcb3724bc41d967f2272add8cf95918ab0 /drivers/ufs/core
parent517bcc2b4db435f230fe864f3db0a0f21d2f6951 (diff)
downloadlinux-stable-767712f91de76abd22a45184e6e3440120b8bfce.tar.gz
linux-stable-767712f91de76abd22a45184e6e3440120b8bfce.tar.bz2
linux-stable-767712f91de76abd22a45184e6e3440120b8bfce.zip
scsi: ufs: core: Fix MCQ MAC configuration
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@google.com> Link: https://lore.kernel.org/r/20240220095637.2900067-1-rohitner@google.com Reviewed-by: Peter Wang <peter.wang@mediatek.com> Reviewed-by: Can Guo <quic_cang@quicinc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs/core')
-rw-r--r--drivers/ufs/core/ufs-mcq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
index 8db81f1a12d5..768bf87cd80d 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);