Re: [PATCH] usb: misc: onboard_usb_dev: don't defer the USB device probe

From: Johan Hovold

Date: Fri Oct 30 2026 - 09:35:24 EST


On Fri, Oct 30, 2026 at 06:47:05PM +0700, James Clark wrote:

> At that point, onboard_dev_usbdev_probe() returns -EPROBE_DEFER. This is
> what causes the problem. The driver has generic_subclass set, so
> usb_probe_device() has already run the generic probe, which configured
> the device and bound the interface drivers. Each binding is a
> deferred-probe trigger, and the driver core re-triggers when a trigger
> happened during a probe that then deferred. So the device is re-probed
> straight away, reconfigured, its interfaces bound again, and so on for
> as long as the platform device remains unbound. This is not specific to
> shared GPIOs: it happens whenever the platform probe is deferred, and
> briefly whenever onboard_usb_dev is a module.

This is indeed a bug in the onboard_usb_dev driver as a driver is not
allowed to probe defer after it has registered devices for precisely the
reason that it will trigger a probe loop (see commit fbc35b45f9f6 ("Add
documentation on meaning of -EPROBE_DEFER")).

Any USB driver using generic_subclass that may probe defer is currently
broken.

I guess you can look into replacing generic_subclass with having the
onboard_usb_dev driver call usb_generic_driver_probe() itself or
possibly adding a pre-probe callback to usb_device_driver.

Johan