Subject: cache code fix for c-tx39.c (Re: CVS [email-masked]: linux)

From: Atsushi Nemoto <[email-masked]>
Date: Wed, 16 Jul 2003 19:55:14 +0900 (JST)

>>>>> On Wed,  9 Jul 2003 13:48:16 +0100, [email-masked] said:
> Changes by:	[email-masked]	03/07/09 13:48:16
> 
> Modified files:
> 	arch/mips/mm   : Tag: linux_2_4 c-r4k.c 
> 	arch/mips64/mm : Tag: linux_2_4 c-r4k.c 
> 	include/asm-mips: Tag: linux_2_4 processor.h r4kcache.h 
> 	include/asm-mips64: Tag: linux_2_4 processor.h 
> 
> Log message:
> 	Cache code fixes.

Please fix c-tx39.c also.  This is a patch for 2.4 branch.

diff -ur linux-mips-cvs/arch/mips/mm/c-tx39.c linux.new/arch/mips/mm/c-tx39.c
--- linux-mips-cvs/arch/mips/mm/c-tx39.c	Tue May  6 09:40:58 2003
+++ linux.new/arch/mips/mm/c-tx39.c	Wed Jul 16 19:39:55 2003
@@ -25,9 +25,6 @@
 
 /* For R3000 cores with R4000 style caches */
 static unsigned long icache_size, dcache_size;		/* Size in bytes */
-static unsigned long icache_way_size, dcache_way_size;	/* Size divided by ways */
-#define scache_size 0
-#define scache_way_size 0
 
 #include <asm/r4kcache.h>
 
@@ -473,15 +470,15 @@
 		break;
 	}
 
-	icache_way_size = icache_size / current_cpu_data.icache.ways;
-	dcache_way_size = dcache_size / current_cpu_data.dcache.ways;
+	current_cpu_data.icache.waysize = icache_size / current_cpu_data.icache.ways;
+	current_cpu_data.dcache.waysize = dcache_size / current_cpu_data.dcache.ways;
 
 	current_cpu_data.icache.sets =
-		icache_way_size / current_cpu_data.icache.linesz;
+		current_cpu_data.icache.waysize / current_cpu_data.icache.linesz;
 	current_cpu_data.dcache.sets =
-		dcache_way_size / current_cpu_data.dcache.linesz;
+		current_cpu_data.dcache.waysize / current_cpu_data.dcache.linesz;
 
-	if (dcache_way_size > PAGE_SIZE)
+	if (current_cpu_data.dcache.waysize > PAGE_SIZE)
 		current_cpu_data.dcache.flags |= MIPS_CACHE_ALIASES;
 
 	current_cpu_data.icache.waybit = 0;
---
Atsushi Nemoto

---

From: Atsushi Nemoto <[email-masked]>
Date: Wed, 16 Jul 2003 19:58:13 +0900 (JST)

>>>>> On Wed, 16 Jul 2003 19:55:14 +0900 (JST), Atsushi Nemoto <[email-masked]> said:
>> Log message: Cache code fixes.

anemo> Please fix c-tx39.c also.  This is a patch for 2.4 branch.

And this is one for trunk (2.6).

diff -ur linux-mips-cvs-2.6/arch/mips/mm/c-tx39.c linux.new-2.6/arch/mips/mm/c-tx39.c
--- linux-mips-cvs-2.6/arch/mips/mm/c-tx39.c	Wed Jul 16 19:49:27 2003
+++ linux.new-2.6/arch/mips/mm/c-tx39.c	Wed Jul 16 19:52:42 2003
@@ -25,9 +25,6 @@

 
@@ -474,15 +471,15 @@
 		break;
 	}