All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: mvebu: armada-37xx-periph: Fix initialization for cpu clocks
@ 2019-03-13 16:35 ` Gregory CLEMENT
  0 siblings, 0 replies; 30+ messages in thread
From: Gregory CLEMENT @ 2019-03-13 16:35 UTC (permalink / raw)
  To: Stephen Boyd, Mike Turquette, linux-clk, linux-kernel
  Cc: Rafael J. Wysocki, Viresh Kumar, linux-pm, Christian Neubert,
	Ilias Apalodimas, Vincent Guittot, Jason Cooper, Andrew Lunn,
	Sebastian Hesselbarth, Gregory CLEMENT, Thomas Petazzoni,
	linux-arm-kernel, Antoine Tenart, Miquèl Raynal,
	Maxime Chevallier, stable

The clock parenting was not setup properly when DVFS was enabled. It was
expected that the same clock source was used with and without DVFS which
was not the case.

This patch fixes this issue, allowing to make the cpufreq support work
when the CPU clocks source are not the default ones.

Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx")
Cc: <stable@vger.kernel.org>
Reported-by: Christian Neubert <christian.neubert.86@gmail.com>
Reported-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
 drivers/clk/mvebu/armada-37xx-periph.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c
index 1f1cff428d78..26ed3c18a239 100644
--- a/drivers/clk/mvebu/armada-37xx-periph.c
+++ b/drivers/clk/mvebu/armada-37xx-periph.c
@@ -671,6 +671,17 @@ static int armada_3700_add_composite_clk(const struct clk_periph_data *data,
 		map = syscon_regmap_lookup_by_compatible(
 				"marvell,armada-3700-nb-pm");
 		pmcpu_clk->nb_pm_base = map;
+
+		/*
+		 * Use the same parent when DVFS is enabled that the
+		 * default parent received at boot time. When this
+		 * function is called, DVFS is not enabled yet, so we
+		 * get the default parent and we can set the parent
+		 * for DVFS.
+		 */
+		if (clk_pm_cpu_set_parent(muxrate_hw,
+					  clk_pm_cpu_get_parent(muxrate_hw)))
+			dev_warn(dev, "Failed to setup default parent clock for DVFS\n");
 	}
 
 	*hw = clk_hw_register_composite(dev, data->name, data->parent_names,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2019-07-17 10:33 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-13 16:35 [PATCH] clk: mvebu: armada-37xx-periph: Fix initialization for cpu clocks Gregory CLEMENT
2019-03-13 16:35 ` Gregory CLEMENT
2019-03-14 12:15 ` Ilias Apalodimas
2019-03-14 12:15   ` Ilias Apalodimas
     [not found]   ` <CAC5LXJcCs4nr-qFOWzUJpUBAJ9ngG-cgeTCVCFBKFc1SPzHMuQ@mail.gmail.com>
2019-03-14 13:44     ` Ilias Apalodimas
2019-03-14 13:44       ` Ilias Apalodimas
     [not found]       ` <CAC5LXJf=f2bZLroSXFkGiF2W=1XzAgb_wwtpvZY7O9xv28wbVA@mail.gmail.com>
2019-03-14 14:15         ` Ilias Apalodimas
2019-03-14 14:15           ` Ilias Apalodimas
2019-03-14 14:20       ` Gregory CLEMENT
2019-03-14 14:20         ` Gregory CLEMENT
2019-03-18 11:28         ` Ilias Apalodimas
2019-03-18 11:28           ` Ilias Apalodimas
2019-03-18 11:40           ` Gregory CLEMENT
2019-03-18 11:40             ` Gregory CLEMENT
2019-03-18 12:21             ` Ilias Apalodimas
2019-03-18 12:21               ` Ilias Apalodimas
2019-04-24  9:30               ` Viresh Kumar
2019-04-24  9:30                 ` Viresh Kumar
2019-04-25 12:33                 ` Ilias Apalodimas
2019-04-25 12:33                   ` Ilias Apalodimas
2019-05-20 11:20                   ` Viresh Kumar
2019-05-20 11:20                     ` Viresh Kumar
2019-05-22  7:03                     ` Ilias Apalodimas
2019-05-22  7:03                       ` Ilias Apalodimas
2019-05-22  7:06                       ` Viresh Kumar
2019-05-22  7:06                         ` Viresh Kumar
2019-06-10 10:19                         ` Viresh Kumar
2019-06-10 10:19                           ` Viresh Kumar
2019-07-17 10:33                           ` Viresh Kumar
2019-07-17 10:33                             ` Viresh Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.