From a11f5b76d76842a87ad95ece38e2a906fe711a48 Mon Sep 17 00:00:00 2001 From: loos Date: Fri, 9 Jan 2015 02:47:57 +0000 Subject: [PATCH] MFC r273599: 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. git-svn-id: svn://svn.freebsd.org/base/stable/10@276874 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/arm/arm/busdma_machdep-v6.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm/arm/busdma_machdep-v6.c b/sys/arm/arm/busdma_machdep-v6.c index 9a2a74238..39014a433 100644 --- a/sys/arm/arm/busdma_machdep-v6.c +++ b/sys/arm/arm/busdma_machdep-v6.c @@ -697,6 +697,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); } -- 2.45.0