scsi: ufs: set autohibern8 timer regardless of hibern8_on_idle

This fixes disabling autohibern8 by the previous commit.

Bug: 151321015
Bug: 152116476
Fixes: 5a57ae46dd6 ("scsi: ufs: disable hibern8_on_idle")
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Change-Id: If71f3212081f62d9c92b8f611aadb4f547ced1e0
fourteen
Jaegeuk Kim 5 years ago committed by Jenna
parent 86525723ea
commit 2b9310ad9c
  1. 12
      drivers/scsi/ufs/ufshcd.c

@ -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",

Loading…
Cancel
Save