linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware: qcom: scm: Fix interrupted SCM calls fully
@ 2016-09-28 10:42 Sricharan R
  2016-10-26 18:35 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Sricharan R @ 2016-09-28 10:42 UTC (permalink / raw)
  To: patches, linux-arm-msm, will.deacon, stanimir.varbanov,
	linux-kernel, srinivas.kandagatla, catalin.marinas, andy.gross,
	bjorn.andersson, sboyd
  Cc: sricharan

Patch [1] fixes the issues with interrupted SCM64 calls
by returning the register r6 (Session ID) on the next try, but register
r0 also needs to be preserved for the retry. r0 contains the
result of the previous try. Without this i see that the SCM calls
hang when retried.

[1] https://patchwork.kernel.org/patch/9291589/

Signed-off-by: Sricharan R <sricharan@codeaurora.org>
---
 drivers/firmware/qcom_scm-64.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c
index 7ecd0e7..28b604e 100755
--- a/drivers/firmware/qcom_scm-64.c
+++ b/drivers/firmware/qcom_scm-64.c
@@ -134,6 +134,9 @@ static int qcom_scm_call(struct device *dev, u32 svc_id, u32 cmd_id,
 		res->a6 = 0;
 
 		do {
+			if (res->a0 == QCOM_SCM_INTERRUPTED)
+				cmd = res->a0;
+
 			arm_smccc_smc(cmd, desc->arginfo, desc->args[0],
 				      desc->args[1], desc->args[2], x5, res->a6, 0,
 				      res);
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] firmware: qcom: scm: Fix interrupted SCM calls fully
  2016-09-28 10:42 [PATCH] firmware: qcom: scm: Fix interrupted SCM calls fully Sricharan R
@ 2016-10-26 18:35 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2016-10-26 18:35 UTC (permalink / raw)
  To: andy.gross, Sricharan R
  Cc: patches, linux-arm-msm, will.deacon, stanimir.varbanov,
	linux-kernel, srinivas.kandagatla, catalin.marinas, sboyd

On Wed 28 Sep 03:42 PDT 2016, Sricharan R wrote:

> Patch [1] fixes the issues with interrupted SCM64 calls
> by returning the register r6 (Session ID) on the next try, but register
> r0 also needs to be preserved for the retry. r0 contains the
> result of the previous try. Without this i see that the SCM calls
> hang when retried.
> 
> [1] https://patchwork.kernel.org/patch/9291589/
> 

Andy, this is needed as well on 8996 - or I get rcu stalls during
firmware loading operations (so I guess it's busy spinning in that
loop).

Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
> ---
>  drivers/firmware/qcom_scm-64.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c
> index 7ecd0e7..28b604e 100755
> --- a/drivers/firmware/qcom_scm-64.c
> +++ b/drivers/firmware/qcom_scm-64.c
> @@ -134,6 +134,9 @@ static int qcom_scm_call(struct device *dev, u32 svc_id, u32 cmd_id,
>  		res->a6 = 0;
>  
>  		do {
> +			if (res->a0 == QCOM_SCM_INTERRUPTED)
> +				cmd = res->a0;
> +
>  			arm_smccc_smc(cmd, desc->arginfo, desc->args[0],
>  				      desc->args[1], desc->args[2], x5, res->a6, 0,
>  				      res);
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-26 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-28 10:42 [PATCH] firmware: qcom: scm: Fix interrupted SCM calls fully Sricharan R
2016-10-26 18:35 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).