* what handles disk drive(s) shutdown?
@ 2006-02-09 22:11 Randy.Dunlap
2006-02-10 2:50 ` Alan Stern
2006-02-10 22:56 ` Pavel Machek
0 siblings, 2 replies; 9+ messages in thread
From: Randy.Dunlap @ 2006-02-09 22:11 UTC (permalink / raw)
To: linux-pm
[-- Attachment #1: Type: TEXT/PLAIN, Size: 348 bytes --]
in Documentation/power/devices.txt, I read:
<quote>
System shutdown -- at least disks need to be spun down, or data may be
lost. Quiesce devices, just to make life easier for BIOS. event =
FREEZE, flags = SYSTEM_SHUTDOWN
</quote>
Is this actually done somewhere? I can't find /SYSTEM_SHUTDOWN/
in any kernel .h or .c files.
Thanks,
--
~Randy
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: what handles disk drive(s) shutdown?
2006-02-09 22:11 what handles disk drive(s) shutdown? Randy.Dunlap
@ 2006-02-10 2:50 ` Alan Stern
2006-02-10 22:56 ` Pavel Machek
1 sibling, 0 replies; 9+ messages in thread
From: Alan Stern @ 2006-02-10 2:50 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: linux-pm
[-- Attachment #1: Type: TEXT/PLAIN, Size: 727 bytes --]
On Thu, 9 Feb 2006, Randy.Dunlap wrote:
> in Documentation/power/devices.txt, I read:
>
> <quote>
> System shutdown -- at least disks need to be spun down, or data may be
> lost. Quiesce devices, just to make life easier for BIOS. event =
> FREEZE, flags = SYSTEM_SHUTDOWN
> </quote>
>
> Is this actually done somewhere? I can't find /SYSTEM_SHUTDOWN/
> in any kernel .h or .c files.
Just about everything concerning the flags in those documentation files is
fictitious. The flags field doesn't even exist! Right now there's
nothing but the event field.
I guess it's what Pavel intended to implement eventually. That doesn't
mean the final version will actually take the form described in the
file...
Alan Stern
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: what handles disk drive(s) shutdown?
2006-02-09 22:11 what handles disk drive(s) shutdown? Randy.Dunlap
2006-02-10 2:50 ` Alan Stern
@ 2006-02-10 22:56 ` Pavel Machek
2006-02-10 22:59 ` Randy.Dunlap
1 sibling, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2006-02-10 22:56 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: linux-pm
[-- Attachment #1: Type: text/plain, Size: 558 bytes --]
Hi!
> in Documentation/power/devices.txt, I read:
>
> <quote>
> System shutdown -- at least disks need to be spun down, or data may be
> lost. Quiesce devices, just to make life easier for BIOS. event =
> FREEZE, flags = SYSTEM_SHUTDOWN
> </quote>
>
> Is this actually done somewhere? I can't find /SYSTEM_SHUTDOWN/
> in any kernel .h or .c files.
I think we do FREEZE during shutdown, but flags never got
implemented. It seems nobody really needs them, so...
Pavel
--
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: what handles disk drive(s) shutdown?
2006-02-10 22:56 ` Pavel Machek
@ 2006-02-10 22:59 ` Randy.Dunlap
2006-02-10 23:06 ` Pavel Machek
0 siblings, 1 reply; 9+ messages in thread
From: Randy.Dunlap @ 2006-02-10 22:59 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-pm
[-- Attachment #1: Type: TEXT/PLAIN, Size: 875 bytes --]
On Fri, 10 Feb 2006, Pavel Machek wrote:
> Hi!
>
> > in Documentation/power/devices.txt, I read:
> >
> > <quote>
> > System shutdown -- at least disks need to be spun down, or data may be
> > lost. Quiesce devices, just to make life easier for BIOS. event =
> > FREEZE, flags = SYSTEM_SHUTDOWN
> > </quote>
> >
> > Is this actually done somewhere? I can't find /SYSTEM_SHUTDOWN/
> > in any kernel .h or .c files.
>
> I think we do FREEZE during shutdown, but flags never got
> implemented. It seems nobody really needs them, so...
I'm not particular about the flags, but I do have a case of
needing to do what the comment describes: spin down disks
during shutdown. Can anyone suggest how that should be done?
[I'm currently adding code to use register_reboot_notifier()
and keeping a table of SATA/PATA controllers/channels for use
at shutdown...]
Thanks,
--
~Randy
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: what handles disk drive(s) shutdown?
2006-02-10 22:59 ` Randy.Dunlap
@ 2006-02-10 23:06 ` Pavel Machek
2006-02-10 23:08 ` Randy.Dunlap
2006-02-11 2:50 ` Dmitry Torokhov
0 siblings, 2 replies; 9+ messages in thread
From: Pavel Machek @ 2006-02-10 23:06 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: linux-pm
On Pá 10-02-06 14:59:58, Randy.Dunlap wrote:
> On Fri, 10 Feb 2006, Pavel Machek wrote:
>
> > Hi!
> >
> > > in Documentation/power/devices.txt, I read:
> > >
> > > <quote>
> > > System shutdown -- at least disks need to be spun down, or data may be
> > > lost. Quiesce devices, just to make life easier for BIOS. event =
> > > FREEZE, flags = SYSTEM_SHUTDOWN
> > > </quote>
> > >
> > > Is this actually done somewhere? I can't find /SYSTEM_SHUTDOWN/
> > > in any kernel .h or .c files.
> >
> > I think we do FREEZE during shutdown, but flags never got
> > implemented. It seems nobody really needs them, so...
>
> I'm not particular about the flags, but I do have a case of
> needing to do what the comment describes: spin down disks
> during shutdown. Can anyone suggest how that should be done?
>
> [I'm currently adding code to use register_reboot_notifier()
> and keeping a table of SATA/PATA controllers/channels for use
> at shutdown...]
No, that is not the right way.
void kernel_shutdown_prepare(enum system_states state)
{
notifier_call_chain(&reboot_notifier_list,
(state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
system_state = state;
device_shutdown();
}
device_shutdown() should do it, AFAICT.
If you want to listen to such event, you should just register your
driver with sysfs and implement .suspend() method. But I believe PATA
does that already...
Pavel
--
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: what handles disk drive(s) shutdown?
2006-02-10 23:06 ` Pavel Machek
@ 2006-02-10 23:08 ` Randy.Dunlap
2006-02-10 23:16 ` Pavel Machek
2006-02-11 2:50 ` Dmitry Torokhov
1 sibling, 1 reply; 9+ messages in thread
From: Randy.Dunlap @ 2006-02-10 23:08 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-pm
On Sat, 11 Feb 2006, Pavel Machek wrote:
> On Pá 10-02-06 14:59:58, Randy.Dunlap wrote:
> > On Fri, 10 Feb 2006, Pavel Machek wrote:
> >
> > > Hi!
> > >
> > > > in Documentation/power/devices.txt, I read:
> > > >
> > > > <quote>
> > > > System shutdown -- at least disks need to be spun down, or data may be
> > > > lost. Quiesce devices, just to make life easier for BIOS. event =
> > > > FREEZE, flags = SYSTEM_SHUTDOWN
> > > > </quote>
> > > >
> > > > Is this actually done somewhere? I can't find /SYSTEM_SHUTDOWN/
> > > > in any kernel .h or .c files.
> > >
> > > I think we do FREEZE during shutdown, but flags never got
> > > implemented. It seems nobody really needs them, so...
> >
> > I'm not particular about the flags, but I do have a case of
> > needing to do what the comment describes: spin down disks
> > during shutdown. Can anyone suggest how that should be done?
> >
> > [I'm currently adding code to use register_reboot_notifier()
> > and keeping a table of SATA/PATA controllers/channels for use
> > at shutdown...]
>
> No, that is not the right way.
>
> void kernel_shutdown_prepare(enum system_states state)
> {
> notifier_call_chain(&reboot_notifier_list,
> (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
> system_state = state;
> device_shutdown();
> }
>
> device_shutdown() should do it, AFAICT.
>
> If you want to listen to such event, you should just register your
> driver with sysfs and implement .suspend() method. But I believe PATA
> does that already...
I walked thru that code path and didn't see it happening.
And for PATA, please expect libata, not legacy drivers/ide/.
--
~Randy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: what handles disk drive(s) shutdown?
2006-02-10 23:08 ` Randy.Dunlap
@ 2006-02-10 23:16 ` Pavel Machek
0 siblings, 0 replies; 9+ messages in thread
From: Pavel Machek @ 2006-02-10 23:16 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: linux-pm
On Pá 10-02-06 15:08:26, Randy.Dunlap wrote:
> On Sat, 11 Feb 2006, Pavel Machek wrote:
>
> > On Pá 10-02-06 14:59:58, Randy.Dunlap wrote:
> > > On Fri, 10 Feb 2006, Pavel Machek wrote:
> > >
> > > > Hi!
> > > >
> > > > > in Documentation/power/devices.txt, I read:
> > > > >
> > > > > <quote>
> > > > > System shutdown -- at least disks need to be spun down, or data may be
> > > > > lost. Quiesce devices, just to make life easier for BIOS. event =
> > > > > FREEZE, flags = SYSTEM_SHUTDOWN
> > > > > </quote>
> > > > >
> > > > > Is this actually done somewhere? I can't find /SYSTEM_SHUTDOWN/
> > > > > in any kernel .h or .c files.
> > > >
> > > > I think we do FREEZE during shutdown, but flags never got
> > > > implemented. It seems nobody really needs them, so...
> > >
> > > I'm not particular about the flags, but I do have a case of
> > > needing to do what the comment describes: spin down disks
> > > during shutdown. Can anyone suggest how that should be done?
> > >
> > > [I'm currently adding code to use register_reboot_notifier()
> > > and keeping a table of SATA/PATA controllers/channels for use
> > > at shutdown...]
> >
> > No, that is not the right way.
> >
> > void kernel_shutdown_prepare(enum system_states state)
> > {
> > notifier_call_chain(&reboot_notifier_list,
> > (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
> > system_state = state;
> > device_shutdown();
> > }
> >
> > device_shutdown() should do it, AFAICT.
> >
> > If you want to listen to such event, you should just register your
> > driver with sysfs and implement .suspend() method. But I believe PATA
> > does that already...
>
> I walked thru that code path and didn't see it happening.
> And for PATA, please expect libata, not legacy drivers/ide/.
I think drivers/ide does it right. Feel free to copy it :-).
Pavel
--
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: what handles disk drive(s) shutdown?
2006-02-10 23:06 ` Pavel Machek
2006-02-10 23:08 ` Randy.Dunlap
@ 2006-02-11 2:50 ` Dmitry Torokhov
2006-02-15 23:30 ` Pavel Machek
1 sibling, 1 reply; 9+ messages in thread
From: Dmitry Torokhov @ 2006-02-11 2:50 UTC (permalink / raw)
To: linux-pm; +Cc: Pavel Machek
On Friday 10 February 2006 18:06, Pavel Machek wrote:
>
> void kernel_shutdown_prepare(enum system_states state)
> {
> notifier_call_chain(&reboot_notifier_list,
> (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
> system_state = state;
> device_shutdown();
> }
>
> device_shutdown() should do it, AFAICT.
>
> If you want to listen to such event, you should just register your
> driver with sysfs and implement .suspend() method. But I believe PATA
> does that already...
You mean .shutdown() method, not .suspend(), right?
--
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: what handles disk drive(s) shutdown?
2006-02-11 2:50 ` Dmitry Torokhov
@ 2006-02-15 23:30 ` Pavel Machek
0 siblings, 0 replies; 9+ messages in thread
From: Pavel Machek @ 2006-02-15 23:30 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-pm, Pavel Machek
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
> > void kernel_shutdown_prepare(enum system_states state)
> > {
> > notifier_call_chain(&reboot_notifier_list,
> > (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
> > system_state = state;
> > device_shutdown();
> > }
> >
> > device_shutdown() should do it, AFAICT.
> >
> > If you want to listen to such event, you should just register your
> > driver with sysfs and implement .suspend() method. But I believe PATA
> > does that already...
>
> You mean .shutdown() method, not .suspend(), right?
yep, sorry.
--
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-02-15 23:30 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-09 22:11 what handles disk drive(s) shutdown? Randy.Dunlap
2006-02-10 2:50 ` Alan Stern
2006-02-10 22:56 ` Pavel Machek
2006-02-10 22:59 ` Randy.Dunlap
2006-02-10 23:06 ` Pavel Machek
2006-02-10 23:08 ` Randy.Dunlap
2006-02-10 23:16 ` Pavel Machek
2006-02-11 2:50 ` Dmitry Torokhov
2006-02-15 23:30 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox