* [PATCH] soc: qcom: pbs: Preserve trigger errors during cleanup
@ 2026-11-17 4:25 Kusuma Harish Etamsetti
0 siblings, 0 replies; only message in thread
From: Kusuma Harish Etamsetti @ 2026-11-17 4:25 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Anjelique Melendez
Cc: linux-arm-msm, linux-kernel, Kusuma Harish Etamsetti
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>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-17 4:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 4:25 [PATCH] soc: qcom: pbs: Preserve trigger errors during cleanup Kusuma Harish Etamsetti
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®