summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Henrique Barboza <danielhb413@gmail.com>2022-08-03 20:32:04 -0300
committerDaniel Henrique Barboza <danielhb413@gmail.com>2022-08-04 15:20:14 -0300
commited021daf2d6c19499ae406055156dc19c073228f (patch)
tree3964e59088152d12cf24a54d1aa81054a2f5a911
parent2480f3bbd03814b0651a1f74959f5c6631ee5819 (diff)
hw/ppc: sam460ex.c: store all GPIO lines in mal_irqs[]
We're not storing all GPIO lines we're retrieving with qdev_get_gpio_in() in mal_irqs[]. We're storing just the last one in the first index: for (i = 0; i < ARRAY_SIZE(mal_irqs); i++) { mal_irqs[0] = qdev_get_gpio_in(uic[2], 3 + i); } ppc4xx_mal_init(env, 4, 16, mal_irqs); mal_irqs is used in ppc4xx_mal_init() to assign the IRQs to MAL: for (i = 0; i < 4; i++) { mal->irqs[i] = irqs[i]; } Since only irqs[0] has been initialized, mal->irqs[1,2,3] are being zeroed. This doesn´t seem to trigger any apparent issues at this moment, but Cedric's QOMification of the MAL device [1] is executing a sysbus_connect_irq() that will fail if we do not store all GPIO lines properly. [1] https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg00497.html Cc: Peter Maydell <peter.maydell@linaro.org> Cc: BALATON Zoltan <balaton@eik.bme.hu> Fixes: 706e944206d7 ("hw/ppc/sam460ex: Drop use of ppcuic_init()") Acked-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20220803233204.2724202-1-danielhb413@gmail.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
-rw-r--r--hw/ppc/sam460ex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 7e8da657c2..0357ee077f 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -384,7 +384,7 @@ static void sam460ex_init(MachineState *machine)
/* MAL */
for (i = 0; i < ARRAY_SIZE(mal_irqs); i++) {
- mal_irqs[0] = qdev_get_gpio_in(uic[2], 3 + i);
+ mal_irqs[i] = qdev_get_gpio_in(uic[2], 3 + i);
}
ppc4xx_mal_init(env, 4, 16, mal_irqs);