diff mbox series

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

Message ID 300052382d9d03bf087d71201bd159805b8fd041.1728544727.git.hy50.seo@samsung.com (mailing list archive)
State New
Headers show
Series processing of asymmetric connected lanes | expand

Commit Message

SEO HOYOUNG Oct. 10, 2024, 7:52 a.m. UTC
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(-)

Comments

Bart Van Assche Oct. 15, 2024, 6:13 p.m. UTC | #1
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.
diff mbox series

Patch

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__);