[PATCH] ufs: core: fix WB resize use wrong offset
Huan Tang
tanghuan at vivo.com
Wed Apr 23 02:29:17 PDT 2025
'Commit 500d4b742e0c ("scsi: ufs: core: Add WB buffer resize support")'
incorrectly reads the value of offset
"DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP" to determine whether WB resize
is supported.
Fix the issue by read the value of "DEVICE_DESC_PARAM_EXT_WB_SUP"
to determine whether the device supports WB resize.
Fixes: 500d4b742e0c ("scsi: ufs: core: Add WB buffer resize support")
Reported-by: Peter Wang <peter.wang at mediatek.com>
Closes: https://lore.kernel.org/all/7ce05b28f5d4b4b4973244310010c1487
bdf4124.camel at mediatek.com/
Signed-off-by: Huan Tang <tanghuan at vivo.com>
---
drivers/ufs/core/ufshcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index dc55c94fa45e..1c53ccf5a616 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8143,7 +8143,7 @@ static void ufshcd_wb_probe(struct ufs_hba *hba, const u8 *desc_buf)
dev_info->wb_buffer_type = desc_buf[DEVICE_DESC_PARAM_WB_TYPE];
dev_info->ext_wb_sup = get_unaligned_be16(desc_buf +
- DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP);
+ DEVICE_DESC_PARAM_EXT_WB_SUP);
dev_info->b_presrv_uspc_en =
desc_buf[DEVICE_DESC_PARAM_WB_PRESRV_USRSPC_EN];
--
2.39.0
More information about the Linux-mediatek
mailing list