Re: [PATCH 1/2] driver: core: Allow drivers to opt out of driver_override

From: Uwe Kleine-König

Date: Fri Sep 25 2026 - 13:22:49 EST


Hello Thierry,

On Tue, Sep 22, 2026 at 04:09:25PM +0200, Thierry Reding wrote:
> > Having said that I think there is only a handful of drivers that are
> > actually supposed to work when used in a driver override (vfio stuff,
> > spidev and i2c-dev come to mind), so I'd prefer that drivers opt-in
> > instead of opt-out. Otherwise we yet another flag that drivers should
> > set in general but don't because driver authors are not aware[1]. The
> > few drivers that rely on driver overriding should be identified quickly,
> > and if we miss one that doesn't result in a way to make the kernel oops.
>
> We could easily invert the logic in this patch to make this opt-in, but
> it might be difficult to know exactly which ones want to opt-in, given
> it's been enabled by default for a really long time.

I'd have the heart to do that in combination with a kernel parameter
that allows to drop the strictness (and remove that after some time).

Currently the only driver I'm aware of that is supposed to be used with
driver_override is drivers/spi/spidev.c. AFAICT the i2c equivalent
doesn't need driver overriding (as it attaches to a bus instead of an
individual device) and vfio seems to work without overrides.

I'm sure I missed some driver, but these can easily get fixed when users
start wailing.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature