Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Martin Michlmayr <tbm@cyrius.com>
Cc: linux-mips@linux-mips.org
Subject: Re: Fix a CPU definition for Cobalt
Date: Thu, 19 Jan 2006 21:04:40 +0000	[thread overview]
Message-ID: <20060119210440.GE3398@linux-mips.org> (raw)
In-Reply-To: <20060119192414.GA26798@deprecation.cyrius.com>

On Thu, Jan 19, 2006 at 07:24:14PM +0000, Martin Michlmayr wrote:

> If cpu_icache_snoops_remote_store is not set, Cobalt will crash
> immediately when starting the kernel.

That's papering over the actual bug.  The CPU has no scache, so the
scache flushing functions aren't getting initialized and the NULL
pointer is eventually called as a function.  So I suggest this below.
Can you test it?

  Ralf

diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 422b55f..24a59a9 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -235,7 +235,9 @@ static inline void r4k_blast_scache_page
 {
 	unsigned long sc_lsize = cpu_scache_line_size();
 
-	if (sc_lsize == 16)
+	if (scache_size == 0)
+		r4k_blast_scache_page = no_sc_noop;
+	else if (sc_lsize == 16)
 		r4k_blast_scache_page = blast_scache16_page;
 	else if (sc_lsize == 32)
 		r4k_blast_scache_page = blast_scache32_page;
@@ -251,7 +253,9 @@ static inline void r4k_blast_scache_page
 {
 	unsigned long sc_lsize = cpu_scache_line_size();
 
-	if (sc_lsize == 16)
+	if (scache_size == 0)
+		r4k_blast_scache_page = no_sc_noop;
+	else if (sc_lsize == 16)
 		r4k_blast_scache_page_indexed = blast_scache16_page_indexed;
 	else if (sc_lsize == 32)
 		r4k_blast_scache_page_indexed = blast_scache32_page_indexed;

  reply	other threads:[~2006-01-19 21:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-19 19:24 Fix a CPU definition for Cobalt Martin Michlmayr
2006-01-19 21:04 ` Ralf Baechle [this message]
2006-01-19 21:45   ` Martin Michlmayr
2006-01-20 15:01     ` Ralf Baechle
2006-01-20 15:10       ` Martin Michlmayr
2006-01-20 15:19         ` Ralf Baechle
2006-01-20 16:00           ` Martin Michlmayr
2006-02-17 19:14     ` Martin Michlmayr

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=20060119210440.GE3398@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-mips@linux-mips.org \
    --cc=tbm@cyrius.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox