summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-backports-functools-lru-cache
diff options
context:
space:
mode:
authorErnest Van Hoecke <ernestvanhoecke@gmail.com>2025-07-02 16:32:09 +0200
committerKhem Raj <raj.khem@gmail.com>2025-07-02 23:27:07 -0700
commit88c7b3ee937bedc9ff46da009ca539662c4b6749 (patch)
treee922c77cadbdee8172bdd48232c4511f5e189373 /meta-python/recipes-devtools/python/python3-backports-functools-lru-cache
parentb7e233f84aeca74147c3e3cdf16cbe58bd0239f0 (diff)
downloadmeta-openembedded-88c7b3ee937bedc9ff46da009ca539662c4b6749.tar.gz
libusbgx: exit with failure code when no UDC is detected
The systemd target `usb-gadget.target` is triggered by udev when a UDC first comes up. It can happen that by the time gadget-start runs, this UDC has been removed from the system again. Have the gadget-start script exit with status 1 when `ls /sys/class/udc` returns nothing. Causing a service failure when no UDC is detected and no default was given, allows the service to be restarted by a udev rule calling the service (and not the target since those are not reentrant) directly. On its own this patch will not do much. 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 device mode. 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 as 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 Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-backports-functools-lru-cache')
0 files changed, 0 insertions, 0 deletions