linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7 v4] sh: various doc, build, init fixes
@ 2023-03-06  4:00 Randy Dunlap
  2023-03-06  4:00 ` [PATCH 1/7 v4] sh: SH2007: drop the bad URL info Randy Dunlap
                   ` (9 more replies)
  0 siblings, 10 replies; 29+ messages in thread
From: Randy Dunlap @ 2023-03-06  4:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, John Paul Adrian Glaubitz, Yoshinori Sato,
	Rich Felker, Geert Uytterhoeven, Hitoshi Mitake, linux-sh,
	Frank Rowand, devicetree, Arnd Bergmann

All of these patches have been sent previously, anywhere from
one to 3 times.  All patches are now called "v4".

This refresh/resend is to assist the new SH maintainer.

 [PATCH 1/7 v4] sh: SH2007: drop the bad URL info
 [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler
 [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init
 [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning
 [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
 [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
 [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled

diffstat:
 Documentation/kbuild/kbuild.rst                           |    1 -
 Documentation/scheduler/sched-arch.rst                    |    2 --
 Documentation/translations/zh_CN/scheduler/sched-arch.rst |    2 --
 arch/sh/Kconfig                                           |    4 ++++
 arch/sh/Kconfig.debug                                     |    2 +-
 arch/sh/boards/Kconfig                                    |    1 -
 arch/sh/kernel/head_32.S                                  |    6 +++---
 arch/sh/kernel/nmi_debug.c                                |    4 ++--
 arch/sh/kernel/setup.c                                    |    4 ++--
 arch/sh/math-emu/sfp-util.h                               |    4 ----
 scripts/checkstack.pl                                     |    7 -------
 tools/perf/arch/common.c                                  |    2 --
 tools/scripts/Makefile.arch                               |    5 -----
 tools/testing/selftests/mm/Makefile                       |    2 +-
 tools/testing/selftests/mm/run_vmtests.sh                 |    2 +-
 15 files changed, 14 insertions(+), 34 deletions(-)

Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: linux-sh@vger.kernel.org
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 1/7 v4] sh: SH2007: drop the bad URL info
  2023-03-06  4:00 [PATCH 0/7 v4] sh: various doc, build, init fixes Randy Dunlap
@ 2023-03-06  4:00 ` Randy Dunlap
  2023-03-19 19:22   ` John Paul Adrian Glaubitz
  2023-03-06  4:00 ` [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler Randy Dunlap
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: Randy Dunlap @ 2023-03-06  4:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, John Paul Adrian Glaubitz, Yoshinori Sato,
	Rich Felker, Geert Uytterhoeven, Hitoshi Mitake, linux-sh

This URL provided is no longer functional, so drop it.

Fixes: 3a598264436e ("sh: SH-2007 board support.")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: linux-sh@vger.kernel.org
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2: skipped
v3: skipped
v4: refresh/rebase and resend

 arch/sh/boards/Kconfig |    1 -
 1 file changed, 1 deletion(-)

diff -- a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -358,7 +358,6 @@ config SH_SH2007
 	  intended for embedded applications.
 	  It has an Ethernet interface (SMC9118), direct connected
 	  Compact Flash socket, two serial ports and PC-104 bus.
-	  More information at <http://sh2000.sh-linux.org>.
 
 config SH_APSH4A3A
 	bool "AP-SH4A-3A"

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler
  2023-03-06  4:00 [PATCH 0/7 v4] sh: various doc, build, init fixes Randy Dunlap
  2023-03-06  4:00 ` [PATCH 1/7 v4] sh: SH2007: drop the bad URL info Randy Dunlap
@ 2023-03-06  4:00 ` Randy Dunlap
  2023-03-19 19:32   ` John Paul Adrian Glaubitz
  2023-03-06  4:00 ` [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init Randy Dunlap
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: Randy Dunlap @ 2023-03-06  4:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Igor Zhbanov, John Paul Adrian Glaubitz,
	Yoshinori Sato, Rich Felker, linux-sh, stable

__setup() handlers should return 1 to obsolete_checksetup() in
init/main.c to indicate that the boot option has been handled.
A return of 0 causes the boot option/value to be listed as an Unknown
kernel parameter and added to init's (limited) argument or environment
strings. Also, error return codes don't mean anything to
obsolete_checksetup() -- only non-zero (usually 1) or zero.
So return 1 from nmi_debug_setup().

Fixes: 1e1030dccb10 ("sh: nmi_debug support.")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Igor Zhbanov <izh1979@gmail.com>
Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Cc: stable@vger.kernel.org
---
v2: add more Cc's;
    refresh and resend;
v3: add Arnd to Cc: list
v4: update Cc: list, refresh & resend

 arch/sh/kernel/nmi_debug.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -- a/arch/sh/kernel/nmi_debug.c b/arch/sh/kernel/nmi_debug.c
--- a/arch/sh/kernel/nmi_debug.c
+++ b/arch/sh/kernel/nmi_debug.c
@@ -49,7 +49,7 @@ static int __init nmi_debug_setup(char *
 	register_die_notifier(&nmi_debug_nb);
 
 	if (*str != '=')
-		return 0;
+		return 1;
 
 	for (p = str + 1; *p; p = sep + 1) {
 		sep = strchr(p, ',');
@@ -70,6 +70,6 @@ static int __init nmi_debug_setup(char *
 			break;
 	}
 
-	return 0;
+	return 1;
 }
 __setup("nmi_debug", nmi_debug_setup);

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init
  2023-03-06  4:00 [PATCH 0/7 v4] sh: various doc, build, init fixes Randy Dunlap
  2023-03-06  4:00 ` [PATCH 1/7 v4] sh: SH2007: drop the bad URL info Randy Dunlap
  2023-03-06  4:00 ` [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler Randy Dunlap
@ 2023-03-06  4:00 ` Randy Dunlap
  2023-03-19 19:48   ` John Paul Adrian Glaubitz
  2023-03-06  4:00 ` [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning Randy Dunlap
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: Randy Dunlap @ 2023-03-06  4:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Rob Herring, Frank Rowand, devicetree, Rich Felker,
	Yoshinori Sato, Geert Uytterhoeven, John Paul Adrian Glaubitz,
	linux-sh, stable

When CONFIG_OF_EARLY_FLATTREE and CONFIG_SH_DEVICE_TREE are not set,
SH3 build fails with a call to early_init_dt_scan(), so in
arch/sh/kernel/setup.c and arch/sh/kernel/head_32.S, use
CONFIG_OF_EARLY_FLATTREE instead of CONFIG_OF_FLATTREE.

Fixes this build error:
../arch/sh/kernel/setup.c: In function 'sh_fdt_init':
../arch/sh/kernel/setup.c:262:26: error: implicit declaration of function 'early_init_dt_scan' [-Werror=implicit-function-declaration]
  262 |         if (!dt_virt || !early_init_dt_scan(dt_virt)) {

Fixes: 03767daa1387 ("sh: fix build regression with CONFIG_OF && !CONFIG_OF_FLATTREE")
Fixes: eb6b6930a70f ("sh: fix memory corruption of unflattened device tree")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Suggested-by: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: linux-sh@vger.kernel.org
Cc: stable@vger.kernel.org
---
v2: use Suggested-by: for Rob.
    add more Cc's.
v3: skipped
v4: update Cc's, refresh & resend

 arch/sh/kernel/head_32.S |    6 +++---
 arch/sh/kernel/setup.c   |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff arch/sh/kernel/setup.c arch/sh/kernel/setup.c
diff -- a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -244,7 +244,7 @@ void __init __weak plat_early_device_set
 {
 }
 
-#ifdef CONFIG_OF_FLATTREE
+#ifdef CONFIG_OF_EARLY_FLATTREE
 void __ref sh_fdt_init(phys_addr_t dt_phys)
 {
 	static int done = 0;
@@ -326,7 +326,7 @@ void __init setup_arch(char **cmdline_p)
 	/* Let earlyprintk output early console messages */
 	sh_early_platform_driver_probe("earlyprintk", 1, 1);
 
-#ifdef CONFIG_OF_FLATTREE
+#ifdef CONFIG_OF_EARLY_FLATTREE
 #ifdef CONFIG_USE_BUILTIN_DTB
 	unflatten_and_copy_device_tree();
 #else
diff -- a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
--- a/arch/sh/kernel/head_32.S
+++ b/arch/sh/kernel/head_32.S
@@ -64,7 +64,7 @@ ENTRY(_stext)
 	ldc	r0, r6_bank
 #endif
 
-#ifdef CONFIG_OF_FLATTREE
+#ifdef CONFIG_OF_EARLY_FLATTREE
 	mov	r4, r12		! Store device tree blob pointer in r12
 #endif
 	
@@ -315,7 +315,7 @@ ENTRY(_stext)
 10:		
 #endif
 
-#ifdef CONFIG_OF_FLATTREE
+#ifdef CONFIG_OF_EARLY_FLATTREE
 	mov.l	8f, r0		! Make flat device tree available early.
 	jsr	@r0
 	 mov	r12, r4
@@ -346,7 +346,7 @@ ENTRY(stack_start)
 5:	.long	start_kernel
 6:	.long	cpu_init
 7:	.long	init_thread_union
-#if defined(CONFIG_OF_FLATTREE)
+#if defined(CONFIG_OF_EARLY_FLATTREE)
 8:	.long	sh_fdt_init
 #endif
 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning
  2023-03-06  4:00 [PATCH 0/7 v4] sh: various doc, build, init fixes Randy Dunlap
                   ` (2 preceding siblings ...)
  2023-03-06  4:00 ` [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init Randy Dunlap
@ 2023-03-06  4:00 ` Randy Dunlap
  2023-03-19 19:49   ` John Paul Adrian Glaubitz
  2023-03-06  4:00 ` [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments Randy Dunlap
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: Randy Dunlap @ 2023-03-06  4:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, kernel test robot, John Paul Adrian Glaubitz,
	Yoshinori Sato, Rich Felker, linux-sh, Geert Uytterhoeven,
	stable

Fix a warning that was reported by the kernel test robot:

In file included from ../include/math-emu/soft-fp.h:27,
                 from ../arch/sh/math-emu/math.c:22:
../arch/sh/include/asm/sfp-machine.h:17: warning: "__BYTE_ORDER" redefined
   17 | #define __BYTE_ORDER __BIG_ENDIAN
In file included from ../arch/sh/math-emu/math.c:21:
../arch/sh/math-emu/sfp-util.h:71: note: this is the location of the previous definition
   71 | #define __BYTE_ORDER __LITTLE_ENDIAN

Fixes: b929926f01f2 ("sh: define __BIG_ENDIAN for math-emu")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Link: lore.kernel.org/r/202111121827.6v6SXtVv-lkp@intel.com
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: stable@vger.kernel.org
---
v2: add Reviewed-by Geert,
    rebase to linux-next-20211115
v3: skipped
v4: refresh & resend

 arch/sh/math-emu/sfp-util.h |    4 ----
 1 file changed, 4 deletions(-)

diff -- a/arch/sh/math-emu/sfp-util.h b/arch/sh/math-emu/sfp-util.h
--- a/arch/sh/math-emu/sfp-util.h
+++ b/arch/sh/math-emu/sfp-util.h
@@ -67,7 +67,3 @@
   } while (0)
 
 #define abort()	return 0
-
-#define __BYTE_ORDER __LITTLE_ENDIAN
-
-

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
  2023-03-06  4:00 [PATCH 0/7 v4] sh: various doc, build, init fixes Randy Dunlap
                   ` (3 preceding siblings ...)
  2023-03-06  4:00 ` [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning Randy Dunlap
@ 2023-03-06  4:00 ` Randy Dunlap
  2023-03-16 13:23   ` John Paul Adrian Glaubitz
  2023-03-19 19:50   ` John Paul Adrian Glaubitz
  2023-03-06  4:00 ` [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP Randy Dunlap
                   ` (4 subsequent siblings)
  9 siblings, 2 replies; 29+ messages in thread
From: Randy Dunlap @ 2023-03-06  4:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Geert Uytterhoeven, Arnd Bergmann, Rich Felker,
	Yoshinori Sato, John Paul Adrian Glaubitz, linux-sh

A previous patch removed most of the sh5 (sh64) support from the
kernel tree. Now remove the last stragglers.

Fixes: 37744feebc08 ("sh: remove sh5 support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: linux-sh@vger.kernel.org
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
---
v2: update after adding the parisc64 alias to kbuild.rst
v3: skipped
v4: refresh & resend

 Documentation/kbuild/kbuild.rst                           |    1 -
 Documentation/scheduler/sched-arch.rst                    |    2 --
 Documentation/translations/zh_CN/scheduler/sched-arch.rst |    2 --
 scripts/checkstack.pl                                     |    7 -------
 tools/perf/arch/common.c                                  |    2 --
 tools/scripts/Makefile.arch                               |    5 -----
 tools/testing/selftests/mm/Makefile                       |    2 +-
 tools/testing/selftests/mm/run_vmtests.sh                 |    2 +-
 8 files changed, 2 insertions(+), 21 deletions(-)

diff -- a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
--- a/Documentation/kbuild/kbuild.rst
+++ b/Documentation/kbuild/kbuild.rst
@@ -161,7 +161,6 @@ But some architectures such as x86 and s
 
 - x86: i386 for 32 bit, x86_64 for 64 bit
 - parisc: parisc64 for 64 bit
-- sh: sh for 32 bit, sh64 for 64 bit
 - sparc: sparc32 for 32 bit, sparc64 for 64 bit
 
 CROSS_COMPILE
diff -- a/Documentation/scheduler/sched-arch.rst b/Documentation/scheduler/sched-arch.rst
--- a/Documentation/scheduler/sched-arch.rst
+++ b/Documentation/scheduler/sched-arch.rst
@@ -70,7 +70,5 @@ Possible arch problems I found (and eith
 
 ia64 - is safe_halt call racy vs interrupts? (does it sleep?) (See #4a)
 
-sh64 - Is sleeping racy vs interrupts? (See #4a)
-
 sparc - IRQs on at this point(?), change local_irq_save to _disable.
       - TODO: needs secondary CPUs to disable preempt (See #1)
diff -- a/Documentation/translations/zh_CN/scheduler/sched-arch.rst b/Documentation/translations/zh_CN/scheduler/sched-arch.rst
--- a/Documentation/translations/zh_CN/scheduler/sched-arch.rst
+++ b/Documentation/translations/zh_CN/scheduler/sched-arch.rst
@@ -70,7 +70,5 @@ 我发现的可能的arch问题(并试
 
 ia64 - safe_halt的调用与中断相比,是否很荒谬? (它睡眠了吗) (参考 #4a)
 
-sh64 - 睡眠与中断相比,是否很荒谬? (参考 #4a)
-
 sparc - 在这一点上,IRQ是开着的(?),把local_irq_save改为_disable。
       - 待办事项: 需要第二个CPU来禁用抢占 (参考 #1)
diff -- a/scripts/checkstack.pl b/scripts/checkstack.pl
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -10,7 +10,6 @@
 #	Mips port by Juan Quintela <quintela@mandrakesoft.com>
 #	IA64 port via Andreas Dilger
 #	Arm port by Holger Schurig
-#	sh64 port by Paul Mundt
 #	Random bits by Matt Mackall <mpm@selenic.com>
 #	M68k port by Geert Uytterhoeven and Andreas Schwab
 #	AArch64, PARISC ports by Kyle McMartin
@@ -100,12 +99,6 @@ my (@stack, $re, $dre, $sub, $x, $xs, $f
 		#  100092:	 e3 f0 ff c8 ff 71	 lay	 %r15,-56(%r15)
 		$re = qr/.*(?:lay|ag?hi).*\%r15,-(([0-9]{2}|[3-9])[0-9]{2})
 		      (?:\(\%r15\))?$/ox;
-	} elsif ($arch =~ /^sh64$/) {
-		#XXX: we only check for the immediate case presently,
-		#     though we will want to check for the movi/sub
-		#     pair for larger users. -- PFM.
-		#a00048e0:       d4fc40f0        addi.l  r15,-240,r15
-		$re = qr/.*addi\.l.*r15,-(([0-9]{2}|[3-9])[0-9]{2}),r15/o;
 	} elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
 		# f0019d10:       9d e3 bf 90     save  %sp, -112, %sp
 		$re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
diff -- a/tools/perf/arch/common.c b/tools/perf/arch/common.c
--- a/tools/perf/arch/common.c
+++ b/tools/perf/arch/common.c
@@ -51,9 +51,7 @@ const char *const s390_triplets[] = {
 
 const char *const sh_triplets[] = {
 	"sh-unknown-linux-gnu-",
-	"sh64-unknown-linux-gnu-",
 	"sh-linux-gnu-",
-	"sh64-linux-gnu-",
 	NULL
 };
 
diff -- a/tools/scripts/Makefile.arch b/tools/scripts/Makefile.arch
--- a/tools/scripts/Makefile.arch
+++ b/tools/scripts/Makefile.arch
@@ -29,11 +29,6 @@ ifeq ($(ARCH),sparc64)
        SRCARCH := sparc
 endif
 
-# Additional ARCH settings for sh
-ifeq ($(ARCH),sh64)
-       SRCARCH := sh
-endif
-
 # Additional ARCH settings for loongarch
 ifeq ($(ARCH),loongarch32)
        SRCARCH := loongarch
diff -- a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
--- a/tools/testing/selftests/mm/Makefile
+++ b/tools/testing/selftests/mm/Makefile
@@ -90,7 +90,7 @@ endif
 
 endif
 
-ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64))
+ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sparc64 x86_64))
 TEST_GEN_FILES += va_128TBswitch
 TEST_GEN_FILES += virtual_address_range
 TEST_GEN_FILES += write_to_hugetlbfs
diff -- a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
--- a/tools/testing/selftests/mm/run_vmtests.sh
+++ b/tools/testing/selftests/mm/run_vmtests.sh
@@ -132,7 +132,7 @@ else
 fi
 
 # filter 64bit architectures
-ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sh64 sparc64 x86_64"
+ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sparc64 x86_64"
 if [ -z "$ARCH" ]; then
 	ARCH=$(uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/')
 fi

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
  2023-03-06  4:00 [PATCH 0/7 v4] sh: various doc, build, init fixes Randy Dunlap
                   ` (4 preceding siblings ...)
  2023-03-06  4:00 ` [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments Randy Dunlap
@ 2023-03-06  4:00 ` Randy Dunlap
  2023-03-19 20:20   ` John Paul Adrian Glaubitz
  2023-03-07 15:18 ` [PATCH 0/7 v4] sh: various doc, build, init fixes John Paul Adrian Glaubitz
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: Randy Dunlap @ 2023-03-06  4:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Geert Uytterhoeven, John Paul Adrian Glaubitz,
	Yoshinori Sato, Rich Felker, linux-sh, stable

Fix SUPERH builds that select SYS_SUPPORTS_NUMA but do not select
SYS_SUPPORTS_SMP and SMP.

kernel/sched/topology.c is only built for CONFIG_SMP and then the NUMA
code + data inside topology.c is only built when CONFIG_NUMA is
set/enabled, so these arch/sh/ configs need to select SMP and
SYS_SUPPORTS_SMP to build the NUMA support.

Fixes this build error in multiple SUPERH configs:

mm/page_alloc.o: In function `get_page_from_freelist':
page_alloc.c:(.text+0x2ca8): undefined reference to `node_reclaim_distance'

Fixes: 357d59469c11 ("sh: Tidy up dependencies for SH-2 build.")
Fixes: 9109a30e5a54 ("sh: add support for sh7366 processor")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Cc: stable@vger.kernel.org
---
v2: skipped
v3: skipped
v4: refresh & resend

 arch/sh/Kconfig |    4 ++++
 1 file changed, 4 insertions(+)

diff -- a/arch/sh/Kconfig b/arch/sh/Kconfig
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -477,6 +477,8 @@ config CPU_SUBTYPE_SH7722
 	select CPU_SHX2
 	select ARCH_SHMOBILE
 	select ARCH_SPARSEMEM_ENABLE
+	select SYS_SUPPORTS_SMP
+	select SMP
 	select SYS_SUPPORTS_NUMA
 	select SYS_SUPPORTS_SH_CMT
 	select PINCTRL
@@ -487,6 +489,8 @@ config CPU_SUBTYPE_SH7366
 	select CPU_SHX2
 	select ARCH_SHMOBILE
 	select ARCH_SPARSEMEM_ENABLE
+	select SYS_SUPPORTS_SMP
+	select SMP
 	select SYS_SUPPORTS_NUMA
 	select SYS_SUPPORTS_SH_CMT
 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 0/7 v4] sh: various doc, build, init fixes
  2023-03-06  4:00 [PATCH 0/7 v4] sh: various doc, build, init fixes Randy Dunlap
                   ` (5 preceding siblings ...)
  2023-03-06  4:00 ` [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP Randy Dunlap
@ 2023-03-07 15:18 ` John Paul Adrian Glaubitz
  2023-03-16 13:26 ` John Paul Adrian Glaubitz
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-07 15:18 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Yoshinori Sato, Rich Felker, Geert Uytterhoeven, Hitoshi Mitake,
	linux-sh, Frank Rowand, devicetree, Arnd Bergmann

Hi Randy!

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> All of these patches have been sent previously, anywhere from
> one to 3 times.  All patches are now called "v4".
> 
> This refresh/resend is to assist the new SH maintainer.
> 
>  [PATCH 1/7 v4] sh: SH2007: drop the bad URL info
>  [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler
>  [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init
>  [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning
>  [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
>  [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
>  [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
> 
> diffstat:
>  Documentation/kbuild/kbuild.rst                           |    1 -
>  Documentation/scheduler/sched-arch.rst                    |    2 --
>  Documentation/translations/zh_CN/scheduler/sched-arch.rst |    2 --
>  arch/sh/Kconfig                                           |    4 ++++
>  arch/sh/Kconfig.debug                                     |    2 +-
>  arch/sh/boards/Kconfig                                    |    1 -
>  arch/sh/kernel/head_32.S                                  |    6 +++---
>  arch/sh/kernel/nmi_debug.c                                |    4 ++--
>  arch/sh/kernel/setup.c                                    |    4 ++--
>  arch/sh/math-emu/sfp-util.h                               |    4 ----
>  scripts/checkstack.pl                                     |    7 -------
>  tools/perf/arch/common.c                                  |    2 --
>  tools/scripts/Makefile.arch                               |    5 -----
>  tools/testing/selftests/mm/Makefile                       |    2 +-
>  tools/testing/selftests/mm/run_vmtests.sh                 |    2 +-
>  15 files changed, 14 insertions(+), 34 deletions(-)
> 
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
> Cc: linux-sh@vger.kernel.org
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: devicetree@vger.kernel.org
> Cc: Arnd Bergmann <arnd@arndb.de>

Thanks for these fixes. All changes look good to me and I'm going to test
them on my SH-7785LCR board on top of 6.3-rc1 and report back. The documentation
changes obviously won't have any impact in this regard.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
  2023-03-06  4:00 ` [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments Randy Dunlap
@ 2023-03-16 13:23   ` John Paul Adrian Glaubitz
  2023-03-16 16:44     ` Randy Dunlap
  2023-03-19 19:50   ` John Paul Adrian Glaubitz
  1 sibling, 1 reply; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-16 13:23 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Geert Uytterhoeven, Arnd Bergmann, Rich Felker, Yoshinori Sato, linux-sh

Hi Randy!

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> A previous patch removed most of the sh5 (sh64) support from the
> kernel tree. Now remove the last stragglers.
> 
> Fixes: 37744feebc08 ("sh: remove sh5 support")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Rich Felker <dalias@libc.org>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: linux-sh@vger.kernel.org
> Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> ---
> v2: update after adding the parisc64 alias to kbuild.rst
> v3: skipped
> v4: refresh & resend
> 
>  Documentation/kbuild/kbuild.rst                           |    1 -
>  Documentation/scheduler/sched-arch.rst                    |    2 --
>  Documentation/translations/zh_CN/scheduler/sched-arch.rst |    2 --
>  scripts/checkstack.pl                                     |    7 -------
>  tools/perf/arch/common.c                                  |    2 --
>  tools/scripts/Makefile.arch                               |    5 -----
>  tools/testing/selftests/mm/Makefile                       |    2 +-
>  tools/testing/selftests/mm/run_vmtests.sh                 |    2 +-
>  8 files changed, 2 insertions(+), 21 deletions(-)
> 
> diff -- a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
> --- a/Documentation/kbuild/kbuild.rst
> +++ b/Documentation/kbuild/kbuild.rst
> @@ -161,7 +161,6 @@ But some architectures such as x86 and s
>  
>  - x86: i386 for 32 bit, x86_64 for 64 bit
>  - parisc: parisc64 for 64 bit
> -- sh: sh for 32 bit, sh64 for 64 bit
>  - sparc: sparc32 for 32 bit, sparc64 for 64 bit
>  
>  CROSS_COMPILE

This hunk doesn't apply anymore since the parisc part has been dropped although I can't
find the commit for that. Could you rebase your patch, please?

Apologies that I didn't have the time earlier to start looking at this series!

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 0/7 v4] sh: various doc, build, init fixes
  2023-03-06  4:00 [PATCH 0/7 v4] sh: various doc, build, init fixes Randy Dunlap
                   ` (6 preceding siblings ...)
  2023-03-07 15:18 ` [PATCH 0/7 v4] sh: various doc, build, init fixes John Paul Adrian Glaubitz
@ 2023-03-16 13:26 ` John Paul Adrian Glaubitz
       [not found] ` <20230306040037.20350-8-rdunlap@infradead.org>
  2023-03-23  9:41 ` [PATCH 0/7 v4] sh: various doc, build, init fixes John Paul Adrian Glaubitz
  9 siblings, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-16 13:26 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Yoshinori Sato, Rich Felker, Geert Uytterhoeven, Hitoshi Mitake,
	linux-sh, Frank Rowand, devicetree, Arnd Bergmann

Hi Randy!

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> All of these patches have been sent previously, anywhere from
> one to 3 times.  All patches are now called "v4".
> 
> This refresh/resend is to assist the new SH maintainer.
> 
>  [PATCH 1/7 v4] sh: SH2007: drop the bad URL info
>  [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler
>  [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init
>  [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning
>  [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
>  [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
>  [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled

I have successfully applied, built and booted all patches on my SH7785LCR evaluation
board except for patch #5.

I'll do the review next, then include them in my for-next tree for 6.4.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
  2023-03-16 13:23   ` John Paul Adrian Glaubitz
@ 2023-03-16 16:44     ` Randy Dunlap
  2023-03-16 16:52       ` John Paul Adrian Glaubitz
  0 siblings, 1 reply; 29+ messages in thread
From: Randy Dunlap @ 2023-03-16 16:44 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz, linux-kernel
  Cc: Geert Uytterhoeven, Arnd Bergmann, Rich Felker, Yoshinori Sato, linux-sh

Hi--

On 3/16/23 06:23, John Paul Adrian Glaubitz wrote:
> Hi Randy!
> 
> On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
>> A previous patch removed most of the sh5 (sh64) support from the
>> kernel tree. Now remove the last stragglers.
>>
>> Fixes: 37744feebc08 ("sh: remove sh5 support")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: Rich Felker <dalias@libc.org>
>> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
>> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>> Cc: linux-sh@vger.kernel.org
>> Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>> ---
>> v2: update after adding the parisc64 alias to kbuild.rst
>> v3: skipped
>> v4: refresh & resend
>>
>>  Documentation/kbuild/kbuild.rst                           |    1 -
>>  Documentation/scheduler/sched-arch.rst                    |    2 --
>>  Documentation/translations/zh_CN/scheduler/sched-arch.rst |    2 --
>>  scripts/checkstack.pl                                     |    7 -------
>>  tools/perf/arch/common.c                                  |    2 --
>>  tools/scripts/Makefile.arch                               |    5 -----
>>  tools/testing/selftests/mm/Makefile                       |    2 +-
>>  tools/testing/selftests/mm/run_vmtests.sh                 |    2 +-
>>  8 files changed, 2 insertions(+), 21 deletions(-)
>>
>> diff -- a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
>> --- a/Documentation/kbuild/kbuild.rst
>> +++ b/Documentation/kbuild/kbuild.rst
>> @@ -161,7 +161,6 @@ But some architectures such as x86 and s
>>  
>>  - x86: i386 for 32 bit, x86_64 for 64 bit
>>  - parisc: parisc64 for 64 bit
>> -- sh: sh for 32 bit, sh64 for 64 bit
>>  - sparc: sparc32 for 32 bit, sparc64 for 64 bit
>>  
>>  CROSS_COMPILE
> 
> This hunk doesn't apply anymore since the parisc part has been dropped although I can't
> find the commit for that. Could you rebase your patch, please?

The parisc part has not been dropped. It's in linux-next but not yet in mainline.
(commit 49deed336ef9a)

Do you want this patch to apply to mainline? (I created it in linux-next.)
I can do that in a few hours. I'm busy ATM.

I suppose there will be a merge conflict between parisc and SH.


> Apologies that I didn't have the time earlier to start looking at this series!

No problem. We'll get there.  Thanks.

-- 
~Randy

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
  2023-03-16 16:44     ` Randy Dunlap
@ 2023-03-16 16:52       ` John Paul Adrian Glaubitz
  2023-03-16 20:43         ` Randy Dunlap
  0 siblings, 1 reply; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-16 16:52 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Geert Uytterhoeven, Arnd Bergmann, Rich Felker,
	Yoshinori Sato, linux-sh



> On Mar 16, 2023, at 5:45 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> 
> Hi--
> 
>> On 3/16/23 06:23, John Paul Adrian Glaubitz wrote:
>> Hi Randy!
>> 
>>> On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
>>> A previous patch removed most of the sh5 (sh64) support from the
>>> kernel tree. Now remove the last stragglers.
>>> 
>>> Fixes: 37744feebc08 ("sh: remove sh5 support")
>>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>>> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
>>> Cc: Arnd Bergmann <arnd@arndb.de>
>>> Cc: Rich Felker <dalias@libc.org>
>>> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
>>> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>>> Cc: linux-sh@vger.kernel.org
>>> Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>>> ---
>>> v2: update after adding the parisc64 alias to kbuild.rst
>>> v3: skipped
>>> v4: refresh & resend
>>> 
>>> Documentation/kbuild/kbuild.rst                           |    1 -
>>> Documentation/scheduler/sched-arch.rst                    |    2 --
>>> Documentation/translations/zh_CN/scheduler/sched-arch.rst |    2 --
>>> scripts/checkstack.pl                                     |    7 -------
>>> tools/perf/arch/common.c                                  |    2 --
>>> tools/scripts/Makefile.arch                               |    5 -----
>>> tools/testing/selftests/mm/Makefile                       |    2 +-
>>> tools/testing/selftests/mm/run_vmtests.sh                 |    2 +-
>>> 8 files changed, 2 insertions(+), 21 deletions(-)
>>> 
>>> diff -- a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
>>> --- a/Documentation/kbuild/kbuild.rst
>>> +++ b/Documentation/kbuild/kbuild.rst
>>> @@ -161,7 +161,6 @@ But some architectures such as x86 and s
>>> 
>>> - x86: i386 for 32 bit, x86_64 for 64 bit
>>> - parisc: parisc64 for 64 bit
>>> -- sh: sh for 32 bit, sh64 for 64 bit
>>> - sparc: sparc32 for 32 bit, sparc64 for 64 bit
>>> 
>>> CROSS_COMPILE
>> 
>> This hunk doesn't apply anymore since the parisc part has been dropped although I can't
>> find the commit for that. Could you rebase your patch, please?
> 
> The parisc part has not been dropped. It's in linux-next but not yet in mainline.
> (commit 49deed336ef9a)
> 
> Do you want this patch to apply to mainline? (I created it in linux-next.)
> I can do that in a few hours. I'm busy ATM.
> 
> I suppose there will be a merge conflict between parisc and SH.

Oops, sorry. My bad. I will use the proper tree.

Adrian

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
  2023-03-16 16:52       ` John Paul Adrian Glaubitz
@ 2023-03-16 20:43         ` Randy Dunlap
  2023-03-16 20:46           ` John Paul Adrian Glaubitz
  0 siblings, 1 reply; 29+ messages in thread
From: Randy Dunlap @ 2023-03-16 20:43 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: linux-kernel, Geert Uytterhoeven, Arnd Bergmann, Rich Felker,
	Yoshinori Sato, linux-sh



On 3/16/23 09:52, John Paul Adrian Glaubitz wrote:
> 
> 
>> On Mar 16, 2023, at 5:45 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> Hi--
>>
>>> On 3/16/23 06:23, John Paul Adrian Glaubitz wrote:
>>> Hi Randy!
>>>
>>>> On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
>>>> A previous patch removed most of the sh5 (sh64) support from the
>>>> kernel tree. Now remove the last stragglers.
>>>>
>>>> Fixes: 37744feebc08 ("sh: remove sh5 support")
>>>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>>>> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
>>>> Cc: Arnd Bergmann <arnd@arndb.de>
>>>> Cc: Rich Felker <dalias@libc.org>
>>>> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
>>>> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>>>> Cc: linux-sh@vger.kernel.org
>>>> Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>>>> ---
>>>> v2: update after adding the parisc64 alias to kbuild.rst
>>>> v3: skipped
>>>> v4: refresh & resend
>>>>
>>>> Documentation/kbuild/kbuild.rst                           |    1 -
>>>> Documentation/scheduler/sched-arch.rst                    |    2 --
>>>> Documentation/translations/zh_CN/scheduler/sched-arch.rst |    2 --
>>>> scripts/checkstack.pl                                     |    7 -------
>>>> tools/perf/arch/common.c                                  |    2 --
>>>> tools/scripts/Makefile.arch                               |    5 -----
>>>> tools/testing/selftests/mm/Makefile                       |    2 +-
>>>> tools/testing/selftests/mm/run_vmtests.sh                 |    2 +-
>>>> 8 files changed, 2 insertions(+), 21 deletions(-)
>>>>
>>>> diff -- a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
>>>> --- a/Documentation/kbuild/kbuild.rst
>>>> +++ b/Documentation/kbuild/kbuild.rst
>>>> @@ -161,7 +161,6 @@ But some architectures such as x86 and s
>>>>
>>>> - x86: i386 for 32 bit, x86_64 for 64 bit
>>>> - parisc: parisc64 for 64 bit
>>>> -- sh: sh for 32 bit, sh64 for 64 bit
>>>> - sparc: sparc32 for 32 bit, sparc64 for 64 bit
>>>>
>>>> CROSS_COMPILE
>>>
>>> This hunk doesn't apply anymore since the parisc part has been dropped although I can't
>>> find the commit for that. Could you rebase your patch, please?
>>
>> The parisc part has not been dropped. It's in linux-next but not yet in mainline.
>> (commit 49deed336ef9a)
>>
>> Do you want this patch to apply to mainline? (I created it in linux-next.)
>> I can do that in a few hours. I'm busy ATM.
>>
>> I suppose there will be a merge conflict between parisc and SH.
> 
> Oops, sorry. My bad. I will use the proper tree.

Just let me know if you want me to resend it.
Thanks.

-- 
~Randy

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
  2023-03-16 20:43         ` Randy Dunlap
@ 2023-03-16 20:46           ` John Paul Adrian Glaubitz
  2023-03-17  7:31             ` Geert Uytterhoeven
  0 siblings, 1 reply; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-16 20:46 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Geert Uytterhoeven, Arnd Bergmann, Rich Felker,
	Yoshinori Sato, linux-sh

Hi Randy!

On Thu, 2023-03-16 at 13:43 -0700, Randy Dunlap wrote:
> > Oops, sorry. My bad. I will use the proper tree.
> 
> Just let me know if you want me to resend it.
> Thanks.

No, that's fine. I will rebase my for-next tree.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
  2023-03-16 20:46           ` John Paul Adrian Glaubitz
@ 2023-03-17  7:31             ` Geert Uytterhoeven
  2023-03-17  7:51               ` John Paul Adrian Glaubitz
  0 siblings, 1 reply; 29+ messages in thread
From: Geert Uytterhoeven @ 2023-03-17  7:31 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: Randy Dunlap, linux-kernel, Arnd Bergmann, Rich Felker,
	Yoshinori Sato, linux-sh

Hi Adrian,

On Thu, Mar 16, 2023 at 9:46 PM John Paul Adrian Glaubitz
<glaubitz@physik.fu-berlin.de> wrote:
> On Thu, 2023-03-16 at 13:43 -0700, Randy Dunlap wrote:
> > > Oops, sorry. My bad. I will use the proper tree.
> >
> > Just let me know if you want me to resend it.
> > Thanks.
>
> No, that's fine. I will rebase my for-next tree.

Rebase on top of what? Commit 49deed336ef9a409 ("parisc:
update kbuild doc. aliases for parisc64") is in the parisc tree.
You must not base the SH tree on the parisc tree.

Don't care about the simple conflict, Stephen and Linus can
handle that fine.

FTR, if the conflict was more complex, an immutable branch to be
merged by all parties would be appropriate.  But that's overkill and
thus not needed for simple conflicts like this.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
  2023-03-17  7:31             ` Geert Uytterhoeven
@ 2023-03-17  7:51               ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-17  7:51 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Randy Dunlap, linux-kernel, Arnd Bergmann, Rich Felker,
	Yoshinori Sato, linux-sh

Hi Geert!

On Fri, 2023-03-17 at 08:31 +0100, Geert Uytterhoeven wrote:
> Hi Adrian,
> 
> On Thu, Mar 16, 2023 at 9:46 PM John Paul Adrian Glaubitz
> <glaubitz@physik.fu-berlin.de> wrote:
> > On Thu, 2023-03-16 at 13:43 -0700, Randy Dunlap wrote:
> > > > Oops, sorry. My bad. I will use the proper tree.
> > > 
> > > Just let me know if you want me to resend it.
> > > Thanks.
> > 
> > No, that's fine. I will rebase my for-next tree.
> 
> Rebase on top of what? Commit 49deed336ef9a409 ("parisc:
> update kbuild doc. aliases for parisc64") is in the parisc tree.
> You must not base the SH tree on the parisc tree.

Oh, I wasn't aware of that.

> Don't care about the simple conflict, Stephen and Linus can
> handle that fine.
> 
> FTR, if the conflict was more complex, an immutable branch to be
> merged by all parties would be appropriate.  But that's overkill and
> thus not needed for simple conflicts like this.

I'll resolve the conflict manually then. Thanks.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 1/7 v4] sh: SH2007: drop the bad URL info
  2023-03-06  4:00 ` [PATCH 1/7 v4] sh: SH2007: drop the bad URL info Randy Dunlap
@ 2023-03-19 19:22   ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-19 19:22 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Yoshinori Sato, Rich Felker, Geert Uytterhoeven, Hitoshi Mitake,
	linux-sh

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> This URL provided is no longer functional, so drop it.
> 
> Fixes: 3a598264436e ("sh: SH-2007 board support.")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
> Cc: linux-sh@vger.kernel.org
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v2: skipped
> v3: skipped
> v4: refresh/rebase and resend
> 
>  arch/sh/boards/Kconfig |    1 -
>  1 file changed, 1 deletion(-)
> 
> diff -- a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
> --- a/arch/sh/boards/Kconfig
> +++ b/arch/sh/boards/Kconfig
> @@ -358,7 +358,6 @@ config SH_SH2007
>  	  intended for embedded applications.
>  	  It has an Ethernet interface (SMC9118), direct connected
>  	  Compact Flash socket, two serial ports and PC-104 bus.
> -	  More information at <http://sh2000.sh-linux.org>.
>  
>  config SH_APSH4A3A
>  	bool "AP-SH4A-3A"

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler
  2023-03-06  4:00 ` [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler Randy Dunlap
@ 2023-03-19 19:32   ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-19 19:32 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Igor Zhbanov, Yoshinori Sato, Rich Felker, linux-sh, stable

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> __setup() handlers should return 1 to obsolete_checksetup() in
> init/main.c to indicate that the boot option has been handled.
> A return of 0 causes the boot option/value to be listed as an Unknown
> kernel parameter and added to init's (limited) argument or environment
> strings. Also, error return codes don't mean anything to
> obsolete_checksetup() -- only non-zero (usually 1) or zero.
> So return 1 from nmi_debug_setup().
> 
> Fixes: 1e1030dccb10 ("sh: nmi_debug support.")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: Igor Zhbanov <izh1979@gmail.com>
> Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: linux-sh@vger.kernel.org
> Cc: stable@vger.kernel.org
> ---
> v2: add more Cc's;
>     refresh and resend;
> v3: add Arnd to Cc: list
> v4: update Cc: list, refresh & resend
> 
>  arch/sh/kernel/nmi_debug.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -- a/arch/sh/kernel/nmi_debug.c b/arch/sh/kernel/nmi_debug.c
> --- a/arch/sh/kernel/nmi_debug.c
> +++ b/arch/sh/kernel/nmi_debug.c
> @@ -49,7 +49,7 @@ static int __init nmi_debug_setup(char *
>  	register_die_notifier(&nmi_debug_nb);
>  
>  	if (*str != '=')
> -		return 0;
> +		return 1;
>  
>  	for (p = str + 1; *p; p = sep + 1) {
>  		sep = strchr(p, ',');
> @@ -70,6 +70,6 @@ static int __init nmi_debug_setup(char *
>  			break;
>  	}
>  
> -	return 0;
> +	return 1;
>  }
>  __setup("nmi_debug", nmi_debug_setup);

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init
  2023-03-06  4:00 ` [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init Randy Dunlap
@ 2023-03-19 19:48   ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-19 19:48 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Rob Herring, Frank Rowand, devicetree, Rich Felker,
	Yoshinori Sato, Geert Uytterhoeven, linux-sh, stable

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> When CONFIG_OF_EARLY_FLATTREE and CONFIG_SH_DEVICE_TREE are not set,
> SH3 build fails with a call to early_init_dt_scan(), so in
> arch/sh/kernel/setup.c and arch/sh/kernel/head_32.S, use
> CONFIG_OF_EARLY_FLATTREE instead of CONFIG_OF_FLATTREE.
> 
> Fixes this build error:
> ../arch/sh/kernel/setup.c: In function 'sh_fdt_init':
> ../arch/sh/kernel/setup.c:262:26: error: implicit declaration of function 'early_init_dt_scan' [-Werror=implicit-function-declaration]
>   262 |         if (!dt_virt || !early_init_dt_scan(dt_virt)) {
> 
> Fixes: 03767daa1387 ("sh: fix build regression with CONFIG_OF && !CONFIG_OF_FLATTREE")
> Fixes: eb6b6930a70f ("sh: fix memory corruption of unflattened device tree")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Suggested-by: Rob Herring <robh+dt@kernel.org>
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: devicetree@vger.kernel.org
> Cc: Rich Felker <dalias@libc.org>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: linux-sh@vger.kernel.org
> Cc: stable@vger.kernel.org
> ---
> v2: use Suggested-by: for Rob.
>     add more Cc's.
> v3: skipped
> v4: update Cc's, refresh & resend
> 
>  arch/sh/kernel/head_32.S |    6 +++---
>  arch/sh/kernel/setup.c   |    4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff arch/sh/kernel/setup.c arch/sh/kernel/setup.c
> diff -- a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
> --- a/arch/sh/kernel/setup.c
> +++ b/arch/sh/kernel/setup.c
> @@ -244,7 +244,7 @@ void __init __weak plat_early_device_set
>  {
>  }
>  
> -#ifdef CONFIG_OF_FLATTREE
> +#ifdef CONFIG_OF_EARLY_FLATTREE
>  void __ref sh_fdt_init(phys_addr_t dt_phys)
>  {
>  	static int done = 0;
> @@ -326,7 +326,7 @@ void __init setup_arch(char **cmdline_p)
>  	/* Let earlyprintk output early console messages */
>  	sh_early_platform_driver_probe("earlyprintk", 1, 1);
>  
> -#ifdef CONFIG_OF_FLATTREE
> +#ifdef CONFIG_OF_EARLY_FLATTREE
>  #ifdef CONFIG_USE_BUILTIN_DTB
>  	unflatten_and_copy_device_tree();
>  #else
> diff -- a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
> --- a/arch/sh/kernel/head_32.S
> +++ b/arch/sh/kernel/head_32.S
> @@ -64,7 +64,7 @@ ENTRY(_stext)
>  	ldc	r0, r6_bank
>  #endif
>  
> -#ifdef CONFIG_OF_FLATTREE
> +#ifdef CONFIG_OF_EARLY_FLATTREE
>  	mov	r4, r12		! Store device tree blob pointer in r12
>  #endif
>  	
> @@ -315,7 +315,7 @@ ENTRY(_stext)
>  10:		
>  #endif
>  
> -#ifdef CONFIG_OF_FLATTREE
> +#ifdef CONFIG_OF_EARLY_FLATTREE
>  	mov.l	8f, r0		! Make flat device tree available early.
>  	jsr	@r0
>  	 mov	r12, r4
> @@ -346,7 +346,7 @@ ENTRY(stack_start)
>  5:	.long	start_kernel
>  6:	.long	cpu_init
>  7:	.long	init_thread_union
> -#if defined(CONFIG_OF_FLATTREE)
> +#if defined(CONFIG_OF_EARLY_FLATTREE)
>  8:	.long	sh_fdt_init
>  #endif
>  

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning
  2023-03-06  4:00 ` [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning Randy Dunlap
@ 2023-03-19 19:49   ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-19 19:49 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: kernel test robot, Yoshinori Sato, Rich Felker, linux-sh,
	Geert Uytterhoeven, stable

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> Fix a warning that was reported by the kernel test robot:
> 
> In file included from ../include/math-emu/soft-fp.h:27,
>                  from ../arch/sh/math-emu/math.c:22:
> ../arch/sh/include/asm/sfp-machine.h:17: warning: "__BYTE_ORDER" redefined
>    17 | #define __BYTE_ORDER __BIG_ENDIAN
> In file included from ../arch/sh/math-emu/math.c:21:
> ../arch/sh/math-emu/sfp-util.h:71: note: this is the location of the previous definition
>    71 | #define __BYTE_ORDER __LITTLE_ENDIAN
> 
> Fixes: b929926f01f2 ("sh: define __BIG_ENDIAN for math-emu")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Link: lore.kernel.org/r/202111121827.6v6SXtVv-lkp@intel.com
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: linux-sh@vger.kernel.org
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: stable@vger.kernel.org
> ---
> v2: add Reviewed-by Geert,
>     rebase to linux-next-20211115
> v3: skipped
> v4: refresh & resend
> 
>  arch/sh/math-emu/sfp-util.h |    4 ----
>  1 file changed, 4 deletions(-)
> 
> diff -- a/arch/sh/math-emu/sfp-util.h b/arch/sh/math-emu/sfp-util.h
> --- a/arch/sh/math-emu/sfp-util.h
> +++ b/arch/sh/math-emu/sfp-util.h
> @@ -67,7 +67,3 @@
>    } while (0)
>  
>  #define abort()	return 0
> -
> -#define __BYTE_ORDER __LITTLE_ENDIAN
> -
> -

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
  2023-03-06  4:00 ` [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments Randy Dunlap
  2023-03-16 13:23   ` John Paul Adrian Glaubitz
@ 2023-03-19 19:50   ` John Paul Adrian Glaubitz
  1 sibling, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-19 19:50 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Geert Uytterhoeven, Arnd Bergmann, Rich Felker, Yoshinori Sato, linux-sh

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> A previous patch removed most of the sh5 (sh64) support from the
> kernel tree. Now remove the last stragglers.
> 
> Fixes: 37744feebc08 ("sh: remove sh5 support")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Rich Felker <dalias@libc.org>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: linux-sh@vger.kernel.org
> Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> ---
> v2: update after adding the parisc64 alias to kbuild.rst
> v3: skipped
> v4: refresh & resend
> 
>  Documentation/kbuild/kbuild.rst                           |    1 -
>  Documentation/scheduler/sched-arch.rst                    |    2 --
>  Documentation/translations/zh_CN/scheduler/sched-arch.rst |    2 --
>  scripts/checkstack.pl                                     |    7 -------
>  tools/perf/arch/common.c                                  |    2 --
>  tools/scripts/Makefile.arch                               |    5 -----
>  tools/testing/selftests/mm/Makefile                       |    2 +-
>  tools/testing/selftests/mm/run_vmtests.sh                 |    2 +-
>  8 files changed, 2 insertions(+), 21 deletions(-)
> 
> diff -- a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
> --- a/Documentation/kbuild/kbuild.rst
> +++ b/Documentation/kbuild/kbuild.rst
> @@ -161,7 +161,6 @@ But some architectures such as x86 and s
>  
>  - x86: i386 for 32 bit, x86_64 for 64 bit
>  - parisc: parisc64 for 64 bit
> -- sh: sh for 32 bit, sh64 for 64 bit
>  - sparc: sparc32 for 32 bit, sparc64 for 64 bit
>  
>  CROSS_COMPILE
> diff -- a/Documentation/scheduler/sched-arch.rst b/Documentation/scheduler/sched-arch.rst
> --- a/Documentation/scheduler/sched-arch.rst
> +++ b/Documentation/scheduler/sched-arch.rst
> @@ -70,7 +70,5 @@ Possible arch problems I found (and eith
>  
>  ia64 - is safe_halt call racy vs interrupts? (does it sleep?) (See #4a)
>  
> -sh64 - Is sleeping racy vs interrupts? (See #4a)
> -
>  sparc - IRQs on at this point(?), change local_irq_save to _disable.
>        - TODO: needs secondary CPUs to disable preempt (See #1)
> diff -- a/Documentation/translations/zh_CN/scheduler/sched-arch.rst b/Documentation/translations/zh_CN/scheduler/sched-arch.rst
> --- a/Documentation/translations/zh_CN/scheduler/sched-arch.rst
> +++ b/Documentation/translations/zh_CN/scheduler/sched-arch.rst
> @@ -70,7 +70,5 @@ 我发现的可能的arch问题(并试
>  
>  ia64 - safe_halt的调用与中断相比,是否很荒谬? (它睡眠了吗) (参考 #4a)
>  
> -sh64 - 睡眠与中断相比,是否很荒谬? (参考 #4a)
> -
>  sparc - 在这一点上,IRQ是开着的(?),把local_irq_save改为_disable。
>        - 待办事项: 需要第二个CPU来禁用抢占 (参考 #1)
> diff -- a/scripts/checkstack.pl b/scripts/checkstack.pl
> --- a/scripts/checkstack.pl
> +++ b/scripts/checkstack.pl
> @@ -10,7 +10,6 @@
>  #	Mips port by Juan Quintela <quintela@mandrakesoft.com>
>  #	IA64 port via Andreas Dilger
>  #	Arm port by Holger Schurig
> -#	sh64 port by Paul Mundt
>  #	Random bits by Matt Mackall <mpm@selenic.com>
>  #	M68k port by Geert Uytterhoeven and Andreas Schwab
>  #	AArch64, PARISC ports by Kyle McMartin
> @@ -100,12 +99,6 @@ my (@stack, $re, $dre, $sub, $x, $xs, $f
>  		#  100092:	 e3 f0 ff c8 ff 71	 lay	 %r15,-56(%r15)
>  		$re = qr/.*(?:lay|ag?hi).*\%r15,-(([0-9]{2}|[3-9])[0-9]{2})
>  		      (?:\(\%r15\))?$/ox;
> -	} elsif ($arch =~ /^sh64$/) {
> -		#XXX: we only check for the immediate case presently,
> -		#     though we will want to check for the movi/sub
> -		#     pair for larger users. -- PFM.
> -		#a00048e0:       d4fc40f0        addi.l  r15,-240,r15
> -		$re = qr/.*addi\.l.*r15,-(([0-9]{2}|[3-9])[0-9]{2}),r15/o;
>  	} elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
>  		# f0019d10:       9d e3 bf 90     save  %sp, -112, %sp
>  		$re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
> diff -- a/tools/perf/arch/common.c b/tools/perf/arch/common.c
> --- a/tools/perf/arch/common.c
> +++ b/tools/perf/arch/common.c
> @@ -51,9 +51,7 @@ const char *const s390_triplets[] = {
>  
>  const char *const sh_triplets[] = {
>  	"sh-unknown-linux-gnu-",
> -	"sh64-unknown-linux-gnu-",
>  	"sh-linux-gnu-",
> -	"sh64-linux-gnu-",
>  	NULL
>  };
>  
> diff -- a/tools/scripts/Makefile.arch b/tools/scripts/Makefile.arch
> --- a/tools/scripts/Makefile.arch
> +++ b/tools/scripts/Makefile.arch
> @@ -29,11 +29,6 @@ ifeq ($(ARCH),sparc64)
>         SRCARCH := sparc
>  endif
>  
> -# Additional ARCH settings for sh
> -ifeq ($(ARCH),sh64)
> -       SRCARCH := sh
> -endif
> -
>  # Additional ARCH settings for loongarch
>  ifeq ($(ARCH),loongarch32)
>         SRCARCH := loongarch
> diff -- a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
> --- a/tools/testing/selftests/mm/Makefile
> +++ b/tools/testing/selftests/mm/Makefile
> @@ -90,7 +90,7 @@ endif
>  
>  endif
>  
> -ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64))
> +ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sparc64 x86_64))
>  TEST_GEN_FILES += va_128TBswitch
>  TEST_GEN_FILES += virtual_address_range
>  TEST_GEN_FILES += write_to_hugetlbfs
> diff -- a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
> --- a/tools/testing/selftests/mm/run_vmtests.sh
> +++ b/tools/testing/selftests/mm/run_vmtests.sh
> @@ -132,7 +132,7 @@ else
>  fi
>  
>  # filter 64bit architectures
> -ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sh64 sparc64 x86_64"
> +ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sparc64 x86_64"
>  if [ -z "$ARCH" ]; then
>  	ARCH=$(uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/')
>  fi

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
  2023-03-06  4:00 ` [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP Randy Dunlap
@ 2023-03-19 20:20   ` John Paul Adrian Glaubitz
  2023-03-20 20:13     ` John Paul Adrian Glaubitz
  0 siblings, 1 reply; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-19 20:20 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Geert Uytterhoeven, Yoshinori Sato, Rich Felker, linux-sh, stable

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> Fix SUPERH builds that select SYS_SUPPORTS_NUMA but do not select
> SYS_SUPPORTS_SMP and SMP.
> 
> kernel/sched/topology.c is only built for CONFIG_SMP and then the NUMA
> code + data inside topology.c is only built when CONFIG_NUMA is
> set/enabled, so these arch/sh/ configs need to select SMP and
> SYS_SUPPORTS_SMP to build the NUMA support.
> 
> Fixes this build error in multiple SUPERH configs:
> 
> mm/page_alloc.o: In function `get_page_from_freelist':
> page_alloc.c:(.text+0x2ca8): undefined reference to `node_reclaim_distance'
> 
> Fixes: 357d59469c11 ("sh: Tidy up dependencies for SH-2 build.")
> Fixes: 9109a30e5a54 ("sh: add support for sh7366 processor")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: linux-sh@vger.kernel.org
> Cc: stable@vger.kernel.org
> ---
> v2: skipped
> v3: skipped
> v4: refresh & resend
> 
>  arch/sh/Kconfig |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff -- a/arch/sh/Kconfig b/arch/sh/Kconfig
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -477,6 +477,8 @@ config CPU_SUBTYPE_SH7722
>  	select CPU_SHX2
>  	select ARCH_SHMOBILE
>  	select ARCH_SPARSEMEM_ENABLE
> +	select SYS_SUPPORTS_SMP
> +	select SMP
>  	select SYS_SUPPORTS_NUMA
>  	select SYS_SUPPORTS_SH_CMT
>  	select PINCTRL
> @@ -487,6 +489,8 @@ config CPU_SUBTYPE_SH7366
>  	select CPU_SHX2
>  	select ARCH_SHMOBILE
>  	select ARCH_SPARSEMEM_ENABLE
> +	select SYS_SUPPORTS_SMP
> +	select SMP
>  	select SYS_SUPPORTS_NUMA
>  	select SYS_SUPPORTS_SH_CMT
>  

It seems that we need this change for these configurations as well:

- config CPU_SHX3
- config CPU_SUBTYPE_SH7785

Although I can trigger a build failure for CPU_SUBTYPE_SH7785 only when
setting CONFIG_NUMA=y:

  CC      net/ipv6/addrconf_core.o
mm/slab.c: In function 'slab_memory_callback':
mm/slab.c:1127:23: error: implicit declaration of function 'init_cache_node_node'; did you mean 'drain_cache_node_node'? [-Werror=implicit-function-declaration]
 1127 |                 ret = init_cache_node_node(nid);
      |                       ^~~~~~~~~~~~~~~~~~~~
      |                       drain_cache_node_node

I would expect this error to be reproducible for CPU_SHX3 as well when
CONFIG_NUMA=y but CONFIG_SMP=n. But for some reason, I am not seeing
the error then.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
       [not found] ` <20230306040037.20350-8-rdunlap@infradead.org>
@ 2023-03-19 20:49   ` John Paul Adrian Glaubitz
       [not found]     ` <CAMuHMdU+tsKuONm9iPqqTFSnRT2zaV3zogYgc-+vCp6x-ruQ_w@mail.gmail.com>
  2023-03-20 20:09   ` John Paul Adrian Glaubitz
  1 sibling, 1 reply; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-19 20:49 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Yoshinori Sato, Rich Felker, Geert Uytterhoeven, stable

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> Fix a build error in mcount.S when CONFIG_PRINTK is not enabled.
> Fixes this build error:
> 
> sh2-linux-ld: arch/sh/lib/mcount.o: in function `stack_panic':
> (.text+0xec): undefined reference to `dump_stack'
> 
> Fixes: e460ab27b6c3 ("sh: Fix up stack overflow check with ftrace disabled.")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: stable@vger.kernel.org
> ---
> v2: add PRINTK to STACK_DEBUG dependency (thanks, Geert)
> v3: skipped
> v4: refresh & resend
> 
>  arch/sh/Kconfig.debug |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -- a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
> --- a/arch/sh/Kconfig.debug
> +++ b/arch/sh/Kconfig.debug
> @@ -15,7 +15,7 @@ config SH_STANDARD_BIOS
>  
>  config STACK_DEBUG
>  	bool "Check for stack overflows"
> -	depends on DEBUG_KERNEL
> +	depends on DEBUG_KERNEL && PRINTK
>  	help
>  	  This option will cause messages to be printed if free stack space
>  	  drops below a certain limit. Saying Y here will add overhead to

I can't really test this change as the moment I am enabling CONFIG_STACK_DEBUG,
the build fails with:

  CC      scripts/mod/devicetable-offsets.s
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible
make[1]: *** [scripts/Makefile.build:252: scripts/mod/empty.o] Error 1
make[1]: *** Waiting for unfinished jobs....
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible
make[1]: *** [scripts/Makefile.build:114: scripts/mod/devicetable-offsets.s] Error 1
make: *** [Makefile:1286: prepare0] Error 2

So, I assume we need to strip -fomit-frame-pointer from KBUILD_CFLAGS, correct?

I tried this change, but that doesn't fix it for me:

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 5c8776482530..83f535b73835 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -173,6 +173,7 @@ KBUILD_AFLAGS               += $(cflags-y)
 
 ifeq ($(CONFIG_MCOUNT),y)
   KBUILD_CFLAGS += -pg
+  KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS))
 endif
 
 ifeq ($(CONFIG_DWARF_UNWINDER),y)

Any ideas?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
       [not found]         ` <CAMuHMdVR78EXTVd7ThUEv6rxL8aHSyAoC_5z8KyAPmiTyww85w@mail.gmail.com>
@ 2023-03-20 12:43           ` Geert Uytterhoeven
  2023-03-20 13:32           ` John Paul Adrian Glaubitz
  1 sibling, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2023-03-20 12:43 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: Randy Dunlap, linux-kernel, Yoshinori Sato, Rich Felker, stable,
	Linux-sh list

CC linux-sh

On Mon, Mar 20, 2023 at 1:42 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Mon, Mar 20, 2023 at 10:13 AM John Paul Adrian Glaubitz
> <glaubitz@physik.fu-berlin.de> wrote:
> > On Mon, 2023-03-20 at 09:16 +0100, Geert Uytterhoeven wrote:
> > > On Sun, Mar 19, 2023 at 9:49 PM John Paul Adrian Glaubitz
> > > <glaubitz@physik.fu-berlin.de> wrote:
> > > > On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> > > > > Fix a build error in mcount.S when CONFIG_PRINTK is not enabled.
> > > > > Fixes this build error:
> > > > >
> > > > > sh2-linux-ld: arch/sh/lib/mcount.o: in function `stack_panic':
> > > > > (.text+0xec): undefined reference to `dump_stack'
> > > > >
> > > > > Fixes: e460ab27b6c3 ("sh: Fix up stack overflow check with ftrace disabled.")
> > > > > Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> > > > > Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> > > > > Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> > > > > Cc: Rich Felker <dalias@libc.org>
> > > > > Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > > > Cc: stable@vger.kernel.org
> > > > > ---
> > > > > v2: add PRINTK to STACK_DEBUG dependency (thanks, Geert)
> > > > > v3: skipped
> > > > > v4: refresh & resend
> > > > >
> > > > >  arch/sh/Kconfig.debug |    2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff -- a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
> > > > > --- a/arch/sh/Kconfig.debug
> > > > > +++ b/arch/sh/Kconfig.debug
> > > > > @@ -15,7 +15,7 @@ config SH_STANDARD_BIOS
> > > > >
> > > > >  config STACK_DEBUG
> > > > >       bool "Check for stack overflows"
> > > > > -     depends on DEBUG_KERNEL
> > > > > +     depends on DEBUG_KERNEL && PRINTK
> > > > >       help
> > > > >         This option will cause messages to be printed if free stack space
> > > > >         drops below a certain limit. Saying Y here will add overhead to
> > > >
> > > > I can't really test this change as the moment I am enabling CONFIG_STACK_DEBUG,
> > > > the build fails with:
> > > >
> > > >   CC      scripts/mod/devicetable-offsets.s
> > > > sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible
> > > > make[1]: *** [scripts/Makefile.build:252: scripts/mod/empty.o] Error 1
> > > > make[1]: *** Waiting for unfinished jobs....
> > > > sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible
> > > > make[1]: *** [scripts/Makefile.build:114: scripts/mod/devicetable-offsets.s] Error 1
> > > > make: *** [Makefile:1286: prepare0] Error 2
> > > >
> > > > So, I assume we need to strip -fomit-frame-pointer from KBUILD_CFLAGS, correct?
> > > >
> > > > I tried this change, but that doesn't fix it for me:
> > > >
> > > > diff --git a/arch/sh/Makefile b/arch/sh/Makefile
> > > > index 5c8776482530..83f535b73835 100644
> > > > --- a/arch/sh/Makefile
> > > > +++ b/arch/sh/Makefile
> > > > @@ -173,6 +173,7 @@ KBUILD_AFLAGS               += $(cflags-y)
> > > >
> > > >  ifeq ($(CONFIG_MCOUNT),y)
> > > >    KBUILD_CFLAGS += -pg
> > > > +  KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS))
> > > >  endif
> > > >
> > > >  ifeq ($(CONFIG_DWARF_UNWINDER),y)
> > > >
> > > > Any ideas?
> > >
> > > Please try with "+=" instead of ":=".
> >
> > That doesn't work either. I tried the following, but that didn't strip -fomit-frame-pointer:
>
> Oops, obviously all of that happened before my morning coffee ;-)
>
> Makefile has:
>
>     ifdef CONFIG_FRAME_POINTER
>     KBUILD_CFLAGS   += -fno-omit-frame-pointer -fno-optimize-sibling-calls
>     KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y
>     else
>     # Some targets (ARM with Thumb2, for example), can't be built with frame
>     # pointers.  For those, we don't have FUNCTION_TRACER automatically
>     # select FRAME_POINTER.  However, FUNCTION_TRACER adds -pg, and this is
>     # incompatible with -fomit-frame-pointer with current GCC, so we don't use
>     # -fomit-frame-pointer with FUNCTION_TRACER.
>     # In the Rust target specification, "frame-pointer" is set explicitly
>     # to "may-omit".
>     ifndef CONFIG_FUNCTION_TRACER
>     KBUILD_CFLAGS   += -fomit-frame-pointer
>     endif
>     endif
>
> Your config probably has CONFIG_FRAME_POINTER set?
>
>     arch/sh/Kconfig.debug=config DWARF_UNWINDER
>     arch/sh/Kconfig.debug-  bool "Enable the DWARF unwinder for stacktraces"
>     arch/sh/Kconfig.debug-  depends on DEBUG_KERNEL
>     arch/sh/Kconfig.debug:  select FRAME_POINTER
>
> You should make sure that cannot happen when CONFIG_FUNCTION_TRACER
> is enabled. I.e. make DWARF_UNWINDER depend on !FUNCTION_TRACER?
>
> Other architectures do something similar:
>
>     arch/sparc/Kconfig.debug:config FRAME_POINTER
>     arch/sparc/Kconfig.debug-       bool
>     arch/sparc/Kconfig.debug-       depends on MCOUNT
>
>     arch/x86/Kconfig.debug:config FRAME_POINTER
>     arch/x86/Kconfig.debug- depends on !UNWINDER_ORC && !UNWINDER_GUESS
>     arch/x86/Kconfig.debug- bool
>
> Probably you need to adjust the following, too:
>
>     lib/Kconfig.debug:config FRAME_POINTER
>     lib/Kconfig.debug-      bool "Compile the kernel with frame pointers"
>     lib/Kconfig.debug-      depends on DEBUG_KERNEL && (M68K || UML ||
> SUPERH) || ARCH_WANT_FRAME_POINTERS
>     lib/Kconfig.debug-      default y if (DEBUG_INFO && UML) ||
> ARCH_WANT_FRAME_POINTERS
>
> i.e. drop SUPERH from the list above, and select ARCH_WANT_FRAME_POINTERS
> if !FUNCTION_TRACER.
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
       [not found]         ` <CAMuHMdVR78EXTVd7ThUEv6rxL8aHSyAoC_5z8KyAPmiTyww85w@mail.gmail.com>
  2023-03-20 12:43           ` Geert Uytterhoeven
@ 2023-03-20 13:32           ` John Paul Adrian Glaubitz
  1 sibling, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-20 13:32 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Randy Dunlap, linux-kernel, Yoshinori Sato, Rich Felker, stable,
	linux-sh

Hi Geert!

On Mon, 2023-03-20 at 13:42 +0100, Geert Uytterhoeven wrote:
> Oops, obviously all of that happened before my morning coffee ;-)
> 
> Makefile has:
> 
>     ifdef CONFIG_FRAME_POINTER
>     KBUILD_CFLAGS   += -fno-omit-frame-pointer -fno-optimize-sibling-calls
>     KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y
>     else
>     # Some targets (ARM with Thumb2, for example), can't be built with frame
>     # pointers.  For those, we don't have FUNCTION_TRACER automatically
>     # select FRAME_POINTER.  However, FUNCTION_TRACER adds -pg, and this is
>     # incompatible with -fomit-frame-pointer with current GCC, so we don't use
>     # -fomit-frame-pointer with FUNCTION_TRACER.
>     # In the Rust target specification, "frame-pointer" is set explicitly
>     # to "may-omit".
>     ifndef CONFIG_FUNCTION_TRACER
>     KBUILD_CFLAGS   += -fomit-frame-pointer
>     endif
>     endif
> 
> Your config probably has CONFIG_FRAME_POINTER set?
> 
>     arch/sh/Kconfig.debug=config DWARF_UNWINDER
>     arch/sh/Kconfig.debug-  bool "Enable the DWARF unwinder for stacktraces"
>     arch/sh/Kconfig.debug-  depends on DEBUG_KERNEL
>     arch/sh/Kconfig.debug:  select FRAME_POINTER
> 
> You should make sure that cannot happen when CONFIG_FUNCTION_TRACER
> is enabled. I.e. make DWARF_UNWINDER depend on !FUNCTION_TRACER?
> 
> Other architectures do something similar:
> 
>     arch/sparc/Kconfig.debug:config FRAME_POINTER
>     arch/sparc/Kconfig.debug-       bool
>     arch/sparc/Kconfig.debug-       depends on MCOUNT
> 
>     arch/x86/Kconfig.debug:config FRAME_POINTER
>     arch/x86/Kconfig.debug- depends on !UNWINDER_ORC && !UNWINDER_GUESS
>     arch/x86/Kconfig.debug- bool
> 
> Probably you need to adjust the following, too:
> 
>     lib/Kconfig.debug:config FRAME_POINTER
>     lib/Kconfig.debug-      bool "Compile the kernel with frame pointers"
>     lib/Kconfig.debug-      depends on DEBUG_KERNEL && (M68K || UML ||
> SUPERH) || ARCH_WANT_FRAME_POINTERS
>     lib/Kconfig.debug-      default y if (DEBUG_INFO && UML) ||
> ARCH_WANT_FRAME_POINTERS
> 
> i.e. drop SUPERH from the list above, and select ARCH_WANT_FRAME_POINTERS
> if !FUNCTION_TRACER.

Do you think you can send a patch for this change? I can then review and apply
it together with Randy's series in case everything works as expected.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
       [not found] ` <20230306040037.20350-8-rdunlap@infradead.org>
  2023-03-19 20:49   ` [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled John Paul Adrian Glaubitz
@ 2023-03-20 20:09   ` John Paul Adrian Glaubitz
  1 sibling, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-20 20:09 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Yoshinori Sato, Rich Felker, Geert Uytterhoeven, stable

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> Fix a build error in mcount.S when CONFIG_PRINTK is not enabled.
> Fixes this build error:
> 
> sh2-linux-ld: arch/sh/lib/mcount.o: in function `stack_panic':
> (.text+0xec): undefined reference to `dump_stack'
> 
> Fixes: e460ab27b6c3 ("sh: Fix up stack overflow check with ftrace disabled.")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: stable@vger.kernel.org
> ---
> v2: add PRINTK to STACK_DEBUG dependency (thanks, Geert)
> v3: skipped
> v4: refresh & resend
> 
>  arch/sh/Kconfig.debug |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -- a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
> --- a/arch/sh/Kconfig.debug
> +++ b/arch/sh/Kconfig.debug
> @@ -15,7 +15,7 @@ config SH_STANDARD_BIOS
>  
>  config STACK_DEBUG
>  	bool "Check for stack overflows"
> -	depends on DEBUG_KERNEL
> +	depends on DEBUG_KERNEL && PRINTK
>  	help
>  	  This option will cause messages to be printed if free stack space
>  	  drops below a certain limit. Saying Y here will add overhead to

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
  2023-03-19 20:20   ` John Paul Adrian Glaubitz
@ 2023-03-20 20:13     ` John Paul Adrian Glaubitz
  2023-03-20 20:17       ` Randy Dunlap
  0 siblings, 1 reply; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-20 20:13 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Geert Uytterhoeven, Yoshinori Sato, Rich Felker, linux-sh, stable

Hi Randy!

On Sun, 2023-03-19 at 21:20 +0100, John Paul Adrian Glaubitz wrote:
> On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> > Fix SUPERH builds that select SYS_SUPPORTS_NUMA but do not select
> > SYS_SUPPORTS_SMP and SMP.
> > 
> > kernel/sched/topology.c is only built for CONFIG_SMP and then the NUMA
> > code + data inside topology.c is only built when CONFIG_NUMA is
> > set/enabled, so these arch/sh/ configs need to select SMP and
> > SYS_SUPPORTS_SMP to build the NUMA support.
> > 
> > Fixes this build error in multiple SUPERH configs:
> > 
> > mm/page_alloc.o: In function `get_page_from_freelist':
> > page_alloc.c:(.text+0x2ca8): undefined reference to `node_reclaim_distance'
> > 
> > Fixes: 357d59469c11 ("sh: Tidy up dependencies for SH-2 build.")
> > Fixes: 9109a30e5a54 ("sh: add support for sh7366 processor")
> > Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> > Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> > Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> > Cc: Rich Felker <dalias@libc.org>
> > Cc: linux-sh@vger.kernel.org
> > Cc: stable@vger.kernel.org
> > ---
> > v2: skipped
> > v3: skipped
> > v4: refresh & resend
> > 
> >  arch/sh/Kconfig |    4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff -- a/arch/sh/Kconfig b/arch/sh/Kconfig
> > --- a/arch/sh/Kconfig
> > +++ b/arch/sh/Kconfig
> > @@ -477,6 +477,8 @@ config CPU_SUBTYPE_SH7722
> >  	select CPU_SHX2
> >  	select ARCH_SHMOBILE
> >  	select ARCH_SPARSEMEM_ENABLE
> > +	select SYS_SUPPORTS_SMP
> > +	select SMP
> >  	select SYS_SUPPORTS_NUMA
> >  	select SYS_SUPPORTS_SH_CMT
> >  	select PINCTRL
> > @@ -487,6 +489,8 @@ config CPU_SUBTYPE_SH7366
> >  	select CPU_SHX2
> >  	select ARCH_SHMOBILE
> >  	select ARCH_SPARSEMEM_ENABLE
> > +	select SYS_SUPPORTS_SMP
> > +	select SMP
> >  	select SYS_SUPPORTS_NUMA
> >  	select SYS_SUPPORTS_SH_CMT
> >  
> 
> It seems that we need this change for these configurations as well:
> 
> - config CPU_SHX3
> - config CPU_SUBTYPE_SH7785
> 
> Although I can trigger a build failure for CPU_SUBTYPE_SH7785 only when
> setting CONFIG_NUMA=y:
> 
>   CC      net/ipv6/addrconf_core.o
> mm/slab.c: In function 'slab_memory_callback':
> mm/slab.c:1127:23: error: implicit declaration of function 'init_cache_node_node'; did you mean 'drain_cache_node_node'? [-Werror=implicit-function-declaration]
>  1127 |                 ret = init_cache_node_node(nid);
>       |                       ^~~~~~~~~~~~~~~~~~~~
>       |                       drain_cache_node_node
> 
> I would expect this error to be reproducible for CPU_SHX3 as well when
> CONFIG_NUMA=y but CONFIG_SMP=n. But for some reason, I am not seeing
> the error then.

Can you make this change for config CPU_SUBTYPE_SH7785 as well?

Then the change should be fine.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
  2023-03-20 20:13     ` John Paul Adrian Glaubitz
@ 2023-03-20 20:17       ` Randy Dunlap
  0 siblings, 0 replies; 29+ messages in thread
From: Randy Dunlap @ 2023-03-20 20:17 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz, linux-kernel
  Cc: Geert Uytterhoeven, Yoshinori Sato, Rich Felker, linux-sh, stable



On 3/20/23 13:13, John Paul Adrian Glaubitz wrote:
> Hi Randy!
> 
> On Sun, 2023-03-19 at 21:20 +0100, John Paul Adrian Glaubitz wrote:
>> On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
>>> Fix SUPERH builds that select SYS_SUPPORTS_NUMA but do not select
>>> SYS_SUPPORTS_SMP and SMP.
>>>
>>> kernel/sched/topology.c is only built for CONFIG_SMP and then the NUMA
>>> code + data inside topology.c is only built when CONFIG_NUMA is
>>> set/enabled, so these arch/sh/ configs need to select SMP and
>>> SYS_SUPPORTS_SMP to build the NUMA support.
>>>
>>> Fixes this build error in multiple SUPERH configs:
>>>
>>> mm/page_alloc.o: In function `get_page_from_freelist':
>>> page_alloc.c:(.text+0x2ca8): undefined reference to `node_reclaim_distance'
>>>
>>> Fixes: 357d59469c11 ("sh: Tidy up dependencies for SH-2 build.")
>>> Fixes: 9109a30e5a54 ("sh: add support for sh7366 processor")
>>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>>> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
>>> Cc: Rich Felker <dalias@libc.org>
>>> Cc: linux-sh@vger.kernel.org
>>> Cc: stable@vger.kernel.org
>>> ---
>>> v2: skipped
>>> v3: skipped
>>> v4: refresh & resend
>>>
>>>  arch/sh/Kconfig |    4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff -- a/arch/sh/Kconfig b/arch/sh/Kconfig
>>> --- a/arch/sh/Kconfig
>>> +++ b/arch/sh/Kconfig
>>> @@ -477,6 +477,8 @@ config CPU_SUBTYPE_SH7722
>>>  	select CPU_SHX2
>>>  	select ARCH_SHMOBILE
>>>  	select ARCH_SPARSEMEM_ENABLE
>>> +	select SYS_SUPPORTS_SMP
>>> +	select SMP
>>>  	select SYS_SUPPORTS_NUMA
>>>  	select SYS_SUPPORTS_SH_CMT
>>>  	select PINCTRL
>>> @@ -487,6 +489,8 @@ config CPU_SUBTYPE_SH7366
>>>  	select CPU_SHX2
>>>  	select ARCH_SHMOBILE
>>>  	select ARCH_SPARSEMEM_ENABLE
>>> +	select SYS_SUPPORTS_SMP
>>> +	select SMP
>>>  	select SYS_SUPPORTS_NUMA
>>>  	select SYS_SUPPORTS_SH_CMT
>>>  
>>
>> It seems that we need this change for these configurations as well:
>>
>> - config CPU_SHX3
>> - config CPU_SUBTYPE_SH7785
>>
>> Although I can trigger a build failure for CPU_SUBTYPE_SH7785 only when
>> setting CONFIG_NUMA=y:
>>
>>   CC      net/ipv6/addrconf_core.o
>> mm/slab.c: In function 'slab_memory_callback':
>> mm/slab.c:1127:23: error: implicit declaration of function 'init_cache_node_node'; did you mean 'drain_cache_node_node'? [-Werror=implicit-function-declaration]
>>  1127 |                 ret = init_cache_node_node(nid);
>>       |                       ^~~~~~~~~~~~~~~~~~~~
>>       |                       drain_cache_node_node
>>
>> I would expect this error to be reproducible for CPU_SHX3 as well when
>> CONFIG_NUMA=y but CONFIG_SMP=n. But for some reason, I am not seeing
>> the error then.
> 
> Can you make this change for config CPU_SUBTYPE_SH7785 as well?
> 
> Then the change should be fine.

Will do. Thanks.

-- 
~Randy

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 0/7 v4] sh: various doc, build, init fixes
  2023-03-06  4:00 [PATCH 0/7 v4] sh: various doc, build, init fixes Randy Dunlap
                   ` (8 preceding siblings ...)
       [not found] ` <20230306040037.20350-8-rdunlap@infradead.org>
@ 2023-03-23  9:41 ` John Paul Adrian Glaubitz
  9 siblings, 0 replies; 29+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-03-23  9:41 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Yoshinori Sato, Rich Felker, Geert Uytterhoeven, Hitoshi Mitake,
	linux-sh, Frank Rowand, devicetree, Arnd Bergmann

Hi Randy!

On Sun, 2023-03-05 at 20:00 -0800, Randy Dunlap wrote:
> All of these patches have been sent previously, anywhere from
> one to 3 times.  All patches are now called "v4".
> 
> This refresh/resend is to assist the new SH maintainer.
> 
>  [PATCH 1/7 v4] sh: SH2007: drop the bad URL info
>  [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler
>  [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init
>  [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning
>  [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
>  [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
>  [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
> 
> diffstat:
>  Documentation/kbuild/kbuild.rst                           |    1 -
>  Documentation/scheduler/sched-arch.rst                    |    2 --
>  Documentation/translations/zh_CN/scheduler/sched-arch.rst |    2 --
>  arch/sh/Kconfig                                           |    4 ++++
>  arch/sh/Kconfig.debug                                     |    2 +-
>  arch/sh/boards/Kconfig                                    |    1 -
>  arch/sh/kernel/head_32.S                                  |    6 +++---
>  arch/sh/kernel/nmi_debug.c                                |    4 ++--
>  arch/sh/kernel/setup.c                                    |    4 ++--
>  arch/sh/math-emu/sfp-util.h                               |    4 ----
>  scripts/checkstack.pl                                     |    7 -------
>  tools/perf/arch/common.c                                  |    2 --
>  tools/scripts/Makefile.arch                               |    5 -----
>  tools/testing/selftests/mm/Makefile                       |    2 +-
>  tools/testing/selftests/mm/run_vmtests.sh                 |    2 +-
>  15 files changed, 14 insertions(+), 34 deletions(-)
> 
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
> Cc: linux-sh@vger.kernel.org
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: devicetree@vger.kernel.org
> Cc: Arnd Bergmann <arnd@arndb.de>

All applied to sh-linux/for-next now except for patch number 6.

Apologies that it took so long, I'm still learning :-).

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2023-03-23  9:41 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-06  4:00 [PATCH 0/7 v4] sh: various doc, build, init fixes Randy Dunlap
2023-03-06  4:00 ` [PATCH 1/7 v4] sh: SH2007: drop the bad URL info Randy Dunlap
2023-03-19 19:22   ` John Paul Adrian Glaubitz
2023-03-06  4:00 ` [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler Randy Dunlap
2023-03-19 19:32   ` John Paul Adrian Glaubitz
2023-03-06  4:00 ` [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init Randy Dunlap
2023-03-19 19:48   ` John Paul Adrian Glaubitz
2023-03-06  4:00 ` [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning Randy Dunlap
2023-03-19 19:49   ` John Paul Adrian Glaubitz
2023-03-06  4:00 ` [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments Randy Dunlap
2023-03-16 13:23   ` John Paul Adrian Glaubitz
2023-03-16 16:44     ` Randy Dunlap
2023-03-16 16:52       ` John Paul Adrian Glaubitz
2023-03-16 20:43         ` Randy Dunlap
2023-03-16 20:46           ` John Paul Adrian Glaubitz
2023-03-17  7:31             ` Geert Uytterhoeven
2023-03-17  7:51               ` John Paul Adrian Glaubitz
2023-03-19 19:50   ` John Paul Adrian Glaubitz
2023-03-06  4:00 ` [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP Randy Dunlap
2023-03-19 20:20   ` John Paul Adrian Glaubitz
2023-03-20 20:13     ` John Paul Adrian Glaubitz
2023-03-20 20:17       ` Randy Dunlap
2023-03-07 15:18 ` [PATCH 0/7 v4] sh: various doc, build, init fixes John Paul Adrian Glaubitz
2023-03-16 13:26 ` John Paul Adrian Glaubitz
     [not found] ` <20230306040037.20350-8-rdunlap@infradead.org>
2023-03-19 20:49   ` [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled John Paul Adrian Glaubitz
     [not found]     ` <CAMuHMdU+tsKuONm9iPqqTFSnRT2zaV3zogYgc-+vCp6x-ruQ_w@mail.gmail.com>
     [not found]       ` <01f84314b2499b6859a4826ecf7363635e66a4fc.camel@physik.fu-berlin.de>
     [not found]         ` <CAMuHMdVR78EXTVd7ThUEv6rxL8aHSyAoC_5z8KyAPmiTyww85w@mail.gmail.com>
2023-03-20 12:43           ` Geert Uytterhoeven
2023-03-20 13:32           ` John Paul Adrian Glaubitz
2023-03-20 20:09   ` John Paul Adrian Glaubitz
2023-03-23  9:41 ` [PATCH 0/7 v4] sh: various doc, build, init fixes John Paul Adrian Glaubitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).