aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/mm/cache-sh4.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c
index dfc1d0379479..92f87a460a81 100644
--- a/arch/sh/mm/cache-sh4.c
+++ b/arch/sh/mm/cache-sh4.c
@@ -330,6 +330,9 @@ loop_exit:
330 */ 330 */
331void flush_cache_mm(struct mm_struct *mm) 331void flush_cache_mm(struct mm_struct *mm)
332{ 332{
333 if (cpu_context(smp_processor_id(), mm) == NO_CONTEXT)
334 return;
335
333 /* 336 /*
334 * If cache is only 4k-per-way, there are never any 'aliases'. Since 337 * If cache is only 4k-per-way, there are never any 'aliases'. Since
335 * the cache is physically tagged, the data can just be left in there. 338 * the cache is physically tagged, the data can just be left in there.
@@ -371,6 +374,9 @@ void flush_cache_page(struct vm_area_struct *vma, unsigned long address,
371 unsigned long phys = pfn << PAGE_SHIFT; 374 unsigned long phys = pfn << PAGE_SHIFT;
372 unsigned int alias_mask; 375 unsigned int alias_mask;
373 376
377 if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
378 return;
379
374 alias_mask = boot_cpu_data.dcache.alias_mask; 380 alias_mask = boot_cpu_data.dcache.alias_mask;
375 381
376 /* We only need to flush D-cache when we have alias */ 382 /* We only need to flush D-cache when we have alias */
@@ -413,6 +419,9 @@ void flush_cache_page(struct vm_area_struct *vma, unsigned long address,
413void flush_cache_range(struct vm_area_struct *vma, unsigned long start, 419void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
414 unsigned long end) 420 unsigned long end)
415{ 421{
422 if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
423 return;
424
416 /* 425 /*
417 * If cache is only 4k-per-way, there are never any 'aliases'. Since 426 * If cache is only 4k-per-way, there are never any 'aliases'. Since
418 * the cache is physically tagged, the data can just be left in there. 427 * the cache is physically tagged, the data can just be left in there.