[Skiboot] [PATCH/URGENT] occ: Fix clearing of OCC interrupt on remote fix

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Dec 5 07:42:09 AEDT 2014


If the OCC interrupt comes from another chip, we incorrectly try to clear
it on the local one. This causes hangs at boot on some machines.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---

diff --git a/hw/occ.c b/hw/occ.c
index 9d8001f..9e62e57 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -524,13 +524,13 @@ static void occ_tmgt_interrupt(void)
 	printf("OCC: TMGT interrupt !\n");
 }
 
-void occ_interrupt(void)
+void occ_interrupt(uint32_t chip_id)
 {
 	uint64_t ireg;
 	int64_t rc;
 
 	/* The OCC interrupt is used to mux up to 15 different sources */
-	rc = xscom_readme(OCB_OCI_OCCMISC, &ireg);
+	rc = xscom_read(chip_id, OCB_OCI_OCCMISC, &ireg);
 	if (rc) {
 		prerror("OCC: Failed to read interrupt status !\n");
 		/* Should we mask it in the XIVR ? */
@@ -539,7 +539,7 @@ void occ_interrupt(void)
 	prlog(PR_TRACE, "OCC: IRQ received: %04llx\n", ireg >> 48);
 
 	/* Clear the bits */
-	xscom_writeme(OCB_OCI_OCCMISC_AND, ~ireg);
+	xscom_write(chip_id, OCB_OCI_OCCMISC_AND, ~ireg);
 
 	/* Dispatch */
 	if (ireg & OCB_OCI_OCIMISC_IRQ_TMGT)
diff --git a/hw/psi.c b/hw/psi.c
index 1dba69a..70403fd 100644
--- a/hw/psi.c
+++ b/hw/psi.c
@@ -278,7 +278,7 @@ static void handle_extra_interrupt(struct psi *psi)
 	 * when available.
 	 */
 	if (val & PSIHB_IRQ_STAT_OCC)
-		occ_interrupt();
+		occ_interrupt(psi->chip_id);
 	if (val & PSIHB_IRQ_STAT_FSI)
 		printf("PSI: FSI irq received\n");
 	if (val & PSIHB_IRQ_STAT_LPC) {
diff --git a/include/skiboot.h b/include/skiboot.h
index d2e1be0..1a684b9 100644
--- a/include/skiboot.h
+++ b/include/skiboot.h
@@ -209,7 +209,7 @@ extern void uart_setup_linux_passthrough(void);
 extern void uart_setup_opal_console(void);
 
 /* OCC interrupt */
-extern void occ_interrupt(void);
+extern void occ_interrupt(uint32_t chip_id);
 extern void occ_send_dummy_interrupt(void);
 
 /* Flatten device-tree */




More information about the Skiboot mailing list