summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2019-09-10 04:18:50 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2019-09-13 10:58:47 -0400
commit855d9140a394229f21fd4fd216f377ed45bd93a3 (patch)
treed126c9150bcd8cc66ce1f5f4baf5389ea5f79d08
parent5896163f7f91c0560cc41908c808661eee4c4121 (diff)
powerpc/xmon: Fix output of XIVE IPI
When dumping the XIVE state of an CPU IPI, xmon does not check if the CPU is started or not which can cause an error. Add a check for that and change the output to be on one line just as the XIVE interrupts of the machine. Signed-off-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190910081850.26038-3-clg@kaod.org
-rw-r--r--arch/powerpc/sysdev/xive/common.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index b10919f08250..df832b09e3e9 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -237,25 +237,30 @@ static notrace void xive_dump_eq(const char *name, struct xive_q *q)
237 i0 = be32_to_cpup(q->qpage + idx); 237 i0 = be32_to_cpup(q->qpage + idx);
238 idx = (idx + 1) & q->msk; 238 idx = (idx + 1) & q->msk;
239 i1 = be32_to_cpup(q->qpage + idx); 239 i1 = be32_to_cpup(q->qpage + idx);
240 xmon_printf(" %s Q T=%d %08x %08x ...\n", name, 240 xmon_printf("%s idx=%d T=%d %08x %08x ...", name,
241 q->toggle, i0, i1); 241 q->idx, q->toggle, i0, i1);
242} 242}
243 243
244notrace void xmon_xive_do_dump(int cpu) 244notrace void xmon_xive_do_dump(int cpu)
245{ 245{
246 struct xive_cpu *xc = per_cpu(xive_cpu, cpu); 246 struct xive_cpu *xc = per_cpu(xive_cpu, cpu);
247 247
248 xmon_printf("XIVE state for CPU %d:\n", cpu); 248 xmon_printf("CPU %d:", cpu);
249 xmon_printf(" pp=%02x cppr=%02x\n", xc->pending_prio, xc->cppr); 249 if (xc) {
250 xive_dump_eq("IRQ", &xc->queue[xive_irq_priority]); 250 xmon_printf("pp=%02x CPPR=%02x ", xc->pending_prio, xc->cppr);
251
251#ifdef CONFIG_SMP 252#ifdef CONFIG_SMP
252 { 253 {
253 u64 val = xive_esb_read(&xc->ipi_data, XIVE_ESB_GET); 254 u64 val = xive_esb_read(&xc->ipi_data, XIVE_ESB_GET);
254 xmon_printf(" IPI state: %x:%c%c\n", xc->hw_ipi, 255
255 val & XIVE_ESB_VAL_P ? 'P' : 'p', 256 xmon_printf("IPI=0x%08x PQ=%c%c ", xc->hw_ipi,
256 val & XIVE_ESB_VAL_Q ? 'Q' : 'q'); 257 val & XIVE_ESB_VAL_P ? 'P' : '-',
257 } 258 val & XIVE_ESB_VAL_Q ? 'Q' : '-');
259 }
258#endif 260#endif
261 xive_dump_eq("EQ", &xc->queue[xive_irq_priority]);
262 }
263 xmon_printf("\n");
259} 264}
260 265
261int xmon_xive_get_irq_config(u32 hw_irq, struct irq_data *d) 266int xmon_xive_get_irq_config(u32 hw_irq, struct irq_data *d)