[PATCH 4/4] spi: qcom-geni: fix sticky -EINVAL after PM runtime resume failure
From: Praveen Talari
Date: Thu Jul 02 2026 - 02:11:26 EST
PM_RUNTIME_ACQUIRE_IF_ENABLED() in spi_geni_init() calls
pm_runtime_resume_and_get() internally. When the resume callback
fails (e.g. -ETIMEDOUT), the RPM core sets power.runtime_error on
the device. Every subsequent PM_RUNTIME_ACQUIRE call then returns
-EINVAL immediately without attempting the resume, permanently
blocking the driver even though the underlying error may be transient.
Add pm_runtime_set_suspended() on the failure path to clear
power.runtime_error, allowing the next attempt to re-enter the
resume callback rather than failing immediately with -EINVAL.
Signed-off-by: Praveen Talari <praveen.talari@xxxxxxxxxxxxxxxx>
---
drivers/spi/spi-geni-qcom.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index a55a3afc0ebd..5f65e6d0d08b 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -616,6 +616,7 @@ static int spi_geni_init(struct spi_geni_master *mas)
PM_RUNTIME_ACQUIRE_IF_ENABLED(mas->dev, pm);
ret = PM_RUNTIME_ACQUIRE_ERR(&pm);
if (ret < 0) {
+ pm_runtime_set_suspended(mas->dev);
dev_err(mas->dev, "Failed to resume and get %d\n", ret);
return ret;
}
--
2.34.1