summary refs log tree commit diff stats
path: root/include/hw
diff options
context:
space:
mode:
authorGlenn Miles <milesg@linux.vnet.ibm.com>2024-05-24 13:24:14 -0500
committerNicholas Piggin <npiggin@gmail.com>2024-07-26 09:21:06 +1000
commitc6e07f03f7270799a26eb79e17ac40078ad94e5c (patch)
tree987dd44bc798cdc843f660034f53f91942430eec /include/hw
parent977e789c4a8ed813d4ab03f17ea20a575bf20cd1 (diff)
downloadfocaccia-qemu-c6e07f03f7270799a26eb79e17ac40078ad94e5c.tar.gz
focaccia-qemu-c6e07f03f7270799a26eb79e17ac40078ad94e5c.zip
ppc/pnv: Fix loss of LPC SERIRQ interrupts
The LPC HC irq status register bits are set when an LPC IRQSER input is
asserted. These irq status bits drive the PSI irq to the CPU interrupt
controller. The LPC HC irq status bits are cleared by software writing
to the register with 1's for the bits to clear.

Existing register write was clearing the irq status bits even when the
input was asserted, this results in interrupts being lost.

This fix changes the behavior to keep track of the device IRQ status
in internal state that is separate from the irq status register, and
only allowing the irq status bits to be cleared if the associated
input is not asserted.

Signed-off-by: Glenn Miles <milesg@linux.ibm.com>
[np: rebased before P9 PSI SERIRQ patch, adjust changelog/comments]
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/ppc/pnv_lpc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/hw/ppc/pnv_lpc.h b/include/hw/ppc/pnv_lpc.h
index 5d22c45570..97c6872c3f 100644
--- a/include/hw/ppc/pnv_lpc.h
+++ b/include/hw/ppc/pnv_lpc.h
@@ -73,6 +73,9 @@ struct PnvLpcController {
     uint32_t opb_irq_pol;
     uint32_t opb_irq_input;
 
+    /* LPC device IRQ state */
+    uint32_t lpc_hc_irq_inputs;
+
     /* LPC HC registers */
     uint32_t lpc_hc_fw_seg_idsel;
     uint32_t lpc_hc_fw_rd_acc_size;