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


Groups > linux.kernel > #1407249 > unrolled thread

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

Started byStefan Agner <stefan@agner.ch>
First post2016-05-26 00:00 +0200
Last post2016-05-26 00:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  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

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

FromStefan Agner <stefan@agner.ch>
Date2016-05-26 00:00 +0200
SubjectRe: [PATCH 1/2] clk: imx: do not sleep if IRQ's are still disabled
Message-ID<rCP0l-66M-13@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web