diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2019-09-05 20:50:41 +1000 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-09-06 16:59:59 +1000 |
commit | fa161cd89fbf6f543f302651a0fd447b8dfc8b06 (patch) | |
tree | 533fe230300e57761a7210a251ddd4d357519505 /hw/psi.c | |
parent | fb2f03ea913793caa5f82e1181d1efd5c159ca91 (diff) | |
download | skiboot-fa161cd89fbf6f543f302651a0fd447b8dfc8b06.zip skiboot-fa161cd89fbf6f543f302651a0fd447b8dfc8b06.tar.gz skiboot-fa161cd89fbf6f543f302651a0fd447b8dfc8b06.tar.bz2 |
hw/psi-p9: Mask OPAL-owned LSIs without handlers
Some versions of Swift have the TPM interrupt line of the second chip
pulled up instead of down. This causes the PSI's external (TPM) interrupt
to constantly re-fire since it's an LSI and the interrupt signal is
constantly active. There's nothing that can be done to clear the underlying
interrupt condition so we to ensure that it's masked.
The problem isn't really specific to the external interrupt and will
occur for any of the PSI interrupts that don't have an actual handler
(FSP, global error, and sometimes the external). When one of these is
delivered to OPAL we should log that it happened and mask it to prevent
re-firing.
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'hw/psi.c')
-rw-r--r-- | hw/psi.c | 35 |
1 files changed, 29 insertions, 6 deletions
@@ -531,6 +531,30 @@ static const char *psi_p9_irq_names[P9_PSI_NUM_IRQS] = { "psu" }; +static void psi_p9_mask_unhandled_irq(struct irq_source *is, uint32_t isn) +{ + struct psi *psi = is->data; + int idx = isn - psi->interrupt; + const char *name; + + if (idx < ARRAY_SIZE(psi_p9_irq_names)) + name = psi_p9_irq_names[idx]; + else + name = "unknown!"; + + prerror("PSI[0x%03x]: Masking unhandled LSI %d (%s)\n", + psi->chip_id, idx, name); + + /* + * All the PSI interrupts are LSIs and will be constantly re-fired + * unless the underlying interrupt condition is cleared. If we don't + * have a handler for the interrupt then it needs to be masked to + * prevent the IRQ from locking up the thread which handles it. + */ + xive_source_mask(is, isn); + +} + static void psihb_p9_interrupt(struct irq_source *is, uint32_t isn) { struct psi *psi = is->data; @@ -543,21 +567,17 @@ static void psihb_p9_interrupt(struct irq_source *is, uint32_t isn) case P9_PSI_IRQ_OCC: occ_p9_interrupt(psi->chip_id); break; - case P9_PSI_IRQ_FSI: - printf("PSI: FSI irq received\n"); - break; case P9_PSI_IRQ_LPCHC: lpc_interrupt(psi->chip_id); break; case P9_PSI_IRQ_LOCAL_ERR: prd_psi_interrupt(psi->chip_id); break; - case P9_PSI_IRQ_GLOBAL_ERR: - printf("PSI: Global error irq received\n"); - break; case P9_PSI_IRQ_EXTERNAL: if (platform.external_irq) platform.external_irq(psi->chip_id); + else + psi_p9_mask_unhandled_irq(is, isn); break; case P9_PSI_IRQ_LPC_SIRQ0: case P9_PSI_IRQ_LPC_SIRQ1: @@ -575,6 +595,9 @@ static void psihb_p9_interrupt(struct irq_source *is, uint32_t isn) case P9_PSI_IRQ_PSU: p9_sbe_interrupt(psi->chip_id); break; + + default: + psi_p9_mask_unhandled_irq(is, isn); } } |