[Skiboot] [PATCH 2/5] hw/phb4: Fix interrupt names

Oliver O'Halloran oohall at gmail.com
Tue Jan 21 18:28:35 AEDT 2020


Linux doesn't seem to parse the interrupt-names property when there are
unnamed (zero length string) interrupts. Add a name callback to the
interrupt source and go from there.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 hw/phb4.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/hw/phb4.c b/hw/phb4.c
index 0b7bf778a50e..2591c0390d5f 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -5613,9 +5613,26 @@ static uint64_t phb4_lsi_attributes(struct irq_source *is __unused,
 	return IRQ_ATTR_TARGET_LINUX;
 }
 
+static char *phb4_lsi_name(struct irq_source *is, uint32_t isn)
+{
+	struct phb4 *p = is->data;
+	uint32_t idx = isn - p->base_lsi;
+	char buf[32];
+
+	if (idx == PHB4_LSI_PCIE_INF)
+		snprintf(buf, 32, "phb#%04x-inf", p->phb.opal_id);
+	else if (idx == PHB4_LSI_PCIE_ER)
+		snprintf(buf, 32, "phb#%04x-err", p->phb.opal_id);
+	else
+		assert(0); /* PCIe LSIs should never be directed to OPAL */
+
+	return strdup(buf);
+}
+
 static const struct irq_source_ops phb4_lsi_ops = {
 	.interrupt = phb4_err_interrupt,
 	.attributes = phb4_lsi_attributes,
+	.name = phb4_lsi_name,
 };
 
 static __be64 lane_eq_default[8] = {
-- 
2.21.1



More information about the Skiboot mailing list