Module Name:    src
Committed By:   chs
Date:           Sun Apr 21 15:49:50 UTC 2019

Modified Files:
        src/sys/external/bsd/drm2/ttm: ttm_bus_dma.c

Log Message:
in ttm_bus_dma_populate(), move the clearing of TTM_PAGE_FLAG_SWAPPED to be
earlier to avoid wrongly asserting if bus_dmamap_load_pglist() fails.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c
diff -u src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c:1.7 src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c:1.8
--- src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c:1.7	Thu Mar  9 08:27:18 2017
+++ src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c	Sun Apr 21 15:49:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_bus_dma.c,v 1.7 2017/03/09 08:27:18 maya Exp $	*/
+/*	$NetBSD: ttm_bus_dma.c,v 1.8 2019/04/21 15:49:50 chs Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttm_bus_dma.c,v 1.7 2017/03/09 08:27:18 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bus_dma.c,v 1.8 2019/04/21 15:49:50 chs Exp $");
 
 #include <sys/bus.h>
 
@@ -70,6 +70,9 @@ ttm_bus_dma_populate(struct ttm_dma_tt *
 	/* Mark it populated but unbound.  */
 	ttm_dma->ttm.state = tt_unbound;
 
+	/* Mark it wired.  */
+	ttm_dma->ttm.page_flags &= ~TTM_PAGE_FLAG_SWAPPED;
+
 	/* Load the DMA map.  */
 	/* XXX errno NetBSD->Linux */
 	ret = -bus_dmamap_load_pglist(ttm_dma->ttm.bdev->dmat,
@@ -78,9 +81,6 @@ ttm_bus_dma_populate(struct ttm_dma_tt *
 	if (ret)
 		goto fail1;
 
-	/* Mark it wired.  */
-	ttm_dma->ttm.page_flags &= ~TTM_PAGE_FLAG_SWAPPED;
-
 	/* Success!  */
 	return 0;
 

Reply via email to