[PATCH v3 2/2] scsi: ufs: core: reflect function execution result in return

SEO HOYOUNG posted 2 patches 1 month, 2 weeks ago
[PATCH v3 2/2] scsi: ufs: core: reflect function execution result in return
Posted by SEO HOYOUNG 1 month, 2 weeks ago
If an error is returned in the power mode function, it is returned and
modified to cause failure in the UFS linkup.
If it is an asymmetric connected lane, the UFS init can fail because it is
an incorrect situation.

Signed-off-by: SEO HOYOUNG <hy50.seo@samsung.com>
---
 drivers/ufs/core/ufshcd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 387eec6f19ef..1381eb7d506a 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8587,7 +8587,8 @@ static int ufshcd_device_params_init(struct ufs_hba *hba)
 		hba->dev_info.f_power_on_wp_en = flag;
 
 	/* Probe maximum power mode co-supported by both UFS host and device */
-	if (ufshcd_get_max_pwr_mode(hba))
+	ret = ufshcd_get_max_pwr_mode(hba);
+	if (ret)
 		dev_err(hba->dev,
 			"%s: Failed getting max supported power mode\n",
 			__func__);
-- 
2.26.0
Re: [PATCH v3 2/2] scsi: ufs: core: reflect function execution result in return
Posted by Bart Van Assche 1 month, 1 week ago
On 10/10/24 12:52 AM, SEO HOYOUNG wrote:
> If an error is returned in the power mode function, it is returned and
> modified to cause failure in the UFS linkup.
> If it is an asymmetric connected lane, the UFS init can fail because it is
> an incorrect situation.

Why is this an incorrect situation? If ufshcd_get_max_pwr_mode() fails,
won't communication succeed with a lower power mode than maximum power?

Thanks,

Bart.