From mbendiks@eunet.no  Sun Sep 10 12:43:11 2000
Return-Path: <mbendiks@eunet.no>
Received: from mail-relay.eunet.no (mail-relay.eunet.no [193.71.71.242])
	by hub.freebsd.org (Postfix) with ESMTP id EAEEB37B424
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 10 Sep 2000 12:43:09 -0700 (PDT)
Received: from login-1.eunet.no (login-1.eunet.no [193.75.110.2])
	by mail-relay.eunet.no (8.9.3/8.9.3/GN) with ESMTP id VAA99297
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 10 Sep 2000 21:43:04 +0200 (CEST)
	(envelope-from mbendiks@eunet.no)
Received: (from mbendiks@localhost)
	by login-1.eunet.no (8.9.3/8.8.8) id VAA71964;
	Sun, 10 Sep 2000 21:43:04 +0200 (CEST)
	(envelope-from mbendiks@eunet.no)
Message-Id: <200009101943.VAA71964@login-1.eunet.no>
Date: Sun, 10 Sep 2000 21:43:04 +0200 (CEST)
From: mbendiks@eunet.no
Reply-To: mbendiks@eunet.no
To: FreeBSD-gnats-submit@freebsd.org
Subject: ISA DMA incorrectly handled
X-Send-Pr-Version: 3.2

>Number:         21175
>Category:       kern
>Synopsis:       ISA DMA channels 4-7 operate on wrong memory area
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    cg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 10 12:50:00 PDT 2000
>Closed-Date:    Mon Mar 26 22:14:07 PST 2001
>Last-Modified:  Mon Mar 26 22:15:37 PST 2001
>Originator:     Marius Bendiksen
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
n/a
>Environment:

	Any system from 3.x and beyond.

>Description:

	The ISA DMA handling code in /sys/i386/isa/isa_dma.c appears
	incorrect, according to my PC hardware guide. For the high
	channels, the page of the bounce buffer is incorrectly shifted
	by 16 bits, when it should be shifted by 17. This could possibly
	cause unexplained memory corruption under certain conditions.
	As a side note, genuine Intel chips do not need bounce buffers,
	and have not since i386, as there exists a second page register.

>How-To-Repeat:

	No problem here yet.

>Fix:
	
	The following patch will correct the problem:

--- isa_dma.c.orig	Sun Sep 10 21:44:53 2000
+++ isa_dma.c	Sun Sep 10 21:45:12 2000
@@ -317,9 +317,9 @@
 		/* send start address */
 		waport = DMA2_CHN(chan - 4);
 		outb(waport, phys>>1);
 		outb(waport, phys>>9);
-		outb(dmapageport[chan], phys>>16);
+		outb(dmapageport[chan], phys>>17);
 
 		/* send count */
 		nbytes >>= 1;
 		outb(waport + 2, --nbytes);


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->peter 
Responsible-Changed-By: johan 
Responsible-Changed-When: Fri Oct 6 12:27:25 PDT 2000 
Responsible-Changed-Why:  
Peter, you have been the main committer to this file, 
can you please have a look at this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21175 
Responsible-Changed-From-To: peter->cg 
Responsible-Changed-By: peter 
Responsible-Changed-When: Sat Mar 24 23:32:00 PST 2001 
Responsible-Changed-Why:  
Cameron, can you please check this out with an ISA DMA sound card that uses 
channels 4 through 7? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21175 
State-Changed-From-To: open->closed 
State-Changed-By: cg 
State-Changed-When: Mon Mar 26 22:14:07 PST 2001 
State-Changed-Why:  
submitter's understanding of isa dma is incorrect 

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