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

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


On Tue, 26 Sep 2006, Shem Multinymous wrote:
> >Is Unload Immediate widely supported?
> 
> Just on newer disks, and the capability is often not reported
> (http://thinkwiki.org/wiki/Problem_with_APS_harddisk_parking).
>
> I guess it could try UNLOAD IMMEDIATE, and fall back if it returns
> error (like the hdaps_protect code does given the right parameters).

Well, then we need to know how safe it is to issue it to a disk that doesn't
implement it, I suppose.

Just so you know, the Hitachi 5K100 and 7K60 used in IBM ThinkPads only
support Unload Immediate due to the IBM firmware.  It is not described in
their datasheets at all.  So, it might be even more rare than what you'd
expect it to be.

I think this is the wrong solution to the problem.  It is much better to
actually get the information of whether a disk spindown is desired or not to
the IDE and libata suspend (and, eventually also the shutdown) handlers.
This fixes the issue for suspend2's "snapshot" suspend, reboots and kexec in
a safe and compatible way.

> swsusp and uswsusp don't have the spin-down issue, right?

Kernel S3 doesn't have any issues, it correctly spins-down only once without
any patches. I didn't test any sort of S4 for it yet as suspend2 ain't
working fine for me, and I didn't try uswsusp yet.

-- 
  "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