public inbox for linux-alpha@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Turner <mattst88@gmail.com>
To: Magnus Lindholm <linmag7@gmail.com>
Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
	Matt Turner <mattst88@gmail.com>
Subject: [PATCH] alpha: Fix arch_irqs_disabled_flags() to handle intermediate IPL levels
Date: Fri,  3 Apr 2026 11:01:19 -0400	[thread overview]
Message-ID: <20260403150119.488427-1-mattst88@gmail.com> (raw)

arch_irqs_disabled_flags() only considered IRQs disabled when IPL was
at IPL_MAX (7). However, PALcode enters interrupt handlers at
intermediate IPL levels (e.g., IPL_DEV1=4, IPL_TIMER=5), which also
have interrupts disabled at that level and below.

This caused a lockdep warning when TRACE_IRQFLAGS_SUPPORT was enabled:
lockdep_hardirqs_off() calls irqs_disabled() inside an interrupt
handler and expects it to return true, but the intermediate IPL didn't
match the IPL_MAX check.

Fix by treating any IPL above IPL_MIN as interrupts disabled.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
 arch/alpha/include/asm/irqflags.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git ./arch/alpha/include/asm/irqflags.h ./arch/alpha/include/asm/irqflags.h
index 9f25d4e0d37e..80a01702b03a 100644
--- ./arch/alpha/include/asm/irqflags.h
+++ ./arch/alpha/include/asm/irqflags.h
@@ -57,7 +57,7 @@ static inline void arch_local_irq_restore(unsigned long flags)
 
 static inline bool arch_irqs_disabled_flags(unsigned long flags)
 {
-	return flags == IPL_MAX;
+	return (flags & 7) > IPL_MIN;
 }
 
 static inline bool arch_irqs_disabled(void)
-- 
2.52.0


             reply	other threads:[~2026-04-03 15:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03 15:01 Matt Turner [this message]
2026-04-04  8:26 ` [PATCH] alpha: Fix arch_irqs_disabled_flags() to handle intermediate IPL levels Magnus Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260403150119.488427-1-mattst88@gmail.com \
    --to=mattst88@gmail.com \
    --cc=linmag7@gmail.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox