linux-mips
[Top] [All Lists]

Re: O2 RM7000 Issues

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: O2 RM7000 Issues
From: David Daney <ddaney@avtrex.com>
Date: Mon, 17 Sep 2007 16:20:28 -0700
Cc: Sergey Rogozhkin <rogozhkin@niisi.msk.ru>, Linux MIPS List <linux-mips@linux-mips.org>, "Gleb O. Raiko" <raiko@niisi.msk.ru>, Kumba <kumba@gentoo.org>
In-reply-to: <20070717122711.GA19977@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <4687DCE2.8070302@gentoo.org> <468825BE.6090001@gmx.net> <50451.70.107.91.207.1183381723.squirrel@webmail.wesleyan.edu> <20070704152729.GA2925@linux-mips.org> <20070704192208.GA7873@linux-mips.org> <469C8600.7090208@niisi.msk.ru> <20070717122711.GA19977@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 1.5.0.12 (X11/20070719)
Ralf Baechle wrote:

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index f599e79..7ee0cb0 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -75,6 +75,26 @@ static void r4k_wait_irqoff(void)
        local_irq_enable();
 }
+/*
+ * The RM7000 variant has to handle erratum 38.  The workaround is to not
+ * have any pending stores when the WAIT instruction is executed.
+ */
+static void rm7k_wait_irqoff(void)
+{
+       local_irq_disable();
+       if (!need_resched())
+               __asm__(
+               "  .set    push            \n"
+               "  .set    mips3           \n"
+               "  .set    noat            \n"
+               "  mfc0    $1, $12         \n"
+               "  sync                    \n"
+               "  mtc0    $1, $12         \n"
+               "  wait                    \n"
+               "  .set    pop             \n");
+       local_irq_enable();
+}
+

Technically, Shouldn't that __asm__ be volatile?

David Daney

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