diff options
Diffstat (limited to 'arch/mips/mm/c-tx39.c')
-rw-r--r-- | arch/mips/mm/c-tx39.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c index ff5afab64b2f..0a97a9434eba 100644 --- a/arch/mips/mm/c-tx39.c +++ b/arch/mips/mm/c-tx39.c | |||
@@ -167,15 +167,16 @@ static void tx39_flush_cache_mm(struct mm_struct *mm) | |||
167 | static void tx39_flush_cache_range(struct vm_area_struct *vma, | 167 | static void tx39_flush_cache_range(struct vm_area_struct *vma, |
168 | unsigned long start, unsigned long end) | 168 | unsigned long start, unsigned long end) |
169 | { | 169 | { |
170 | struct mm_struct *mm = vma->vm_mm; | 170 | int exec; |
171 | 171 | ||
172 | if (!cpu_has_dc_aliases) | 172 | if (!(cpu_context(smp_processor_id(), vma->vm_mm))) |
173 | return; | 173 | return; |
174 | 174 | ||
175 | if (cpu_context(smp_processor_id(), mm) != 0) { | 175 | exec = vma->vm_flags & VM_EXEC; |
176 | if (cpu_has_dc_aliases || exec) | ||
176 | tx39_blast_dcache(); | 177 | tx39_blast_dcache(); |
178 | if (exec) | ||
177 | tx39_blast_icache(); | 179 | tx39_blast_icache(); |
178 | } | ||
179 | } | 180 | } |
180 | 181 | ||
181 | static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn) | 182 | static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn) |
@@ -183,6 +184,7 @@ static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page | |||
183 | int exec = vma->vm_flags & VM_EXEC; | 184 | int exec = vma->vm_flags & VM_EXEC; |
184 | struct mm_struct *mm = vma->vm_mm; | 185 | struct mm_struct *mm = vma->vm_mm; |
185 | pgd_t *pgdp; | 186 | pgd_t *pgdp; |
187 | pud_t *pudp; | ||
186 | pmd_t *pmdp; | 188 | pmd_t *pmdp; |
187 | pte_t *ptep; | 189 | pte_t *ptep; |
188 | 190 | ||
@@ -195,7 +197,8 @@ static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page | |||
195 | 197 | ||
196 | page &= PAGE_MASK; | 198 | page &= PAGE_MASK; |
197 | pgdp = pgd_offset(mm, page); | 199 | pgdp = pgd_offset(mm, page); |
198 | pmdp = pmd_offset(pgdp, page); | 200 | pudp = pud_offset(pgdp, page); |
201 | pmdp = pmd_offset(pudp, page); | ||
199 | ptep = pte_offset(pmdp, page); | 202 | ptep = pte_offset(pmdp, page); |
200 | 203 | ||
201 | /* | 204 | /* |
@@ -407,7 +410,7 @@ static __init void tx39_probe_cache(void) | |||
407 | } | 410 | } |
408 | } | 411 | } |
409 | 412 | ||
410 | void __init ld_mmu_tx39(void) | 413 | void __init tx39_cache_init(void) |
411 | { | 414 | { |
412 | extern void build_clear_page(void); | 415 | extern void build_clear_page(void); |
413 | extern void build_copy_page(void); | 416 | extern void build_copy_page(void); |
@@ -490,4 +493,5 @@ void __init ld_mmu_tx39(void) | |||
490 | 493 | ||
491 | build_clear_page(); | 494 | build_clear_page(); |
492 | build_copy_page(); | 495 | build_copy_page(); |
496 | tx39h_flush_icache_all(); | ||
493 | } | 497 | } |