Re: [PATCH] driver core: complete deferred binds when drivers_autoprobe is off

From: Danilo Krummrich

Date: Fri Oct 09 2026 - 04:56:58 EST


On Thu Oct 8, 2026 at 5:41 PM CEST, mosafer wrote:
> From: Mohammad Mosafer <mohsafer@xxxxxxxxx>
>
> device_add() registers a device and then runs the bus's initial probe
> via bus_probe_device() -> device_initial_probe(). With
> drivers_autoprobe disabled for the bus, device_initial_probe() skips
> __device_attach() entirely.
>
> That is correct for automatic *matching* against the bus's driver list,
> but __device_attach() also doubles as "complete a bind that a driver
> already initiated": when dev->driver has been pre-assigned outside the
> normal match/probe path, its else-if branch finishes the bind by
> calling device_bind_driver().

We've recently had another patch to fix up cases where dev->driver is
pre-assigned. Please see [1] and the corresponding thread.

IIRC, there was no reasons the remaining users can't just use a proper match()
callback instead, so we don't have to worry about those edge cases in the
future.

[1] https://lore.kernel.org/driver-core/20260820084557.129908-1-khiemtranzo532001@xxxxxxxxx/