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

powerpc/xive: Replace pr_devel() by pr_debug() to ease debug



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: default avatarCédric Le Goater <clg@kaod.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211105102636.1016378-2-clg@kaod.org
parent d02fa40d
Loading
Loading
Loading
Loading
+15 −14
Original line number Original line Diff line number Diff line
@@ -451,6 +451,8 @@ static void xive_do_source_set_mask(struct xive_irq_data *xd,
{
{
	u64 val;
	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.
	 * If the interrupt had P set, it may be in a queue.
	 *
	 *
@@ -612,8 +614,8 @@ static unsigned int xive_irq_startup(struct irq_data *d)


	xd->saved_p = false;
	xd->saved_p = false;
	xd->stale_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 */
	/* Pick a target */
	target = xive_pick_irq_target(d, irq_data_get_affinity_mask(d));
	target = xive_pick_irq_target(d, irq_data_get_affinity_mask(d));
@@ -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);
	struct xive_irq_data *xd = irq_data_get_irq_handler_data(d);
	unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d);
	unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d);


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


	if (WARN_ON(xd->target == XIVE_INVALID_TARGET))
	if (WARN_ON(xd->target == XIVE_INVALID_TARGET))
		return;
		return;
@@ -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);
	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);
	xive_do_source_set_mask(xd, false);
}
}
@@ -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);
	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);
	xive_do_source_set_mask(xd, true);
}
}
@@ -702,7 +703,7 @@ static int xive_irq_set_affinity(struct irq_data *d,
	u32 target, old_target;
	u32 target, old_target;
	int rc = 0;
	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 ? */
	/* Is this valid ? */
	if (cpumask_any_and(cpumask, cpu_online_mask) >= nr_cpu_ids)
	if (cpumask_any_and(cpumask, cpu_online_mask) >= nr_cpu_ids)
@@ -975,7 +976,7 @@ EXPORT_SYMBOL_GPL(is_xive_irq);


void xive_cleanup_irq_data(struct xive_irq_data *xd)
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) {
	if (xd->eoi_mmio) {
		iounmap(xd->eoi_mmio);
		iounmap(xd->eoi_mmio);
@@ -1211,7 +1212,7 @@ static int xive_setup_cpu_ipi(unsigned int cpu)
		pr_err("Failed to map IPI CPU %d\n", cpu);
		pr_err("Failed to map IPI CPU %d\n", cpu);
		return -EIO;
		return -EIO;
	}
	}
	pr_devel("CPU %d HW IPI %x, virq %d, trig_mmio=%p\n", cpu,
	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);
		 xc->hw_ipi, xive_ipi_irq, xc->ipi_data.trig_mmio);


	/* Unmask it */
	/* Unmask it */
@@ -1390,7 +1391,7 @@ static int xive_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
	if (rc)
	if (rc)
		return 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++) {
	for (i = 0; i < nr_irqs; i++) {
		/* TODO: call xive_irq_domain_map() */
		/* TODO: call xive_irq_domain_map() */
@@ -1504,7 +1505,7 @@ static void xive_setup_cpu(void)
#ifdef CONFIG_SMP
#ifdef CONFIG_SMP
void xive_smp_setup_cpu(void)
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 */
	/* This will have already been done on the boot CPU */
	if (smp_processor_id() != boot_cpuid)
	if (smp_processor_id() != boot_cpuid)
@@ -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;
	ppc_md.get_irq = xive_get_irq;
	__xive_enabled = true;
	__xive_enabled = true;


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


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


	/* Allocate per-CPU data and queues */
	/* Allocate per-CPU data and queues */
	xive_prepare_cpu(smp_processor_id());
	xive_prepare_cpu(smp_processor_id());
+19 −19
Original line number Original line Diff line number Diff line
@@ -173,7 +173,7 @@ static long plpar_int_get_source_info(unsigned long flags,
	} while (plpar_busy_delay(rc));
	} while (plpar_busy_delay(rc));


	if (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;
		return rc;
	}
	}


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


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


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




	pr_devel("H_INT_SET_SOURCE_CONFIG flags=%lx lisn=%lx target=%lx prio=%lx sw_irq=%lx\n",
	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);
		 flags, lisn, target, prio, sw_irq);




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


	if (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);
		       lisn, target, prio, rc);
		return rc;
		return rc;
	}
	}
@@ -227,7 +227,7 @@ static long plpar_int_get_source_config(unsigned long flags,
	unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
	unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
	long rc;
	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 {
	do {
		rc = plpar_hcall(H_INT_GET_SOURCE_CONFIG, retbuf, flags, lisn,
		rc = plpar_hcall(H_INT_GET_SOURCE_CONFIG, retbuf, flags, lisn,
@@ -235,7 +235,7 @@ static long plpar_int_get_source_config(unsigned long flags,
	} while (plpar_busy_delay(rc));
	} while (plpar_busy_delay(rc));


	if (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);
		       lisn, rc);
		return rc;
		return rc;
	}
	}
@@ -244,7 +244,7 @@ static long plpar_int_get_source_config(unsigned long flags,
	*prio   = retbuf[1];
	*prio   = retbuf[1];
	*sw_irq = retbuf[2];
	*sw_irq = retbuf[2];


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


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


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


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


	pr_devel("H_INT_SET_QUEUE_CONFIG flags=%lx target=%lx priority=%lx qpage=%lx qsize=%lx\n",
	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);
		 flags,  target, priority, qpage, qsize);


	do {
	do {
@@ -298,7 +298,7 @@ static long plpar_int_set_queue_config(unsigned long flags,
	} while (plpar_busy_delay(rc));
	} while (plpar_busy_delay(rc));


	if (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);
		       target, priority, qpage, rc);
		return  rc;
		return  rc;
	}
	}
@@ -315,7 +315,7 @@ static long plpar_int_sync(unsigned long flags, unsigned long lisn)
	} while (plpar_busy_delay(rc));
	} while (plpar_busy_delay(rc));


	if (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;
		return  rc;
	}
	}


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


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


	do {
	do {
@@ -342,7 +342,7 @@ static long plpar_int_esb(unsigned long flags,
	} while (plpar_busy_delay(rc));
	} while (plpar_busy_delay(rc));


	if (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);
		       lisn, offset, rc);
		return  rc;
		return  rc;
	}
	}