All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove redundant r4k_blast_icache() calls
@ 2006-08-22 12:15 Atsushi Nemoto
  2006-11-14 17:00 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2006-08-22 12:15 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

This patch remove some r4k_blast_icache() calls.

r4k_flush_cache_all() and r4k_flush_cache_mm() case: these are noop if
the CPU did not have dc_aliases.  It would mean we do not need to care
about icache here.

r4k_flush_cache_range case: if r4k_flush_cache_mm() did not need to
care about icache, it would be same for this function.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 4e14982..a9e2f84 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -323,7 +323,6 @@ static inline void r4k_blast_scache_setu
 static inline void local_r4k_flush_cache_all(void * args)
 {
 	r4k_blast_dcache();
-	r4k_blast_icache();
 }
 
 static void r4k_flush_cache_all(void)
@@ -359,21 +358,19 @@ static void r4k___flush_cache_all(void)
 static inline void local_r4k_flush_cache_range(void * args)
 {
 	struct vm_area_struct *vma = args;
-	int exec;
 
 	if (!(cpu_context(smp_processor_id(), vma->vm_mm)))
 		return;
 
-	exec = vma->vm_flags & VM_EXEC;
-	if (cpu_has_dc_aliases || exec)
-		r4k_blast_dcache();
-	if (exec)
-		r4k_blast_icache();
+	r4k_blast_dcache();
 }
 
 static void r4k_flush_cache_range(struct vm_area_struct *vma,
 	unsigned long start, unsigned long end)
 {
+	if (!cpu_has_dc_aliases)
+		return;
+
 	r4k_on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1);
 }
 
@@ -385,7 +382,6 @@ static inline void local_r4k_flush_cache
 		return;
 
 	r4k_blast_dcache();
-	r4k_blast_icache();
 
 	/*
 	 * Kludge alert.  For obscure reasons R4000SC and R4400SC go nuts if we

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] remove redundant r4k_blast_icache() calls
  2006-08-22 12:15 [PATCH] remove redundant r4k_blast_icache() calls Atsushi Nemoto
@ 2006-11-14 17:00 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2006-11-14 17:00 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: linux-mips

On Tue, Aug 22, 2006 at 09:15:47PM +0900, Atsushi Nemoto wrote:

> @@ -385,7 +382,6 @@ static inline void local_r4k_flush_cache
>  		return;
>  
>  	r4k_blast_dcache();
> -	r4k_blast_icache();
>  
>  	/*
>  	 * Kludge alert.  For obscure reasons R4000SC and R4400SC go nuts if we

R4000 / R4400 SC and MC indexed S-cache ops also affected the primary
caches so this code ends unnecessarily blowing away the D-cache twice.

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-14 16:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-22 12:15 [PATCH] remove redundant r4k_blast_icache() calls Atsushi Nemoto
2006-11-14 17:00 ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.