Bug 41932 - Ideapad S10-3 hangs on resume from suspend-to-ram
Ideapad S10-3 hangs on resume from suspend-to-ram
Status: CLOSED UNREPRODUCIBLE
Product: Platform Specific/Hardware
Classification: Unclassified
Component: x86-64
All Linux
: P1 normal
Assigned To: platform_x86_64@kernel-bugs.osdl.org
:
Depends on:
Blocks: 7216 36912
  Show dependency treegraph
 
Reported: 2011-08-29 04:42 UTC by Jonathan Nieder
Modified: 2013-08-15 22:33 UTC (History)
9 users (show)

See Also:
Kernel Version: 3.0-rc1
Tree: Mainline
Regression: Yes


Attachments
s10-3t kernel config for 3.4-af56e0aa3 (113.76 KB, application/xml)
2012-06-05 01:04 UTC, Feng Tang
Details
s10_s2ram_debug patch (550 bytes, patch)
2012-07-04 07:50 UTC, Feng Tang
Details | Diff
new_s2ram.patch (961 bytes, patch)
2012-07-25 06:04 UTC, Feng Tang
Details | Diff

Description Jonathan Nieder 2011-08-29 04:42:10 UTC
http://thread.gmane.org/gmane.linux.kernel/1136253/focus=1185250

Subject    : Ideapad S10-3 hangs on resume from suspend-to-ram
Submitter  : Lars Boegild Thomsen <lth@cow.dk>
Date       : 2011-07-27 05:21:01
Message-ID : 201107271318.51883.lth@cow.dk
References : http://thread.gmane.org/gmane.linux.kernel/1136253/focus=1185250
First-Bad-Commit : 983bbf1af0664b78689612b247acb514300f62c7

This entry is being used for tracking a regression from 3.0. Please don't
close it until the problem is fixed in the mainline.
Comment 1 Jonathan Nieder 2011-08-29 04:43:07 UTC
(In reply to comment #0)

> This entry is being used for tracking a regression from 3.0.

Apparently I can't spell.  This is a regression from *2.6.39*.
Comment 2 Dave Hansen 2011-08-31 15:40:28 UTC
Could you post your .configs for both kernels?  I just want to confirm the presence (or lack of) of intel_idle.
Comment 3 e568b31a443d 2012-03-19 11:29:07 UTC
This bug is still valid for 3.3, anyone going to fix it?
Comment 4 Jonathan Nieder 2012-03-19 17:17:40 UTC
(In reply to comment #3)
> This bug is still valid for 3.3, anyone going to fix it?

Maybe you will.  Can you confirm Lars's bisection result by
testing 983bbf1af06 and 983bbf1af06^ and describing the behavior
of each?
Comment 5 e568b31a443d 2012-03-23 14:37:38 UTC
Yes, I can confirm that.

Also: /boot/config-2.6.39-rc7+:# CONFIG_INTEL_IDLE is not set
Comment 6 e568b31a443d 2012-03-23 14:37:46 UTC
Yes, I can confirm that.

Also: /boot/config-2.6.39-rc7+:# CONFIG_INTEL_IDLE is not set
Comment 7 e568b31a443d 2012-03-23 15:04:25 UTC
Description of the behaviour is that with 983bbf1af06 present,
resume does not work, if it's not present, it works.
Comment 8 Andreas Wallberg 2012-04-27 20:34:19 UTC
I have this netbook and suffer from the bug as well. I'm on Arch Linux with a 3.3.3 i686 kernel. The last working kernel was the 2.6.39 series. I'd like to help out testing patches. What is the current status?

The most recent discussion I've seen was referenced here: http://www.mentby.com/Group/linux-kernel/regression-ideapad-s10-3-does-not-wake-up-from-suspend.html
Comment 9 e568b31a443d 2012-05-10 21:38:23 UTC
There is a second bug for me which was introduced after that one in 2.6.39. Can you try waiting 600 seconds and check if your laptop resumes after that amount of time?

If I remember correct "hpet=disable nohz=off" fixed it.
Comment 10 Andreas Wallberg 2012-05-11 22:59:30 UTC
It seems to be able to sleep at least an hour and resume correctly only if I add these flags:

hpet=disable highres=off nohz=off
Comment 11 Feng Tang 2012-06-04 06:02:56 UTC
(In reply to comment #10)
> It seems to be able to sleep at least an hour and resume correctly only if I
> add these flags:
> 
> hpet=disable highres=off nohz=off

What's your kernel version. 

I now check a S10-3t with Federo 15, with kernel
Linux cats-testing.sh.intel.com 2.6.38.6-26.rc1.fc15.i686.PAE #1 SMP Mon May 9 20:36:50 UTC 2011 i686 i686 i386 GNU/Linux 

The s2ram and s2disk both work fine.
Comment 12 Feng Tang 2012-06-04 07:28:25 UTC
Just tested with a new 3.4.0+ kernel, both s2ram and s2disk work fine too.

kernel:
3.4.0+ #25 SMP Mon Jun 4 14:18:02 CST 2012 i686 i686 i386 GNU/Linux

cmdline:
ro root=UUID=b3f9f994-4d41-48b9-893f-88db07533b5d rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb 

lspci:
00:00.0 Host bridge: Intel Corporation N10 Family DMI Bridge
00:02.0 VGA compatible controller: Intel Corporation N10 Family Integrated Graphics Controller
00:02.1 Display controller: Intel Corporation N10 Family Integrated Graphics Controller
00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 02)
00:1d.0 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation NM10 Family LPC Controller (rev 02)
00:1f.2 SATA controller: Intel Corporation N10/ICH7 Family SATA AHCI Controller (rev 02)
00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 02)
05:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57780 Gigabit Ethernet PCIe (rev 01)
07:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
Comment 13 Dave Hansen 2012-06-04 16:10:58 UTC
I've had a bunch of issues getting post-3.1 kernels to suspend and resume on this hardware:

http://groups.google.com/group/linux.kernel/browse_thread/thread/3272041cb68ccb0d?pli=1

Here's the config I've been using:

http://sr71.net/~dave/linux/netbook.config

Feng, could you post your .config, please?
Comment 14 Feng Tang 2012-06-05 01:04:40 UTC
Created attachment 73508 [details]
s10-3t kernel config for 3.4-af56e0aa3

This is for kernel 3.4-af56e0aa3
Comment 15 Dave Hansen 2012-06-05 02:53:27 UTC
(In reply to comment #14)
> Created an attachment (id=73508) [details]
> s10-3t kernel config for 3.4-af56e0aa3

Ahh...  All of the S10-* hardware is fairly different.  IOW, I'm not sure results on the S10-3t apply to the S10-3.  I will check to see if the hangs that intel_idle was causing are fixed, though.
Comment 16 Jonathan Nieder 2012-06-05 03:12:49 UTC
Dave, does "hpet=disable highres=off nohz=off" help in your setup?
Comment 17 Feng Tang 2012-07-03 09:04:40 UTC
I was told to try the s2ram with AC adapter unplugged, so I started test the s2ram with close/open lid, there is no hang happen, just sometimes I did see a very long delay before the system could resume back from the S3 suspended state, the delay sometimes is ~120 seconds, sometimes ~150 seconds.

I tried 2.6.37, 2.6.38.8, 3.4.0, 3.5-rc2 kernel, which all have this problem.

Will check more
Comment 18 Feng Tang 2012-07-04 07:50:08 UTC
Created attachment 74801 [details]
s10_s2ram_debug patch

Hi,

Could you try the attached debug patch, it works on my side. I know our HW are not the exactly same, and I can see the problem on 2.6.37 till 3.5-rc2, while you guys only see it as a regression for 2.6.39.

Thanks,
Feng

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index f113755..d2e0c90 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -439,6 +439,14 @@ again:
 	 * in the event mask
 	 */
 	if (next_event.tv64 != KTIME_MAX) {
+		s64 delta;
+
+		delta = next_event.tv64 - now.tv64;
+		if (delta >= 10000000000) {
+			printk("%s(): The delta is big: %lld\n", __func__, delta);
+			next_event.tv64 = now.tv64 + 3000000000;
+		}
+
 		/*
 		 * Rearm the broadcast device. If event expired,
 		 * repeat the above
Comment 19 Damjan Georgievski 2012-07-15 22:51:24 UTC
(In reply to comment #16)
> Dave, does "hpet=disable highres=off nohz=off" help in your setup?

This helped on my Ideapad S10-3 and now it resumes.
Comment 20 e568b31a443d 2012-07-17 09:01:57 UTC
Jul 17 09:47:46 foo kernel: [   64.051308] PM: Syncing filesystems ... done.
Jul 17 09:47:46 foo kernel: [   64.052814] PM: Preparing system for mem sleep
Jul 17 09:52:57 foo kernel: [   64.076513] Freezing user space processes ... (elapsed 0.01 seconds) done.
Jul 17 09:52:57 foo kernel: [   64.092307] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
Jul 17 09:52:57 foo kernel: [   64.108265] PM: Entering mem sleep
Jul 17 09:52:57 foo kernel: [   64.108298] Suspending console(s) (use no_console_suspend to debug)
Jul 17 09:52:57 foo kernel: [   64.108722] sd 1:0:0:0: [sda] Synchronizing SCSI cache
Jul 17 09:52:57 foo kernel: [   64.113842] sd 1:0:0:0: [sda] Stopping disk
Jul 17 09:52:57 foo kernel: [   64.469231] ACPI handle has no context!
Jul 17 09:52:57 foo kernel: [   64.724102] PM: suspend of devices complete after 615.590 msecs
Jul 17 09:52:57 foo kernel: [   64.724368] PM: late suspend of devices complete after 0.258 msecs
Jul 17 09:52:57 foo kernel: [   64.740233] pcieport 0000:00:1c.0: wake-up capability enabled by ACPI
Jul 17 09:52:57 foo kernel: [   64.756438] PM: noirq suspend of devices complete after 32.059 msecs
Jul 17 09:52:57 foo kernel: [   64.756476] ACPI: Preparing to enter system sleep state S3
Jul 17 09:52:57 foo kernel: [   64.840208] PM: Saving platform NVS memory
Jul 17 09:52:57 foo kernel: [   64.840250] Disabling non-boot CPUs ...
Jul 17 09:52:57 foo kernel: [   64.944036] CPU 1 is now offline
Jul 17 09:52:57 foo kernel: [   64.944784] Extended CMOS year: 2000
Jul 17 09:52:57 foo kernel: [   64.944784] ACPI: Low-level resume complete
Jul 17 09:52:57 foo kernel: [   64.944784] PM: Restoring platform NVS memory
Jul 17 09:52:57 foo kernel: [   64.944784] CPU0: Thermal monitoring handled by SMI
Jul 17 09:52:57 foo kernel: [   64.944784] Extended CMOS year: 2000
Jul 17 09:52:57 foo kernel: [   73.180349] Enabling non-boot CPUs ...
Jul 17 09:52:57 foo kernel: [   73.180543] Booting Node 0 Processor 1 APIC 0x1
Jul 17 09:52:57 foo kernel: [   73.184006] [sched_delayed] sched: RT throttling activated
Jul 17 09:52:57 foo kernel: [   73.196105] CPU1 is up
Jul 17 09:52:57 foo kernel: [   73.196541] ACPI: Waking up from system sleep state S3
Jul 17 09:52:57 foo kernel: [  365.237735] PM: noirq resume of devices complete after 1.435 msecs
Jul 17 09:52:57 foo kernel: [  365.237917] PM: early resume of devices complete after 0.134 msecs
Jul 17 09:52:57 foo kernel: [  365.238051] i915 0000:00:02.0: setting latency timer to 64
Jul 17 09:52:57 foo kernel: [  365.238535] snd_hda_intel 0000:00:1b.0: irq 45 for MSI/MSI-X
Jul 17 09:52:57 foo kernel: [  365.239094] pci 0000:00:1e.0: setting latency timer to 64
Jul 17 09:52:57 foo kernel: [  365.239247] ahci 0000:00:1f.2: setting latency timer to 64
Jul 17 09:52:57 foo kernel: [  365.239392] pcieport 0000:00:1c.0: wake-up capability disabled by ACPI
Jul 17 09:52:57 foo kernel: [  365.560238] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Jul 17 09:52:57 foo kernel: [  365.564163] ata1: SATA link down (SStatus 0 SControl 300)
Jul 17 09:52:57 foo kernel: [  365.825885] ata2.00: configured for UDMA/133
Jul 17 09:52:57 foo kernel: [  365.840353] sd 1:0:0:0: [sda] Starting disk
Jul 17 09:52:57 foo kernel: [  366.035954] PM: resume of devices complete after 798.030 msecs
Jul 17 09:52:57 foo kernel: [  366.036218] PM: Finishing wakeup.

This is 3.5.0-rc7 with s10_s2ram_debug, I see no effect.
Laptop does wake up but it takes 5 Minutes to wake up completely.
Cmdline includes intel_idle.max_cstate=0 pcie_aspm=force and CONFIG_CPU_IDLE=y.
Hardware is S10-3.


> > Dave, does "hpet=disable highres=off nohz=off" help in your setup?

> This helped on my Ideapad S10-3 and now it resumes.

Helps here too but it does drain the battery a lot.
Comment 21 Feng Tang 2012-07-25 06:03:09 UTC
(In reply to comment #20)

> 798.030 msecs
> Jul 17 09:52:57 foo kernel: [  366.036218] PM: Finishing wakeup.
> 
> This is 3.5.0-rc7 with s10_s2ram_debug, I see no effect.
> Laptop does wake up but it takes 5 Minutes to wake up completely.
> Cmdline includes intel_idle.max_cstate=0 pcie_aspm=force and CONFIG_CPU_IDLE=y.
> Hardware is S10-3.
> 

Thanks for the test, looks like the broadcast device didn't fire an interrupt during the wakeup. could you test the new attached patch "new_s2ram.patch".
Comment 22 Feng Tang 2012-07-25 06:04:36 UTC
Created attachment 76071 [details]
new_s2ram.patch
Comment 23 Damjan Georgievski 2012-07-25 19:54:51 UTC
(In reply to comment #22)
> Created an attachment (id=76071) [details]
> new_s2ram.patch

The patch seems to lack a closing } in the if case.

Otherwise, it seems to work. Now my S10-3 does resume.
Comment 24 e568b31a443d 2012-07-25 21:59:43 UTC
(In reply to comment #21)

> Thanks for the test, looks like the broadcast device didn't fire an interrupt
> during the wakeup. could you test the new attached patch "new_s2ram.patch".

It works for me, thanks for your work.
Comment 25 e568b31a443d 2012-07-26 08:53:47 UTC
(In reply to comment #24)

> It works for me, thanks for your work.

I'm not sure weather it's related but my S10-3 froze while resuming, nothing in the logs.
Comment 26 Feng Tang 2012-07-26 09:56:30 UTC
(In reply to comment #25)
> (In reply to comment #24)
> 
> > It works for me, thanks for your work.
> 
> I'm not sure weather it's related but my S10-3 froze while resuming, nothing in
> the logs.

I'm a little confused. Could you provide more detail?

Did you mean with the patch, sometimes s10-3 resume ok, while sometimes it still can't resume? And you mentioned "froze while resuming", did it hang forever, or comeback after several minutes?
Comment 27 e568b31a443d 2012-07-26 20:59:27 UTC
(In reply to comment #26)

> I'm a little confused. Could you provide more detail?

Never mind, it did not happen again and was probably unrelated.
Comment 28 Damjan Georgievski 2012-08-10 17:03:25 UTC
What's the future of the patch in upstream?
Comment 29 Feng Tang 2012-08-11 13:52:55 UTC
(In reply to comment #28)
> What's the future of the patch in upstream?

I've been thinking this for quiet a while. The patch is kind of a hack, and I don't think it will be easily accepted by Thomas (tglx) .

The patch has 2 parts:
1. After resume, program the broadcast tick device to fire IRQ in 5 seconds.
2. In broadcast device's oneshot handler, if the interval to be programmed to be bigger than 10 seconds, cut it down to 3 seconds.

1st point is not that bad, the 2nd may hurt performance. One way may be to create a flag "system_in_suspend", we only do the 2nd when system_in_suspend == 1.

Thomas, any comments on this?

Thanks,
Feng
Comment 30 Ivan Osadchii 2012-10-11 11:51:58 UTC
I think I'm experiencing the same problem with lenovo s10-3 (system freezes on resume, waiting for 5-10 minutes doesn't help). I'm not sure if it worth creating a new bug, so I'll just post what I have here.

Original bugreport with a bunch of apport-collected dumps: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1065076

Kernels tested:

3.2.0-31 (ubuntu stock kernel)
3.6.1 from http://kernel.ubuntu.com/~kernel-ppa/mainline/

Suspend problem is present in both.

Workarounds: anything that prevents CPU from entering C4 state. In particular, adding kernel parameter "hpet=disabled" (CPU never enters C1-C4) or adding "intel_idle.max_cstate=3" (CPU can enter C1-C2, but not C4).

I have to note that these workarounds make not much sense: why try to save power by suspending at all if regular power consumption is increased?

I also want to confirm that Feng Tang's patch from comment #22 is working. Applied it to the 3.6.1 kernel and now I can suspend/resume without problems. Thank you, Feng. The patch does have a missing closing bracket, had to add it manually.

And of course.. is there any chance this will be fixed in upstream?
Comment 31 Len Brown 2013-08-15 22:33:09 UTC
My Lenovo S10-3 suspends and resumes fine.
I've tested various kernels, 3.8 - 3.11-rc5

https://bugzilla.kernel.org/show_bug.cgi?id=21952#c66

Please re-open if you have an issue w/ yours.
It may be that there is a failure on the S10-3t
that is not present on the S10-3.

Note You need to log in before you can comment on or make changes to this bug.