From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Ben Dooks <ben.dooks@codethink.co.uk>
Cc: linux-kernel@lists.codethink.co.uk, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-pm@vger.kernel.org, linux-sh@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] power: clock_ops.c: check return of clk_enable() in pm_clk_resume()
Date: Mon, 13 Jan 2014 20:55:58 +0100 [thread overview]
Message-ID: <1438385.ppqm7XWTt3@vostro.rjw.lan> (raw)
In-Reply-To: <1389445540-21426-2-git-send-email-ben.dooks@codethink.co.uk>
On Saturday, January 11, 2014 01:05:39 PM Ben Dooks wrote:
> The clk_enable() call in the pm_clk_resume() call returns an error
> that is not being checked. If clk_enable() fails then we should
> not set the state of the clock to PCE_STATUS_ENABLED.
>
> Note, the issue of warning the user if this fails has not been
> addressed in this patch as this is not the only place the driver
> calls clk_enable().
>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> Reviewed-by: Ian Molton <ian.molton@codethink.co.uk>
> ---
> drivers/base/power/clock_ops.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
> index b9dd8fa..9bb95ab 100644
> --- a/drivers/base/power/clock_ops.c
> +++ b/drivers/base/power/clock_ops.c
> @@ -252,6 +252,7 @@ int pm_clk_resume(struct device *dev)
> struct pm_subsys_data *psd = dev_to_psd(dev);
> struct pm_clock_entry *ce;
> unsigned long flags;
> + int ret;
>
> dev_dbg(dev, "%s()\n", __func__);
>
> @@ -262,8 +263,9 @@ int pm_clk_resume(struct device *dev)
>
> list_for_each_entry(ce, &psd->clock_list, node) {
> if (ce->status < PCE_STATUS_ERROR) {
> - clk_enable(ce->clk);
> - ce->status = PCE_STATUS_ENABLED;
> + ret = clk_enable(ce->clk);
> + if (ret == 0)
Can you please use if (!ret) here?
And analogously in patch [3/3]?
> + ce->status = PCE_STATUS_ENABLED;
> }
> }
>
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2014-01-13 19:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-11 13:05 [PATCH 1/3] power: clock_ops.c: fixup clk prepare/unprepare count Ben Dooks
2014-01-11 13:05 ` [PATCH 2/3] power: clock_ops.c: check return of clk_enable() in pm_clk_resume() Ben Dooks
2014-01-13 19:55 ` Rafael J. Wysocki [this message]
2014-01-14 12:02 ` Ben Dooks
2014-01-11 13:05 ` [PATCH 3/3] power: clock_ops.c: report clock errors from clk_enable() Ben Dooks
2014-01-12 22:04 ` [PATCH 1/3] power: clock_ops.c: fixup clk prepare/unprepare count Laurent Pinchart
2014-01-13 6:28 ` Ben Dooks
2014-01-13 8:50 ` Geert Uytterhoeven
2014-01-13 9:21 ` Ben Dooks
2014-01-14 12:23 [RESEND] v2: clock_ops.c fixes Ben Dooks
2014-01-14 12:23 ` [PATCH 2/3] power: clock_ops.c: check return of clk_enable() in pm_clk_resume() Ben Dooks
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=1438385.ppqm7XWTt3@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=ben.dooks@codethink.co.uk \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@lists.codethink.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=pavel@ucw.cz \
/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®