From: Jaegeuk Kim Date: Tue, 17 Nov 2020 16:58:33 +0000 (-0800) Subject: scsi: ufs: Avoid to call REQ_CLKS_OFF to CLKS_OFF X-Git-Tag: iomap-folio-5.17-old~2456^2~140 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fd62de114f8c9df098dcd43b5d83c5714176dd12;p=users%2Fwilly%2Flinux.git scsi: ufs: Avoid to call REQ_CLKS_OFF to CLKS_OFF Once UFS is gated with CLKS_OFF, it should not call REQ_CLKS_OFF again. This can lead to hibern8_enter failure. Link: https://lore.kernel.org/r/20201117165839.1643377-2-jaegeuk@kernel.org Reviewed-by: Can Guo Signed-off-by: Jaegeuk Kim Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 80cbce414678..9f53f6391342 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -1755,7 +1755,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;