Bug 201239 - Resume fails in 10-stable after 284034 on some systems
Summary: Resume fails in 10-stable after 284034 on some systems
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.1-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: John Baldwin
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2015-07-01 03:20 UTC by rkoberman
Modified: 2015-07-29 01:03 UTC (History)
3 users (show)

See Also:


Attachments
pci_power_resume_10.patch (1.59 KB, patch)
2015-07-22 18:03 UTC, John Baldwin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rkoberman 2015-07-01 03:20:27 UTC
r284034 broke resume on at least some Lenovo ThinkPads including the x220 and T520. The failure started after the commit of r284034. When a resume is requested, the system starts powering up. The disks spin up and the fans start, but nothing else happens. The power LED continues to pulse, indicating the system is still suspended. No network as the network card is not restarted. This occurred when the suspend was done with X running (i915).

After the attempt the system was essentially dead and had to be hard powered off. After a reboot, nothing had been logged after the suspend.

I manually merged all of the head commits included in this MFC except for r281874 and the system resumed normally again. 

I have now updated everything to r284916 except for the files modified by r281874 and everything is working.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2015-07-03 03:14:04 UTC
There was no way the previously listed commit in the Summary could have affected this :-)

OTOH I will add the committer of *284034* to the Cc: .
Comment 2 rainbow 2015-07-18 06:12:40 UTC
same behaviour with T430s.
Comment 3 John Baldwin freebsd_committer freebsd_triage 2015-07-18 18:55:59 UTC
My x220 suspends and resumes fine on HEAD with this change.  Can you please try HEAD?
Comment 4 rkoberman 2015-07-19 05:04:55 UTC
I can now confirm that on my T520:
HEAD       resumes
10.2-BETA2 fails
10.1       resumes

So the problem is a regression on 10, but works fine on HEAD.
Again, the system suspends normally but does not seem to even start the resume operation on 10.2-BETA2 and requires a power cycle.
Comment 5 rainbow 2015-07-22 12:37:58 UTC
same behavior of rkoberman with T430s
Comment 6 John Baldwin freebsd_committer freebsd_triage 2015-07-22 18:02:35 UTC
Does setting hw.pci.do_power_suspend=0 and/or hw.pci.do_power_resume=0 fix it?  If so, you can try the patch I posted to the mailing list.
Comment 7 John Baldwin freebsd_committer freebsd_triage 2015-07-22 18:03:20 UTC
Created attachment 159075 [details]
pci_power_resume_10.patch
Comment 8 rkoberman 2015-07-23 05:37:12 UTC
No joy. Setting the sysctl items made no difference. I tried both individually and then both. I also tried the patch. In all cases the behavior was unchanged. 

Press the power button to resume. Disk LED comes on for about 2 seconds and goes out. The power light resumes slow flash, but pressing it does nothing after the first press.
Comment 9 John Baldwin freebsd_committer freebsd_triage 2015-07-25 00:09:47 UTC
I'm just going to punt for 10.2 and revert the last change in the MFC.  The other changes in the MFC might fix cardbus across suspend/resume so I will leave those in.  Other people have reported that this worked and it worked fine on a USB key on 10 on my x220.
Comment 10 commit-hook freebsd_committer freebsd_triage 2015-07-25 00:14:24 UTC
A commit references this bug:

Author: jhb
Date: Sat Jul 25 00:14:05 UTC 2015
New revision: 285863
URL: https://svnweb.freebsd.org/changeset/base/285863

Log:
  Partially revert r284034.  In particular, revert the final change in this
  MFC (281874).  It broke suspend and resume on several Thinkpads (though not
  all) in 10 even though it works fine on the same laptops in HEAD.

  PR:		201239
  Reported by:	Kevin Oberman and several others

Changes:
_U  stable/10/
  stable/10/sys/dev/pccbb/pccbb_pci.c
  stable/10/sys/dev/pci/pci.c
  stable/10/sys/dev/pci/pci_pci.c
  stable/10/sys/dev/pci/pcib_private.h
  stable/10/sys/dev/pci/pcivar.h
Comment 11 rkoberman 2015-07-27 05:47:55 UTC
I see that this commit was after 10.2 was branched. Can I assume that you have requested re@ to include in releng/10.2 for RC2?
Comment 12 Glen Barber freebsd_committer freebsd_triage 2015-07-27 14:19:52 UTC
Yes, it was sent to re@ for approval, and should be committed to releng/10.2 today.
Comment 13 rkoberman 2015-07-28 00:43:11 UTC
Confirm that the 10.2-STABLE fixes the problem on my T520.
Comment 14 commit-hook freebsd_committer freebsd_triage 2015-07-29 00:58:54 UTC
A commit references this bug:

Author: gjb
Date: Wed Jul 29 00:57:57 UTC 2015
New revision: 285991
URL: https://svnweb.freebsd.org/changeset/base/285991

Log:
  MFS r285863 (jhb):
   Partially revert r284034.  In particular, revert the final change in
   this MFC (281874).  It broke suspend and resume on several Thinkpads
   (though not all) in 10 even though it works fine on the same laptops
   in HEAD.

  PR:		201239
  Reported by:	Kevin Oberman and several others
  Approved by:	re (kib)
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  releng/10.2/
  releng/10.2/sys/dev/pccbb/pccbb_pci.c
  releng/10.2/sys/dev/pci/pci.c
  releng/10.2/sys/dev/pci/pci_pci.c
  releng/10.2/sys/dev/pci/pcib_private.h
  releng/10.2/sys/dev/pci/pcivar.h
Comment 15 Glen Barber freebsd_committer freebsd_triage 2015-07-29 01:03:46 UTC
Fixed in releng/10.2 as r285991.  Thank you for the report, and for testing the proposed fix.