提交 c4506e13 编写于 作者: G Geert Uytterhoeven 提交者: Zheng Zengkai

m68k: Fix invalid RMW_INSNS on CPUs that lack CAS

stable inclusion
from stable-5.10.65
commit 3868507181534fee3d8d03130f40f579e52cd0a7
bugzilla: 182361 https://gitee.com/openeuler/kernel/issues/I4EH3U

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3868507181534fee3d8d03130f40f579e52cd0a7

--------------------------------

[ Upstream commit 2189e928 ]

When enabling CONFIG_RMW_INSNS in e.g. a Coldfire build:

    {standard input}:3068: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `casl %d4,%d0,(%a6)' ignored

Fix this by (a) adding a new config symbol to track if support for any
CPU that lacks the CAS instruction is enabled, and (b) making
CONFIG_RMW_INSNS depend on the new symbol not being set.

Fixes: 0e152d80 ("m68k: reorganize Kconfig options to improve mmu/non-mmu selections")
Reported-by: Nkernel test robot <lkp@intel.com>
Reported-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
Acked-by: NArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210725104413.318932-1-geert@linux-m68k.orgSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 f208e0a4
......@@ -25,6 +25,7 @@ config COLDFIRE
bool "Coldfire CPU family support"
select ARCH_HAVE_CUSTOM_GPIO_H
select CPU_HAS_NO_BITFIELDS
select CPU_HAS_NO_CAS
select CPU_HAS_NO_MULDIV64
select GENERIC_CSUM
select GPIOLIB
......@@ -38,6 +39,7 @@ config M68000
bool "MC68000"
depends on !MMU
select CPU_HAS_NO_BITFIELDS
select CPU_HAS_NO_CAS
select CPU_HAS_NO_MULDIV64
select CPU_HAS_NO_UNALIGNED
select GENERIC_CSUM
......@@ -53,6 +55,7 @@ config M68000
config MCPU32
bool
select CPU_HAS_NO_BITFIELDS
select CPU_HAS_NO_CAS
select CPU_HAS_NO_UNALIGNED
select CPU_NO_EFFICIENT_FFS
help
......@@ -357,7 +360,7 @@ config ADVANCED
config RMW_INSNS
bool "Use read-modify-write instructions"
depends on ADVANCED
depends on ADVANCED && !CPU_HAS_NO_CAS
help
This allows to use certain instructions that work with indivisible
read-modify-write bus cycles. While this is faster than the
......@@ -411,6 +414,9 @@ config NODES_SHIFT
config CPU_HAS_NO_BITFIELDS
bool
config CPU_HAS_NO_CAS
bool
config CPU_HAS_NO_MULDIV64
bool
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册