File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -3884,18 +3884,25 @@ EXPORT_SYMBOL_GPL(ufshcd_uic_hibern8_exit);
3884
3884
void ufshcd_auto_hibern8_update (struct ufs_hba * hba , u32 ahit )
3885
3885
{
3886
3886
unsigned long flags ;
3887
+ bool update = false;
3887
3888
3888
- if (!(hba -> capabilities & MASK_AUTO_HIBERN8_SUPPORT ))
3889
+ if (!ufshcd_is_auto_hibern8_supported (hba ))
3889
3890
return ;
3890
3891
3891
3892
spin_lock_irqsave (hba -> host -> host_lock , flags );
3892
- if (hba -> ahit == ahit )
3893
- goto out_unlock ;
3894
- hba -> ahit = ahit ;
3895
- if (!pm_runtime_suspended (hba -> dev ))
3896
- ufshcd_writel (hba , hba -> ahit , REG_AUTO_HIBERNATE_IDLE_TIMER );
3897
- out_unlock :
3893
+ if (hba -> ahit != ahit ) {
3894
+ hba -> ahit = ahit ;
3895
+ update = true;
3896
+ }
3898
3897
spin_unlock_irqrestore (hba -> host -> host_lock , flags );
3898
+
3899
+ if (update && !pm_runtime_suspended (hba -> dev )) {
3900
+ pm_runtime_get_sync (hba -> dev );
3901
+ ufshcd_hold (hba , false);
3902
+ ufshcd_auto_hibern8_enable (hba );
3903
+ ufshcd_release (hba );
3904
+ pm_runtime_put (hba -> dev );
3905
+ }
3899
3906
}
3900
3907
EXPORT_SYMBOL_GPL (ufshcd_auto_hibern8_update );
3901
3908
You can’t perform that action at this time.
0 commit comments