From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754287AbdEJUJz (ORCPT ); Wed, 10 May 2017 16:09:55 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:57793 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754087AbdEJUJx (ORCPT ); Wed, 10 May 2017 16:09:53 -0400 Date: Wed, 10 May 2017 13:09:46 -0700 From: Guenter Roeck To: Tommi Rantala Cc: Thomas Gleixner , LKML , Fenghua Yu , Jean Delvare , linux-hwmon@vger.kernel.org, Sebastian Siewior , Peter Zijlstra , x86@kernel.org Subject: Re: [PATCH] hwmon: (coretemp) Handle frozen hotplug state correctly Message-ID: <20170510200946.GB5628@roeck-us.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 10, 2017 at 10:16:33PM +0300, Tommi Rantala wrote: > 2017-05-10 17:30 GMT+03:00 Thomas Gleixner : > > 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 > > Signed-off-by: Thomas Gleixner > > 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;