From amdmi3@amdmi3.ru  Sat Apr 11 02:56:05 2009
Return-Path: <amdmi3@amdmi3.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EB101065672
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Apr 2009 02:56:05 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 4BD248FC14
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Apr 2009 02:56:05 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.69)
	(envelope-from <amdmi3@amdmi3.ru>)
	id 1LsTO1-0001L3-1N
	for FreeBSD-gnats-submit@freebsd.org; Sat, 11 Apr 2009 06:56:05 +0400
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id CC584C6A9
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Apr 2009 06:56:19 +0400 (MSD)
Received: by hades.panopticon (Postfix, from userid 1000)
	id 92B4410883E; Sat, 11 Apr 2009 06:55:45 +0400 (MSD)
Message-Id: <20090411025545.92B4410883E@hades.panopticon>
Date: Sat, 11 Apr 2009 06:55:45 +0400 (MSD)
From: Dmitry Marakasov <amdmi3@FreeBSD.org>
Reply-To: Dmitry Marakasov <amdmi3@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [ata] `atacontrol spindown` won't affect disk until some data is read from it
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         133593
>Category:       kern
>Synopsis:       [ata] `atacontrol(8) spindown` won't affect disk until some data is read from it
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          suspended
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 11 03:00:12 UTC 2009
>Closed-Date:    
>Last-Modified:  Sun Sep 05 20:04:40 UTC 2010
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Thu Apr 9 02:46:37 MSD 2009 root@hades.panopticon:/async/obj/usr/src/sys/HADES i386


>Description:
I have and extra PATA drive that I use for backups, and it is not even mounted on boot. To make it sleep until needed I've added atacontrol spindown ad5 60 into /etc/rc.local, but it turned out that this won't affect the drive until it is touched in any way. For example, if I do `dd if=/dev/ad5 of=/dev/null bs=512 count=1`, drive will spindown in 60 as it should. If I add it to fstab, it's also spun down. But until it is touched, it wont.

% sudo atacontrol info ata2
Master:  ad4 <ST3300622A/3.AAH> ATA/ATAPI revision 7
Slave:   ad5 <ST3300622A/3.AAH> ATA/ATAPI revision 7

% dmesg | grep ata2
ata2: <ATA channel 0> on atapci0
ata2: [ITHREAD]
ad4: 286168MB <Seagate ST3300622A 3.AAH> at ata2-master UDMA100
ad5: 286168MB <Seagate ST3300622A 3.AAH> at ata2-slave UDMA100

% dmesg | grep atapci0
atapci0: <Marvell 88SX6121 UDMA133 controller> port 0xec00-0xec07,0xe880-0xe883,0xe800-0xe807,0xe480-0xe483,0xe400-0xe40f mem 0xfeaffc00-0xfeafffff irq 16 at device 0.0 on pci3
atapci0: [ITHREAD]
ata2: <ATA channel 0> on atapci0

>How-To-Repeat:
>Fix:

>Release-Note:
>Audit-Trail:

From: Bruce Cran <bruce@cran.org.uk>
To: bug-followup@FreeBSD.org, amdmi3@FreeBSD.org
Cc:  
Subject: Re: kern/133593: [ata] `atacontrol spindown` won't affect disk
 until some data is read from it
Date: Sat, 11 Apr 2009 08:44:07 +0100

 This is documented as the way the spindown command works.  From
 atacontrol(8):
 
 spindown   Set or report timeout after which the device will be spun
 down. To arm the timeout the device needs at least one more request
 after setting the timeout.  To disable spindown, set the time- out to
 zero.  No further actions are needed in this case.
 
 -- 
 Bruce Cran

From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: Bruce Cran <bruce@cran.org.uk>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/133593: [ata] `atacontrol spindown` won't affect disk
	until some data is read from it
Date: Sat, 11 Apr 2009 16:36:31 +0400

 * Bruce Cran (bruce@cran.org.uk) wrote:
 
 > This is documented as the way the spindown command works.  From
 > atacontrol(8):
 > 
 > spindown   Set or report timeout after which the device will be spun
 > down. To arm the timeout the device needs at least one more request
 > after setting the timeout.  To disable spindown, set the time- out to
 > zero.  No further actions are needed in this case.
 
 Oh, thanks, didn't notice that.
 
 Then maybe it's possible to make atacontrol make some dummy
 request after the timeout is set?
 
 -- 
 Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
 amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru

From: Bruce Cran <bruce@cran.org.uk>
To: Dmitry Marakasov <amdmi3@amdmi3.ru>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/133593: [ata] `atacontrol spindown` won't affect disk
 until some data is read from it
Date: Sat, 11 Apr 2009 14:20:19 +0100

 On Sat, 11 Apr 2009 16:36:31 +0400
 Dmitry Marakasov <amdmi3@amdmi3.ru> wrote:
 
 > Then maybe it's possible to make atacontrol make some dummy
 > request after the timeout is set?
 
 The drive has an onboard timer that can be programmed so the drive
 spins down after a predetermined length of time it's been unused.  I'm
 not sure why the kernel's keeping track of this too and sending an
 immediate spindown command instead of telling it how long it should wait
 until spinning down.
 
 -- 
 Bruce Cran

From: Bruce Cran <bruce.cran@gmail.com>
To: bug-followup@FreeBSD.org, amdmi3@FreeBSD.org
Cc:  
Subject: Re: kern/133593: [ata] `atacontrol spindown` won't affect disk until 
	some data is read from it
Date: Sun, 2 May 2010 18:42:26 +0100

 It looks like no further work is being done to atacontrol, while new
 functionality is being added
 to the CAM based driver which uses camcontrol.
 
 -- 
 Bruce
State-Changed-From-To: open->suspended 
State-Changed-By: arundel 
State-Changed-When: Sun Sep 5 20:01:00 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=133593 
>Unformatted:
