* [PATCH] remoteproc: qcom_q6v5_pas: Preserve shutdown error in qcom_pas_stop()
@ 2026-09-21 19:33 Anup Vishwakarma
2026-10-20 8:06 ` Konrad Dybcio
0 siblings, 1 reply; 2+ messages in thread
From: Anup Vishwakarma @ 2026-09-21 19:33 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier
Cc: linux-arm-msm, linux-remoteproc, linux-kernel, Anup Vishwakarma
qcom_pas_stop() unconditionally overwrites ret with the return value of
qcom_smem_bust_hwspin_lock_by_host(), discarding any earlier shutdown
error from qcom_pas_shutdown(). If the primary shutdown fails but the
hwspin_lock bust succeeds, the function returns 0, silently masking the
failure from the remoteproc core.
Use a separate local variable for the hwspin_lock result and only update
ret if it is currently 0, consistent with how the DTB shutdown error is
already handled in the same function.
Fixes: 568b13b65078 ("remoteproc: qcom_q6v5_pas: Add hwspinlock bust on stop")
Signed-off-by: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
---
drivers/remoteproc/qcom_q6v5_pas.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index a005546c265d..845aed000a1b 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -436,8 +436,15 @@ static int qcom_pas_stop(struct rproc *rproc)
if (handover)
qcom_pas_handover(&pas->q6v5);
- if (pas->smem_host_id)
- ret = qcom_smem_bust_hwspin_lock_by_host(pas->smem_host_id);
+ if (pas->smem_host_id) {
+ int lock_ret = qcom_smem_bust_hwspin_lock_by_host(pas->smem_host_id);
+
+ if (lock_ret) {
+ dev_err(pas->dev, "failed to bust hwspin_lock: %d\n", lock_ret);
+ if (!ret)
+ ret = lock_ret;
+ }
+ }
return ret;
}
---
base-commit: 5c4d4169604b335c38bbc79bc1fc03042981fc6f
change-id: 20260922-b4-q6v5_pas_stop_preserve_shutdown_error-39be7e8133e6
Best regards,
--
Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] remoteproc: qcom_q6v5_pas: Preserve shutdown error in qcom_pas_stop()
2026-09-21 19:33 [PATCH] remoteproc: qcom_q6v5_pas: Preserve shutdown error in qcom_pas_stop() Anup Vishwakarma
@ 2026-10-20 8:06 ` Konrad Dybcio
0 siblings, 0 replies; 2+ messages in thread
From: Konrad Dybcio @ 2026-10-20 8:06 UTC (permalink / raw)
To: Anup Vishwakarma, Bjorn Andersson, Mathieu Poirier
Cc: linux-arm-msm, linux-remoteproc, linux-kernel
On 9/21/26 9:33 PM, Anup Vishwakarma wrote:
> qcom_pas_stop() unconditionally overwrites ret with the return value of
> qcom_smem_bust_hwspin_lock_by_host(), discarding any earlier shutdown
> error from qcom_pas_shutdown(). If the primary shutdown fails but the
> hwspin_lock bust succeeds, the function returns 0, silently masking the
> failure from the remoteproc core.
>
> Use a separate local variable for the hwspin_lock result and only update
> ret if it is currently 0, consistent with how the DTB shutdown error is
> already handled in the same function.
>
> Fixes: 568b13b65078 ("remoteproc: qcom_q6v5_pas: Add hwspinlock bust on stop")
> Signed-off-by: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-20 8:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21 19:33 [PATCH] remoteproc: qcom_q6v5_pas: Preserve shutdown error in qcom_pas_stop() Anup Vishwakarma
2026-10-20 8:06 ` Konrad Dybcio
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®