ATA APM and NCQ support in FreeBSD atacontrol

Ian Smith smithi at nimnet.asn.au
Wed May 14 05:36:48 UTC 2008


On Tue, 13 May 2008, Alexandre "Sunny" Kovalenko wrote:
 > On Mon, 2008-05-12 at 14:52 +1000, Ian Smith wrote:
 > > On Sun, 11 May 2008 jonathan at kc8onw.net wrote:
 > >  > Has any work been done recently towards adding SATA Native Command
 > >  > Queueing as well as ATA APM and acoustic management to FreeBSD?
 > >  > 
 > >  > I found this PR (with patch) to add APM and acoustic management control to
 > >  > atacontrol.  The PR was opened in May 2005 has not been changed since
 > >  > December 2006 and is still open.
 > >  > http://www.freebsd.org/cgi/query-pr.cgi?pr=81692&cat=
 > >  > 
 > >  > I have not been able to find much of anything on SATA NCQ in FreeBSD newer
 > >  > than 2005 or 2006 does anyone know anything newer?
 > > 
 > > Jeremy has addressed the NCQ issue, about which I know nothing.
 > > 
 > > As for APM and AAM, that functionality is handled by sysutils/ataidle,
 > > which that PR appears - on a quick glance - to pretty well duplicate. 
 > > 
 > > I see phk@ recently added an 'atacontrol spindown' command to HEAD and
 > > RELENG_7 that appears to offer similar functionality to 'ataidle -S
 > > standby_mins' or 'ataidle -I idle_mins', though specified in seconds
 > > instead.  However this doesn't address acoustic management.
 > > 
 > > Or is ataidle broken for SATA disks?

 > Does not look broken here (RELENG_7):
 > 
 > RabbitsDen# ataidle /dev/ad4
 > Device Info:
 > 
 > Model:			HTS541010G9SA00                         
 > Serial:			MP2ZM4X0JWY6WH
 > Firmware Rev:		MBZIC60H
 > ATA revision:		ATA-7
 > LBA 48:			yes
 > Geometry:		16383 cyls, 16 heads, 63 spt
 > Capacity:		93GB
 > SMART Supported: 	yes
 > SMART Enabled: 		yes
 > APM Supported: 		yes
 > APM Enabled: 		yes
 > AAM Supported: 		yes
 > AAM Enabled: 		yes
 > Current AAM: 		1
 > Vendor Recommends AAM: 	1
 > APM Value: 		16638

Thanks for the confirmation Alexandre.

I take Jonathan's point that it would be nice to have this functionality
in atacontrol, though perhaps the BUGS section in ataidle(8) precludes
merging that?  cc'ing Bruce Cran in case he wants to add something ..

 > RabbitsDen# atacontrol list
[..]
 > ATA channel 2:
 >     Master:  ad4 <HTS541010G9SA00/MBZIC60H> Serial ATA v1.0
 >     Slave:       no device present

Regarding the spindown thing, I always used to use APM (set in BIOS) to
do that on this old laptop, until I found that I'd already consumed 25%
of a new 40GB drive's 2 million Load_Cycle_Count in a year, following a
thread warning about that last year, so now I run ataidle from rc.conf:

ataidle_enable="YES"
ataidle_device="ad0"
ataidle_ad0="-P 0 0 0"

but then found it necessary to again disable disk APM in rc.resume:

/usr/local/sbin/ataidle -P 0 0 0

cheers, Ian



More information about the freebsd-stable mailing list