From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
Romain Perier <romain.perier@free-electrons.com>,
Jason Cooper <jason@lakedaemon.net>,
Boris BREZILLON <boris.brezillon@free-electrons.com>,
Stefan Roese <stefan.roese@gmail.com>,
Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
Sebastian Careba <nitroshift@yahoo.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
linux-arm-kernel@lists.infradead.org,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Subject: Re: [PATCH] clocksource/drivers/time-armada-370-xp: Fix the clock reference
Date: Wed, 10 Aug 2016 14:06:52 +0200 [thread overview]
Message-ID: <20160810140652.2d59e12b@free-electrons.com> (raw)
In-Reply-To: <1470816548-8750-1-git-send-email-gregory.clement@free-electrons.com>
Hello,
On Wed, 10 Aug 2016 10:09:08 +0200, Gregory CLEMENT wrote:
> While converting the init function to return an error, the wrong clock
> was get. This lead to wrong clock rate and slow down the kernel. For
> example, before the patch a typical boot was around 15s after it was 1
> minute slower.
>
> Fixes: 12549e27c63c ("clocksource/drivers/time-armada-370-xp: Convert init function to return error")
>
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
> drivers/clocksource/time-armada-370-xp.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/clocksource/time-armada-370-xp.c b/drivers/clocksource/time-armada-370-xp.c
> index 719b478d136e..3c39e6f45971 100644
> --- a/drivers/clocksource/time-armada-370-xp.c
> +++ b/drivers/clocksource/time-armada-370-xp.c
> @@ -338,7 +338,6 @@ static int __init armada_xp_timer_init(struct device_node *np)
> struct clk *clk = of_clk_get_by_name(np, "fixed");
> int ret;
>
> - clk = of_clk_get(np, 0);
I think to avoid this mistake, we should rewrite the code as:
struct *clk;
int ret;
clk = of_clk_get_by_name(np, "fixed");
if (IS_ERR(clk)) {
...
Indeed, I find confusing a block that starts with error checking, and
it's probably what lead to this of_clk_get() being added here.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-08-10 18:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-10 8:09 Gregory CLEMENT
2016-08-10 12:06 ` Thomas Petazzoni [this message]
2016-08-10 13:05 ` Gregory CLEMENT
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=20160810140652.2d59e12b@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=andrew@lunn.ch \
--cc=boris.brezillon@free-electrons.com \
--cc=daniel.lezcano@linaro.org \
--cc=ezequiel.garcia@free-electrons.com \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=nitroshift@yahoo.com \
--cc=romain.perier@free-electrons.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=stefan.roese@gmail.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome