Re: [PATCH] irqchip/gic-v5: Rename gicv5_hwirq_init() to gicv5_hwirq_set_priority()
From: Vladimir Murzin
Date: Thu Dec 03 2026 - 08:44:35 EST
On 12/3/26 11:18, Lorenzo Pieralisi wrote:
> 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@xxxxxxx>
>> ---
>> 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() ?
>
Absolutely! v2 is on its way!
Cheers
Vladimir
> Thanks,
> Lorenzo