Stanley Chu 93b6c5db06 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: Avri Altman <avri.altman@wdc.com>
Co-developed-by: Andy Teng <andy.teng@mediatek.com>
Signed-off-by: Andy Teng <andy.teng@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-08-17 21:52:45 -04:00
..
2020-08-07 18:48:15 -07:00
2020-08-06 16:50:07 -07:00
2019-11-07 06:43:18 -07:00
2020-03-11 23:07:59 -04:00
2020-08-06 16:50:07 -07:00
2020-06-15 23:28:04 -04:00
2020-08-06 16:50:07 -07:00
2020-08-14 16:01:59 -07:00
2020-08-14 16:01:59 -07:00
2020-08-06 16:50:07 -07:00
2020-08-06 16:50:07 -07:00
2020-08-06 16:50:07 -07:00
2020-08-06 16:50:07 -07:00
2020-08-06 16:50:07 -07:00
2020-08-06 16:50:07 -07:00
2020-08-07 18:48:15 -07:00
2019-03-02 11:39:54 -08:00
2019-11-12 22:21:35 -05:00
2020-02-24 14:54:25 -05:00
2020-03-11 23:07:59 -04:00
2020-04-14 21:32:39 -04:00
2019-01-08 21:58:35 -05:00
2019-07-11 15:14:01 -07:00
2020-07-28 22:34:52 -04:00
2020-07-24 22:09:55 -04:00
2020-08-06 16:50:07 -07:00
2018-11-06 21:31:28 -05:00
2020-07-24 22:09:55 -04:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:17:41 -07:00
2020-07-24 22:09:55 -04:00
2020-08-06 16:50:07 -07:00
2020-06-19 23:06:43 -04:00
2019-07-11 15:14:01 -07:00
2020-08-06 16:50:07 -07:00
2020-06-19 23:06:43 -04:00
2020-08-14 16:01:59 -07:00
2020-08-04 20:56:56 -04:00
2020-08-04 20:56:56 -04:00
2019-07-11 15:14:01 -07:00
2020-06-13 13:17:49 -07:00
2020-02-24 15:01:57 -05:00
2020-08-06 16:50:07 -07:00
2020-08-11 14:34:17 -07:00
2019-07-11 15:14:01 -07:00