Re: 2.4.19pre8aa1 & vm-34: unresolved kmap_pagetable

From: Andrea Arcangeli (andrea@suse.de)
Date: Sat May 04 2002 - 08:49:43 EST


On Sat, May 04, 2002 at 11:41:25PM +1000, Eyal Lebedinsky wrote:
> Well, this may be a problem for NVdriver (a mostly binary only driver)
> which I use.

This should fix it:

diff -urN NVIDIA_kernel-1.0-2313/nv.c NVIDIA_kernel-1.0-2313.pte-highmem/nv.c
--- NVIDIA_kernel-1.0-2313/nv.c Tue Nov 27 21:39:17 2001
+++ NVIDIA_kernel-1.0-2313.pte-highmem/nv.c Sun Feb 3 16:35:18 2002
@@ -42,6 +42,7 @@
 #include <linux/interrupt.h>
 #include <linux/tqueue.h> // struct tq_struct
 #include <linux/poll.h>
+#include <linux/highmem.h>
 #ifdef CONFIG_PM
 #include <linux/pm.h> // power management
 #endif
@@ -2267,7 +2268,7 @@
 {
     pgd_t *pg_dir;
     pmd_t *pg_mid_dir;
- pte_t *pg_table;
+ pte_t *pg_table, pte;
 
     /* XXX do we really need this? */
     if (address > VMALLOC_START)
@@ -2297,11 +2298,13 @@
     if (pmd_none(*pg_mid_dir))
         goto failed;
 
- pg_table = pte_offset(pg_mid_dir, address);
- if (!pte_present(*pg_table))
+ pg_table = pte_offset_atomic(pg_mid_dir, address);
+ pte = *pg_table;
+ pte_kunmap(pg_table);
+ if (!pte_present(pte))
         goto failed;
 
- return ((pte_val(*pg_table) & KERN_PAGE_MASK) | NV_MASK_OFFSET(address));
+ return ((pte_val(pte) & KERN_PAGE_MASK) | NV_MASK_OFFSET(address));
 
   failed:
     return (unsigned long) NULL;

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 07 2002 - 22:00:22 EST