diff mbox

parisc: fix LMMIO mismatch between PAT length and MASK register

Message ID 51DC7996.3010405@bell.net (mailing list archive)
State Superseded
Headers show

Commit Message

John David Anglin July 9, 2013, 8:59 p.m. UTC
On 7/9/2013 3:45 PM, Alex Ivanov wrote:
> The panic on SMP kernel changed to another one:
> http://pastebin.com/SfUfd0Un
This is just a guess but I don't think page is valid
if the pfn is not valid.  You might try this untested change.

flush_cache_mm might have same problem (i.e., we may need to
check whether the pfn for the pte is valid).

Dave
diff mbox

Patch

diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 65fb4cb..8f60123 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -74,10 +74,13 @@  EXPORT_SYMBOL(flush_cache_all_local);
 void
 update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
 {
-	struct page *page = pte_page(*ptep);
+	struct page *page;
 
-	if (pfn_valid(page_to_pfn(page)) && page_mapping(page) &&
-	    test_bit(PG_dcache_dirty, &page->flags)) {
+	if (!pfn_valid(*ptep))
+		return;
+
+	page = pte_page(*ptep);
+	if (page_mapping(page) && test_bit(PG_dcache_dirty, &page->flags)) {
 
 		flush_kernel_dcache_page(page);
 		clear_bit(PG_dcache_dirty, &page->flags);