Skip to contentSkip to conversation

Dovetail 6.1 arm64: Lockdep report while booting up

DISCUSSION Florian Bezdeka 2 participants 2 messages Nov 6, 2025 – Nov 7, 2025

lore
Share & tools
lore
#0 lore raw

Hi all,

I get the following lockdep report on 6.1, arm64. The uart port lock - which is a spinlock_t - is used in (inband) IRQ context, which seems wrong to me as well.

Dovetail specifics start in clockevents_register_proxy(), where we print out (printk) some details about the registered proxy tick device. That looks like

[    2.054973] CPU2: proxy tick device registered (62.50MHz)
[    2.055008] CPU0: proxy tick device registered (62.50MHz)
[    2.055159] CPU1: proxy tick device registered (62.50MHz)
[    2.055444] CPU3: proxy tick device registered (62.50MHz)

clockevents_register_proxy() is executed on all CPUs in parallel using an IPI mechanism. So we end up in (inband) IRQ context.

Input on how to solve that is welcome.

I should note that Jan tried to reproduce on his end as well. Obviously he was not able to trigger that. I have no idea why...

The code paths seems unchanged in newer releases as well. I haven't tested that yet, but I think they are affected as well.

[    2.218254] =============================
[    2.218324] [ BUG: Invalid wait context ]
[    2.218398] 6.1.155-cip47 #442 Not tainted
[    2.218561] -----------------------------
[    2.218575] swapper/1/0 is trying to lock:
[    2.218639] ffffff80038e0898 (&port_lock_key){....}-{3:3}, at: pl011_console_write+0x140/0x1c4
[    2.219156] other info that might help us debug this:
[    2.219198] context-{2:2}
[    2.219250] 2 locks held by swapper/1/0:
[    2.219295]  #0: ffffffc009c7f4c0 (console_lock){+.+.}-{0:0}, at: vprintk_emit+0x2ec/0x420
[    2.219407]  #1: ffffffc009c7f5c0 (console_owner){-...}-{0:0}, at: console_emit_next_record.constprop.0+0x168/0x36c
[    2.219481] stack backtrace:
[    2.219785] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.1.155-cip47 #442
[    2.219856] Hardware name: linux,dummy-virt (DT)
[    2.219883] IRQ stage: Linux
[    2.220148] Call trace:
[    2.220177]  dump_backtrace+0xe8/0x140
[    2.220241]  show_stack+0x20/0x30
[    2.220254]  dump_stack_lvl+0xa8/0xf4
[    2.220275]  dump_stack+0x18/0x28
[    2.220289]  __lock_acquire+0x918/0x1fe0
[    2.220308]  lock_acquire+0x1f8/0x324
[    2.220326]  _raw_spin_lock+0x58/0x70
[    2.220343]  pl011_console_write+0x140/0x1c4
[    2.220362]  console_emit_next_record.constprop.0+0x1b0/0x36c
[    2.220381]  console_unlock+0x1dc/0x240
[    2.220393]  vprintk_emit+0x324/0x420
[    2.220405]  vprintk_default+0x40/0x50
[    2.220417]  vprintk+0xdc/0x100
[    2.220429]  _printk+0x64/0x8c
[    2.220443]  clockevents_register_proxy+0x110/0x120
[    2.220462]  register_proxy_device+0x3c/0x80
[    2.220477]  __flush_smp_call_function_queue+0x160/0x30c
[    2.220495]  generic_smp_call_function_single_interrupt+0x1c/0x30
[    2.220511]  ipi_handler+0x68/0x400
[    2.220528]  handle_percpu_devid_irq+0x10c/0x1f4
[    2.220546]  handle_irq_desc+0x4c/0x6c
[    2.220560]  arch_do_IRQ_pipelined+0x4c/0x80
[    2.220577]  sync_current_irq_stage+0x1c4/0x2dc
[    2.220591]  __inband_irq_enable+0x84/0xa0
[    2.220604]  inband_irq_enable+0x1c/0x50
[    2.220618]  arch_cpu_idle+0x1c/0x2c
[    2.220635]  default_idle_call+0x90/0xe4
[    2.220651]  do_idle+0x2a8/0x340
[    2.220664]  cpu_startup_entry+0x3c/0x44
[    2.220677]  secondary_start_kernel+0x164/0x190
[    2.220693]  __secondary_switched+0xb0/0xb4

Best regards,
Florian

#1 lore raw
Quoted 74 lines · Florian Bezdeka

Hi all,

I get the following lockdep report on 6.1, arm64. The uart port lock - which is a spinlock_t - is used in (inband) IRQ context, which seems wrong to me as well.

Dovetail specifics start in clockevents_register_proxy(), where we print out (printk) some details about the registered proxy tick device. That looks like

[    2.054973] CPU2: proxy tick device registered (62.50MHz)
[    2.055008] CPU0: proxy tick device registered (62.50MHz)
[    2.055159] CPU1: proxy tick device registered (62.50MHz)
[    2.055444] CPU3: proxy tick device registered (62.50MHz)

clockevents_register_proxy() is executed on all CPUs in parallel using an IPI mechanism. So we end up in (inband) IRQ context.

Input on how to solve that is welcome.

I should note that Jan tried to reproduce on his end as well. Obviously he was not able to trigger that. I have no idea why...

The code paths seems unchanged in newer releases as well. I haven't tested that yet, but I think they are affected as well.

[    2.218254] =============================
[    2.218324] [ BUG: Invalid wait context ]
[    2.218398] 6.1.155-cip47 #442 Not tainted
[    2.218561] -----------------------------
[    2.218575] swapper/1/0 is trying to lock:
[    2.218639] ffffff80038e0898 (&port_lock_key){....}-{3:3}, at: pl011_console_write+0x140/0x1c4
[    2.219156] other info that might help us debug this:
[    2.219198] context-{2:2}
[    2.219250] 2 locks held by swapper/1/0:
[    2.219295]  #0: ffffffc009c7f4c0 (console_lock){+.+.}-{0:0}, at: vprintk_emit+0x2ec/0x420
[    2.219407]  #1: ffffffc009c7f5c0 (console_owner){-...}-{0:0}, at: console_emit_next_record.constprop.0+0x168/0x36c
[    2.219481] stack backtrace:
[    2.219785] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.1.155-cip47 #442
[    2.219856] Hardware name: linux,dummy-virt (DT)
[    2.219883] IRQ stage: Linux
[    2.220148] Call trace:
[    2.220177]  dump_backtrace+0xe8/0x140
[    2.220241]  show_stack+0x20/0x30
[    2.220254]  dump_stack_lvl+0xa8/0xf4
[    2.220275]  dump_stack+0x18/0x28
[    2.220289]  __lock_acquire+0x918/0x1fe0
[    2.220308]  lock_acquire+0x1f8/0x324
[    2.220326]  _raw_spin_lock+0x58/0x70
[    2.220343]  pl011_console_write+0x140/0x1c4
[    2.220362]  console_emit_next_record.constprop.0+0x1b0/0x36c
[    2.220381]  console_unlock+0x1dc/0x240
[    2.220393]  vprintk_emit+0x324/0x420
[    2.220405]  vprintk_default+0x40/0x50
[    2.220417]  vprintk+0xdc/0x100
[    2.220429]  _printk+0x64/0x8c
[    2.220443]  clockevents_register_proxy+0x110/0x120
[    2.220462]  register_proxy_device+0x3c/0x80
[    2.220477]  __flush_smp_call_function_queue+0x160/0x30c
[    2.220495]  generic_smp_call_function_single_interrupt+0x1c/0x30
[    2.220511]  ipi_handler+0x68/0x400
[    2.220528]  handle_percpu_devid_irq+0x10c/0x1f4
[    2.220546]  handle_irq_desc+0x4c/0x6c
[    2.220560]  arch_do_IRQ_pipelined+0x4c/0x80
[    2.220577]  sync_current_irq_stage+0x1c4/0x2dc
[    2.220591]  __inband_irq_enable+0x84/0xa0
[    2.220604]  inband_irq_enable+0x1c/0x50
[    2.220618]  arch_cpu_idle+0x1c/0x2c
[    2.220635]  default_idle_call+0x90/0xe4
[    2.220651]  do_idle+0x2a8/0x340
[    2.220664]  cpu_startup_entry+0x3c/0x44
[    2.220677]  secondary_start_kernel+0x164/0x190
[    2.220693]  __secondary_switched+0xb0/0xb4
Quoted 2 lines

Best regards,
Florian

This turned out to be a false positive of upstream kernels < 6.12. It was resolved by [1] there. Due to dependencies, backporting this was likely never considered.

Jan

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=daeed1595b4ddf314bad8ee40b2662e03fd012dc

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center