Subject: kern/8245: pool wdcspl: reentrancy at file wdc.c (plus, CDROM doesn't work)
To: None <gnats-bugs@gnats.netbsd.org>
From: Dave Huang <khym@bga.com>
List: netbsd-bugs
Date: 08/20/1999 11:50:54
>Number:         8245
>Category:       kern
>Synopsis:       pool wdcspl: reentrancy at file wdc.c (plus, CDROM doesn't work)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 20 11:50:01 1999
>Last-Modified:
>Originator:     Dave Huang
>Organization:
Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 23 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
>Release:        NetBSD-current as of August 15, 1999
>Environment:
	
System: NetBSD dell.metonymy.com 1.4J NetBSD 1.4J (DELL) #7: Sun Aug 15 00:46:11 CDT 1999     khym@dahan.metonymy.com:/usr/src.local/sys/arch/i386/compile/DELL i386

NetBSD 1.4J (DELL) #7: Sun Aug 15 00:46:11 CDT 1999
    khym@dahan.metonymy.com:/usr/src.local/sys/arch/i386/compile/DELL
cpu0: family 5 model 2 step 5
cpu0: Intel Pentium (P54C) (586-class)
total memory = 32384 KB
avail memory = 27932 KB
using 430 buffers containing 1720 KB of memory
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 2
pci0: i/o enabled, memory enabled
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82434LX/NX PCI, Cache and Memory Controller (PCMC) (rev. 0x11)
pciide0 at pci0 dev 1 function 0: PC Technology RZ1000 (rev. 0x01)
pciide0: hardware does not support DMA
pciide0: primary channel wired to compatibility mode
pciide0: primary channel interrupting at irq 14
wd0 at pciide0 channel 0 drive 0: <ST31720A>
wd0: drive supports 16-sector pio transfers, lba addressing
wd0: 1625MB, 3303 cyl, 16 head, 63 sec, 512 bytes/sect x 3329424 sectors
wd0: drive supports PIO mode 4, DMA mode 2
wd1 at pciide0 channel 0 drive 1: <Conner Peripherals 1080MB - CFS1081A>
wd1: drive supports 16-sector pio transfers, lba addressing
wd1: 1032MB, 2097 cyl, 16 head, 63 sec, 512 bytes/sect x 2114180 sectors
wd1: drive supports PIO mode 4, DMA mode 2
pciide0: secondary channel wired to compatibility mode
pciide0: secondary channel ignored (other hardware responding at addresses)
pcib0 at pci0 dev 2 function 0
pcib0: Intel 82378ZB System I/O (SIO) (rev. 0x43)
vga0 at pci0 dev 6 function 0: Number 9 Computer Company Imagine-128 (rev. 0x00)
wsdisplay0 at vga0: console (80x25, vt100 emulation)
fxp0 at pci0 dev 12 function 0: Intel i82557 Ethernet, rev 5
fxp0: interrupting at irq 10
fxp0: Ethernet address 00:90:27:13:0b:30, 10/100 Mb/s
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 0
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
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
wdc1 at isa0 port 0x170-0x177 irq 15
atapibus0 at wdc1 channel 0
cd0 at atapibus0 drive 0: <ATAPI CD-ROM DRIVE 32X MAXIMUM, , 323P> type 5 cdrom removable
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
lpt0 at isa0 port 0x378-0x37b irq 7
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
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
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


>Description:
	This machine is an old Dell Dimension XPS P90, with what looks
to be a rather strange IDE system. The motherboard has two IDE
connectors; one labelled "PCI IDE," the other "ISA IDE." NetBSD agrees
with this, attaching the drives on the "PCI IDE" connector to pciide0
and the CDROM on the "ISA IDE" connector to wdc1. BTW, that CDROM is
an Acer of some sort... Acer 632 perhaps, but I'm not positive (I can
look it up if needed). The machine also has an extremely annoying
BIOS... it assigns all PCI cards the same IRQ (which you can set in
the CMOS setup utility). Anyways, all that is to say that the hardware
seems pretty weird and lame. However, Windows works just fine on it :)

The problem is that the CDROM doesn't work. If I try to mount a disc
or do a "disklabel cd0" (either with or without a CD in the drive), I
get:
     wdc1:0:0: lost interrupt
	     type: atapi
	     c_bcount: 32
	     c_skip: 0
three times. The drive doesn't spin up or anything.

Normally, I see those messages every day from the /etc/daily script
trying to do a disklabel on the drive, but nothing really bad happens.
However, this morning, I saw:
     [ a couple of the wdc1:0:0: lost interrupt messages ]
     pool wdcspl: reentrancy at file ../../../../dev/ic/wdc.c line 1305
	     previous entry at file ../../../../dev/ic/wdc.c line 1286
     panic: pr_enter
     Stopped in disklabel at Debugger+0x4: leave

A stack trace shows the following functions:
     Debugger+0x4
     panic+0x55
     _pool_put+0x52
     wdc_free_xfer+0x80
     wdc_ata_bio_done+0x8b
     wdc_ata_bio_intr+0x42c
     wdcintr+0x54
     pciide_compat_intr+0x1e
     Xintr14+0x70
     --- interrupt ---
     _pool_get+0x550
     wdc_get_xfer+0x27
     wdc_atapi_send_cmd+0x4b
     scsipi_execute_xs+0x3c
     atapi_scsipi_cmd+0x9a
     scsipi_test_unit_ready+0x3c
     cdopen+0xbb
     spec_open+0x162
     vn_open+0x341
     sys_open+0xd0
     syscall+0x1ed
     --- syscall (number 5) ---

>How-To-Repeat:
	I don't know how to reproduce the panic, but see above for the
"lost interrupt" message.
>Fix:
>Audit-Trail:
>Unformatted: