kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
	Bjorn Andersson <bjorn.andersson@sonymobile.com>,
	linux-remoteproc@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] remoteproc: qcom: remove some bogus error handling
Date: Tue, 05 Jul 2016 23:43:15 +0000	[thread overview]
Message-ID: <20160705234315.GP1190@tuxbot> (raw)
In-Reply-To: <20160629144055.GB22818@mwanda>

On Wed 29 Jun 07:40 PDT 2016, Dan Carpenter wrote:

> "val" can't be negative because it's unsigned and also readl() doesn't
> return negative error codes.
> 

Thanks for catching this. Unfortunately a successful validation will
result in status becoming 4 and I check if the return value is non-zero
(rather than negative) in q6v5_mpss_load().

However, the next step in the process is to do a timed wait for the
status to turn 4 or negative, so we should treat that snippet (check for
MBA_AUTH_COMPLETE) as part of the validation and move it in here from
q6v5_mpss_load().

Regards,
Bjorn

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
> index fb4c56c..8abc369 100644
> --- a/drivers/remoteproc/qcom_q6v5_pil.c
> +++ b/drivers/remoteproc/qcom_q6v5_pil.c
> @@ -386,7 +386,6 @@ static int q6v5_mpss_validate(struct q6v5 *qproc, const struct firmware *fw)
>  	phys_addr_t fw_addr;
>  	bool relocate;
>  	size_t size;
> -	u32 val;
>  	int ret;
>  	int i;
>  
> @@ -425,8 +424,7 @@ static int q6v5_mpss_validate(struct q6v5 *qproc, const struct firmware *fw)
>  		writel(size, qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
>  	}
>  
> -	val = readl(qproc->rmb_base + RMB_MBA_STATUS_REG);
> -	return val < 0 ? val : 0;
> +	return readl(qproc->rmb_base + RMB_MBA_STATUS_REG);
>  }
>  
>  static int q6v5_mpss_load(struct q6v5 *qproc)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-remoteproc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2016-07-05 23:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-29 14:40 [patch] remoteproc: qcom: remove some bogus error handling Dan Carpenter
2016-07-05 23:43 ` Bjorn Andersson [this message]

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=20160705234315.GP1190@tuxbot \
    --to=bjorn.andersson@linaro.org \
    --cc=bjorn.andersson@sonymobile.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=ohad@wizery.com \
    /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).