From: "tip-bot2 for Nathan Chancellor" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Nathan Chancellor <nathan@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Jiri Slaby <jirislaby@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org
Subject: [tip: irq/core] genirq: Ensure flags in lock guard is consistently initialized
Date: Tue, 13 May 2025 07:46:44 -0000 [thread overview]
Message-ID: <174712240447.406.13492998074191262965.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250513-irq-guards-fix-flags-init-v1-1-1dca3f5992d6@kernel.org>
The following commit has been merged into the irq/core branch of tip:
Commit-ID: b5fcb6898202858ae8425bf0cd9cb5704735bd02
Gitweb: https://git.kernel.org/tip/b5fcb6898202858ae8425bf0cd9cb5704735bd02
Author: Nathan Chancellor <nathan@kernel.org>
AuthorDate: Tue, 13 May 2025 00:16:55 +02:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 13 May 2025 09:37:18 +02:00
genirq: Ensure flags in lock guard is consistently initialized
After the conversion to locking guards within the interrupt core code,
several builds with clang show the "Interrupts were enabled early"
WARN() in start_kernel() on boot.
In class_irqdesc_lock_constructor(), _t.flags is initialized via
__irq_get_desc_lock() within the _t initializer list. However, the C11
standard 6.7.9.23 states that the evaluation of the initialization list
expressions are indeterminately sequenced relative to one another,
meaning _t.flags could be initialized by __irq_get_desc_lock() then be
initialized to zero due to flags being absent from the initializer list.
To ensure _t.flags is consistently initialized, move the call to
__irq_get_desc_lock() and the assignment of its result to _t.lock out of
the designated initializer.
Fixes: 0f70a49f3fa3 ("genirq: Provide conditional lock guards")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/all/20250513-irq-guards-fix-flags-init-v1-1-1dca3f5992d6@kernel.org
---
kernel/irq/internals.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index bd2db6e..476a20f 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -176,10 +176,10 @@ __DEFINE_UNLOCK_GUARD(irqdesc_lock, struct irq_desc,
static inline class_irqdesc_lock_t class_irqdesc_lock_constructor(unsigned int irq, bool bus,
unsigned int check)
{
- class_irqdesc_lock_t _t = {
- .bus = bus,
- .lock = __irq_get_desc_lock(irq, &_t.flags, bus, check),
- };
+ class_irqdesc_lock_t _t = { .bus = bus, };
+
+ _t.lock = __irq_get_desc_lock(irq, &_t.flags, bus, check);
+
return _t;
}
prev parent reply other threads:[~2025-05-13 7:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-12 22:16 [PATCH] " Nathan Chancellor
2025-05-13 5:22 ` Jiri Slaby
2025-05-13 7:46 ` tip-bot2 for Nathan Chancellor [this message]
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=174712240447.406.13492998074191262965.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=maz@kernel.org \
--cc=nathan@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@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
all inboxes | Powered by JetHome®