All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Sascha Bischoff <Sascha.Bischoff@arm.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: nd <nd@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH 2/3] irqchip/gic-v5: Allow for nr_irqs > 1 for LPI alloc and teardown
Date: Tue, 05 May 2026 22:08:55 +0200	[thread overview]
Message-ID: <87zf2dwre0.ffs@tglx> (raw)
In-Reply-To: <20260430153352.3654325-3-sascha.bischoff@arm.com>

On Thu, Apr 30 2026 at 15:34, Sascha Bischoff wrote:
> Formerly the LPI allocaion and freeing was handled by the domains
> built on top of the LPI domain, and hence the LPI to use was passed in
> from the child domain. This mandadated that LPI allocation and freeing
> was done one at a time, rather than for a range of interrupts in one
> go.
>
> Now that the underlying restriction has been removed and all LPI
> tracking happens within the LPI domain itself, drop the requirement to
> allocate and free LPIs one-by-one.  While we're at it, clean up the
> IPI allocation to request all LPIs in one go, rather than requesting
> them one at a time.
>
> Incidentally, this fixes a unwind bug for IPIs where previously
> allocated entries were not unwound on a failed parent allocation.

See previous reply

> Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
> ---
>  drivers/irqchip/irq-gic-v5.c | 70 +++++++++++++++++++-----------------
>  1 file changed, 38 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-gic-v5.c
> index a3c9eaa8ff486..61a70fe48bc32 100644
> --- a/drivers/irqchip/irq-gic-v5.c
> +++ b/drivers/irqchip/irq-gic-v5.c
> @@ -800,17 +800,16 @@ static void gicv5_irq_lpi_domain_free(struct irq_domain *domain, unsigned int vi
>  				      unsigned int nr_irqs)
>  {
>  	struct irq_data *d;
> +	int i;
>  
> -	if (WARN_ON_ONCE(nr_irqs != 1))
> -		return;
> -
> -	d = irq_domain_get_irq_data(domain, virq);
> -
> +	for (i = 0; i < nr_irqs; i++) {

        for (unsigned int = 0; ....

> +		d = irq_domain_get_irq_data(domain, virq + i);

  s/virq/ and then make
  
        for (unsigned int = 0; ....; i++, virq++)

>  static int gicv5_irq_lpi_domain_alloc(struct irq_domain *domain, unsigned int virq,
> @@ -818,32 +817,38 @@ static int gicv5_irq_lpi_domain_alloc(struct irq_domain *domain, unsigned int vi
>  {
>  	irq_hw_number_t hwirq;
>  	struct irq_data *irqd;
> -	int ret;
> -
> -	if (WARN_ON_ONCE(nr_irqs != 1))
> -		return -EINVAL;
> +	int ret, i;

unsigned int i;

>  static const struct irq_domain_ops gicv5_irq_lpi_domain_ops = {
> @@ -871,11 +876,11 @@ static int gicv5_irq_ipi_domain_alloc(struct irq_domain *domain, unsigned int vi
>  	struct irq_data *irqd;
>  	int ret, i;
>  
> -	for (i = 0; i < nr_irqs; i++) {
> -		ret = irq_domain_alloc_irqs_parent(domain, virq + i, 1, NULL);
> -		if (ret)
> -			return ret;
> +	ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, arg);
> +	if (ret)
> +		return ret;
>  
> +	for (i = 0; i < nr_irqs; i++) {

  for (unsigned int i ....

Thanks,

        tglx


  reply	other threads:[~2026-05-05 20:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30 15:33 [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Sascha Bischoff
2026-04-30 15:34 ` [PATCH 1/3] irqchip/gic-v5: Move LPI alloc/free into LPI domain Sascha Bischoff
2026-05-05 20:02   ` Thomas Gleixner
2026-05-06  9:35     ` Sascha Bischoff
2026-04-30 15:34 ` [PATCH 2/3] irqchip/gic-v5: Allow for nr_irqs > 1 for LPI alloc and teardown Sascha Bischoff
2026-05-05 20:08   ` Thomas Gleixner [this message]
2026-05-06  9:35     ` Sascha Bischoff
2026-04-30 15:34 ` [PATCH 3/3] irqchip/gic-v5: Allocate ITS parent LPIs as a range Sascha Bischoff
2026-05-02 10:40 ` [PATCH 0/3] irqchip/gic-v5: Tidy up LPI allocation Marc Zyngier
2026-05-04  8:45   ` Lorenzo Pieralisi
2026-05-05  9:03     ` Sascha Bischoff

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=87zf2dwre0.ffs@tglx \
    --to=tglx@kernel.org \
    --cc=Sascha.Bischoff@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=maz@kernel.org \
    --cc=nd@arm.com \
    /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.