diff mbox series

[v4,04/10] scsi: ufs: Enable IRQ after enabling clocks in error handling preparation

Message ID 1624433711-9339-5-git-send-email-cang@codeaurora.org (mailing list archive)
State Changes Requested
Headers show
Series Complementary changes for error handling | expand

Commit Message

Can Guo June 23, 2021, 7:35 a.m. UTC
In error handling preparation, enable IRQ after enabling clocks in case
unclocked register access happens.

Fixes: c72e79c0ad2bd ("scsi: ufs: Recover HBA runtime PM error in error handler")
Signed-off-by: Can Guo <cang@codeaurora.org>
---
 drivers/scsi/ufs/ufshcd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Bart Van Assche June 23, 2021, 9:20 p.m. UTC | #1
On 6/23/21 12:35 AM, Can Guo wrote:
> In error handling preparation, enable IRQ after enabling clocks in case
> unclocked register access happens.
> 
> Fixes: c72e79c0ad2bd ("scsi: ufs: Recover HBA runtime PM error in error handler")
> Signed-off-by: Can Guo <cang@codeaurora.org>
> ---
>  drivers/scsi/ufs/ufshcd.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index ee70522..5f837c4 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -5927,13 +5927,14 @@ static void ufshcd_err_handling_prepare(struct ufs_hba *hba)
>  		 * can be OFF or in LPM.
>  		 */
>  		ufshcd_setup_hba_vreg(hba, true);
> -		ufshcd_enable_irq(hba);
>  		ufshcd_setup_vreg(hba, true);
>  		ufshcd_config_vreg_hpm(hba, hba->vreg_info.vccq);
>  		ufshcd_config_vreg_hpm(hba, hba->vreg_info.vccq2);
>  		ufshcd_hold(hba, false);
> -		if (!ufshcd_is_clkgating_allowed(hba))
> +		if (!ufshcd_is_clkgating_allowed(hba)) {
>  			ufshcd_setup_clocks(hba, true);
> +			ufshcd_enable_irq(hba);
> +		}
>  		ufshcd_release(hba);
>  		pm_op = hba->is_wlu_sys_suspended ? UFS_SYSTEM_PM : UFS_RUNTIME_PM;
>  		ufshcd_vops_resume(hba, pm_op);

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index ee70522..5f837c4 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5927,13 +5927,14 @@  static void ufshcd_err_handling_prepare(struct ufs_hba *hba)
 		 * can be OFF or in LPM.
 		 */
 		ufshcd_setup_hba_vreg(hba, true);
-		ufshcd_enable_irq(hba);
 		ufshcd_setup_vreg(hba, true);
 		ufshcd_config_vreg_hpm(hba, hba->vreg_info.vccq);
 		ufshcd_config_vreg_hpm(hba, hba->vreg_info.vccq2);
 		ufshcd_hold(hba, false);
-		if (!ufshcd_is_clkgating_allowed(hba))
+		if (!ufshcd_is_clkgating_allowed(hba)) {
 			ufshcd_setup_clocks(hba, true);
+			ufshcd_enable_irq(hba);
+		}
 		ufshcd_release(hba);
 		pm_op = hba->is_wlu_sys_suspended ? UFS_SYSTEM_PM : UFS_RUNTIME_PM;
 		ufshcd_vops_resume(hba, pm_op);