diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2019-09-05 20:50:39 +1000 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-09-06 16:59:59 +1000 |
commit | 4017085c4b2d8b93c1994702e70fe0a9387914d0 (patch) | |
tree | ce9390b84724f0418cdca23d80f6083cbde44139 /hw/psi.c | |
parent | e97391ae2bb5a146a5041453f9185326654264d9 (diff) | |
download | skiboot-4017085c4b2d8b93c1994702e70fe0a9387914d0.zip skiboot-4017085c4b2d8b93c1994702e70fe0a9387914d0.tar.gz skiboot-4017085c4b2d8b93c1994702e70fe0a9387914d0.tar.bz2 |
hw/psi: Add chip ID to interrupt names
Each chip has a separate PSI, but the interrupt names are the same for
both. Add the chip ID to the interrupt name of each to help differentiate
between the two.
Before:
$ ./count_irqs.py |grep psi:i2c
27: 13006 - XIVE-IRQ 2097147 Level opal-psi:i2c
507: 3447 - XIVE-IRQ 1048571 Level opal-psi:i2c
After:
$ ~/count_irqs.py |grep i2c
27: 4338 - XIVE-IRQ 2097147 Level opal-psi#8:i2c
507: 11668 - XIVE-IRQ 1048571 Level opal-psi#0:i2c
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw/psi.c')
-rw-r--r-- | hw/psi.c | 56 |
1 files changed, 33 insertions, 23 deletions
@@ -486,19 +486,24 @@ static char *psi_p8_irq_name(struct irq_source *is, uint32_t isn) { struct psi *psi = is->data; uint32_t idx = isn - psi->interrupt; + char tmp[30]; static const char *names[P8_IRQ_PSI_IRQ_COUNT] = { - "psi:fsp", - "psi:occ", - "psi:fsi", - "psi:lpchc", - "psi:local_err", - "psi:external", + "fsp", + "occ", + "fsi", + "lpchc", + "local_err", + "external", }; if (idx >= P8_IRQ_PSI_IRQ_COUNT) return NULL; - return strdup(names[idx]); + + snprintf(tmp, sizeof(tmp), "psi#%x:%s", + psi->chip_id, names[idx]); + + return strdup(tmp); } static const struct irq_source_ops psi_p8_irq_ops = { @@ -587,27 +592,32 @@ static char *psi_p9_irq_name(struct irq_source *is, uint32_t isn) { struct psi *psi = is->data; uint32_t idx = isn - psi->interrupt; + char tmp[30]; static const char *names[P9_PSI_NUM_IRQS] = { - "psi:fsp", - "psi:occ", - "psi:fsi", - "psi:lpchc", - "psi:local_err", - "psi:global_err", - "psi:external", - "psi:lpc_serirq_mux0", /* Have a callback to get name ? */ - "psi:lpc_serirq_mux1", /* Have a callback to get name ? */ - "psi:lpc_serirq_mux2", /* Have a callback to get name ? */ - "psi:lpc_serirq_mux3", /* Have a callback to get name ? */ - "psi:i2c", - "psi:dio", - "psi:psu" + "fsp", + "occ", + "fsi", + "lpchc", + "local_err", + "global_err", + "external", + "lpc_serirq_mux0", /* Have a callback to get name ? */ + "lpc_serirq_mux1", /* Have a callback to get name ? */ + "lpc_serirq_mux2", /* Have a callback to get name ? */ + "lpc_serirq_mux3", /* Have a callback to get name ? */ + "i2c", + "dio", + "psu" }; - if (idx >= P9_PSI_NUM_IRQS) + if (idx >= ARRAY_SIZE(names)) return NULL; - return strdup(names[idx]); + + snprintf(tmp, sizeof(tmp), "psi#%x:%s", + psi->chip_id, names[idx]); + + return strdup(tmp); } static const struct irq_source_ops psi_p9_irq_ops = { |