2020-11-17 17:05:38

by Jaegeuk Kim

[permalink] [raw]
Subject: [PATCH v5 1/7] scsi: ufs: avoid to call REQ_CLKS_OFF to CLKS_OFF

Once UFS was gated with CLKS_OFF, it should not call REQ_CLKS_OFF again, which
caused hibern8_enter failure.

Signed-off-by: Jaegeuk Kim <[email protected]>
---
drivers/scsi/ufs/ufshcd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index b8f573a02713..cc8d5f0c3fdc 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1745,7 +1745,8 @@ static void __ufshcd_release(struct ufs_hba *hba)
if (hba->clk_gating.active_reqs || hba->clk_gating.is_suspended ||
hba->ufshcd_state != UFSHCD_STATE_OPERATIONAL ||
ufshcd_any_tag_in_use(hba) || hba->outstanding_tasks ||
- hba->active_uic_cmd || hba->uic_async_done)
+ hba->active_uic_cmd || hba->uic_async_done ||
+ hba->clk_gating.state == CLKS_OFF)
return;

hba->clk_gating.state = REQ_CLKS_OFF;
--
2.29.2.299.gdc1121823c-goog


2020-11-18 03:57:24

by Can Guo

[permalink] [raw]
Subject: Re: [PATCH v5 1/7] scsi: ufs: avoid to call REQ_CLKS_OFF to CLKS_OFF

On 2020-11-18 00:58, Jaegeuk Kim wrote:
> Once UFS was gated with CLKS_OFF, it should not call REQ_CLKS_OFF
> again, which
> caused hibern8_enter failure.
>
> Signed-off-by: Jaegeuk Kim <[email protected]>

Reviewed-by: Can Guo <[email protected]>

> ---
> drivers/scsi/ufs/ufshcd.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index b8f573a02713..cc8d5f0c3fdc 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -1745,7 +1745,8 @@ static void __ufshcd_release(struct ufs_hba *hba)
> if (hba->clk_gating.active_reqs || hba->clk_gating.is_suspended ||
> hba->ufshcd_state != UFSHCD_STATE_OPERATIONAL ||
> ufshcd_any_tag_in_use(hba) || hba->outstanding_tasks ||
> - hba->active_uic_cmd || hba->uic_async_done)
> + hba->active_uic_cmd || hba->uic_async_done ||
> + hba->clk_gating.state == CLKS_OFF)
> return;
>
> hba->clk_gating.state = REQ_CLKS_OFF;