mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Question about IDE disk shutdown
@ 2004-06-01 15:13 Tvrtko A. Uršulin
  2004-06-01 15:42 ` John Bradford
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tvrtko A. Uršulin @ 2004-06-01 15:13 UTC (permalink / raw)
  To: linux-kernel


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? 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Question about IDE disk shutdown
  2004-06-01 15:13 Question about IDE disk shutdown Tvrtko A. Uršulin
@ 2004-06-01 15:42 ` John Bradford
  2004-06-01 15:47 ` Eric D. Mudama
  2004-06-01 22:41 ` Bartlomiej Zolnierkiewicz
  2 siblings, 0 replies; 6+ messages in thread
From: John Bradford @ 2004-06-01 15:42 UTC (permalink / raw)
  To: Tvrtko A. Uršulin, linux-kernel

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Question about IDE disk shutdown
  2004-06-01 15:13 Question about IDE disk shutdown Tvrtko A. Uršulin
  2004-06-01 15:42 ` John Bradford
@ 2004-06-01 15:47 ` Eric D. Mudama
  2004-06-01 15:57   ` Tvrtko A. Uršulin
  2004-06-01 22:41 ` Bartlomiej Zolnierkiewicz
  2 siblings, 1 reply; 6+ messages in thread
From: Eric D. Mudama @ 2004-06-01 15:47 UTC (permalink / raw)
  To: Tvrtko A. Ur?ulin; +Cc: linux-kernel

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
edmudama@mail.bounceswoosh.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Question about IDE disk shutdown
  2004-06-01 15:47 ` Eric D. Mudama
@ 2004-06-01 15:57   ` Tvrtko A. Uršulin
  0 siblings, 0 replies; 6+ messages in thread
From: Tvrtko A. Uršulin @ 2004-06-01 15:57 UTC (permalink / raw)
  To: Eric D. Mudama; +Cc: linux-kernel

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Question about IDE disk shutdown
  2004-06-01 15:13 Question about IDE disk shutdown Tvrtko A. Uršulin
  2004-06-01 15:42 ` John Bradford
  2004-06-01 15:47 ` Eric D. Mudama
@ 2004-06-01 22:41 ` Bartlomiej Zolnierkiewicz
  2004-06-02  6:27   ` Tvrtko A. Uršulin
  2 siblings, 1 reply; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-06-01 22:41 UTC (permalink / raw)
  To: Tvrtko A. Uršulin; +Cc: linux-kernel

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Question about IDE disk shutdown
  2004-06-01 22:41 ` Bartlomiej Zolnierkiewicz
@ 2004-06-02  6:27   ` Tvrtko A. Uršulin
  0 siblings, 0 replies; 6+ messages in thread
From: Tvrtko A. Uršulin @ 2004-06-02  6:27 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel

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!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-06-02  6:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-01 15:13 Question about IDE disk shutdown Tvrtko A. Uršulin
2004-06-01 15:42 ` John Bradford
2004-06-01 15:47 ` Eric D. Mudama
2004-06-01 15:57   ` Tvrtko A. Uršulin
2004-06-01 22:41 ` Bartlomiej Zolnierkiewicz
2004-06-02  6:27   ` Tvrtko A. Uršulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®