Module Name:    src
Committed By:   riastradh
Date:           Tue Jan 21 20:56:50 UTC 2014

Modified Files:
        src/sys/external/bsd/drm2/linux [riastradh-drm2]: linux_kmap.c

Log Message:
Call uvm_vm_page_to_phys before taking a spin lock to ease debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/external/bsd/drm2/linux/linux_kmap.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/linux/linux_kmap.c
diff -u src/sys/external/bsd/drm2/linux/linux_kmap.c:1.1.2.3 src/sys/external/bsd/drm2/linux/linux_kmap.c:1.1.2.4
--- src/sys/external/bsd/drm2/linux/linux_kmap.c:1.1.2.3	Sun Sep  8 16:16:37 2013
+++ src/sys/external/bsd/drm2/linux/linux_kmap.c	Tue Jan 21 20:56:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_kmap.c,v 1.1.2.3 2013/09/08 16:16:37 riastradh Exp $	*/
+/*	$NetBSD: linux_kmap.c,v 1.1.2.4 2014/01/21 20:56:50 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_kmap.c,v 1.1.2.3 2013/09/08 16:16:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_kmap.c,v 1.1.2.4 2014/01/21 20:56:50 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/kmem.h>
@@ -144,6 +144,7 @@ linux_kmap_fini(void)
 void *
 kmap_atomic(struct page *page)
 {
+	const paddr_t paddr = uvm_vm_page_to_phys(&page->p_vmp);
 
 	mutex_spin_enter(&linux_kmap_atomic_lock);
 
@@ -151,7 +152,6 @@ kmap_atomic(struct page *page)
 	KASSERT(!pmap_extract(pmap_kernel(), linux_kmap_atomic_vaddr, NULL));
 
 	const vaddr_t vaddr = linux_kmap_atomic_vaddr;
-	const paddr_t paddr = uvm_vm_page_to_phys(&page->p_vmp);
 	const int prot = (VM_PROT_READ | VM_PROT_WRITE);
 	const int flags = 0;
 	pmap_kenter_pa(vaddr, paddr, prot, flags);

Reply via email to