public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Tommi Rantala <tt.rantala@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org,
	Sebastian Siewior <bigeasy@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	x86@kernel.org
Subject: Re: [PATCH] hwmon: (coretemp) Handle frozen hotplug state correctly
Date: Wed, 10 May 2017 13:09:46 -0700	[thread overview]
Message-ID: <20170510200946.GB5628@roeck-us.net> (raw)
In-Reply-To: <CA+ydwtqrZ0GVN24M8zEZhWuTqvRASpqSHTYWfoDrTHFAJZGp5Q@mail.gmail.com>

On Wed, May 10, 2017 at 10:16:33PM +0300, Tommi Rantala wrote:
> 2017-05-10 17:30 GMT+03:00 Thomas Gleixner <tglx@linutronix.de>:
> > The recent conversion to the hotplug state machine missed that the original
> > hotplug notifiers did not execute in the frozen state, which is used on
> > suspend on resume.
> >
> > This does not matter on single socket machines, but on multi socket systems
> > this breaks when the device for a non-boot socket is removed when the last
> > CPU of that socket is brought offline. The device removal locks up the
> > machine hard w/o any debug output.
> >
> > Prevent executing the hotplug callbacks when cpuhp_tasks_frozen is true.
> >
> > Thanks to Tommi for providing debug information patiently while I failed to
> > spot the obvious.
> >
> > Fixes: e00ca5df37ad ("hwmon: (coretemp) Convert to hotplug state machine")
> > Reported-by: Tommi Rantala <tt.rantala@gmail.com>
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> 
> Many thanks, I can confirm that it works well!
> 
Ok if I add your Tested-by: ?

Thanks,
Guenter

> -Tommi
> 
> > ---
> >  drivers/hwmon/coretemp.c |   14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > --- a/drivers/hwmon/coretemp.c
> > +++ b/drivers/hwmon/coretemp.c
> > @@ -605,6 +605,13 @@ static int coretemp_cpu_online(unsigned
> >         struct platform_data *pdata;
> >
> >         /*
> > +        * Don't execute this on resume as the offline callback did
> > +        * not get executed on suspend.
> > +        */
> > +       if (cpuhp_tasks_frozen)
> > +               return 0;
> > +
> > +       /*
> >          * CPUID.06H.EAX[0] indicates whether the CPU has thermal
> >          * sensors. We check this bit only, all the early CPUs
> >          * without thermal sensors will be filtered out.
> > @@ -654,6 +661,13 @@ static int coretemp_cpu_offline(unsigned
> >         struct temp_data *tdata;
> >         int indx, target;
> >
> > +       /*
> > +        * Don't execute this on suspend as the device remove locks
> > +        * up the machine.
> > +        */
> > +       if (cpuhp_tasks_frozen)
> > +               return 0;
> > +
> >         /* If the physical CPU device does not exist, just return */
> >         if (!pdev)
> >                 return 0;

  reply	other threads:[~2017-05-10 20:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 14:30 [PATCH] hwmon: (coretemp) Handle frozen hotplug state correctly Thomas Gleixner
2017-05-10 19:16 ` Tommi Rantala
2017-05-10 20:09   ` Guenter Roeck [this message]
2017-05-11  5:57     ` Tommi Rantala
2017-05-10 20:09 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170510200946.GB5628@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=bigeasy@linutronix.de \
    --cc=fenghua.yu@intel.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tt.rantala@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox