* [PATCH] ufs: core: fix WB resize use wrong offset
@ 2025-04-23 9:29 Huan Tang
2025-04-23 9:46 ` Peter Wang (王信友)
2025-04-29 1:19 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Huan Tang @ 2025-04-23 9:29 UTC (permalink / raw)
To: alim.akhtar, avri.altman, bvanassche, James.Bottomley,
martin.petersen, matthias.bgg, angelogioacchino.delregno,
peter.wang, manivannan.sadhasivam, quic_nguyenb, luhongfei,
tanghuan, linux-scsi, linux-kernel, linux-arm-kernel,
linux-mediatek
Cc: opensource.kernel
'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@mediatek.com>
Closes: https://lore.kernel.org/all/7ce05b28f5d4b4b4973244310010c1487
bdf4124.camel@mediatek.com/
Signed-off-by: Huan Tang <tanghuan@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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ufs: core: fix WB resize use wrong offset
2025-04-23 9:29 [PATCH] ufs: core: fix WB resize use wrong offset Huan Tang
@ 2025-04-23 9:46 ` Peter Wang (王信友)
2025-04-29 1:19 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Peter Wang (王信友) @ 2025-04-23 9:46 UTC (permalink / raw)
To: avri.altman@wdc.com, linux-mediatek@lists.infradead.org,
tanghuan@vivo.com, quic_nguyenb@quicinc.com,
AngeloGioacchino Del Regno, bvanassche@acm.org,
manivannan.sadhasivam@linaro.org, alim.akhtar@samsung.com,
luhongfei@vivo.com, linux-kernel@vger.kernel.org,
matthias.bgg@gmail.com, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, linux-arm-kernel@lists.infradead.org,
linux-scsi@vger.kernel.org
Cc: opensource.kernel@vivo.com
On Wed, 2025-04-23 at 17:29 +0800, Huan Tang wrote:
> '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@mediatek.com>
> Closes: https://lore.kernel.org/all/7ce05b28f5d4b4b4973244310010c1487
> bdf4124.camel@mediatek.com/
> Signed-off-by: Huan Tang <tanghuan@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
>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ufs: core: fix WB resize use wrong offset
2025-04-23 9:29 [PATCH] ufs: core: fix WB resize use wrong offset Huan Tang
2025-04-23 9:46 ` Peter Wang (王信友)
@ 2025-04-29 1:19 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-04-29 1:19 UTC (permalink / raw)
To: Huan Tang
Cc: alim.akhtar, avri.altman, bvanassche, James.Bottomley,
martin.petersen, matthias.bgg, angelogioacchino.delregno,
peter.wang, manivannan.sadhasivam, quic_nguyenb, luhongfei,
linux-scsi, linux-kernel, linux-arm-kernel, linux-mediatek,
opensource.kernel
Huan,
> '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.
Applied to 6.16/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-29 1:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23 9:29 [PATCH] ufs: core: fix WB resize use wrong offset Huan Tang
2025-04-23 9:46 ` Peter Wang (王信友)
2025-04-29 1:19 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox