Re: [PATCH] driver core: auxiliary bus: Fix calling stage for auxiliary bus init
From: Greg KH
Date: Wed Feb 10 2021 - 01:46:16 EST
On Tue, Feb 09, 2021 at 12:01:06PM -0800, Dan Williams wrote:
> On Tue, Feb 9, 2021 at 11:16 AM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> [..]
> > > diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
> > > index 8336535f1e11..53f93a506626 100644
> > > --- a/drivers/base/auxiliary.c
> > > +++ b/drivers/base/auxiliary.c
> > > @@ -270,7 +270,7 @@ static void __exit auxiliary_bus_exit(void)
> > > bus_unregister(&auxiliary_bus_type);
> > > }
> > >
> > > -module_init(auxiliary_bus_init);
> > > +subsys_initcall(auxiliary_bus_init);
> >
> > Ah, the linker priority dance. Are you _SURE_ this will solve this?
>
> All users are module_init() today so it will work.... today. The
> moment someone wants to use it in a built-in driver that uses
> subsystem_init() it will ultimately be chased into driver_init().
>
> > Why not just call this explicitly in driver_init() so that you know it
> > will be ok? Just like we do for the platform bus?
>
> Cross that bridge when / if it happens?
Let's fix it properly now please.
thanks,
greg k-h