linux-mips
[Top] [All Lists]

Re: [PATCH] mm/pg-r4k.c: Fix a typo in an R4600 v2 erratum workaround

To: "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: [PATCH] mm/pg-r4k.c: Fix a typo in an R4600 v2 erratum workaround
From: Ralf Baechle <ralf@linux-mips.org>
Date: Wed, 3 Oct 2007 01:04:25 +0100
Cc: Thiemo Seufer <ths@networkno.de>, linux-mips@linux-mips.org
In-reply-to: <Pine.LNX.4.64N.0710021435200.32726@blysk.ds.pg.gda.pl>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.64N.0710021435200.32726@blysk.ds.pg.gda.pl>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.14 (2007-02-12)
On Tue, Oct 02, 2007 at 02:47:22PM +0100, Maciej W. Rozycki wrote:

>  Restore a load from KSEG1 done as a workaround for an R4600 v2 
> erratum, dropped with 211be16de99a7424e66c0b6c0d00e2c970508ac2.
> 
> Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
> ---
> Thiemo,
> 
>  It reverts your change of Sep 1st, 2005; given the way the code is 
> written, I am assuming the change was accidental, correct?  At the moment 
> the load never happens.

But it should ...  So this seems to be the right thing, no?

  Ralf

diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c
index dc795be..66921fb 100644
--- a/arch/mips/mm/pg-r4k.c
+++ b/arch/mips/mm/pg-r4k.c
@@ -208,8 +208,10 @@ static inline void build_cdex_p(void)
                build_nop();
        }
 
-       if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
+       if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) {
                build_insn_word(0x3c01a000);    /* lui     $at, 0xa000  */
+               build_insn_word(0x8c200000);    /* lw      $zero, ($at) */
+       }
 
        mi.c_format.opcode     = cache_op;
        mi.c_format.rs         = 4;             /* $a0 */
@@ -390,8 +392,10 @@ void __init build_clear_page(void)
        } else
                build_addiu_a2_a0(off);
 
-       if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
+       if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) {
                build_insn_word(0x3c01a000);    /* lui     $at, 0xa000  */
+               build_insn_word(0x8c200000);    /* lw      $zero, ($at) */
+       }
 
 dest = label();
        do {
@@ -452,8 +456,10 @@ void __init build_copy_page(void)
        } else
                build_addiu_a2_a0(off);
 
-       if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
+       if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) {
                build_insn_word(0x3c01a000);    /* lui     $at, 0xa000  */
+               build_insn_word(0x8c200000);    /* lw      $zero, ($at) */
+       }
 
 dest = label();
        loop_start = store_offset;

<Prev in Thread] Current Thread [Next in Thread>