From cgull@n.owl.org  Fri Nov  3 02:58:16 2000
Return-Path: <cgull@n.owl.org>
Received: from n.owl.org (unknown [209.6.194.69])
	by hub.freebsd.org (Postfix) with ESMTP
	id E2BEF37B4C5; Fri,  3 Nov 2000 02:58:14 -0800 (PST)
Received: (from cgull@localhost)
	by n.owl.org (8.11.1/8.11.1) id eA3AxcK00563;
	Fri, 3 Nov 2000 05:59:38 -0500 (EST)
	(envelope-from cgull)
Message-Id: <200011031059.eA3AxcK00563@n.owl.org>
Date: Fri, 3 Nov 2000 05:59:38 -0500 (EST)
From: cgull@owl.org
Sender: cgull@n.owl.org
Reply-To: cgull@owl.org
To: FreeBSD-gnats-submit@freebsd.org
Cc: nsouch@freebsd.org, nicolas.souchu@prism.uvsq.fr, dfr@freebsd.org
Subject: ppc panic with drq = 0
X-Send-Pr-Version: 3.2

>Number:         22568
>Category:       i386
>Synopsis:       ppc0 panics on DMA with drq set to 0
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    dfr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 03 03:00:02 PST 2000
>Closed-Date:    Tue Dec 19 13:31:06 PST 2000
>Last-Modified:  Tue Dec 19 13:36:55 PST 2000
>Originator:     john hood
>Release:        FreeBSD 4.1-20001028-STABLE i386
>Organization:
>Environment:

Asus A7V motherboard with super i/o's parallel port configured to port
0x378, irq 7, dma 3.  kernel config derived from GENERIC; ppb and lpt
configuration identical to GENERIC.

>Description:

The ppc driver panics when requested to use DMA, when it is configured
to use DMA channel 0.

>How-To-Repeat:

	boot kernel.GENERIC
	lptcontrol -e
	dd if=/dev/zero of=/dev/lpt0 bs=1024 count=1

	panic: isa_dmastart: bad bounce buffer

	boot kernel.GENERIC -c; drq ppc0 3

	lptcontrol -e
	dd if=/dev/zero of=/dev/lpt0 bs=1024 count=1

	no panic.
>Fix:

Make ppc.c test ppc->ppc_dmachan consistently.  I think drq 0 means
'unconfigured', so I did that.

A quick grovel through cvsweb shows the bug's existed since DMA
support was added.

--- ppc.c	Fri Nov  3 05:06:31 2000
+++ /usr/src/sys/isa/ppc.c	Sat Jul 22 05:09:36 2000
@@ -1657,7 +1657,7 @@
 	 */
 	if ((ppc->ppc_avm & PPB_ECP) && (ppc->ppc_registered)) {
 
-	    if (ppc->ppc_dmachan > 0) {
+	    if (ppc->ppc_dmachan >= 0) {
 
 		/* byte mode, no intr, no DMA, dir=0, flush fifo
 		 */

>Release-Note:
>Audit-Trail:

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: cgull@owl.org
Cc: FreeBSD-gnats-submit@freebsd.org, nsouch@freebsd.org,
	nicolas.souchu@prism.uvsq.fr, dfr@freebsd.org
Subject: Re: i386/22568: ppc panic with drq = 0 
Date: Thu, 09 Nov 2000 20:26:57 +0200

 Your patch is reversed, right?
 
 On Fri, 03 Nov 2000 05:59:38 EST, cgull@owl.org wrote:
 
 > --- ppc.c	Fri Nov  3 05:06:31 2000
 > +++ /usr/src/sys/isa/ppc.c	Sat Jul 22 05:09:36 2000
 > @@ -1657,7 +1657,7 @@
 >  	 */
 >  	if ((ppc->ppc_avm & PPB_ECP) && (ppc->ppc_registered)) {
 >  
 > -	    if (ppc->ppc_dmachan > 0) {
 > +	    if (ppc->ppc_dmachan >= 0) {
 >  
 >  		/* byte mode, no intr, no DMA, dir=0, flush fifo
 >  		 */
 
 Ciao,
 Sheldon.
 
Responsible-Changed-From-To: freebsd-bugs->dfr 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Fri Nov 10 03:23:15 PST 2000 
Responsible-Changed-Why:  
With the right mental gymnastics, one could think of Doug as 
the maintainer. :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22568 
State-Changed-From-To: open->closed 
State-Changed-By: nsouch 
State-Changed-When: Tue Dec 19 13:31:06 PST 2000 
State-Changed-Why:  
Fixed in -current and RELENG_4. Note that the patch proposed was actually 
reversed. 


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