[PATCH] ppc64: Fix the lazy icache/dcache code for non-RAM pages
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 8 Nov 2005 00:21:05 +0000 (11:21 +1100)
committerPaul Mackerras <paulus@samba.org>
Tue, 8 Nov 2005 02:07:50 +0000 (13:07 +1100)
For some stupid reason I can't explain (brown paper bag is at hand), I
removed the check pfn_valid() in the code that does the icache/dcache
coherency on POWER4 and later. That causes us to eventually try to
access non existing struct page when hashing in IO pages.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/mm/hash_utils_64.c

index 3d83c3b84f0eed0c3fadf0f4e843b75633c1cf00..22e474876133b334724d053a3e2434c06481acca 100644 (file)
@@ -507,6 +507,9 @@ unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap)
 {
        struct page *page;
 
+       if (!pfn_valid(pte_pfn(pte)))
+               return pp;
+
        page = pte_page(pte);
 
        /* page is dirty */