From: ebiederm@xmission.com (Eric W. Biederman)
To: Mike Snitzer <snitzer@gmail.com>
Cc: fastboot@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: [Fastboot] [ANNOUNCE] [PATCH] 2.6.8-rc1-kexec1 (ppc & x86)
Date: 21 Jul 2004 13:40:18 -0600 [thread overview]
Message-ID: <m1d62p2lp9.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <170fa0d2040720180741cfa783@mail.gmail.com>
Mike Snitzer <snitzer@gmail.com> writes:
> In preparation for kexec to be viable for 2.6 inclusion it would
> appear that some effort will need to go in to making sure all drivers
> in the kernel actually let go of their resources. Should there be an
> audit to verify all device drivers have a shutdown()?
Right this is a janitorial type task that needs to done.
- First there are a lot of devices that don't need a shutdown
method. Mostly either because they are not stateful or
their initialization method can bring them out of whatever
state they are in.
Although if the kexec stuff gets in this might just happen
with a pile of bug reports like yours.
> Another option is to call each module's remove() iff the module
> doesn't have shutdown(). This would require changing
> drivers/base/power/shutdown.c device_shutdown() to include ... else if
> (dev->driver && dev->driver->remove) ... As a side-effect it would
> make drivers like the e1000 safe for use with kexec.
Last time I had this conversation it was not wanted to merge
shutdown() and remove() because shutdown is just required to touch
the hardware and not to clean up the kernel data structures. Which
if you machine is in an unstable state already could be an advantage.
But calling shutdown on device remove is perfectly legitimate.
And it should help ensure the code path gets tested.
Ah... Looking more closely there is a method for testing
the shutdown method and the related power management states.
Details are in documentation/power/devices.txt
But in short there is a "detach_state" file for each file
in sysfs. If you do "echo 4 > detach_state" it the shutdown
method should be called on device removal. Other low power
states can be handles the same way.
I still think drivers will want to call their shutdown method
from their remove method if there is any work to do. But at
least there is now a way to test the code path.
Eric
prev parent reply other threads:[~2004-07-21 19:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040719181115.86378.qmail@web52302.mail.yahoo.com>
[not found] ` <m1y8le3cto.fsf@ebiederm.dsl.xmission.com>
2004-07-21 1:07 ` [Fastboot] [ANNOUNCE] [PATCH] 2.6.8-rc1-kexec1 (ppc & x86) Mike Snitzer
2004-07-21 19:09 ` [BUG] e1000 on reboot/boot path Eric W. Biederman
2004-07-21 19:40 ` Eric W. Biederman [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=m1d62p2lp9.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=fastboot@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
--cc=snitzer@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).