From 122ec508dc574e0292e362aa360843d2f04dd664 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 8 Oct 2007 16:38:37 +0100 Subject: [PATCH] --- yaml --- r: 72797 b: refs/heads/master c: a76ab5c10d99bdf458067cb495e72c0ee5f09909 h: refs/heads/master i: 72795: 7e0d049e09b4db2831a9438ad24f53fae624f232 v: v3 --- [refs] | 2 +- trunk/arch/mips/mm/c-r4k.c | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index b57e8cb8d3db..9def6bf098c5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a370605594bc9f375d2912096f01643c46b4b709 +refs/heads/master: a76ab5c10d99bdf458067cb495e72c0ee5f09909 diff --git a/trunk/arch/mips/mm/c-r4k.c b/trunk/arch/mips/mm/c-r4k.c index d7088331fb0f..6806d58211b2 100644 --- a/trunk/arch/mips/mm/c-r4k.c +++ b/trunk/arch/mips/mm/c-r4k.c @@ -345,11 +345,26 @@ static void r4k___flush_cache_all(void) r4k_on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1); } +static inline int has_valid_asid(const struct mm_struct *mm) +{ +#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC) + int i; + + for_each_online_cpu(i) + if (cpu_context(i, mm)) + return 1; + + return 0; +#else + return cpu_context(smp_processor_id(), mm); +#endif +} + static inline void local_r4k_flush_cache_range(void * args) { struct vm_area_struct *vma = args; - if (!(cpu_context(smp_processor_id(), vma->vm_mm))) + if (!(has_valid_asid(vma->vm_mm))) return; r4k_blast_dcache(); @@ -368,7 +383,7 @@ static inline void local_r4k_flush_cache_mm(void * args) { struct mm_struct *mm = args; - if (!cpu_context(smp_processor_id(), mm)) + if (!has_valid_asid(mm)) return; /* @@ -420,7 +435,7 @@ static inline void local_r4k_flush_cache_page(void *args) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if (cpu_context(smp_processor_id(), mm) == 0) + if (!has_valid_asid(mm)) return; addr &= PAGE_MASK;