From 8f29c69ab628628309fb8ab3c9ddf8f11ba2f615 Mon Sep 17 00:00:00 2001 From: Ziqi Chen Date: Wed, 16 Mar 2022 13:32:31 +0900 Subject: [PATCH] sm8150-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 --- init/etc/init.qcom.rc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init/etc/init.qcom.rc b/init/etc/init.qcom.rc index df20f42b..7bc8db80 100644 --- a/init/etc/init.qcom.rc +++ b/init/etc/init.qcom.rc @@ -55,6 +55,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 @@ -532,6 +536,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