Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39f14e79 authored by Cédric Le Goater's avatar Cédric Le Goater Committed by Michael Ellerman
Browse files

powerpc/xmon: Add a dump of all XIVE interrupts



Modify the xmon 'dxi' command to query all interrupts if no IRQ number
is specified.

Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190814154754.23682-4-clg@kaod.org
parent b4868ff5
Loading
Loading
Loading
Loading
+21 −0
Original line number Original line Diff line number Diff line
@@ -2584,6 +2584,25 @@ static void dump_one_xive_irq(u32 num)
		    num, target, prio, lirq, rc);
		    num, target, prio, lirq, rc);
}
}


static void dump_all_xive_irq(void)
{
	unsigned int i;
	struct irq_desc *desc;

	for_each_irq_desc(i, desc) {
		struct irq_data *d = irq_desc_get_irq_data(desc);
		unsigned int hwirq;

		if (!d)
			continue;

		hwirq = (unsigned int)irqd_to_hwirq(d);
		/* IPIs are special (HW number 0) */
		if (hwirq)
			dump_one_xive_irq(hwirq);
	}
}

static void dump_xives(void)
static void dump_xives(void)
{
{
	unsigned long num;
	unsigned long num;
@@ -2601,6 +2620,8 @@ static void dump_xives(void)
	} else if (c == 'i') {
	} else if (c == 'i') {
		if (scanhex(&num))
		if (scanhex(&num))
			dump_one_xive_irq(num);
			dump_one_xive_irq(num);
		else
			dump_all_xive_irq();
		return;
		return;
	}
	}