Subject: Re: IDE problems
To: Mihai CHELARU <kefren@netbastards.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: current-users
Date: 11/07/2003 00:31:38
--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Nov 02, 2003 at 02:47:05PM +0200, Mihai CHELARU wrote:
> [...]
> wd2(viaide0:1:1): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using 
> DMA data transfers)
> wd2d: error reading fsbn 0 (wd2 bn 0; cn 0 tn 0 sn 0), retrying
> wd2: (aborted command, interface CRC error)
> 
> 	And here it hangs. An older kernel (1.6ZC) continues with:
> 
> wd2: soft error (corrected)


On Sun, Nov 02, 2003 at 02:05:13PM -0700, Bruce J.A. Nourish wrote:
> [...]
> wd0: transfer error, downgrading to Ultra-DMA mode 2
> wd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
> cd0(viaide0:0:1): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
> wd0d: error reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
> wd0: (aborted command, interface CRC error)

Hi,
can you try the attached patch ?

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 24 ans d'experience feront toujours la difference
--

--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: wdc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/wdc.c,v
retrieving revision 1.152
diff -u -r1.152 wdc.c
--- wdc.c	2003/11/02 11:07:46	1.152
+++ wdc.c	2003/11/06 23:26:42
@@ -1082,6 +1082,10 @@
 	    chp->wdc->sc_dev.dv_xname, chp->channel, drvp->drive),
 	    DEBUG_FUNCS);
 	if ((flags & AT_POLL) == 0) {
+		if (chp->ch_flags & WDCF_TH_RESET) {
+			/* no need to schedule a reset more than one time */
+			return;
+		}
 		chp->ch_flags |= WDCF_TH_RESET;
 		chp->ch_queue->queue_freeze++;
 		wakeup(&chp->thread);

--VbJkn9YxBvnuCH5J--