From nobody@FreeBSD.org  Mon Mar  7 01:03:29 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 CAFCE16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  7 Mar 2005 01:03:29 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8331243D41
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  7 Mar 2005 01:03:29 +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 j2713TUe023133
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 7 Mar 2005 01:03:29 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j2713Sae023132;
	Mon, 7 Mar 2005 01:03:28 GMT
	(envelope-from nobody)
Message-Id: <200503070103.j2713Sae023132@www.freebsd.org>
Date: Mon, 7 Mar 2005 01:03:28 GMT
From: Andrzej Kukula <akukula@navopgd.pl>
To: freebsd-gnats-submit@FreeBSD.org
Subject: WRITE_DMA and READ_DMA timeouts with ATI RX330 chipset
X-Send-Pr-Version: www-2.3

>Number:         78517
>Category:       i386
>Synopsis:       [ata] WRITE_DMA and READ_DMA timeouts with ATI RX330 chipset
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    linimon
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 07 01:10:01 GMT 2005
>Closed-Date:    Sat Apr 21 22:21:38 GMT 2007
>Last-Modified:  Sat Apr 21 22:21:38 GMT 2007
>Originator:     Andrzej Kukula
>Release:        5.3-RELEASE ISO from freebsd.org
>Organization:
>Environment:
FreeBSD 5.3-RELEASE i386, kernel GENERIC installed from CD
>Description:
1. Default installation CD cannot proceed with newfs(8) due to WRITE_DMA
errors. I had to provide hw.ata.ata_dma=0 to proceed with the installation.
The hardware is Gigabyte 8TRX330-L mainboard with ATI RX330 chipset (ATI
IXP 300 South Bridge with integrated ATA/SATA controller). My disk is
Seagate ST340810A 40GB UDMA/33.

The error message was exactly as follows:
ad0: TIMEOUT - WRITE DMA retrying (2 retries left) LBA=xxxxxx
ata0: reiniting channel ..
ata0: reset tp1 mask=03 ostat0=58 ostat1=00
ad0: stat=0x50 err=0x01 lsb=0x00 msb=0x00
ata0-slave: stat=0x00 err=0x01 lsb=0x00 msb=0x00
ata0: reset tp2 stat0=50 stat1=00 devices=0x1<ATA_MASTER>
ata0: resetting done ..
ad0: pio=0x0c wdma=0x22 udma=0x45 cable=80pin
ata0: device config done ..
ad0: FAILURE - WRITE_DMA timed out

It is surprising as FreeBSD is the only OS among 5 I've installed on this
machine that doesn't work.

2. Any attempt to enable DMA either via boot loader or atacontrol(8) gives
the above error or frozen system. I tried
# atacontrol mode 0 wdma2 biospio
then
# find /
System printed:
ad0: TIMEOUT - READ DMA retrying (2 retries left)
and hung.

3. This ATA controller is detected as
atapci0:<GENERIC ATA controller> port 0xf000-0xf00f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 20.1 on pci0

# pciconf -l -v
..
atapci0@pci0:20:1: class=0x01018a card=0x50021458 chip=0x43691002 rev=0x01 hdr=0x00
vendor = 'ATI Technologies Inc.'
class = mass storage
subclass = ATA

>How-To-Repeat:
obvious methinks...
>Fix:
I just started poking, but I'm not a kernel hacker by any means... Maybe
this is of little help...
<http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/pci/ixpide.c?rev=1.2>
althought still lacking ID 0x4369

<http://linux.bkbits.net:8080/linux-2.6/anno/drivers/ide/pci/atiixp.c@1.9>
<http://linux.bkbits.net:8080/linux-2.6/anno/include/linux/pci_ids.h@1.203>

I can help by testing any CVS version and providing root on this machine
if it's needed (it's not production, contains no valuable data and is not
connected to any machine I care of... :)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Thu Apr 19 03:40:21 UTC 2007 
State-Changed-Why:  
Is this still a problem with recent versions of FreeBSD? 


Responsible-Changed-From-To: freebsd-i386->linimon 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Apr 19 03:40:21 UTC 2007 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=78517 

From: "Andrzej Kukula" <akukula@gmail.com>
To: bug-followup@FreeBSD.org, akukula@navopgd.pl
Cc:  
Subject: Re: i386/78517: [ata] WRITE_DMA and READ_DMA timeouts with ATI RX330 chipset
Date: Thu, 19 Apr 2007 10:48:50 +0200

 I've got no access to a machine with ATI RX330 chipset anymore. But it
 looks like dev/ata/ata-chipset.c version 1.126.2.5 just before 6.0
 RELEASE has added support for these chipsets.
 
 Thanks and regards,
 Andrzej Kukula
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Sat Apr 21 22:20:57 UTC 2007 
State-Changed-Why:  
Apparently support for this chipset was added just before 6.0R. 

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