hi there,

because of kern/140752 i looked through a discussion back in 2009
(http://lists.freebsd.org/pipermail/freebsd-hackers/2009-March/027879.html)
concerning freebsd's hdd spin down procedure. right now ATA_FLUSHCACHE is
being used although the hitachi hdd specs referenced in the pr say that this
will not cause proper load/unload and thus an emergency unload will occur
which reduces the life expectancy of hdds dramatically (20.000 shutdowns vs.
600.000 shutdowns). unfortunately the discussion back then didn't come up with
any sort of decision/patch.

attached you'll find a very simple patch which issues ATA_STANDBY_IMMEDIATE
instead of ATA_FLUSHCACHE during hdd spin down.

could somebody with hdd knowledge comment on this? this matter seems quite
important since there may be a chance that the current spin down mechanism in
freebsd damages hdds!

cheers.
alex
Index: sys/dev/ata/ata-disk.c
===================================================================
--- sys/dev/ata/ata-disk.c      (revision 202848)
+++ sys/dev/ata/ata-disk.c      (working copy)
@@ -191,8 +191,9 @@
 {
     struct ata_device *atadev = device_get_softc(dev);
 
-    if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE)
-       ata_controlcmd(dev, ATA_FLUSHCACHE, 0, 0, 0);
+    if (atadev->param.support.command2 & ATA_SUPPORT_STANDBY)
+       ata_controlcmd(dev, ATA_STANDBY_IMMEDIATE, 0, 0, 0);
+
     return 0;
 }

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to