[PATCH] soc: qcom: rpmh: Return the first error from flush_batch()
From: getfeus
Date: Fri Nov 27 2026 - 04:31:57 EST
When a TCS write fails, flush_batch() breaks out of the inner loop
and continues with the next cached batch. A later successful write can
overwrite the error and make rpmh_flush() proceed even though some
sleep or wake commands were skipped.
Return the error immediately so rpmh_flush() stops and leaves the
cache dirty for a retry.
A mocked TCS writer returning -ENOMEM for the first batch and success
for the second reproduced a zero return from flush_batch(). With this
change, flush_batch() returns -ENOMEM after a single write attempt.
The ARM64 kernel and modules also build successfully.
Signed-off-by: Lee Youngjoon <getfeus@xxxxxxxxx>
---
--- a/drivers/soc/qcom/rpmh.c
+++ b/drivers/soc/qcom/rpmh.c
@@ -334,11 +334,11 @@
ret = rpmh_rsc_write_ctrl_data(ctrlr_to_drv(ctrlr),
&rpm_msg->msg);
if (ret)
- break;
+ return ret;
}
}
- return ret;
+ return 0;
}
/**