Re: [PATCH v5 2/6] irqchip: Add the Sky1 AUDSS auxiliary interrupt controller
From: Jelly Jia
Date: Wed Dec 02 2026 - 07:37:21 EST
Hi Thomas,
> My comments on V4 still apply.
Thanks for the review. Quoting the relevant parts of your v4 comments
below:
>> +#define INFO_AP_IRQC 0x54
>> +#define INFO_AP_IRQC_DMAC_MASK GENMASK(7, 0)
>> +#define SKY1_AUDSS_DMAC_IRQS 8
>> +
>> +struct sky1_audss_irq {
>> + struct regmap *regmap;
>> + struct irq_domain *domain;
>> + int parent_irq;
>> +};
>
> Please use tabular layout for the defines and struct declaration.
I'll align the defines and struct members as documented.
>> + regmap_update_bits(priv->regmap, INFO_AP_IRQC,
>> + BIT(d->hwirq), BIT(d->hwirq));
>
> No line break requied you have 100 characters.
I'll keep this call on one line.
>> +static int sky1_audss_irq_request_resources(struct irq_data *d)
>> +{
>> + return try_module_get(THIS_MODULE) ? 0 : -ENODEV;
>> +}
>> +
>> +static void sky1_audss_irq_release_resources(struct irq_data *d)
>> +{
>> + module_put(THIS_MODULE);
>> +}
>
> What's the point of this exercise?
These callbacks pin the IRQ driver module while a child IRQ is
requested, preventing the provider from being unloaded while a DMA
consumer still owns an IRQ. Runtime PM references do not pin the module.
This follows the same pattern as irq-pruss-intc.c.
>> + /*
>> + * There is no per-channel pending status in the CRU. Poll enabled
>> + * children without spurious-IRQ accounting, but retain level flow
>> + * control so disabled and oneshot-threaded children stay masked.
>> + */
>> + irq_set_status_flags(irq, IRQ_LEVEL | IRQ_IS_POLLED);
>
> Huch? The chained handler below ...
>
>> + if (!regmap_read(priv->regmap, INFO_AP_IRQC, &val)) {
>
> .. clearly reads the pending bits, no?
INFO_AP_IRQC at offset 0x54 is an enable register, not a pending register.
The hardware documentation defines bits 0-7 as read/write AP DMA channel
interrupt enables, with a reset value of zero.
We therefore dispatch all enabled channels and let each DMA handler
check its actual status. IRQ_IS_POLLED avoids spurious-IRQ accounting
for the expected IRQ_NONE returns. I'll clarify this in the comments.
>> + /* The parent CRU may turn its clocks off after the child suspends. */
>> + disable_irq(priv->parent_irq);
>
> This operates on the interrupt which runs the chained handler, which
> means disable_irq() is _not_ synchronizing against a handler in flight
> on a different CPU because chained handlers do not set/clear INPROGRESS.
>
> Please explain how this is supposed to be correct under all circumstances.
I understand that chained handlers do not set IRQD_IRQ_INPROGRESS.
For Sky1, the parent is a non-forwarded GICv3 SPI, and the current code
relies on the additional ACTIVE-state check in synchronize_irq().
IRQ_DISABLE_UNLAZY ensures that disable_irq() masks the parent.
synchronize_irq() then checks IRQCHIP_STATE_ACTIVE through
gic_irq_get_irqchip_state(). Deactivation happens in chained_irq_exit(),
after all CRU accesses and child IRQ dispatches. In split EOI mode,
the earlier EOIR write only drops priority, without deactivating the IRQ.
My understanding is that this waits until the resource accesses have
finished before suspend or teardown continues. This relies on GICv3's
ACTIVE-state support.
Is there a case in this path that I have overlooked?
Best regards,
Jelly