From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] powerpc/xive: Fix/improve verbose debug output
Date: Thu, 27 Apr 2017 15:57:26 +0200 [thread overview]
Message-ID: <1493301446.25766.276.camel@kernel.crashing.org> (raw)
The existing verbose debug code doesn't build when enabled.
This fixes it and generally improves the output to make it
more useful.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/sysdev/xive/common.c | 37 ++++++++++++++++++++++++++-----------
1 file changed, 26 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index 6a98efb..2305aa9 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -143,7 +143,6 @@ static u32 xive_scan_interrupts(struct xive_cpu *xc, bool just_peek)
struct xive_q *q;
prio = ffs(xc->pending_prio) - 1;
- DBG_VERBOSE("scan_irq: trying prio %d\n", prio);
/* Try to fetch */
irq = xive_read_eq(&xc->queue[prio], just_peek);
@@ -171,12 +170,18 @@ static u32 xive_scan_interrupts(struct xive_cpu *xc, bool just_peek)
}
/* If nothing was found, set CPPR to 0xff */
- if (irq == 0)
+ if (irq == 0) {
prio = 0xff;
+ DBG_VERBOSE("scan_irq(%d): nothing found\n", just_peek);
+ } else {
+ DBG_VERBOSE("scan_irq(%d): found irq %d prio %d\n",
+ just_peek, irq, prio);
+ }
/* Update HW CPPR to match if necessary */
if (prio != xc->cppr) {
- DBG_VERBOSE("scan_irq: adjusting CPPR to %d\n", prio);
+ DBG_VERBOSE("scan_irq(%d): adjusting CPPR %d->%d\n",
+ just_peek, xc->cppr, prio);
xc->cppr = prio;
out_8(xive_tima + xive_tima_offset + TM_CPPR, prio);
}
@@ -260,7 +265,7 @@ static unsigned int xive_get_irq(void)
/* Scan our queue(s) for interrupts */
irq = xive_scan_interrupts(xc, false);
- DBG_VERBOSE("get_irq: got irq 0x%x, new pending=0x%02x\n",
+ DBG_VERBOSE("get_irq: got irq %d new pending=0x%02x\n",
irq, xc->pending_prio);
/* Return pending interrupt if any */
@@ -282,7 +287,7 @@ static unsigned int xive_get_irq(void)
static void xive_do_queue_eoi(struct xive_cpu *xc)
{
if (xive_scan_interrupts(xc, true) != 0) {
- DBG_VERBOSE("eoi: pending=0x%02x\n", xc->pending_prio);
+ DBG_VERBOSE("eoi_irq: more pending !\n");
force_external_irq_replay();
}
}
@@ -327,11 +332,13 @@ void xive_do_source_eoi(u32 hw_irq, struct xive_irq_data *xd)
in_be64(xd->eoi_mmio);
else {
eoi_val = xive_poke_esb(xd, XIVE_ESB_SET_PQ_00);
- DBG_VERBOSE("eoi_val=%x\n", offset, eoi_val);
+ DBG_VERBOSE("hwirq 0x%x eoi_val=%x\n", hw_irq, eoi_val);
/* Re-trigger if needed */
- if ((eoi_val & XIVE_ESB_VAL_Q) && xd->trig_mmio)
+ if ((eoi_val & XIVE_ESB_VAL_Q) && xd->trig_mmio) {
+ DBG_VERBOSE(" -> eoi retrigger !\n");
out_be64(xd->trig_mmio, 0);
+ }
}
}
}
@@ -380,10 +387,15 @@ static void xive_do_source_set_mask(struct xive_irq_data *xd,
if (mask) {
val = xive_poke_esb(xd, XIVE_ESB_SET_PQ_01);
xd->saved_p = !!(val & XIVE_ESB_VAL_P);
- } else if (xd->saved_p)
- xive_poke_esb(xd, XIVE_ESB_SET_PQ_10);
- else
- xive_poke_esb(xd, XIVE_ESB_SET_PQ_00);
+ DBG_VERBOSE("masking val=%llx, sp=%d\n",
+ val, xd->saved_p);
+ } else {
+ DBG_VERBOSE("unmasking sp=%d\n", xd->saved_p);
+ if (xd->saved_p)
+ xive_poke_esb(xd, XIVE_ESB_SET_PQ_10);
+ else
+ xive_poke_esb(xd, XIVE_ESB_SET_PQ_00);
+ }
}
/*
@@ -526,6 +538,7 @@ static unsigned int xive_irq_startup(struct irq_data *d)
pr_devel("xive_irq_startup: irq %d [0x%x] data @%p\n",
d->irq, hw_irq, d);
+ pr_devel(" eoi_mmio=%p trig_mmio=%p\n", xd->eoi_mmio, xd->trig_mmio);
#ifdef CONFIG_PCI_MSI
/*
@@ -754,6 +767,8 @@ static int xive_irq_retrigger(struct irq_data *d)
if (WARN_ON(xd->flags & XIVE_IRQ_FLAG_LSI))
return 0;
+ DBG_VERBOSE("retrigger irq %d\n", d->irq);
+
/*
* To perform a retrigger, we first set the PQ bits to
* 11, then perform an EOI.
next reply other threads:[~2017-04-27 13:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-27 13:57 Benjamin Herrenschmidt [this message]
2017-04-28 3:07 ` [PATCH] powerpc/xive: Fix/improve verbose debug output Michael Ellerman
2017-04-28 5:20 ` Benjamin Herrenschmidt
2017-04-28 6:34 ` Michael Ellerman
2017-04-28 6:48 ` Benjamin Herrenschmidt
2017-04-28 9:58 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1493301446.25766.276.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.