Re: [PATCH 3/3] driver core: bus: Correct API bus_rescan_devices() behavior

From: Greg Kroah-Hartman
Date: Wed Sep 04 2024 - 10:44:31 EST


On Wed, Sep 04, 2024 at 10:26:39PM +0800, Zijun Hu wrote:
> On 2024/9/4 21:54, Greg Kroah-Hartman wrote:
> > On Wed, Sep 04, 2024 at 08:56:44PM +0800, Zijun Hu wrote:
> >> From: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
> >>
> >> API bus_rescan_devices() should ideally scan drivers for a bus's devices
> >> as many as possible, but it really stops scanning for remaining devices
> >> even if a device encounters inconsequential errors such as -EPROBE_DEFER
> >
> > -EPROBE_DEFER should not be an issue for scanning the bus, that's only
> > for probe errors, so who is returning that mess today? Let's fix that
> > up please.
> >
>
> drivers/amba/bus.c:
> struct bus_type amba_bustype = {
> ...
> .match = amba_match,
> ...
> };
> amba_match() may return -EPROBE_DEFER.

Why? That feels wrong.

> you maybe also look at below AMBA bus related commit.
> Commit: 656b8035b0ee ("ARM: 8524/1: driver cohandle -EPROBE_DEFER from
> bus_type.match()"

Ah, ick, clocks. What a mess.

I don't think we need this anymore with the genric device link stuff
anymore, but I'm not quite sure.

> is it proper to change bus_type match()'s return value type to bool type
> back if this issue is fixed?

Yes, I would like to. Care to look into it, odds are you can test this
better than I can :)

thanks,

greg k-h