diff mbox series

[v3] scsi: ufs: qcom: Return ufs_qcom_clk_scale_*() errors in ufs_qcom_clk_scale_notify()

Message ID 20231215003812.29650-1-cw9316.lee@samsung.com (mailing list archive)
State Accepted
Headers show
Series [v3] scsi: ufs: qcom: Return ufs_qcom_clk_scale_*() errors in ufs_qcom_clk_scale_notify() | expand

Commit Message

Chanwoo Lee Dec. 15, 2023, 12:38 a.m. UTC
From: ChanWoo Lee <cw9316.lee@samsung.com>

In commit 031312dbc695 ("scsi: ufs: ufs-qcom: Remove unnecessary goto statements")
the error handling was accidentally changed, resulting in the error of
ufs_qcom_clk_scale_*() calls not being returned.

This is the case I checked.
* ufs_qcom_clk_scale_notify -> 'ufs_qcom_clk_scale_up_/down_pre_change' error -> return 0;

Let's make sure those errors are properly returned.

Fixes: 031312dbc695 ("scsi: ufs: ufs-qcom: Remove unnecessary goto statements")
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com>
---
* v2->v3: Change title and description
  v2 :
     https://patchwork.kernel.org/project/linux-scsi/patch/20231214021401.26474-1-cw9316.lee@samsung.com/

* v1->v2: Remove things already in progress
  v1 :
     https://patchwork.kernel.org/project/linux-scsi/patch/20231213022500.9011-1-cw9316.lee@samsung.com/
---
---
 drivers/ufs/host/ufs-qcom.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Andrew Halaney Dec. 15, 2023, 3:05 p.m. UTC | #1
On Fri, Dec 15, 2023 at 09:38:12AM +0900, Chanwoo Lee wrote:
> From: ChanWoo Lee <cw9316.lee@samsung.com>
> 
> In commit 031312dbc695 ("scsi: ufs: ufs-qcom: Remove unnecessary goto statements")
> the error handling was accidentally changed, resulting in the error of
> ufs_qcom_clk_scale_*() calls not being returned.
> 
> This is the case I checked.
> * ufs_qcom_clk_scale_notify -> 'ufs_qcom_clk_scale_up_/down_pre_change' error -> return 0;
> 
> Let's make sure those errors are properly returned.
> 
> Fixes: 031312dbc695 ("scsi: ufs: ufs-qcom: Remove unnecessary goto statements")

Thanks for the changes. Looks good to me now:

    Reviewed-by: Andrew Halaney <ahalaney@redhat.com>

> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com>
> ---
> * v2->v3: Change title and description
>   v2 :
>      https://patchwork.kernel.org/project/linux-scsi/patch/20231214021401.26474-1-cw9316.lee@samsung.com/
> 
> * v1->v2: Remove things already in progress
>   v1 :
>      https://patchwork.kernel.org/project/linux-scsi/patch/20231213022500.9011-1-cw9316.lee@samsung.com/
> ---
> ---
>  drivers/ufs/host/ufs-qcom.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 96cb8b5b4e66..17e24270477d 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1516,9 +1516,11 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba,
>  			err = ufs_qcom_clk_scale_up_pre_change(hba);
>  		else
>  			err = ufs_qcom_clk_scale_down_pre_change(hba);
> -		if (err)
> -			ufshcd_uic_hibern8_exit(hba);
>  
> +		if (err) {
> +			ufshcd_uic_hibern8_exit(hba);
> +			return err;
> +		}
>  	} else {
>  		if (scale_up)
>  			err = ufs_qcom_clk_scale_up_post_change(hba);
> -- 
> 2.29.0
>
Martin K. Petersen Dec. 19, 2023, 2:19 a.m. UTC | #2
On Fri, 15 Dec 2023 09:38:12 +0900, Chanwoo Lee wrote:

> In commit 031312dbc695 ("scsi: ufs: ufs-qcom: Remove unnecessary goto statements")
> the error handling was accidentally changed, resulting in the error of
> ufs_qcom_clk_scale_*() calls not being returned.
> 
> This is the case I checked.
> * ufs_qcom_clk_scale_notify -> 'ufs_qcom_clk_scale_up_/down_pre_change' error -> return 0;
> 
> [...]

Applied to 6.7/scsi-fixes, thanks!

[1/1] scsi: ufs: qcom: Return ufs_qcom_clk_scale_*() errors in ufs_qcom_clk_scale_notify()
      https://git.kernel.org/mkp/scsi/c/9264fd61e628
diff mbox series

Patch

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 96cb8b5b4e66..17e24270477d 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1516,9 +1516,11 @@  static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba,
 			err = ufs_qcom_clk_scale_up_pre_change(hba);
 		else
 			err = ufs_qcom_clk_scale_down_pre_change(hba);
-		if (err)
-			ufshcd_uic_hibern8_exit(hba);
 
+		if (err) {
+			ufshcd_uic_hibern8_exit(hba);
+			return err;
+		}
 	} else {
 		if (scale_up)
 			err = ufs_qcom_clk_scale_up_post_change(hba);