From: Johan Hovold <johan@kernel.org>
To: Finn Thain <fthain@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nubus: switch to dynamic root device
Date: Mon, 4 May 2026 12:03:34 +0200 [thread overview]
Message-ID: <afhu9r_x40aeLgvS@hovoldconsulting.com> (raw)
In-Reply-To: <a05b0f75-87b8-5478-3480-be545c905c83@linux-m68k.org>
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
next prev parent reply other threads:[~2026-05-04 10:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 10:40 [PATCH] nubus: switch to dynamic root device Johan Hovold
2026-04-25 4:07 ` Finn Thain
2026-04-27 15:30 ` Johan Hovold
2026-04-28 7:24 ` Finn Thain
2026-05-04 10:03 ` Johan Hovold [this message]
2026-05-04 7:41 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=afhu9r_x40aeLgvS@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=fthain@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox