From nobody@FreeBSD.org  Thu Mar 31 19:17:11 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9F68916A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 31 Mar 2005 19:17:11 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7B0EB43D58
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 31 Mar 2005 19:17:11 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j2VJHBwU063003
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 31 Mar 2005 19:17:11 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j2VJHBlF063002;
	Thu, 31 Mar 2005 19:17:11 GMT
	(envelope-from nobody)
Message-Id: <200503311917.j2VJHBlF063002@www.freebsd.org>
Date: Thu, 31 Mar 2005 19:17:11 GMT
From: arnaud de prelle <arnaud@pnzone.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [ataidle?] Come back from idle make the server reboot.
X-Send-Pr-Version: www-2.3

>Number:         79409
>Category:       i386
>Synopsis:       Coming back from idles make the server reboot
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gavin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 31 19:20:05 GMT 2005
>Closed-Date:    Thu Feb 21 17:29:09 UTC 2008
>Last-Modified:  Thu Feb 21 17:29:09 UTC 2008
>Originator:     arnaud de prelle
>Release:        FreeBSD 5.4-PRERELEASE
>Organization:
>Environment:
FreeBSD pnserver.pnzone.net 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #7: Wed Mar 30 22:10:04 CEST 2005     apn@pnserver.pnzone.net:/usr/obj/usr/src/sys/PNkernel  i386
>Description:
When the ata1-master disk come back from sleep (configured by ataidle), it
is removed and I can't browse it anymore.  A manual umount makes the server
reboot.

Here are the logs for the event:
kernel: ad2: TIMEOUT - READ_DMA retrying (2 retries left) LBA=265761311
kernel: ad2: WARNING - removed from configuration
kernel: ata1-master: FAILURE - READ_DMA timed out
kernel: ata1-master: timeout state=0 unexpected

It is a new 200Go Maxtor disk:
ad2: 194481MB <Maxtor 6B200P0/BAH41BY0> [395136/16/63] at ata1-master UDMA133

Config ataidle:
/usr/local/sbin/ataidle -S 20 1 0 (in rc.local)

>How-To-Repeat:
Unknown, not regular.
>Fix:
Unknown
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Thu Feb 21 17:19:25 UTC 2008 
State-Changed-Why:  
To submitter: firstly, sorry that it has taken so long for this PR to 
be looked at.  PR kern/99567 is about the same issue, from that PR: 

"Since ataidle bypasses the kernel and talks directly to the hardware 
there are cases where it just doesn't work with certain controllers.  
Unfortunately the only solution at the moment is simply not to use it if  
it doesn't work with the combination of hardware you have. The  
READ_DMA timeouts are expected: the kernel doesn't expect to have to  
wait for a drive to spin up before data can be read. [...] This only 
becomes a problem if the operation fails after all the retries have 
been done." 

As it appears your drives take longer to spin up than the kernel is 
prepared to wait, the kernel gives up on the disk; assuming it is no 
longer there (as it has no idea that the disk was ever put to sleep). 
Apparently there is a possibility that using ataidle's standby mode 
rather than sleep mode may help with this. 

There is talk of integrating this functionality into the kernel, I don't 
know of a timeframe which this will be completed in.  You could possibly 
try upping the retries count in the ATA code to see if you are able to 
work around the problem that way, else the only answer is to not use 
ataidle on your hardware. 



Responsible-Changed-From-To: freebsd-i386->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Thu Feb 21 17:19:25 UTC 2008 
Responsible-Changed-Why:  
Track 

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