]> git.ipfire.org Git - thirdparty/linux.git/commit
i2c: ls2x-v2: return IRQ_HANDLED after servicing an error
authorDavid Carlier <devnexen@gmail.com>
Wed, 6 May 2026 15:40:15 +0000 (16:40 +0100)
committerAndi Shyti <andi.shyti@kernel.org>
Tue, 16 Jun 2026 23:19:53 +0000 (01:19 +0200)
commit6ee2ba9dcefe5bb41d179e183919531c8da01d14
tree912c9f09528547feb88701e5096c039bdab0e0b1
parent1e696bc33c30acda698e5e921adcc7f7e61976f7
i2c: ls2x-v2: return IRQ_HANDLED after servicing an error

The event ISR reads SR1 and, when an error flag (ARLO/AF/BERR) is set,
calls loongson2_i2c_isr_error() which clears the offending flag, issues
STOP for the AF case, records msg->result, masks every CR2 interrupt
enable and completes the waiter. The handler then returns IRQ_NONE,
declaring to the IRQ core that the device did not interrupt.

That report is wrong. The device did interrupt and the handler fully
serviced it. Because the IRQ is requested with IRQF_SHARED, the genirq
spurious-IRQ tracker counts each error as unhandled. A bus that emits
sporadic NACKs, arbitration losses or bus errors will therefore march
toward the spurious-IRQ threshold and the line can end up disabled,
wedging the controller.

Return IRQ_HANDLED on this path. The other IRQ_NONE site, taken when
neither an event nor an error bit is set, remains correct.

Fixes: 6d1b0785f6d5 ("i2c: ls2x-v2: Add driver for Loongson-2K0300 I2C controller")
Signed-off-by: David Carlier <devnexen@gmail.com>
Assisted-by: Codex:GPT-5.5
Reviewed-by: Binbin Zhou <zhoubinbin@loongson.cn>
Tested-by: Binbin Zhou <zhoubinbin@loongson.cn>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260506154015.94815-1-devnexen@gmail.com
drivers/i2c/busses/i2c-ls2x-v2.c