]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/clocksource-timer-ti-dm-fix-pwm-dmtimer-usage-of-fck.patch
Linux 4.14.108
[thirdparty/kernel/stable-queue.git] / queue-4.19 / clocksource-timer-ti-dm-fix-pwm-dmtimer-usage-of-fck.patch
1 From 3bb88457dd0e4d039b1c8a7debf4cd6ae187c87f Mon Sep 17 00:00:00 2001
2 From: Tony Lindgren <tony@atomide.com>
3 Date: Tue, 22 Jan 2019 09:03:08 -0800
4 Subject: clocksource: timer-ti-dm: Fix pwm dmtimer usage of fck reparenting
5
6 [ Upstream commit 983a5a43ec254cd5ddf3254db80ca96e8f8bb2a4 ]
7
8 Commit 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe
9 them with ti-sysc") moved some omap4 timers to probe with ti-sysc
10 interconnect target module. Turns out this broke pwm-omap-dmtimer
11 where we now try to reparent the clock to itself with the following:
12
13 omap_dm_timer_of_set_source: failed to set parent
14
15 With ti-sysc, we can now configure the clock sources in the dts
16 with assigned-clocks and assigned-clock-parents. So we should be able
17 to remove omap_dm_timer_of_set_source with clean-up patches later on.
18 But for now, let's just fix it first by checking if parent and fck
19 are the same and bail out of so.
20
21 Fixes: 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe them with ti-sysc")
22 Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
23 Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
24 Cc: H. Nikolaus Schaller <hns@goldelico.com>
25 Cc: Keerthy <j-keerthy@ti.com>
26 Cc: Ladislav Michl <ladis@linux-mips.org>
27 Cc: Pavel Machek <pavel@ucw.cz>
28 Cc: Sebastian Reichel <sre@kernel.org>
29 Cc: Tero Kristo <t-kristo@ti.com>
30 Cc: Thierry Reding <thierry.reding@gmail.com>
31 Cc: Thomas Gleixner <tglx@linutronix.de>
32 Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
33 Tested-By: Andreas Kemnade <andreas@kemnade.info>
34 Tested-By: H. Nikolaus Schaller <hns@goldelico.com>
35 Signed-off-by: Tony Lindgren <tony@atomide.com>
36 Signed-off-by: Sasha Levin <sashal@kernel.org>
37 ---
38 drivers/clocksource/timer-ti-dm.c | 4 ++++
39 1 file changed, 4 insertions(+)
40
41 diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
42 index 4cce6b224b87..3ecf84706640 100644
43 --- a/drivers/clocksource/timer-ti-dm.c
44 +++ b/drivers/clocksource/timer-ti-dm.c
45 @@ -154,6 +154,10 @@ static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
46 if (IS_ERR(parent))
47 return -ENODEV;
48
49 + /* Bail out if both clocks point to fck */
50 + if (clk_is_match(parent, timer->fclk))
51 + return 0;
52 +
53 ret = clk_set_parent(timer->fclk, parent);
54 if (ret < 0)
55 pr_err("%s: failed to set parent\n", __func__);
56 --
57 2.19.1
58