Skip to contentSkip to conversation

i2c: qcom-cci: drop custom suspend/resume and rely on runtime PM helpers

PATCH Applied Wenmeng Liu 5 participants 5 messages Jun 25 – Jul 28

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: qcom-cci: drop custom suspend/resume and rely on runtime PM helpers

cci_resume() unconditionally calls cci_resume_runtime() regardless of the runtime PM state.

If the device is already runtime-suspended before system suspend, the clock is re-enabled while runtime_status remains RPM_SUSPENDED. As a result, pm_request_autosuspend() does not arm the timer, leaving the clock permanently enabled.

Fixes e517526195de ("i2c: Add Qualcomm CCI I2C driver")
---
 drivers/i2c/busses/i2c-qcom-cci.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/i2c/busses/i2c-qcom-cci.c +1 -17
index 4d64895a9e9e4e0bd5e0ccb5c3cc04b282b1e4d5..bdeda3979c4814b5cdb463734b8361da7fffa879 100644
@@ -492,24 +492,8 @@ static int __maybe_unused cci_resume_runtime(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused cci_suspend(struct device *dev)
-{
-	if (!pm_runtime_suspended(dev))
-		return cci_suspend_runtime(dev);
-
-	return 0;
-}
-
-static int __maybe_unused cci_resume(struct device *dev)
-{
-	cci_resume_runtime(dev);
-	pm_request_autosuspend(dev);
-
-	return 0;
-}
-
 static const struct dev_pm_ops qcom_cci_pm = {
-	SET_SYSTEM_SLEEP_PM_OPS(cci_suspend, cci_resume)
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 	SET_RUNTIME_PM_OPS(cci_suspend_runtime, cci_resume_runtime, NULL)
 };
 

---
base-commit: 4e5dfb7c84012007c3c7061126491bbc92d71bf1
change-id: 20260625-cci-3eedf766d43b

Best regards,

Signature · 1 line
Wenmeng Liu <[email protected]>
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Wenmeng Liu

cci_resume() unconditionally calls cci_resume_runtime() regardless of the runtime PM state.

Quoted 8 lines

If the device is already runtime-suspended before system suspend, the clock is re-enabled while runtime_status remains RPM_SUSPENDED. As a result, pm_request_autosuspend() does not arm the timer, leaving the clock permanently enabled.

Fixes e517526195de ("i2c: Add Qualcomm CCI I2C driver")
Quoted 43 lines
---
 drivers/i2c/busses/i2c-qcom-cci.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/i2c/busses/i2c-qcom-cci.c +1 -18
index 4d64895a9e9e4e0bd5e0ccb5c3cc04b282b1e4d5..bdeda3979c4814b5cdb463734b8361da7fffa879 100644
@@ -492,24 +492,8 @@ static int __maybe_unused cci_resume_runtime(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused cci_suspend(struct device *dev)
-{
-       if (!pm_runtime_suspended(dev))
-               return cci_suspend_runtime(dev);
-
-       return 0;
-}
-
-static int __maybe_unused cci_resume(struct device *dev)
-{
-       cci_resume_runtime(dev);
-       pm_request_autosuspend(dev);
-
-       return 0;
-}
-
 static const struct dev_pm_ops qcom_cci_pm = {
-       SET_SYSTEM_SLEEP_PM_OPS(cci_suspend, cci_resume)
+       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
        SET_RUNTIME_PM_OPS(cci_suspend_runtime, cci_resume_runtime, NULL)
 };
 
 
---

base-commit: 4e5dfb7c84012007c3c7061126491bbc92d71bf1
change-id: 20260625-cci-3eedf766d43b

Best regards,
--
Wenmeng Liu <[email protected]>

Reviewed-by on v1 1/1
#2 lore raw
In reply to Wenmeng Liu
Quoted 8 lines · Wenmeng Liu

cci_resume() unconditionally calls cci_resume_runtime() regardless of the runtime PM state.

If the device is already runtime-suspended before system suspend, the clock is re-enabled while runtime_status remains RPM_SUSPENDED. As a result, pm_request_autosuspend() does not arm the timer, leaving the clock permanently enabled.

Quoted 4 lines
Fixes e517526195de ("i2c: Add Qualcomm CCI I2C driver")

---

Konrad

Reviewed-by on v1 1/1
#3 lore raw
In reply to Wenmeng Liu
Quoted 35 lines · Wenmeng Liu

cci_resume() unconditionally calls cci_resume_runtime() regardless of the runtime PM state.

If the device is already runtime-suspended before system suspend, the clock is re-enabled while runtime_status remains RPM_SUSPENDED. As a result, pm_request_autosuspend() does not arm the timer, leaving the clock permanently enabled.

Fixes e517526195de ("i2c: Add Qualcomm CCI I2C driver")
---
  drivers/i2c/busses/i2c-qcom-cci.c | 18 +-----------------
  1 file changed, 1 insertion(+), 17 deletions(-)
drivers/i2c/busses/i2c-qcom-cci.c +0 -12
index 4d64895a9e9e4e0bd5e0ccb5c3cc04b282b1e4d5..bdeda3979c4814b5cdb463734b8361da7fffa879 100644
@@ -492,24 +492,8 @@ static int __maybe_unused cci_resume_runtime(struct device *dev)
  	return 0;
  }
 
-static int __maybe_unused cci_suspend(struct device *dev)
-{
-	if (!pm_runtime_suspended(dev))
-		return cci_suspend_runtime(dev);
-
-	return 0;
-}
-
-static int __maybe_unused cci_resume(struct device *dev)
-{
-	cci_resume_runtime(dev);
-	pm_request_autosuspend(dev);

drivers/i2c/busses/i2c-qcom-cci.c static int __maybe_unused cci_resume_runtime(struct device *dev) · line 499

Quoted 10 lines
drivers/i2c/busses/i2c-qcom-cci.c +1 -5
-
-	return 0;
-}
-
  static const struct dev_pm_ops qcom_cci_pm = {
-	SET_SYSTEM_SLEEP_PM_OPS(cci_suspend, cci_resume)
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
  	SET_RUNTIME_PM_OPS(cci_suspend_runtime, cci_resume_runtime, NULL)
  };
 
Signature · 2 lines
Best wishes,
Vladimir
maintainer Applied
#4 lore raw
In reply to Wenmeng Liu

Hi Wenmeng,

Quoted 11 lines · Wenmeng Liu

cci_resume() unconditionally calls cci_resume_runtime() regardless of the runtime PM state.

If the device is already runtime-suspended before system suspend, the clock is re-enabled while runtime_status remains RPM_SUSPENDED. As a result, pm_request_autosuspend() does not arm the timer, leaving the clock permanently enabled.

Fixes e517526195de ("i2c: Add Qualcomm CCI I2C driver")

merged to i2c/i2c-fixes.

Thanks,
Andi