Re: [PATCH] irqchip/irq-xtensa-pic: clean up

From: Thomas Gleixner
Date: Fri Dec 08 2023 - 08:56:05 EST


On Tue, Dec 05 2023 at 02:13, Max Filippov wrote:
> - get rid of the cached_irq_mask variable
> - make mask/unmask operations atomic
> - use BIT() macro instead of bit shifts
> - drop .disable and .enable as they are equivalent to the default
> implementations
> static void xtensa_irq_mask(struct irq_data *d)
> {
> - cached_irq_mask &= ~(1 << d->hwirq);
> - xtensa_set_sr(cached_irq_mask, intenable);
> -}
> + unsigned long flags;
> + u32 irq_mask;
>
> -static void xtensa_irq_unmask(struct irq_data *d)
> -{
> - cached_irq_mask |= 1 << d->hwirq;
> - xtensa_set_sr(cached_irq_mask, intenable);
> + local_irq_save(flags);

All of these callbacks are invoked with interrupts disabled already. No
point in disabling them some more.

> + irq_mask = xtensa_get_sr(intenable);
> + irq_mask &= ~BIT(d->hwirq);
> + xtensa_set_sr(irq_mask, intenable);
> + local_irq_restore(flags);
> }

Thanks,

tglx