Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Make DIEI support as a config option

DI(Disable Interrupt) and EI(Enable Interrupt) instructions is required by
MIPSR2/MIPSR6, however, it appears to be buggy on some processors such as
Loongson-3A1000. Thus we make it as a config option to allow disable it at
compile time with CPU_MIPSR2 selected.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: chenhc@lemote.com
Cc: paul.burton@mips.com
Cc: linux-kernel@vger.kernel.org

authored by

Jiaxun Yang and committed by
Paul Burton
ba9196d2 636e9d23

+14 -5
+9
arch/mips/Kconfig
··· 2084 2084 bool 2085 2085 default y if CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_CAVIUM_OCTEON 2086 2086 select CPU_HAS_RIXI 2087 + select CPU_HAS_DIEI if !CPU_DIEI_BROKEN 2087 2088 select MIPS_SPRAM 2088 2089 2089 2090 config CPU_MIPSR6 2090 2091 bool 2091 2092 default y if CPU_MIPS32_R6 || CPU_MIPS64_R6 2092 2093 select CPU_HAS_RIXI 2094 + select CPU_HAS_DIEI if !CPU_DIEI_BROKEN 2093 2095 select HAVE_ARCH_BITREVERSE 2094 2096 select MIPS_ASID_BITS_VARIABLE 2095 2097 select MIPS_CRC_SUPPORT ··· 2549 2547 bool 2550 2548 2551 2549 config XKS01 2550 + bool 2551 + 2552 + config CPU_HAS_DIEI 2553 + depends on !CPU_DIEI_BROKEN 2554 + bool 2555 + 2556 + config CPU_DIEI_BROKEN 2552 2557 bool 2553 2558 2554 2559 config CPU_HAS_RIXI
+3 -3
arch/mips/include/asm/irqflags.h
··· 18 18 #include <asm/compiler.h> 19 19 #include <asm/hazards.h> 20 20 21 - #if defined(CONFIG_CPU_MIPSR2) || defined (CONFIG_CPU_MIPSR6) 21 + #if defined(CONFIG_CPU_HAS_DIEI) 22 22 23 23 static inline void arch_local_irq_disable(void) 24 24 { ··· 94 94 void arch_local_irq_disable(void); 95 95 unsigned long arch_local_irq_save(void); 96 96 void arch_local_irq_restore(unsigned long flags); 97 - #endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */ 97 + #endif /* CONFIG_CPU_HAS_DIEI */ 98 98 99 99 static inline void arch_local_irq_enable(void) 100 100 { ··· 102 102 " .set push \n" 103 103 " .set reorder \n" 104 104 " .set noat \n" 105 - #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) 105 + #if defined(CONFIG_CPU_HAS_DIEI) 106 106 " ei \n" 107 107 #else 108 108 " mfc0 $1,$12 \n"
+2 -2
arch/mips/lib/mips-atomic.c
··· 15 15 #include <linux/export.h> 16 16 #include <linux/stringify.h> 17 17 18 - #if !defined(CONFIG_CPU_MIPSR2) && !defined(CONFIG_CPU_MIPSR6) 18 + #if !defined(CONFIG_CPU_HAS_DIEI) 19 19 20 20 /* 21 21 * For cli() we have to insert nops to make sure that the new value ··· 110 110 } 111 111 EXPORT_SYMBOL(arch_local_irq_restore); 112 112 113 - #endif /* !CONFIG_CPU_MIPSR2 && !CONFIG_CPU_MIPSR6 */ 113 + #endif /* !CONFIG_CPU_HAS_DIEI */