Subject: kern/10734: ex0 reports "can't allocate download descriptors"
To: None <gnats-bugs@gnats.netbsd.org>
From: John Hawkinson <jhawk@mit.edu>
List: netbsd-bugs
Date: 08/01/2000 12:57:14
>Number:         10734
>Category:       kern
>Synopsis:       ex0 reports "can't allocate download descriptors"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 01 12:58:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     John Hawkinson
>Release:        -current of 14 July 2000
>Organization:
MIT
>Environment:
	
System: NetBSD zorkmid.mit.edu 1.5B NetBSD 1.5B (ZORKMID-$Revision: 1.16 $) #28: Sun Jul 30 16:54:45 EDT 2000 jhawk@zorkmid.mit.edu:/usr/local/netbsd-current/src/sys/arch/i386/compile/ZORKMID i386


>Description:
	bus_dmamem_alloc() can fail for the ex driver under some circumstances.
It appears to be in this code in elinkxl.c:

 273          /*
 274           * Allocate the download descriptors, and create and load the DMA
 275           * map for them.
 276           */
 277          if ((error = bus_dmamem_alloc(sc->sc_dmat,
 278              EX_NDPD * sizeof (struct ex_dpd), NBPG, 0, &sc->sc_dseg, 1, 
 279              &sc->sc_drseg, BUS_DMA_NOWAIT)) != 0) {
 280                  printf("%s: can't allocate download descriptors, error =
 280   %d\n",
 281                      sc->sc_dev.dv_xname, error);
 282                  goto fail;
 283          }

I'm not sure what causes this failure.

>How-To-Repeat:

	Hotswap in a ex0 card into a Sony VAIO:

ex0 at cardbus0 dev 0 function 0: 3Com 3c575B-TX Ethernet
ex0: interrupting at 9
ex0: MAC address 00:10:4b:f7:28:5b
ex0: can't allocate download descriptors, error = 12

>Fix:
	I don't know. Ideally the pcmcia(4) or cardbus(4) manpages should
describe this and explain what precisely it means and how to debug it.
>Release-Note:
>Audit-Trail:
>Unformatted: