diff mbox series

[1/3] clocksource: timer-ti-dm: Fix pwm dmtimer usage of fck reparenting

Message ID 20190122175717.13428-2-tony@atomide.com (mailing list archive)
State New, archived
Headers show
Series pwm-omap-dmtimer regression fixes | expand

Commit Message

Tony Lindgren Jan. 22, 2019, 5:57 p.m. UTC
Commit 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe
them with ti-sysc") moved some omap4 timers to probe with ti-sysc
interconnect target module. Turns out this broke pwm-omap-dmtimer
where we now try to reparent the clock to itself with the following:

omap_dm_timer_of_set_source: failed to set parent

With ti-sysc, we can now configure the clock sources in the dts
with assigned-clocks and assigned-clock-parents. So we should be able
to remove omap_dm_timer_of_set_source with clean-up patches later on.
But for now, let's just fix it first by checking if parent and fck
are the same and bail out of so.

Fixes: 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe
them with ti-sysc")
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Keerthy <j-keerthy@ti.com>
Cc: Ladislav Michl <ladis@linux-mips.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/clocksource/timer-ti-dm.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Andreas Kemnade Jan. 26, 2019, 6:40 p.m. UTC | #1
On Tue, 22 Jan 2019 09:57:15 -0800
Tony Lindgren <tony@atomide.com> wrote:

> Commit 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe
> them with ti-sysc") moved some omap4 timers to probe with ti-sysc
> interconnect target module. Turns out this broke pwm-omap-dmtimer
> where we now try to reparent the clock to itself with the following:
> 
> omap_dm_timer_of_set_source: failed to set parent
> 
> With ti-sysc, we can now configure the clock sources in the dts
> with assigned-clocks and assigned-clock-parents. So we should be able
> to remove omap_dm_timer_of_set_source with clean-up patches later on.
> But for now, let's just fix it first by checking if parent and fck
> are the same and bail out of so.
> 
together with 2/3 it fixes things on pyra

Tested-By: Andreas Kemnade <andreas@kemnade.info>
H. Nikolaus Schaller Jan. 26, 2019, 7:30 p.m. UTC | #2
> Am 26.01.2019 um 19:40 schrieb Andreas Kemnade <andreas@kemnade.info>:
> 
> On Tue, 22 Jan 2019 09:57:15 -0800
> Tony Lindgren <tony@atomide.com> wrote:
> 
>> Commit 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe
>> them with ti-sysc") moved some omap4 timers to probe with ti-sysc
>> interconnect target module. Turns out this broke pwm-omap-dmtimer
>> where we now try to reparent the clock to itself with the following:
>> 
>> omap_dm_timer_of_set_source: failed to set parent
>> 
>> With ti-sysc, we can now configure the clock sources in the dts
>> with assigned-clocks and assigned-clock-parents. So we should be able
>> to remove omap_dm_timer_of_set_source with clean-up patches later on.
>> But for now, let's just fix it first by checking if parent and fck
>> are the same and bail out of so.
>> 
> together with 2/3 it fixes things on pyra
> 
> Tested-By: Andreas Kemnade <andreas@kemnade.info>

Tested-By: H. Nikolaus Schaller <hns@goldelico.com>
Daniel Lezcano Feb. 12, 2019, 9:08 a.m. UTC | #3
On 22/01/2019 18:57, Tony Lindgren wrote:
> Commit 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe
> them with ti-sysc") moved some omap4 timers to probe with ti-sysc
> interconnect target module. Turns out this broke pwm-omap-dmtimer
> where we now try to reparent the clock to itself with the following:
> 
> omap_dm_timer_of_set_source: failed to set parent
> 
> With ti-sysc, we can now configure the clock sources in the dts
> with assigned-clocks and assigned-clock-parents. So we should be able
> to remove omap_dm_timer_of_set_source with clean-up patches later on.
> But for now, let's just fix it first by checking if parent and fck
> are the same and bail out of so.
> 
> Fixes: 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe
> them with ti-sysc")
> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: H. Nikolaus Schaller <hns@goldelico.com>
> Cc: Keerthy <j-keerthy@ti.com>
> Cc: Ladislav Michl <ladis@linux-mips.org>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Tero Kristo <t-kristo@ti.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---

Do you want me to take it through my tree (1 et 3)?

>  drivers/clocksource/timer-ti-dm.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
> --- a/drivers/clocksource/timer-ti-dm.c
> +++ b/drivers/clocksource/timer-ti-dm.c
> @@ -154,6 +154,10 @@ static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
>  	if (IS_ERR(parent))
>  		return -ENODEV;
>  
> +	/* Bail out if both clocks point to fck */
> +	if (clk_is_match(parent, timer->fclk))
> +		return 0;
> +
>  	ret = clk_set_parent(timer->fclk, parent);
>  	if (ret < 0)
>  		pr_err("%s: failed to set parent\n", __func__);
>
Tony Lindgren Feb. 12, 2019, 3:29 p.m. UTC | #4
Hi,

* Daniel Lezcano <daniel.lezcano@linaro.org> [190212 09:08]:
> 
> Do you want me to take it through my tree (1 et 3)?

No need to thanks, I already sent a pull request on them
as "[GIT PULL] omap soc regression fixes for v5.0-rc cycle"
with you in Cc.

Regards,

Tony
diff mbox series

Patch

diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -154,6 +154,10 @@  static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
 	if (IS_ERR(parent))
 		return -ENODEV;
 
+	/* Bail out if both clocks point to fck */
+	if (clk_is_match(parent, timer->fclk))
+		return 0;
+
 	ret = clk_set_parent(timer->fclk, parent);
 	if (ret < 0)
 		pr_err("%s: failed to set parent\n", __func__);