Date: Fri, 29 Jan 2010 15:38:52 -0700 (MST) From: Warren Block <wblock@wonkity.com> To: Alexander Best <alexbestms@wwu.de> Cc: freebsd-hackers@freebsd.org Subject: Re: Spin down HDD after disk sync or before power off Message-ID: <alpine.BSF.2.00.1001291422590.46949@wonkity.com> In-Reply-To: <permail-2010012708514080e26a0b0000374a-a_best01@message-id.uni-muenster.de> References: <permail-2010012708514080e26a0b0000374a-a_best01@message-id.uni-muenster.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 27 Jan 2010, Alexander Best wrote: > i believe the sound you hear is due to the emergency unload sequence. i'm not > 100% sure, but i think after applying the patch the sound is gone. i recently > replaced my old IDE hdd (which made a very loud "click!" during shutdown) with > a new SATA hdd. the new one is very quiet and so it's not that easy to > recognise any changes in the spin down procedure. > > would be very nice if you could try the patch on one of the notebooks you're > referring to in order to see if the patch makes a difference. Based on followups to this thread, here's the modified patch I've tested: --- sys/dev/ata/ata-disk.c.orig 2010-01-28 10:47:57.000000000 -0700 +++ sys/dev/ata/ata-disk.c 2010-01-28 11:49:32.000000000 -0700 @@ -191,6 +191,10 @@ { struct ata_device *atadev = device_get_softc(dev); + if (atadev->param.support.command2 & ATA_SUPPORT_POWERMGT) + ata_controlcmd(dev, ATA_STANDBY_IMMEDIATE, 0, 0, 0); + return 0; + if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE) ata_controlcmd(dev, ATA_FLUSHCACHE, 0, 0, 0); return 0; This uses the POWERMGT bit and adds it before the existing code. On a desktop system with an 80G drive, it's hard to tell if there's an audible difference. On an Acer notebook with a WD drive, it does change the sound. Without the patch, the drive shutdown sounds like power has been pulled, with a GLINK! head park followed by a decreasing-pitch spindown whir. With the patch, there's a quieter glink with nearly no spindown whir. Because this is subjective, I recorded the shutdown sounds with a microphone underneath the notebook hard drive: http://wonkity.com/~wblock/sounds/unpatchedglink.wav http://wonkity.com/~wblock/sounds/patchedglink.wav Can't speak to the safety of this, but it definitely sounds better. -Warren Block * Rapid City, South Dakota USA
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1001291422590.46949>