Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jan 1999 14:17:30 +0100 (CET)
From:      Søren Schmidt <sos@freebsd.dk>
To:        phk@FreeBSD.ORG (Poul-Henning Kamp)
Cc:        current@FreeBSD.ORG
Subject:   Re: wd0: DMA failure, DMA status 0
Message-ID:  <199901261317.OAA31728@freebsd.dk>
In-Reply-To: <26057.917356301@critter.freebsd.dk> from Poul-Henning Kamp at "Jan 26, 1999  2:11:41 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
It seems Poul-Henning Kamp wrote:
> 
> 
> Is "wd0: DMA failure, DMA status 0" something which needs looked at ?

Blame Julian, he broke it in v 1.183 of wd.c, the following patch
works on all my HW, but I dont have the "cyrix" chipset Julian
made the patch for, to test it on (it also contains other small
corrections mostly from Bruce)...


Index: wd.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/isa/wd.c,v
retrieving revision 1.186
diff -u -r1.186 wd.c
--- wd.c	1999/01/17 05:46:24	1.186
+++ wd.c	1999/01/19 18:29:23
@@ -1084,10 +1086,11 @@
 	du = wddrives[dkunit(bp->b_dev)];
 
 	/* finish off DMA */
-	if (du->dk_flags & (DKFL_DMA|DKFL_USEDMA)) {
+	if ((du->dk_flags & (DKFL_DMA|DKFL_SINGLE)) == DKFL_DMA) {
 		/* XXX SMP boxes sometimes generate an early intr.  Why? */
-		if ((wddma[du->dk_interface].wdd_dmastatus(du->dk_dmacookie) & WDDS_INTERRUPT)
-		    != 0)
+		if ((wddma[du->dk_interface].wdd_dmastatus(du->dk_dmacookie) & 
+		    WDDS_INTERRUPT) == 0)
+			return;
 		dmastat = wddma[du->dk_interface].wdd_dmadone(du->dk_dmacookie);
 	}
 
@@ -1568,6 +1571,7 @@
 	if (wdwait(du, 0, TIMEOUT) < 0)
 		return (1);
 	if( command == WDCC_FEATURES) {
+		outb(wdc + wd_sdh, WDSD_IBM | (du->dk_unit << 4) | head);
 		outb(wdc + wd_features, count);
 		if ( count == WDFEA_SETXFER )
 			outb(wdc + wd_seccnt, sector);
@@ -2289,9 +2293,8 @@
 {
 	int     err = 0;
 
-	if ((du->dk_flags & (DKFL_DMA|DKFL_USEDMA)) && du->dk_dmacookie)
+	if ((du->dk_flags & (DKFL_DMA|DKFL_SINGLE)) == DKFL_DMA)
 		wddma[du->dk_interface].wdd_dmadone(du->dk_dmacookie);
-
 	(void)wdwait(du, 0, TIMEOUT);
 	outb(du->dk_altport, WDCTL_IDS | WDCTL_RST);
 	DELAY(10 * 1000);


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901261317.OAA31728>