From: Ben Collins <bcollins@debian.org>
To: Patrick Mochel <mochel@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] [PATCH] Device removal callback
Date: Mon, 10 Mar 2003 11:30:07 -0500 [thread overview]
Message-ID: <20030310163007.GA555@phunnypharm.org> (raw)
In-Reply-To: <Pine.LNX.4.33.0303100939001.1002-100000@localhost.localdomain>
On Mon, Mar 10, 2003 at 09:45:12AM -0600, Patrick Mochel wrote:
>
> > So, here's my simple patch. I'd really like this to be applied to the
> > proper kernel. I really can't see how the driver model is working
> > without walking children on unregister, but this atleast allows you to
> > handle it yourself.
>
> The assumption is that the bus driver will take care of cleaning up all
> the children before unregistering the parent. This place a bit more
> responsibility on the bus driver, but it keeps it simple in the core.
>
> That's not to say that it can't change in the future, but I don't want to
> take that step right now. There are a lot of implications WRT locking and
> recursion that need to be worked out, and I'd rather wait on making these
> kind of core changes.
That's fine, I can deal with that. But this patch only allows you to add
a ->remove member to a device, which will aide in ensuring that.
Currently there's not even a check in the driver core for whether a
device has children when it is removed. Adding the remove function will
make it easier for the bus to validate a device, sanity check it, and
cleanup after it before it gets demolished from the core.
Maybe you need to {get,put}_device() wrap the call to remove, but that
shouldn't be a big problem with locking (really, the patch is simple).
--
Debian - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
Deqo - http://www.deqo.com/
prev parent reply other threads:[~2003-03-10 16:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-09 18:14 [RFC] [PATCH] Device removal callback Ben Collins
2003-03-10 0:11 ` Greg KH
2003-03-10 1:02 ` Ben Collins
2003-03-10 15:59 ` Patrick Mochel
2003-03-10 16:55 ` Ben Collins
2003-03-10 17:21 ` Greg KH
2003-03-10 18:12 ` Ben Collins
2003-03-10 15:45 ` Patrick Mochel
2003-03-10 16:30 ` Ben Collins [this message]
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=20030310163007.GA555@phunnypharm.org \
--to=bcollins@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@osdl.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