[PATCH] genirq: Report pending state for disabled IRQs

From: Avi Weiss

Date: Sat Oct 31 2026 - 15:57:41 EST


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@xxxxxxxxx>
---

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