Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/linux linux: Fix dma mapping to set RE...



details:   https://anonhg.NetBSD.org/src/rev/028ae83f50b3
branches:  trunk
changeset: 1028834:028ae83f50b3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:10:14 2021 +0000

description:
linux: Fix dma mapping to set READ|WRITE if bidi; clarify cases.

diffstat:

 sys/external/bsd/drm2/linux/linux_sgt.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r bbecac436bf4 -r 028ae83f50b3 sys/external/bsd/drm2/linux/linux_sgt.c
--- a/sys/external/bsd/drm2/linux/linux_sgt.c   Sun Dec 19 12:10:06 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_sgt.c   Sun Dec 19 12:10:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_sgt.c,v 1.1 2021/12/19 12:06:57 riastradh Exp $  */
+/*     $NetBSD: linux_sgt.c,v 1.2 2021/12/19 12:10:14 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sgt.c,v 1.1 2021/12/19 12:06:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sgt.c,v 1.2 2021/12/19 12:10:14 riastradh Exp $");
 
 #include <sys/bus.h>
 #include <sys/errno.h>
@@ -160,8 +160,10 @@
                flags |= BUS_DMA_READ;
                break;
        case DMA_BIDIRECTIONAL:
+               flags |= BUS_DMA_READ|BUS_DMA_WRITE;
                break;
        case DMA_NONE:
+       default:
                panic("invalid DMA direction %d", dir);
        }
 
@@ -181,6 +183,7 @@
        KASSERT(sg->sg_dmamap->dm_nsegs > 0);
        KASSERT(sg->sg_dmamap->dm_nsegs <= nents);
        ret = sg->sg_dmamap->dm_nsegs;
+       error = 0;
 
 out:   if (error) {
                if (loaded)



Home | Main Index | Thread Index | Old Index