Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1407249

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

From Stefan Agner <stefan@agner.ch>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] clk: imx: do not sleep if IRQ's are still disabled
Date 2016-05-26 00:00 +0200
Message-ID <rCP0l-66M-13@gated-at.bofh.it> (permalink)
References (5 earlier) <rs9c5-6Eu-5@gated-at.bofh.it> <rs9lM-6K3-5@gated-at.bofh.it> <rsmVI-1a3-1@gated-at.bofh.it> <rsnRM-1Xs-7@gated-at.bofh.it> <rsuJz-7VP-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 1/2] clk: imx: do not sleep if IRQ's are still disabled Stefan Agner <stefan@agner.ch> - 2016-05-26 00:00 +0200

csiph-web