[Skiboot] [PATCH 12/24] psi: Switch to ESB mode later

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Jun 23 02:22:13 AEST 2017


There's an errata, if we switch to ESB mode before setting up
the various ESB mode related registers, a pending interrupts
can go wrong.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 hw/psi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/psi.c b/hw/psi.c
index c98babf..9da0257 100644
--- a/hw/psi.c
+++ b/hw/psi.c
@@ -826,10 +826,6 @@ static void psi_init_p9_interrupts(struct psi *psi)
 	bool is_p9ndd1;
 	u64 val;
 
-	/* Reset irq handling and switch to ESB mode */
-	out_be64(psi->regs + PSIHB_INTERRUPT_CONTROL, PSIHB_IRQ_RESET);
-	out_be64(psi->regs + PSIHB_INTERRUPT_CONTROL, 0);
-
 	/* Grab chip */
 	chip = get_chip(psi->chip_id);
 	if (!chip)
@@ -874,6 +870,10 @@ static void psi_init_p9_interrupts(struct psi *psi)
 					12, psi->esb_mmio, XIVE_SRC_LSI,
 					psi, &psi_p9_irq_ops);
 	}
+
+	/* Reset irq handling and switch to ESB mode */
+	out_be64(psi->regs + PSIHB_INTERRUPT_CONTROL, PSIHB_IRQ_RESET);
+	out_be64(psi->regs + PSIHB_INTERRUPT_CONTROL, 0);
 }
 
 static void psi_init_interrupts(struct psi *psi)
-- 
2.9.4



More information about the Skiboot mailing list