diff options
Diffstat (limited to 'arch/arm/mm/fault-armv.c')
-rw-r--r-- | arch/arm/mm/fault-armv.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c index a8ec97b4752e..81d0b8772de3 100644 --- a/arch/arm/mm/fault-armv.c +++ b/arch/arm/mm/fault-armv.c | |||
@@ -17,11 +17,13 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/pagemap.h> | 18 | #include <linux/pagemap.h> |
19 | 19 | ||
20 | #include <asm/bugs.h> | ||
20 | #include <asm/cacheflush.h> | 21 | #include <asm/cacheflush.h> |
22 | #include <asm/cachetype.h> | ||
21 | #include <asm/pgtable.h> | 23 | #include <asm/pgtable.h> |
22 | #include <asm/tlbflush.h> | 24 | #include <asm/tlbflush.h> |
23 | 25 | ||
24 | static unsigned long shared_pte_mask = L_PTE_CACHEABLE; | 26 | static unsigned long shared_pte_mask = L_PTE_MT_BUFFERABLE; |
25 | 27 | ||
26 | /* | 28 | /* |
27 | * We take the easy way out of this problem - we make the | 29 | * We take the easy way out of this problem - we make the |
@@ -63,9 +65,10 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address) | |||
63 | * If this page isn't present, or is already setup to | 65 | * If this page isn't present, or is already setup to |
64 | * fault (ie, is old), we can safely ignore any issues. | 66 | * fault (ie, is old), we can safely ignore any issues. |
65 | */ | 67 | */ |
66 | if (ret && pte_val(entry) & shared_pte_mask) { | 68 | if (ret && (pte_val(entry) & L_PTE_MT_MASK) != shared_pte_mask) { |
67 | flush_cache_page(vma, address, pte_pfn(entry)); | 69 | flush_cache_page(vma, address, pte_pfn(entry)); |
68 | pte_val(entry) &= ~shared_pte_mask; | 70 | pte_val(entry) &= ~L_PTE_MT_MASK; |
71 | pte_val(entry) |= shared_pte_mask; | ||
69 | set_pte_at(vma->vm_mm, address, pte, entry); | 72 | set_pte_at(vma->vm_mm, address, pte, entry); |
70 | flush_tlb_page(vma, address); | 73 | flush_tlb_page(vma, address); |
71 | } | 74 | } |
@@ -197,7 +200,7 @@ void __init check_writebuffer_bugs(void) | |||
197 | unsigned long *p1, *p2; | 200 | unsigned long *p1, *p2; |
198 | pgprot_t prot = __pgprot(L_PTE_PRESENT|L_PTE_YOUNG| | 201 | pgprot_t prot = __pgprot(L_PTE_PRESENT|L_PTE_YOUNG| |
199 | L_PTE_DIRTY|L_PTE_WRITE| | 202 | L_PTE_DIRTY|L_PTE_WRITE| |
200 | L_PTE_BUFFERABLE); | 203 | L_PTE_MT_BUFFERABLE); |
201 | 204 | ||
202 | p1 = vmap(&page, 1, VM_IOREMAP, prot); | 205 | p1 = vmap(&page, 1, VM_IOREMAP, prot); |
203 | p2 = vmap(&page, 1, VM_IOREMAP, prot); | 206 | p2 = vmap(&page, 1, VM_IOREMAP, prot); |
@@ -218,7 +221,7 @@ void __init check_writebuffer_bugs(void) | |||
218 | 221 | ||
219 | if (v) { | 222 | if (v) { |
220 | printk("failed, %s\n", reason); | 223 | printk("failed, %s\n", reason); |
221 | shared_pte_mask |= L_PTE_BUFFERABLE; | 224 | shared_pte_mask = L_PTE_MT_UNCACHED; |
222 | } else { | 225 | } else { |
223 | printk("ok\n"); | 226 | printk("ok\n"); |
224 | } | 227 | } |