From: "Dwivedi, Avaneesh Kumar (avani)" <akdwived@codeaurora.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: sboyd@codeaurora.org, agross@codeaurora.org,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-remoteproc@vger.kernel.org
Subject: Re: [RESEND: PATCH v4 2/4] remoteproc: qcom: refactor mss fw image loading sequence
Date: Fri, 26 May 2017 18:32:54 +0530 [thread overview]
Message-ID: <596f9e9d-a7ce-ff9c-027c-d4189648bfa6@codeaurora.org> (raw)
In-Reply-To: <20170525191323.GE12920@tuxbook>
On 5/26/2017 12:43 AM, Bjorn Andersson wrote:
> On Tue 16 May 11:02 PDT 2017, Avaneesh Kumar Dwivedi wrote:
>
>> This patch refactor code to first load all firmware blobs
>> and then update modem proc to authenticate and boot fw.
> Nice, I like this! Just some style details below.
Thanks. Sure will correct.
>
>> Also make a trivial change in a error log.
>>
>> Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
>> ---
>> drivers/remoteproc/qcom_q6v5_pil.c | 25 ++++++++++++-------------
>> 1 file changed, 12 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
>> index 8fd697a..2626954 100644
>> --- a/drivers/remoteproc/qcom_q6v5_pil.c
>> +++ b/drivers/remoteproc/qcom_q6v5_pil.c
>> @@ -466,9 +466,10 @@ static int q6v5_mpss_init_image(struct q6v5 *qproc, const struct firmware *fw)
>>
>> ret = q6v5_rmb_mba_wait(qproc, RMB_MBA_META_DATA_AUTH_SUCCESS, 1000);
>> if (ret == -ETIMEDOUT)
>> - dev_err(qproc->dev, "MPSS header authentication timed out\n");
>> + dev_err(qproc->dev, "metadata authentication timed out\n");
>> else if (ret < 0)
>> - dev_err(qproc->dev, "MPSS header authentication failed: %d\n", ret);
>> + dev_err(qproc->dev,
>> + "metadata authentication failed: %d\n", ret);
> I'm happy to accept these changes if they better describe the errors,
> but please send them in a separate patch in that case - and please don't
> line break that second print.
OK. Will reconsider.
>
>>
>> dma_free_attrs(qproc->dev, fw->size, ptr, phys, dma_attrs);
>>
>> @@ -503,7 +504,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>> bool relocate = false;
>> char seg_name[10];
>> ssize_t offset;
>> - size_t size;
>> + size_t size = 0;
>> void *ptr;
>> int ret;
>> int i;
>> @@ -541,7 +542,9 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>> }
>>
>> mpss_reloc = relocate ? min_addr : qproc->mpss_phys;
>> -
>> + /* Load firmware completely before letting mss to start
>> + * authentication and then boot firmware
>> + */
> /*
> * The first line of a multi-line comment should be empty.
> */
>
> Also your comment tend to tell the story of your change, that's what the
> commit message is for, the comment should describe the code regardless
> of history;
>
> I think it makes sense to have a comment in the lines of:
>
> /* Load the firmware segments */
OK.
>
>> for (i = 0; i < ehdr->e_phnum; i++) {
>> phdr = &phdrs[i];
>>
>> @@ -574,17 +577,13 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>> memset(ptr + phdr->p_filesz, 0,
>> phdr->p_memsz - phdr->p_filesz);
>> }
>> -
>> - size = readl(qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
>> - if (!size) {
>> - boot_addr = relocate ? qproc->mpss_phys : min_addr;
>> - writel(boot_addr, qproc->rmb_base + RMB_PMI_CODE_START_REG);
>> - writel(RMB_CMD_LOAD_READY, qproc->rmb_base + RMB_MBA_COMMAND_REG);
>> - }
>> -
>> size += phdr->p_memsz;
>> - writel(size, qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
>> }
> Please put a blank line here, to separate the steps like "paragraphs".
OK
>
>> + /* Transfer ownership of modem region with modem fw */
>> + boot_addr = relocate ? qproc->mpss_phys : min_addr;
>> + writel(boot_addr, qproc->rmb_base + RMB_PMI_CODE_START_REG);
>> + writel(RMB_CMD_LOAD_READY, qproc->rmb_base + RMB_MBA_COMMAND_REG);
>> + writel(size, qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
> I originally did something similar, but ran into some issue - so I will
> test this on 8974 and 8916 as soon as my devboards are back online.
OK
>
> Regards,
> Bjorn
--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
next prev parent reply other threads:[~2017-05-26 13:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-16 18:01 [RESEND: PATCH v4 0/4] Add memory ownership switch support and enable mss rproc on msm8996 Avaneesh Kumar Dwivedi
2017-05-16 18:01 ` [RESEND: PATCH v4 1/4] firmware: scm: Add new SCM call for switching memory ownership Avaneesh Kumar Dwivedi
2017-05-26 6:03 ` Bjorn Andersson
2017-05-26 13:01 ` Dwivedi, Avaneesh Kumar (avani)
2017-05-26 19:19 ` Bjorn Andersson
2017-05-16 18:02 ` [RESEND: PATCH v4 2/4] remoteproc: qcom: refactor mss fw image loading sequence Avaneesh Kumar Dwivedi
2017-05-20 2:55 ` Sricharan R
2017-05-22 9:33 ` Dwivedi, Avaneesh Kumar (avani)
2017-05-22 10:37 ` Sricharan R
2017-05-22 13:26 ` Dwivedi, Avaneesh Kumar (avani)
2017-05-25 19:03 ` Bjorn Andersson
2017-05-26 5:00 ` Sricharan R
2017-05-25 19:13 ` Bjorn Andersson
2017-05-26 13:02 ` Dwivedi, Avaneesh Kumar (avani) [this message]
2017-05-16 18:02 ` [RESEND: PATCH v4 3/4] remoteproc: qcom: Make secure world call for mem ownership switch Avaneesh Kumar Dwivedi
2017-05-26 2:16 ` Bjorn Andersson
2017-05-26 13:19 ` Dwivedi, Avaneesh Kumar (avani)
2017-05-26 19:17 ` Bjorn Andersson
2017-05-16 18:02 ` [RESEND: PATCH v4 4/4] remoteproc: qcom: Add support for mss boot on msm8996 Avaneesh Kumar Dwivedi
2017-05-26 6:09 ` Bjorn Andersson
2017-05-26 13:20 ` Dwivedi, Avaneesh Kumar (avani)
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=596f9e9d-a7ce-ff9c-027c-d4189648bfa6@codeaurora.org \
--to=akdwived@codeaurora.org \
--cc=agross@codeaurora.org \
--cc=bjorn.andersson@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=sboyd@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).