devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Govindraj Raja <govindraj.raja@imgtec.com>,
	linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
	devicetree@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Andrew Bresticker <abrestic@chromium.org>,
	James Hartley <James.Hartley@imgtec.com>,
	Damien Horsley <Damien.Horsley@imgtec.com>,
	James Hogan <James.Hogan@imgtec.com>,
	Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
	Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Subject: Re: [PATCH v4 1/7] clocksource: mips-gic: Enable the clock before using it
Date: Tue, 04 Aug 2015 11:23:59 +0200	[thread overview]
Message-ID: <55C084AF.7060606@linaro.org> (raw)
In-Reply-To: <1438005618-27003-2-git-send-email-govindraj.raja@imgtec.com>

On 07/27/2015 04:00 PM, Govindraj Raja wrote:
> From: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
>
> For the clock to be used (e.g. get its rate through clk_get_rate)
> it should be prepared and enabled first.
>
> Also, while the clock is enabled the driver must hold a reference to it,
> so let's remove the call to clk_put.
>
> Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>

> ---
>   drivers/clocksource/mips-gic-timer.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
> index b81ed1a..913585d 100644
> --- a/drivers/clocksource/mips-gic-timer.c
> +++ b/drivers/clocksource/mips-gic-timer.c
> @@ -158,8 +158,13 @@ static void __init gic_clocksource_of_init(struct device_node *node)
>
>   	clk = of_clk_get(node, 0);
>   	if (!IS_ERR(clk)) {
> +		if (clk_prepare_enable(clk) < 0) {
> +			pr_err("GIC failed to enable clock\n");
> +			clk_put(clk);
> +			return;
> +		}
> +
>   		gic_frequency = clk_get_rate(clk);
> -		clk_put(clk);
>   	} else if (of_property_read_u32(node, "clock-frequency",
>   					&gic_frequency)) {
>   		pr_err("GIC frequency not specified.\n");
>


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

  reply	other threads:[~2015-08-04  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 14:00 [PATCH v4 0/7] Clocksource changes for Pistachio CPUFreq Govindraj Raja
2015-07-27 14:00 ` [PATCH v4 1/7] clocksource: mips-gic: Enable the clock before using it Govindraj Raja
2015-08-04  9:23   ` Daniel Lezcano [this message]
     [not found] ` <1438005618-27003-1-git-send-email-govindraj.raja-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-07-27 14:00   ` [PATCH v4 2/7] clocksource: mips-gic: Add missing error returns checks Govindraj Raja
2015-07-27 14:00 ` [PATCH v4 3/7] clocksource: mips-gic: Split clocksource and clockevent initialization Govindraj Raja
2015-07-27 14:00 ` [PATCH v4 4/7] clocksource: mips-gic: Update clockevent frequency on clock rate changes Govindraj Raja
2015-07-28  9:51 ` [PATCH v4 0/7] Clocksource changes for Pistachio CPUFreq Ralf Baechle
2015-08-04  9:48   ` Daniel Lezcano

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=55C084AF.7060606@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=Damien.Horsley@imgtec.com \
    --cc=James.Hartley@imgtec.com \
    --cc=James.Hogan@imgtec.com \
    --cc=abrestic@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ezequiel.garcia@imgtec.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=govindraj.raja@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --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;
as well as URLs for NNTP newsgroup(s).