[PATCH v7 0/2] i2c: i2c-qcom-geni: serve transfers during early resume
From: Mukesh Kumar Savaliya
Date: Thu Jul 09 2026 - 10:06:42 EST
I2C transfers issued during the resume_noirq phase can fail on systems
using GENI I2C controllers with GPI DMA.
Some devices require I2C communication before their resume sequence can
complete. One example is a USB Ethernet device attached through PCIe,
where device configuration must be restored over I2C before PCIe link
initialization can proceed. Since such accesses may occur from
resume_noirq(), the I2C controller and its DMA backend must be capable
of servicing transfers at that stage.
GENI I2C transfers depend on interrupt-driven completion. During system
resume, both the GENI controller interrupt and the GPI DMA interrupt may
remain unavailable until the normal interrupt resume phase, preventing
transfer completion during early resume. Additionally, runtime PM may
still be disabled when the I2C transfer path is entered, causing
pm_runtime_get_sync() to return -EACCES and preventing controller
resources from being enabled.
Address these issues by:
- Allowing the GPI DMA interrupt to resume early and remain active
across system suspend/resume transitions.
- Allowing the GENI I2C interrupt to operate during early resume and
restoring runtime PM when necessary from resume_noirq().
With these changes, GENI I2C transfers can complete successfully during
the resume_noirq phase, allowing dependent devices to finish their
resume sequence without waiting for the regular interrupt resume stage.
Co-developed-by: Viken Dadhaniya <viken.dadhaniya@xxxxxxxxxxxxxxxx>
Signed-off-by: Viken Dadhaniya <viken.dadhaniya@xxxxxxxxxxxxxxxx>
Signed-off-by: Mukesh Kumar Savaliya <mukesh.savaliya@xxxxxxxxxxxxxxxx>
Acked-by: Aniket Randive <aniketrandive@xxxxxxxxxxxxxxxx>
----
v6->v7 :
- Separated gpi.c file change into separate patch due to dma engine subsystem.
- Added cover letter as patches increased to two from one.
- Added acked-by tag recieved in V6 patch.
Link to V6: https://lore.kernel.org/all/b7404cdb-7c67-40b0-8124-d4977a8ed3cf@xxxxxxxxxxxxxxxx/
---
v5->v6 :
- Modified commit log to start with problem description as suggested by Bjorn.
- Moved to new implementation of the logic while earlier replied to comments on
older design and considers latest fix added recently.
- Made change generic to I2C including GPI mode transfer, this was not done earlier.
- Changed email address to oss.qualcomm.com domain.
Link to V5: https://lore.kernel.org/lkml/20241227130236.755794-1-quic_msavaliy@xxxxxxxxxxx/
---
v4->v5:
- Commit log enhanced considering Bjorn's comments by explaining PCIe usecase.
- Enhanced comment with reason when using pm_runtime_force_resume().
- Corrected IS_ENABLED(CONFIG_PM) condition inside geni_i2c_xfer().
- Improved debug log as per Bjorn's suggestions during suspend, resume.
- Reverted back comment before devm_request_irq().
Link to V4: https://lore.kernel.org/lkml/bd699719-4958-445a-a685-4b5f6a8ad81f@xxxxxxxxxxx/
---
v3->v4 :
- Enhanced commit log by explaining client usecase scenario during early resume.
- Covered 'usage_count' of 'struct dev_pm_info' under CONFIG_PM to compile non PM CONFIG.
Link to V3: https://lore.kernel.org/all/20241119143031.3331753-1-quic_msavaliy@xxxxxxxxxxx/T/
---
v2 -> v3:
- Updated exact usecase and scenario in the commit log description.
- Removed bulleted points from technical description, added details in free flow.
- Used pm_runtime_force_resume/suspend() instead customized local implementation.
- Added debug log after pm_runtime_force_suspend().
Link to V2: https://lore.kernel.org/lkml/202410132233.P25W2vKq-lkp@xxxxxxxxx/T/
---
v1 -> v2:
- Changed gi2c->se.dev to dev during dev_dbg() calls.
- Addressed review comments from Andi and Bjorn.
- Returned 0 instead garbage inside geni_i2c_force_resume().
- Added comments explaining forced resume transfer when runtime PM
remains disabled.
Link to V1: https://patches.linaro.org/project/linux-i2c/patch/20240328123743.1713696-1-quic_msavaliy@xxxxxxxxxxx/
----
Mukesh Kumar Savaliya (2):
i2c: qcom-geni: Handle runtime PM disabled state during early resume
dmaengine: qcom-gpi: Keep GPI interrupt active during system resume
drivers/dma/qcom/gpi.c | 3 ++-
drivers/i2c/busses/i2c-qcom-geni.c | 12 +++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
--
2.43.0