From lee@st-lcremean.tidalwave.net  Sat Nov 28 00:51:16 1998
Received: from st-lcremean.tidalwave.net (host-e186.tidalwave.net [208.213.203.186] (may be forged))
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA20056
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 28 Nov 1998 00:51:14 -0800 (PST)
          (envelope-from lee@st-lcremean.tidalwave.net)
Received: (from root@localhost)
	by st-lcremean.tidalwave.net (8.9.1/8.8.8) id DAA03425;
	Sat, 28 Nov 1998 03:51:04 -0500 (EST)
	(envelope-from lee)
Message-Id: <199811280851.DAA03425@st-lcremean.tidalwave.net>
Date: Sat, 28 Nov 1998 03:51:04 -0500 (EST)
From: Lee Cremeans <lcremean@tidalwave.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Patch to allow DMA IDE with generic chipset + UDMA drives
X-Send-Pr-Version: 3.2

>Number:         8875
>Category:       kern
>Synopsis:       Patch to allow DMA IDE with generic chipset + UDMA drives
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 28 01:00:01 PST 1998
>Closed-Date:    Tue Aug 08 05:18:03 PDT 2000
>Last-Modified:  Wed Nov 12 16:13:03 UTC 2008
>Originator:     
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

	Amptron PM-9600 motherboard (Acer Aladdin IV+ Socket 7 chipset)
	AMD K6-2-266 processor
	Seagate Medalist Pro 9140 hard drive

>Description:

	Adds option NO_GENERIC_UDMA. This option lets people who have 
	had problems getting "generic" chipsets and UDMA hard drives 
	to cooperate to use their drives in multiword DMA 2 mode--a
	slight tradeoff in speed, but enough to tide over until support
	can be written in for the Acer and SiS UDMA chips. 


>How-To-Repeat:

	N/A, this is a patch

>Fix:
	

(The lines for the Id strings can be ignored, they're just there to show which
versions of the files I diffed against.)

--- ide_pci.c.orig	Sat Nov 28 03:09:23 1998
+++ ide_pci.c	Sat Nov 28 03:47:40 1998
@@ -26,7 +26,6 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$Id: ide_pci.c,v 1.14 1998/07/15 02:32:26 bde Exp $
  */
 
 #include "pci.h"
@@ -267,6 +266,19 @@
 		printf("ide_pci: generic_dmainit %04x:%d: warning, IDE controller timing not set\n",
 			cookie->iobase_wd,
 			cookie->unit);
+#ifdef NO_GENERIC_UDMA
+                /* Be pessimistic about the controller's setup, and assume it's
+                   only set for Multiword 2 DMA and not UDMA. Make the drive
+                   aware of this. */
+                int r; 
+
+		r = wdcmd(WDDMA_MDMA2, wdinfo);
+                if (!r) {
+                        printf("generic_dmainit: setting DMA mode failed\n");
+                        return 0;
+
+                }
+#endif /* NO_GENERIC_UDMA */
 		return 1;
 	}
 #ifdef IDE_PCI_DEBUG

--- options.i386.orig	Sat Nov 28 03:43:47 1998
+++ options.i386	Sat Nov 28 03:46:59 1998
@@ -1,4 +1,3 @@
-#	$Id: options.i386,v 1.92 1998/11/15 20:08:49 eivind Exp $
 
 DISABLE_PSE
 IDE_DELAY
@@ -95,6 +94,7 @@
 ATAPI_STATIC		opt_atapi.h
 
 CMD640			opt_wd.h
+NO_GENERIC_UDMA	opt_wd.h
 
 USERCONFIG		opt_userconfig.h
 VISUAL_USERCONFIG	opt_userconfig.h
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: n_hibma 
State-Changed-When: Sat Jul 24 04:21:24 PDT 1999 
State-Changed-Why:  
It looks like an additional feature that is no longer necessary. 
If I remeber correcctly support for Ali and Sis has been added). 

From: Nick Hibma <nick.hibma@jrc.it>
To: freebsd-gnats-submit@freebsd.org, lcremean@tidalwave.net,
	sos@freebsd.org
Cc:  
Subject: Re: kern/8875: Patch to allow DMA IDE with generic chipset + UDMA drives
Date: Sat, 24 Jul 1999 13:19:59 +0200

 Soren,
 
 anything you can comment on this?
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=8875
 
 Cheers,
 
 Nick
 -- 
 ISIS/STA, T.P.270, Joint Research Centre, 21020 Ispra, Italy
 

From: Nick Hibma <nick.hibma@jrc.it>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: kern/8875: Patch to allow DMA IDE with generic chipset + UDMA drives (fwd)
Date: Sat, 24 Jul 1999 20:48:48 +0200 (MET DST)

 ---------- Forwarded message ----------
 Date: Sun, 25 Jul 1999 04:36:49 +1000
 From: Bruce Evans <bde@zeta.org.au>
 To: n_hibma@FreeBSD.ORG
 Subject: Re: kern/8875: Patch to allow DMA IDE with generic chipset + UDMA drives
 
 >Synopsis: Patch to allow DMA IDE with generic chipset + UDMA drives
 >
 >State-Changed-From-To: open->analyzed
 >State-Changed-By: n_hibma
 >State-Changed-When: Sat Jul 24 04:21:24 PDT 1999
 >State-Changed-Why: 
 >It looks like an additional feature that is no longer necessary.
 >If I remeber correcctly support for Ali and Sis has been added).
 
 An unifdefed version of it was committed in rev.1.23, but should
 not have been.  It was a quick fix for the author's Ali motherboard
 or BIOS but it is obviously wrong in general since it bogotifies the
 comment preceding it (the point of the "generic" support is to assume
 that everything is already set up correctly; any hardware programming
 risks disturbing the setup).  It broke generic support on at least one
 of grog's systems (SiS IIRC).  rev.1.23 also added Ali support, so the
 patch in the PR was certainly unnecessary for Ali.  The SiS breakage
 was fixed a little later by adding proper SiS support.
 
 The ata driver does the same things as the patch.  It's not clear that it
 helps there.  It may harm by reprogramming the drive from UDMA2 to WDMA2.
 I think something like this happens on one of my systems, but it doesn't
 harm throughput or overhead.  I only have PIIX1, VIA2 and PIIX4 to test.
 
 Bruce
 
 
 
 
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Aug 8 05:06:28 PDT 2000 
Responsible-Changed-Why:  
Soren can decide whether this is still an issue. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=8875 
State-Changed-From-To: analyzed->closed 
State-Changed-By: sos 
State-Changed-When: Tue Aug 8 05:18:03 PDT 2000 
State-Changed-Why:  
This no longer applies the ata driver does this differently. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=8875 
>Unformatted:
