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 drm: Sprinkle some assertions in...



details:   https://anonhg.NetBSD.org/src/rev/bfe26bd7d009
branches:  trunk
changeset: 1029173:bfe26bd7d009
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Dec 24 15:08:31 2021 +0000

description:
drm: Sprinkle some assertions into sg dma logic.

diffstat:

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

diffs (35 lines):

diff -r 4e75bc6fd970 -r bfe26bd7d009 sys/external/bsd/drm2/linux/linux_sgt.c
--- a/sys/external/bsd/drm2/linux/linux_sgt.c   Fri Dec 24 15:08:09 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_sgt.c   Fri Dec 24 15:08:31 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_sgt.c,v 1.3 2021/12/19 12:10:42 riastradh Exp $  */
+/*     $NetBSD: linux_sgt.c,v 1.4 2021/12/24 15:08:31 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.3 2021/12/19 12:10:42 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sgt.c,v 1.4 2021/12/24 15:08:31 riastradh Exp $");
 
 #include <sys/bus.h>
 #include <sys/errno.h>
@@ -153,6 +153,7 @@
        int ret, error = 0;
 
        KASSERT(sg->sg_dmamap == NULL);
+       KASSERT(sg->sg_npgs);
        KASSERT(nents >= 1);
 
        switch (dir) {
@@ -213,6 +214,8 @@
     int dir, int attrs)
 {
 
+       KASSERT(sg->sg_dmat == dmat);
+
        bus_dmamap_unload(dmat, sg->sg_dmamap);
        bus_dmamap_destroy(dmat, sg->sg_dmamap);
        sg->sg_dmamap = NULL;



Home | Main Index | Thread Index | Old Index