NetBSD Problem Report #9346
Received: (qmail 11859 invoked from network); 3 Feb 2000 23:19:35 -0000
Message-Id: <20000203231843.6301634D9@eed.miee.ru>
Date: Fri, 4 Feb 2000 02:18:43 +0300 (MSK)
From: luke@eed.miee.ru
Reply-To: luke@eed.miee.ru
To: gnats-bugs@gnats.netbsd.org
Subject: Incorrect pciide driver behaviour
X-Send-Pr-Version: 3.95
>Number: 9346
>Category: kern
>Synopsis: pciide driver finds a non-existent ATAPI device
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Feb 03 15:20:59 +0000 2000
>Closed-Date: Mon Feb 14 12:38:21 +0000 2000
>Last-Modified: Mon Feb 14 12:40:27 +0000 2000
>Originator: Oleg Polyanski
>Release: 1.4-current
>Organization:
>Environment:
>Description:
During the boot pciide driver finds non-existent `wd0' (ST 506
drive to be exact). Such device has never been existed in
system. Below is the output from `dmesg':
NetBSD 1.4Q (TINDERBOX) #5: Thu Feb 3 00:09:11 MSK 2000
root@dazzle.org:/usr/src/syssrc/sys/arch/i386/compile/TINDERBOX
cpu0: family 6 model 5 step 1
cpu0: Intel Pentium II (Deschutes) (686-class)
total memory = 127 MB
avail memory = 116 MB
using 1659 buffers containing 6636 KB of memory
BIOS32 rev. 0 found at 0xfdb60
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: Intel 82443BX Host Bridge/Controller (rev. 0x02)
ppb0 at pci0 dev 1 function 0: Intel 82443BX AGP Interface (rev. 0x02)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: Matrox MGA G100 AGP (rev. 0x02)
wsdisplay0 at vga1: console (80x25, vt100 emulation)
pcib0 at pci0 dev 7 function 0
pcib0: Intel 82371AB PCI-to-ISA Bridge (PIIX4) (rev. 0x02)
pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
atapibus0 at pciide0 channel 0
sd0 at atapibus0 drive 1: <IOMEGA ZIP 100 ATAPI, , 23.D> type 0 direct removable
sd0: drive offline
sd0: 32-bits data port
wd0 at pciide0 channel 0 drive 0: <ST506>
wd0: drive supports 1-sector pio transfers, chs addressing
wd0: 69632 KB, 1024 cyl, 8 head, 17 sec, 512 bytes/sect x 139264 sectors
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 0
sd0(pciide0:0:1): using PIO mode 3
pciide0: secondary channel wired to compatibility mode
atapibus1 at pciide0 channel 1
cd0 at atapibus1 drive 1: <ASUS CD-S340, , V3.10> type 5 cdrom removable
cd0: 32-bits data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
pciide0: secondary channel interrupting at irq 15
cd0(pciide0:1:1): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
uhci0 at pci0 dev 7 function 2: Intel 82371AB USB Host Controller (PIIX4) (rev. 0x01)
uhci0: interrupting at irq 11
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
Intel 82371AB Power Management Controller (PIIX4) (miscellaneous bridge, revision 0x02) at pci0 dev 7 function 3 not configured
ncr0 at pci0 dev 16 function 0: ncr 53c875 fast20 wide scsi
ncr0: interrupting at irq 10
ncr0: minsync=12, maxsync=137, maxoffs=16, 128 dwords burst, large dma fifo
ncr0: single-ended, open drain IRQ driver, using on-chip SRAM
ncr0: restart (scsi reset).
scsibus0 at ncr0: 16 targets, 8 luns per target
ne0 at pci0 dev 17 function 0: Compex Ethernet
ne0: supplying EUI64: 00:80:48:ff:fe:d9:b1:d4
ne0: Ethernet address 00:80:48:d9:b1:d4
ne0: interrupting at irq 9
3Dfx Interactive Voodoo2 (video multimedia, revision 0x02) at pci0 dev 19 function 0 not configured
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
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: read port 0x203
isapnp0: No current device for tag, card 1
sb0 at isapnp0 port 0x220/16,0x330/2,0x388/4 irq 5 drq 1,5
sb0: Creative SB AWE64 PnP Audio: dsp v4.16
audio0 at sb0: full duplex, mmap, independent
mpu0 at sb0
midi0 at mpu0: SB MPU-401 MIDI UART
opl0 at sb0: model OPL3
midi1 at opl0: SB Yamaha OPL3
joy0 at isapnp0 port 0x200/8
joy0: Creative SB AWE64 PnP Game
joy0: joystick not connected
isapnp0: <Creative SB AWE64 PnP, CTL0022, , WaveTable> port 0x620/4 not configured
apm0 at mainbus0: Power Management spec V1.2
apm0: A/C state: on
apm0: battery charge state: no battery
biomask fd45 netmask ff45 ttymask ffc7
scsibus0: waiting 2 seconds for devices to settle...
sd1 at scsibus0 targ 1 lun 0: <SEAGATE, ST52160N, 0285> SCSI2 0/direct fixed
sd1(ncr0:1:0): 20.0 MB/s (50 ns, offset 15)
sd1: 2069 MB, 6536 cyl, 4 head, 162 sec, 512 bytes/sect x 4238282 sectors
sd2 at scsibus0 targ 2 lun 0: <SEAGATE, ST36530N, 1206> SCSI2 0/direct fixed
sd2(ncr0:2:0): 20.0 MB/s (50 ns, offset 15)
sd2: 6208 MB, 9006 cyl, 6 head, 235 sec, 512 bytes/sect x 12715920 sectors
ums0 at uhub0 port 1 configuration 1 interface 0
ums0: Logitech N48, rev 1.00/4.01, addr 2, iclass 3/1
ums0: 3 buttons and Z dir.
wsmouse0 at ums0 mux 0
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal timed out
wd0d: device timeout reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0)
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 512
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0)
wd0: dos partition I/O error
pciide0:0:0: lost interrupt
type: ata
c_bcount: 2048
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 of 0-3 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 2048
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 of 0-3 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 2048
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 of 0-3 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 2048
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 of 0-3 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 2048
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 of 0-3 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
pciide0:0:0: lost interrupt
type: ata
c_bcount: 2048
c_skip: 0
pciide0:0:0: recal drive fault
wd0d: device fault reading fsbn 0 of 0-3 (wd0 bn 0; cn 0 tn 0 sn 0)
boot device: sd2
root on sd2a dumps on sd2b
root file system type: ffs
IP Filter: loaded into slot 29
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25bf, vt100 emulation)
wsmux1: connecting to wsdisplay0
uhci_device_intr_transfer: not done, ii=0xf060e800
[....]
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
To: luke@eed.miee.ru
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/9346: Incorrect pciide driver behaviour
Date: Fri, 4 Feb 2000 21:01:47 +0100
On Fri, Feb 04, 2000 at 02:18:43AM +0300, luke@eed.miee.ru wrote:
> [...]
> pciide0: primary channel wired to compatibility mode
> atapibus0 at pciide0 channel 0
> sd0 at atapibus0 drive 1: <IOMEGA ZIP 100 ATAPI, , 23.D> type 0 direct removable
> sd0: drive offline
> sd0: 32-bits data port
> wd0 at pciide0 channel 0 drive 0: <ST506>
> wd0: drive supports 1-sector pio transfers, chs addressing
> wd0: 69632 KB, 1024 cyl, 8 head, 17 sec, 512 bytes/sect x 139264 sectors
Hum, note that an ATAPI device as slave without master is not a recommended
configuration.
I'll have a look at this though, the fix should be simple.
--
Manuel Bouyer <bouyer@antioche.eu.org>
--
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
To: Oleg Polyanski <luke@eed.miee.ru>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/9346: Incorrect pciide driver behaviour
Date: Sat, 5 Feb 2000 13:04:11 +0100
On Sat, Feb 05, 2000 at 01:32:45AM +0300, Oleg Polyanski wrote:
> Uhm, it seems I didn't clarify the problem enough. There is NO wd0
> device in system. Only ATAPI ZIP drive (as primary and slave - sd0)
Yes I understood this. The point is that a slave device without master
is not a recommended configuration. But in most case is works anyway.
> and ATAPI CD drive (as secondary and slave too - cd0). 1.4P and
> earlier are not affected this problem, only 1.4Q and higher (but I
> remember that about more than one half year I had exactly the same
> problem that mysteriously disappeared). May I provide you with any
> additional info that will help you?
Could you try to boot a kernel with wdcdebug_mask set to 0x10 (DEBUG_PROBE) ?
Either change it in sys/dev/ic/wdc.c and recompile, or hack the static variable
with gdb:
gdb --write /netbsd
set wdcdebug_mask=0x10
quit
And send me the dmesg.
From reading the code this shouldn't be possible, I don't understand how
this wd0 can be here. At last 2 tests in the probe function should avoid it,
and nothing changed in the near past in this area.
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
--
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
To: Oleg Polyanski <luke@eed.miee.ru>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/9346: Incorrect pciide driver behaviour
Date: Tue, 8 Feb 2000 17:15:52 +0100
--0F1p//8PRICkK4MW
Content-Type: text/plain; charset=us-ascii
On Tue, Feb 08, 2000 at 12:51:30AM +0300, Oleg Polyanski wrote:
>
> Here is verbose dmesg.
>
Thanks. Could you please try the attached patch ? I think I've found what's
wrong (your controller puts randon values in the registers but and checks
in wdccommand_* are not strict enouth, so the IDENTIFY command appears to
work).
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
--
--0F1p//8PRICkK4MW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="pciide.diff"
Index: wdc.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/wdc.c,v
retrieving revision 1.78
diff -u -r1.78 wdc.c
--- wdc.c 2000/01/17 00:01:01 1.78
+++ wdc.c 2000/02/08 16:12:07
@@ -1226,7 +1226,7 @@
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
WDSD_IBM | (drive << 4));
- if (wdcwait(chp, wdc_c->r_st_bmask, wdc_c->r_st_bmask,
+ if (wdcwait(chp, wdc_c->r_st_bmask | WDCS_DRQ, wdc_c->r_st_bmask,
wdc_c->timeout) != 0) {
wdc_c->flags |= AT_TIMEOU;
__wdccommand_done(chp, xfer);
@@ -1306,6 +1306,9 @@
if (chp->ch_status & WDCS_DWF)
wdc_c->flags |= AT_DF;
+ /* still DRQ once cmd donne ? flag it as a timeout */
+ if (chp->ch_status & WDCS_DRQ)
+ wdc_c->flags |= AT_TIMEOU;
if (chp->ch_status & WDCS_ERR) {
wdc_c->flags |= AT_ERROR;
wdc_c->r_error = chp->ch_error;
--0F1p//8PRICkK4MW--
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
To: Oleg Polyanski <luke@eed.miee.ru>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/9346: Incorrect pciide driver behaviour
Date: Tue, 8 Feb 2000 18:44:58 +0100
--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
On Tue, Feb 08, 2000 at 05:15:52PM +0100, Manuel Bouyer wrote:
> Thanks. Could you please try the attached patch ? I think I've found what's
> wrong (your controller puts randon values in the registers but and checks
> in wdccommand_* are not strict enouth, so the IDENTIFY command appears to
> work).
Ops, this patch is wrong, sorry. Here's the rigth one.
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
--
--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="pciide.diff"
Index: wdc.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/wdc.c,v
retrieving revision 1.78
diff -u -r1.78 wdc.c
--- wdc.c 2000/01/17 00:01:01 1.78
+++ wdc.c 2000/02/08 17:44:05
@@ -1226,7 +1226,7 @@
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
WDSD_IBM | (drive << 4));
- if (wdcwait(chp, wdc_c->r_st_bmask, wdc_c->r_st_bmask,
+ if (wdcwait(chp, wdc_c->r_st_bmask | WDCS_DRQ, wdc_c->r_st_bmask,
wdc_c->timeout) != 0) {
wdc_c->flags |= AT_TIMEOU;
__wdccommand_done(chp, xfer);
--lrZ03NoBR/3+SXJZ--
State-Changed-From-To: open->closed
State-Changed-By: bouyer
State-Changed-When: Mon Feb 14 04:38:21 PST 2000
State-Changed-Why:
I just commited a fix.
>Unformatted:
>System: NetBSD dazzle.org 1.4Q NetBSD 1.4Q (TINDERBOX) #5: Thu Feb 3 00:09:11 MSK 2000 root@dazzle.org:/usr/src/syssrc/sys/arch/i386/compile/TINDERBOX i386
and tries to recognize it as valid block device causing very long
timeouts.
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.