Bug 22568

Summary: ppc0 panics on DMA with drq set to 0
Product: Base System Reporter: cgull <cgull>
Component: i386Assignee: dfr
Status: Closed FIXED    
Severity: Affects Only Me CC: nsouch
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description cgull 2000-11-03 11:00:02 UTC
The ppc driver panics when requested to use DMA, when it is configured
to use DMA channel 0.

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.
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.
Comment 1 Sheldon Hearn 2000-11-09 18:26:57 UTC
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.
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-11-10 11:23:15 UTC
Responsible Changed
From-To: freebsd-bugs->dfr

With the right mental gymnastics, one could think of Doug as 
the maintainer. :-)
Comment 3 Nicolas Souchu freebsd_committer freebsd_triage 2000-12-19 21:31:06 UTC
State Changed
From-To: open->closed

Fixed in -current and RELENG_4. Note that the patch proposed was actually 
reversed.