linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] clk: imx: do not sleep if IRQ's are still disabled
@ 2016-01-29 22:49 Stefan Agner
  2016-01-29 22:49 ` [PATCH 2/2] clk: imx: return correct frequency for Ethernet PLL Stefan Agner
                   ` (4 more replies)
  0 siblings, 5 replies; 39+ messages in thread
From: Stefan Agner @ 2016-01-29 22:49 UTC (permalink / raw)
  To: shawnguo, kernel, mturquette, sboyd
  Cc: linux-arm-kernel, linux-clk, linux-kernel, Stefan Agner

If a clock gets enabled early during boot time, it can lead to a PLL
startup. The wait_lock function makes sure that the PLL is really
stareted up before it gets used. However, the function sleeps which
leads to scheduling and an error:
bad: scheduling from the idle thread!
...

Use udelay in case IRQ's are still disabled.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 drivers/clk/imx/clk-pllv3.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
index c05c43d..b5ff561 100644
--- a/drivers/clk/imx/clk-pllv3.c
+++ b/drivers/clk/imx/clk-pllv3.c
@@ -63,7 +63,10 @@ static int clk_pllv3_wait_lock(struct clk_pllv3 *pll)
 			break;
 		if (time_after(jiffies, timeout))
 			break;
-		usleep_range(50, 500);
+		if (unlikely(irqs_disabled()))
+			udelay(50);
+		else
+			usleep_range(50, 500);
 	} while (1);
 
 	return readl_relaxed(pll->base) & BM_PLL_LOCK ? 0 : -ETIMEDOUT;
-- 
2.7.0

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

end of thread, other threads:[~2016-06-12 12:30 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29 22:49 [PATCH 1/2] clk: imx: do not sleep if IRQ's are still disabled Stefan Agner
2016-01-29 22:49 ` [PATCH 2/2] clk: imx: return correct frequency for Ethernet PLL Stefan Agner
2016-01-29 23:35 ` [PATCH 1/2] clk: imx: do not sleep if IRQ's are still disabled Joshua Clayton
2016-01-30  1:16 ` Stephen Boyd
2016-04-26 17:04   ` Stefan Agner
2016-04-16  1:00 ` Stephen Boyd
2016-04-18  1:58   ` Shawn Guo
2016-04-21  3:45 ` Dong Aisheng
2016-04-26  1:23   ` Shawn Guo
2016-04-26  5:51     ` Dong Aisheng
2016-04-26  9:24       ` Shawn Guo
2016-04-26  9:31       ` Lucas Stach
2016-04-26 11:16         ` Dong Aisheng
2016-04-26 11:27           ` Dong Aisheng
2016-04-27  1:58             ` Shawn Guo
2016-04-27  2:45               ` Dong Aisheng
2016-04-27  2:56                 ` Fabio Estevam
2016-04-27  7:28                   ` Stefan Agner
2016-04-27  8:53                     ` Dong Aisheng
2016-04-27  2:57               ` Dong Aisheng
2016-04-27  7:24                 ` Shawn Guo
2016-04-27  7:26                   ` Stefan Agner
2016-04-27  8:48                   ` Dong Aisheng
2016-04-27  7:34                 ` Stefan Agner
2016-04-27  8:57                   ` Dong Aisheng
2016-04-27 10:15                 ` Thomas Gleixner
2016-04-29  9:45                   ` [RFC PATCH 1/1] clk: imx7d: move clk setting out of imx7d_clocks_init Dong Aisheng
2016-04-29  9:55                     ` Dong Aisheng
2016-04-29 12:31                       ` Lucas Stach
2016-04-30  2:04                     ` Stefan Agner
2016-06-02 15:19                       ` Dong Aisheng
2016-05-25 21:54                   ` [PATCH 1/2] clk: imx: do not sleep if IRQ's are still disabled Stefan Agner
2016-06-02 14:59                   ` Dong Aisheng
2016-06-06 13:20                     ` Thomas Gleixner
2016-06-07  7:04                       ` Dong Aisheng
2016-06-09 20:08                         ` Thomas Gleixner
2016-06-09 22:14                           ` Stefan Agner
2016-06-09 22:55                             ` Thomas Gleixner
2016-06-12 12:24                           ` Dong Aisheng

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).