Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 48eafd42 authored by Stanley Chu's avatar Stanley Chu Committed by Todd Kjos
Browse files

UPSTREAM: scsi: ufs: Fix possible infinite loop in ufshcd_hold

In ufshcd_suspend(), after clk-gating is suspended and link is set
as Hibern8 state, ufshcd_hold() is still possibly invoked before
ufshcd_suspend() returns. For example, MediaTek's suspend vops may
issue UIC commands which would call ufshcd_hold() during the command
issuing flow.

Now if UFSHCD_CAP_HIBERN8_WITH_CLK_GATING capability is enabled,
then ufshcd_hold() may enter infinite loops because there is no
clk-ungating work scheduled or pending. In this case, ufshcd_hold()
shall just bypass, and keep the link as Hibern8 state.

Link: https://lore.kernel.org/r/20200809050734.18740-1-stanley.chu@mediatek.com


Reviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
Co-developed-by: default avatarAndy Teng <andy.teng@mediatek.com>
Signed-off-by: default avatarAndy Teng <andy.teng@mediatek.com>
Signed-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>

Bug: 166747994
(cherry picked from commit 93b6c5db06028a3b55122bbb74d0715dd8ca4ae0)
Change-Id: I595ee3f0da3b89e11cbe5d6d31ba7ce58b1757bc
Signed-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
parent 45f61ca7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment