Re: [PATCH v10 05/13] mfd: nct6694: Drop the unused IRQ enable mask

From: Ming Yu

Date: Fri Nov 20 2026 - 00:37:23 EST


Dear Sebastian,

Thank you for the review.

Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> 於 2026年11月19日週四 下午6:12寫道:
>
> On 2026-11-18 16:16:16 [+0800], a0282524688@xxxxxxxxx wrote:
> > From: Ming Yu <a0282524688@xxxxxxxxx>
> >
> > The .irq_enable and .irq_disable callbacks only update the irq_enable
> > bitmask under irq_lock, which is a spinlock_t. Nothing ever reads that
> > bitmask, so the callbacks do not mask anything. They also take irq_lock
> > while the IRQ core holds desc->lock, a raw spinlock. On PREEMPT_RT this
> > is an invalid wait context.
> >
> > Remove both callbacks, along with irq_enable and irq_lock, and keep
> > IRQCHIP_SKIP_SET_WAKE. Without .irq_disable, the IRQ core falls back to
> > lazy disable, and handle_simple_irq() keeps a disabled interrupt pending
> > instead of calling its handler. The behaviour is therefore unchanged.
> >
> > Fixes: 51dad33ede63 ("mfd: Add core driver for Nuvoton NCT6694")
> > Signed-off-by: Ming Yu <a0282524688@xxxxxxxxx>
>
> This sort of makes sense. But how does this work? If the interrupt keeps
> coming the irq-core will just suppress it?

Yes, that is my understanding. The NCT6694 does not provide an interrupt
mask that the host can program. The firmware reports a 32-bit status
word, through the interrupt URB on USB and through shared memory on HIF,
and the transport handles every report and dispatches each set bit.

While a child interrupt is disabled, handle_simple_irq() only marks it
pending and does not call the handler. When the interrupt is enabled
again, check_irq_resend() replays it. The parent should not be flooded:
on USB it is the URB completion, and on HIF the handler clears the
status on every interrupt.

This is also how the driver behaved before this patch, because the
callbacks only updated a bitmask that was never read.

> If that is your whole business why not use dummy_irq_chip?

Thank you for the suggestion. I am looking into it now. As far as I can
see, dummy_irq_chip only provides no-op callbacks and also sets
IRQCHIP_SKIP_SET_WAKE, so the behaviour should stay the same. It would
also let me drop the irq_set_chip_data() calls, since nothing reads the
chip data after this change. The only visible difference I found is the
chip name shown in /proc/interrupts.

If you agree, I would like to switch to dummy_irq_chip in v11. Since
this changes the patch, I will not keep your Reviewed-by unless you are
fine with it.

Please let me know if I missed anything.

Best regards,
Ming