scsi: ufs: qcom: Check the return value of ufs_qcom_power_up_sequence()
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Fri, 8 Dec 2023 06:58:53 +0000 (12:28 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 14 Dec 2023 04:03:45 +0000 (23:03 -0500)
If ufs_qcom_power_up_sequence() fails, then it makes no sense to enable the
lane clocks and continue ufshcd_hba_enable(). So let's check the return
value of ufs_qcom_power_up_sequence().

Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20231208065902.11006-9-manivannan.sadhasivam@linaro.org
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/host/ufs-qcom.c

index 365a61dbf7ea413dc8a8d9b34c7ac508915a7d82..b141dd2a9346a0343e3616c2c3f52027dc462254 100644 (file)
@@ -417,7 +417,10 @@ static int ufs_qcom_hce_enable_notify(struct ufs_hba *hba,
 
        switch (status) {
        case PRE_CHANGE:
-               ufs_qcom_power_up_sequence(hba);
+               err = ufs_qcom_power_up_sequence(hba);
+               if (err)
+                       return err;
+
                /*
                 * The PHY PLL output is the source of tx/rx lane symbol
                 * clocks, hence, enable the lane clocks only after PHY