mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: getfeus@gmail.com, Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Maulik Shah <maulik.shah@oss.qualcomm.com>
Subject: Re: [PATCH] soc: qcom: rpmh: Return the first error from flush_batch()
Date: Mon, 30 Nov 2026 09:54:45 +0100	[thread overview]
Message-ID: <7807a6d3-1bdf-4a5d-9f55-3a8c2f107aca@oss.qualcomm.com> (raw)
In-Reply-To: <CA+m4KrAaEbbZywwCq38BqvTuh9dn2+23br6N3FYxB-mix_+R6g@mail.gmail.com>

On 11/27/26 10:31 AM, getfeus@gmail.com 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@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;

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

  reply	other threads:[~2026-11-30  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  9:31 getfeus
2026-11-30  8:54 ` Konrad Dybcio [this message]
2026-11-30  9:30   ` YoungJoon Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7807a6d3-1bdf-4a5d-9f55-3a8c2f107aca@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=getfeus@gmail.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maulik.shah@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®