* [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock
@ 2015-05-05 18:02 Tony Lindgren
2015-05-06 5:35 ` Stephen Boyd
0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2015-05-05 18:02 UTC (permalink / raw)
To: linux-arm-kernel
With recent changes to use determine_rate, the comparison of two
clocks won't work without doing __clk_get_hw on the clocks
first.
Cc: Michael Turquette <mturquette@linaro.org>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
Found one more of these, the coccinelle scripts do not seem
to match this?
---
arch/arm/mach-omap2/timer.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index cef67af..22c7a8e 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -35,6 +35,7 @@
#include <linux/irq.h>
#include <linux/clocksource.h>
#include <linux/clockchips.h>
+#include <linux/clk-provider.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_address.h>
@@ -298,7 +299,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
if (IS_ERR(src))
return PTR_ERR(src);
- if (clk_get_parent(timer->fclk) != src) {
+ if (__clk_get_hw(clk_get_parent(timer->fclk)) != __clk_get_hw(src)) {
r = clk_set_parent(timer->fclk, src);
if (r < 0) {
pr_warn("%s: %s cannot set source\n", __func__,
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock
2015-05-05 18:02 [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock Tony Lindgren
@ 2015-05-06 5:35 ` Stephen Boyd
2015-05-06 14:55 ` Tony Lindgren
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Boyd @ 2015-05-06 5:35 UTC (permalink / raw)
To: linux-arm-kernel
On 05/05, Tony Lindgren wrote:
> With recent changes to use determine_rate, the comparison of two
> clocks won't work without doing __clk_get_hw on the clocks
> first.
>
> Cc: Michael Turquette <mturquette@linaro.org>
> Cc: Paul Walmsley <paul@pwsan.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Tero Kristo <t-kristo@ti.com>
> Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>
> Found one more of these, the coccinelle scripts do not seem
> to match this?
I don't think the coccinelle script was ever merged...
>
> ---
> arch/arm/mach-omap2/timer.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
> index cef67af..22c7a8e 100644
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -35,6 +35,7 @@
> #include <linux/irq.h>
> #include <linux/clocksource.h>
> #include <linux/clockchips.h>
> +#include <linux/clk-provider.h>
> #include <linux/slab.h>
> #include <linux/of.h>
> #include <linux/of_address.h>
> @@ -298,7 +299,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
> if (IS_ERR(src))
> return PTR_ERR(src);
>
> - if (clk_get_parent(timer->fclk) != src) {
> + if (__clk_get_hw(clk_get_parent(timer->fclk)) != __clk_get_hw(src)) {
Please use clk_is_match() instead so we can find these instances
with an easy grep.
> r = clk_set_parent(timer->fclk, src);
> if (r < 0) {
> pr_warn("%s: %s cannot set source\n", __func__,
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock
2015-05-06 5:35 ` Stephen Boyd
@ 2015-05-06 14:55 ` Tony Lindgren
2015-05-07 0:29 ` Stephen Boyd
0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2015-05-06 14:55 UTC (permalink / raw)
To: linux-arm-kernel
* Stephen Boyd <sboyd@codeaurora.org> [150505 22:36]:
> On 05/05, Tony Lindgren wrote:
> > With recent changes to use determine_rate, the comparison of two
> > clocks won't work without doing __clk_get_hw on the clocks
> > first.
> >
> > Cc: Michael Turquette <mturquette@linaro.org>
> > Cc: Paul Walmsley <paul@pwsan.com>
> > Cc: Stephen Boyd <sboyd@codeaurora.org>
> > Cc: Tero Kristo <t-kristo@ti.com>
> > Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> >
> > Found one more of these, the coccinelle scripts do not seem
> > to match this?
>
> I don't think the coccinelle script was ever merged...
Oh OK, but the wrong comparisons in the kernel code got
fixed, right?
> > @@ -298,7 +299,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
> > if (IS_ERR(src))
> > return PTR_ERR(src);
> >
> > - if (clk_get_parent(timer->fclk) != src) {
> > + if (__clk_get_hw(clk_get_parent(timer->fclk)) != __clk_get_hw(src)) {
>
> Please use clk_is_match() instead so we can find these instances
> with an easy grep.
Thanks here's an updated version with that.
Regards,
Tony
8< -----------------------------
From: Tony Lindgren <tony@atomide.com>
Date: Tue, 5 May 2015 09:03:34 -0700
Subject: [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock
With recent changes to use determine_rate, the comparison of two
clocks won't work without clk_is_match that does __clk_get_hw
on the clocks first.
Cc: Michael Turquette <mturquette@linaro.org>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -298,7 +298,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
if (IS_ERR(src))
return PTR_ERR(src);
- if (clk_get_parent(timer->fclk) != src) {
+ if (!clk_is_match(clk_get_parent(timer->fclk), src)) {
r = clk_set_parent(timer->fclk, src);
if (r < 0) {
pr_warn("%s: %s cannot set source\n", __func__,
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock
2015-05-06 14:55 ` Tony Lindgren
@ 2015-05-07 0:29 ` Stephen Boyd
2015-05-07 14:44 ` Tony Lindgren
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Boyd @ 2015-05-07 0:29 UTC (permalink / raw)
To: linux-arm-kernel
On 05/06/15 07:55, Tony Lindgren wrote:
> * Stephen Boyd <sboyd@codeaurora.org> [150505 22:36]:
>> On 05/05, Tony Lindgren wrote:
>>> With recent changes to use determine_rate, the comparison of two
>>> clocks won't work without doing __clk_get_hw on the clocks
>>> first.
>>>
>>> Cc: Michael Turquette <mturquette@linaro.org>
>>> Cc: Paul Walmsley <paul@pwsan.com>
>>> Cc: Stephen Boyd <sboyd@codeaurora.org>
>>> Cc: Tero Kristo <t-kristo@ti.com>
>>> Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>>> ---
>>>
>>> Found one more of these, the coccinelle scripts do not seem
>>> to match this?
>> I don't think the coccinelle script was ever merged...
> Oh OK, but the wrong comparisons in the kernel code got
> fixed, right?
Yes the ones that mattered were fixed.
>>> @@ -298,7 +299,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
>>> if (IS_ERR(src))
>>> return PTR_ERR(src);
>>>
>>> - if (clk_get_parent(timer->fclk) != src) {
>>> + if (__clk_get_hw(clk_get_parent(timer->fclk)) != __clk_get_hw(src)) {
>> Please use clk_is_match() instead so we can find these instances
>> with an easy grep.
> Thanks here's an updated version with that.
Are you taking this through arm-soc?
> Regards,
>
> Tony
>
> 8< -----------------------------
> From: Tony Lindgren <tony@atomide.com>
> Date: Tue, 5 May 2015 09:03:34 -0700
> Subject: [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock
>
> With recent changes to use determine_rate, the comparison of two
> clocks won't work without clk_is_match that does __clk_get_hw
> on the clocks first.
>
> Cc: Michael Turquette <mturquette@linaro.org>
> Cc: Paul Walmsley <paul@pwsan.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Tero Kristo <t-kristo@ti.com>
> Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
>
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -298,7 +298,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
> if (IS_ERR(src))
> return PTR_ERR(src);
>
> - if (clk_get_parent(timer->fclk) != src) {
> + if (!clk_is_match(clk_get_parent(timer->fclk), src)) {
> r = clk_set_parent(timer->fclk, src);
I also wonder why we can't just call clk_set_parent() and skip the "is
the parent already src" check?
If there's a good reason for not just calling clk_set_parent() then it
makes sense to do the clk_is_match() thing, and you can have my ack
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock
2015-05-07 0:29 ` Stephen Boyd
@ 2015-05-07 14:44 ` Tony Lindgren
2015-05-07 19:01 ` Stephen Boyd
0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2015-05-07 14:44 UTC (permalink / raw)
To: linux-arm-kernel
* Stephen Boyd <sboyd@codeaurora.org> [150506 17:30]:
> On 05/06/15 07:55, Tony Lindgren wrote:
> >> I don't think the coccinelle script was ever merged...
>
> > Oh OK, but the wrong comparisons in the kernel code got
> > fixed, right?
>
> Yes the ones that mattered were fixed.
OK thanks for confirming that.
> > Thanks here's an updated version with that.
>
> Are you taking this through arm-soc?
Yes that's the plan.
> > --- a/arch/arm/mach-omap2/timer.c
> > +++ b/arch/arm/mach-omap2/timer.c
> > @@ -298,7 +298,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
> > if (IS_ERR(src))
> > return PTR_ERR(src);
> >
> > - if (clk_get_parent(timer->fclk) != src) {
> > + if (!clk_is_match(clk_get_parent(timer->fclk), src)) {
> > r = clk_set_parent(timer->fclk, src);
>
> I also wonder why we can't just call clk_set_parent() and skip the "is
> the parent already src" check?
>
> If there's a good reason for not just calling clk_set_parent() then it
> makes sense to do the clk_is_match() thing, and you can have my ack
>
> Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Good point. We've been unconditionally calling it anyways and
nobody has complained of any issues. So let's just remove the
check.
Regards,
Tony
8< ----------------------
From: Tony Lindgren <tony@atomide.com>
Date: Tue, 5 May 2015 09:03:34 -0700
Subject: [PATCH] ARM: OMAP2+: Remove bogus struct clk comparison for timer
clock
With recent changes to use determine_rate, the comparison of two
clocks won't work without clk_is_match that does __clk_get_hw
on the clocks first.
As we've been unconditionally already calling clk_set_parent
already because of the bogus comparison, let's just remove the
check as suggested by Stephen Boyd <sboyd@codeaurora.org>.
Cc: Michael Turquette <mturquette@linaro.org>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -298,14 +298,11 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
if (IS_ERR(src))
return PTR_ERR(src);
- if (clk_get_parent(timer->fclk) != src) {
- r = clk_set_parent(timer->fclk, src);
- if (r < 0) {
- pr_warn("%s: %s cannot set source\n", __func__,
- oh->name);
- clk_put(src);
- return r;
- }
+ r = clk_set_parent(timer->fclk, src);
+ if (r < 0) {
+ pr_warn("%s: %s cannot set source\n", __func__, oh->name);
+ clk_put(src);
+ return r;
}
clk_put(src);
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock
2015-05-07 14:44 ` Tony Lindgren
@ 2015-05-07 19:01 ` Stephen Boyd
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2015-05-07 19:01 UTC (permalink / raw)
To: linux-arm-kernel
On 05/07/15 07:44, Tony Lindgren wrote:
> * Stephen Boyd <sboyd@codeaurora.org> [150506 17:30]:
>> On 05/06/15 07:55, Tony Lindgren wrote:
>>
>>> --- a/arch/arm/mach-omap2/timer.c
>>> +++ b/arch/arm/mach-omap2/timer.c
>>> @@ -298,7 +298,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
>>> if (IS_ERR(src))
>>> return PTR_ERR(src);
>>>
>>> - if (clk_get_parent(timer->fclk) != src) {
>>> + if (!clk_is_match(clk_get_parent(timer->fclk), src)) {
>>> r = clk_set_parent(timer->fclk, src);
>> I also wonder why we can't just call clk_set_parent() and skip the "is
>> the parent already src" check?
>>
>> If there's a good reason for not just calling clk_set_parent() then it
>> makes sense to do the clk_is_match() thing, and you can have my ack
>>
>> Acked-by: Stephen Boyd <sboyd@codeaurora.org>
> Good point. We've been unconditionally calling it anyways and
> nobody has complained of any issues. So let's just remove the
> check.
>
> Regards,
>
> Tony
>
> 8< ----------------------
> From: Tony Lindgren <tony@atomide.com>
> Date: Tue, 5 May 2015 09:03:34 -0700
> Subject: [PATCH] ARM: OMAP2+: Remove bogus struct clk comparison for timer
> clock
>
> With recent changes to use determine_rate, the comparison of two
> clocks won't work without clk_is_match that does __clk_get_hw
> on the clocks first.
>
> As we've been unconditionally already calling clk_set_parent
> already because of the bogus comparison, let's just remove the
> check as suggested by Stephen Boyd <sboyd@codeaurora.org>.
>
> Cc: Michael Turquette <mturquette@linaro.org>
> Cc: Paul Walmsley <paul@pwsan.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Tero Kristo <t-kristo@ti.com>
> Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-07 19:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-05 18:02 [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock Tony Lindgren
2015-05-06 5:35 ` Stephen Boyd
2015-05-06 14:55 ` Tony Lindgren
2015-05-07 0:29 ` Stephen Boyd
2015-05-07 14:44 ` Tony Lindgren
2015-05-07 19:01 ` Stephen Boyd
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).