Skip to content

Commit 3868507

Browse files
geertugregkh
authored andcommitted
m68k: Fix invalid RMW_INSNS on CPUs that lack CAS
[ Upstream commit 2189e92 ] 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: 0e152d8 ("m68k: reorganize Kconfig options to improve mmu/non-mmu selections") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20210725104413.318932-1-geert@linux-m68k.org Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 497f3d9 commit 3868507

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎arch/m68k/Kconfig.cpu‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ config COLDFIRE
2525
bool "Coldfire CPU family support"
2626
select ARCH_HAVE_CUSTOM_GPIO_H
2727
select CPU_HAS_NO_BITFIELDS
28+
select CPU_HAS_NO_CAS
2829
select CPU_HAS_NO_MULDIV64
2930
select GENERIC_CSUM
3031
select GPIOLIB
@@ -38,6 +39,7 @@ config M68000
3839
bool "MC68000"
3940
depends on !MMU
4041
select CPU_HAS_NO_BITFIELDS
42+
select CPU_HAS_NO_CAS
4143
select CPU_HAS_NO_MULDIV64
4244
select CPU_HAS_NO_UNALIGNED
4345
select GENERIC_CSUM
@@ -53,6 +55,7 @@ config M68000
5355
config MCPU32
5456
bool
5557
select CPU_HAS_NO_BITFIELDS
58+
select CPU_HAS_NO_CAS
5659
select CPU_HAS_NO_UNALIGNED
5760
select CPU_NO_EFFICIENT_FFS
5861
help
@@ -357,7 +360,7 @@ config ADVANCED
357360

358361
config RMW_INSNS
359362
bool "Use read-modify-write instructions"
360-
depends on ADVANCED
363+
depends on ADVANCED && !CPU_HAS_NO_CAS
361364
help
362365
This allows to use certain instructions that work with indivisible
363366
read-modify-write bus cycles. While this is faster than the
@@ -411,6 +414,9 @@ config NODES_SHIFT
411414
config CPU_HAS_NO_BITFIELDS
412415
bool
413416

417+
config CPU_HAS_NO_CAS
418+
bool
419+
414420
config CPU_HAS_NO_MULDIV64
415421
bool
416422

0 commit comments

Comments
 (0)