From f13115f44c909e137aa8f1ff68d0c774759c83a2 Mon Sep 17 00:00:00 2001 From: Roy Luo Date: Fri, 23 Aug 2024 01:28:38 +0000 Subject: [PATCH] usb: correct sys.usb.controller sysprop system/core/init/init.cpp SetUsbController picks the first udc device if there're multiple udc devices present on the system to populate sys.usb.controller system property. CONFIG_USB_DUMMY_HCD enabled in kernel-5.10 GKI would introduce a dummy udc device named "dummy_udc.0". Depends on timing, the dummy device might be picked up by the init process and incorrectly populate sys.usb.controller. This issue only applies to devices on kernel-5.10 GKI, the WAR is to overwrite the sysprop if it's incorrectly populated by the dummy udc. Bug: 333778731 Test: tested on Cheetah Flag: EXEMPT bugfix Change-Id: I7555dda7f0bb436200ef7cd8a46b785232187cfd --- conf/init.gs201.usb.rc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/init.gs201.usb.rc b/conf/init.gs201.usb.rc index 9ba9eb8a..7d017d31 100644 --- a/conf/init.gs201.usb.rc +++ b/conf/init.gs201.usb.rc @@ -417,3 +417,7 @@ on property:ro.bootmode=usbuwb on property:vendor.usb.contaminantdisable=true exec /vendor/bin/hw/disable_contaminant_detection.sh + +# WAR for kernel 5.10 with CONFIG_USB_DUMMY_HCD enabled +on property:sys.usb.controller=dummy_udc.0 + setprop sys.usb.controller "11210000.dwc3"