Subject: port-i386/10308: ym at pnpbios fails to attach on a Panasonic Toughbook CF-71
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jasper@pointless.net>
List: netbsd-bugs
Date: 06/07/2000 07:41:13
>Number:         10308
>Category:       port-i386
>Synopsis:       the kernel [panics trying to attach the ym device.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 07 07:42:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Jasper Wallace
>Release:        i386-snap-20000527
>Organization:
>Environment:
>Description:
 >System: NetBSD jellycat 1.4Z NetBSD 1.4Z (JELLYCAT.pnpbios) #0: Mon Jun 5 16:26:50 BST 2000 jasper@jellycat:/usr/src/sys/arch/i386/compile/JELLYCAT.pnpbios i386
 
 
 Description:
 	booting a kernel with ym* at pnpbios0 enabled panics the machine:
 
 ym0 at pnpbios0 index 20 (YMH0021)
 ym0: io 220-22f 530-537 388-38f 300-301 100-101, irq 5, dma 0
 ym0: OPL3-SA3
 audio0 at ym0: full duplex, mmap
 pnpbios0: bogus drq -1
 panic: _isa_dmamem_alloc
 
 The ym driver is trying to get a second dma descriptor for recording
 (sc->ym_recdrq), either:
 
 1) the bios in this laptop is buggy, and dosn't report the dma's properly
 2) some ym's only need one dma, the the ym driver is trying to get 2
 3) the pnpbios probing code isn't putting together the right data from the
    bios
 
 Here's the copmplete PNPBIOS_DEBUG output:
 
 pnpbios0: getting info for index 20
 YMH0021 (static): type 0x04 subtype 0x01 dpi 0x00 attr 0x0083:
 YMH0021: allocated config scan:
 	tag io flags 01 min 0220 max 0220 align 0x20 len 0x10
 	tag io flags 01 min 0530 max 0530 align 0x10 len 0x08
 	tag io flags 01 min 0388 max 0388 align 0x10 len 0x08
 	tag io flags 01 min 0300 max 0300 align 0x10 len 0x02
 	tag io flags 01 min 0100 max 0100 align 0x20 len 0x02
 	tag irq flags 01 mask 0020
 	tag irq zeroed
 	tag dma flags 00 mask 01		<---*only one dma*
 	tag dma zeroed
 	tag end cksum 00
 	possible config scan:
 
 	tag startdep flags 01
 	tag io flags 01 min 0220 max 0280 align 0x20 len 0x10
 	tag io flags 01 min 0530 max 0560 align 0x10 len 0x08
 	tag io flags 01 min 0388 max 03b8 align 0x10 len 0x08
 	tag io flags 01 min 0300 max 0330 align 0x10 len 0x02
 	tag io flags 01 min 0100 max 0160 align 0x20 len 0x02
 	tag irq flags 01 mask 06a0
 	tag irq zeroed
 	tag dma flags 00 mask 83		<---*only one dma*
 	tag dma zeroed
 
 	tag startdep flags 01
 	tag io flags 01 min 0220 max 0280 align 0x20 len 0x10
 	tag io flags 01 min 0530 max 0560 align 0x10 len 0x08
 	tag io flags 01 min 0388 max 03b8 align 0x10 len 0x08
 	tag io flags 01 min 0300 max 0330 align 0x10 len 0x02
 	tag io flags 01 min 0100 max 0160 align 0x20 len 0x02
 	tag irq flags 01 mask 06a0
 	tag irq flags 01 mask 06a0
 	tag dma flags 00 mask 83		<---*only one dma*
 	tag dma zeroed
 
 	tag startdep flags 01
 	tag io flags 01 min 0220 max 0280 align 0x20 len 0x10
 	tag io flags 01 min 0530 max 0560 align 0x10 len 0x08
 	tag io flags 01 min 0388 max 03b8 align 0x10 len 0x08
 	tag io flags 01 min 0300 max 0330 align 0x10 len 0x02
 	tag io flags 01 min 0100 max 0160 align 0x20 len 0x02
 	tag irq flags 01 mask 06a0
 	tag irq zeroed
 	tag dma flags 00 mask 83		<---two dma's
 	tag dma flags 00 mask 83		<---here!
 
 	tag startdep flags 01
 	tag io flags 01 min 0220 max 0280 align 0x20 len 0x10
 	tag io flags 01 min 0530 max 0560 align 0x10 len 0x08
 	tag io flags 01 min 0388 max 03b8 align 0x10 len 0x08
 	tag io flags 01 min 0300 max 0330 align 0x10 len 0x02
 	tag io flags 01 min 0100 max 0160 align 0x20 len 0x02
 	tag irq flags 01 mask 06a0
 	tag irq flags 01 mask 06a0
 	tag dma flags 00 mask 83		<---two dma's
 	tag dma flags 00 mask 83		<---here too!
 	tag enddep
 	tag end cksum 00
 	compat id scan:
 	tag end cksum 00
 YMH0021 (dynamic): type 0x04 subtype 0x01 dpi 0x00 attr 0x0083:
 YMH0021: allocated config scan:
 	tag io flags 01 min 0220 max 0220 align 0x20 len 0x10
 	tag io flags 01 min 0530 max 0530 align 0x10 len 0x08
 	tag io flags 01 min 0388 max 0388 align 0x10 len 0x08
 	tag io flags 01 min 0300 max 0300 align 0x10 len 0x02
 	tag io flags 01 min 0100 max 0100 align 0x20 len 0x02
 	tag irq flags 01 mask 0020
 	tag irq zeroed
 	tag dma flags 00 mask 01
 	tag dma zeroed
 	tag end cksum 00
 	possible config scan:
 
 	tag startdep flags 01
 	tag io flags 01 min 0220 max 0280 align 0x20 len 0x10
 	tag io flags 01 min 0530 max 0560 align 0x10 len 0x08
 	tag io flags 01 min 0388 max 03b8 align 0x10 len 0x08
 	tag io flags 01 min 0300 max 0330 align 0x10 len 0x02
 	tag io flags 01 min 0100 max 0160 align 0x20 len 0x02
 	tag irq flags 01 mask 06a0
 	tag irq zeroed
 	tag dma flags 00 mask 83
 	tag dma zeroed
 
 	tag startdep flags 01
 	tag io flags 01 min 0220 max 0280 align 0x20 len 0x10
 	tag io flags 01 min 0530 max 0560 align 0x10 len 0x08
 	tag io flags 01 min 0388 max 03b8 align 0x10 len 0x08
 	tag io flags 01 min 0300 max 0330 align 0x10 len 0x02
 	tag io flags 01 min 0100 max 0160 align 0x20 len 0x02
 	tag irq flags 01 mask 06a0
 	tag irq flags 01 mask 06a0
 	tag dma flags 00 mask 83
 	tag dma zeroed
 
 	tag startdep flags 01
 	tag io flags 01 min 0220 max 0280 align 0x20 len 0x10
 	tag io flags 01 min 0530 max 0560 align 0x10 len 0x08
 	tag io flags 01 min 0388 max 03b8 align 0x10 len 0x08
 	tag io flags 01 min 0300 max 0330 align 0x10 len 0x02
 	tag io flags 01 min 0100 max 0160 align 0x20 len 0x02
 	tag irq flags 01 mask 06a0
 	tag irq zeroed
 	tag dma flags 00 mask 83		<---two dma's
 	tag dma flags 00 mask 83		<---two dma's
 
 	tag startdep flags 01
 	tag io flags 01 min 0220 max 0280 align 0x20 len 0x10
 	tag io flags 01 min 0530 max 0560 align 0x10 len 0x08
 	tag io flags 01 min 0388 max 03b8 align 0x10 len 0x08
 	tag io flags 01 min 0300 max 0330 align 0x10 len 0x02
 	tag io flags 01 min 0100 max 0160 align 0x20 len 0x02
 	tag irq flags 01 mask 06a0
 	tag irq flags 01 mask 06a0
 	tag dma flags 00 mask 83		<---two dma's
 	tag dma flags 00 mask 83		<---two dma's
 	tag enddep
 	tag end cksum 00
 	compat id scan:
 	tag end cksum 00
 ym0 at pnpbios0 index 20 (YMH0021)
 ym0: io 220-22f 530-537 388-38f 300-301 100-101, irq 5, dma 0
 ym0: OPL3-SA3
 audio0 at ym0: full duplex, mmap
 pnpbios0: bogus drq -1
 panic: _isa_dmamem_alloc
 
 I think 3), with a little bit of 1) is the problem, but i don't know much
 about pnpbioses!
 
 How-To-Repeat:
 	
 	Boot a netbsd-current kernel with pnpbios and ym support on a
 	Panasonic Toughbook CF-71
 
 Fix:
 	
 	Workaround: Hardcodeing the dma values works fine (tho i havn't
 tried recording yet!). A real fix woudkl involve reworking the
 pnpbios_attach() function (?).
 
 (There's another related problem which is that ym only attaches after a cold
 boot, but i'm less woried about that one).
 
 --- ym_pnpbios.c.orig	Sat Apr 22 11:51:50 2000
 +++ ym_pnpbios.c	Fri Jun  2 14:43:58 2000
 @@ -128,7 +128,12 @@
  		return;
  	}
  	if (pnpbios_getdmachan(aa->pbt, aa->resc, 1, &sc->ym_recdrq))
 +	{
  		sc->ym_recdrq = -1;
 +		printf("\nsc->ym_recdrq was set to -1, setting it to 0");
 +		printf("\nsc->ym_playdrq == %d", sc->ym_playdrq);
 +		sc->ym_recdrq = 0;
 +	}
  
  	printf("\n");
  	pnpbios_print_devres(self, aa);
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: