From: Robert Noland Date: Mon, 9 Jun 2008 12:54:53 +0000 (-0400) Subject: [FreeBSD] We aren't allowed to hold locks over bus_dma_tag_create or bus_dmamem_alloc. X-Git-Tag: submit/1.0/20121108.012404~790 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96580f660e5509dcf6c34de5630e3d36b156bcd5;p=profile%2Fivi%2Flibdrm.git [FreeBSD] We aren't allowed to hold locks over bus_dma_tag_create or bus_dmamem_alloc. --- diff --git a/bsd-core/drm_pci.c b/bsd-core/drm_pci.c index 6b411ab..f23b2a5 100644 --- a/bsd-core/drm_pci.c +++ b/bsd-core/drm_pci.c @@ -71,6 +71,7 @@ drm_pci_alloc(struct drm_device *dev, size_t size, return NULL; #ifdef __FreeBSD__ + DRM_UNLOCK(); ret = bus_dma_tag_create(NULL, align, 0, /* tag, align, boundary */ maxaddr, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ NULL, NULL, /* filtfunc, filtfuncargs */ @@ -79,6 +80,7 @@ drm_pci_alloc(struct drm_device *dev, size_t size, &dmah->tag); if (ret != 0) { free(dmah, M_DRM); + DRM_LOCK(); return NULL; } @@ -87,9 +89,10 @@ drm_pci_alloc(struct drm_device *dev, size_t size, if (ret != 0) { bus_dma_tag_destroy(dmah->tag); free(dmah, M_DRM); + DRM_LOCK(); return NULL; } - + DRM_LOCK(); ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, size, drm_pci_busdma_callback, dmah, 0); if (ret != 0) {