lkml.org 
[lkml]   [2026]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] nubus: switch to dynamic root device
On Tue, Apr 28, 2026 at 05:24:31PM +1000, Finn Thain wrote:
> On Mon, 27 Apr 2026, Johan Hovold wrote:
> > On Sat, Apr 25, 2026 at 02:07:10PM +1000, Finn Thain wrote:
> > > On Fri, 24 Apr 2026, Johan Hovold wrote:
> > >
> > > > Driver core expects devices to be dynamically allocated and will,
> > > > for example, complain loudly if a device that lacks a release
> > > > function is ever freed.

> > > Yes, in drivers/base/core.c, there is a warning in device_release().
> > >
> > > WARN(1, KERN_ERR "Device '%s' does not have a release()
> > > function, it is broken and must be fixed. See
> > > Documentation/core-api/kobject.rst.\n",
> > >
> > > But there's no way for the refcount for the nubus parent device to
> > > reach zero that I can see. Did I miss something?
> >
> > It will if registration ever fails (e.g. due to fault injection or name
> > collision):
> >
> > err = device_register(&nubus_parent);
> > if (err) {
> > put_device(&nubus_parent);
> > return err;
> > }
> >
>
> In that situation the kernel error message would say the device "is broken
> and must be fixed" when it was deliberately broken by fault injection.
> I think the commit log should state that the aim of your patch is to avoid
> that error message for that use-case.

No, the aim is to git rid of statically allocated device structures. The
error message is there to notify people that the driver model expects
dynamically allocated objects (e.g. as documented in kobject.rst) even
if you're unlikely to hit it with this particular module.

> Aside from that quibble, the patch looks fine to me.
>
> Acked-by: Finn Thain <fthain@linux-m68k.org>

Thanks for taking a look.

Johan

\
 
 \ /
  Last update: 2026-05-04 12:06    [W:0.067 / U:40.390 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog