mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avi Weiss <thnkslprpt@gmail.com>
To: tglx@kernel.org
Cc: radu@rendec.net, linux-kernel@vger.kernel.org,
	Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] genirq: Report pending state for disabled IRQs
Date: Sat, 31 Oct 2026 21:57:16 +0200	[thread overview]
Message-ID: <20261031195716.194625-1-thnkslprpt@gmail.com> (raw)

irq_sim_get_irqchip_state() returns success without updating the
output argument when the simulated IRQ is disabled. This leaves
callers with the previous value rather than the pending state.

Read the pending bitmap regardless of whether the IRQ is enabled.

Fixes: 337cbeb2c13e ("genirq/irq_sim: Simplify the API")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---

 kernel/irq/irq_sim.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c
index 44747754530d..176100c074f8 100644
--- a/kernel/irq/irq_sim.c
+++ b/kernel/irq/irq_sim.c
@@ -58,8 +58,7 @@ static int irq_sim_get_irqchip_state(struct irq_data *data,
 
 	switch (which) {
 	case IRQCHIP_STATE_PENDING:
-		if (irq_ctx->enabled)
-			*state = test_bit(hwirq, irq_ctx->work_ctx->pending);
+		*state = test_bit(hwirq, irq_ctx->work_ctx->pending);
 		break;
 	default:
 		return -EINVAL;

base-commit: e9954f3fbddd25e1a01b7e5a0b72fb8b564204e0
-- 
2.53.0


                 reply	other threads:[~2026-10-31 19:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261031195716.194625-1-thnkslprpt@gmail.com \
    --to=thnkslprpt@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=radu@rendec.net \
    --cc=tglx@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®