Thread (11 messages) 11 messages, 4 authors, 2017-07-31

Re: [PATCH 1/3] drivers: remoteproc: Make mdt_loader firmware authentication optional

From: Sricharan R <hidden>
Date: 2017-07-28 16:15:29
Also in: linux-arm-msm, linux-remoteproc, lkml

Hi Bjorn,
   Thanks for the review !

On 7/26/2017 11:41 PM, Bjorn Andersson wrote:
On Thu 29 Jun 07:17 PDT 2017, Sricharan R wrote:
quoted
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.
quoted
Signed-off-by: Sricharan R <redacted>
---
 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.
 ok, will do.
[..]
quoted
diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c
[..]
quoted
 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".
 ok will rename.
 
quoted
 {
 	const struct elf32_phdr *phdrs;
 	const struct elf32_phdr *phdr;
[..]
quoted
@@ -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.
 ok.

Regards,
 Sricharan

-- 
"QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help