From owner-svn-src-all@freebsd.org Fri May 13 15:15:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91EE4B393F6; Fri, 13 May 2016 15:15:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5EDDF1764; Fri, 13 May 2016 15:15:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DFFs08090383; Fri, 13 May 2016 15:15:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DFFsst090382; Fri, 13 May 2016 15:15:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605131515.u4DFFsst090382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 13 May 2016 15:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299679 - head/sys/dev/mmc/host 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.22 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 May 2016 15:15:55 -0000 Author: andrew Date: Fri May 13 15:15:54 2016 New Revision: 299679 URL: https://svnweb.freebsd.org/changeset/base/299679 Log: Add DMA sync operations around accessing the dwmmc descriptor ring. Even with it maps as cache-coherent we still need to call bus_dmamap_sync. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Fri May 13 15:11:17 2016 (r299678) +++ head/sys/dev/mmc/host/dwmmc.c Fri May 13 15:15:54 2016 (r299679) @@ -722,6 +722,9 @@ dma_done(struct dwmmc_softc *sc, struct bus_dmamap_sync(sc->buf_tag, sc->buf_map, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(sc->desc_tag, sc->desc_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->buf_tag, sc->buf_map); return (0); @@ -766,6 +769,10 @@ dma_prepare(struct dwmmc_softc *sc, stru if (err != 0) panic("dmamap_load failed\n"); + /* Ensure the device can see the desc */ + bus_dmamap_sync(sc->desc_tag, sc->desc_map, + BUS_DMASYNC_PREWRITE); + if (data->flags & MMC_DATA_WRITE) bus_dmamap_sync(sc->buf_tag, sc->buf_map, BUS_DMASYNC_PREWRITE);