Re: [PATCH 4/4] irqchip/alpine-msi: Add debug logging for MSI allocation
From: Radu Rendec
Date: Sat Oct 24 2026 - 14:47:20 EST
On Wed, 2026-09-23 at 08:37 +0000, Eliav Farber wrote:
> Add log messages to help follow the driver flow when debugging: an
> info message on successful initialisation, and debug messages on the
> MSI interrupt allocation and free paths.
>
> Signed-off-by: Eliav Farber <farbere@xxxxxxxxxx>
> ---
> drivers/irqchip/irq-alpine-msi.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/irqchip/irq-alpine-msi.c b/drivers/irqchip/irq-alpine-msi.c
> index 8155f63cfd29..0e68f81014e7 100644
> --- a/drivers/irqchip/irq-alpine-msi.c
> +++ b/drivers/irqchip/irq-alpine-msi.c
> @@ -104,6 +104,8 @@ static int alpine_msix_middle_domain_alloc(struct irq_domain *domain, unsigned i
> struct alpine_msix_data *priv = domain->host_data;
> int sgi, err, i;
>
> + pr_debug("trying to allocate %d msi starting from %d\n", nr_irqs, virq);
> +
> sgi = alpine_msix_allocate_sgi(priv, nr_irqs);
> if (sgi < 0)
> return sgi;
> @@ -116,6 +118,9 @@ static int alpine_msix_middle_domain_alloc(struct irq_domain *domain, unsigned i
> irq_domain_set_hwirq_and_chip(domain, virq + i, sgi + i,
> &middle_irq_chip, priv);
> }
> +
> + pr_debug("allocated %d msi starting from %d\n", nr_irqs, virq);
> +
> return 0;
>
> err_sgi:
> @@ -132,6 +137,8 @@ static void alpine_msix_middle_domain_free(struct irq_domain *domain, unsigned i
>
> irq_domain_free_irqs_parent(domain, virq, nr_irqs);
> alpine_msix_free_sgi(priv, d->hwirq, nr_irqs);
> +
> + pr_debug("freed %d msi starting from %d\n", nr_irqs, virq);
> }
>
> static const struct irq_domain_ops alpine_msix_middle_domain_ops = {
> @@ -235,6 +242,9 @@ static int alpine_msix_init(struct device_node *node, struct device_node *parent
> if (ret)
> return ret;
>
> + pr_info("initialized successfully, spi %d to %d\n",
> + priv->spi_first, priv->spi_first + priv->num_spis - 1);
> +
> retain_and_null_ptr(priv);
> retain_and_null_ptr(msi_map);
> return 0;
Not that this matters in reality (because all these numbers are "small")
but for the sake of correctness: all the variables you added messages
for are unsigned, so you should use %u on them.
Since you're cleaning up this driver, you may want to look at the other
prints. For example, the existing pr_debug() in alpine_msix_init() has
the same problem.
--
Regards,
Radu