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

From: Maulik Shah (mkshah)

Date: Fri Jul 03 2026 - 04:51:39 EST




On 6/30/2026 8:16 PM, Thomas Gleixner wrote:
> On Tue, Jun 16 2026 at 14:55, Maulik Shah wrote:
>> - for (i = 0; i < pdc_region[n].cnt; i++)
>> - __pdc_enable_intr(i + pdc_region[n].pin_base, 0);
>> + for (int i = 0; i < pdc->region[n].cnt; i++)
>> + pdc->enable_intr(i + pdc->region[n].pin_base, 0);
>
> This needs a guard(raw_spinlock_irqsave)() when invoking
> pdc->enable_intr(). The probe function is only invoked
> with interrupts disabled during early boot. If it's called later, then
> this still works, but lockdep will be rightfully upset.
>

Patch 3 of the series moved guard(raw_spinlock)() within the pdc->enable_intr().
I will merge patch 2 and patch 3 in v4 series so that lock movement and newly adding it at probe time is captured in single change.

Lock is required only for old PDC HW versions (v2.7 and v3.0) where enable bank is used instead of separate enable register for each IRQ.
Adding lock like below will apply the lock unnecessary on HW v3.2 specific pdc->enable_intr() as well which is initialized to pdc_enable_intr_cfg().

guard(raw_spinlock_irqsave)(&pdc->lock);
pdc->enable_intr(i + pdc->region[n].pin_base, false);

To address this, lock is still kept within pdc->enable_intr() which is pointing to pdc_enable_intr_bank() for PDC HW v2.7 and v3.0.

Since probe gets invoked later during probe, i will keep guard(raw_spinlock_irqsave)() within pdc->enable_intr(),
even if chip callbacks like .irq_enable invoking pdc->enable_intr() may not need _irqsave() variant as it seems no better way as keeping
lock before calling pdc->enable_intr() will apply for PDC HW v3.2 as well.

Thanks,
Maulik