linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Daniel Mack <daniel@zonque.org>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Mark Brown <broonie@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] spi: pxa2xx: Handle return value of clk_prepare_enable
Date: Tue, 6 Jun 2017 17:03:29 +0530	[thread overview]
Message-ID: <e4762e92-2142-56a5-c037-e88e4b5dece6@gmail.com> (raw)
In-Reply-To: <CAHp75Vf+cm_-V4jcqJqcmMRdGA9j19RQYfyjJ8YRz3w1A+gRYQ@mail.gmail.com>



On Tuesday 06 June 2017 04:24 PM, Andy Shevchenko wrote:
> On Tue, Jun 6, 2017 at 12:44 PM, Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:
>> clk_prepare_enable() can fail here and we must check its return value.
>> @@ -1676,7 +1676,11 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
>> -       clk_prepare_enable(ssp->clk);
>> +       status = clk_prepare_enable(ssp->clk);
> This one looks fine.
>
>> @@ -1855,8 +1859,13 @@ static int pxa2xx_spi_resume(struct device *dev)
>>          /* Enable the SSP clock */
>> -       if (!pm_runtime_suspended(dev))
>> -               clk_prepare_enable(ssp->clk);
>> +       if (!pm_runtime_suspended(dev)) {
>> +               status = clk_prepare_enable(ssp->clk);
>> +               if (status) {
>> +                       dev_err(dev, "Failed to prepare clock\n");
>> +                       return status;
>> +               }
> This...
>
>> @@ -1886,8 +1895,7 @@ static int pxa2xx_spi_runtime_resume(struct device *dev)
>>   {
>>          struct driver_data *drv_data = dev_get_drvdata(dev);
>>
>> -       clk_prepare_enable(drv_data->ssp->clk);
>> -       return 0;
>> +       return clk_prepare_enable(drv_data->ssp->clk);
> ...and especially this should be carefully checked since there are
> differences in behaviour how system or driver will be resumed.
yes true, here clk_prepare_enable will return 0 on successful attempt.
what do you suggest here, we should not return like this.?
>
> So, the question is how did you test it?
It can fail, I am not able to produce clock failure issue. If you have 
any suggestion.
please let me know.
>
-arvind

      reply	other threads:[~2017-06-06 11:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06  9:44 [PATCH] spi: pxa2xx: Handle return value of clk_prepare_enable Arvind Yadav
     [not found] ` <4e16c0aba047b068aaa41c1d180d98ccb441afd0.1496668108.git.arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-06 10:54   ` Andy Shevchenko
2017-06-06 11:33     ` Arvind Yadav [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=e4762e92-2142-56a5-c037-e88e4b5dece6@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=daniel@zonque.org \
    --cc=geert@linux-m68k.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=robert.jarzmik@free.fr \
    /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).