Subject: kern/33786: ATAPI DMA with ITE 8212F
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <eye.of.the.8eholder@gmail.com>
List: netbsd-bugs
Date: 06/21/2006 14:05:00
>Number:         33786
>Category:       kern
>Synopsis:       ATAPI DMA with ITE 8212F
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 21 14:05:00 +0000 2006
>Originator:     Khelban Blackstaff
>Release:        NetBSD 3.99.21
>Organization:
>Environment:
NetBSD hostname 3.99.21 NetBSD 3.99.21 (hostname) #1: Fri Jun  9 10:18:57
EEST 2006  root@hostname:/usr/obj/usr/src/sys/arch/i386/compile/hostname
i386
>Description:
ATAPI DMA doesn't work with ITE 8212F controller.
Hard disks work perfectly but ATAPI devices (e.g dvdroms) work only in
PIO mode.

I include the dmesg output.
I also have the dmesg output from using "wdcdebug_atapi_mask=0xff" but
it huge that is why i don't include it. If it is needed i will include
it too.

iteide0 at pci5 dev 4 function 0
iteide0: Integrated Technology Express IDE controller (rev. 0x13)
iteide0: bus-master DMA support present
iteide0: primary channel wired to native-PCI mode
iteide0: using irq 3 for native-PCI interrupt
atabus0 at iteide0 channel 0
iteide0: secondary channel wired to native-PCI mode
atabus1 at iteide0 channel 1
atapibus0 at atabus0: 2 targets
cd0 at atapibus0 drive 0: <LITE-ON DVD SOHD-167T, , 9S1B> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
cd0(iteide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)

This is after boot. If i try to access the drive (even a simple
cdrecord -scanbus) gives the following:

iteide0:0:0: lost interrupt
        type: atapi tc_bcount: 32 tc_skip: 0
iteide0:0:0: bus-master DMA error: missing interrupt, status=0x21
cd0: transfer error, downgrading to Ultra-DMA mode 1
cd0(iteide0:0:0): using PIO mode 4, Ultra-DMA mode 1 (using DMA)
iteide0:0:0: lost interrupt
        type: atapi tc_bcount: 32 tc_skip: 0
iteide0:0:0: bus-master DMA error: missing interrupt, status=0x21
cd0: transfer error, downgrading to PIO mode 4
cd0(iteide0:0:0): using PIO mode 0

After this the drive works perfectly but in PIO mode.
>How-To-Repeat:
Use ATAPI devices connected to a ITE IDE controller.
>Fix: