Bug 53011

Summary: Resumed system freezes - Toshiba Tecra R950-117
Product: Power Management Reporter: kk1 (ja.schm)
Component: Hibernation/SuspendAssignee: Lv Zheng (lv.zheng)
Status: CLOSED DUPLICATE    
Severity: normal CC: aaron.lu, lenb, rui.zhang
Priority: P1    
Hardware: All   
OS: Linux   
URL: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1101897
Kernel Version: 3.8 rc4 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: acpidump

Description kk1 2013-01-24 21:16:33 UTC
After first resume, next suspend don't work. System freeze and I need to push power button for hard turn off my computer.
After first resume, Fn keys for suspend, mute and brightness don`t work. However, the volume up/down Fn keys continue to work. This is with 12.10 Quantal 64 bit installed on my Toshiba Tecra R950-117 with disabled EFI boot.

Kernel 3.3.8 from http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3.8-quantoral/ suspend works corectly
Kernel 3.8 rc4 fromhttp://kernel.ubuntu.com/~kernel-ppa/mainline/v3.8-rc4-raring/ the problem persists

Ubuntu kernel 3.5.0-22-generic the problem persists

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: linux-image-3.5.0-22-generic 3.5.0-22.34
ProcVersionSignature: Ubuntu 3.5.0-22.34-generic 3.5.7.2
Uname: Linux 3.5.0-22-generic x86_64
ApportVersion: 2.6.1-0ubuntu9
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: janschml 2950 F.... pulseaudio
Date: Sat Jan 19 21:28:54 2013
EcryptfsInUse: Yes
HibernationDevice: RESUME=UUID=30f5cea7-2ed3-4fc8-a0cf-fba7f54d8ef2
InstallationDate: Installed on 2012-09-20 (121 days ago)
InstallationMedia: Kubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120822.2)
MachineType: TOSHIBA TECRA R950
MarkForUpload: True
ProcEnviron:
 LANGUAGE=sk_SK.utf8
 TERM=xterm
 PATH=(custom, no user)
 LANG=sk_SK.UTF-8
 SHELL=/bin/bash
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.5.0-22-generic root=UUID=a81c5873-29fe-4715-b4a0-2ca25650661d ro quiet splash acpi_osi=Linux acpi_backlight=vendor pcie_aspm=force i915.i915_enable_rc6=1 i915.lvds_downclock=1 vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-3.5.0-22-generic N/A
 linux-backports-modules-3.5.0-22-generic N/A
 linux-firmware 1.95
SourcePackage: linux
UpgradeStatus: Upgraded to quantal on 2012-10-18 (93 days ago)
dmi.bios.date: 10/01/2012
dmi.bios.vendor: TOSHIBA
dmi.bios.version: Version 6.40
dmi.board.asset.tag: 0000000000
dmi.board.name: TECRA R950
dmi.board.vendor: TOSHIBA
dmi.board.version: Version A0
dmi.chassis.asset.tag: 0000000000
dmi.chassis.type: 10
dmi.chassis.vendor: TOSHIBA
dmi.chassis.version: Version 1.0
dmi.modalias: dmi:bvnTOSHIBA:bvrVersion6.40:bd10/01/2012:svnTOSHIBA:pnTECRAR950:pvrPT534E-00F008CZ:rvnTOSHIBA:rnTECRAR950:rvrVersionA0:cvnTOSHIBA:ct10:cvrVersion1.0:
dmi.product.name: TECRA R950
dmi.product.version: PT534E-00F008CZ
dmi.sys.vendor: TOSHIBA
Comment 1 Len Brown 2013-01-30 21:01:32 UTC
It seems the big problem is that your system freezes
after the resume.  The fact that Fn keys are not working
is interesting, but there are bigger problems:-)

Please describe the failure in more detail.
Are you able to use the system for a while
before it freezes, or does it freeze before
you can get control?

Does the keyboard work?  Network?
Can you observe changes in /proc/interrupts?
how about the power button -- does a single press
cause an acpi event and the system shuts down under
software control, or do you have to hold the power
button down for 5 sec for a "hard" power-off?
Comment 2 kk1 2013-01-30 21:47:18 UTC
I don`t have a problem with resume. I have a 
problem with the second suspend.

1. I power on notebook normally, all is working
2. I suspend to RAM -> Notebook suspends normally
3. I resume from suspend normally, but Brightness, suspend and mute Fn Keys do not work and I'm not able suspend second time because when I try to suspend for the second time, system freezes.  The volume Fn keys, network, keyboard always work after resume. System freezes when I start to suspend via Window manager ( Fn key not working) or via terminal with pm-suspend command for the second time.  Suspend start  normally but never finish.  After start of the second suspend I have to hold power  button for  a "hard" power-off.
 
With kernel 3.3.8 I'm able to suspend to RAM  more then once. Brightness Fn keys work after resume with this hack:
http://askubuntu.com/questions/184584/backlight-does-not-work-on-toshiba-portege-and-lts-12-04 .

Interesting is, that this problem occured when I upgraded  BIOS to version 6.40. I think, this bug is the same or very similar to bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1088721 or https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1094800
Comment 3 Rafael J. Wysocki 2013-01-30 22:06:20 UTC
You have some interesting stuff in the kernel command line.

Why do you need them?

Are they still needed with 3.8-rc5?
Comment 4 Aaron Lu 2013-04-08 01:16:47 UTC
Hello kkl,

Please attach the output of acpidump:
# acpidump > acpidump.out

It looks like to me, the FADT table may have the sleep control/status reg set.
Comment 5 kk1 2013-04-08 20:22:28 UTC
Created attachment 97721 [details]
acpidump

I have attached acpidump.out. I don't know if it's important but program acpidump finished with  message "Wrong checksum for FADT!"
Comment 6 kk1 2013-04-08 20:23:52 UTC
I forgot to say thank you Aaron Lu.
Comment 7 Aaron Lu 2013-04-10 08:46:19 UTC
(In reply to comment #6)
> I forgot to say thank you Aaron Lu.
Hi kk1,
You are welcome.

Can you please test the following git commits?

1 da0df92b57311aa1b26a2a90599ed16e1e968b90
expected result: everything works fine
2 b74f05d61b73af584d0c39121980171389ecfaaa
expected result: first resume will result in reboot
3 0dd90aa9d6222e12201f05c0058e8741b7f66474
expected result: first resume will result in reboot
4 dba69d1092e291e257fb5673a3ad0e4c87878ebc
expected result: first suspend ok, but second suspend will freeze
5 latest linus' git tree
expected result: first suspend ok, but second suspend will freeze

Thanks.
Comment 8 kk1 2013-04-11 21:52:29 UTC
Sorry for my late answer, but I copiled kernel and here is result:

commit da0df92b57311aa1b26a2a90599ed16e1e968b90 is as you wrote

commit b74f05d61b73af584d0c39121980171389ecfaaa is as you wrote

commit 0dd90aa9d6222e12201f05c0058e8741b7f66474 is as you wrote

commit dba69d1092e291e257fb5673a3ad0e4c87878ebc Oddly enough, this commit is ok. It's this commit right?, because I think it's kernel 3.3.0 and first broken kernel was 3.4 for me.

last commit f94eeb423bd6061fe68c490dcb11c74e5267f6a2  from http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux is as you wrote

Thanks.
Comment 9 Aaron Lu 2013-04-12 01:22:39 UTC
Thanks a lot for the test!

> 
> commit dba69d1092e291e257fb5673a3ad0e4c87878ebc Oddly enough, this commit is
> ok. It's this commit right?, because I think it's kernel 3.3.0 and first
> broken
> kernel was 3.4 for me.

this commit is meant to fix the first-resume-resulted-in-reboot issue, but is believed to cause the 2nd suspend failure problem according to the linked ubuntu bug page, but obviously, it is not the case. So with this commit, everything works OK? If so, there must be a commit somewhere between this commit and v3.4 that broke the 2nd suspend.

Please use git-bisect to find it, below are steps:
1 git clone Linus' tree if you haven't yet:
$ git clone http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
2 start bisect
$ git bisect start
3 mark the good commit that you have verified
$ git bisect good dba69d1092e291e257fb5673a3ad0e4c87878ebc
4 mark the bad commit
$ git bisect bad v3.4
And then you will see:
Bisecting: 1288 revisions left to test after this (roughly 10 steps)
Now build kernel and test, depending on if this build works or not, mark it as good or bad. Finally, a commit will be found as the 1st commit to cause this problem.

A link to git-bisect:
http://git-scm.com/book/en/Git-Tools-Debugging-with-Git#Binary-Search

Thanks.
Comment 10 kk1 2013-04-19 09:40:03 UTC
OK I made a bisect, bat I`m a little bit confused. I made a bisect between 3.3.8
and 3.4-rc1 one month ago and the result was same as here:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1094800.

The first bad commit was b74f05d61b73af584d0c39121980171389ecfaaa.

But now when I made a bisect between 3.3 and 3.4 the first bad commit is
ad50c15919e8aca7ea30f9dcf4bac52448c9ab46, but there is nothing important, only
maintainer change.
Comment 11 Aaron Lu 2013-04-19 10:23:15 UTC
Thanks for the bisect, but I have a question:

I don't think it is possible to bisect from 3.3.8 to 3.4-rc1, as in Linus' tree, there is no 3.3.8 tag, only Greg's stable tree has, but you are not supposed to mix the two trees I think.
Did you do the bisect using the steps as listed in comment #9?
Comment 12 kk1 2013-04-19 10:39:06 UTC
Yes I did. Twice. Bisect between 3.3.8 to 3.4-rc1 was made from   git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git.

Now I made bisect from http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git as you wrote. 

Here is my bisect log:

# bad: [76e10d158efb6d4516018846f60c2ab5501900bc] Linux 3.4
# good: [dba69d1092e291e257fb5673a3ad0e4c87878ebc] x86, kvm: Call restore_sched_clock_state() only after %gs is initialized
git bisect start 'v3.4' 'dba69d1092e291e257fb5673a3ad0e4c87878ebc'
# bad: [ecca5c3acc0d0933d89abc44e60afb0cc8170e35] Merge branch 'akpm' (Andrew's patch-bomb)
git bisect bad ecca5c3acc0d0933d89abc44e60afb0cc8170e35
# bad: [54229ff359250ce7292dbeb59f157a2d3b67e30c] arch/tile: fix finv_buffer_remote() for tilegx
git bisect bad 54229ff359250ce7292dbeb59f157a2d3b67e30c
# bad: [c39e8ede284f469971589f2e04af78216e1a771d] Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
git bisect bad c39e8ede284f469971589f2e04af78216e1a771d
# bad: [a9d38a4f2da6c49a257253a9fdef7a6bcb0e0e4f] Merge branch 'dunlap' (Randy's Documentation patches)
git bisect bad a9d38a4f2da6c49a257253a9fdef7a6bcb0e0e4f
# good: [66c2689226ac322fbc9acd2e8e418b78dcd52f51] Btrfs: do not bother to defrag an extent if it is a big real extent
git bisect good 66c2689226ac322fbc9acd2e8e418b78dcd52f51
# good: [b7e68d6876dfbab087bc3859211a9efc74cbe30c] sh: Support I/O space swapping where needed.
git bisect good b7e68d6876dfbab087bc3859211a9efc74cbe30c
# bad: [307cc7904841fd66a848ece16a179b49ae1a4ba4] Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
git bisect bad 307cc7904841fd66a848ece16a179b49ae1a4ba4
# good: [16bf288c4be67b68c3fcb6561ff145702cb7bd22] Input: wacom - create inputs when wireless connect
git bisect good 16bf288c4be67b68c3fcb6561ff145702cb7bd22
# good: [f182394033d639679264d61e6dca62761e659ff7] Input: wacom - check for allocation failure in probe()
git bisect good f182394033d639679264d61e6dca62761e659ff7
# bad: [2f7fa1be66dce77608330c5eb918d6360b5525f2] Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
git bisect bad 2f7fa1be66dce77608330c5eb918d6360b5525f2
# bad: [8f121918f2e49f852de1acdc5255cc1ef440d85b] cgroup: cgroup_attach_task() could return -errno after success
git bisect bad 8f121918f2e49f852de1acdc5255cc1ef440d85b
# bad: [ad50c15919e8aca7ea30f9dcf4bac52448c9ab46] cgroup: update MAINTAINERS entry
git bisect bad ad50c15919e8aca7ea30f9dcf4bac52448c9ab46


I really think it is same bug as here:

https://bugzilla.kernel.org/show_bug.cgi?id=54181, because before I upgrade bios to version 6.40 and then 6.50 everything works fine.
Comment 13 Zhang Rui 2013-05-13 02:26:54 UTC
Mark the problem as a duplicate of bug 54181 according to
https://bugzilla.kernel.org/show_bug.cgi?id=54181#c32

Comment #32 From kk1 2013-04-25 08:21:06 (-) [reply] Private

I confirm, that the patch solved problem with second suspend for me on notebook
Toshiba Tecra R950. I tested kernel 3.9-rc8 with applied patch. Second suspend
problem still occurs on kernel 3.9-rc8 without patch.

*** This bug has been marked as a duplicate of bug 54181 ***