Module Name:    src
Committed By:   matt
Date:           Mon Sep  8 22:12:12 UTC 2014

Modified Files:
        src/sys/arch/arm/arm32: bus_dma.c

Log Message:
With PMAP_NEED_ALLOC_POOLPAGE, before using pmap_map_poolpage make sure
the page comes from the same freelist that pmap_map_poolpage uses.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/arm/arm32/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/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.86 src/sys/arch/arm/arm32/bus_dma.c:1.87
--- src/sys/arch/arm/arm32/bus_dma.c:1.86	Thu Apr 10 02:44:05 2014
+++ src/sys/arch/arm/arm32/bus_dma.c	Mon Sep  8 22:12:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.86 2014/04/10 02:44:05 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.87 2014/09/08 22:12:12 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.86 2014/04/10 02:44:05 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.87 2014/09/08 22:12:12 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1305,6 +1305,19 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 			}
 		}
 
+#ifdef PMAP_NEED_ALLOC_POOLPAGE
+		/*
+		 * The page can only be direct mapped if was allocated out
+		 * of the arm poolpage vm freelist.  
+		 */
+		int lcv = vm_physseg_find(atop(pa), NULL);
+		KASSERT(lcv != -1);
+		if (direct_mapable) {
+			direct_mapable =
+			    (arm_poolpage_vmfreelist == VM_PHYSMEM_PTR(lcv)->free_list);
+		}
+#endif
+
 		if (direct_mapable) {
 			*kvap = (void *)PMAP_MAP_POOLPAGE(pa);
 #ifdef DEBUG_DMA

Reply via email to