Re: [RFC PATCH 0/4] device_schedule_reprobe(): core helper and conversions
From: Greg Kroah-Hartman
Date: Tue Aug 11 2026 - 04:12:48 EST
On Tue, Aug 11, 2026 at 09:32:45AM +0200, Hans de Goede wrote:
> Hi Greg,
>
> On 11-Aug-26 04:33, Greg Kroah-Hartman wrote:
> > On Tue, Aug 11, 2026 at 01:47:17AM +0100, Daniel Golle wrote:
> >> Three in-tree drivers (iwlwifi, hci_h5, btintel_pcie) schedule a
> >> deferred re-probe of their own device from a work item in module
> >> text.
> >
> > That's a mess, why? Why not fix that up to not do that? Thousands of
> > other kernel drivers do not do that, what makes these so special?
>
> I can only speak for the hci_h5 driver where I added the reprobe code-path.
>
> The problem is some of the Bluetooth HCI devices using hci_h5 loose all
> state during system-suspend. This means that the HCI and the Bluetooth core
> end up being out of sync.
>
> So we basically need to tear down and re-build everything including
> e.g. the firmware upload which happens at probe(). Doing a full reprobe
> is by far the easiest way to do this.
>
> I suspect the other 4 users + the pending driver which triggered
> this are similar.
Full reprobe feels different than the THIS_MODULE stuff, which is what I
objected to here.
> Sure we can do the whole tear-down + setup from some worker
> scheduled at resume, while keep the driver attached but if we need
> to duplicate that over 4 drivers + the pending driver which triggers
> this then IMHO those 5 users are a pattern which deserves having
> some helper to do this through the existing probe() + remove(),
> rather then requiring those 5 drivers to open code this themselves.
>
> Note that we already have device_reprobe(), which has 15 existing
> users. This series just adds a helper to do a device_reprobe() from
> a worker in a safe way.
That feels a bit better, as long as this code really is "safe" :)
So, how can this be tested and fixed up so it isn't a RFC anymore?
thanks,
greg k-h