mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: rpmh: Return the first error from flush_batch()
@ 2026-11-27  9:31 getfeus
  2026-11-30  8:54 ` Konrad Dybcio
  0 siblings, 1 reply; 3+ messages in thread
From: getfeus @ 2026-11-27  9:31 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio; +Cc: linux-arm-msm, linux-kernel

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@gmail.com>
---
--- 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;
 }

 /**

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

end of thread, other threads:[~2026-11-30  9:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27  9:31 [PATCH] soc: qcom: rpmh: Return the first error from flush_batch() getfeus
2026-11-30  8:54 ` Konrad Dybcio
2026-11-30  9:30   ` YoungJoon Lee

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

all inboxes | Powered by JetHome®