[PATCH] i2c: spacemit: fix spurious IRQ handling returning IRQ_HANDLED

Pei Xiao xiaopei01 at kylinos.cn
Thu Jul 9 18:10:56 PDT 2026



在 2026/7/9 18:16, Troy Mitchell 写道:
> On Thu Jul 9, 2026 at 2:54 AM PDT, Pei Xiao wrote:
>> When the interrupt status register reads zero (no interrupt pending
>> from this device), the handler should return IRQ_NONE. Returning
>> IRQ_HANDLED incorrectly claims the interrupt was serviced, which can
>> prevent other devices sharing the same IRQ line from receiving their
>> interrupts.
>>
>> Fix this by returning IRQ_NONE instead of IRQ_HANDLED when the
>> status register is zero.
> The change goes in the right direction, but the rationale in the
> commit message doesn't hold, and I think the check itself can be
> improved.
>
> This driver requests its IRQ without IRQF_SHARED (see
> spacemit_i2c_probe(), which passes only IRQF_NO_SUSPEND), so there
> are no "other devices sharing the same IRQ line" to begin with.
> Even on a genuinely shared line, the kernel invokes every handler
> registered on the line regardless of what previous handlers return,
> so IRQ_HANDLED cannot prevent other handlers from running.
Thanks for pointing out!
>
> What the return value actually feeds into is the spurious interrupt
> accounting in note_interrupt(): falsely claiming IRQ_HANDLED defeats
> the "irq XX: nobody cared" detection, so a stuck interrupt source
> would never be caught. That applies to dedicated lines as well, and
> is the real justification for this change.
>
> Could you rework the check and the commit message and send a v2?
yes, I will check again and send a v2.

Thanks! 
Pei.
>                                   - Troy




More information about the linux-riscv mailing list