[PATCH v3 0/3] i2c: qcom-geni: improve transfer error recovery and synchronization

From: Praveen Talari

Date: Thu Jul 16 2026 - 02:39:11 EST


The GENI I2C driver has few issues in its transfer recovery
and completion handling paths.

The timeout recovery flow directly aborts outstanding commands, while
GENI hardware requires command cancellation to be attempted before
issuing an abort. In addition, multiple operations share a common
completion object, which can allow unrelated events to wake waiters
prematurely and lead to incorrect synchronization.

The M_GP_IRQ_1 interrupt fires for both address-phase and data-phase
NACKs, but the driver treated them identically, triggering unnecessary
cancellation and reset operations even though the address-phase NACK
has already terminated the transfer without arming the DMA engine.
For an address NACK, the hardware requires no recovery since the DMA
engine was never armed. For a data NACK on a write transfer, the DMA
engine was active and the normal cancel and FSM reset path must run.

Signed-off-by: Praveen Talari <praveen.talari@xxxxxxxxxxxxxxxx>
---
Changes in v3:
- Updated Address and Data NACK error message.
- Link to v2: https://patch.msgid.link/20260709-fix_cancel_sequence_on_failure_for_i2c-v2-0-1db178c695bb@xxxxxxxxxxxxxxxx

Changes in v2:
- Fix typo: "signalled" -> "signaled" in patch 1 commit message
- Replace "shared" with "common completion event for transfer, abort
and DMA reset" in patch 2 commit message
- Fix "has a few issues" -> "has few issues" in cover letter
- Fix "cancel and reset operations" -> "cancellation and reset
operations" in cover letter
- Add geni_i2c_check_addr_data_nack() to correctly gate DMA FSM
reset and cancel per NACK type
- Link to v1: https://patch.msgid.link/20260708-fix_cancel_sequence_on_failure_for_i2c-v1-0-dd8f841f36a2@xxxxxxxxxxxxxxxx

---
Praveen Talari (3):
i2c: qcom-geni: use cancel command before abort on transfer timeout
i2c: qcom-geni: use dedicated completions for abort and reset events
i2c: qcom-geni: distinguish address-phase and data-phase NACK

drivers/i2c/busses/i2c-qcom-geni.c | 113 ++++++++++++++++++++++++-------------
1 file changed, 75 insertions(+), 38 deletions(-)
---
base-commit: 173f2099661309fd2a52fe94e6bcbbaf0d323dea
change-id: 20260703-fix_cancel_sequence_on_failure_for_i2c-a868571f77e0

Best regards,
--
Praveen Talari <praveen.talari@xxxxxxxxxxxxxxxx>