Subject: kern/17642: TEAC CD-RW at Promise adapter on A7V266 panics NetBSD 1.5.2
To: None <gnats-bugs@gnats.netbsd.org>
From: Klaus Heinz <k.heinz.jul.zwei@onlinehome.de>
List: netbsd-bugs
Date: 07/19/2002 02:43:40
>Number:         17642
>Category:       kern
>Synopsis:       TEAC CD-RW at Promise adapter on A7V266 panics NetBSD 1.5.2
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 18 17:45:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Klaus Heinz
>Release:        NetBSD 1.5.2
>Organization:
none
>Environment:
System: 

NetBSD 1.5.2 (GENERIC) #2: Fri Jul 19 00:45:46 MEST 2002
  root@silence.homedns.org:/a/src-1.5.2/src/sys/arch/i386/compile/GENERIC
cpu0: AMD K7 (Athlon) (686-class), 1333.44 MHz
total memory = 511 MB
avail memory = 468 MB
using 6573 buffers containing 26292 KB of memory
BIOS32 rev. 0 found at 0xf0c60
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: VIA Technologies product 0x3099 (rev. 0x00)
ppb0 at pci0 dev 1 function 0: VIA Technologies product 0xb099 (rev. 0x00)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: Nvidia Corporation product 0x0110 (rev. 0xb2)
wsdisplay0 at vga1: console (80x25, vt100 emulation)
cmpci0 at pci0 dev 5 function 0: CMI8738 PCI Audio Device
cmpci0: interrupting at irq 10
audio0 at cmpci0: full duplex, mmap, independent
pciide0 at pci0 dev 6 function 0: Promise Ultra100/ATA Bus Master IDE Accelerator (rev. 0x02)
pciide0: bus-master DMA support present
pciide0: primary channel configured to native-PCI mode
pciide0: using irq 12 for native-PCI interrupt
atapibus0 at pciide0 channel 0
cd0 at atapibus0 drive 0: <CD-W512EB, , 2.0E> type 5 cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
cd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
pciide0: secondary channel configured to native-PCI mode
pciide0: disabling secondary channel (no drives)
rtk0 at pci0 dev 12 function 0: RealTek 8139 10/100BaseTX
rtk0: interrupting at irq 12
rtk0: Ethernet address 00:30:84:2b:7f:64
ukphy0 at rtk0 phy 7: Generic IEEE 802.3u media interface
ukphy0: OUI 0x000000, model 0x0000, rev. 0
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0 at pci0 dev 13 function 0: Intel i82557 Ethernet, rev 5
fxp0: interrupting at irq 11
fxp0: Ethernet address 00:a0:c9:e6:58:a3, 10/100 Mb/s
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 0
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pcib0 at pci0 dev 17 function 0
pcib0: VIA Technologies product 0x3074 (rev. 0x00)
pciide1 at pci0 dev 17 function 1: VIA Technologies unknown ATA controller
pciide1: bus-master DMA support present
pciide1: primary channel configured to compatibility mode
wd0 at pciide1 channel 0 drive 0: <MAXTOR 4K080H4>
wd0: drive supports 16-sector pio transfers, lba addressing
wd0: 76319 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 156301488 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5
pciide1: primary channel interrupting at irq 14
wd0(pciide1:0:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
pciide1: secondary channel configured to compatibility mode
atapibus1 at pciide1 channel 1
cd1 at atapibus1 drive 0: <LITEON  DVD-ROM LTD163, , GH5E> type 5 cdrom removable
cd1: 32-bit data port
cd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
pciide1: secondary channel interrupting at irq 15
cd1(pciide1:1:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
uhci0 at pci0 dev 17 function 2: VIA Technologies VT83C572 USB Controller (rev. 0x1b)
uhci0: interrupting at irq 12
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA Technologie UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 17 function 3: VIA Technologies VT83C572 USB Controller (rev. 0x1b)
uhci1: interrupting at irq 12
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: VIA Technologie UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 17 function 4: VIA Technologies VT83C572 USB Controller (rev. 0x1b)
uhci2: interrupting at irq 12
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: VIA Technologie UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
lpt0 at isa0 port 0x378-0x37b irq 7
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
isapnp0: no ISA Plug 'n Play devices found
biomask f365 netmask fb65 ttymask fbe7
boot device: wd0
root on wd0a dumps on wd0b

>Description:
	The CD-RW drive is connected to the PROMISE chip on an ASUS
	A7V266-E Motherboard. It is not possible to mount CD-ROMs or
	CD-RW discs in the drive. Issuing

	  'scsictl /dev/cd0d identify'

	produces the following (dmesg) output with NetBSD 1.5.2:


pciide0:0:0: lost interrupt
	type: atapi tc_bcount: 32 tc_skip: 0
pciide0:0:0: bus-master DMA error: missing interrupt, status=0x21
cd0: transfer error, downgrading to Ultra-DMA mode 1
cd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 1 (using DMA data transfers)
wdc_atapi_intr: unknown phase 0x1
pciide0:0:0: lost interrupt
	type: atapi tc_bcount: 32 tc_skip: 0
pciide0:0:0: bus-master DMA error: missing interrupt, status=0x21
pciide0:0:0: device timeout, c_bcount=32, c_skip=0
cd0: transfer error, downgrading to DMA mode 2
cd0(pciide0:0:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
pciide0:0:0: lost interrupt
	type: atapi tc_bcount: 32 tc_skip: 0
pciide0:0:0: bus-master DMA error: missing interrupt, status=0x21
cd0: transfer error, downgrading to PIO mode 4
cd0(pciide0:0:0): using PIO mode 4
pciide0:0:0: lost interrupt
	type: atapi tc_bcount: 32 tc_skip: 0
pciide0:0:0: bus-master DMA \M-error: missing interrupt, status=0x21
pciide0:0:0: bad state 0 in wdc_atapi_intr
panic: wdc_atapi_intr: bad state


	After this the kernel debugger ddb takes over.
	A look at the resulting memory dump with gdb shows this:


# gdb netbsd.gdb
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsd"...
(gdb) target kcore netbsd.1.core
panic: wdc_atapi_intr: bad state

#0  0xc04e88e8 in db_last_command ()
(gdb) bt
#0  0xc04e88e8 in db_last_command ()
#1  0x1ff9d000 in ?? ()
#2  0xc02ff773 in cpu_reboot (howto=256, bootstr=0x0)
    at ../../../../arch/i386/i386/machdep.c:1175
#3  0xc018e325 in db_sync_cmd () at ../../../../ddb/db_command.c:720
#4  0xc018df4c in db_command (last_cmdp=0xc04e88e8, cmd_table=0xc04e8708)
    at ../../../../ddb/db_command.c:320
#5  0xc018e0ee in db_command_loop () at ../../../../ddb/db_command.c:555
#6  0xc0190e82 in db_trap (type=1, code=0) at ../../../../ddb/db_trap.c:78
#7  0xc02fd5a2 in kdb_trap (type=1, code=0, regs=0xe3daad20)
    at ../../../../arch/i386/i386/db_interface.c:119
#8  0xc0307004 in trap (frame={tf_gs = 16, tf_fs = 16, tf_es = 16, tf_ds = 16, 
      tf_edi = 256, tf_esi = -1069314550, tf_ebp = -472208032, 
      tf_ebx = -472208000, tf_edx = -1069447776, tf_ecx = 22528, tf_eax = 0, 
      tf_trapno = 1, tf_err = 0, tf_eip = -1070606740, tf_cs = 8, 
      tf_eflags = 514, tf_esp = -472208012, tf_ss = -1071940344, 
      tf_vm86_es = -1058494288, tf_vm86_ds = 1, tf_vm86_fs = -472207936, 
      tf_vm86_gs = -472207920}) at ../../../../arch/i386/i386/trap.c:299
#9  0xc0100e8f in calltrap ()
#10 0xc01b7d08 in panic (fmt=0xc0438e0a "wdc_atapi_intr: bad state\n")
    at ../../../../kern/subr_prf.c:224
#11 0xc030a984 in wdc_atapi_intr (chp=0xc0e8a8b0, xfer=0xc0e8b000, irq=1)
    at ../../../../dev/scsipi/atapi_wdc.c:441
---Type <return> to continue, or q <return> to quit---
#12 0xc0175437 in wdctimeout (arg=0xc0e8a8b0) at ../../../../dev/ic/wdc.c:943
#13 0xc01a5411 in softclock () at ../../../../kern/kern_clock.c:921
#14 0xc01a529f in hardclock (frame=0xe3daae54)
    at ../../../../kern/kern_clock.c:855
#15 0xc039a9e3 in clockintr (arg=0xe3daae54)
    at ../../../../arch/i386/isa/clock.c:409
#16 0xc010103c in Xintr0 ()
(gdb) quit


	I cannot test with NetBSD 1.6 at this time, but I did a test with
	the NetBSD 1.5.3 kernel. Although it still does not work, the kernel
	does not panic after I get similar kernel messages as with 1.5.2.
	Instead it simply says on the command line

	  # scsictl /dev/cd0d identify
	  scsictl: /dev/cd0d: Input/output error
	  # eject /dev/cd0d
	  eject: open: /dev/cd0d: Input/output error
 
	
	There is another phenomenon that could be related to the problem.
	When the kernel (1.5.2 or 1.5.3) starts it always waits about 15
	to 20 seconds after this line (see dmesg output at the start of
	the PR)

	  pciide0: using irq 12 for native-PCI interrupt

	just before it detects the CD-RW drive.

	The CD-RW drive itself has been working in a different machine with
	the Intel 430HX chipset.

>How-To-Repeat:
	Boot NetBSD 1.5.2 on an ASUS A7V266-E with a TEAC CD-W512EB on
	the first channel of the PROMISE chip. Use
	  'scsictl /dev/cd0d identify'
	and see the kernel error messages.
>Fix:
	not known
>Release-Note:
>Audit-Trail:
>Unformatted: