Fix a bug where DMA maps created with bus_dmamap_create() won't increment

the map count and without being able to keep track of the current map
allocation, bus_dma_tag_destroy() will fail to proceed and will return
EBUSY even after all the maps have been correctly destroyed with
bus_dmamap_destroy().

Found while testing the detach method of a NIC.

Tested on:	BBB (am335x)
Reviewed by:	cognet, ian
MFC after:	1 week
This commit is contained in:
loos 2014-10-24 19:18:39 +00:00
parent 65e80d25ca
commit 6ab33f375c

View File

@ -719,6 +719,8 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)
if (map->flags & DMAMAP_COHERENT)
atomic_add_32(&maps_coherent, 1);
atomic_add_32(&maps_total, 1);
dmat->map_count++;
return (0);
}