linux-mips
[Top] [All Lists]

[PATCH 1/2] MIPS: Netlogic: define cpu_has_fpu macro

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 1/2] MIPS: Netlogic: define cpu_has_fpu macro
From: "Jayachandran C" <jchandra@broadcom.com>
Date: Tue, 14 Aug 2012 17:00:12 +0530
Cc: "Jayachandran C" <jayachandranc@netlogicmicro.com>, "Jayachandran C" <jchandra@broadcom.com>
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>
Sender: linux-mips-bounce@linux-mips.org
From: Jayachandran C <jayachandranc@netlogicmicro.com>

The default implementation of 'cpu_has_fpu' macro uses calls
smp_processor_id() which causes this warning when preemption
is enabled:

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

Work around this by defining cpu_has_fpu for XLR and XLP in
mach-netlogic/cpu-feature-overrides.h

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
---
 .../asm/mach-netlogic/cpu-feature-overrides.h      |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h 
b/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
index 966db4b..4f5907f 100644
--- a/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
@@ -44,10 +44,12 @@
 #define cpu_has_dc_aliases     0
 #define cpu_has_mips32r2       0
 #define cpu_has_mips64r2       0
+#define cpu_has_fpu            0
 #elif defined(CONFIG_CPU_XLP)
 #define cpu_has_userlocal      1
 #define cpu_has_mips32r2       1
 #define cpu_has_mips64r2       1
+#define cpu_has_fpu            1
 #else
 #error "Unknown Netlogic CPU"
 #endif
-- 
1.7.9.5



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