From: ebiederm@xmission.com (Eric W. Biederman)
To: Patrick Mochel <mochel@osdl.org>
Cc: "Adam J. Richter" <adam@yggdrasil.com>,
<eblade@blackmagik.dynup.net>, <linux-kernel@vger.kernel.org>
Subject: Re: Patch: linux-2.5.42/kernel/sys.c - warm reboot should not suspend devices
Date: 19 Oct 2002 12:30:38 -0600 [thread overview]
Message-ID: <m1d6q6xovl.fsf@frodo.biederman.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0210150928340.1038-100000@cherise.pdx.osdl.net>
Patrick Mochel <mochel@osdl.org> writes:
> > device_shutdown and device_suspend are for power management.
> > It is important to turn the device off as soon as possible if a power
> > management routine has told you that the device is not going to be
> > used any more.
>
> device_suspend() is for power management. device_shutdown() is for
> quiescing devices before a system reboot or power off.
>
> It's true that the same function is called when the device is physically
> removed from the system as when the system is shutting down, and that
> might be kinda bad. If it gets to the point where it's really difficult to
> deal with for drivers, we can create another callback: ->shutdown() for
> struct device_driver.
Obviously you have decided this was worth it.
My feedback.
* dev->shutdown is not called on module removal.
* dev->shutdown does not update dev->state to anything like
DEVICE_SHUTDOWN, that could be used as a sanity check, to not
use a device after it has been shut down.
* The semantics of dev->shutdown() and are not clear, in their
interactions with other parts of the system. Can the code from
dev->remove() that shuts down a device be removed?
I care because getting devices to properly shutdown on when
sys_kexec is what I need to do to get sys_kexec stable.
Would it be worth it for me to split out my fixes to smp shutdown,
and i8259 shutdown and to send them along to you?
The smp shutdown case on x86 probably cannot be handled by the device
model because it must be the very last code to run. When you stop
interrupts from coming in several drivers get cranky and do not
shutdown cleanly.
Hopefully I am not coming off harsh but I am a little cranky this
morning, As before this change I thought things on the device side
were pretty much under control they just needed a little stabilization
and testing. And now someone possibly me has to go through every
driver and write a shutdown method because someone figured calling
free was expensive.
That was the point of calling dev->shutdown instead of dev->remove()
wasn't it? If there was a way to reawaken a device after calling
dev -> shutdown I might see it. But to do that you still need to call
dev -> remove() followed by dev ->probe()
Eric
next prev parent reply other threads:[~2002-10-19 18:26 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-13 22:14 Patch: linux-2.5.42/kernel/sys.c - warm reboot should not suspend devices Adam J. Richter
2002-10-13 22:31 ` Russell King
2002-10-13 23:49 ` Eric W. Biederman
2002-10-15 16:35 ` Patrick Mochel
2002-10-15 20:04 ` Mikael Pettersson
2002-10-19 18:30 ` Eric W. Biederman [this message]
2002-10-20 9:47 ` Eric W. Biederman
-- strict thread matches above, loose matches on Subject: below --
2002-10-21 22:26 Adam J. Richter
2002-10-21 20:56 Adam J. Richter
2002-10-22 4:28 ` Eric W. Biederman
2002-10-20 7:01 Adam J. Richter
2002-10-20 9:17 ` Eric W. Biederman
2002-10-20 20:43 ` Patrick Mochel
2002-10-20 23:57 ` Eric W. Biederman
2002-10-21 17:13 ` Patrick Mochel
2002-10-17 1:50 Adam J. Richter
2002-10-17 9:08 ` Eric W. Biederman
2002-10-15 19:52 Adam J. Richter
2002-10-16 12:13 ` Eric W. Biederman
2002-10-15 18:54 Adam J. Richter
2002-10-15 2:53 Adam J. Richter
2002-10-15 16:59 ` Eric W. Biederman
2002-10-14 18:41 Adam J. Richter
2002-10-14 20:05 ` Eric W. Biederman
2002-10-15 4:55 ` Eric Blade
2002-10-16 8:01 ` Pavel Machek
2002-10-14 15:25 Adam J. Richter
2002-10-14 16:44 ` Eric W. Biederman
2002-10-14 17:48 ` Richard B. Johnson
2002-10-14 19:28 ` Eric W. Biederman
2002-10-14 20:17 ` Richard B. Johnson
2002-10-13 23:59 Adam J. Richter
2002-10-14 0:07 ` Eric W. Biederman
2002-10-14 5:38 ` Eric Blade
2002-10-14 15:28 ` Eric W. Biederman
2002-10-15 4:34 ` Eric Blade
2002-10-13 23:10 Adam J. Richter
2002-10-13 23:15 ` Russell King
2002-10-14 0:03 ` Eric W. Biederman
2002-10-13 23:54 ` Eric W. Biederman
2002-10-13 19:24 Adam J. Richter
2002-10-13 19:51 ` Eric Blade
2002-10-13 21:27 ` Eric W. Biederman
2002-10-13 22:52 ` Andries Brouwer
2002-10-14 0:30 ` Eric W. Biederman
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=m1d6q6xovl.fsf@frodo.biederman.org \
--to=ebiederm@xmission.com \
--cc=adam@yggdrasil.com \
--cc=eblade@blackmagik.dynup.net \
--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