From: Kusuma Harish Etamsetti <kusuma.etamsetti@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Abel Vesa <abelvesa@kernel.org>,
Anjelique Melendez <quic_amelende@quicinc.com>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
Kusuma Harish Etamsetti <kusuma.etamsetti@oss.qualcomm.com>
Subject: [PATCH] soc: qcom: pbs: Preserve trigger errors during cleanup
Date: Tue, 17 Nov 2026 09:55:08 +0530 [thread overview]
Message-ID: <20261117-harish-qcom-learning-v1-1-9bb3fb956a9c@oss.qualcomm.com> (raw)
When a regmap operation or the acknowledgment wait fails in the
trigger loop, ret contains the appropriate error. The final SCRATCH1
cleanup overwrites ret, however, so a successful cleanup makes
qcom_pbs_trigger_event() incorrectly return success.
Keep the cleanup result separate and return the original trigger error
when one occurred. This lets callers such as the LPG driver detect that
the PBS sequence was not triggered.
Fixes: 5b2dd77be1d8 ("soc: qcom: add QCOM PBS driver")
Signed-off-by: Kusuma Harish Etamsetti <kusuma.etamsetti@oss.qualcomm.com>
---
Fix qcom_pbs_trigger_event() to preserve errors from the trigger
operation instead of overwriting them with the SCRATCH1 cleanup result.
---
drivers/soc/qcom/qcom-pbs.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/qcom/qcom-pbs.c b/drivers/soc/qcom/qcom-pbs.c
index 06b4a596e275..13c67f85f634 100644
--- a/drivers/soc/qcom/qcom-pbs.c
+++ b/drivers/soc/qcom/qcom-pbs.c
@@ -76,7 +76,7 @@ int qcom_pbs_trigger_event(struct pbs_dev *pbs, u8 bitmap)
{
unsigned int val;
u16 bit_pos;
- int ret;
+ int ret, cleanup_ret;
if (WARN_ON(!bitmap))
return -EINVAL;
@@ -128,7 +128,11 @@ int qcom_pbs_trigger_event(struct pbs_dev *pbs, u8 bitmap)
}
/* Clear all the requested bitmap */
- return regmap_update_bits(pbs->regmap, pbs->base + PBS_CLIENT_SCRATCH1, bitmap, 0);
+ cleanup_ret = regmap_update_bits(pbs->regmap,
+ pbs->base + PBS_CLIENT_SCRATCH1,
+ bitmap, 0);
+
+ return ret < 0 ? ret : cleanup_ret;
}
EXPORT_SYMBOL_GPL(qcom_pbs_trigger_event);
---
base-commit: 6a876df4686788cd39128b62d7fcbff62f39278f
change-id: 20261116-harish-qcom-learning-c9cc071ca193
Best regards,
--
Kusuma Harish Etamsetti <kusuma.etamsetti@oss.qualcomm.com>
reply other threads:[~2026-11-17 4:25 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=20261117-harish-qcom-learning-v1-1-9bb3fb956a9c@oss.qualcomm.com \
--to=kusuma.etamsetti@oss.qualcomm.com \
--cc=abelvesa@kernel.org \
--cc=andersson@kernel.org \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_amelende@quicinc.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®