Skip to content

Commit

Permalink
powerpc/xive: Replace pr_devel() by pr_debug() to ease debug
Browse files Browse the repository at this point in the history
These routines are not on hot code paths and pr_debug() is easier to
activate. Also add a '0x' prefix to hex printed values (HW IRQ number).

Signed-off-by: Cédric Le Goater <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
legoater authored and mpe committed Nov 25, 2021
1 parent d02fa40 commit 44b9c8d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 33 deletions.
29 changes: 15 additions & 14 deletions arch/powerpc/sysdev/xive/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ static void xive_do_source_set_mask(struct xive_irq_data *xd,
{
u64 val;

pr_debug("%s: HW 0x%x %smask\n", __func__, xd->hw_irq, mask ? "" : "un");

/*
* If the interrupt had P set, it may be in a queue.
*
Expand Down Expand Up @@ -612,8 +614,8 @@ static unsigned int xive_irq_startup(struct irq_data *d)

xd->saved_p = false;
xd->stale_p = false;
pr_devel("xive_irq_startup: irq %d [0x%x] data @%p\n",
d->irq, hw_irq, d);

pr_debug("%s: irq %d [0x%x] data @%p\n", __func__, d->irq, hw_irq, d);

/* Pick a target */
target = xive_pick_irq_target(d, irq_data_get_affinity_mask(d));
Expand Down Expand Up @@ -654,8 +656,7 @@ static void xive_irq_shutdown(struct irq_data *d)
struct xive_irq_data *xd = irq_data_get_irq_handler_data(d);
unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d);

pr_devel("xive_irq_shutdown: irq %d [0x%x] data @%p\n",
d->irq, hw_irq, d);
pr_debug("%s: irq %d [0x%x] data @%p\n", __func__, d->irq, hw_irq, d);

if (WARN_ON(xd->target == XIVE_INVALID_TARGET))
return;
Expand All @@ -679,7 +680,7 @@ static void xive_irq_unmask(struct irq_data *d)
{
struct xive_irq_data *xd = irq_data_get_irq_handler_data(d);

pr_devel("xive_irq_unmask: irq %d data @%p\n", d->irq, xd);
pr_debug("%s: irq %d data @%p\n", __func__, d->irq, xd);

xive_do_source_set_mask(xd, false);
}
Expand All @@ -688,7 +689,7 @@ static void xive_irq_mask(struct irq_data *d)
{
struct xive_irq_data *xd = irq_data_get_irq_handler_data(d);

pr_devel("xive_irq_mask: irq %d data @%p\n", d->irq, xd);
pr_debug("%s: irq %d data @%p\n", __func__, d->irq, xd);

xive_do_source_set_mask(xd, true);
}
Expand All @@ -702,7 +703,7 @@ static int xive_irq_set_affinity(struct irq_data *d,
u32 target, old_target;
int rc = 0;

pr_debug("%s: irq %d/%x\n", __func__, d->irq, hw_irq);
pr_debug("%s: irq %d/0x%x\n", __func__, d->irq, hw_irq);

/* Is this valid ? */
if (cpumask_any_and(cpumask, cpu_online_mask) >= nr_cpu_ids)
Expand Down Expand Up @@ -975,7 +976,7 @@ EXPORT_SYMBOL_GPL(is_xive_irq);

void xive_cleanup_irq_data(struct xive_irq_data *xd)
{
pr_debug("%s for HW %x\n", __func__, xd->hw_irq);
pr_debug("%s for HW 0x%x\n", __func__, xd->hw_irq);

if (xd->eoi_mmio) {
iounmap(xd->eoi_mmio);
Expand Down Expand Up @@ -1211,8 +1212,8 @@ static int xive_setup_cpu_ipi(unsigned int cpu)
pr_err("Failed to map IPI CPU %d\n", cpu);
return -EIO;
}
pr_devel("CPU %d HW IPI %x, virq %d, trig_mmio=%p\n", cpu,
xc->hw_ipi, xive_ipi_irq, xc->ipi_data.trig_mmio);
pr_debug("CPU %d HW IPI 0x%x, virq %d, trig_mmio=%p\n", cpu,
xc->hw_ipi, xive_ipi_irq, xc->ipi_data.trig_mmio);

/* Unmask it */
xive_do_source_set_mask(&xc->ipi_data, false);
Expand Down Expand Up @@ -1390,7 +1391,7 @@ static int xive_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
if (rc)
return rc;

pr_debug("%s %d/%lx #%d\n", __func__, virq, hwirq, nr_irqs);
pr_debug("%s %d/0x%lx #%d\n", __func__, virq, hwirq, nr_irqs);

for (i = 0; i < nr_irqs; i++) {
/* TODO: call xive_irq_domain_map() */
Expand Down Expand Up @@ -1504,7 +1505,7 @@ static void xive_setup_cpu(void)
#ifdef CONFIG_SMP
void xive_smp_setup_cpu(void)
{
pr_devel("SMP setup CPU %d\n", smp_processor_id());
pr_debug("SMP setup CPU %d\n", smp_processor_id());

/* This will have already been done on the boot CPU */
if (smp_processor_id() != boot_cpuid)
Expand Down Expand Up @@ -1650,10 +1651,10 @@ bool __init xive_core_init(struct device_node *np, const struct xive_ops *ops,
ppc_md.get_irq = xive_get_irq;
__xive_enabled = true;

pr_devel("Initializing host..\n");
pr_debug("Initializing host..\n");
xive_init_host(np);

pr_devel("Initializing boot CPU..\n");
pr_debug("Initializing boot CPU..\n");

/* Allocate per-CPU data and queues */
xive_prepare_cpu(smp_processor_id());
Expand Down
38 changes: 19 additions & 19 deletions arch/powerpc/sysdev/xive/spapr.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static long plpar_int_get_source_info(unsigned long flags,
} while (plpar_busy_delay(rc));

if (rc) {
pr_err("H_INT_GET_SOURCE_INFO lisn=%ld failed %ld\n", lisn, rc);
pr_err("H_INT_GET_SOURCE_INFO lisn=0x%lx failed %ld\n", lisn, rc);
return rc;
}

Expand All @@ -182,8 +182,8 @@ static long plpar_int_get_source_info(unsigned long flags,
*trig_page = retbuf[2];
*esb_shift = retbuf[3];

pr_devel("H_INT_GET_SOURCE_INFO flags=%lx eoi=%lx trig=%lx shift=%lx\n",
retbuf[0], retbuf[1], retbuf[2], retbuf[3]);
pr_debug("H_INT_GET_SOURCE_INFO lisn=0x%lx flags=0x%lx eoi=0x%lx trig=0x%lx shift=0x%lx\n",
lisn, retbuf[0], retbuf[1], retbuf[2], retbuf[3]);

return 0;
}
Expand All @@ -200,8 +200,8 @@ static long plpar_int_set_source_config(unsigned long flags,
long rc;


pr_devel("H_INT_SET_SOURCE_CONFIG flags=%lx lisn=%lx target=%lx prio=%lx sw_irq=%lx\n",
flags, lisn, target, prio, sw_irq);
pr_debug("H_INT_SET_SOURCE_CONFIG flags=0x%lx lisn=0x%lx target=%ld prio=%ld sw_irq=%ld\n",
flags, lisn, target, prio, sw_irq);


do {
Expand All @@ -210,7 +210,7 @@ static long plpar_int_set_source_config(unsigned long flags,
} while (plpar_busy_delay(rc));

if (rc) {
pr_err("H_INT_SET_SOURCE_CONFIG lisn=%ld target=%lx prio=%lx failed %ld\n",
pr_err("H_INT_SET_SOURCE_CONFIG lisn=0x%lx target=%ld prio=%ld failed %ld\n",
lisn, target, prio, rc);
return rc;
}
Expand All @@ -227,15 +227,15 @@ static long plpar_int_get_source_config(unsigned long flags,
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
long rc;

pr_devel("H_INT_GET_SOURCE_CONFIG flags=%lx lisn=%lx\n", flags, lisn);
pr_debug("H_INT_GET_SOURCE_CONFIG flags=0x%lx lisn=0x%lx\n", flags, lisn);

do {
rc = plpar_hcall(H_INT_GET_SOURCE_CONFIG, retbuf, flags, lisn,
target, prio, sw_irq);
} while (plpar_busy_delay(rc));

if (rc) {
pr_err("H_INT_GET_SOURCE_CONFIG lisn=%ld failed %ld\n",
pr_err("H_INT_GET_SOURCE_CONFIG lisn=0x%lx failed %ld\n",
lisn, rc);
return rc;
}
Expand All @@ -244,8 +244,8 @@ static long plpar_int_get_source_config(unsigned long flags,
*prio = retbuf[1];
*sw_irq = retbuf[2];

pr_devel("H_INT_GET_SOURCE_CONFIG target=%lx prio=%lx sw_irq=%lx\n",
retbuf[0], retbuf[1], retbuf[2]);
pr_debug("H_INT_GET_SOURCE_CONFIG target=%ld prio=%ld sw_irq=%ld\n",
retbuf[0], retbuf[1], retbuf[2]);

return 0;
}
Expand Down Expand Up @@ -273,8 +273,8 @@ static long plpar_int_get_queue_info(unsigned long flags,
*esn_page = retbuf[0];
*esn_size = retbuf[1];

pr_devel("H_INT_GET_QUEUE_INFO page=%lx size=%lx\n",
retbuf[0], retbuf[1]);
pr_debug("H_INT_GET_QUEUE_INFO cpu=%ld prio=%ld page=0x%lx size=0x%lx\n",
target, priority, retbuf[0], retbuf[1]);

return 0;
}
Expand All @@ -289,16 +289,16 @@ static long plpar_int_set_queue_config(unsigned long flags,
{
long rc;

pr_devel("H_INT_SET_QUEUE_CONFIG flags=%lx target=%lx priority=%lx qpage=%lx qsize=%lx\n",
flags, target, priority, qpage, qsize);
pr_debug("H_INT_SET_QUEUE_CONFIG flags=0x%lx target=%ld priority=0x%lx qpage=0x%lx qsize=0x%lx\n",
flags, target, priority, qpage, qsize);

do {
rc = plpar_hcall_norets(H_INT_SET_QUEUE_CONFIG, flags, target,
priority, qpage, qsize);
} while (plpar_busy_delay(rc));

if (rc) {
pr_err("H_INT_SET_QUEUE_CONFIG cpu=%ld prio=%ld qpage=%lx returned %ld\n",
pr_err("H_INT_SET_QUEUE_CONFIG cpu=%ld prio=%ld qpage=0x%lx returned %ld\n",
target, priority, qpage, rc);
return rc;
}
Expand All @@ -315,7 +315,7 @@ static long plpar_int_sync(unsigned long flags, unsigned long lisn)
} while (plpar_busy_delay(rc));

if (rc) {
pr_err("H_INT_SYNC lisn=%ld returned %ld\n", lisn, rc);
pr_err("H_INT_SYNC lisn=0x%lx returned %ld\n", lisn, rc);
return rc;
}

Expand All @@ -333,16 +333,16 @@ static long plpar_int_esb(unsigned long flags,
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
long rc;

pr_devel("H_INT_ESB flags=%lx lisn=%lx offset=%lx in=%lx\n",
flags, lisn, offset, in_data);
pr_debug("H_INT_ESB flags=0x%lx lisn=0x%lx offset=0x%lx in=0x%lx\n",
flags, lisn, offset, in_data);

do {
rc = plpar_hcall(H_INT_ESB, retbuf, flags, lisn, offset,
in_data);
} while (plpar_busy_delay(rc));

if (rc) {
pr_err("H_INT_ESB lisn=%ld offset=%ld returned %ld\n",
pr_err("H_INT_ESB lisn=0x%lx offset=0x%lx returned %ld\n",
lisn, offset, rc);
return rc;
}
Expand Down

0 comments on commit 44b9c8d

Please sign in to comment.