Skip to content

Commit 6b3142b

Browse files
agnersRussell King
authored andcommitted
ARM: 8612/1: LPAE: initialize cache policy correctly
The cachepolicy variable gets initialized using a masked pmd value. So far, the pmd has been masked with flags valid for the 2-page table format, but the 3-page table format requires a different mask. On LPAE, this lead to a wrong assumption of what initial cache policy has been used. Later a check forces the cache policy to writealloc and prints the following warning: Forcing write-allocate cache policy for SMP This patch introduces a new definition PMD_SECT_CACHE_MASK for both page table formats which masks in all cache flags in both cases. Signed-off-by: Stefan Agner <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 1feafd6 commit 6b3142b

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

arch/arm/include/asm/pgtable-2level-hwdef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
4848
#define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE)
4949
#define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
50+
#define PMD_SECT_CACHE_MASK (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
5051
#define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2))
5152

5253
/*

arch/arm/include/asm/pgtable-3level-hwdef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#define PMD_SECT_WT (_AT(pmdval_t, 2) << 2) /* normal inner write-through */
6363
#define PMD_SECT_WB (_AT(pmdval_t, 3) << 2) /* normal inner write-back */
6464
#define PMD_SECT_WBWA (_AT(pmdval_t, 7) << 2) /* normal inner write-alloc */
65+
#define PMD_SECT_CACHE_MASK (_AT(pmdval_t, 7) << 2)
6566

6667
/*
6768
* + Level 3 descriptor (PTE)

arch/arm/mm/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void __init init_default_cache_policy(unsigned long pmd)
137137

138138
initial_pmd_value = pmd;
139139

140-
pmd &= PMD_SECT_TEX(1) | PMD_SECT_BUFFERABLE | PMD_SECT_CACHEABLE;
140+
pmd &= PMD_SECT_CACHE_MASK;
141141

142142
for (i = 0; i < ARRAY_SIZE(cache_policies); i++)
143143
if (cache_policies[i].pmd == pmd) {

0 commit comments

Comments
 (0)