All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lpieralisi@kernel.org>
To: Vladimir Murzin <vladimir.murzin@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, radu@rendec.net, tglx@kernel.org,
	maz@kernel.org
Subject: Re: [PATCH] irqchip/gic-v5: Rename gicv5_hwirq_init() to gicv5_hwirq_set_priority()
Date: Thu, 3 Dec 2026 12:18:08 +0100	[thread overview]
Message-ID: <axFP8AEhvXVs48WB@red-moon> (raw)
In-Reply-To: <20261203095338.111945-1-vladimir.murzin@arm.com>

On Thu, Dec 03, 2026 at 09:53:38AM +0000, Vladimir Murzin wrote:
> Since commit a1ee1a1ca75b ("irqchip/gic-v5: Defer default SPI and LPI
> IAFFID programming"), gicv5_hwirq_init() only sets the interrupt
> priority. Rename it to reflect its actual functionality.
> 
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> ---
>  drivers/irqchip/irq-gic-v5.c | 20 +++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-gic-v5.c
> index 8c0303af71e7..14ed0c384f72 100644
> --- a/drivers/irqchip/irq-gic-v5.c
> +++ b/drivers/irqchip/irq-gic-v5.c
> @@ -85,16 +85,18 @@ static void gicv5_ppi_priority_init(void)
>  	isb();
>  }
>  
> -static void gicv5_hwirq_init(irq_hw_number_t hwirq, u8 priority, u8 hwirq_type)
> +static void gicv5_hwirq_set_priority(irq_hw_number_t hwirq, u8 priority, u8 hwirq_type)
>  {
>  	u64 cdpri;
>  
> -	if (hwirq_type == GICV5_HWIRQ_TYPE_LPI || hwirq_type == GICV5_HWIRQ_TYPE_SPI) {
> -		cdpri = FIELD_PREP(GICV5_GIC_CDPRI_PRIORITY_MASK, priority)	|
> -			FIELD_PREP(GICV5_GIC_CDPRI_TYPE_MASK, hwirq_type)	|
> -			FIELD_PREP(GICV5_GIC_CDPRI_ID_MASK, hwirq);
> -		gic_insn(cdpri, CDPRI);
> -	}
> +	if (WARN_ON(hwirq_type != GICV5_HWIRQ_TYPE_LPI && hwirq_type != GICV5_HWIRQ_TYPE_SPI))
> +		return;

If we want to warn it does not make much sense to make it a runtime one given
that we always pass in constant values.

Can we make this function always inline and turn this run-time check into
a BUILD_BUG_ON() ?

Thanks,
Lorenzo

> +
> +	cdpri = FIELD_PREP(GICV5_GIC_CDPRI_PRIORITY_MASK, priority)	|
> +		FIELD_PREP(GICV5_GIC_CDPRI_TYPE_MASK, hwirq_type)	|
> +		FIELD_PREP(GICV5_GIC_CDPRI_ID_MASK, hwirq);
> +
> +	gic_insn(cdpri, CDPRI);
>  }
>  
>  static void gicv5_ppi_irq_mask(struct irq_data *d)
> @@ -733,7 +735,7 @@ static int gicv5_irq_spi_domain_alloc(struct irq_domain *domain, unsigned int vi
>  	irq_set_probe(virq);
>  	irqd_set_single_target(irqd);
>  
> -	gicv5_hwirq_init(hwirq, GICV5_IRQ_PRI_MI, GICV5_HWIRQ_TYPE_SPI);
> +	gicv5_hwirq_set_priority(hwirq, GICV5_IRQ_PRI_MI, GICV5_HWIRQ_TYPE_SPI);
>  
>  	return 0;
>  }
> @@ -824,7 +826,7 @@ static int gicv5_irq_lpi_domain_alloc(struct irq_domain *domain, unsigned int vi
>  				    NULL, handle_fasteoi_irq, NULL, NULL);
>  		irqd_set_single_target(irqd);
>  
> -		gicv5_hwirq_init(hwirq, GICV5_IRQ_PRI_MI, GICV5_HWIRQ_TYPE_LPI);
> +		gicv5_hwirq_set_priority(hwirq, GICV5_IRQ_PRI_MI, GICV5_HWIRQ_TYPE_LPI);
>  		gicv5_lpi_config_reset(irqd);
>  	}
>  
> -- 
> 2.34.1
> 


  parent reply	other threads:[~2026-12-03 11:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  9:53 [PATCH] irqchip/gic-v5: Rename gicv5_hwirq_init() to gicv5_hwirq_set_priority() Vladimir Murzin
2026-12-03 11:02 ` Marc Zyngier
2026-12-03 11:18 ` Lorenzo Pieralisi [this message]
2026-12-03 13:44   ` Vladimir Murzin

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=axFP8AEhvXVs48WB@red-moon \
    --to=lpieralisi@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=radu@rendec.net \
    --cc=tglx@kernel.org \
    --cc=vladimir.murzin@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.