summaryrefslogtreecommitdiff
path: root/backport/compat/backport-3.12.c
diff options
context:
space:
mode:
authorErnest Van Hoecke <ernest.vanhoecke@toradex.com>2025-07-16 16:24:58 +0200
committerErnest Van Hoecke <ernest.vanhoecke@toradex.com>2025-07-22 12:00:54 +0200
commitb25ffb88658ca64944941648a0f5fcde8a51261d (patch)
tree8aa79bd334977b851e0a0425c30afea8cd9dd8d4 /backport/compat/backport-3.12.c
parentfcc6995eff6dfb78b224ccca3368d2b71de2c3a9 (diff)
libusbgx: call gadget-start from udev instead of usbgx.service
The systemd target `usb-gadget.target` is triggered by udev when a UDC first comes up. The usbgx service uses this target and executes gadget-start to initialize the gadget. It can happen that by the time gadget-start runs, the UDC has been removed from the system again. For example, we saw such a situation using the DWC3 USB controller and usb-conn-gpio kernel modules as loadables. By the time of the DWC3 init, udev was active, and during init DWC3 started the USB OTG port in devicemode, generating a udev add event. If a pen drive was plugged in at boot, it would quickly switch to host mode right after initialisation, emitting another udev event for the removal of the UDC. The systemd target is thus reached, but by the time gadget-start ran, the UDC was gone. dwc3 init usb-conn-gpio role switch │ │ ▼ ▼ udev: add UDC─┐ udev: del UDC─────►/sys/class/udc empty │ │ │ x │ │ │ ▼ └────────────►usb-gadget.target─────►gadget-start Call gadget-start from udev every time a UDC comes up instead of only once via the systemd service (usbgx.service). Repeated runs of this script are not problematic. Related-to: ELB-6355 Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com> (cherry picked from commit 4ba1cebc6909ee7a83d569e8cc748f69e6a0a24f)
Diffstat (limited to 'backport/compat/backport-3.12.c')
0 files changed, 0 insertions, 0 deletions