Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm32 Assert we aren't trying to sync a read-on...



details:   https://anonhg.NetBSD.org/src/rev/9ef255913282
branches:  trunk
changeset: 340084:9ef255913282
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Aug 21 20:52:47 2015 +0000

description:
Assert we aren't trying to sync a read-only mbuf as PREREAD.

diffstat:

 sys/arch/arm/arm32/bus_dma.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 225262d8a4c0 -r 9ef255913282 sys/arch/arm/arm32/bus_dma.c
--- a/sys/arch/arm/arm32/bus_dma.c      Fri Aug 21 20:12:29 2015 +0000
+++ b/sys/arch/arm/arm32/bus_dma.c      Fri Aug 21 20:52:47 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.91 2015/02/25 13:52:42 joerg Exp $       */
+/*     $NetBSD: bus_dma.c,v 1.92 2015/08/21 20:52:47 matt Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "opt_arm_bus_space.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.91 2015/02/25 13:52:42 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.92 2015/08/21 20:52:47 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -924,9 +924,15 @@
                 * cache), this will have to be revisited.
                 */
 
-               if ((ds->_ds_flags & _BUS_DMAMAP_COHERENT) == 0)
+               if ((ds->_ds_flags & _BUS_DMAMAP_COHERENT) == 0) {
+                       /*
+                        * If we are doing preread (DMAing into the mbuf),
+                        * this mbuf better not be readonly, 
+                        */
+                       KASSERT(!(ops & BUS_DMASYNC_PREREAD) || !M_ROMAP(m));
                        _bus_dmamap_sync_segment(va, pa, seglen, ops,
                            M_ROMAP(m));
+               }
                voff += seglen;
                ds_off += seglen;
                len -= seglen;



Home | Main Index | Thread Index | Old Index