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: Idefd1a5d8154a51792c6cb52ee6d11cbb7f6df78
This commit is contained in:
Roy Luo 2024-08-23 18:10:22 +00:00
parent 6c2502279f
commit 8d0a51e591

View file

@ -414,3 +414,7 @@ on property:vendor.usb.contaminantdisable=true
on property:ro.bootmode=usbuwb
setprop persist.vendor.usb.usbradio.config uwb_acm
# WAR for kernel 5.10 with CONFIG_USB_DUMMY_HCD enabled
on property:sys.usb.controller=dummy_udc.0
setprop sys.usb.controller "11110000.dwc3"