Skip to contentSkip to conversation

parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY

PATCH Guenter Roeck 2 participants 6 messages Apr 1, 2022 – Apr 2, 2022 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 4 lines · Helge Deller

Switch away from the own cpu topology code to common code which is used by ARM64 and RISCV. That will allow us to enable CPU hotplug later on.

This patch results in the following traceback when booting generic-32bit_defconfig - SMP in qemu.

[    9.432811] ------------[ cut here ]------------
[    9.433305] WARNING: CPU: 0 PID: 1 at fs/sysfs/group.c:115 internal_create_group+0x360/0x394
[    9.433825] Modules linked in:
[    9.434267] CPU: 0 PID: 1 Comm: swapper Not tainted 5.17.0-32bit+ #1
[    9.434621] Hardware name: 9000/778/B160L
[    9.434889]
[    9.435014]      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
[    9.435201] PSW: 00000000000001001011111100001111 Not tainted
[    9.435392] r00-03  0004bf0f 114305c0 103518bc 11430600
[    9.435578] r04-07  0000003c 10db3d20 10b27ecc 00000000
[    9.435725] r08-11  106f6c88 00000001 00000000 00000000
[    9.435876] r12-15  10c59000 00000000 00000001 00000000
[    9.436022] r16-19  00000028 00080000 00000000 10db4ad8
[    9.436168] r20-23  0000012c 10eb0a00 106f6c88 00000000
[    9.436314] r24-27  10b27ecc 00000000 00000000 10cf00e0
[    9.436460] r28-31  00000000 ae147af8 114306c0 101a66d8
[    9.436625] sr00-03  00000000 00000000 00000000 00000000
[    9.436785] sr04-07  00000000 00000000 00000000 00000000
[    9.436942]
[    9.437006] IASQ: 00000000 00000000 IAOQ: 1035186c 10351870
[    9.437161]  IIR: 03ffe01f    ISR: 00000000  IOR: 10e02d68
[    9.437307]  CPU:        0   CR30: 1141a010 CR31: 00000000
[    9.437470]  ORIG_R28: 00000000
[    9.437579]  IAOQ[0]: internal_create_group+0x360/0x394
[    9.437753]  IAOQ[1]: internal_create_group+0x364/0x394
[    9.437913]  RP(r2): sysfs_create_group+0x1c/0x2c
[    9.438180] Backtrace:
[    9.438892]  [<103518bc>] sysfs_create_group+0x1c/0x2c
[    9.439116]  [<106f6cb0>] topology_add_dev+0x28/0x38
[    9.439407]  [<101a66d8>] cpuhp_invoke_callback.constprop.0+0xcc/0x17c
[    9.440321]  [<101a68b0>] __cpuhp_setup_state_cpuslocked+0x128/0x210
[    9.440545]  [<101a69c0>] __cpuhp_setup_state+0x28/0x38
[    9.440657]  [<10126fa4>] topology_sysfs_init+0x3c/0x4c
[    9.440795]  [<1018510c>] do_one_initcall+0x68/0x510
[    9.440918]  [<10101420>] kernel_init_freeable+0x1d4/0x268
[    9.441040]  [<10aa7bdc>] kernel_init+0x2c/0x150
[    9.441191]  [<1018201c>] ret_from_kernel_thread+0x1c/0x24
[    9.441574]
[    9.441716] ---[ end trace 0000000000000000 ]---

Reverting the offending commit fixes the problem.
Bisect log is attached.

Guenter

---
# bad: [e8b767f5e04097aaedcd6e06e2270f9fe5282696] Merge tag 'for-linus-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
# good: [d888c83fcec75194a8a48ccd283953bdba7b2550] fs: fix fd table size alignment properly
git bisect start 'HEAD' 'd888c83fcec7'
# good: [2a44cdaa01837355b14b9221e87d75963846296c] Merge tag 'dmaengine-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
git bisect good 2a44cdaa01837355b14b9221e87d75963846296c
# bad: [b8321ed4a40c02054f930ca59d3570caa27bc86c] Merge tag 'kbuild-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
git bisect bad b8321ed4a40c02054f930ca59d3570caa27bc86c
# bad: [93235e3df29c084a37e0daed17801c6adfce4cb6] Merge tag 'v5.18-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
git bisect bad 93235e3df29c084a37e0daed17801c6adfce4cb6
# good: [84b3b8df51e26b8bc2c7178b068ef447473d4609] dt-bindings: pwm: renesas,pwm: Include generic PWM schema
git bisect good 84b3b8df51e26b8bc2c7178b068ef447473d4609
# bad: [a9fe7fa7d874a536e0540469f314772c054a0323] parisc: Fix patch code locking and flushing
git bisect bad a9fe7fa7d874a536e0540469f314772c054a0323
# bad: [95370b4031ec67f9749e5873ae7139a53cc6bf53] parisc: Move store_cpu_topology() into text section
git bisect bad 95370b4031ec67f9749e5873ae7139a53cc6bf53
# good: [ed9794812b0a61f62317991c5c3e6c78749a0bdc] parisc: Detect hppa-suse-linux-gcc compiler for cross-building
git bisect good ed9794812b0a61f62317991c5c3e6c78749a0bdc
# good: [1e93848a385ed2c2df9cb246b073dc8c66d10793] parisc: Ensure set_firmware_width() is called only once
git bisect good 1e93848a385ed2c2df9cb246b073dc8c66d10793
# bad: [62773112acc55d29727465d075fc61ed08a0a532] parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY
git bisect bad 62773112acc55d29727465d075fc61ed08a0a532

# first bad commit: [62773112acc55d29727465d075fc61ed08a0a532] parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY
maintainer
#1 lore raw

Hi Günter,

Quoted 8 lines · Guenter Roeck
Quoted 4 lines · Helge Deller

Switch away from the own cpu topology code to common code which is used by ARM64 and RISCV. That will allow us to enable CPU hotplug later on.

This patch results in the following traceback when booting generic-32bit_defconfig - SMP in qemu.

That's strange, because I just built this generic-32bit_defconfig myself and it boots up nicely in qemu for me. The only thing missing is CONFIG_CGROUPS=y so that systemd can start.

I'm not sure how I can debug/reproduce your bug report...

Helge

Quoted 68 lines
[    9.432811] ------------[ cut here ]------------
[    9.433305] WARNING: CPU: 0 PID: 1 at fs/sysfs/group.c:115 internal_create_group+0x360/0x394
[    9.433825] Modules linked in:
[    9.434267] CPU: 0 PID: 1 Comm: swapper Not tainted 5.17.0-32bit+ #1
[    9.434621] Hardware name: 9000/778/B160L
[    9.434889]
[    9.435014]      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
[    9.435201] PSW: 00000000000001001011111100001111 Not tainted
[    9.435392] r00-03  0004bf0f 114305c0 103518bc 11430600
[    9.435578] r04-07  0000003c 10db3d20 10b27ecc 00000000
[    9.435725] r08-11  106f6c88 00000001 00000000 00000000
[    9.435876] r12-15  10c59000 00000000 00000001 00000000
[    9.436022] r16-19  00000028 00080000 00000000 10db4ad8
[    9.436168] r20-23  0000012c 10eb0a00 106f6c88 00000000
[    9.436314] r24-27  10b27ecc 00000000 00000000 10cf00e0
[    9.436460] r28-31  00000000 ae147af8 114306c0 101a66d8
[    9.436625] sr00-03  00000000 00000000 00000000 00000000
[    9.436785] sr04-07  00000000 00000000 00000000 00000000
[    9.436942]
[    9.437006] IASQ: 00000000 00000000 IAOQ: 1035186c 10351870
[    9.437161]  IIR: 03ffe01f    ISR: 00000000  IOR: 10e02d68
[    9.437307]  CPU:        0   CR30: 1141a010 CR31: 00000000
[    9.437470]  ORIG_R28: 00000000
[    9.437579]  IAOQ[0]: internal_create_group+0x360/0x394
[    9.437753]  IAOQ[1]: internal_create_group+0x364/0x394
[    9.437913]  RP(r2): sysfs_create_group+0x1c/0x2c
[    9.438180] Backtrace:
[    9.438892]  [<103518bc>] sysfs_create_group+0x1c/0x2c
[    9.439116]  [<106f6cb0>] topology_add_dev+0x28/0x38
[    9.439407]  [<101a66d8>] cpuhp_invoke_callback.constprop.0+0xcc/0x17c
[    9.440321]  [<101a68b0>] __cpuhp_setup_state_cpuslocked+0x128/0x210
[    9.440545]  [<101a69c0>] __cpuhp_setup_state+0x28/0x38
[    9.440657]  [<10126fa4>] topology_sysfs_init+0x3c/0x4c
[    9.440795]  [<1018510c>] do_one_initcall+0x68/0x510
[    9.440918]  [<10101420>] kernel_init_freeable+0x1d4/0x268
[    9.441040]  [<10aa7bdc>] kernel_init+0x2c/0x150
[    9.441191]  [<1018201c>] ret_from_kernel_thread+0x1c/0x24
[    9.441574]
[    9.441716] ---[ end trace 0000000000000000 ]---

Reverting the offending commit fixes the problem.
Bisect log is attached.

Guenter

---
# bad: [e8b767f5e04097aaedcd6e06e2270f9fe5282696] Merge tag 'for-linus-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
# good: [d888c83fcec75194a8a48ccd283953bdba7b2550] fs: fix fd table size alignment properly
git bisect start 'HEAD' 'd888c83fcec7'
# good: [2a44cdaa01837355b14b9221e87d75963846296c] Merge tag 'dmaengine-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
git bisect good 2a44cdaa01837355b14b9221e87d75963846296c
# bad: [b8321ed4a40c02054f930ca59d3570caa27bc86c] Merge tag 'kbuild-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
git bisect bad b8321ed4a40c02054f930ca59d3570caa27bc86c
# bad: [93235e3df29c084a37e0daed17801c6adfce4cb6] Merge tag 'v5.18-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
git bisect bad 93235e3df29c084a37e0daed17801c6adfce4cb6
# good: [84b3b8df51e26b8bc2c7178b068ef447473d4609] dt-bindings: pwm: renesas,pwm: Include generic PWM schema
git bisect good 84b3b8df51e26b8bc2c7178b068ef447473d4609
# bad: [a9fe7fa7d874a536e0540469f314772c054a0323] parisc: Fix patch code locking and flushing
git bisect bad a9fe7fa7d874a536e0540469f314772c054a0323
# bad: [95370b4031ec67f9749e5873ae7139a53cc6bf53] parisc: Move store_cpu_topology() into text section
git bisect bad 95370b4031ec67f9749e5873ae7139a53cc6bf53
# good: [ed9794812b0a61f62317991c5c3e6c78749a0bdc] parisc: Detect hppa-suse-linux-gcc compiler for cross-building
git bisect good ed9794812b0a61f62317991c5c3e6c78749a0bdc
# good: [1e93848a385ed2c2df9cb246b073dc8c66d10793] parisc: Ensure set_firmware_width() is called only once
git bisect good 1e93848a385ed2c2df9cb246b073dc8c66d10793
# bad: [62773112acc55d29727465d075fc61ed08a0a532] parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY
git bisect bad 62773112acc55d29727465d075fc61ed08a0a532

# first bad commit: [62773112acc55d29727465d075fc61ed08a0a532] parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY
#2 lore raw
Quoted 7 lines · Helge Deller

Hi Günter,

Quoted 4 lines · Guenter Roeck
Quoted 3 lines · Helge Deller

Switch away from the own cpu topology code to common code which is used by ARM64 and RISCV. That will allow us to enable CPU hotplug later on.

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

This patch results in the following traceback when booting generic-32bit_defconfig - SMP in qemu.

That's strange, because I just built this generic-32bit_defconfig myself and it boots up nicely in qemu for me. The only thing missing is CONFIG_CGROUPS=y so that systemd can start.

Did you disable SMP (that is what - SMP was supposed to mean) ? Also, note that the system does boot fine, it just spits out the warning.

Quoted 2 lines

I'm not sure how I can debug/reproduce your bug report...

I see the problem with generic-32bit_defconfig if I disable SMP. I normally have some other (debug) options enabled, but I confirmed that it is sufficient to disable SMP. The actual command line should not matter, but here is one of mine as example (for booting from initrd). I currently use qemu v6.2.

qemu-system-hppa -kernel vmlinux \
    -no-reboot -initrd rootfs.cpio \
    -device e1000,netdev=net0 -netdev user,id=net0 \
    -append "panic=-1 slub_debug=FZPUA rdinit=/sbin/init console=ttyS0,115200" \
    -nographic -monitor null

Guenter

maintainer
#3 lore raw

Hi Günter,

* Guenter Roeck <[email protected]>:

Quoted 13 lines · Helge Deller
Quoted 12 lines

Hi Günter,

Quoted 8 lines · Guenter Roeck
Quoted 4 lines · Helge Deller

Switch away from the own cpu topology code to common code which is used by ARM64 and RISCV. That will allow us to enable CPU hotplug later on.

This patch results in the following traceback when booting generic-32bit_defconfig - SMP in qemu.

Quoted 7 lines
Quoted 4 lines

That's strange, because I just built this generic-32bit_defconfig myself and it boots up nicely in qemu for me. The only thing missing is CONFIG_CGROUPS=y so that systemd can start.

Did you disable SMP (that is what - SMP was supposed to mean) ? Also, note that the system does boot fine, it just spits out the warning.

The patch below fixes the warning for me.
Could you try?

Helge

From: Helge Deller <[email protected]>
Subject: [PATCH] parisc: Re-enable GENERIC_CPU_DEVICES for !SMP

In commit 62773112acc5 ("parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY") GENERIC_CPU_DEVICES was unconditionally turned off, but this triggers a warning in topology_add_dev(). Turning it back on for the !SMP case avoids this warning.

Fixes 62773112acc5 ("parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY")
arch/parisc/Kconfig +1 -0
index 52e550b45692..bd22578859d0 100644
@@ -38,6 +38,7 @@ config PARISC
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
 	select GENERIC_SMP_IDLE_THREAD
 	select GENERIC_ARCH_TOPOLOGY if SMP
+	select GENERIC_CPU_DEVICES if !SMP
 	select GENERIC_LIB_DEVMEM_IS_ALLOWED
 	select SYSCTL_ARCH_UNALIGN_ALLOW
 	select SYSCTL_EXCEPTION_TRACE
#4 lore raw
Quoted 21 lines · Helge Deller

Hi Günter,

* Guenter Roeck <[email protected]>:

Quoted 18 lines · Helge Deller
Quoted 16 lines

Hi Günter,

Quoted 8 lines · Guenter Roeck
Quoted 4 lines · Helge Deller

Switch away from the own cpu topology code to common code which is used by ARM64 and RISCV. That will allow us to enable CPU hotplug later on.

This patch results in the following traceback when booting generic-32bit_defconfig - SMP in qemu.

That's strange, because I just built this generic-32bit_defconfig myself and it boots up nicely in qemu for me. The only thing missing is CONFIG_CGROUPS=y so that systemd can start.

Quoted 6 lines
Quoted 2 lines

Did you disable SMP (that is what - SMP was supposed to mean) ? Also, note that the system does boot fine, it just spits out the warning.

The patch below fixes the warning for me.
Could you try?

I did, and it fixes the problem. I just sent a Tested-by: in response to your patch.

Guenter

Quoted 27 lines

Helge

From: Helge Deller <[email protected]>
Subject: [PATCH] parisc: Re-enable GENERIC_CPU_DEVICES for !SMP

In commit 62773112acc5 ("parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY") GENERIC_CPU_DEVICES was unconditionally turned off, but this triggers a warning in topology_add_dev(). Turning it back on for the !SMP case avoids this warning.

Fixes 62773112acc5 ("parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY")
arch/parisc/Kconfig +1 -0
index 52e550b45692..bd22578859d0 100644
@@ -38,6 +38,7 @@ config PARISC
  	select ARCH_HAVE_NMI_SAFE_CMPXCHG
  	select GENERIC_SMP_IDLE_THREAD
  	select GENERIC_ARCH_TOPOLOGY if SMP
+	select GENERIC_CPU_DEVICES if !SMP
  	select GENERIC_LIB_DEVMEM_IS_ALLOWED
  	select SYSCTL_ARCH_UNALIGN_ALLOW
  	select SYSCTL_EXCEPTION_TRACE
maintainer
#5 lore raw
Quoted 25 lines · Guenter Roeck
Quoted 24 lines · Helge Deller

Hi Günter,

* Guenter Roeck <[email protected]>:

Quoted 20 lines · Helge Deller
Quoted 7 lines

Hi Günter,

Quoted 4 lines · Guenter Roeck
Quoted 3 lines · Helge Deller

Switch away from the own cpu topology code to common code which is used by ARM64 and RISCV. That will allow us to enable CPU hotplug later on.

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

This patch results in the following traceback when booting generic-32bit_defconfig - SMP in qemu.

That's strange, because I just built this generic-32bit_defconfig myself and it boots up nicely in qemu for me. The only thing missing is CONFIG_CGROUPS=y so that systemd can start.

Did you disable SMP (that is what - SMP was supposed to mean) ? Also, note that the system does boot fine, it just spits out the warning.

Quoted 6 lines
Quoted 3 lines

The patch below fixes the warning for me.
Could you try?

I did, and it fixes the problem. I just sent a Tested-by: in response to your patch.

Thanks for testing !!
Helge

Quoted 31 lines

Guenter

Quoted 27 lines

Helge

From: Helge Deller <[email protected]>
Subject: [PATCH] parisc: Re-enable GENERIC_CPU_DEVICES for !SMP

In commit 62773112acc5 ("parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY") GENERIC_CPU_DEVICES was unconditionally turned off, but this triggers a warning in topology_add_dev(). Turning it back on for the !SMP case avoids this warning.

Fixes 62773112acc5 ("parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY")
arch/parisc/Kconfig +0 -0
index 52e550b45692..bd22578859d0 100644
@@ -38,6 +38,7 @@ config PARISC

      select ARCH_HAVE_NMI_SAFE_CMPXCHG
      select GENERIC_SMP_IDLE_THREAD
      select GENERIC_ARCH_TOPOLOGY if SMP
+    select GENERIC_CPU_DEVICES if !SMP
      select GENERIC_LIB_DEVMEM_IS_ALLOWED
      select SYSCTL_ARCH_UNALIGN_ALLOW
      select SYSCTL_EXCEPTION_TRACE