Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3163398imm; Thu, 17 May 2018 04:33:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrFeIDXCKwqFCKqFl/4JJBdy1De2na4HbFNiRYKGANU0WYYsMnXNXinwE5IisjomwjxQDSa X-Received: by 2002:a63:384d:: with SMTP id h13-v6mr3814626pgn.209.1526556820574; Thu, 17 May 2018 04:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526556820; cv=none; d=google.com; s=arc-20160816; b=G2RmQ1uyM0EQIvLJHWVfUm1mCGp1nJYV8qhddkv7X7xXuc08wK0s+T7+yvW8KhThYO NNDBB1GrOyjupXXbGBQciti+FFglvCyUkPS8d7Yf2NcGCnRTZARGYGFwjYLM7UcPG0kK 6R1M3XK7SXuL+bJb9/lSlEdE+Ms1Ey2V/CSGZ+PPBr2W41T+za6L567t9WKFTH8c2J+J dlSCoH2nMDv1P8d+qokeTWukyJItTLPom/O+q+glNzzX5wApVGHyCkN8La9oeqd5jNj0 op7XpFHjhziBSSOz2mcvVdGgqeUk8ekJmS+tHC+XOLg6clSQ7T4ijhSdL98S9JWepTxp CWHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=TELFlnInh+rcWvFjnnPEf/6MJxAhkrXrXfqxaqGxeAs=; b=GQcu2VpWNIj2koGdPA/pSz+FowBksvdWmccWmBFXTBT+SbQ+iQn6hGKzU/E/fDLCKT LALhuaxyw0CpF4Gqj3M6zAaePZL4k+UcmPKLXcfBzmrzQW99qAIhJiCYLnhzUGCgbFjv uF7F/cBtawiaHRl5v4A12yXGnj9Cm++Ykfd2e9wun1abCHiWIHRU0i2Hpo+oYRP2zPGW mrEEMvpE4FjDfEiExtCI1o+93ojhokdrrFxVXTuR8Knd6lPynqtQpHazEr3iP4AgOboL 1vBuGxw3RFhN9+cJXFcf1YWFjXID0/wV9qwDFOpm+4S6zZcvQXhXT75xRGOw1B0/auSt IEdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=jwe9/8xP; dkim=pass header.i=@codeaurora.org header.s=default header.b=jwe9/8xP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a189-v6si3929399pgc.296.2018.05.17.04.33.26; Thu, 17 May 2018 04:33:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=jwe9/8xP; dkim=pass header.i=@codeaurora.org header.s=default header.b=jwe9/8xP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751999AbeEQLc7 (ORCPT + 99 others); Thu, 17 May 2018 07:32:59 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60322 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbeEQLc5 (ORCPT ); Thu, 17 May 2018 07:32:57 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9D51F60C67; Thu, 17 May 2018 11:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526556776; bh=Um+daHEyVR00+nR/DHCvmax2BgJYwG3DeHLU1u/0JYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jwe9/8xPbB2HhToInvznehGwcmqFbK9qAWsuPi0MF2MdwyAYBqp0aoJYdX6JcnpL4 hNzNJncPe67wTgCBVXF6sXO+QhOlnU7mPNh0V/ytiSFhJ1wJdqCc59f3wJv17PEbGn bVP1fxxAdfZeSINZnCSBLABm9o4bXCtyuZjLPuXg= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from vgarodia-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vgarodia@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 732E960881; Thu, 17 May 2018 11:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526556776; bh=Um+daHEyVR00+nR/DHCvmax2BgJYwG3DeHLU1u/0JYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jwe9/8xPbB2HhToInvznehGwcmqFbK9qAWsuPi0MF2MdwyAYBqp0aoJYdX6JcnpL4 hNzNJncPe67wTgCBVXF6sXO+QhOlnU7mPNh0V/ytiSFhJ1wJdqCc59f3wJv17PEbGn bVP1fxxAdfZeSINZnCSBLABm9o4bXCtyuZjLPuXg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 732E960881 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vgarodia@codeaurora.org From: Vikash Garodia To: hverkuil@xs4all.nl, mchehab@kernel.org, andy.gross@linaro.org, bjorn.andersson@linaro.org, stanimir.varbanov@linaro.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, acourbot@google.com, Vikash Garodia Subject: [PATCH 1/4] soc: qcom: mdt_loader: Add check to make scm calls Date: Thu, 17 May 2018 17:02:17 +0530 Message-Id: <1526556740-25494-2-git-send-email-vgarodia@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1526556740-25494-1-git-send-email-vgarodia@codeaurora.org> References: <1526556740-25494-1-git-send-email-vgarodia@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to invoke scm calls, ensure that the platform has the required support to invoke the scm calls in secure world. Signed-off-by: Vikash Garodia --- drivers/soc/qcom/mdt_loader.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c index 17b314d..db55d53 100644 --- a/drivers/soc/qcom/mdt_loader.c +++ b/drivers/soc/qcom/mdt_loader.c @@ -121,10 +121,12 @@ int qcom_mdt_load(struct device *dev, const struct firmware *fw, if (!fw_name) return -ENOMEM; - ret = qcom_scm_pas_init_image(pas_id, fw->data, fw->size); - if (ret) { - dev_err(dev, "invalid firmware metadata\n"); - goto out; + if (qcom_scm_is_available()) { + ret = qcom_scm_pas_init_image(pas_id, fw->data, fw->size); + if (ret) { + dev_err(dev, "invalid firmware metadata\n"); + goto out; + } } for (i = 0; i < ehdr->e_phnum; i++) { @@ -144,10 +146,13 @@ int qcom_mdt_load(struct device *dev, const struct firmware *fw, } if (relocate) { - ret = qcom_scm_pas_mem_setup(pas_id, mem_phys, max_addr - min_addr); - if (ret) { - dev_err(dev, "unable to setup relocation\n"); - goto out; + if (qcom_scm_is_available()) { + ret = qcom_scm_pas_mem_setup(pas_id, mem_phys, + max_addr - min_addr); + if (ret) { + dev_err(dev, "unable to setup relocation\n"); + goto out; + } } /* -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project