Re: [PATCH] soc: qcom: rpmh: Return the first error from flush_batch()
From: Konrad Dybcio
Date: Mon Nov 30 2026 - 03:54:55 EST
On 11/27/26 10:31 AM, getfeus@xxxxxxxxx wrote:
> 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;
I think this is intentional. We may have a number of disjoint
writes to different endpoints in the same batch, and some may
fail, while others may succeed (and not have any dependency on
the prior).
Konrad