Re: [PATCH v2 2/8] irqchip/qcom-pdc: Move all statics to struct pdc_desc

From: Thomas Gleixner

Date: Wed Jun 03 2026 - 11:42:09 EST


On Tue, May 26 2026 at 16:24, Maulik Shah wrote:
> @@ -221,9 +231,9 @@ static void pdc_enable_intr(struct irq_data *d, bool on)
> {
> unsigned long flags;
>
> - raw_spin_lock_irqsave(&pdc_lock, flags);
> - __pdc_enable_intr(d->hwirq, on);
> - raw_spin_unlock_irqrestore(&pdc_lock, flags);
> + raw_spin_lock_irqsave(&pdc->lock, flags);

While at it please convert this to:

guard(raw_spinlock_irqsave)(...);

The _irqsave is not really required when invoked from the irqchip
callbacks with irq desc lock held and interrupts disabled, but that's
also magically invoked from other contexts. So you could spare that
irqsave by wrapping the other callsite into:

guard(irq)() or scoped_guard(irq)

> + pdc->enable_intr(d->hwirq, on);
> + raw_spin_unlock_irqrestore(&pdc->lock, flags);
> }
>
> static void qcom_pdc_gic_disable(struct irq_data *d)
> @@ -348,10 +358,10 @@ static struct pdc_pin_region *get_pin_region(int pin)
> {
> int i;
>
> - for (i = 0; i < pdc_region_cnt; i++) {
> - if (pin >= pdc_region[i].pin_base &&
> - pin < pdc_region[i].pin_base + pdc_region[i].cnt)
> - return &pdc_region[i];
> + for (i = 0; i < pdc->region_cnt; i++) {

for (int i = 0; ....

> + if (pin >= pdc->region[i].pin_base &&
> + pin < pdc->region[i].pin_base + pdc->region[i].cnt)
> + return &pdc->region[i];
>
> + raw_spin_lock_init(&pdc->lock);
> +
> pdc_domain = irq_domain_create_hierarchy(parent_domain,
> IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP,
> PDC_MAX_IRQS,

Please fix up the coding style here according to

https://docs.kernel.org/process/maintainer-tip.html