Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v3 0/2] PM: runtime: Fix sticky -EINVAL after resume callback failure
@ 2026-07-06  8:53 Praveen Talari
  2026-07-06  8:53 ` [PATCH v3 1/2] PM: runtime: Only set runtime_error on suspend callback failures Praveen Talari
  2026-07-06  8:53 ` [PATCH v3 2/2] spi: qcom-geni: Fix missing error check on pm_runtime_get_sync() Praveen Talari
  0 siblings, 2 replies; 17+ messages in thread
From: Praveen Talari @ 2026-07-06  8:53 UTC (permalink / raw)
  To: Mark Brown, Dilip Kota, Stephen Boyd, Girish Mahadevan,
	Alok Chauhan, bjorn.andersson, Konrad Dybcio, Rafael J. Wysocki,
	Len Brown, Pavel Machek, Greg Kroah-Hartman, Danilo Krummrich,
	Douglas Anderson
  Cc: linux-spi, linux-kernel, linux-arm-msm, Mukesh Kumar Savaliya,
	aniket.randive, chandana.chiluveru, jyothi.seerapu, linux-pm,
	driver-core, Praveen Talari

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@oss.qualcomm.com>
---
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@oss.qualcomm.com

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@oss.qualcomm.com

---
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  | 18 ++++++++++--------
 2 files changed, 13 insertions(+), 11 deletions(-)
---
base-commit: 4e5dfb7c84012007c3c7061126491bbc92d71bf1
change-id: 20260625-fix_sticky_-einval_after_pm_runtime_api_failure-6797d0a5c4d0

Best regards,
--  
Praveen Talari <praveen.talari@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-07-10  9:43 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06  8:53 [PATCH v3 0/2] PM: runtime: Fix sticky -EINVAL after resume callback failure Praveen Talari
2026-07-06  8:53 ` [PATCH v3 1/2] PM: runtime: Only set runtime_error on suspend callback failures Praveen Talari
2026-07-06 11:49   ` Rafael J. Wysocki (Intel)
2026-07-06 13:21     ` Mark Brown
2026-07-06 14:10       ` Rafael J. Wysocki (Intel)
2026-07-06 17:30         ` Mark Brown
2026-07-09 14:52           ` Rafael J. Wysocki (Intel)
2026-07-09 16:35   ` Mark Brown
2026-07-09 17:35     ` Rafael J. Wysocki (Intel)
2026-07-09 17:38       ` Mark Brown
2026-07-06  8:53 ` [PATCH v3 2/2] spi: qcom-geni: Fix missing error check on pm_runtime_get_sync() Praveen Talari
2026-07-06 13:04   ` Konrad Dybcio
2026-07-09 14:54   ` Rafael J. Wysocki (Intel)
2026-07-09 18:29   ` Mark Brown
2026-07-10  4:11     ` Praveen Talari
2026-07-10  9:23       ` Mark Brown
2026-07-10  9:43         ` Praveen Talari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox