Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/mips/mips Pull up following revision(s) (request...



details:   https://anonhg.NetBSD.org/src/rev/76f8289eafca
branches:  netbsd-9
changeset: 963711:76f8289eafca
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Mar 13 05:35:42 2020 +0000

description:
Pull up following revision(s) (requested by thorpej in ticket #779):

        sys/arch/mips/mips/bus_dma.c: revision 1.39

Allow len == 0 in bus_dmamap_sync().

XXX pullup-9

diffstat:

 sys/arch/mips/mips/bus_dma.c |  20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diffs (55 lines):

diff -r 9fc7a910eae3 -r 76f8289eafca sys/arch/mips/mips/bus_dma.c
--- a/sys/arch/mips/mips/bus_dma.c      Tue Mar 10 06:49:58 2020 +0000
+++ b/sys/arch/mips/mips/bus_dma.c      Fri Mar 13 05:35:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.38 2016/08/17 22:02:19 skrll Exp $       */
+/*     $NetBSD: bus_dma.c,v 1.38.20.1 2020/03/13 05:35:42 martin Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.38 2016/08/17 22:02:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.38.20.1 2020/03/13 05:35:42 martin Exp $");
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -750,11 +750,12 @@
                panic("_bus_dmamap_sync: mix PRE and POST");
 
        if (offset >= map->dm_mapsize)
-               panic("_bus_dmamap_sync: bad offset %"PRIxPADDR 
-                       " (map size is %"PRIxPSIZE")",
-                               offset, map->dm_mapsize);
-       if (len == 0 || (offset + len) > map->dm_mapsize)
-               panic("_bus_dmamap_sync: bad length");
+               panic("%s: bad offset 0x%jx >= 0x%jx", __func__,
+                   (intmax_t)offset, (intmax_t)map->dm_mapsize);
+       if ((offset + len) > map->dm_mapsize)
+               panic("%s: bad length 0x%jx + 0x%jx > 0x%jx", __func__,
+                   (intmax_t)offset, (intmax_t)len,
+                   (intmax_t)map->dm_mapsize);
 #endif
 
        /*
@@ -777,7 +778,7 @@
 #ifdef _MIPS_NEED_BUS_DMA_BOUNCE
        struct mips_bus_dma_cookie * const cookie = map->_dm_cookie;
        if (cookie != NULL && (cookie->id_flags & _BUS_DMA_IS_BOUNCING)
-           && (ops & BUS_DMASYNC_PREWRITE)) {
+           && (ops & BUS_DMASYNC_PREWRITE) && len != 0) {
                STAT_INCR(write_bounces);
                /*
                 * Copy the caller's buffer to the bounce buffer.
@@ -920,7 +921,8 @@
 #ifdef _MIPS_NEED_BUS_DMA_BOUNCE
        if ((ops & BUS_DMASYNC_POSTREAD) == 0
            || cookie == NULL
-           || (cookie->id_flags & _BUS_DMA_IS_BOUNCING) == 0)
+           || (cookie->id_flags & _BUS_DMA_IS_BOUNCING) == 0
+           || len == 0)
                return;
 
        STAT_INCR(read_bounces);



Home | Main Index | Thread Index | Old Index