All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: imx8m: Use SYS_PLL1_800M as intermediate parent of CLK_ARM
@ 2019-10-22 19:21 ` Leonard Crestez
  0 siblings, 0 replies; 7+ messages in thread
From: Leonard Crestez @ 2019-10-22 19:21 UTC (permalink / raw)
  To: Stephen Boyd, Shawn Guo
  Cc: Michael Turquette, Dong Aisheng, Fabio Estevam, Jacky Bai,
	Anson Huang, Abel Vesa, linux-clk, kernel, linux-imx,
	linux-arm-kernel

During cpu frequency switching the main "CLK_ARM" is reparented to an
intermediate "step" clock. On imx8mm and imx8mn the 24M oscillator is
used for this purpose but it is extremely slow, increasing wakeup
latencies to the point that i2c transactions can timeout and system
becomes unresponsive.

Fix by switching the "step" clk to SYS_PLL1_800M, matching the behavior
of imx8m cpufreq drivers in imx vendor tree.

This bug was not immediately apparent because upstream arm64 defconfig
uses the "performance" governor by default so no cpufreq transitions
happen.

Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
Fixes: 96d6392b54db ("clk: imx: Add support for i.MX8MN clock driver")

Cc: stable@vger.kernel.org
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 drivers/clk/imx/clk-imx8mm.c | 2 +-
 drivers/clk/imx/clk-imx8mn.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

This is marked as "cc: stable" because it has a large impact on common
usecases and it's difficult to debug.

This was sent with a different email workaround so hope it arrives OK.

diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c
index bbd212eb904e..a92942ea2045 100644
--- a/drivers/clk/imx/clk-imx8mm.c
+++ b/drivers/clk/imx/clk-imx8mm.c
@@ -588,11 +588,11 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
 
 	clks[IMX8MM_CLK_ARM] = imx_clk_cpu("arm", "arm_a53_div",
 					   clks[IMX8MM_CLK_A53_DIV],
 					   clks[IMX8MM_CLK_A53_SRC],
 					   clks[IMX8MM_ARM_PLL_OUT],
-					   clks[IMX8MM_CLK_24M]);
+					   clks[IMX8MM_SYS_PLL1_800M]);
 
 	imx_check_clocks(clks, ARRAY_SIZE(clks));
 
 	clk_data.clks = clks;
 	clk_data.clk_num = ARRAY_SIZE(clks);
diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c
index ad7f2e527c70..3cd38eba58df 100644
--- a/drivers/clk/imx/clk-imx8mn.c
+++ b/drivers/clk/imx/clk-imx8mn.c
@@ -544,11 +544,11 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
 
 	clks[IMX8MN_CLK_ARM] = imx_clk_cpu("arm", "arm_a53_div",
 					   clks[IMX8MN_CLK_A53_DIV],
 					   clks[IMX8MN_CLK_A53_SRC],
 					   clks[IMX8MN_ARM_PLL_OUT],
-					   clks[IMX8MN_CLK_24M]);
+					   clks[IMX8MN_SYS_PLL1_800M]);
 
 	imx_check_clocks(clks, ARRAY_SIZE(clks));
 
 	clk_data.clks = clks;
 	clk_data.clk_num = ARRAY_SIZE(clks);
-- 
2.17.1


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

* [PATCH] clk: imx8m: Use SYS_PLL1_800M as intermediate parent of CLK_ARM
@ 2019-10-22 19:21 ` Leonard Crestez
  0 siblings, 0 replies; 7+ messages in thread
From: Leonard Crestez @ 2019-10-22 19:21 UTC (permalink / raw)
  To: Stephen Boyd, Shawn Guo
  Cc: Dong Aisheng, Jacky Bai, Anson Huang, Michael Turquette,
	linux-imx, kernel, Fabio Estevam, linux-clk, linux-arm-kernel,
	Abel Vesa

During cpu frequency switching the main "CLK_ARM" is reparented to an
intermediate "step" clock. On imx8mm and imx8mn the 24M oscillator is
used for this purpose but it is extremely slow, increasing wakeup
latencies to the point that i2c transactions can timeout and system
becomes unresponsive.

Fix by switching the "step" clk to SYS_PLL1_800M, matching the behavior
of imx8m cpufreq drivers in imx vendor tree.

This bug was not immediately apparent because upstream arm64 defconfig
uses the "performance" governor by default so no cpufreq transitions
happen.

Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
Fixes: 96d6392b54db ("clk: imx: Add support for i.MX8MN clock driver")

Cc: stable@vger.kernel.org
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 drivers/clk/imx/clk-imx8mm.c | 2 +-
 drivers/clk/imx/clk-imx8mn.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

This is marked as "cc: stable" because it has a large impact on common
usecases and it's difficult to debug.

This was sent with a different email workaround so hope it arrives OK.

diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c
index bbd212eb904e..a92942ea2045 100644
--- a/drivers/clk/imx/clk-imx8mm.c
+++ b/drivers/clk/imx/clk-imx8mm.c
@@ -588,11 +588,11 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
 
 	clks[IMX8MM_CLK_ARM] = imx_clk_cpu("arm", "arm_a53_div",
 					   clks[IMX8MM_CLK_A53_DIV],
 					   clks[IMX8MM_CLK_A53_SRC],
 					   clks[IMX8MM_ARM_PLL_OUT],
-					   clks[IMX8MM_CLK_24M]);
+					   clks[IMX8MM_SYS_PLL1_800M]);
 
 	imx_check_clocks(clks, ARRAY_SIZE(clks));
 
 	clk_data.clks = clks;
 	clk_data.clk_num = ARRAY_SIZE(clks);
diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c
index ad7f2e527c70..3cd38eba58df 100644
--- a/drivers/clk/imx/clk-imx8mn.c
+++ b/drivers/clk/imx/clk-imx8mn.c
@@ -544,11 +544,11 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
 
 	clks[IMX8MN_CLK_ARM] = imx_clk_cpu("arm", "arm_a53_div",
 					   clks[IMX8MN_CLK_A53_DIV],
 					   clks[IMX8MN_CLK_A53_SRC],
 					   clks[IMX8MN_ARM_PLL_OUT],
-					   clks[IMX8MN_CLK_24M]);
+					   clks[IMX8MN_SYS_PLL1_800M]);
 
 	imx_check_clocks(clks, ARRAY_SIZE(clks));
 
 	clk_data.clks = clks;
 	clk_data.clk_num = ARRAY_SIZE(clks);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] clk: imx8m: Use SYS_PLL1_800M as intermediate parent of CLK_ARM
  2019-10-22 19:21 ` Leonard Crestez
@ 2019-10-28  8:35   ` Shawn Guo
  -1 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2019-10-28  8:35 UTC (permalink / raw)
  To: Leonard Crestez, Stephen Boyd
  Cc: Michael Turquette, Dong Aisheng, Fabio Estevam, Jacky Bai,
	Anson Huang, Abel Vesa, linux-clk, kernel, linux-imx,
	linux-arm-kernel

On Tue, Oct 22, 2019 at 10:21:28PM +0300, Leonard Crestez wrote:
> During cpu frequency switching the main "CLK_ARM" is reparented to an
> intermediate "step" clock. On imx8mm and imx8mn the 24M oscillator is
> used for this purpose but it is extremely slow, increasing wakeup
> latencies to the point that i2c transactions can timeout and system
> becomes unresponsive.
> 
> Fix by switching the "step" clk to SYS_PLL1_800M, matching the behavior
> of imx8m cpufreq drivers in imx vendor tree.
> 
> This bug was not immediately apparent because upstream arm64 defconfig
> uses the "performance" governor by default so no cpufreq transitions
> happen.
> 
> Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
> Fixes: 96d6392b54db ("clk: imx: Add support for i.MX8MN clock driver")
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

Acked-by: Shawn Guo <shawnguo@kernel.org>

Stephen,

I assume that you will pick up this one as a fix.

Shawn

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

* Re: [PATCH] clk: imx8m: Use SYS_PLL1_800M as intermediate parent of CLK_ARM
@ 2019-10-28  8:35   ` Shawn Guo
  0 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2019-10-28  8:35 UTC (permalink / raw)
  To: Leonard Crestez, Stephen Boyd
  Cc: Dong Aisheng, Jacky Bai, Anson Huang, Michael Turquette,
	linux-imx, kernel, Fabio Estevam, linux-clk, linux-arm-kernel,
	Abel Vesa

On Tue, Oct 22, 2019 at 10:21:28PM +0300, Leonard Crestez wrote:
> During cpu frequency switching the main "CLK_ARM" is reparented to an
> intermediate "step" clock. On imx8mm and imx8mn the 24M oscillator is
> used for this purpose but it is extremely slow, increasing wakeup
> latencies to the point that i2c transactions can timeout and system
> becomes unresponsive.
> 
> Fix by switching the "step" clk to SYS_PLL1_800M, matching the behavior
> of imx8m cpufreq drivers in imx vendor tree.
> 
> This bug was not immediately apparent because upstream arm64 defconfig
> uses the "performance" governor by default so no cpufreq transitions
> happen.
> 
> Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
> Fixes: 96d6392b54db ("clk: imx: Add support for i.MX8MN clock driver")
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

Acked-by: Shawn Guo <shawnguo@kernel.org>

Stephen,

I assume that you will pick up this one as a fix.

Shawn

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] clk: imx8m: Use SYS_PLL1_800M as intermediate parent of CLK_ARM
  2019-10-22 19:21 ` Leonard Crestez
@ 2019-10-28  9:45   ` Stephen Boyd
  -1 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2019-10-28  9:45 UTC (permalink / raw)
  To: Leonard Crestez, Shawn Guo
  Cc: Michael Turquette, Dong Aisheng, Fabio Estevam, Jacky Bai,
	Anson Huang, Abel Vesa, linux-clk, kernel, linux-imx,
	linux-arm-kernel

Quoting Leonard Crestez (2019-10-22 12:21:28)
> During cpu frequency switching the main "CLK_ARM" is reparented to an
> intermediate "step" clock. On imx8mm and imx8mn the 24M oscillator is
> used for this purpose but it is extremely slow, increasing wakeup
> latencies to the point that i2c transactions can timeout and system
> becomes unresponsive.
> 
> Fix by switching the "step" clk to SYS_PLL1_800M, matching the behavior
> of imx8m cpufreq drivers in imx vendor tree.
> 
> This bug was not immediately apparent because upstream arm64 defconfig
> uses the "performance" governor by default so no cpufreq transitions
> happen.
> 
> Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
> Fixes: 96d6392b54db ("clk: imx: Add support for i.MX8MN clock driver")
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
> ---

Applied to clk-fixes


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

* Re: [PATCH] clk: imx8m: Use SYS_PLL1_800M as intermediate parent of CLK_ARM
@ 2019-10-28  9:45   ` Stephen Boyd
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2019-10-28  9:45 UTC (permalink / raw)
  To: Leonard Crestez, Shawn Guo
  Cc: Dong Aisheng, Jacky Bai, Anson Huang, Michael Turquette,
	linux-imx, kernel, Fabio Estevam, linux-clk, linux-arm-kernel,
	Abel Vesa

Quoting Leonard Crestez (2019-10-22 12:21:28)
> During cpu frequency switching the main "CLK_ARM" is reparented to an
> intermediate "step" clock. On imx8mm and imx8mn the 24M oscillator is
> used for this purpose but it is extremely slow, increasing wakeup
> latencies to the point that i2c transactions can timeout and system
> becomes unresponsive.
> 
> Fix by switching the "step" clk to SYS_PLL1_800M, matching the behavior
> of imx8m cpufreq drivers in imx vendor tree.
> 
> This bug was not immediately apparent because upstream arm64 defconfig
> uses the "performance" governor by default so no cpufreq transitions
> happen.
> 
> Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
> Fixes: 96d6392b54db ("clk: imx: Add support for i.MX8MN clock driver")
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
> ---

Applied to clk-fixes


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] clk: imx8m: Use SYS_PLL1_800M as intermediate parent of CLK_ARM
       [not found] ` <20191026131046.00973206DD@mail.kernel.org>
@ 2019-10-28 14:18   ` Leonard Crestez
  0 siblings, 0 replies; 7+ messages in thread
From: Leonard Crestez @ 2019-10-28 14:18 UTC (permalink / raw)
  To: Sasha Levin, Stephen Boyd
  Cc: Shawn Guo, Michael Turquette, stable@vger.kernel.org

On 26.10.2019 16:10, Sasha Levin wrote:
> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: ba5625c3e272c clk: imx: Add clock driver support for imx8mm.
> 
> The bot has tested the following trees: v5.3.7.
> 
> v5.3.7: Failed to apply! Possible dependencies:
>      96d6392b54dbb ("clk: imx: Add support for i.MX8MN clock driver")
> 
> 
> NOTE: The patch will not be queued to stable trees until it is upstream.
> 
> How should we proceed with this patch?

This is a single patch which fixes an identical bug in two clk drivers 
which were accepted at different points. I was going to repost in as two 
patches (8mm/8mn) but I saw that Stephen already applied it.

Just fixing 5.4 is fine, or let me know if I should resend.

--
Regards,
Leonard


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

end of thread, other threads:[~2019-10-28 14:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-22 19:21 [PATCH] clk: imx8m: Use SYS_PLL1_800M as intermediate parent of CLK_ARM Leonard Crestez
2019-10-22 19:21 ` Leonard Crestez
2019-10-28  8:35 ` Shawn Guo
2019-10-28  8:35   ` Shawn Guo
2019-10-28  9:45 ` Stephen Boyd
2019-10-28  9:45   ` Stephen Boyd
     [not found] ` <20191026131046.00973206DD@mail.kernel.org>
2019-10-28 14:18   ` Leonard Crestez

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.