google memconsole: use ioremap_cache()
authorAaron Durbin <adurbin@chromium.org>
Fri, 19 Apr 2013 15:35:04 +0000 (10:35 -0500)
committerChromeBot <chrome-bot@google.com>
Wed, 24 Apr 2013 17:59:51 +0000 (10:59 -0700)
The memconsole code was using ioremap() which defaults to using
an uncacheable mapping. When using PAT this creates a PAT entry
as uncached-minus. When a userspace program, such as cbmem,
wants to mmap() the memory area not using O_SYNC by way of /dev/mem
it creates a conflicting entry and fails. Correct this situation
by using ioreamp_cache() becaus the cbmem memconsole lives in memory
that is just reserved from the OS -- not in mmio space.

BUG=None
BRANCH=None
TEST=Tested on Pixel with new cbmem utlity. No errors.

Change-Id: Iff8a160205bf59e4c4d0e9508832901f8dbd1cde
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48654

drivers/firmware/google/memconsole.c

index acedda5..baa327b 100644 (file)
@@ -173,7 +173,7 @@ static bool check_cbmem(void)
                                    E820_RESERVED))
                        break;
 
-               pcbm = ioremap(scan_addr, remap_size);
+               pcbm = ioremap_cache(scan_addr, remap_size);
                if (!pcbm) {
                        scan_addr += CBMEM_ALIGNMENT;
                        continue;
@@ -190,7 +190,7 @@ static bool check_cbmem(void)
                        if ((pcbm[i].magic == CBMEM_ENTRY_MAGIC) &&
                            (pcbm[i].id == CBMEM_CONSOLE_ID)) {
                                /* Yes, map the log. */
-                               cbmem_console = ioremap(pcbm[i].base,
+                               cbmem_console = ioremap_cache(pcbm[i].base,
                                                        pcbm[i].size);
                                break;
                        }