[PATCH v4 0/2] PM: runtime: Fix sticky -EINVAL after resume callback failure
From: Praveen Talari
Date: Fri Jul 10 2026 - 06:13:16 EST
When a runtime PM resume callback returns an error, rpm_callback() sets
power.runtime_error on the device. All subsequent rpm_resume() calls
then return -EINVAL immediately at the top of the function, permanently
blocking any future resume attempt — including those triggered by
consumers trying to power up their suppliers — until runtime PM is
explicitly re-initialized.
Unlike suspend failures, resume failures should be retryable. The first
patch fixes this in the core by only setting power.runtime_error when a
suspend callback fails, leaving resume failures transient by nature.
The second patch fixes a pre-existing issue in the spi-geni-qcom driver
that this scenario exposed: pm_runtime_get_sync() was called in
spi_geni_init() without checking the return value, so a resume failure
would silently proceed to access hardware registers on a device that was
not powered up.
Signed-off-by: Praveen Talari <praveen.talari@xxxxxxxxxxxxxxxx>
---
Changes in v4:
- Added close brace to resolve build issue.
- Link to v3: https://patch.msgid.link/20260706-fix_sticky_-einval_after_pm_runtime_api_failure-v3-0-92feb5a7b926@xxxxxxxxxxxxxxxx
Changes in v3:
- Moved power.runtime_error assignment from rpm_callback() into
rpm_suspend() at the fail label, per maintainer feedback.
- Link to v2: https://patch.msgid.link/20260703-fix_sticky_-einval_after_pm_runtime_api_failure-v2-0-578b78a0cf46@xxxxxxxxxxxxxxxx
Changes in v2:
- Reworked the fix per maintainer feedback: instead of calling
pm_runtime_set_suspended() in rpm_get_suppliers(), fix the root cause
in rpm_callback() by not setting power.runtime_error on resume
callback failures.
- Link to v1: https://patch.msgid.link/20260702-fix_sticky_-einval_after_pm_runtime_api_failure-v1-0-6ddc317011c0@xxxxxxxxxxxxxxxx
To: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
To: Pavel Machek <pavel@xxxxxxxxxx>
To: Len Brown <lenb@xxxxxxxxxx>
To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
To: Danilo Krummrich <dakr@xxxxxxxxxx>
To: Mark Brown <broonie@xxxxxxxxxx>
To: Alok Chauhan <alokc@xxxxxxxxxxxxxx>
To: Stephen Boyd <swboyd@xxxxxxxxxxxx>
To: Douglas Anderson <dianders@xxxxxxxxxxxx>
To: Dilip Kota <dkota@xxxxxxxxxxxxxx>
To: Girish Mahadevan <girishm@xxxxxxxxxxxxxx>
To: bjorn.andersson@xxxxxxxxxxxxxxxx
To: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
Cc: linux-pm@xxxxxxxxxxxxxxx
Cc: driver-core@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-arm-msm@xxxxxxxxxxxxxxx
Cc: linux-spi@xxxxxxxxxxxxxxx
Cc: Mukesh Kumar Savaliya <mukesh.savaliya@xxxxxxxxxxxxxxxx>
Cc: aniket.randive@xxxxxxxxxxxxxxxx
Cc: chandana.chiluveru@xxxxxxxxxxxxxxxx
---
Praveen Talari (2):
PM: runtime: Only set runtime_error on suspend callback failures
spi: qcom-geni: Fix missing error check on pm_runtime_get_sync()
drivers/base/power/runtime.c | 6 +++---
drivers/spi/spi-geni-qcom.c | 17 ++++++++++-------
2 files changed, 13 insertions(+), 10 deletions(-)
---
base-commit: 34cf6dafc47441dfb6b356a095b89c3585a93714
change-id: 20260625-fix_sticky_-einval_after_pm_runtime_api_failure-6797d0a5c4d0
Best regards,
--
Praveen Talari <praveen.talari@xxxxxxxxxxxxxxxx>