From owner-svn-src-all@FreeBSD.ORG Fri Jun 13 18:20:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 989F55DF; Fri, 13 Jun 2014 18:20:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78F3C2809; Fri, 13 Jun 2014 18:20:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5DIKkoh046107; Fri, 13 Jun 2014 18:20:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DIKjEk046100; Fri, 13 Jun 2014 18:20:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406131820.s5DIKjEk046100@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jun 2014 18:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267446 - in head/sys/dev: amr drm drm2 isp mlx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 18:20:46 -0000 Author: jhb Date: Fri Jun 13 18:20:44 2014 New Revision: 267446 URL: http://svnweb.freebsd.org/changeset/base/267446 Log: Add missing calls to bus_dmamap_unload() when freeing static DMA allocations. Reviewed by: scottl Modified: head/sys/dev/amr/amr_pci.c head/sys/dev/drm/ati_pcigart.c head/sys/dev/drm/drm_pci.c head/sys/dev/drm2/drm_pci.c head/sys/dev/isp/isp_pci.c head/sys/dev/mlx/mlx.c Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/amr/amr_pci.c Fri Jun 13 18:20:44 2014 (r267446) @@ -477,20 +477,25 @@ amr_pci_free(struct amr_softc *sc) 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) Modified: head/sys/dev/drm/ati_pcigart.c ============================================================================== --- head/sys/dev/drm/ati_pcigart.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/drm/ati_pcigart.c Fri Jun 13 18:20:44 2014 (r267446) @@ -116,6 +116,7 @@ drm_ati_free_pcigart_table(struct drm_de { 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); Modified: head/sys/dev/drm/drm_pci.c ============================================================================== --- head/sys/dev/drm/drm_pci.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/drm/drm_pci.c Fri Jun 13 18:20:44 2014 (r267446) @@ -119,6 +119,7 @@ drm_pci_free(struct drm_device *dev, drm 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); Modified: head/sys/dev/drm2/drm_pci.c ============================================================================== --- head/sys/dev/drm2/drm_pci.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/drm2/drm_pci.c Fri Jun 13 18:20:44 2014 (r267446) @@ -116,6 +116,7 @@ drm_pci_free(struct drm_device *dev, drm 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); Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/isp/isp_pci.c Fri Jun 13 18:20:44 2014 (r267446) @@ -1741,6 +1741,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) 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 @@ bad: 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); Modified: head/sys/dev/mlx/mlx.c ============================================================================== --- head/sys/dev/mlx/mlx.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/mlx/mlx.c Fri Jun 13 18:20:44 2014 (r267446) @@ -191,6 +191,8 @@ mlx_free(struct mlx_softc *sc) 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 @@ mlx_sglist_map(struct mlx_softc *sc) 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