From 3caf4a5a8be4b457c0064cb7580f182cca15c9b8 Mon Sep 17 00:00:00 2001 From: Ziqi Chen Date: Wed, 16 Mar 2022 13:32:31 +0900 Subject: [PATCH] sm7250-common: init: Tuning UFS clkgate and ah8 during boot time Disabling UFS clkgate and ah8 during boot time helps in reducing IO delays, which helps in reducing the total boot time. This change will disable UFS clkgate and ah8 during early-init and then enable it back after boot completion. Change-Id: I6a10cd57a30fe3bdc4fba72a0d84cdfa3b1fd513 Signed-off-by: Omkar Chandorkar Signed-off-by: aswin7469 --- rootdir/etc/init.qcom.rc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 3be191b..033b436 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -61,6 +61,10 @@ on early-init #Disable UFS clock scaling write /sys/bus/platform/devices/1d84000.ufshc/clkscale_enable 0 + # Disable UFS auto_hibern8 + write /sys/bus/platform/devices/1d84000.ufshc/auto_hibern8 0 + # Disable UFS clock gating + write /sys/bus/platform/devices/1d84000.ufshc/clkgate_enable 0 chown root system /dev/kmsg chmod 0620 /dev/kmsg @@ -496,6 +500,10 @@ on property:sys.boot_completed=1 write /dev/kmsg "Boot completed " #Enable UFS clock scaling back write /sys/bus/platform/devices/1d84000.ufshc/clkscale_enable 1 + #Enable UFS auto_hibern8 back + write /sys/bus/platform/devices/1d84000.ufshc/auto_hibern8 5000 + #Enable UFS clock gating back + write /sys/bus/platform/devices/1d84000.ufshc/clkgate_enable 1 #Reset read ahead for dm-0 and dm-1 to 512kb write /sys/block/dm-0/queue/read_ahead_kb 512 write /sys/block/dm-1/queue/read_ahead_kb 512