From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Sricharan R <sricharan@codeaurora.org>
Cc: ohad@wizery.com, robh+dt@kernel.org, mark.rutland@arm.com,
andy.gross@linaro.org, david.brown@linaro.org,
linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-soc@vger.kernel.org
Subject: Re: [PATCH 1/3] drivers: remoteproc: Make mdt_loader firmware authentication optional
Date: Wed, 26 Jul 2017 11:11:08 -0700 [thread overview]
Message-ID: <20170726181108.GP20973@minitux> (raw)
In-Reply-To: <1498745861-20531-2-git-send-email-sricharan@codeaurora.org>
On Thu 29 Jun 07:17 PDT 2017, Sricharan R wrote:
> qcom_mdt_load function loads the mdt type firmware and
> authenticates it as well. Make the authentication only
> when requested by the caller, so that the function can be used
> by self-authenticating remoteproc as well.
>
This is good, we should be able to save some duplication the current
MSA PIL as well by this.
> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
> ---
> drivers/remoteproc/qcom_adsp_pil.c | 3 ++-
> drivers/remoteproc/qcom_wcnss.c | 3 ++-
> drivers/soc/qcom/mdt_loader.c | 24 ++++++++++++++----------
> include/linux/soc/qcom/mdt_loader.h | 2 +-
We have two additional callers being merged, so changing the prototype
of qcom_mdt_load() will cause issues.
I think the best approach is to leave all callers untouched, make the
current implementation of qcom_mdt_load() internal and provide two
exported wrapper functions: qcom_mdt_load() and qcom_mdt_load_no_init().
These wrappers would call the internal function with the appropriate
value of the boolean.
[..]
> diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c
[..]
> int qcom_mdt_load(struct device *dev, const struct firmware *fw,
> const char *firmware, int pas_id, void *mem_region,
> - phys_addr_t mem_phys, size_t mem_size)
> + phys_addr_t mem_phys, size_t mem_size, bool auth)
We're not authenticating even with @auth=true, so please name this
"pas_init".
> {
> const struct elf32_phdr *phdrs;
> const struct elf32_phdr *phdr;
[..]
> @@ -142,12 +144,14 @@ 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 (auth) {
> + 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;
> + }
> }
> -
I like this empty line, please let me have it.
> /*
> * The image is relocatable, so offset each segment based on
> * the lowest segment address.
Regards,
Bjorn
next prev parent reply other threads:[~2017-07-26 18:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-29 14:17 [PATCH 0/3] Add remoteproc driver for Hexagon Q6 - WCSS integrated core Sricharan R
2017-06-29 14:17 ` [PATCH 1/3] drivers: remoteproc: Make mdt_loader firmware authentication optional Sricharan R
2017-07-26 18:11 ` Bjorn Andersson [this message]
2017-07-28 16:15 ` Sricharan R
2017-06-29 14:17 ` [PATCH 2/3] drivers: remoteproc: Add Hexagon Q6 - WCSS integrated core driver Sricharan R
2017-07-02 10:30 ` kbuild test robot
2017-07-26 19:08 ` Bjorn Andersson
2017-07-31 10:51 ` Sricharan R
2017-06-29 14:17 ` [PATCH 3/3] dt-binding: remoteproc: Add the bindings required for Q6 - WCSS core Sricharan R
2017-07-07 13:47 ` Rob Herring
2017-07-07 18:10 ` Sricharan R
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=20170726181108.GP20973@minitux \
--to=bjorn.andersson@linaro.org \
--cc=andy.gross@linaro.org \
--cc=david.brown@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=ohad@wizery.com \
--cc=robh+dt@kernel.org \
--cc=sricharan@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).