PM / Sleep: arm: mmu: Mark fixed ptes as volatile during suspend
authorJonathan Kliegman <kliegs@chromium.org>
Tue, 6 Nov 2012 21:35:09 +0000 (16:35 -0500)
committerGerrit <chrome-bot@google.com>
Wed, 7 Nov 2012 23:32:06 +0000 (15:32 -0800)
Make the page table entries used by kmap_atomic as volatile so we ignore
changes made to them during the memory checksum operations on suspend/resume.

BUG=chrome-os-partner:15914
TEST=Saw location 0xaf7fe400 generate false CRC errors before patch
  After patch changes to that page are ignored.
  Confirmed with additional debug printing that the supression is added

Change-Id: I6766099aa0e86c479b26ee18d69b537493e84dfc
Signed-off-by: Jonathan Kliegman <kliegs@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37463
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
arch/arm/mm/mmu.c

index cf4528d..97fda6f 100644 (file)
@@ -28,6 +28,7 @@
 #include <asm/highmem.h>
 #include <asm/system_info.h>
 #include <asm/traps.h>
+#include <asm/fixmap.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -52,6 +53,7 @@ pmd_t *top_pmd;
 #define CPOLICY_WRITEBACK      3
 #define CPOLICY_WRITEALLOC     4
 
+static struct pm_suspend_volatile_chunk pm_volatile_chunk;
 static unsigned int cachepolicy __initdata = CPOLICY_WRITEBACK;
 static unsigned int ecc_mask __initdata = 0;
 pgprot_t pgprot_user;
@@ -1215,4 +1217,11 @@ void __init paging_init(struct machine_desc *mdesc)
 
        empty_zero_page = virt_to_page(zero_page);
        __flush_dcache_page(NULL, empty_zero_page);
+
+#ifdef CONFIG_HIGHMEM
+       pm_volatile_chunk.start =
+               virt_to_phys(pte_offset_kernel(top_pmd, fix_to_virt(0)));
+       pm_volatile_chunk.num_bytes = FIX_KMAP_END * sizeof(pte_t);
+       pm_register_suspend_volatile(&pm_volatile_chunk);
+#endif
 }