[PATCH 1/2] clk: imx: do not sleep if IRQ's are still disabled

Dong Aisheng dongas86 at gmail.com
Tue Apr 26 19:57:21 PDT 2016

On Wed, Apr 27, 2016 at 9:58 AM, Shawn Guo <shawnguo at kernel.org> wrote:
> On Tue, Apr 26, 2016 at 07:27:03PM +0800, Dong Aisheng wrote:
>> Shawn,
>> What's your suggestion?
> I think this needs more discussion, and I just dropped Stefan's patch
> from my tree.
> We need to firstly understand why this is happening.  The .prepare hook
> is defined to be non-atomic context, and so that we call sleep function
> in there.  We did everything right.  Why are we getting the warning?  If
> I'm correct, this warning only happens on i.MX7D.  Why is that?

Why Stefan's patch works (checking irqs_disabled()) is because during kernel
time init, the irq is still not enabled. It fixes the issue indirectly.
asmlinkage __visible void __init start_kernel(void)
         * Set up the scheduler prior starting any interrupts (such as the
         * timer interrupt). Full topology setup happens at smp_init()
         * time - but meanwhile we still have a functioning scheduler.
        WARN(!irqs_disabled(), "Interrupts were enabled early\n");
        early_boot_irqs_disabled = false;

The issue can only happen when PLL enable causes a schedule during
Not all PLL has this issue.
The issue happens on MX7D pll_audio_main_clk/pll_video_main_clk
which requires more delay time and cause usleep.
Because clk framework does not support MX7D clock types (operation requires
parents on), we simply enable all clocks in imx7d_clocks_init().

If apply my this patch series:
The issue can also be gone.

Dong Aisheng

> Shawn

More information about the linux-arm-kernel mailing list