From nobody@FreeBSD.org  Sat Dec  3 14:51:16 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 072FD16A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  3 Dec 2005 14:51:16 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A46DF43D53
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  3 Dec 2005 14:51:15 +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 jB3EpFIS058571
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 3 Dec 2005 14:51:15 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id jB3EpF1l058560;
	Sat, 3 Dec 2005 14:51:15 GMT
	(envelope-from nobody)
Message-Id: <200512031451.jB3EpF1l058560@www.freebsd.org>
Date: Sat, 3 Dec 2005 14:51:15 GMT
From: Pl Marius Bjrnstad <pmbjornstad@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Writing to S-ATA HDD in DMA mode fails
X-Send-Pr-Version: www-2.3

>Number:         89885
>Category:       kern
>Synopsis:       [ata] Writing to S-ATA HDD in DMA mode fails
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    remko
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 03 15:00:15 GMT 2005
>Closed-Date:    Mon Mar 12 07:21:00 GMT 2007
>Last-Modified:  Mon Mar 12 07:21:00 GMT 2007
>Originator:     Pl Marius Bjrnstad
>Release:        6.0-RELEASE
>Organization:
Private
>Environment:
FreeBSD fa2k.fa2001.mine.nu 6.0-STABLE FreeBSD 6.0-STABLE #2: Sat Dec  3 00:35:40 CET 2005     root@fa2k.fa2001.mine.nu:/usr/obj/usr/src/sys/BLACKHOLE  i386

>Description:
This bug /may/ be the result of a slightly "unstable" system. I have to disable the APIC for the system to stay up more than 2-5 minutes. When doing that, the computer seems stable, it can run for 12 hours, with no weird messages in the console, except, of course the following problem. If no-one else are experiencing this, it's obvious that this bug should be ignored.

When I try to mount the Serial ATA disk, the following messages appear in the console:
ad4: TIMEOUT - WRITE_DMA retrying (1 retry left) LBA=12063
ad4: TIMEOUT - WRITE_DMA retrying (0 retries left) LBA=12063
ad4: FAILURE - WRITE_DMA timed out LBA=12063
g_vfs_done():ad4s1d[WRITE(offset=6144000, length=8192)]error = 5
ad4: TIMEOUT - WRITE_DMA retrying (1 retry left) LBA=12063
ad4: TIMEOUT - WRITE_DMA retrying (0 retries left) LBA=12063
ad4: FAILURE - WRITE_DMA timed out LBA=12063
g_vfs_done():ad4s1d[WRITE(offset=6144000, length=8192)]error = 5

The S-ATA controller is located on the motherboard. It is an Asus A7N8X. Output of pciconf -lv for the S-ATA controller:
hdr=0x00
    vendor   = 'Silicon Image Inc (Was: CMD Technology Inc)'
    device   = 'SiI 3112 SATALink/SATARaid Controller'
    class    = mass storage
    subclass = RAID

It is possible to view the files on the filesystem, and to write to it when it is mounted this way, but I suspect that data is lost, or will be lost, if it is used extensively. When setting the drive to PIO4-mode using atacontrol, the errors do not appear, and everything works as expected. When mounting in read-only mode, it can read flawlessly (with DMA enabled).

The hard drive is a Seagate, with 80GB:
ATA channel 2:
    Master:  ad4 <ST380023AS/3.01> ATA/ATAPI revision 6
    Slave:       no device present

I have CVSup'ed to the most recent version of RELEASE-6.0. The problem did not occur on Windows, so it's not an (obvious) case of broken hardware. ACPI disable/enable changes nothing.
>How-To-Repeat:
With the described hardware, the problem appears once one tries to use the drive.
>Fix:
              
>Release-Note:
>Audit-Trail:

From: Brooks Davis <brooks@one-eyed-alien.net>
To: =?iso-8859-1?Q?P=E5l_Marius_Bj=F8rnstad?= <pmbjornstad@gmail.com>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: misc/89885: Writing to S-ATA HDD in DMA mode fails
Date: Sat, 3 Dec 2005 09:51:11 -0800

 The SiI 3112 is a well known lemon.  It is unlikely FreeBSD will ever
 provide decent support for it.
 
 -- Brooks

From: =?iso-8859-15?Q?P=E5l_Marius_Bj=F8rnstad?= <pmbjornstad@gmail.com>
To: bug-followup@freebsd.org, pmbjornstad@gmail.com
Cc:  
Subject: Re: kern/89885: [ata] Writing to S-ATA HDD in DMA mode fails
Date: Sun, 04 Dec 2005 01:06:09 +0100

 Well, I guess I'm off to Linux then. Unless, of course, there is anything  
 I can do to help... Its unlikely, as I have just finished an introductory  
 course to Java programming, and I don't have a clue about hardware  
 interfaces. I don't want to discourage anyone, though, FreeBSD is a great  
 OS, but no OS can be everything for everyone.
State-Changed-From-To: open->feedback 
State-Changed-By: remko 
State-Changed-When: Fri Jan 26 21:58:20 UTC 2007 
State-Changed-Why:  
Hello, 

In the time since your less good contact with FreeBSD we changed 
a lot, also in your area, are you able to test whether this still 
is a problem or is this resolved? Hopefully we can get to a point 
where you can be proud and happy about FreeBSD :-) 

Thanks for the willingness to improve the OS 


Responsible-Changed-From-To: freebsd-bugs->remko 
Responsible-Changed-By: remko 
Responsible-Changed-When: Fri Jan 26 21:58:20 UTC 2007 
Responsible-Changed-Why:  
grab the pr 

http://www.freebsd.org/cgi/query-pr.cgi?pr=89885 
State-Changed-From-To: feedback->closed 
State-Changed-By: remko 
State-Changed-When: Mon Mar 12 07:20:58 UTC 2007 
State-Changed-Why:  
feedback timeout 

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