svn commit: r219543 - head/sys/dev/firewire
Marius Strobl
marius at FreeBSD.org
Fri Mar 11 22:19:49 UTC 2011
Author: marius
Date: Fri Mar 11 22:19:49 2011
New Revision: 219543
URL: http://svn.freebsd.org/changeset/base/219543
Log:
Allocate the DMA memory shared between the host and the controller as
coherent.
MFC after: 2 weeks
Modified:
head/sys/dev/firewire/fwohci.c
head/sys/dev/firewire/sbp.c
Modified: head/sys/dev/firewire/fwohci.c
==============================================================================
--- head/sys/dev/firewire/fwohci.c Fri Mar 11 22:16:05 2011 (r219542)
+++ head/sys/dev/firewire/fwohci.c Fri Mar 11 22:19:49 2011 (r219543)
@@ -686,7 +686,7 @@ fwohci_init(struct fwohci_softc *sc, 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, 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;
Modified: head/sys/dev/firewire/sbp.c
==============================================================================
--- head/sys/dev/firewire/sbp.c Fri Mar 11 22:16:05 2011 (r219542)
+++ head/sys/dev/firewire/sbp.c Fri Mar 11 22:19:49 2011 (r219543)
@@ -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__);
More information about the svn-src-all
mailing list