media: venus: firmware: Ignore secure call error on first resume
authorStanimir Varbanov <stanimir.varbanov@linaro.org>
Wed, 4 Mar 2020 10:09:49 +0000 (11:09 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 30 Mar 2020 09:28:18 +0000 (11:28 +0200)
With the latest cleanup in qcom scm driver the secure monitor
call for setting the remote processor state returns EINVAL when
it is called for the first time and after another scm call
auth_and_reset. The error returned from scm call could be ignored
because the state transition is already done in auth_and_reset.

Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/qcom/venus/firmware.c

index de6812fb55f45c7edce7d7a29c1fb53265d15f54..8801a6a7543de872a8c4204d49b30ef3b720f311 100644 (file)
@@ -44,8 +44,14 @@ static void venus_reset_cpu(struct venus_core *core)
 
 int venus_set_hw_state(struct venus_core *core, bool resume)
 {
-       if (core->use_tz)
-               return qcom_scm_set_remote_state(resume, 0);
+       int ret;
+
+       if (core->use_tz) {
+               ret = qcom_scm_set_remote_state(resume, 0);
+               if (resume && ret == -EINVAL)
+                       ret = 0;
+               return ret;
+       }
 
        if (resume)
                venus_reset_cpu(core);