Re: [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Stephen Boyd <sboyd@xxxxxxxxxxxxxx> [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@xxxxxxxxxxxxxx>

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@xxxxxxxxxxx>
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@xxxxxxxxxxxxxx>.

Cc: Michael Turquette <mturquette@xxxxxxxxxx>
Cc: Paul Walmsley <paul@xxxxxxxxx>
Cc: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>
Cc: Tero Kristo <t-kristo@xxxxxx>
Cc: Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx>
Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>

--- 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);
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux