2004-06-01 15:18:54

by Tvrtko A. Uršulin

[permalink] [raw]
Subject: Question about IDE disk shutdown


Hello all,

Probably a trivial question for ones who know it - what IDE commands does
kernel issue when shutting down (which results in automatic power-off if ACPI
is enabled)?

According to my hard disk manual, it is absolutely recommended to put the
drive in STANDBY or SLEEP mode before power cut-off because in that way heads
are nicely parked. In that way it is guaranteed to have 300000 head
load/unload cycles minimum, while in other case it is just 20000 cycles.

It also explicitely states that FLUSH CACHE is not to be used for drive
power-off because it does not park the heads.

Looking at the source I see in ide-disk.c:

.gen_driver = {
.shutdown = ide_device_shutdown,
},

Following that I see that ide_device_shutdown flushes the cache, and then
calls dev->bus->suspend(dev, PM_SUSPEND_STANDBY); which is in fact
generic_ide_suspend, right? There, something called REQ_PM_SUSPEND is issued
to the drive. As SUSPEND != STANDBY or SLEEP, I am left uncertain.

Is there a place to be worried or I am missing something?


2004-06-01 15:34:57

by John Bradford

[permalink] [raw]
Subject: Re: Question about IDE disk shutdown

Hi,

> Probably a trivial question for ones who know it - what IDE commands does
> kernel issue when shutting down (which results in automatic power-off if ACPI
> is enabled)?
>
> According to my hard disk manual, it is absolutely recommended to put the
> drive in STANDBY or SLEEP mode before power cut-off because in that way heads
> are nicely parked. In that way it is guaranteed to have 300000 head
> load/unload cycles minimum, while in other case it is just 20000 cycles.
>
> It also explicitely states that FLUSH CACHE is not to be used for drive
> power-off because it does not park the heads.
>
> Looking at the source I see in ide-disk.c:
>
> .gen_driver = {
> .shutdown = ide_device_shutdown,
> },
>
> Following that I see that ide_device_shutdown flushes the cache, and then
> calls dev->bus->suspend(dev, PM_SUSPEND_STANDBY); which is in fact
> generic_ide_suspend, right? There, something called REQ_PM_SUSPEND is issued
> to the drive. As SUSPEND != STANDBY or SLEEP, I am left uncertain.
>
> Is there a place to be worried or I am missing something?

This kind of thing has been discussed extensively in the past. Basically,
there are loads of broken drives which do a wide range of different things,
so following the standards doesn't necessarily work best in practice.

John.

2004-06-01 15:45:23

by Eric D. Mudama

[permalink] [raw]
Subject: Re: Question about IDE disk shutdown

On Tue, Jun 1 at 17:13, Tvrtko A. Ur?ulin wrote:
>According to my hard disk manual, it is absolutely recommended to put the
>drive in STANDBY or SLEEP mode before power cut-off because in that way heads
>are nicely parked. In that way it is guaranteed to have 300000 head
>load/unload cycles minimum, while in other case it is just 20000 cycles.

All "modern" drives have plenty of back-EMF to park the heads properly
when power fails.

Remember that even if you are limited to 20,000 power cycles reliably,
that's over 5 reboots every day for 10 years, well over the expected
lifetime of the drive. (unless you run windows yuk yuk)


--
Eric D. Mudama
[email protected]

2004-06-01 16:00:13

by Tvrtko A. Uršulin

[permalink] [raw]
Subject: Re: Question about IDE disk shutdown

On Tuesday 01 June 2004 17:47, Eric D. Mudama wrote:
> On Tue, Jun 1 at 17:13, Tvrtko A. Ur?ulin wrote:
> >According to my hard disk manual, it is absolutely recommended to put the
> >drive in STANDBY or SLEEP mode before power cut-off because in that way
> > heads are nicely parked. In that way it is guaranteed to have 300000 head
> > load/unload cycles minimum, while in other case it is just 20000 cycles.
>
> All "modern" drives have plenty of back-EMF to park the heads properly
> when power fails.

Yes, but this is a kind of uncontrollable parking with much greater mechanical
stress.

> Remember that even if you are limited to 20,000 power cycles reliably,
> that's over 5 reboots every day for 10 years, well over the expected
> lifetime of the drive. (unless you run windows yuk yuk)

Good point, I missed that. :) Although it would be nice if we could park the
heads nicely. You never know which premature failure emergency parking can
produce.

Subject: Re: Question about IDE disk shutdown

On Tuesday 01 of June 2004 17:13, Tvrtko A. Uršulin wrote:
> Hello all,
>
> Probably a trivial question for ones who know it - what IDE commands does
> kernel issue when shutting down (which results in automatic power-off if
> ACPI is enabled)?
>
> According to my hard disk manual, it is absolutely recommended to put the
> drive in STANDBY or SLEEP mode before power cut-off because in that way
> heads are nicely parked. In that way it is guaranteed to have 300000 head
> load/unload cycles minimum, while in other case it is just 20000 cycles.
>
> It also explicitely states that FLUSH CACHE is not to be used for drive
> power-off because it does not park the heads.
>
> Looking at the source I see in ide-disk.c:
>
> .gen_driver = {
> .shutdown = ide_device_shutdown,
> },
>
> Following that I see that ide_device_shutdown flushes the cache, and then
> calls dev->bus->suspend(dev, PM_SUSPEND_STANDBY); which is in fact
> generic_ide_suspend, right? There, something called REQ_PM_SUSPEND is
> issued to the drive. As SUSPEND != STANDBY or SLEEP, I am left uncertain.
>
> Is there a place to be worried or I am missing something?

You are missing PM code in ide-disk.c. :-)

See idedisk_start_power_step() and idedisk_complete_power_step(),
also read comment in <linux/ide.h> about ide_pm_state_*.

Bartlomiej

2004-06-02 06:36:17

by Tvrtko A. Uršulin

[permalink] [raw]
Subject: Re: Question about IDE disk shutdown

On Wednesday 02 June 2004 00:41, Bartlomiej Zolnierkiewicz wrote:

> > Following that I see that ide_device_shutdown flushes the cache, and then
> > calls dev->bus->suspend(dev, PM_SUSPEND_STANDBY); which is in fact
> > generic_ide_suspend, right? There, something called REQ_PM_SUSPEND is
> > issued to the drive. As SUSPEND != STANDBY or SLEEP, I am left uncertain.
> >
> > Is there a place to be worried or I am missing something?
>
> You are missing PM code in ide-disk.c. :-)
>
> See idedisk_start_power_step() and idedisk_complete_power_step(),
> also read comment in <linux/ide.h> about ide_pm_state_*.

I saw that, but the comment speaks only about power management. Therefore I
wasn't sure that this path is also taken during standard power-off. Thanks!