|
|
|
@ -3062,6 +3062,9 @@ static void ufshcd_exit_clk_gating(struct ufs_hba *hba) |
|
|
|
|
|
|
|
|
|
static void ufshcd_set_auto_hibern8_timer(struct ufs_hba *hba, u32 delay) |
|
|
|
|
{ |
|
|
|
|
if (!ufshcd_is_auto_hibern8_supported(hba)) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
ufshcd_rmwl(hba, AUTO_HIBERN8_TIMER_SCALE_MASK | |
|
|
|
|
AUTO_HIBERN8_IDLE_TIMER_MASK, |
|
|
|
|
AUTO_HIBERN8_TIMER_SCALE_1_MS | delay, |
|
|
|
@ -3415,7 +3418,8 @@ static void ufshcd_init_hibern8_on_idle(struct ufs_hba *hba) |
|
|
|
|
/* initialize the state variable here */ |
|
|
|
|
hba->hibern8_on_idle.state = HIBERN8_EXITED; |
|
|
|
|
|
|
|
|
|
if (!ufshcd_is_hibern8_on_idle_allowed(hba)) |
|
|
|
|
if (!ufshcd_is_hibern8_on_idle_allowed(hba) && |
|
|
|
|
!ufshcd_is_auto_hibern8_supported(hba)) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if (ufshcd_is_auto_hibern8_supported(hba)) { |
|
|
|
@ -3426,6 +3430,7 @@ static void ufshcd_init_hibern8_on_idle(struct ufs_hba *hba) |
|
|
|
|
* auto hibern8 is supported |
|
|
|
|
*/ |
|
|
|
|
hba->caps &= ~UFSHCD_CAP_HIBERN8_ENTER_ON_IDLE; |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
hba->hibern8_on_idle.delay_ms = 10; |
|
|
|
|
INIT_DELAYED_WORK(&hba->hibern8_on_idle.enter_work, |
|
|
|
@ -10198,10 +10203,7 @@ retry: |
|
|
|
|
* Enable auto hibern8 if supported, after full host and |
|
|
|
|
* device initialization. |
|
|
|
|
*/ |
|
|
|
|
if (ufshcd_is_auto_hibern8_supported(hba) && |
|
|
|
|
hba->hibern8_on_idle.is_enabled) |
|
|
|
|
ufshcd_set_auto_hibern8_timer(hba, |
|
|
|
|
hba->hibern8_on_idle.delay_ms); |
|
|
|
|
ufshcd_set_auto_hibern8_timer(hba, hba->hibern8_on_idle.delay_ms); |
|
|
|
|
out: |
|
|
|
|
if (ret && link_retry_count++ < UFS_LINK_SETUP_RETRIES) { |
|
|
|
|
dev_err(hba->dev, "%s: error with %d, and will be reset.(%d)\n", |
|
|
|
|