summaryrefslogtreecommitdiff
path: root/sys/dev/sdmmc
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sdmmc')
-rw-r--r--sys/dev/sdmmc/sdmmc.c5
-rw-r--r--sys/dev/sdmmc/sdmmcchip.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/sdmmc/sdmmc.c b/sys/dev/sdmmc/sdmmc.c
index 81c5a101454..863f4ee69f4 100644
--- a/sys/dev/sdmmc/sdmmc.c
+++ b/sys/dev/sdmmc/sdmmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmc.c,v 1.47 2017/04/06 07:07:28 jsg Exp $ */
+/* $OpenBSD: sdmmc.c,v 1.48 2017/12/24 12:55:52 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -115,11 +115,12 @@ sdmmc_attach(struct device *parent, struct device *self, void *aux)
sc->sct = saa->sct;
sc->sch = saa->sch;
sc->sc_dmat = saa->dmat;
+ sc->sc_dmap = saa->dmap;
sc->sc_flags = saa->flags;
sc->sc_caps = saa->caps;
sc->sc_max_xfer = saa->max_xfer;
- if (ISSET(sc->sc_caps, SMC_CAPS_DMA)) {
+ if (ISSET(sc->sc_caps, SMC_CAPS_DMA) && sc->sc_dmap == NULL) {
error = bus_dmamap_create(sc->sc_dmat, MAXPHYS, SDMMC_MAXNSEGS,
MAXPHYS, 0, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, &sc->sc_dmap);
if (error) {
diff --git a/sys/dev/sdmmc/sdmmcchip.h b/sys/dev/sdmmc/sdmmcchip.h
index f2acb6a6925..464521602f7 100644
--- a/sys/dev/sdmmc/sdmmcchip.h
+++ b/sys/dev/sdmmc/sdmmcchip.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmcchip.h,v 1.9 2016/05/05 20:40:48 kettenis Exp $ */
+/* $OpenBSD: sdmmcchip.h,v 1.10 2017/12/24 12:55:52 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -97,6 +97,7 @@ struct sdmmcbus_attach_args {
sdmmc_chipset_tag_t sct;
sdmmc_chipset_handle_t sch;
bus_dma_tag_t dmat;
+ bus_dmamap_t dmap;
int flags;
int caps;
long max_xfer;