From 0a0bf76f74a6d2b7ad250ae19dafbf6f693892c8 Mon Sep 17 00:00:00 2001 From: Donnie Pollitz Date: Tue, 16 May 2023 13:54:50 +0200 Subject: [PATCH 1/4] Make sure nsp storage has the right owner/group Background: * Not all secure storage files had the correct ownership transitions. Bug: 280325952 Test: Changed permissions and confirmed user transitions Change-Id: Iafa32e27b7c24bda41cf251048995ae96b3ce8f7 Signed-off-by: Donnie Pollitz --- conf/init.zuma.rc | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/init.zuma.rc b/conf/init.zuma.rc index e5e199d5..6f6a10ec 100644 --- a/conf/init.zuma.rc +++ b/conf/init.zuma.rc @@ -919,6 +919,7 @@ on post-fs-data chmod 0770 /data/vendor/ss/persist symlink /dev/block/platform/13200000\.ufs/by-name/trusty_persist /data/vendor/ss/persist/0 chown system system /data/vendor/ss/persist/0 + chown system system /data/vendor/ss/persist/nsp restart storageproxyd From 3d72a5b29f412a3c5424bf160de732c570e8b92a Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Wed, 17 May 2023 06:06:03 +0000 Subject: [PATCH 2/4] Disable USB contaminant detection when the disable flag is true (ported from 6b1106498e1164f46b9a895ed2258a20a0c7a7b5) Bug: 263916675 Bug: 264231895 Test: setprop vendor.usb.contaminantdisable true Change-Id: I57ea8280e4af3720dce9d9174b1cc24066c5324e Signed-off-by: Jimmy Hu --- Android.bp | 7 +++++++ conf/init.zuma.usb.rc | 3 +++ device.mk | 4 ++++ disable_contaminant_detection.sh | 7 +++++++ 4 files changed, 21 insertions(+) create mode 100644 disable_contaminant_detection.sh diff --git a/Android.bp b/Android.bp index ef1e4b44..bf7fac7e 100644 --- a/Android.bp +++ b/Android.bp @@ -34,3 +34,10 @@ license { "NOTICE", ], } + +sh_binary { + name: "disable_contaminant_detection.sh", + src: "disable_contaminant_detection.sh", + vendor: true, + sub_dir: "hw", +} diff --git a/conf/init.zuma.usb.rc b/conf/init.zuma.usb.rc index d8925eaa..b6bf02d8 100644 --- a/conf/init.zuma.usb.rc +++ b/conf/init.zuma.usb.rc @@ -195,6 +195,9 @@ on property:sys.usb.config=charger && property:sys.usb.configfs=1 on property:ro.bootmode=usbuwb setprop persist.vendor.usb.usbradio.config uwb_acm +on property:vendor.usb.contaminantdisable=true + exec /vendor/bin/hw/disable_contaminant_detection.sh + on property:persist.vendor.usb.displayport.enabled=1 write /sys/class/typec/port0/port0.0/mode1/active "yes" diff --git a/device.mk b/device.mk index e9eb238d..be0249d0 100644 --- a/device.mk +++ b/device.mk @@ -359,6 +359,10 @@ PRODUCT_COPY_FILES += \ device/google/$(TARGET_BOARD_PLATFORM)/conf/fstab.persist:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.persist \ device/google/$(TARGET_BOARD_PLATFORM)/conf/fstab.modem:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.modem +# Shell scripts +PRODUCT_PACKAGES += \ + disable_contaminant_detection.sh + include device/google/gs-common/insmod/insmod.mk # Insmod config files diff --git a/disable_contaminant_detection.sh b/disable_contaminant_detection.sh new file mode 100644 index 00000000..07149643 --- /dev/null +++ b/disable_contaminant_detection.sh @@ -0,0 +1,7 @@ +#!/vendor/bin/sh + +for f in /sys/devices/platform/10cb0000.hsi2c/i2c-*/*-0025; do + if [ -d $f ]; then + echo 0 > $f/contaminant_detection; + fi +done From 1cd9bdb775f29ca0730d995a2fe695fd525db17f Mon Sep 17 00:00:00 2001 From: Rick Yiu Date: Wed, 24 May 2023 03:31:18 +0000 Subject: [PATCH 3/4] Restore uclamp.max for bg groups These values could indicate if cpu is running important tasks. Bug: 201260585 Test: build pass Change-Id: I2fce47de1833ed0814049e22199d0cdd41e80dc3 --- conf/init.zuma.rc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/init.zuma.rc b/conf/init.zuma.rc index e5e199d5..0d7a66e8 100644 --- a/conf/init.zuma.rc +++ b/conf/init.zuma.rc @@ -790,6 +790,12 @@ on property:sys.boot_completed=1 # Set bg group throttle write /proc/vendor_sched/ug_bg_group_throttle 308 + # Set uclamp.max for some groups, which could indicate cpu importance used in scheduling + write /proc/vendor_sched/bg_uclamp_max 512 + write /proc/vendor_sched/sysbg_uclamp_max 512 + write /proc/vendor_sched/ota_uclamp_max 512 + write /proc/vendor_sched/dex2oat_uclamp_max 615 + # Set PMU freq limit parameters write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/lcpi_threshold 2 write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/spc_threshold 59 From da11085b13ae235d30ebca568982f74bfb6d000e Mon Sep 17 00:00:00 2001 From: Sam Dubey Date: Wed, 24 May 2023 10:40:48 +0000 Subject: [PATCH 4/4] Revert "Make sure nsp storage has the right owner/group" Revert submission 23280559-nsp Reason for revert: b/284107307 Reverted changes: /q/submissionid:23280559-nsp Change-Id: I60c726a4710b934e0760a0227a5a6074fcfe5d38 --- conf/init.zuma.rc | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/init.zuma.rc b/conf/init.zuma.rc index 6f6a10ec..e5e199d5 100644 --- a/conf/init.zuma.rc +++ b/conf/init.zuma.rc @@ -919,7 +919,6 @@ on post-fs-data chmod 0770 /data/vendor/ss/persist symlink /dev/block/platform/13200000\.ufs/by-name/trusty_persist /data/vendor/ss/persist/0 chown system system /data/vendor/ss/persist/0 - chown system system /data/vendor/ss/persist/nsp restart storageproxyd