linux-mips
[Top] [All Lists]

[PATCH] MIPS: Fix for warning from FPU emulation code

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH] MIPS: Fix for warning from FPU emulation code
From: "Jayachandran C" <jchandra@broadcom.com>
Date: Tue, 14 Aug 2012 21:33:40 +0530
Cc: "Jayachandran C" <jchandra@broadcom.com>
In-reply-to: <20120814133858.GA30856@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <20120814133858.GA30856@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
The default implementation of 'cpu_has_fpu' macro calls
smp_processor_id() which causes this warning to be printed when
preemption is enabled:

[    4.664000] Algorithmics/MIPS FPU Emulator v1.5
[    4.676000] BUG: using smp_processor_id() in preemptible [00000000] code: ini
[    4.700000] caller is fpu_emulator_cop1Handler+0x434/0x27b8

Use 'raw_cpu_has_fpu' macro in cop1_64bit() instead of 'cpu_has_fpu'
to fix this. Fix suggested by Ralf Baechle <ralf@linux-mips.org>

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
---
 arch/mips/math-emu/cp1emu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index a03bf00..663bfb9 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -178,7 +178,7 @@ static int isBranchInstr(mips_instruction * i)
  */
 static inline int cop1_64bit(struct pt_regs *xcp)
 {
-       if (cpu_has_fpu)
+       if (raw_cpu_has_fpu)
                return xcp->cp0_status & ST0_FR;
 #ifdef CONFIG_64BIT
        return !test_thread_flag(TIF_32BIT_REGS);
-- 
1.7.9.5



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