Re: [PATCH] parisc: irq: Trace hardirq state in do_cpu_irq_mask()

From: Helge Deller

Date: Wed Nov 18 2026 - 17:03:44 EST


On 11/8/26 20:20, Karl Mehltretter wrote:
intr_extint calls do_cpu_irq_mask() with PSW[I] already clear. Since
commit 044d0d6de9f5 ("lockdep: Only trace IRQ edges"), its
local_irq_disable() then skips trace_hardirqs_off(), and lockdep
assertions fail in the timer tick:

WARNING: kernel/rcu/tree.c:2739 at rcu_sched_clock_irq+0x618/0x1f84

The return to a context with PSW[I] set has not been annotated since
TRACE_IRQFLAGS_SUPPORT was enabled. Annotate both transitions.

Fixes: 366dd4ea9d5f ("parisc: Fix ftrace function tracer")
Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>
---
Assisted by an LLM.

Tested under QEMU hppa (32-bit, -smp 2, PREEMPT, PROVE_LOCKING) on
mainline d48723711bae: 13 to 18 lockdep warnings per boot before, none
after (two boots each and one with ftrace=irqsoff). Locking selftests
pass.

The exit annotation assumes intr_return does not call
preempt_schedule_irq(). It currently never does: intr_do_preempt tests
PSW_D rather than PSW_I ("bb,<,n %r20, 31 - PSW_SM_I"), and a kprobe
saw no calls. Fixing that needs the same annotation after
preempt_schedule_irq().

arch/parisc/kernel/irq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
applied.

Thanks!
Helge