All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: "Steven J. Hill" <sjhill@mips.com>
Cc: linux-mips@linux-mips.org, Douglas Leung <douglas@mips.com>
Subject: Re: [PATCH] MIPS: Add support for the MIPS32 4Kc family I/D caches.
Date: Tue, 22 May 2012 18:32:45 +0100	[thread overview]
Message-ID: <20120522173245.GB5884@linux-mips.org> (raw)
In-Reply-To: <1337614412-29035-1-git-send-email-sjhill@mips.com>

On Mon, May 21, 2012 at 10:33:32AM -0500, Steven J. Hill wrote:

> Signed-off-by: Steven J. Hill <sjhill@mips.com>
> ---
>  arch/mips/mm/c-r4k.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
> index 18546fa..bca1447 100644
> --- a/arch/mips/mm/c-r4k.c
> +++ b/arch/mips/mm/c-r4k.c
> @@ -1000,7 +1000,7 @@ static void __cpuinit probe_pcache(void)
>  			c->icache.linesz = 2 << lsize;
>  		else
>  			c->icache.linesz = lsize;
> -		c->icache.sets = 64 << ((config1 >> 22) & 7);
> +		c->icache.sets = 32 << (((config1 >> 22) + 1) & 7);
>  		c->icache.ways = 1 + ((config1 >> 16) & 7);
>  
>  		icache_size = c->icache.sets *
> @@ -1020,7 +1020,7 @@ static void __cpuinit probe_pcache(void)
>  			c->dcache.linesz = 2 << lsize;
>  		else
>  			c->dcache.linesz= lsize;
> -		c->dcache.sets = 64 << ((config1 >> 13) & 7);
> +		c->dcache.sets = 32 << (((config1 >> 13) + 1) & 7);
>  		c->dcache.ways = 1 + ((config1 >> 7) & 7);
>  
>  		dcache_size = c->dcache.sets *

Good catch.  I'm amazed how long we were able to get away with this bug.
I guess it only covers a rather esotheric cache configuration.

I wonder what variant of the 4Kc is affected by this?  So far none has
an I-cache with only 32 lines per way.

  Ralf

  reply	other threads:[~2012-05-22 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21 15:33 [PATCH] MIPS: Add support for the MIPS32 4Kc family I/D caches Steven J. Hill
2012-05-22 17:32 ` Ralf Baechle [this message]
2012-05-27  2:19   ` Maciej W. Rozycki
2012-05-29  8:48     ` Ralf Baechle
2012-05-29 10:48       ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120522173245.GB5884@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=douglas@mips.com \
    --cc=linux-mips@linux-mips.org \
    --cc=sjhill@mips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.