From gil@kloepfer.org  Tue May 31 04:24:04 2005
Return-Path: <gil@kloepfer.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A025816A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 31 May 2005 04:24:04 +0000 (GMT)
	(envelope-from gil@kloepfer.org)
Received: from limbic.kloepfer.org (limbic.kloepfer.org [67.65.12.9])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 96B4543D48
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 31 May 2005 04:24:03 +0000 (GMT)
	(envelope-from gil@kloepfer.org)
Received: from limbic.kloepfer.org (localhost.kloepfer.org [127.0.0.1])
	by limbic.kloepfer.org (8.13.3/8.13.3) with ESMTP id j4V4O2jr089968;
	Mon, 30 May 2005 23:24:02 -0500 (CDT)
Received: (from gil@localhost)
	by limbic.kloepfer.org (8.13.3/8.13.3/Submit) id j4V4O2aq089967;
	Mon, 30 May 2005 23:24:02 -0500 (CDT)
	(envelope-from gil@kloepfer.org)
Message-Id: <200505310424.j4V4O2aq089967@limbic.kloepfer.org>
Date: Mon, 30 May 2005 23:24:02 -0500 (CDT)
From: Gil Kloepfer <fgil@kloepfer.org>
Reply-To: Gil Kloepfer <fgil@kloepfer.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] atacontrol support for disk APM and acoustic management
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         81692
>Category:       bin
>Synopsis:       [patch] [ata] atacontrol(8) support for disk APM and acoustic management
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          suspended
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 31 04:30:01 GMT 2005
>Closed-Date:    
>Last-Modified:  Sun Sep 05 20:04:00 UTC 2010
>Originator:     Gil Kloepfer
>Release:        FreeBSD 5.4-RELEASE i386
>Organization:
Self
>Environment:
System: FreeBSD limbic.kloepfer.org 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May 22 12:52:26 CDT 2005 root@build.int.kloepfer.org:/usr/src/sys/i386/compile/DELLDIM i386

>Description:
Attached is a patch to enhance atacontrol so that it may
control an ATA hard disk's advanced power management (APM) and
acoustic management features.  The former is typically important
with laptop/notebook hard disks where the drives are designed
to operate in low power mode by default.  For systems where
this is not important, it can lead to the drive constantly
spinning up-and-down, leading to reduced performance.  This
feature can also be used to enable power management where it
is not enabled by default.

Acoustic management functions similarly.

Note that /usr/include/sys/ata.h (in the source as
sys/sys/ata.h) is modified to include the appropriate
symbolic representation of the APM and acoustic feature
codes from the ATA specification.

>How-To-Repeat:
This is not a bug, so there's nothing to repeat.

>Fix:
The following patch is uuencoded in order to prevent modification
by e-mail servers.  It patches the following files:

(based in /usr/src)
sbin/atacontrol/atacontrol.c
sbin/atacontrol/atacontrol.8
sys/sys/ata.h

(yes, I really did include the additions to the manpage!!)

begin 644 atapatch
M+2TM('-B:6XO871A8V]N=')O;"]A=&%C;VYT<F]L+F,N3U))1PE4:'4@36%Y
M(#(P(#$P.C`Q.C(V(#(P,#0**RLK('-B:6XO871A8V]N=')O;"]A=&%C;VYT
M<F]L+F,)36]N($UA>2`S,"`R,CHS,CHQ,"`R,#`U"D!`("TU,34L-B`K-3$U
M+#<P($!`"B`)"0D);6]D93)S='(H:6]C;60N=2YM;V1E+FUO9&5;,5TI*3L*
M(`D)?0H@"7T**PEE;'-E(&EF("@A<W1R8VUP*&%R9W9;,5TL(")F96%T=7)E
M(BD@)B8@87)G8R`]/2`V*2!["BL)"6EO8VUD+F1E=FEC92`](&%T;VDH87)G
M=ELS72D["BL)"6EO8VUD+F-M9"`]($%405)%455%4U0["BL)"6EO8VUD+G4N
M<F5Q=65S="YU+F%T82YC;VUM86YD(#T@051!7U-%5$9%05154D53.PHK"0EI
M;V-M9"YU+G)E<75E<W0N=&EM96]U="`](#4P,#L**PD):68@*"%S=')C;7`H
M87)G=ELT72P@(F%P;2(I*2!["BL)"0EI9B`H(7-T<F-M<"AA<F=V6S5=+"`B
M;V9F(BDI('L**PD)"0EI;V-M9"YU+G)E<75E<W0N=2YA=&$N9F5A='5R92`]
M($%405]31E]$25-?05!-.PHK"0D)?0HK"0D)96QS92!I9B`H(7-T<F-M<"AA
M<F=V6S5=+"`B;6%X<&5R9B(I*2!["BL)"0D):6]C;60N=2YR97%U97-T+G4N
M871A+F9E871U<F4@/2!!5$%?4T9?14Y!0E]!4$T["BL)"0D):6]C;60N=2YR
M97%U97-T+G4N871A+F-O=6YT(#T@,'AF93L**PD)"7T**PD)"65L<V4@:68@
M*"%S=')C;7`H87)G=ELU72P@(FUI;G!O=V5R(BDI('L**PD)"0EI;V-M9"YU
M+G)E<75E<W0N=2YA=&$N9F5A='5R92`]($%405]31E]%3D%"7T%033L**PD)
M"0EI;V-M9"YU+G)E<75E<W0N=2YA=&$N8V]U;G0@/2`P>#`Q.PHK"0D)?0HK
M"0D)96QS92!["BL)"0D):6YT(&]F9G-E="`](#`["BL**PD)"0EI;V-M9"YU
M+G)E<75E<W0N=2YA=&$N9F5A='5R92`]($%405]31E]%3D%"7T%033L**PD)
M"0EI9B`H87)G=ELU75LP72`]/2`G<R<I('L**PD)"0D);V9F<V5T(#T@871O
M:2@F87)G=ELU75LQ72D["BL)"0D)"6EO8VUD+G4N<F5Q=65S="YU+F%T82YC
M;W5N="`](#!X,#$["BL)"0D)?2!E;'-E('L**PD)"0D);V9F<V5T(#T@871O
M:2@F87)G=ELU75LQ72D["BL)"0D)"6EO8VUD+G4N<F5Q=65S="YU+F%T82YC
M;W5N="`](#!X.#`["BL)"0D)?0HK"0D)"6EF("AO9F9S970@/CT@,"`F)B!O
M9F9S970@/#T@,3(W*0HK"0D)"0EI;V-M9"YU+G)E<75E<W0N=2YA=&$N8V]U
M;G0@*ST@;V9F<V5T.PHK"0D)?0HK"0E]"BL)"65L<V4@:68@*"%S=')C;7`H
M87)G=ELT72P@(F%C;W5S=&E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C9&5F:6YE"0E!5$%?4T9?14Y!0E]!4$T)"3!X,#4)+RH@96YA
M8FQE(&%D=B!P;W=E<B!M9VUT("HO"BLC9&5F:6YE"0E!5$%?4T9?1$E37T%0
M30D),'@X-0DO*B!D:7-A8FQE(&%D=B!P;W=E<B!M9VUT("HO"BLC9&5F:6YE
M"0E!5$%?4T9?14Y!0E]!0T-/55,),'@T,@DO*B!E;F%B;&4@86-O=7-T:6,@
M;6=M="`J+PHK(V1E9FEN90D)051!7U-&7T1)4U]!0T-/55,),'AC,@DO*B!D
M:7-A8FQE(&%C;W5S=&EC(&UG;70@*B\*(`H@+RH@051!4$D@8V]M;6%N9',@
M*B\*("-D969I;F4@051!4$E?5$535%]53DE47U)%0419"0DP>#`P"2\J(&-H
:96-K(&EF(&1E=FEC92!I<R!R96%D>2`J+PH`
`
end
>Release-Note:
>Audit-Trail:

From: Gil Kloepfer <fgil@kloepfer.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: bin/81692: [patch] atacontrol(8) support for disk APM and acoustic management
Date: Mon, 16 Jan 2006 15:59:55 -0600

 The following patch is an update to provide equivalent functionality
 for FreeBSD 6.0-RELEASE.  It would be very helpful to have this in future
 FreeBSD releases.  Thanks.
 
 -- Cut Here -- -- Cut Here -- -- Cut Here -- -- Cut Here --
 --- sbin/atacontrol/atacontrol.c.ORIG	Sun Aug  7 06:16:58 2005
 +++ sbin/atacontrol/atacontrol.c	Mon Jan 16 02:00:12 2006
 @@ -108,6 +108,8 @@
  		"        atacontrol rebuild array\n"
  		"        atacontrol status array\n"
  		"        atacontrol mode device [mode]\n"
 +		"        atacontrol feature device apm apmlevel\n"
 +		"        atacontrol feature device acoustic soundsupplevel\n"
  		"        atacontrol cap device\n"
  	);
  	exit(EX_USAGE);
 @@ -319,6 +321,88 @@
  				err(1, "ioctl(IOCATAGMODE)");
  			printf("current mode = %s\n", mode2str(mode));
  		}
 +		exit(EX_OK);
 +	}
 +	if (!strcmp(argv[1], "feature") && argc == 5) {
 +		int disk;
 +		char device[64];
 +		struct ata_ioc_request request;
 +
 +		if (!(sscanf(argv[2], "ad%d", &disk) == 1 ||
 +		      sscanf(argv[2], "acd%d", &disk) == 1 ||
 +		      sscanf(argv[2], "afd%d", &disk) == 1 ||
 +		      sscanf(argv[2], "ast%d", &disk) == 1)) {
 +			fprintf(stderr, "atacontrol: Invalid device %s\n",
 +				argv[2]);
 +			exit(EX_USAGE);
 +		}
 +		sprintf(device, "/dev/%s", argv[2]);
 +		if ((fd = open(device, O_RDONLY)) < 0)
 +			err(1, "device not found");
 +
 +		bzero(&request, sizeof(struct ata_ioc_request));
 +		request.u.ata.command = ATA_SETFEATURES;
 +		request.flags = ATA_CMD_CONTROL;
 +		request.timeout = 500;
 +		if (!strcmp(argv[3], "apm")) {
 +			if (!strcmp(argv[4], "off")) {
 +				request.u.ata.feature = ATA_SF_DIS_APM;
 +			}
 +			else if (!strcmp(argv[4], "maxperf")) {
 +				request.u.ata.feature = ATA_SF_ENAB_APM;
 +				request.u.ata.count = 0xfe;
 +			}
 +			else if (!strcmp(argv[4], "minpower")) {
 +				request.u.ata.feature = ATA_SF_ENAB_APM;
 +				request.u.ata.count = 0x01;
 +			}
 +			else {
 +				int offset = 0;
 +
 +				request.u.ata.feature = ATA_SF_ENAB_APM;
 +				if (argv[4][0] == 's') {
 +					offset = atoi(&argv[4][1]);
 +					request.u.ata.count = 0x01;
 +				} else {
 +					offset = atoi(&argv[4][1]);
 +					request.u.ata.count = 0x80;
 +				}
 +				if (offset >= 0 && offset <= 127)
 +					request.u.ata.count += offset;
 +			}
 +		}
 +		else if (!strcmp(argv[3], "acoustic")) {
 +			if (!strcmp(argv[4], "off")) {
 +				request.u.ata.feature = ATA_SF_DIS_ACCOUS;
 +			}
 +			else if (!strcmp(argv[4], "maxperf")) {
 +				request.u.ata.feature = ATA_SF_ENAB_ACCOUS;
 +				request.u.ata.count = 0xfe;
 +			}
 +			else if (!strcmp(argv[4], "maxquiet")) {
 +				request.u.ata.feature = ATA_SF_ENAB_ACCOUS;
 +				request.u.ata.count = 0x80;
 +			}
 +			else {
 +				request.u.ata.feature = ATA_SF_ENAB_ACCOUS;
 +				request.u.ata.count = atoi(argv[4]);
 +				if (request.u.ata.count > 124)
 +					request.u.ata.count = 124;
 +			}
 +		}
 +		else
 +			usage();
 +
 +		if (ioctl(fd, IOCATAREQUEST, &request) < 0)
 +			err(1, "ioctl(IOCATAREQUEST)");
 +
 +		if (request.error != 0) {
 +			fprintf(stderr,
 +				"IOCATAREQUEST returned err status %d",
 +				request.error);
 +			exit(EX_IOERR);
 +		}
 +
  		exit(EX_OK);
  	}
  	if (!strcmp(argv[1], "cap") && argc == 3) {
 --- sbin/atacontrol/atacontrol.8.ORIG	Fri Aug 19 10:54:42 2005
 +++ sbin/atacontrol/atacontrol.8	Mon Jan 16 02:09:05 2006
 @@ -64,6 +64,16 @@
  .Ic mode
  .Ar device
  .Nm
 +.Ic feature
 +.Ar device
 +.Ic apm
 +.Ar apmlevel
 +.Nm
 +.Ic feature
 +.Ar device
 +.Ic acoustic
 +.Ar soundsupplevel
 +.Nm
  .Ic info
  .Ar channel
  .Nm
 @@ -187,6 +197,44 @@
  (alias
  .Cm UDMA133 ) .
  The device name and manufacture/version strings are shown.
 +.It Ic feature / apm
 +Set disk drive Advanced Power Management (APM) level.
 +This command is generally used on laptop (notebook) hard disks to control
 +the power level consumed by the drive (at the expense of performance).
 +.Pp
 +The
 +.Ar apmlevel
 +may be set to one of:
 +.Cm off
 +(turn off APM),
 +.Cm maxperf
 +or
 +.Cm minpower
 +(optimize for maximum performance or minimum power, respectively), or
 +a numeric level which can be 0 to 127 inclusive indicating an increasing
 +level of performance over power savings.
 +The numeric levels may be prefixed by
 +.Cm s
 +which will allow the drive to include suspension as part of the
 +power savings.  Note that not all hard drives will support the
 +.Cm off
 +command, and that the number of incremental power savings levels
 +do not typically have as wide of a range as this command will
 +support.
 +.It Ic feature / acoustic
 +Control disk drive Acoustic Management level.  The
 +.Ar soundsupplevel
 +may be set to
 +.Cm off
 +which will turn off acoustic management,
 +.Cm maxperf
 +to optimize for maximum performance,
 +.Cm maxquiet
 +to optimize for maximum quiet, or a numeric level
 +from 0 to 124.  The higher the numeric level, the higher the
 +theoretical sound level emitted from the drive.  Note that few
 +devices support this command and even fewer will allow the
 +range of levels supported.
  .It Ic cap
  Show detailed info about the device on
  .Ar device .
 -- Cut Here -- -- Cut Here -- -- Cut Here -- -- Cut Here --

From: Gil Kloepfer <fgil@kloepfer.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: bin/81692: [patch] atacontrol(8) support for disk APM and acoustic management
Date: Mon, 16 Jan 2006 16:02:53 -0600

 Oops...this is also required for the FreeBSD 6.0 patch above.  It is
 the required change to /usr/include/sys/ata.h that provides the
 ATA codes for APM and acoustic management.
 
 
 -- Cut Here -- -- Cut Here -- -- Cut Here -- -- Cut Here -- -- Cut Here --
 --- usr/include/sys/ata.h.ORIG	Thu Nov  3 02:09:29 2005
 +++ usr/include/sys/ata.h	Mon Jan 16 01:06:47 2006
 @@ -267,6 +267,10 @@
  #define         ATA_SF_DIS_RELIRQ       0xdd    /* disable release interrupt */
  #define         ATA_SF_ENAB_SRVIRQ      0x5e    /* enable service interrupt */
  #define         ATA_SF_DIS_SRVIRQ       0xde    /* disable service interrupt */
 +#define		ATA_SF_ENAB_APM		0x05	/* enable adv power mgmt */
 +#define		ATA_SF_DIS_APM		0x85	/* disable adv power mgmt */
 +#define		ATA_SF_ENAB_ACCOUS	0x42	/* enable acoustic mgmt */
 +#define		ATA_SF_DIS_ACCOUS	0xc2	/* disable acoustic mgmt */
  #define ATA_SECURITY_FREEE_LOCK         0xf5    /* freeze security config */
  #define ATA_READ_NATIVE_MAX_ADDDRESS    0xf8    /* read native max address */
  #define ATA_SET_MAX_ADDRESS             0xf9    /* set max address */
 -- Cut Here -- -- Cut Here -- -- Cut Here -- -- Cut Here -- -- Cut Here --
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: netchild 
Responsible-Changed-When: Sun Dec 10 19:46:03 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=81692 
Responsible-Changed-From-To: sos->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue May 12 04:33:22 UTC 2009 
Responsible-Changed-Why:  
sos@ is not actively working on ATA-related PRs. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=81692 
State-Changed-From-To: open->suspended 
State-Changed-By: arundel 
State-Changed-When: Sun Sep 5 20:03:08 UTC 2010 
State-Changed-Why:  
Work on the ATA subsytem has been suspended, because eventually it will get 
replaced by CAM. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=81692 
>Unformatted:
