diff mbox series

[v3,8/8] powerpc/xive: improve debugging macros

Message ID 20170830194617.26621-9-clg@kaod.org (mailing list archive)
State Accepted
Commit 5f121292f0a0873fa2cd3a0292fb4860a8953f38
Headers show
Series guest exploitation of the XIVE interrupt controller | expand

Commit Message

Cédric Le Goater Aug. 30, 2017, 7:46 p.m. UTC
Having the CPU identifier in the debug logs is helpful when tracking
issues. Also add some more logging and fix a compile issue in
xive_do_source_eoi().

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/sysdev/xive/common.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Benjamin Herrenschmidt Sept. 1, 2017, 5:43 a.m. UTC | #1
On Wed, 2017-08-30 at 21:46 +0200, Cédric Le Goater wrote:
> Having the CPU identifier in the debug logs is helpful when tracking
> issues. Also add some more logging and fix a compile issue in
> xive_do_source_eoi().
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
>  arch/powerpc/sysdev/xive/common.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
> index 8fd58773c241..1c087ed7427f 100644
> --- a/arch/powerpc/sysdev/xive/common.c
> +++ b/arch/powerpc/sysdev/xive/common.c
> @@ -40,7 +40,8 @@
>  #undef DEBUG_ALL
>  
>  #ifdef DEBUG_ALL
> -#define DBG_VERBOSE(fmt...)	pr_devel(fmt)
> +#define DBG_VERBOSE(fmt, ...)	pr_devel("cpu %d - " fmt, \
> +					 smp_processor_id(), ## __VA_ARGS__)
>  #else
>  #define DBG_VERBOSE(fmt...)	do { } while(0)
>  #endif
> @@ -344,7 +345,7 @@ void xive_do_source_eoi(u32 hw_irq, struct xive_irq_data *xd)
>  			xive_esb_read(xd, XIVE_ESB_LOAD_EOI);
>  		else {
>  			eoi_val = xive_esb_read(xd, XIVE_ESB_SET_PQ_00);
> -			DBG_VERBOSE("eoi_val=%x\n", offset, eoi_val);
> +			DBG_VERBOSE("eoi_val=%x\n", eoi_val);
>  
>  			/* Re-trigger if needed */
>  			if ((eoi_val & XIVE_ESB_VAL_Q) && xd->trig_mmio)
> @@ -1004,6 +1005,9 @@ static void xive_ipi_eoi(struct irq_data *d)
>  {
>  	struct xive_cpu *xc = __this_cpu_read(xive_cpu);
>  
> +	DBG_VERBOSE("IPI eoi: irq=%d [0x%lx] (HW IRQ 0x%x) pending=%02x\n",
> +		    d->irq, irqd_to_hwirq(d), xc->hw_ipi, xc->pending_prio);
> +
>  	/* Handle possible race with unplug and drop stale IPIs */
>  	if (!xc)
>  		return;
diff mbox series

Patch

diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index 8fd58773c241..1c087ed7427f 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -40,7 +40,8 @@ 
 #undef DEBUG_ALL
 
 #ifdef DEBUG_ALL
-#define DBG_VERBOSE(fmt...)	pr_devel(fmt)
+#define DBG_VERBOSE(fmt, ...)	pr_devel("cpu %d - " fmt, \
+					 smp_processor_id(), ## __VA_ARGS__)
 #else
 #define DBG_VERBOSE(fmt...)	do { } while(0)
 #endif
@@ -344,7 +345,7 @@  void xive_do_source_eoi(u32 hw_irq, struct xive_irq_data *xd)
 			xive_esb_read(xd, XIVE_ESB_LOAD_EOI);
 		else {
 			eoi_val = xive_esb_read(xd, XIVE_ESB_SET_PQ_00);
-			DBG_VERBOSE("eoi_val=%x\n", offset, eoi_val);
+			DBG_VERBOSE("eoi_val=%x\n", eoi_val);
 
 			/* Re-trigger if needed */
 			if ((eoi_val & XIVE_ESB_VAL_Q) && xd->trig_mmio)
@@ -1004,6 +1005,9 @@  static void xive_ipi_eoi(struct irq_data *d)
 {
 	struct xive_cpu *xc = __this_cpu_read(xive_cpu);
 
+	DBG_VERBOSE("IPI eoi: irq=%d [0x%lx] (HW IRQ 0x%x) pending=%02x\n",
+		    d->irq, irqd_to_hwirq(d), xc->hw_ipi, xc->pending_prio);
+
 	/* Handle possible race with unplug and drop stale IPIs */
 	if (!xc)
 		return;