Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72797
b: refs/heads/master
c: a76ab5c
h: refs/heads/master
i:
  72795: 7e0d049
v: v3
  • Loading branch information
Ralf Baechle committed Oct 29, 2007
1 parent 3fc4c6b commit 122ec50
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a370605594bc9f375d2912096f01643c46b4b709
refs/heads/master: a76ab5c10d99bdf458067cb495e72c0ee5f09909
21 changes: 18 additions & 3 deletions trunk/arch/mips/mm/c-r4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;

/*
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 122ec50

Please sign in to comment.