Re: BUG: spinlock bad magic on CPU#1, irq/39-firewire/245 (v6.18-rc4, ppc64)

Erhard Furtner <[email protected]> Tue, 11 Nov 2025 13:41:21 +0100
Newsgroups gmane.linux.kernel,gmane.linux.kernel.firewire.devel
Message-ID <[email protected]>
On 11/9/25 15:17, Erhard Furtner wrote:
> [...]
> firewire_ohci 0001:03:0e.0: added OHCI v1.0 device as card 0, 8 IR + 8 
> IT contexts, quirks 0x0
> BUG: spinlock bad magic on CPU#1, irq/39-firewire/245
>   lock: 0xc00000001f672618, .magic: 00000000, .owner: irq/39- 
> firewire/245, .owner_cpu: 1
> CPU: 1 UID: 0 PID: 245 Comm: irq/39-firewire Tainted: G N  6.18.0-rc4- 
> PMacG5 #1 PREEMPTLAZY
> Tainted: [N]=TEST
> Hardware name: PowerMac11,2 PPC970MP 0x440101 PowerMac
> Call Trace:
> [c000000005dafb20] [c000000000bc054c] __dump_stack+0x30/0x54 (unreliable)
> [c000000005dafb50] [c000000000bc04e4] dump_stack_lvl+0x98/0xd0
> [c000000005dafb90] [c0000000000f22a8] spin_dump+0x88/0xb4
> [c000000005dafc10] [c0000000000f1d4c] do_raw_spin_unlock+0xdc/0x164
> [c000000005dafc50] [c000000000bf65d0] _raw_spin_unlock+0x18/0x68
> [c000000005dafc70] [c0003d0013ce1d5c] 
> fw_core_handle_bus_reset+0xa98/0xb64 [firewire_core]
> [c000000005dafdc0] [c0003d0013d19aec] 
> handle_selfid_complete_event+0x610/0x764 [firewire_ohci]
> [c000000005dafe80] [c000000000106050] irq_thread_fn+0x40/0x9c
> [c000000005dafec0] [c000000000105ecc] irq_thread+0x1c0/0x298
> [c000000005daff60] [c0000000000b5e54] kthread+0x250/0x280
> [c000000005daffe0] [c00000000000bd30] start_kernel_thread+0x14/0x18
I bisected the issue. First bad commit is:

  # git bisect good
7d138cb269dbd2fa9b0da89a9c10503d1cf269d5 is the first bad commit
commit 7d138cb269dbd2fa9b0da89a9c10503d1cf269d5
Author: Takashi Sakamoto <[email protected]>
Date:   Tue Sep 16 08:47:44 2025 +0900

     firewire: core: use spin lock specific to topology map

     At present, the operation for read transaction to topology map 
register is
     not protected by any kind of lock primitives. This causes a potential
     problem to result in the mixed content of topology map.

     This commit adds and uses spin lock specific to topology map.

     Link: 
https://lore.kernel.org/r/[email protected]
     Signed-off-by: Takashi Sakamoto <[email protected]>

  drivers/firewire/core-topology.c    | 22 ++++++++++++++--------
  drivers/firewire/core-transaction.c |  6 +++++-
  include/linux/firewire.h            |  6 +++++-
  3 files changed, 24 insertions(+), 10 deletions(-)


Bisect.log attached.

Regards,
Erhard F.
bisect.log (text/x-log, 3.2 KB)
git bisect start
# Status: warte auf guten und schlechten Commit
# good: [e5f0a698b34ed76002dc5cff3804a61c80233a7a] Linux 6.17
git bisect good e5f0a698b34ed76002dc5cff3804a61c80233a7a
# Status: warte auf schlechten Commit, 1 guter Commit bekannt
# bad: [e9a6fb0bcdd7609be6969112f3fbfcce3b1d4a7c] Linux 6.18-rc5
git bisect bad e9a6fb0bcdd7609be6969112f3fbfcce3b1d4a7c
# bad: [f79e772258df311c2cb21594ca0996318e720d28] Merge tag 'media/v6.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
git bisect bad f79e772258df311c2cb21594ca0996318e720d28
# bad: [0f048c878ee32a4259dbf28e0ad8fd0b71ee0085] Merge tag 'soc-dt-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
git bisect bad 0f048c878ee32a4259dbf28e0ad8fd0b71ee0085
# good: [c050daf69f3edf72e274eaa321f663b1779c4391] Merge tag 'pwm/for-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux
git bisect good c050daf69f3edf72e274eaa321f663b1779c4391
# bad: [9792d660a4e91d31a6b1af105ae3f1c29107e94b] Merge tag 'devicetree-for-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
git bisect bad 9792d660a4e91d31a6b1af105ae3f1c29107e94b
# bad: [f07c3695bf65220a69a848478bd9099bdeaafa78] Merge tag 'firewire-updates-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
git bisect bad f07c3695bf65220a69a848478bd9099bdeaafa78
# good: [ea1c6c592522208df1dcac9e8f1deb7cc56a51b7] Merge tag 'spi-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
git bisect good ea1c6c592522208df1dcac9e8f1deb7cc56a51b7
# good: [2d274536245b58a43753a23d84dfadc9df1df489] Merge tag 'mmc-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
git bisect good 2d274536245b58a43753a23d84dfadc9df1df489
# good: [b4918003cf54f99004c136c26f96b6df7ab49fac] Merge tag 'mfd-next-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
git bisect good b4918003cf54f99004c136c26f96b6df7ab49fac
# bad: [e31b990cafd49a8c56eac55094c1a783f5826b47] firewire: core: code refactoring for the case of generation mismatch
git bisect bad e31b990cafd49a8c56eac55094c1a783f5826b47
# good: [a4bac55d99d37976209e2fc2c32bd3dfc86b0447] firewire: core: code refactoring whether root node is cycle master capable
git bisect good a4bac55d99d37976209e2fc2c32bd3dfc86b0447
# bad: [420bd7068cbfaea0a857472dd631dc48311e2a8f] firewire: core: use spin lock specific to transaction
git bisect bad 420bd7068cbfaea0a857472dd631dc48311e2a8f
# good: [379b870c28c6a615a101df7986eba70fea99eff7] firewire: core: use helper macros instead of direct access to HZ
git bisect good 379b870c28c6a615a101df7986eba70fea99eff7
# good: [80c5b023a7d6ae41bd79aadece4cb1fc62e95a08] firewire: core: use scoped_guard() to manage critical section to update topology
git bisect good 80c5b023a7d6ae41bd79aadece4cb1fc62e95a08
# bad: [7d138cb269dbd2fa9b0da89a9c10503d1cf269d5] firewire: core: use spin lock specific to topology map
git bisect bad 7d138cb269dbd2fa9b0da89a9c10503d1cf269d5
# good: [07c446e35b89bc8774792f8036e595cffdf5b162] firewire: core: maintain phy packet receivers locally in cdev layer
git bisect good 07c446e35b89bc8774792f8036e595cffdf5b162
# first bad commit: [7d138cb269dbd2fa9b0da89a9c10503d1cf269d5] firewire: core: use spin lock specific to topology map