linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] intel_idle: Don't use on Lenovo Ideapad S10-3t
@ 2015-11-02 21:22 ville.syrjala
  2015-11-03  3:04 ` Brown, Len
  2016-10-27 18:10 ` ville.syrjala
  0 siblings, 2 replies; 7+ messages in thread
From: ville.syrjala @ 2015-11-02 21:22 UTC (permalink / raw)
  To: Len Brown
  Cc: Rafael J. Wysocki, linux-pm, linux-kernel, Ville Syrjälä

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Lenovo Ideapad S10-3t hangs coming out of S3 with intel_idle.
The two workaround that seem to help are "intel_idle.max_cstate=0"
or "nohz=off highres=off".

At a first glance quirk_tigerpoint_bm_sts() seemed promising, but
even when moved to early_resume it didn't do anything.

I have no idea what's wrong here, so let's just disable intel_idle
for these machines using a DMI match.

Cc: Len Brown <len.brown@intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
If anyone has any better ideas, I can try out some patches.

 drivers/idle/intel_idle.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index cd4510a..c4a6888 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -61,6 +61,7 @@
 #include <linux/notifier.h>
 #include <linux/cpu.h>
 #include <linux/module.h>
+#include <linux/dmi.h>
 #include <asm/cpu_device_id.h>
 #include <asm/mwait.h>
 #include <asm/msr.h>
@@ -925,6 +926,25 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
 };
 MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids);
 
+static int intel_idle_disable_callback(const struct dmi_system_id *id)
+{
+	pr_debug(PREFIX "problematic system (%s), disabling\n", id->ident);
+	return 1;
+}
+
+static const struct dmi_system_id intel_idle_disable_dmi[] = {
+	{
+		/* Lenovo Ideapad S10-3t, hangs coming out of S3 */
+		.callback = intel_idle_disable_callback,
+		.ident = "Lenovo Ideapad S10-3t",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Ideapad S10-3t"),
+		},
+	},
+	{}
+};
+
 /*
  * intel_idle_probe()
  */
@@ -957,6 +977,9 @@ static int __init intel_idle_probe(void)
 	    !mwait_substates)
 			return -ENODEV;
 
+	if (dmi_check_system(intel_idle_disable_dmi))
+		return -ENODEV;
+
 	pr_debug(PREFIX "MWAIT substates: 0x%x\n", mwait_substates);
 
 	icpu = (const struct idle_cpu *)id->driver_data;
-- 
2.4.10


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [PATCH] intel_idle: Don't use on Lenovo Ideapad S10-3t
  2015-11-02 21:22 [PATCH] intel_idle: Don't use on Lenovo Ideapad S10-3t ville.syrjala
@ 2015-11-03  3:04 ` Brown, Len
  2015-11-04 16:21   ` Ville Syrjälä
  2016-10-27 18:10 ` ville.syrjala
  1 sibling, 1 reply; 7+ messages in thread
From: Brown, Len @ 2015-11-03  3:04 UTC (permalink / raw)
  To: ville.syrjala; +Cc: Wysocki, Rafael J, linux-pm, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1431 bytes --]

> Lenovo Ideapad S10-3t hangs coming out of S3 with intel_idle.
> The two workaround that seem to help are "intel_idle.max_cstate=0"
> or "nohz=off highres=off".
> 
> At a first glance quirk_tigerpoint_bm_sts() seemed promising, but
> even when moved to early_resume it didn't do anything.
> 
> I have no idea what's wrong here, so let's just disable intel_idle
> for these machines using a DMI match.

Ville, 

It is great that several workarounds have been discovered.

But it would be better to get a good idea of the root-cause
before permanently ignoring the problem via a new
black-list in the upstream kernel.

Is it possible for you to file a bug at bugzilla.kernel.org
against Product: power-management; component: intel_idle?

In it, please put the following information.

If this is a regression, the oldest kernel that broke.

When booted with intel_idle, and then without:

dmesg | grep idle
grep . /sys/devices/system/cpu/cpu0/cpuidle/*/*
# turbostat --debug sleep 10 2> turbostat.out

# cd /sys/devices/system/clocksource/clocksource0
grep . available_clocksource current_clocksource


Other boot options to test:

maxcpus=1
nohpet

intel_idle.max_cstate=3
and if that fails
intel_idle.max_cstate=2
and if that fails
intel_idle.max_cstate=1

thanks,
-Len

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] intel_idle: Don't use on Lenovo Ideapad S10-3t
  2015-11-03  3:04 ` Brown, Len
@ 2015-11-04 16:21   ` Ville Syrjälä
  2015-11-08 19:20     ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 7+ messages in thread
From: Ville Syrjälä @ 2015-11-04 16:21 UTC (permalink / raw)
  To: Brown, Len; +Cc: Wysocki, Rafael J, linux-pm, linux-kernel

On Tue, Nov 03, 2015 at 03:04:21AM +0000, Brown, Len wrote:
> > Lenovo Ideapad S10-3t hangs coming out of S3 with intel_idle.
> > The two workaround that seem to help are "intel_idle.max_cstate=0"
> > or "nohz=off highres=off".
> > 
> > At a first glance quirk_tigerpoint_bm_sts() seemed promising, but
> > even when moved to early_resume it didn't do anything.
> > 
> > I have no idea what's wrong here, so let's just disable intel_idle
> > for these machines using a DMI match.
> 
> Ville, 
> 
> It is great that several workarounds have been discovered.
> 
> But it would be better to get a good idea of the root-cause
> before permanently ignoring the problem via a new
> black-list in the upstream kernel.
> 
> Is it possible for you to file a bug at bugzilla.kernel.org
> against Product: power-management; component: intel_idle?

https://bugzilla.kernel.org/show_bug.cgi?id=107151

> 
> In it, please put the following information.
> 
> If this is a regression, the oldest kernel that broke.

I'll repeat the details here just in case people are too lazy to look at
the bug:

It seems intel_idle has always been flaky with this hardware. It used to
work a little better in the past, but not perfectly.

I tried to bisect the total breakage starting from v3.11, and found the
following commit to be at fault:
commit a8d46b9e4e487301affe84fa53de40b890898604
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Tue Sep 30 02:29:01 2014 +0200

    ACPI / sleep: Rework the handling of ACPI GPE wakeup from
    suspend-to-idle

Before that I observed three different behaviours for S3 resume:
a) sometimes it resumed OK
b) sometimes it resumed part way, but kbd/network etc. were still
   dead, but then pressing the power button made it finish the resume
   somehow
c) same as the previous, except the power button press also made it
   all the way to userspace and initiated a normal shutdown
The same kernel could exhibit both a) and b), or both a) and c).

After a8d46b9e4e48 it never resumes, no matter if I press the power
button or not.

> When booted with intel_idle, and then without:
> 
> dmesg | grep idle
> grep . /sys/devices/system/cpu/cpu0/cpuidle/*/*
> # turbostat --debug sleep 10 2> turbostat.out
> 
> # cd /sys/devices/system/clocksource/clocksource0
> grep . available_clocksource current_clocksource
> 
> 
> Other boot options to test:
> 
> maxcpus=1
> nohpet
> 
> intel_idle.max_cstate=3
> and if that fails
> intel_idle.max_cstate=2
> and if that fails
> intel_idle.max_cstate=1

None of these help.

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] intel_idle: Don't use on Lenovo Ideapad S10-3t
  2015-11-04 16:21   ` Ville Syrjälä
@ 2015-11-08 19:20     ` Henrique de Moraes Holschuh
  2015-11-09 10:28       ` Ville Syrjälä
  0 siblings, 1 reply; 7+ messages in thread
From: Henrique de Moraes Holschuh @ 2015-11-08 19:20 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: Brown, Len, Wysocki, Rafael J, linux-pm, linux-kernel

On Wed, 04 Nov 2015, Ville Syrjälä wrote:
> On Tue, Nov 03, 2015 at 03:04:21AM +0000, Brown, Len wrote:
> > > Lenovo Ideapad S10-3t hangs coming out of S3 with intel_idle.
> > > The two workaround that seem to help are "intel_idle.max_cstate=0"
> > > or "nohz=off highres=off".
> > > 
> > > At a first glance quirk_tigerpoint_bm_sts() seemed promising, but
> > > even when moved to early_resume it didn't do anything.
> > > 
> > > I have no idea what's wrong here, so let's just disable intel_idle
> > > for these machines using a DMI match.
> > 
> > Ville, 
> > 
> > It is great that several workarounds have been discovered.
> > 
> > But it would be better to get a good idea of the root-cause
> > before permanently ignoring the problem via a new
> > black-list in the upstream kernel.
> > 
> > Is it possible for you to file a bug at bugzilla.kernel.org
> > against Product: power-management; component: intel_idle?
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=107151

This is a shot in the dark, but...

The Atom N450 public errata sheet is nightmare fuel, and Ville's Ideapad is
running that hellish processor on outdated microcode.

http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/atom-processor-n400-specification-update.pdf

Ville, you might want to insure you're at the latest BIOS for the S10-3t:
http://support.lenovo.com/us/en/products/laptops-and-netbooks/ideapad-s-series-netbooks/ideapad-s10-3t/downloads/DS010786

(don't bother with changelogs to make any sort of update-or-not decisions:
Lenovo changelogs are known to often be incomplete).

I also strongly recommend that you should install your distro's microcode
update package: your microcode should have been revision 0x107 or higher, it
has been in the public microcode distribution since Q2/Q3-2010...

Now, as I said, this is all a shot in the dark, and it might not help at all
with the hangs.  But it looks like something worth trying...

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] intel_idle: Don't use on Lenovo Ideapad S10-3t
  2015-11-08 19:20     ` Henrique de Moraes Holschuh
@ 2015-11-09 10:28       ` Ville Syrjälä
  0 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2015-11-09 10:28 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh
  Cc: Brown, Len, Wysocki, Rafael J, linux-pm, linux-kernel

On Sun, Nov 08, 2015 at 05:20:16PM -0200, Henrique de Moraes Holschuh wrote:
> On Wed, 04 Nov 2015, Ville Syrjälä wrote:
> > On Tue, Nov 03, 2015 at 03:04:21AM +0000, Brown, Len wrote:
> > > > Lenovo Ideapad S10-3t hangs coming out of S3 with intel_idle.
> > > > The two workaround that seem to help are "intel_idle.max_cstate=0"
> > > > or "nohz=off highres=off".
> > > > 
> > > > At a first glance quirk_tigerpoint_bm_sts() seemed promising, but
> > > > even when moved to early_resume it didn't do anything.
> > > > 
> > > > I have no idea what's wrong here, so let's just disable intel_idle
> > > > for these machines using a DMI match.
> > > 
> > > Ville, 
> > > 
> > > It is great that several workarounds have been discovered.
> > > 
> > > But it would be better to get a good idea of the root-cause
> > > before permanently ignoring the problem via a new
> > > black-list in the upstream kernel.
> > > 
> > > Is it possible for you to file a bug at bugzilla.kernel.org
> > > against Product: power-management; component: intel_idle?
> > 
> > https://bugzilla.kernel.org/show_bug.cgi?id=107151
> 
> This is a shot in the dark, but...
> 
> The Atom N450 public errata sheet is nightmare fuel, and Ville's Ideapad is
> running that hellish processor on outdated microcode.
> 
> http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/atom-processor-n400-specification-update.pdf
> 
> Ville, you might want to insure you're at the latest BIOS for the S10-3t:
> http://support.lenovo.com/us/en/products/laptops-and-netbooks/ideapad-s-series-netbooks/ideapad-s10-3t/downloads/DS010786

Seems to require Windows, so no can do without major pain.

Considering acpi_idle works just fine, I doubt a new BIOS version would
have anything to fix this, except maybe by accident.

> (don't bother with changelogs to make any sort of update-or-not decisions:
> Lenovo changelogs are known to often be incomplete).
> 
> I also strongly recommend that you should install your distro's microcode
> update package: your microcode should have been revision 0x107 or higher, it
> has been in the public microcode distribution since Q2/Q3-2010...

[    0.000000] microcode: CPU0 microcode updated early to revision 0x107, date = 2009-08-25
[    0.990876] microcode: CPU0 sig=0x106ca, pf=0x4, revision=0x107
[    0.990972] microcode: CPU1 sig=0x106ca, pf=0x4, revision=0x107

No help unfortunately.

> 
> Now, as I said, this is all a shot in the dark, and it might not help at all
> with the hangs.  But it looks like something worth trying...
> 
> -- 
>   "One disk to rule them all, One disk to find them. One disk to bring
>   them all and in the darkness grind them. In the Land of Redmond
>   where the shadows lie." -- The Silicon Valley Tarot
>   Henrique Holschuh

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] intel_idle: Don't use on Lenovo Ideapad S10-3t
  2015-11-02 21:22 [PATCH] intel_idle: Don't use on Lenovo Ideapad S10-3t ville.syrjala
  2015-11-03  3:04 ` Brown, Len
@ 2016-10-27 18:10 ` ville.syrjala
  2016-10-27 22:22   ` Thomas Gleixner
  1 sibling, 1 reply; 7+ messages in thread
From: ville.syrjala @ 2016-10-27 18:10 UTC (permalink / raw)
  To: Len Brown
  Cc: feng.tang, Steven Rostedt, Sebastian Andrzej Siewior,
	Thomas Gleixner, Rik van Riel, Srivatsa S. Bhat, Peter Zijlstra,
	Arjan van de Ven, Rusty Russell, Oleg Nesterov, Tejun Heo,
	Andrew Morton, Paul McKenney, Linus Torvalds, Paul Turner, Zhang,
	Rui, Rafael J . Wysocki, linux-pm, linux-kernel, linux-arch,
	linux-acpi, Ville Syrjälä

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Lenovo Ideapad S10-3t hangs coming out of S3 with intel_idle.
The two workaround that seem to help are "intel_idle.max_cstate=0"
or "nohz=off highres=off".

At a first glance quirk_tigerpoint_bm_sts() seemed promising, but
even when moved to early_resume it didn't do anything.

I have no idea what's wrong here, so let's just disable intel_idle
for these machines using a DMI match.

I sent this patch originally about one year ago, at which time I was
asked to file a bug, which I did [1], which was mostly a waste of time
since no one actually did anything to fix the problem. In the
meantime even acpi-idle got broken and then fixed again [2], so at
least there's still a working alternative. As intel_idle has never
worked on this machine, and it looks like no one has any real
intention to fix it, I'm going to suggest *again* that we simply
disable intel_idle on this machine and get on with life.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=107151
[2] https://lkml.org/lkml/2016/5/11/238

Cc: feng.tang@intel.com
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Turner <pjt@google.com>
Cc: "Zhang, Rui" <rui.zhang@intel.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/idle/intel_idle.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 4466a2f969d7..db81b27f6250 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -59,6 +59,7 @@
 #include <linux/notifier.h>
 #include <linux/cpu.h>
 #include <linux/moduleparam.h>
+#include <linux/dmi.h>
 #include <asm/cpu_device_id.h>
 #include <asm/intel-family.h>
 #include <asm/mwait.h>
@@ -1089,6 +1090,25 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
 	{}
 };
 
+static int intel_idle_disable_callback(const struct dmi_system_id *id)
+{
+	pr_debug(PREFIX "problematic system (%s), disabling\n", id->ident);
+	return 1;
+}
+
+static const struct dmi_system_id intel_idle_disable_dmi[] = {
+	{
+		/* Lenovo Ideapad S10-3t, hangs coming out of S3 */
+		.callback = intel_idle_disable_callback,
+		.ident = "Lenovo Ideapad S10-3t",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Ideapad S10-3t"),
+		},
+	},
+	{}
+};
+
 /*
  * intel_idle_probe()
  */
@@ -1121,6 +1141,9 @@ static int __init intel_idle_probe(void)
 	    !mwait_substates)
 			return -ENODEV;
 
+	if (dmi_check_system(intel_idle_disable_dmi))
+		return -ENODEV;
+
 	pr_debug(PREFIX "MWAIT substates: 0x%x\n", mwait_substates);
 
 	icpu = (const struct idle_cpu *)id->driver_data;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] intel_idle: Don't use on Lenovo Ideapad S10-3t
  2016-10-27 18:10 ` ville.syrjala
@ 2016-10-27 22:22   ` Thomas Gleixner
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Gleixner @ 2016-10-27 22:22 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: Len Brown, feng.tang, Steven Rostedt, Sebastian Andrzej Siewior,
	Rik van Riel, Srivatsa S. Bhat, Peter Zijlstra, Arjan van de Ven,
	Rusty Russell, Oleg Nesterov, Tejun Heo, Andrew Morton,
	Paul McKenney, Linus Torvalds, Paul Turner, Zhang, Rui,
	Rafael J . Wysocki, linux-pm, linux-kernel, linux-arch,
	linux-acpi

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]

On Thu, 27 Oct 2016, ville.syrjala@linux.intel.com wrote:

> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Lenovo Ideapad S10-3t hangs coming out of S3 with intel_idle.
> The two workaround that seem to help are "intel_idle.max_cstate=0"
> or "nohz=off highres=off".
> 
> At a first glance quirk_tigerpoint_bm_sts() seemed promising, but
> even when moved to early_resume it didn't do anything.
> 
> I have no idea what's wrong here, so let's just disable intel_idle
> for these machines using a DMI match.
> 
> I sent this patch originally about one year ago, at which time I was
> asked to file a bug, which I did [1], which was mostly a waste of time
> since no one actually did anything to fix the problem. In the
> meantime even acpi-idle got broken and then fixed again [2], so at
> least there's still a working alternative. As intel_idle has never
> worked on this machine, and it looks like no one has any real
> intention to fix it, I'm going to suggest *again* that we simply
> disable intel_idle on this machine and get on with life.

Please put that patch on hold. We have some new data on this.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-27 22:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 21:22 [PATCH] intel_idle: Don't use on Lenovo Ideapad S10-3t ville.syrjala
2015-11-03  3:04 ` Brown, Len
2015-11-04 16:21   ` Ville Syrjälä
2015-11-08 19:20     ` Henrique de Moraes Holschuh
2015-11-09 10:28       ` Ville Syrjälä
2016-10-27 18:10 ` ville.syrjala
2016-10-27 22:22   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).