diff options
Diffstat (limited to 'arch/powerpc/sysdev/xive/spapr.c')
| -rw-r--r-- | arch/powerpc/sysdev/xive/spapr.c | 23 | 
1 files changed, 21 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c index 55dc61cb4867..7ab5c6780997 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -18,6 +18,7 @@  #include <linux/delay.h>  #include <linux/libfdt.h> +#include <asm/machdep.h>  #include <asm/prom.h>  #include <asm/io.h>  #include <asm/smp.h> @@ -560,11 +561,11 @@ static int xive_spapr_get_ipi(unsigned int cpu, struct xive_cpu *xc)  static void xive_spapr_put_ipi(unsigned int cpu, struct xive_cpu *xc)  { -	if (!xc->hw_ipi) +	if (xc->hw_ipi == XIVE_BAD_IRQ)  		return;  	xive_irq_bitmap_free(xc->hw_ipi); -	xc->hw_ipi = 0; +	xc->hw_ipi = XIVE_BAD_IRQ;  }  #endif /* CONFIG_SMP */ @@ -645,6 +646,21 @@ static void xive_spapr_sync_source(u32 hw_irq)  	plpar_int_sync(0, hw_irq);  } +static int xive_spapr_debug_show(struct seq_file *m, void *private) +{ +	struct xive_irq_bitmap *xibm; +	char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); + +	list_for_each_entry(xibm, &xive_irq_bitmaps, list) { +		memset(buf, 0, PAGE_SIZE); +		bitmap_print_to_pagebuf(true, buf, xibm->bitmap, xibm->count); +		seq_printf(m, "bitmap #%d: %s", xibm->count, buf); +	} +	kfree(buf); + +	return 0; +} +  static const struct xive_ops xive_spapr_ops = {  	.populate_irq_data	= xive_spapr_populate_irq_data,  	.configure_irq		= xive_spapr_configure_irq, @@ -662,6 +678,7 @@ static const struct xive_ops xive_spapr_ops = {  #ifdef CONFIG_SMP  	.get_ipi		= xive_spapr_get_ipi,  	.put_ipi		= xive_spapr_put_ipi, +	.debug_show		= xive_spapr_debug_show,  #endif /* CONFIG_SMP */  	.name			= "spapr",  }; @@ -839,3 +856,5 @@ bool __init xive_spapr_init(void)  	pr_info("Using %dkB queues\n", 1 << (xive_queue_shift - 10));  	return true;  } + +machine_arch_initcall(pseries, xive_core_debug_init);  |