[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/33] hw/intc/allwinner-a10-pic: Handle IRQ levels other than 0 o
From: |
Peter Maydell |
Subject: |
[PULL 24/33] hw/intc/allwinner-a10-pic: Handle IRQ levels other than 0 or 1 |
Date: |
Mon, 19 Jun 2023 15:29:05 +0100 |
In commit 2c5fa0778c3b430 we fixed an endianness bug in the Allwinner
A10 PIC model; however in the process we introduced a regression.
This is because the old code was robust against the incoming 'level'
argument being something other than 0 or 1, whereas the new code was
not.
In particular, the allwinner-sdhost code treats its IRQ line
as 0-vs-non-0 rather than 0-vs-1, so when the SD controller
set its IRQ line for any reason other than transmit the
interrupt controller would ignore it. The observed effect
was a guest timeout when rebooting the guest kernel.
Handle level values other than 0 or 1, to restore the old
behaviour.
Fixes: 2c5fa0778c3b430 ("hw/intc/allwinner-a10-pic: Don't use
set_bit()/clear_bit()")
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Message-id: 20230606104609.3692557-2-peter.maydell@linaro.org
---
hw/intc/allwinner-a10-pic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/intc/allwinner-a10-pic.c b/hw/intc/allwinner-a10-pic.c
index 4875e68ba6a..d0bf8d545ba 100644
--- a/hw/intc/allwinner-a10-pic.c
+++ b/hw/intc/allwinner-a10-pic.c
@@ -51,7 +51,7 @@ static void aw_a10_pic_set_irq(void *opaque, int irq, int
level)
AwA10PICState *s = opaque;
uint32_t *pending_reg = &s->irq_pending[irq / 32];
- *pending_reg = deposit32(*pending_reg, irq % 32, 1, level);
+ *pending_reg = deposit32(*pending_reg, irq % 32, 1, !!level);
aw_a10_pic_update(s);
}
--
2.34.1
- [PULL 25/33] hw/sd/allwinner-sdhost: Don't send non-boolean IRQ line levels, (continued)
- [PULL 25/33] hw/sd/allwinner-sdhost: Don't send non-boolean IRQ line levels, Peter Maydell, 2023/06/19
- [PULL 19/33] target/arm: Convert load (pointer auth) insns to decodetree, Peter Maydell, 2023/06/19
- [PULL 31/33] hw/misc/bcm2835_property: Use 'raspberrypi-fw-defs.h' definitions, Peter Maydell, 2023/06/19
- [PULL 22/33] target/arm: Convert load/store single structure to decodetree, Peter Maydell, 2023/06/19
- [PULL 23/33] target/arm: Convert load/store tags insns to decodetree, Peter Maydell, 2023/06/19
- [PULL 30/33] hw/arm/raspi: Import Linux raspi definitions as 'raspberrypi-fw-defs.h', Peter Maydell, 2023/06/19
- [PULL 28/33] imx_serial: set wake bit when we receive a data byte, Peter Maydell, 2023/06/19
- [PULL 29/33] docs: sbsa: document board to firmware interface, Peter Maydell, 2023/06/19
- [PULL 33/33] hw/misc/bcm2835_property: Handle CORE_CLK_ID firmware property, Peter Maydell, 2023/06/19
- [PULL 17/33] target/arm: Convert LDR/STR reg+reg to decodetree, Peter Maydell, 2023/06/19
- [PULL 24/33] hw/intc/allwinner-a10-pic: Handle IRQ levels other than 0 or 1,
Peter Maydell <=
- [PULL 20/33] target/arm: Convert LDAPR/STLR (imm) to decodetree, Peter Maydell, 2023/06/19
- [PULL 21/33] target/arm: Convert load/store (multiple structures) to decodetree, Peter Maydell, 2023/06/19
- [PULL 27/33] hw/arm/Kconfig: sbsa-ref uses Bochs display, Peter Maydell, 2023/06/19
- [PULL 26/33] hw/timer/nrf51_timer: Don't lose time when timer is queried in tight loop, Peter Maydell, 2023/06/19
- [PULL 32/33] hw/misc/bcm2835_property: Replace magic frequency values by definitions, Peter Maydell, 2023/06/19
- Re: [PULL 00/33] target-arm queue, Richard Henderson, 2023/06/19