mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Jonathan Neusch?fer <j.neuschaefer@gmx.net>
Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	Andy Gross <andy.gross@linaro.org>,
	David Brown <david.brown@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] soc: qcom: smsm: Improve error handling, quiesce probe deferral
Date: Wed, 5 Apr 2017 10:01:23 -0700	[thread overview]
Message-ID: <20170405170123.GK70446@Bjorns-MacBook-Pro-2.local> (raw)
In-Reply-To: <20170405121048.31800-1-j.neuschaefer@gmx.net>

On Wed 05 Apr 05:10 PDT 2017, Jonathan Neusch?fer wrote:

> Don't use size if info indicates an error condition. Previously a
> non-ENOENT error (such as -EPROBE_DEFER) would lead to size being used
> even though it hadn't necessarily been initialized in qcom_smem_get.
> 
> Don't print an error message in the -EPROBE_DEFER case.
> 
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> 
> ---
> v2:
> - Rewrite based on Bjorn's suggestion.
> - Don't check for -EPROBE_DEFER again after qcom_smem_alloc was called
>   in qcom_smsm_probe. This point is only reached if smsm_get_size_info
>   returned success, which can only happen if probe deferral is over.
> v1:
> - was "[PATCH 1/2] soc: qcom: smsm: Handle probe deferral"
> ---
>  drivers/soc/qcom/smsm.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c
> index d0337b2a71c8..dc540ea92e9d 100644
> --- a/drivers/soc/qcom/smsm.c
> +++ b/drivers/soc/qcom/smsm.c
> @@ -439,14 +439,15 @@ static int smsm_get_size_info(struct qcom_smsm *smsm)
>  	} *info;
>  
>  	info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_SMSM_SIZE_INFO, &size);
> -	if (PTR_ERR(info) == -ENOENT || size != sizeof(*info)) {
> +	if (IS_ERR(info) && PTR_ERR(info) != -ENOENT) {
> +		if (PTR_ERR(info) != -EPROBE_DEFER)
> +			dev_err(smsm->dev, "unable to retrieve smsm size info\n");
> +		return PTR_ERR(info);
> +	} else if (IS_ERR(info) || size != sizeof(*info)) {
>  		dev_warn(smsm->dev, "no smsm size info, using defaults\n");
>  		smsm->num_entries = SMSM_DEFAULT_NUM_ENTRIES;
>  		smsm->num_hosts = SMSM_DEFAULT_NUM_HOSTS;
>  		return 0;
> -	} else if (IS_ERR(info)) {
> -		dev_err(smsm->dev, "unable to retrieve smsm size info\n");
> -		return PTR_ERR(info);
>  	}
>  
>  	smsm->num_entries = info->num_entries;
> -- 
> 2.11.0
> 

  reply	other threads:[~2017-04-05 17:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 11:43 [PATCH 1/2] soc: qcom: smsm: Handle " Jonathan Neuschäfer
2017-03-15 11:43 ` [PATCH 2/2] soc: qcom: smsm: Avoid the use of an uninitialized value Jonathan Neuschäfer
2017-03-17 14:01 ` [PATCH 1/2] soc: qcom: smsm: Handle probe deferral Jonathan Neuschäfer
2017-03-28  6:18 ` Bjorn Andersson
2017-04-04  2:38   ` Jonathan Neuschäfer
2017-04-05  3:47     ` Bjorn Andersson
2017-04-05 12:10     ` [PATCH v2] soc: qcom: smsm: Improve error handling, quiesce " Jonathan Neuschäfer
2017-04-05 17:01       ` Bjorn Andersson [this message]
2017-05-31 14:00         ` Jonathan Neuschäfer
2017-06-01  6:34           ` Andy Gross

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=20170405170123.GK70446@Bjorns-MacBook-Pro-2.local \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=j.neuschaefer@gmx.net \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.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

all inboxes | Powered by JetHome®