Re: AW: [PATCH 1/2] irqchip/irq-realtek-rtl: Add/simplify register helpers

From: Thomas Gleixner

Date: Thu Jun 04 2026 - 08:46:06 EST


On Thu, Jun 04 2026 at 14:32, Markus Stockhausen wrote:

>> Von: Thomas Gleixner <tglx@xxxxxxxxxx>
>> Gesendet: Mittwoch, 3. Juni 2026 17:57
>> An: Markus Stockhausen <markus.stockhausen@xxxxxx>;
> linux-kernel@xxxxxxxxxxxxxxx
>> Cc: Markus Stockhausen <markus.stockhausen@xxxxxx>
>> Betreff: Re: [PATCH 1/2] irqchip/irq-realtek-rtl: Add/simplify register
> helpers
>> ...
>> > -
>> > - value = readl(REG(RTL_ICTL_GIMR));
>> > - value &= ~BIT(i->hwirq);
>> > - writel(value, REG(RTL_ICTL_GIMR));
>> > -
>> > + disable_gimr(i->hwirq);
>> > raw_spin_unlock_irqrestore(&irq_lock, flags);
>> > }
>> >
>> > @@ -89,7 +98,7 @@ static int intc_map(struct irq_domain *d, unsigned int
> irq, irq_hw_number_t hw)
>> > irq_set_chip_and_handler(irq, &realtek_ictl_irq, handle_level_irq);
>> >
>> guard(raw_spinlock_irq)(&lock);
>>
>> _irq because this is task context.
>>
>> > raw_spin_lock_irqsave(&irq_lock, flags);
>> > - write_irr(REG(RTL_ICTL_IRR0), hw, 1);
>> > + write_irr(hw, 1);
>> > raw_spin_unlock_irqrestore(&irq_lock, flags);
>> >
>> > return 0;
>
> The above is the only one of your guides I'm unsure about.
> With the whole series adapted and applied I finally get
>
> static int intc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t
> hw)
> {
> unsigned int cpu;
>
> irq_set_chip_and_handler(irq, &realtek_ictl_irq, handle_level_irq);
>
> guard(raw_spinlock_irq)(&irq_lock);
> for_each_cpu(cpu, &realtek_ictl_cpu_configurable)
> write_irr(cpu, hw, 1);
>
> return 0;
> }
>
> Boot gives a warning.

Indeed. If map() is invoked during early boot, you need _irqsave.