linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jordan Crouse <jcrouse@codeaurora.org>
To: Vikash Garodia <vgarodia@codeaurora.org>
Cc: hverkuil@xs4all.nl, mchehab@kernel.org, andy.gross@linaro.org,
	bjorn.andersson@linaro.org, stanimir.varbanov@linaro.org,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	acourbot@google.com
Subject: Re: [PATCH 1/4] soc: qcom: mdt_loader: Add check to make scm calls
Date: Thu, 17 May 2018 09:50:01 -0600	[thread overview]
Message-ID: <20180517155000.GH4995@jcrouse-lnx.qualcomm.com> (raw)
In-Reply-To: <1526556740-25494-2-git-send-email-vgarodia@codeaurora.org>

On Thu, May 17, 2018 at 05:02:17PM +0530, Vikash Garodia wrote:
> 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 <vgarodia@codeaurora.org>
> ---
>  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;
> +			}
>  		}
>  

As far as I can tell you can make it all the way through the function with
'ret' uninitialized if qcom_scm_is_available() returns false which is a bug, but
I'm confused why you would even bother loading the firmware even if you didn't
have SCM.

Jordan

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2018-05-17 15:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 11:32 [PATCH 0/4] Venus updates - PIL Vikash Garodia
2018-05-17 11:32 ` [PATCH 1/4] soc: qcom: mdt_loader: Add check to make scm calls Vikash Garodia
2018-05-17 15:50   ` Jordan Crouse [this message]
2018-05-18  5:28   ` Bjorn Andersson
2018-05-18  7:18     ` Vikash Garodia
2018-05-17 11:32 ` [PATCH 2/4] media: venus: add a routine to reset ARM9 Vikash Garodia
2018-05-17 15:57   ` Jordan Crouse
2018-05-17 11:32 ` [PATCH 3/4] venus: add check to make scm calls Vikash Garodia
2018-05-22 13:04   ` Stanimir Varbanov
2018-05-22 19:50     ` Jordan Crouse
2018-05-22 20:57       ` Stanimir Varbanov
2018-05-23  5:30         ` Vikash Garodia
2018-05-17 11:32 ` [PATCH 4/4] media: venus: add PIL support Vikash Garodia
2018-05-18  0:40   ` Trilok Soni
2018-05-18 12:20     ` Vikash Garodia
2018-05-22 13:02   ` Stanimir Varbanov
2018-05-22 15:52     ` Stanimir Varbanov
2018-06-01  6:53     ` Vikash Garodia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180517155000.GH4995@jcrouse-lnx.qualcomm.com \
    --to=jcrouse@codeaurora.org \
    --cc=acourbot@google.com \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    --cc=vgarodia@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).