From 1fd5db8246aa29df0469b06485db9713edd3a3be Mon Sep 17 00:00:00 2001 From: Leo Liou Date: Thu, 14 Sep 2023 12:39:36 +0800 Subject: [PATCH 1/3] gs201: ffu: add lifeC and activated date as condition Limit the following devices to accept ffu upgrade: - LifeC time < 10% - Activated date < 1 year Bug: 273305600 Test: run ffu process at local Change-Id: I9cc9298eeb7cd32f02a9577efb71bda0737f284d Signed-off-by: Leo Liou --- storage/ufs_firmware_update.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/storage/ufs_firmware_update.sh b/storage/ufs_firmware_update.sh index d118115f..a5cabfb9 100755 --- a/storage/ufs_firmware_update.sh +++ b/storage/ufs_firmware_update.sh @@ -6,13 +6,23 @@ ufs_dev="/dev/sys/block/bootdevice" fw_dir="/vendor/firmware" blk_dev="/dev/block/by-name/fips" +min_timestamp=$(date -d "2022-10-01" +%s) +epoch_1y=$(date -u -d "1971-01-01" +%s) vendor=$(cat ${ufs_dev}/vendor | tr -d "[:space:]") model=$(cat ${ufs_dev}/model | tr -d "[:space:]") rev=$(cat ${ufs_dev}/rev | tr -d "[:space:]") file=$(find ${fw_dir} -name "*${vendor}${model}${rev}*" | head -n 1) -if [ -n "$file" ]; then +lifec=$(cat ${ufs_dev}/health_descriptor/life_time_estimation_c | tr -d "[:space:]") +[ ! "$lifec" ] && lifec=0xff + +atime=$(ls -lu -d /data 2>&1 | awk '{print $6}') +timestamp=$(date -d "$atime" +%s) +(( $timestamp < $min_timestamp )) && timestamp=$min_timestamp +now=$(date +%s) + +if [ -n "$file" ] && (( $lifec < 0x0a )) && (( $timestamp + $epoch_1y >= $now )); then # The first 4KB block at fips partition has been occupied, and unused space begins from 4 KB # Refer to: go/pixel-mp-ffu-ota-1p dd if="$file" of=$blk_dev bs=4k seek=1 From e5cc14a4792d359171c2d47311b8514431154ccb Mon Sep 17 00:00:00 2001 From: Wilson Wu Date: Tue, 19 Sep 2023 06:09:26 +0000 Subject: [PATCH 2/3] Disable variable refresh rate when typing on gs201 Turn off config_variableRefreshRateTypingSupported on gs201. Bug: 299966467 Test: presubmit Change-Id: Idb98959749f365b7ed5f192a9f650b70a3840ae0 --- overlay/frameworks/base/core/res/res/values/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index f37aab51..3f1e2c1c 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -291,5 +291,5 @@ - true + false From c7042d8b23b527b14f580d839a0a45b57ab26782 Mon Sep 17 00:00:00 2001 From: Qais Yousef Date: Mon, 11 Sep 2023 17:11:12 +0000 Subject: [PATCH 3/3] init.gs201.rc: Disable util-awareness There are some regressions reports. Disable them completely for now. Bug: 297496375 Change-Id: I6478931d73145a15471982738f0ff93eae5f2f07 Signed-off-by: Qais Yousef --- conf/init.gs201.rc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/init.gs201.rc b/conf/init.gs201.rc index 2f62f695..847c2611 100644 --- a/conf/init.gs201.rc +++ b/conf/init.gs201.rc @@ -16,6 +16,8 @@ on init # Set teo as cpu idle governor write /sys/devices/system/cpu/cpuidle/current_governor teo + # Disable util-awareness + write /proc/vendor_sched/teo_util_threshold "1024 1024 1024" # Boot time fs tuning write /sys/block/sda/queue/iostats 0