[ltp] [PATCH] 2.6.17: Unload disks heads before powering down

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Tue, 26 Sep 2006 00:23:19 -0300


On Tue, 26 Sep 2006, Shem Multinymous wrote:
> On my box with ata_piix, the kernel is *spinning down* the disks
> during shutddown. Tested with vanilla 2.6.18 and 2.6.17.4+suspend2.

Yes, it might do that.  I cannot test it right now, will do so later (I
added a printk about it to libata-eh.c to help track what happens).

The EH suspend subroutine does a STANDBY IMMEDIATE command, and that flushes
caches and spins down the disk, which IS the right thing to do on a system
shutdown, but quite less so for a system reset.

Now, teaching the kernel how to differentiate a "regular" scsi bus shutdown,
from a "will reboot/kexec" scsi bus shutdown is something I have absolutely
NO CLUE on how to go about doing properly.

> Annoyingly, it spins down disks also on reboot and in the first phase
> of the suspend2 hibernation.

Suspend2 2.2.8 + kernel 2.6.18 is corrupting the page cache here, do *not*
use it if you value your data.

That said, which version of suspend2 and kernel are you using?

> Any idea where that comes from, and how it relates to the SuSE head
> unload patch?

If you shutdown the scsi bus, the unload patch will spin down the disk. And
if you suspend the scsi bus, the regular kernel code will spin down the disk
as well (at least it should).  And if you are going to use the disk to write
a image there, what the hell are you doing suspending or shutting it down?
I suspect the "so don't do it" finale for this thought is only possible with
2.6.18, that's why I asked you about the version of the kernel + suspend2
you're using...

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh