[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <27240C0AC20F114CBF8149A2696CBE4A61601F7D@SHSMSX101.ccr.corp.intel.com>
Date: Sat, 11 Jan 2020 04:20:02 +0000
From: "Liu, Chuansheng" <chuansheng.liu@...el.com>
To: Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Luck, Tony" <tony.luck@...el.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"hpa@...or.com" <hpa@...or.com>
Subject: RE: [PATCH] x86/mce/therm_throt: Fix the access of uninitialized
therm_work
Hi Ingo,
> -----Original Message-----
> From: Ingo Molnar <mingo.kernel.org@...il.com> On Behalf Of Ingo Molnar
> Sent: Monday, January 6, 2020 3:11 PM
> To: Borislav Petkov <bp@...en8.de>
> Cc: Liu, Chuansheng <chuansheng.liu@...el.com>; linux-kernel@...r.kernel.org;
> Luck, Tony <tony.luck@...el.com>; tglx@...utronix.de; mingo@...hat.com;
> hpa@...or.com
> Subject: Re: [PATCH] x86/mce/therm_throt: Fix the access of uninitialized
> therm_work
>
> * Borislav Petkov <bp@...en8.de> wrote:
>
> > On Mon, Jan 06, 2020 at 06:41:55AM +0000, Chuansheng Liu wrote:
> > > In ICL platform, it is easy to hit bootup failure with panic
> > > in thermal interrupt handler during early bootup stage.
> > >
> > > Such issue makes my platform almost can not boot up with
> > > latest kernel code.
> > >
> > > The call stack is like:
> > > kernel BUG at kernel/timer/timer.c:1152!
> > >
> > > Call Trace:
> > > __queue_delayed_work
> > > queue_delayed_work_on
> > > therm_throt_process
> > > intel_thermal_interrupt
> > > ...
> > >
> > > When one CPU is up, the irq is enabled prior to CPU UP
> > > notification which will then initialize therm_worker.
> >
> > You mean the unmasking of the thermal vector at the end of
> > intel_init_thermal()?
> >
> > If so, why don't you move that to the end of the notifier and unmask it
> > only after all the necessary work like setting up the workqueues etc, is
> > done, and save yourself adding yet another silly bool?
>
> A debugging WARN_ON_ONCE() when the workqueue is not initialized yet
> would also be useful I suspect. This would turn any remaining race-crash
> boot failure in this area into a warning.
>
Just checked the code, the WARN_ON_ONCE() is already there:
1622 WARN_ON_ONCE(timer->function != delayed_work_timer_fn);
With reproducing it, the corresponding log also shows before panic:
WARNING: CPU: 0 .... at kernel/workqueue.c:1622 __queue_delayed_work+0x73/0x90
Thanks for your reminder.
Powered by blists - more mailing lists