Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 46c313b6 authored by Winter Wang's avatar Winter Wang
Browse files

init: usb: disable usb function switch until adbd is ready



In the case of adb enabled, When a usb function switch happens
e.g mtp,adb -> ptp,adb, framework will set sys.usb.config from
"mtp,adb" to "none" and stop adbd first.
At this time, the property "sys.usb.ffs.ready", which is set after
the ready of the perious start adbd, is still "1".
So , when framework goes on setting the sys.usb.config to "ptp,adb",
init.usb.configfs.rc will trigger actions to bind() f_fs without
waiting for adbd is actually ready.

This will produce some error messages:
------------
configfs-gadget ci_hdrc.0: failed to start g1: -19
init: write_file: Unable to write to '/config/usb_gadget/g1/UDC': No such device
------------
this error msg is caused by configFS start binding f_fs before adbd is ready.

Add setting the "sys.usb.ffs.ready" to "0" will help clear this error msg,
as the bind process in kernel gadget driver will wait for the set of
this property, which is the sign of adbd is ready.

Signed-off-by: default avatarWinter Wang <wente.wang@nxp.com>
parent 2c78f626
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment