--- //depot/vendor/freebsd/src/sys/dev/amr/amr_pci.c +++ //depot/user/jhb/cleanup/sys/dev/amr/amr_pci.c @@ -477,20 +477,25 @@ bus_dma_tag_destroy(sc->amr_buffer64_dmat); /* free and destroy DMA memory and tag for passthrough pool */ - if (sc->amr_ccb) + if (sc->amr_ccb) { + bus_dmamap_unload(sc->amr_ccb_dmat, sc->amr_ccb_dmamap); bus_dmamem_free(sc->amr_ccb_dmat, sc->amr_ccb, sc->amr_ccb_dmamap); + } if (sc->amr_ccb_dmat) bus_dma_tag_destroy(sc->amr_ccb_dmat); /* free and destroy DMA memory and tag for s/g lists */ - if (sc->amr_sgtable) + if (sc->amr_sgtable) { + bus_dmamap_unload(sc->amr_sg_dmat, sc->amr_sg_dmamap); bus_dmamem_free(sc->amr_sg_dmat, sc->amr_sgtable, sc->amr_sg_dmamap); + } if (sc->amr_sg_dmat) bus_dma_tag_destroy(sc->amr_sg_dmat); /* free and destroy DMA memory and tag for mailbox */ p = (void *)(uintptr_t)(volatile void *)sc->amr_mailbox64; if (sc->amr_mailbox) { + bus_dmamap_unload(sc->amr_mailbox_dmat, sc->amr_mailbox_dmamap); bus_dmamem_free(sc->amr_mailbox_dmat, p, sc->amr_mailbox_dmamap); } if (sc->amr_mailbox_dmat) --- //depot/vendor/freebsd/src/sys/dev/drm/ati_pcigart.c +++ //depot/user/jhb/cleanup/sys/dev/drm/ati_pcigart.c @@ -116,6 +116,7 @@ { struct drm_dma_handle *dmah = gart_info->dmah; + bus_dmamap_unload(dmah->tag, dmah->map); bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); --- //depot/vendor/freebsd/src/sys/dev/drm/drm_pci.c +++ //depot/user/jhb/cleanup/sys/dev/drm/drm_pci.c @@ -119,6 +119,7 @@ if (dmah == NULL) return; + bus_dmamap_unload(dmah->tag, dmah->map); bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); --- //depot/vendor/freebsd/src/sys/dev/drm2/drm_pci.c +++ //depot/user/jhb/cleanup/sys/dev/drm2/drm_pci.c @@ -116,6 +116,7 @@ if (dmah == NULL) return; + bus_dmamap_unload(dmah->tag, dmah->map); bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); --- //depot/vendor/freebsd/src/sys/dev/isp/isp_pci.c +++ //depot/user/jhb/cleanup/sys/dev/isp/isp_pci.c @@ -1741,6 +1741,7 @@ bad: while (--cmap >= 0) { struct isp_fc *fc = ISP_FC_PC(isp, cmap); + bus_dmamap_unload(fc->tdmat, fc->tdmap); bus_dmamem_free(fc->tdmat, base, fc->tdmap); bus_dma_tag_destroy(fc->tdmat); while (fc->nexus_free_list) { @@ -1749,6 +1750,8 @@ free(n, M_DEVBUF); } } + if (isp->isp_rquest_dma != 0) + bus_dmamap_unload(isp->isp_osinfo.cdmat, isp->isp_osinfo.cdmap); bus_dmamem_free(isp->isp_osinfo.cdmat, base, isp->isp_osinfo.cdmap); bus_dma_tag_destroy(isp->isp_osinfo.cdmat); free(isp->isp_xflist, M_DEVBUF); --- //depot/vendor/freebsd/src/sys/dev/mlx/mlx.c +++ //depot/user/jhb/cleanup/sys/dev/mlx/mlx.c @@ -191,6 +191,8 @@ bus_dma_tag_destroy(sc->mlx_buffer_dmat); /* free and destroy DMA memory and tag for s/g lists */ + if (sc->mlx_sgbusaddr) + bus_dmamap_unload(sc->mlx_sg_dmat, sc->mlx_sg_dmamap); if (sc->mlx_sgtable) bus_dmamem_free(sc->mlx_sg_dmat, sc->mlx_sgtable, sc->mlx_sg_dmamap); if (sc->mlx_sg_dmat) @@ -239,10 +241,15 @@ debug_called(1); /* destroy any existing mappings */ + if (sc->mlx_sgbusaddr) + bus_dmamap_unload(sc->mlx_sg_dmat, sc->mlx_sg_dmamap); if (sc->mlx_sgtable) bus_dmamem_free(sc->mlx_sg_dmat, sc->mlx_sgtable, sc->mlx_sg_dmamap); if (sc->mlx_sg_dmat) bus_dma_tag_destroy(sc->mlx_sg_dmat); + sc->mlx_sgbusaddr = 0; + sc->mlx_sgtable = NULL; + sc->mlx_sg_dmat = NULL; /* * Create a single tag describing a region large enough to hold all of