From b5769ac1f146d3317ca22d56f828fc9d4e107917 Mon Sep 17 00:00:00 2001 From: Sergey Volk Date: Wed, 14 Feb 2024 00:57:52 +0000 Subject: [PATCH] Fix permissions for dp_hotplug_error_code sysfs node DisplayPort kernel driver passes error code/status to hardware composer via the dp_hotplug_error_code sysfs file. When HWC receives/consumes the error, it will write "0" into that file to reset the error code. So this file must be readable and writable by the HWC code running with "system" user/group permissions. Previously we used to set the ownership to system:system, but in order to be more consistent with the rest of sysfs files in that directory, we can use root:graphics instead with permissions 0664. HWC runs under the "graphics" group, so this should allow HWC write access. Bug: 324953626 Test: checked permissions of dp_hotplug_error_code sysfs Change-Id: Idf65acc12d158a78565c41f4e2aea24362e2cdff --- conf/init.zuma.rc | 2 -- usb/usb/android.hardware.usb-service.rc | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/init.zuma.rc b/conf/init.zuma.rc index 9c42d3cb..b6e622e5 100644 --- a/conf/init.zuma.rc +++ b/conf/init.zuma.rc @@ -681,8 +681,6 @@ on fs chown system system /sys/class/dqe0/atc/gain_limit chown system system /sys/class/dqe0/atc/lt_calc_ab_shift - chown system system /sys/devices/platform/110f0000.drmdp/drm-displayport/dp_hotplug_error_code - chown system system /sys/devices/platform/19470000.drmdecon/early_wakeup chmod 0660 /sys/devices/platform/19470000.drmdecon/early_wakeup diff --git a/usb/usb/android.hardware.usb-service.rc b/usb/usb/android.hardware.usb-service.rc index e710451e..9d10bb37 100644 --- a/usb/usb/android.hardware.usb-service.rc +++ b/usb/usb/android.hardware.usb-service.rc @@ -16,6 +16,7 @@ on post-fs chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_sink_enable chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_source_enable chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/update_sdp_enum_timeout + chown root graphics /sys/devices/platform/110f0000.drmdp/drm-displayport/dp_hotplug_error_code chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation @@ -40,6 +41,7 @@ on post-fs chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_sink_enable chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_source_enable chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/update_sdp_enum_timeout + chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/dp_hotplug_error_code chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation