From: Lee Youngjoon <getfeus@gmail.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] soc: qcom: rpmh: Preserve the first error from flush_batch()
Date: Sat, 05 Dec 2026 23:42:58 +0900 [thread overview]
Message-ID: <20261205-rpmh-flush-batch-v2-7d613ac2dff0@gmail.com> (raw)
A failed sleep or wake TCS write skips the rest of its cached batch.
If a later batch succeeds, flush_batch() can return success. Once the
individual cached requests also succeed, rpmh_flush() marks the cache
clean even though some batch commands were never programmed. The next
flush then skips those commands until the cache changes.
Keep the first write error and return it after walking the batch list.
Continue to try subsequent independent batches. A partial flush then
leaves the cache dirty so the next flush programs the cached requests
again.
Fixes: c8790cb6da58 ("drivers: qcom: rpmh: add support for batch RPMH request")
Signed-off-by: Lee Youngjoon <getfeus@gmail.com>
---
Changes in v2:
- Keep processing later cached batches after a write error, as Konrad
pointed out that they can target independent endpoints.
- Test the next rpmh_flush() with the failing batch first and last.
Link to v1: https://lore.kernel.org/r/CA+m4KrAaEbbZywwCq38BqvTuh9dn2+23br6N3FYxB-mix_+R6g@mail.gmail.com
Review: https://lore.kernel.org/r/7807a6d3-1bdf-4a5d-9f55-3a8c2f107aca@oss.qualcomm.com
OpenAI Codex assisted with the change, commit message and host tests.
drivers/soc/qcom/rpmh.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c
index 360242a31..a449dcb74 100644
--- a/drivers/soc/qcom/rpmh.c
+++ b/drivers/soc/qcom/rpmh.c
@@ -338,7 +338,8 @@ static int flush_batch(struct rpmh_ctrlr *ctrlr)
{
struct batch_cache_req *req;
const struct rpmh_request *rpm_msg;
- int ret = 0;
+ int first_error = 0;
+ int ret;
int i;
/* Send Sleep/Wake requests to the controller, expect no response */
@@ -347,12 +348,15 @@ static int flush_batch(struct rpmh_ctrlr *ctrlr)
rpm_msg = req->rpm_msgs + i;
ret = rpmh_rsc_write_ctrl_data(ctrlr_to_drv(ctrlr),
&rpm_msg->msg);
- if (ret)
+ if (ret) {
+ if (!first_error)
+ first_error = ret;
break;
+ }
}
}
- return ret;
+ return first_error;
}
/**
base-commit: 1e5bbf63105d0b367efc6df0bf87c7fde0f91995
reply other threads:[~2026-12-05 14:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261205-rpmh-flush-batch-v2-7d613ac2dff0@gmail.com \
--to=getfeus@gmail.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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®