From dfd06cdff2c74deae4e08d759d39d63579a14885 Mon Sep 17 00:00:00 2001 From: Venkat Gopalakrishnan Date: Tue, 4 Oct 2016 10:01:31 -0700 Subject: [PATCH] scsi: ufs: reduce auto hibern8 timeout to save power The PA_Hibern8Time and PA_TActivate time in most devices are well under 1ms combined thereby the overall hibern8 enter/exit latencies are under 1ms as well. Entering hibern8 as soon as possible saves power consumption, hence reduce the auto hibern8 timeout to 1ms. Change-Id: If58590fc397ec8eb88906c103247bb48710805db Signed-off-by: Venkat Gopalakrishnan --- drivers/scsi/ufs/ufshcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index dcc2cb8193a1..d254faacfcfe 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -1948,6 +1948,7 @@ static void ufshcd_init_hibern8_on_idle(struct ufs_hba *hba) return; if (ufshcd_is_auto_hibern8_supported(hba)) { + hba->hibern8_on_idle.delay_ms = 1; hba->hibern8_on_idle.state = AUTO_HIBERN8; /* * Disable SW hibern8 enter on idle in case @@ -1955,13 +1956,13 @@ static void ufshcd_init_hibern8_on_idle(struct ufs_hba *hba) */ hba->caps &= ~UFSHCD_CAP_HIBERN8_ENTER_ON_IDLE; } else { + hba->hibern8_on_idle.delay_ms = 10; INIT_DELAYED_WORK(&hba->hibern8_on_idle.enter_work, ufshcd_hibern8_enter_work); INIT_WORK(&hba->hibern8_on_idle.exit_work, ufshcd_hibern8_exit_work); } - hba->hibern8_on_idle.delay_ms = 10; hba->hibern8_on_idle.is_enabled = true; hba->hibern8_on_idle.delay_attr.show =