]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: npcm: Handle spurious interrupts
authorTali Perry <tali.perry1@gmail.com>
Tue, 17 May 2022 10:11:39 +0000 (18:11 +0800)
committerWolfram Sang <wsa@kernel.org>
Sat, 21 May 2022 05:53:23 +0000 (07:53 +0200)
commitffd1a2652ec266a9cfe29e68c7450328064e1c6f
treefe6cde8eaf750be0a4ae1d2da96bd7b778adf290
parent6938b788f61d399449e23c29e829b866bf430cba
i2c: npcm: Handle spurious interrupts

On some platforms in rare cases (1 to 100,000 transactions),
the i2c gets a spurious interrupt which means that we enter an interrupt
but in the interrupt handler we don't find any status bit that points to
the reason we got this interrupt.

This may be a case of a rare HW issue or signal integrity issue that is
still under investigation.

In order to overcome this we are doing the following:
1. Disable incoming interrupts in master mode only when slave mode is not
   enabled.
2. Clear end of busy (EOB) after every interrupt.
3. Clear other status bits (just in case since we found them cleared)
4. Return correct status during the interrupt that will finish the
   transaction.

On next xmit transaction if the bus is still busy the master will issue a
recovery process before issuing the new transaction.

Fixes: 58fafb9526b2 ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver")
Signed-off-by: Tali Perry <tali.perry1@gmail.com>
Signed-off-by: Tyrone Ting <kfting@nuvoton.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-npcm7xx.c