On 04/04/2011, at 5:31 AM, Mark Kettenis wrote:

>> Date: Sun, 3 Apr 2011 13:46:40 +0200
>> From: Claudio Jeker <[email protected]>
>> 
>> bce(4) was turned off because of limitations in the DMA engine that allows
>> the chip to access only 1G of memory. On systems with more then 1G of
>> memory hilarity ensued.
>> 
>> Now I rewrote the driver to use bcopy() to copy the mbufs into a savely
>> allocated DMA memory buffer. So the chip will now work with any ammount of
>> memory in the machine. It works for me so if you own a bce(4) please test.
> 
>> +    /* Create the data DMA region and maps. */
>> +    if ((sc->bce_data = (caddr_t)uvm_km_kmemalloc_pla(kernel_map,
>> +        uvm.kernel_object, (BCE_NTXDESC + BCE_NRXDESC) * MCLBYTES, 0,
>> +        UVM_KMF_NOWAIT, 0, (paddr_t)(0x40000000 - 1), 0, 0, 1)) == NULL) {
>> +            printf(": unable to alloc space for ring");
>> +            return;
> 
> Sorry, but I think drivers should not call uvm memory allocations
> directly.  Instead we should promote _bus_dmamem_alloc_range() found
> on i386 and amd64 to a first class citizen.

i would like to see this in bus_dma too.

dlg

Reply via email to