summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2011-03-11 22:19:49 +0000
committermarius <marius@FreeBSD.org>2011-03-11 22:19:49 +0000
commit956d767e8b05873e93061ed2e070c41f21c134ca (patch)
tree44ba10786feb58187e888aae58566a72e21fe0a4
parent83676a4b3da14e744d0c31b03e0d273a19f97785 (diff)
downloadFreeBSD-src-956d767e8b05873e93061ed2e070c41f21c134ca.zip
FreeBSD-src-956d767e8b05873e93061ed2e070c41f21c134ca.tar.gz
Allocate the DMA memory shared between the host and the controller as
coherent. MFC after: 2 weeks
-rw-r--r--sys/dev/firewire/fwohci.c4
-rw-r--r--sys/dev/firewire/sbp.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c
index 07a1a42..cccbc8c 100644
--- a/sys/dev/firewire/fwohci.c
+++ b/sys/dev/firewire/fwohci.c
@@ -686,7 +686,7 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
sc->fc.dev = dev;
sc->fc.config_rom = fwdma_malloc(&sc->fc, CROMSIZE, CROMSIZE,
- &sc->crom_dma, BUS_DMA_WAITOK);
+ &sc->crom_dma, BUS_DMA_WAITOK | BUS_DMA_COHERENT);
if(sc->fc.config_rom == NULL){
device_printf(dev, "config_rom alloc failed.");
return ENOMEM;
@@ -708,7 +708,7 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
/* SID recieve buffer must align 2^11 */
#define OHCI_SIDSIZE (1 << 11)
sc->sid_buf = fwdma_malloc(&sc->fc, OHCI_SIDSIZE, OHCI_SIDSIZE,
- &sc->sid_dma, BUS_DMA_WAITOK);
+ &sc->sid_dma, BUS_DMA_WAITOK | BUS_DMA_COHERENT);
if (sc->sid_buf == NULL) {
device_printf(dev, "sid_buf alloc failed.");
return ENOMEM;
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c
index 229ee6d..0ac7d14 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -562,7 +562,8 @@ END_DEBUG
fwdma_malloc(sbp->fd.fc,
/* alignment */ sizeof(uint32_t),
- SBP_DMA_SIZE, &sdev->dma, BUS_DMA_NOWAIT);
+ SBP_DMA_SIZE, &sdev->dma, BUS_DMA_NOWAIT |
+ BUS_DMA_COHERENT);
if (sdev->dma.v_addr == NULL) {
printf("%s: dma space allocation failed\n",
__func__);
OpenPOWER on IntegriCloud