Skip to content

Commit 621c100

Browse files
lbmengalistair23
authored andcommitted
hw/riscv: sifive_gpio: Do not blindly trigger output IRQs
At present the GPIO output IRQs are triggered each time any GPIO register is written. However this is not correct. We should only trigger the output IRQ when the pin is configured as output enable. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Message-id: [email protected] Message-Id: <[email protected]> Signed-off-by: Alistair Francis <[email protected]>
1 parent 8a88b9f commit 621c100

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hw/riscv/sifive_gpio.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ static void update_state(SIFIVEGPIOState *s)
7676
actual_value = pull;
7777
}
7878

79-
qemu_set_irq(s->output[i], actual_value);
79+
if (output_en) {
80+
qemu_set_irq(s->output[i], actual_value);
81+
}
8082

8183
/* Input value */
8284
ival = input_en && actual_value;

0 commit comments

Comments
 (0)