From 9c3d77d0881a800396163f17ef2cb2ffc43b4f31 Mon Sep 17 00:00:00 2001 From: George Lee Date: Mon, 15 Mar 2021 09:16:37 -0700 Subject: [PATCH] power: Add policy to access sysfs_bcl Bug: 180620276 Test: adb bugreport dumpstate_board.txt shows: ------ BCL (/sys/devices/virtual/pmic/mitigation/triggered_stats) ------ Source Count Last Triggered Last SOC Last Voltage smpl_warn 0 0 0 0 ocp_cpu1 0 0 0 0 ocp_cpu2 0 0 0 0 soft_ocp_cpu1 0 0 0 0 soft_ocp_cpu2 0 0 0 0 ocp_tpu 0 0 0 0 soft_ocp_tpu 0 0 0 0 pmic_120c 0 0 0 0 pmic_140c 0 0 0 0 pmic_overheat 0 0 0 0 ocp_gpu 0 0 0 0 soft_ocp_gpu 0 0 0 0 ------ IF PMIC (/sys/devices/virtual/pmic/max77759-mitigation/triggered_stats) ------ Source Count Last Triggered Last SOC Last Voltage VDROOP1 0 0 0 0 VDROOP2 0 0 0 0 BATOILO 0 0 0 0 Signed-off-by: George Lee Change-Id: If7874e19b8202175071d474502e77748168565ce --- whitechapel/vendor/google/file.te | 3 +++ whitechapel/vendor/google/genfs_contexts | 8 ++++++++ whitechapel/vendor/google/hal_dumpstate_default.te | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/whitechapel/vendor/google/file.te b/whitechapel/vendor/google/file.te index 8a71cc1e..37fa6efb 100644 --- a/whitechapel/vendor/google/file.te +++ b/whitechapel/vendor/google/file.te @@ -159,6 +159,9 @@ type sysfs_chargelevel, sysfs_type, fs_type; type odpm_config_file, file_type, data_file_type; type sysfs_odpm, sysfs_type, fs_type; +# bcl +type sysfs_bcl, sysfs_type, fs_type; + # Chosen type sysfs_chosen, sysfs_type, fs_type; diff --git a/whitechapel/vendor/google/genfs_contexts b/whitechapel/vendor/google/genfs_contexts index 096e780e..a48b4a1f 100644 --- a/whitechapel/vendor/google/genfs_contexts +++ b/whitechapel/vendor/google/genfs_contexts @@ -127,6 +127,14 @@ genfscon sysfs /devices/platform/acpm_mfd_bus@17510000/i2c-8/8-002f/s2mpg11-mete genfscon sysfs /devices/platform/acpm_mfd_bus@17510000/i2c-8/8-002f/s2mpg11-meter/s2mpg11-odpm/iio:device1/sampling_rate u:object_r:sysfs_odpm:s0 genfscon sysfs /devices/platform/acpm_mfd_bus@17510000/i2c-8/8-002f/s2mpg11-meter/s2mpg11-odpm/iio:device1/enabled_rails u:object_r:sysfs_odpm:s0 +# bcl sysfs files +genfscon sysfs /devices/virtual/pmic/mitigation/triggered_stats u:object_r:sysfs_bcl:s0 +genfscon sysfs /devices/virtual/pmic/mitigation/mpmm_settings u:object_r:sysfs_bcl:s0 +genfscon sysfs /devices/virtual/pmic/mitigation/ppm_settings u:object_r:sysfs_bcl:s0 +genfscon sysfs /devices/virtual/pmic/mitigation/clk_ratio u:object_r:sysfs_bcl:s0 +genfscon sysfs /devices/virtual/pmic/mitigation/clk_stats u:object_r:sysfs_bcl:s0 +genfscon sysfs /devices/virtual/pmic/max77759-mitigation/triggered_stats u:object_r:sysfs_bcl:s0 + # Chosen genfscon sysfs /firmware/devicetree/base/chosen u:object_r:sysfs_chosen:s0 diff --git a/whitechapel/vendor/google/hal_dumpstate_default.te b/whitechapel/vendor/google/hal_dumpstate_default.te index a72f1257..ad7ec061 100644 --- a/whitechapel/vendor/google/hal_dumpstate_default.te +++ b/whitechapel/vendor/google/hal_dumpstate_default.te @@ -118,6 +118,10 @@ userdebug_or_eng(` allow hal_dumpstate_default vendor_votable_debugfs:dir r_dir_perms; allow hal_dumpstate_default vendor_votable_debugfs:file r_file_perms; + + allow hal_dumpstate_default sysfs_bcl:dir r_dir_perms; + allow hal_dumpstate_default sysfs_bcl:file r_file_perms; + allow hal_dumpstate_default sysfs_bcl:lnk_file read; ') dontaudit hal_dumpstate_default vendor_ion_debugfs:dir r_dir_perms;