Subject: Re: CVS commit: src/sys/arch/sgimips/sgimips
To: Izumi Tsutsui <>
From: Christopher SEKIYA <>
List: port-sgimips
Date: 10/15/2005 22:37:09
On Sat, Oct 15, 2005 at 01:33:31PM +0900, Izumi Tsutsui wrote:

> Is't it better to check mips_sdcache_line_size
> (which is taken from CP0, though mips_machdep_find_l2cache()
>  overrides it) rather than mips_sdcache_size?

Yes.  My original analysis of the problem was slightly wrong.

The problem was not that mips_machdep_find_l2cache() did not properly set
mips_sdcache_line_size; the problem was mips_machdep_cache_config() called
r5k_enable_sdcache() iff MIPS3_CONFIG_SC was zero.

MIPS3_CONFIG_SC is not reliable for r5k on IP22.  Since r5k_enable_sdcache()
will gracefully exit if SC size is zero, we should call it unconditionally.

I believe the patch below does the right thing.  My IP22 seems happy with it
(although it doesn't seem any faster, perhaps I should run a benchmark).

-- Chris
	GPG key FEB9DE7F (91AF 4534 4529 4BCC 31A5  938E 023E EEFB FEB9 DE7F)

Index: machdep.c
RCS file: /cvsroot/src/sys/arch/sgimips/sgimips/machdep.c,v
retrieving revision 1.93
diff -u -r1.93 machdep.c
--- machdep.c   3 Jun 2005 19:02:33 -0000       1.93
+++ machdep.c   15 Oct 2005 13:31:37 -0000
@@ -862,6 +862,7 @@
 #if defined(MIPS3)
        case MIPS_R5000:
        case MIPS_RM5200:
+               r5k_enable_sdcache();