[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c3368a10135e304051a56562a1ae0f99@agner.ch>
Date: Wed, 25 May 2016 14:54:07 -0700
From: Stefan Agner <stefan@...er.ch>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Dong Aisheng <dongas86@...il.com>, Shawn Guo <shawnguo@...nel.org>,
Lucas Stach <l.stach@...gutronix.de>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...eaurora.org>,
linux-kernel@...r.kernel.org, mingo@...hat.com,
kernel@...gutronix.de, linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 1/2] clk: imx: do not sleep if IRQ's are still disabled
On 2016-04-27 03:15, Thomas Gleixner wrote:
> On Wed, 27 Apr 2016, Dong Aisheng wrote:
>> 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.
>> See:
>> 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.
>> */
>> sched_init();
>> .............
>> time_init();
>> ..............
>> WARN(!irqs_disabled(), "Interrupts were enabled early\n");
>> early_boot_irqs_disabled = false;
>> local_irq_enable();
>> }
>>
>> The issue can only happen when PLL enable causes a schedule during
>> imx_clock_init().
>
> Calling a function which might sleep _BEFORE_ kernel_init() is wrong. Don't
> try to work around such an issue by doing magic irq_disabled() checks and busy
> loops. Fix the call site and be done with it.
What do you mean exactly by fix the call site? The patch I proposed
(https://lkml.org/lkml/2016/1/29/695) fixes the call site...
But I see Dong's argument here, irqs_disabled is the wrong way to figure
out whether we are in kernel_init. What is the right approach to
distinguish whether we are allowed to sleep?
--
Stefan
Powered by blists - more mailing lists