Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1193150 > unrolled thread
| Started by | Govindraj Raja <govindraj.raja@imgtec.com> |
|---|---|
| First post | 2015-07-27 16:10 +0200 |
| Last post | 2015-08-04 11:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v4 1/7] clocksource: mips-gic: Enable the clock before using it Govindraj Raja <govindraj.raja@imgtec.com> - 2015-07-27 16:10 +0200
Re: [PATCH v4 1/7] clocksource: mips-gic: Enable the clock before using it Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-04 11:30 +0200
| From | Govindraj Raja <govindraj.raja@imgtec.com> |
|---|---|
| Date | 2015-07-27 16:10 +0200 |
| Subject | [PATCH v4 1/7] clocksource: mips-gic: Enable the clock before using it |
| Message-ID | <pQRgo-46U-53@gated-at.bofh.it> |
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>
---
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");
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-08-04 11:30 +0200 |
| Subject | Re: [PATCH v4 1/7] clocksource: mips-gic: Enable the clock before using it |
| Message-ID | <pTGHM-6oa-15@gated-at.bofh.it> |
| In reply to | #1193150 |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web