Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clocksource/drivers/timer-ti-dm: Drop bogus omap_dm_timer_of_set_source()

The function omap_dm_timer_of_set_source() was originally added in
commit 31a7448f4fa8a ("ARM: OMAP: dmtimer: Add clock source from DT"),
and is designed to set a clock source from DT using the clocks property
of a timer node. This design choice is okay for clk provider nodes but
otherwise is a bad design as typically the clocks property is used to
specify the functional clocks for a device, and not its parents.

The timer nodes now all define a timer functional clock after the
conversion to ti-sysc and the new clkctrl layout, and this results
in an attempt to set the same functional clock as its parent when a
consumer driver attempts to acquire any of these timers in the
omap_dm_timer_prepare() function. This was masked and worked around
in commit 983a5a43ec25 ("clocksource: timer-ti-dm: Fix pwm dmtimer
usage of fck reparenting"). Fix all of this by simply dropping the
entire function.

Any DT configuration of clock sources should be achieved using
assigned-clocks and assigned-clock-parents properties provided
by the Common Clock Framework.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.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>
Signed-off-by: Suman Anna <s-anna@ti.com>
Tested-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200213053504.22638-1-s-anna@ti.com

authored by

Suman Anna and committed by
Daniel Lezcano
753e8340 6ce4fcb0

+1 -32
+1 -32
drivers/clocksource/timer-ti-dm.c
··· 138 138 return 0; 139 139 } 140 140 141 - static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer) 142 - { 143 - int ret; 144 - struct clk *parent; 145 - 146 - /* 147 - * FIXME: OMAP1 devices do not use the clock framework for dmtimers so 148 - * do not call clk_get() for these devices. 149 - */ 150 - if (!timer->fclk) 151 - return -ENODEV; 152 - 153 - parent = clk_get(&timer->pdev->dev, NULL); 154 - if (IS_ERR(parent)) 155 - return -ENODEV; 156 - 157 - /* Bail out if both clocks point to fck */ 158 - if (clk_is_match(parent, timer->fclk)) 159 - return 0; 160 - 161 - ret = clk_set_parent(timer->fclk, parent); 162 - if (ret < 0) 163 - pr_err("%s: failed to set parent\n", __func__); 164 - 165 - clk_put(parent); 166 - 167 - return ret; 168 - } 169 - 170 141 static int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) 171 142 { 172 143 int ret; ··· 247 276 __omap_dm_timer_enable_posted(timer); 248 277 omap_dm_timer_disable(timer); 249 278 250 - rc = omap_dm_timer_of_set_source(timer); 251 - if (rc == -ENODEV) 252 - return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ); 279 + rc = omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ); 253 280 254 281 return rc; 255 282 }