linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, Suman Anna <s-anna@ti.com>,
	Tony Lindgren <tony@atomide.com>, Tero Kristo <t-kristo@ti.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	"H . Nikolaus Schaller" <hns@goldelico.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Keerthy <j-keerthy@ti.com>, Ladislav Michl <ladis@linux-mips.org>,
	Pavel Machek <pavel@ucw.cz>, Sebastian Reichel <sre@kernel.org>,
	Lokesh Vutla <lokeshvutla@ti.com>
Subject: [PATCH 07/21] clocksource/drivers/timer-ti-dm: Drop bogus omap_dm_timer_of_set_source()
Date: Wed, 18 Mar 2020 18:41:17 +0100	[thread overview]
Message-ID: <20200318174131.20582-7-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <20200318174131.20582-1-daniel.lezcano@linaro.org>

From: Suman Anna <s-anna@ti.com>

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
---
 drivers/clocksource/timer-ti-dm.c | 33 +------------------------------
 1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
index acc93600d351..6a0adb7104b3 100644
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -138,35 +138,6 @@ static int omap_dm_timer_reset(struct omap_dm_timer *timer)
 	return 0;
 }
 
-static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
-{
-	int ret;
-	struct clk *parent;
-
-	/*
-	 * FIXME: OMAP1 devices do not use the clock framework for dmtimers so
-	 * do not call clk_get() for these devices.
-	 */
-	if (!timer->fclk)
-		return -ENODEV;
-
-	parent = clk_get(&timer->pdev->dev, NULL);
-	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__);
-
-	clk_put(parent);
-
-	return ret;
-}
-
 static int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
 {
 	int ret;
@@ -276,9 +247,7 @@ static int omap_dm_timer_prepare(struct omap_dm_timer *timer)
 	__omap_dm_timer_enable_posted(timer);
 	omap_dm_timer_disable(timer);
 
-	rc = omap_dm_timer_of_set_source(timer);
-	if (rc == -ENODEV)
-		return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
+	rc = omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
 
 	return rc;
 }
-- 
2.17.1


  parent reply	other threads:[~2020-03-18 17:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 17:38 [GIT PULL] timer drivers for v5.7 Daniel Lezcano
2020-03-18 17:41 ` [PATCH 01/21] clocksource/drivers/fttmr010: Parametrise shutdown Daniel Lezcano
2020-03-18 17:41   ` [PATCH 02/21] clocksource/drivers/fttmr010: Set interrupt and shutdown Daniel Lezcano
2020-03-18 17:41   ` [PATCH 03/21] dt-bindings: fttmr010: Add ast2600 compatible Daniel Lezcano
2020-03-18 17:41   ` [PATCH 04/21] clocksource: Add driver for the Ingenic JZ47xx OST Daniel Lezcano
2020-03-18 17:41   ` [PATCH 05/21] clocksource/drivers/owl: Improve owl_timer_init fail messages Daniel Lezcano
2020-03-18 17:41   ` [PATCH 06/21] clocksource/drivers/timer-ti-dm: Do not update counter on updating the period Daniel Lezcano
2020-03-18 17:41   ` Daniel Lezcano [this message]
2020-03-18 17:41   ` [PATCH 08/21] dt-bindings: timer: Add X1000 bindings Daniel Lezcano
2020-03-18 17:41   ` [PATCH 09/21] clocksource/drivers/ingenic: Add support for TCU of X1000 Daniel Lezcano
2020-03-18 17:41   ` [PATCH 10/21] clocksource: Replace setup_irq() by request_irq() Daniel Lezcano
2020-03-27 10:24     ` Linus Walleij
2020-03-18 17:41   ` [PATCH 11/21] clocksource/drivers/timer-cs5535: Request irq with non-NULL dev_id Daniel Lezcano
2020-03-18 17:41   ` [PATCH 12/21] clocksource/drivers/timer-microchip-pit64b: Fix rate for gck Daniel Lezcano
2020-03-18 17:41   ` [PATCH 13/21] clocksource/drivers/timer-ti-dm: Convert to SPDX identifier Daniel Lezcano
2020-03-18 17:41   ` [PATCH 14/21] clocksource/drivers/timer-ti-dm: Prepare for using cpuidle Daniel Lezcano
2020-03-18 17:41   ` [PATCH 15/21] clocksource/drivers/timer-ti-dm: Implement cpu_pm notifier for context save and restore Daniel Lezcano
2020-03-18 17:41   ` [PATCH 16/21] clocksource/drivers/timer-ti-dm: Do not update counter on updating the period Daniel Lezcano
2020-03-18 17:41   ` [PATCH 17/21] clocksource/drivers/timer-ti-dm: Add support to get pwm current status Daniel Lezcano
2020-03-18 17:41   ` [PATCH 18/21] clocksource/drivers/timer-ti-dm: Enable autoreload in set_pwm Daniel Lezcano
2020-03-18 17:41   ` [PATCH 19/21] clocksource/drivers/imx-tpm: Remove unused includes Daniel Lezcano
2020-03-18 17:41   ` [PATCH 20/21] clocksource/drivers/imx-sysctr: " Daniel Lezcano
2020-03-18 17:41   ` [PATCH 21/21] clocksource/drivers/timer-probe: Avoid creating dead devices Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200318174131.20582-7-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=hns@goldelico.com \
    --cc=j-keerthy@ti.com \
    --cc=ladis@linux-mips.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lokeshvutla@ti.com \
    --cc=narmstrong@baylibre.com \
    --cc=pavel@ucw.cz \
    --cc=s-anna@ti.com \
    --cc=sre@kernel.org \
    --cc=t-kristo@ti.com \
    --cc=tglx@linutronix.de \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).