lkml.org 
[lkml]   [2021]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 02/10] scsi: ufs: Add flags pm_op_in_progress and is_sys_suspended
From
Date
On 6/23/21 12:35 AM, Can Guo wrote:
> @@ -9141,6 +9143,8 @@ static int ufshcd_suspend(struct ufs_hba *hba)
>
> if (!hba->is_powered)
> return 0;
> +
> + hba->pm_op_in_progress = true;
> /*
> * Disable the host irq as host controller as there won't be any
> * host controller transaction expected till resume.
> @@ -9160,6 +9164,7 @@ static int ufshcd_suspend(struct ufs_hba *hba)
> ufshcd_vreg_set_lpm(hba);
> /* Put the host controller in low power mode if possible */
> ufshcd_hba_vreg_set_lpm(hba);
> + hba->pm_op_in_progress = false;
> return ret;
> }
>
> @@ -9179,6 +9184,7 @@ static int ufshcd_resume(struct ufs_hba *hba)
> if (!hba->is_powered)
> return 0;
>
> + hba->pm_op_in_progress = true;
> ufshcd_hba_vreg_set_hpm(hba);
> ret = ufshcd_vreg_set_hpm(hba);
> if (ret)
> @@ -9198,6 +9204,7 @@ static int ufshcd_resume(struct ufs_hba *hba)
> out:
> if (ret)
> ufshcd_update_evt_hist(hba, UFS_EVT_RESUME_ERR, (u32)ret);
> + hba->pm_op_in_progress = false;
> return ret;
> }

Has it been considered to check dev->power.runtime_status instead of
introducing the pm_op_in_progress variable?

Thanks,

Bart.

\
 
 \ /
  Last update: 2021-06-24 19:35    [W:0.071 / U:1.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site