storage: turn off writebooster flags upon init
Enabling writebooster capability for Pixel UFS (pa/2994670)
enabled the following flags in Android Common Kernel:
- wb_flush_en
- wb_flush_during_h8
- wb_enable
This patch disables these writebooster-related flags to restore the
intended behavior for Pixel devices. This overrides the default Android
Common Kernel behavior.
While 'wb_flush_en' and 'wb_enable' have corresponding sysfs entries
('enable_wb_buf_flush' and 'wb_on') for toggling,
'wb_flush_during_h8' currently lacks this functionality in the Android
Common Kernel. Pixel provides the 'manual_gc' sysfs entry as a
workaround. Setting 'manual_gc' to 0 disables 'wb_flush_during_h8'.
Bug: 377958570
Flag: EXEMPT bugfix
Test: check if all writebooster-realated flags are false upon init
Change-Id: I918bf6939de3e208b715f554a96ccbd053f68a18
Signed-off-by: Daniel Lee <chullee@google.com>
diff --git a/storage/init.storage.rc b/storage/init.storage.rc
index 9e4acd4..943c483 100644
--- a/storage/init.storage.rc
+++ b/storage/init.storage.rc
@@ -42,10 +42,13 @@
# UFS
write /dev/sys/block/bootdevice/clkgate_enable 0
+ write /dev/sys/block/bootdevice/wb_on 0
+ write /dev/sys/block/bootdevice/enable_wb_buf_flush 0
on property:sys.boot_completed=1
# Health Storage HAL
chown system system /dev/sys/block/bootdevice/manual_gc
+ write /dev/sys/block/bootdevice/manual_gc 0
# Pixelstats
chown system system /dev/sys/block/bootdevice/slowio_read_cnt