Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Use coherent DMA mappings when possible.



details:   https://anonhg.NetBSD.org/src/rev/a70a2442ea25
branches:  trunk
changeset: 1023658:a70a2442ea25
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Sep 20 11:27:30 2021 +0000

description:
Use coherent DMA mappings when possible.

diffstat:

 sys/dev/pci/if_msk.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r dd85b3d702af -r a70a2442ea25 sys/dev/pci/if_msk.c
--- a/sys/dev/pci/if_msk.c      Mon Sep 20 11:12:35 2021 +0000
+++ b/sys/dev/pci/if_msk.c      Mon Sep 20 11:27:30 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.117 2021/08/07 16:19:14 thorpej Exp $ */
+/* $NetBSD: if_msk.c,v 1.118 2021/09/20 11:27:30 jmcneill Exp $ */
 /*     $OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $     */
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.117 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.118 2021/09/20 11:27:30 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -661,7 +661,7 @@
        state = 1;
        if (bus_dmamem_map(sc->sc_dmatag, &sc_if->sk_cdata.sk_jumbo_seg,
            sc_if->sk_cdata.sk_jumbo_nseg, MSK_JMEM, (void **)&kva,
-           BUS_DMA_NOWAIT)) {
+           BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) {
                aprint_error(": can't map dma buffers (%d bytes)", MSK_JMEM);
                error = ENOBUFS;
                goto out;
@@ -1240,7 +1240,8 @@
        }
        if (bus_dmamem_map(sc->sc_dmatag, &sc_if->sk_ring_seg,
            sc_if->sk_ring_nseg,
-           sizeof(struct msk_ring_data), &kva, BUS_DMA_NOWAIT)) {
+           sizeof(struct msk_ring_data), &kva,
+           BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) {
                aprint_error(": can't map dma buffers (%zu bytes)\n",
                       sizeof(struct msk_ring_data));
                goto fail_1;
@@ -1561,7 +1562,7 @@
        if (bus_dmamem_map(sc->sc_dmatag,
            &sc->sk_status_seg, sc->sk_status_nseg,
            MSK_STATUS_RING_CNT * sizeof(struct msk_status_desc),
-           &kva, BUS_DMA_NOWAIT)) {
+           &kva, BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) {
                aprint_error(": can't map dma buffers (%zu bytes)\n",
                    MSK_STATUS_RING_CNT * sizeof(struct msk_status_desc));
                goto fail_3;



Home | Main Index | Thread Index | Old Index