From 350e26241504bb140122f396f3447d8ce36ef574 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Mon, 18 Nov 2024 10:38:21 -0800 Subject: [PATCH] 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 --- storage/init.storage.rc | 3 +++ 1 file changed, 3 insertions(+) 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 @@ on init # 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