NetBSD Problem Report #16159
Received: (qmail 4143 invoked from network); 1 Apr 2002 19:08:02 -0000
Message-Id: <200204011903.g31J3ps00380@jackdaniels.acasa.ro>
Date: Mon, 1 Apr 2002 22:03:51 +0300 (EEST)
From: Mihai.Chelaru@jackdaniels.acasa.ro
Reply-To: kefren@netbsd.ro
To: gnats-bugs@gnats.netbsd.org
Subject: kernel & ide problems
X-Send-Pr-Version: 3.95
>Number: 16159
>Category: kern
>Synopsis: kernel won't boot if an IDE channel has no devices attached
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: bouyer
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Apr 01 19:09:00 +0000 2002
>Closed-Date: Thu Jan 23 10:58:49 +0000 2003
>Last-Modified: Thu Jan 23 10:58:49 +0000 2003
>Originator: Mihai Chelaru
>Release: NetBSD 1.5ZB
>Organization:
RomTeleNet
>Environment:
System: NetBSD JackDaniels 1.5ZB NetBSD 1.5ZB (Kefren) #0: Sun Mar 17 22:45:38 EET 2002 root@JackDaniels:/data/usr/src/sys/arch/i386/compile/Kefren i386
Architecture: i386
Machine: i386
>Description:
Kernel will hang up at boot time in a lost interrupt/waiting loop if an IDE channel has no devices attached.
>How-To-Repeat:
Enable from BIOS the secondary IDE interface and attach no devices to that one.
>Fix:
>Release-Note:
>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: kefren@netbsd.ro
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/16159: kernel & ide problems
Date: Mon, 1 Apr 2002 21:26:11 +0200
On Mon, Apr 01, 2002 at 10:03:51PM +0300, Mihai.Chelaru@jackdaniels.acasa.ro wrote:
>
> >Number: 16159
> >Category: kern
> >Synopsis: kernel won't boot if an IDE channel has no devices attached
> >Confidential: no
> >Severity: critical
> >Priority: high
> >Responsible: kern-bug-people
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Mon Apr 01 11:09:00 PST 2002
> >Closed-Date:
> >Last-Modified:
> >Originator: Mihai Chelaru
> >Release: NetBSD 1.5ZB
> >Organization:
>
> RomTeleNet
> >Environment:
>
>
> System: NetBSD JackDaniels 1.5ZB NetBSD 1.5ZB (Kefren) #0: Sun Mar 17 22:45:38 EET 2002 root@JackDaniels:/data/usr/src/sys/arch/i386/compile/Kefren i386
> Architecture: i386
> Machine: i386
> >Description:
> Kernel will hang up at boot time in a lost interrupt/waiting loop if an IDE channel has no devices attached.
> >How-To-Repeat:
> Enable from BIOS the secondary IDE interface and attach no devices to that one.
More details please. Can you give the dmesg output ?
Can you also give more details about the loop, especially the error message
--
Manuel Bouyer <bouyer@antioche.eu.org>
--
From: "Kefren" <kefren@netbsd.ro>
To: "Manuel Bouyer" <bouyer@antioche.eu.org>
Cc: <gnats-bugs@gnats.netbsd.org>
Subject: Re: kern/16159: kernel & ide problems
Date: Mon, 1 Apr 2002 22:46:36 +0200
I'm afraid not. It looks like this:
(pciide0:0:1): lost interrupt, sleeping for retry
And the cycle is infinite (well, it last at least 10 minutes... i rebooted
after).
ty,
Mihai
----- Original Message -----
From: "Manuel Bouyer" <bouyer@antioche.eu.org>
To: <kefren@netbsd.ro>
Cc: <gnats-bugs@gnats.netbsd.org>
Sent: Monday, April 01, 2002 9:26 PM
Subject: Re: kern/16159: kernel & ide problems
> On Mon, Apr 01, 2002 at 10:03:51PM +0300,
Mihai.Chelaru@jackdaniels.acasa.ro wrote:
> >
> > >Number: 16159
> > >Category: kern
> > >Synopsis: kernel won't boot if an IDE channel has no devices
attached
> > >Confidential: no
> > >Severity: critical
> > >Priority: high
> > >Responsible: kern-bug-people
> > >State: open
> > >Class: sw-bug
> > >Submitter-Id: net
> > >Arrival-Date: Mon Apr 01 11:09:00 PST 2002
> > >Closed-Date:
> > >Last-Modified:
> > >Originator: Mihai Chelaru
> > >Release: NetBSD 1.5ZB
> > >Organization:
> >
> > RomTeleNet
> > >Environment:
> >
> >
> > System: NetBSD JackDaniels 1.5ZB NetBSD 1.5ZB (Kefren) #0: Sun Mar 17
22:45:38 EET 2002
root@JackDaniels:/data/usr/src/sys/arch/i386/compile/Kefren i386
> > Architecture: i386
> > Machine: i386
> > >Description:
> > Kernel will hang up at boot time in a lost interrupt/waiting loop if an
IDE channel has no devices attached.
> > >How-To-Repeat:
> > Enable from BIOS the secondary IDE interface and attach no devices to
that one.
>
> More details please. Can you give the dmesg output ?
>
> Can you also give more details about the loop, especially the error
message
>
>
> --
> Manuel Bouyer <bouyer@antioche.eu.org>
> --
>
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Kefren <kefren@netbsd.ro>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/16159: kernel & ide problems
Date: Mon, 1 Apr 2002 21:58:36 +0200
On Mon, Apr 01, 2002 at 10:46:36PM +0200, Kefren wrote:
> I'm afraid not. It looks like this:
> (pciide0:0:1): lost interrupt, sleeping for retry
> And the cycle is infinite (well, it last at least 10 minutes... i rebooted
> after).
Are you sure it's "pciide0:0:1" ?
Can you send the dmesg output ?
--
Manuel Bouyer <bouyer@antioche.eu.org>
--
From: "Kefren" <kefren@netbsd.ro>
To: "Manuel Bouyer" <bouyer@antioche.eu.org>
Cc: <gnats-bugs@gnats.netbsd.org>
Subject: Re: kern/16159: kernel & ide problems
Date: Mon, 1 Apr 2002 23:22:29 +0200
i don't have any dmesg (the kernel acts like this before mounting rw / ).
And i'm not very sure about about pciide0:0:1 (i think it's pciide0,
rather). The problem is that i have this problem on two remote servers. I
came back in a couple of days with more details.
----- Original Message -----
From: "Manuel Bouyer" <bouyer@antioche.eu.org>
To: "Kefren" <kefren@netbsd.ro>
Cc: <gnats-bugs@gnats.netbsd.org>
Sent: Monday, April 01, 2002 9:58 PM
Subject: Re: kern/16159: kernel & ide problems
> On Mon, Apr 01, 2002 at 10:46:36PM +0200, Kefren wrote:
> > I'm afraid not. It looks like this:
> > (pciide0:0:1): lost interrupt, sleeping for retry
> > And the cycle is infinite (well, it last at least 10 minutes... i
rebooted
> > after).
>
> Are you sure it's "pciide0:0:1" ?
> Can you send the dmesg output ?
>
> --
> Manuel Bouyer <bouyer@antioche.eu.org>
> --
>
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Kefren <kefren@netbsd.ro>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/16159: kernel & ide problems
Date: Mon, 1 Apr 2002 22:28:03 +0200
On Mon, Apr 01, 2002 at 11:22:29PM +0200, Kefren wrote:
> i don't have any dmesg (the kernel acts like this before mounting rw / ).
But if you disable the second channel, it boots ? This would be enouth for
me ...
> And i'm not very sure about about pciide0:0:1 (i think it's pciide0,
> rather). The problem is that i have this problem on two remote servers. I
> came back in a couple of days with more details.
OK. Which device gets the lost interrupt (pciide0:0:1 or pciide0:1:0) is
important :)
--
Manuel Bouyer <bouyer@antioche.eu.org>
--
From: "Kefren" <kefren@netbsd.ro>
To: "Manuel Bouyer" <bouyer@antioche.eu.org>
Cc: <gnats-bugs@gnats.netbsd.org>
Subject: Re: kern/16159: kernel & ide problems
Date: Tue, 2 Apr 2002 00:10:00 +0200
Yes. It has no problems if i disable the secondary channel from BIOS.
----- Original Message -----
From: "Manuel Bouyer" <bouyer@antioche.eu.org>
To: "Kefren" <kefren@netbsd.ro>
Cc: <gnats-bugs@gnats.netbsd.org>
Sent: Monday, April 01, 2002 10:28 PM
Subject: Re: kern/16159: kernel & ide problems
> On Mon, Apr 01, 2002 at 11:22:29PM +0200, Kefren wrote:
> > i don't have any dmesg (the kernel acts like this before mounting rw
/ ).
>
> But if you disable the second channel, it boots ? This would be enouth for
> me ...
>
> > And i'm not very sure about about pciide0:0:1 (i think it's pciide0,
> > rather). The problem is that i have this problem on two remote servers.
I
> > came back in a couple of days with more details.
>
> OK. Which device gets the lost interrupt (pciide0:0:1 or pciide0:1:0) is
> important :)
>
> --
> Manuel Bouyer <bouyer@antioche.eu.org>
> --
>
From: "Mihai Chelaru" <kefren@netbsd.ro>
To: "Manuel Bouyer" <bouyer@antioche.eu.org>
Cc: <gnats-bugs@gnats.netbsd.org>
Subject: Re: kern/16159: kernel & ide problems
Date: Sun, 7 Apr 2002 01:29:01 +0200
Hello again,
I had this problem on another computer. This time I copied the message:
pciide0:1:0: lost interrupt
type: ata tc_bcount:512 tc_skip:0
pciide0:1:0: not ready, st=0x00, err=0x00
wd1d: device timeout reading fsbn 0 (wd1 bn 0; cn0 tn0 sn0), retrying
And I so also this message:
wd1: dos partition error
And i have no dos partitions on that system, and no msdos fs in fstab.
Thanks,
Mihai
----- Original Message -----
From: "Manuel Bouyer" <bouyer@antioche.eu.org>
To: "Kefren" <kefren@netbsd.ro>
Cc: <gnats-bugs@gnats.netbsd.org>
Sent: Monday, April 01, 2002 9:58 PM
Subject: Re: kern/16159: kernel & ide problems
> On Mon, Apr 01, 2002 at 10:46:36PM +0200, Kefren wrote:
> > I'm afraid not. It looks like this:
> > (pciide0:0:1): lost interrupt, sleeping for retry
> > And the cycle is infinite (well, it last at least 10 minutes... i
rebooted
> > after).
>
> Are you sure it's "pciide0:0:1" ?
> Can you send the dmesg output ?
>
> --
> Manuel Bouyer <bouyer@antioche.eu.org>
> --
>
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Mihai Chelaru <kefren@netbsd.ro>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/16159: kernel & ide problems
Date: Sun, 7 Apr 2002 19:04:33 +0200
On Sun, Apr 07, 2002 at 01:29:01AM +0200, Mihai Chelaru wrote:
> Hello again,
>
> I had this problem on another computer. This time I copied the message:
>
> pciide0:1:0: lost interrupt
> type: ata tc_bcount:512 tc_skip:0
> pciide0:1:0: not ready, st=0x00, err=0x00
> wd1d: device timeout reading fsbn 0 (wd1 bn 0; cn0 tn0 sn0), retrying
>
> And I so also this message:
>
> wd1: dos partition error
>
> And i have no dos partitions on that system, and no msdos fs in fstab.
It tries to read the DOS partition table for each drive, to see if there's
a NetBSD partition in there.
Do you really have a drive connected to the secondary channel of the
controller ?
Can you send me the dmesg of this machine ?
--
Manuel Bouyer <bouyer@antioche.eu.org>
--
From: Mihai Chelaru <kefren@netbsd.ro>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/16159: kernel & ide problems
Date: Mon, 08 Apr 2002 09:14:12 +0300
--------------060700030809010702060608
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Nope. No drive in the secondary controller. I'll give you the dmesg this
evening.
Thanks,
Mihai
Manuel Bouyer wrote:
>On Sun, Apr 07, 2002 at 01:29:01AM +0200, Mihai Chelaru wrote:
>
>>Hello again,
>>
>>I had this problem on another computer. This time I copied the message:
>>
>>pciide0:1:0: lost interrupt
>> type: ata tc_bcount:512 tc_skip:0
>>pciide0:1:0: not ready, st=0x00, err=0x00
>>wd1d: device timeout reading fsbn 0 (wd1 bn 0; cn0 tn0 sn0), retrying
>>
>>And I so also this message:
>>
>>wd1: dos partition error
>>
>>And i have no dos partitions on that system, and no msdos fs in fstab.
>>
>
>It tries to read the DOS partition table for each drive, to see if there's
>a NetBSD partition in there.
>Do you really have a drive connected to the secondary channel of the
>controller ?
>Can you send me the dmesg of this machine ?
>
--------------060700030809010702060608
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<html>
<head>
</head>
<body>
Nope. No drive in the secondary controller. I'll give you the dmesg this
evening.<br>
<br>
Thanks,<br>
Mihai<br>
<br>
Manuel Bouyer wrote:<br>
<blockquote type="cite" cite="mid:20020407170433.GE1012@antioche.eu.org">
<pre wrap="">On Sun, Apr 07, 2002 at 01:29:01AM +0200, Mihai Chelaru wrote:<br></pre>
<blockquote type="cite">
<pre wrap="">Hello again,<br><br>I had this problem on another computer. This time I copied the message:<br><br>pciide0:1:0: lost interrupt<br> type: ata tc_bcount:512 tc_skip:0<br>pciide0:1:0: not ready, st=0x00, err=0x00<br>wd1d: device timeout reading fsbn 0 (wd1 bn 0; cn0 tn0 sn0), retrying<br><br>And I so also this message:<br><br>wd1: dos partition error<br><br>And i have no dos partitions on that system, and no msdos fs in fstab.<br></pre>
</blockquote>
<pre wrap=""><!----><br>It tries to read the DOS partition table for each drive, to see if there's<br>a NetBSD partition in there.<br>Do you really have a drive connected to the secondary channel of the<br>controller ?<br>Can you send me the dmesg of this machine ?<br><br></pre>
</blockquote>
<br>
</body>
</html>
--------------060700030809010702060608--
From: Mihai Chelaru <kefren@netbsd.ro>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/16159: kernel & ide problems
Date: Mon, 08 Apr 2002 18:41:41 +0300
Here is a normal dmesg.
NetBSD 1.5ZB (Kefren) #0: Sun Mar 17 22:45:38 EET 2002
root@JackDaniels:/data/usr/src/sys/arch/i386/compile/Kefren
cpu0: Intel Pentium II/Celeron (Deschutes) (686-class), 350.82 MHz
cpu0: I-cache 16 KB 32b/line 4-way, D-cache 16 KB 32b/line 2-way
cpu0: L2 cache 512 KB 32b/line 4-way
cpu0: features 183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR>
cpu0: features 183f9ff<PGE,MCA,CMOV,FGPAT,PSE36,MMX,FXSR>
total memory = 127 MB
avail memory = 115 MB
using 1658 buffers containing 6632 KB of memory
BIOS32 rev. 0 found at 0xfb240
PCI BIOS rev. 2.1 found at 0xfb270
PCI IRQ Routing Table rev. 1.0 found at 0xfd4c0, size 160 bytes (8 entries)
PCI Interrupt Router at 000:07:0 (vendor 0x8086 product 0x7000)
PCI Exclusive IRQs: 11
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: vendor 0x8086 product 0x7190 (rev. 0x03)
agp0 at pchb0: aperture at 0xe8000000, size 0x4000000
ppb0 at pci0 dev 1 function 0: vendor 0x8086 product 0x7191 (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: vendor 0x5333 product 0x8a13 (rev. 0x02)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
pcib0 at pci0 dev 7 function 0
pcib0: vendor 0x8086 product 0x7110 (rev. 0x02)
pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4) (rev.
0x01)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
atapibus0 at pciide0 channel 0: 2 targets
cd0 at atapibus0 drive 1: <CRD-8322B, 1998/10/26, 1.10> type 5 cdrom
removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2
wd0 at pciide0 channel 0 drive 0: <Nikimi NIK-XR205A>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 19595 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 40132503 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA
data transfers)
cd0(pciide0:0:1): using PIO mode 4, DMA mode 2 (using DMA data transfers)
pciide0: secondary channel wired to compatibility mode
pciide0: disabling secondary channel (no drives)
vendor 0x8086 product 0x7112 (USB serial bus, revision 0x01) at pci0 dev 7
function 2 not configured
vendor 0x8086 product 0x7113 (miscellaneous bridge, revision 0x02) at pci0
dev 7 function 3 not configured
rtk0 at pci0 dev 16 function 0: RealTek 8139 10/100BaseTX
rtk0: interrupting at irq 11
rtk0: Ethernet address 00:48:54:1c:59:c4
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
isa0 at pcib0
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
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: no ISA Plug 'n Play devices found
apm0 at mainbus0: Power Management spec V1.2
biomask f7fd netmask fffd ttymask ffff
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
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 (80x25, vt100 emulation)
Accounting started
Mihai
Manuel Bouyer wrote:
> On Sun, Apr 07, 2002 at 01:29:01AM +0200, Mihai Chelaru wrote:
> > Hello again,
> >
> > I had this problem on another computer. This time I copied the message:
> >
> > pciide0:1:0: lost interrupt
> > type: ata tc_bcount:512 tc_skip:0
> > pciide0:1:0: not ready, st=0x00, err=0x00
> > wd1d: device timeout reading fsbn 0 (wd1 bn 0; cn0 tn0 sn0), retrying
> >
> > And I so also this message:
> >
> > wd1: dos partition error
> >
> > And i have no dos partitions on that system, and no msdos fs in fstab.
>
> It tries to read the DOS partition table for each drive, to see if there's
> a NetBSD partition in there.
> Do you really have a drive connected to the secondary channel of the
> controller ?
> Can you send me the dmesg of this machine ?
>
> --
> Manuel Bouyer <bouyer@antioche.eu.org>
> --
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Mihai Chelaru <kefren@netbsd.ro>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/16159: kernel & ide problems
Date: Mon, 8 Apr 2002 23:59:26 +0200
--vkogqOf2sHV7VnPd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
OK, thanks.
I'm not sure what's going on. It's possible that the controller, with its
floating lines, happen to read random values which can fool the driver
in thinking that the IDENTIFY command succeeded.
Can you try the attached patch ? It should make it more robust for the read
case, and correct a protocol error for the write case.
--
Manuel Bouyer <bouyer@antioche.eu.org>
--
--vkogqOf2sHV7VnPd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="wdc.diff"
? pci/pciide.c+pdc_hack
Index: ata/ata.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ata/ata.c,v
retrieving revision 1.16
diff -u -r1.16 ata.c
--- ata.c 2001/12/03 00:20:22 1.16
+++ ata.c 2002/04/08 21:58:45
@@ -112,6 +112,9 @@
wdc_c.flags), DEBUG_FUNCS|DEBUG_PROBE);
return CMD_ERR;
} else {
+ /* if we didn't read any data something is wrong */
+ if ((wdc_c.flags & AT_XFDONE) == 0)
+ return CMD_ERR;
/* Read in parameter block. */
memcpy(prms, tb, sizeof(struct ataparams));
#if BYTE_ORDER == LITTLE_ENDIAN
Index: ata/atavar.h
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ata/atavar.h,v
retrieving revision 1.23
diff -u -r1.23 atavar.h
--- atavar.h 2001/12/03 00:20:23 1.23
+++ atavar.h 2002/04/08 21:58:45
@@ -133,10 +133,11 @@
#define AT_WAIT 0x0008 /* wait in controller code for command completion */
#define AT_POLL 0x0010 /* poll for command completion (no interrupts) */
#define AT_DONE 0x0020 /* command is done */
-#define AT_ERROR 0x0040 /* command is done with error */
-#define AT_TIMEOU 0x0080 /* command timed out */
-#define AT_DF 0x0100 /* Drive fault */
-#define AT_READREG 0x0200 /* Read registers on completion */
+#define AT_XFDONE 0x0040 /* data xfer is done */
+#define AT_ERROR 0x0080 /* command is done with error */
+#define AT_TIMEOU 0x0100 /* command timed out */
+#define AT_DF 0x0200 /* Drive fault */
+#define AT_READREG 0x0400 /* Read registers on completion */
int timeout; /* timeout (in ms) */
void *data; /* Data buffer address */
int bcount; /* number of bytes to transfer */
Index: ic/wdc.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/wdc.c,v
retrieving revision 1.113
diff -u -r1.113 wdc.c
--- wdc.c 2002/03/28 22:51:58 1.113
+++ wdc.c 2002/04/08 21:58:50
@@ -1374,8 +1374,26 @@
int bcount = wdc_c->bcount;
char *data = wdc_c->data;
+again:
WDCDEBUG_PRINT(("__wdccommand_intr %s:%d:%d\n",
chp->wdc->sc_dev.dv_xname, chp->channel, xfer->drive), DEBUG_INTR);
+ if ((wdc_c->flags & AT_XFDONE) != 0) {
+ /*
+ * We have completed a data xfer. The drive should now be
+ * in its initial state
+ */
+ if (wdcwait(chp, wdc_c->r_st_bmask | WDCS_DRQ,
+ wdc_c->r_st_bmask, (irq == 0) ? wdc_c->timeout : 0) != 0) {
+ if (irq && (xfer->c_flags & C_TIMEOU) == 0)
+ return 0; /* IRQ was not for us */
+ wdc_c->flags |= AT_TIMEOU;
+ __wdccommand_done(chp, xfer);
+ return 1;
+ }
+ wdc_c->flags |= AT_DONE;
+ __wdccommand_done(chp, xfer);
+ return 1;
+ }
if (wdcwait(chp, wdc_c->r_st_pmask, wdc_c->r_st_pmask,
(irq == 0) ? wdc_c->timeout : 0)) {
if (irq && (xfer->c_flags & C_TIMEOU) == 0)
@@ -1396,6 +1414,11 @@
if (bcount > 0)
bus_space_read_multi_2(chp->cmd_iot, chp->cmd_ioh,
wd_data, (u_int16_t *)data, bcount >> 1);
+ /* at this point the drive should be in its initial state */
+ wdc_c->flags |= AT_XFDONE;
+ if (wdcwait(chp, wdc_c->r_st_bmask | WDCS_DRQ,
+ wdc_c->r_st_bmask, 100) != 0)
+ wdc_c->flags |= AT_TIMEOU;
} else if (wdc_c->flags & AT_WRITE) {
if (chp->ch_drive[xfer->drive].drive_flags & DRIVE_CAP32) {
bus_space_write_multi_4(chp->data32iot, chp->data32ioh,
@@ -1406,6 +1429,15 @@
if (bcount > 0)
bus_space_write_multi_2(chp->cmd_iot, chp->cmd_ioh,
wd_data, (u_int16_t *)data, bcount >> 1);
+ wdc_c->flags |= AT_XFDONE;
+ if ((wdc_c->flags & AT_POLL) == 0) {
+ chp->ch_flags |= WDCF_IRQ_WAIT; /* wait for interrupt */
+ callout_reset(&chp->ch_callout,
+ wdc_c->timeout / 1000 * hz, wdctimeout, chp);
+ return 1;
+ } else {
+ goto again;
+ }
}
__wdccommand_done(chp, xfer);
return 1;
--vkogqOf2sHV7VnPd--
State-Changed-From-To: open->feedback
State-Changed-By: bouyer
State-Changed-When: Tue Apr 9 14:13:59 PDT 2002
State-Changed-Why:
I sent a patch to test
Responsible-Changed-From-To: kern-bug-people->bouyer
Responsible-Changed-By: bouyer
Responsible-Changed-When: Tue Apr 9 14:13:59 PDT 2002
Responsible-Changed-Why:
I'll handle this.
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
To: Mihai Chelaru <kefren@netbsd.ro>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/16159
Date: Wed, 10 Apr 2002 18:25:15 +0200
On Wed, Apr 10, 2002 at 03:40:22PM +0300, Mihai Chelaru wrote:
> Hello again,
>
> The patch worked and i got no errors in about 20 or 30 reboots. Hope it
> will be ok.
OK, thanks. I'll wait for the pullup queue for 1.5 to be open again before
closing the PR though.
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
--
From: SAITOH Masanobu <msaitoh@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:
Subject: pr/16159 CVS commit: [netbsd-1-5] src
Date: Thu, 23 Jan 2003 12:43:25 +0200 (EET)
Module Name: src
Committed By: msaitoh
Date: Thu Jan 23 10:43:24 UTC 2003
Modified Files:
src [netbsd-1-5]: CHANGES-1.5.4
Log Message:
Today's set:
o fix kernel won't boot if an IDE channel has no devices attached. PR#16159.
o fix struct secashead overrun. PR#18751.
To generate a diff of this commit:
cvs rdiff -r1.1.2.86 -r1.1.2.87 src/CHANGES-1.5.4
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: feedback->closed
State-Changed-By: bouyer
State-Changed-When: Thu Jan 23 02:57:50 PST 2003
State-Changed-Why:
Submitter said the fix solved his problem, and it has been pulled up to 1.5
>Unformatted:
(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.