Bug 110961 - HP laptop pavillion X360 kernel freeze after suspend
Summary: HP laptop pavillion X360 kernel freeze after suspend
Status: CLOSED WILL_NOT_FIX
Alias: None
Product: Power Management
Classification: Unclassified
Component: Hibernation/Suspend (show other bugs)
Hardware: Intel Linux
: P1 blocking
Assignee: Chen Yu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-18 03:07 UTC by Dean DeVries
Modified: 2018-02-18 15:53 UTC (History)
6 users (show)

See Also:
Kernel Version: 4.2.0, 4.4.0,4.10.0,4.12.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg capture after suspend with pm_trace (58.89 KB, text/plain)
2016-01-18 03:07 UTC, Dean DeVries
Details
test script to remove modules (732 bytes, application/x-shellscript)
2016-01-18 03:09 UTC, Dean DeVries
Details
loaded modules prior to suspend to bios (9.26 KB, application/octet-stream)
2016-01-18 03:10 UTC, Dean DeVries
Details
output from /proc/acpi/wakeup (514 bytes, application/octet-stream)
2016-01-18 03:10 UTC, Dean DeVries
Details
list of loaded modules for suspend test (4.14 KB, text/plain)
2016-02-18 22:47 UTC, Dean DeVries
Details
excerpt from /var/log/syslog (8.48 KB, text/plain)
2016-02-18 22:49 UTC, Dean DeVries
Details
grub config defaults (1.20 KB, text/plain)
2016-02-25 02:08 UTC, Dean DeVries
Details
dmesg output after normal boot and suspend test (core) (8.54 KB, application/octet-stream)
2016-03-19 19:52 UTC, Dean DeVries
Details
dmesg after boot with options "nomodeset text" (3.58 KB, application/octet-stream)
2016-03-19 19:58 UTC, Dean DeVries
Details
kernel config (188.05 KB, text/plain)
2016-05-18 05:00 UTC, Chen Yu
Details
kernel config file (180.55 KB, application/octet-stream)
2016-05-26 23:12 UTC, Dean DeVries
Details
Kernel Config 07/13/2016 (173.38 KB, text/plain)
2016-07-17 20:40 UTC, Dean DeVries
Details
Modules loaded after init=/bin/bash (7/13/2016) (1.12 KB, application/octet-stream)
2016-07-17 20:41 UTC, Dean DeVries
Details
Ouptut from sleep test routine 07/13/16 (109 bytes, application/octet-stream)
2016-07-17 20:42 UTC, Dean DeVries
Details
Loaded modules for suspend test (1.35 KB, text/plain)
2016-08-04 02:53 UTC, Dean DeVries
Details
kernel 4.12.0 config (178.44 KB, text/x-mpsub)
2017-07-05 02:22 UTC, Dean DeVries
Details
syslog for kernel 4.12.0 rtcwake test (153.87 KB, text/plain)
2017-07-05 02:25 UTC, Dean DeVries
Details
dmesg output kernel 4.12.0 (62.28 KB, text/plain)
2017-07-05 02:27 UTC, Dean DeVries
Details
dmesg output with PM-Trace (54.28 KB, text/plain)
2017-07-30 16:42 UTC, Dean DeVries
Details
syslog for rtcwake with pm_trace=1 (13.01 KB, text/plain)
2017-07-30 16:44 UTC, Dean DeVries
Details
syslog for rtcwake -m freeze with i915 unloaded (15.87 KB, text/plain)
2017-08-16 03:22 UTC, Dean DeVries
Details
rtcwake run with i915 loaded (29.88 KB, text/plain)
2017-08-16 03:24 UTC, Dean DeVries
Details
bash script for stepping through pm_test states (621 bytes, application/x-shellscript)
2017-08-16 03:25 UTC, Dean DeVries
Details
syslog extract (10.29 KB, text/plain)
2017-11-26 03:49 UTC, Dean DeVries
Details
dmesg after startup pm_trace enabled (59.14 KB, text/plain)
2017-11-26 03:51 UTC, Dean DeVries
Details
syslog kernel 4.13 (1.07 MB, text/plain)
2017-12-19 01:27 UTC, Dean DeVries
Details
sys log single user (104.56 KB, text/plain)
2017-12-19 03:58 UTC, Dean DeVries
Details
loaded kernel modules pm-suspend test (6.13 KB, text/plain)
2017-12-19 03:59 UTC, Dean DeVries
Details
loaded kernel modules (346 bytes, text/plain)
2017-12-23 02:52 UTC, Dean DeVries
Details
syslog for pm_suspend test with minimal modules (96.04 KB, text/plain)
2017-12-23 02:54 UTC, Dean DeVries
Details
syslog for comment 71 (4.60 KB, text/plain)
2018-01-16 02:18 UTC, Dean DeVries
Details

Description Dean DeVries 2016-01-18 03:07:46 UTC
Created attachment 200321 [details]
dmesg capture after suspend with pm_trace

When suspending to ram via "systemctl suspend" or using suspend from KDE menu, the laptop will sleep normally.  When power button is tapped for restart, the hard drive spools up and the ethernet card activates (i.e. lights up) but the laptop remains unresponsive.  Pushing "CAPS LOCK" does not get a response (i.e. caps lock light does not come on.)

The trouble shooting steps in "https://wiki.ubuntu.com/DebuggingKernelSuspend" were followed. Output from dmesg is attached.

A script was added to /lib/systemd/system-sleep to attempt to remove as many modules as possible.  No success with getting a successful resume from suspend with any of the modules which were possible to remove.   Ubuntu was also launched in "recovery mode" and the i915 modules removed.  Laptop still failed to resume after suspend command.
Comment 1 Dean DeVries 2016-01-18 03:09:14 UTC
Created attachment 200331 [details]
test script to remove modules
Comment 2 Dean DeVries 2016-01-18 03:10:07 UTC
Created attachment 200341 [details]
loaded modules prior to suspend to bios
Comment 3 Dean DeVries 2016-01-18 03:10:43 UTC
Created attachment 200351 [details]
output from /proc/acpi/wakeup
Comment 4 Dean DeVries 2016-01-20 02:48:09 UTC
1/16/2016:  problem still exists after update to kernel 4.2.0-25-generic
there is a recurring error message associated with the i915 graphic card driver which may be associated with suspend issue:
[drm:valleyview_update_wm [i915]] *ERROR* timed out waiting for Punit DDR
 DVFS request
Comment 5 Aaron Lu 2016-02-01 08:27:36 UTC
Is it a ATOM based laptop?
Comment 6 Dean DeVries 2016-02-04 03:12:33 UTC
The processor is a quad core Intel N3700.  I don't believe that chip is considered part of the ATOM family.
Comment 7 Chen Yu 2016-02-09 07:15:46 UTC
hi
1. boot kernel with init=/bin/bash root=/dev/ram rw nomodeset text modprobe.blacklist=i915 
2. use shell console to test different options for /sys/power/pm_test respectively
Comment 8 Dean DeVries 2016-02-10 02:41:10 UTC
I had a little difficulty with the custom boot parameters.  From the grub menu I select "Advanced boot options for Ubuntu", then edit one of the boot "stanzas". 

I tried to add the parameters to the "linux /vmlinuz ..." line.  Both "init=/bin/bash" and "root=/dev/ram" cause kernel load eerors  such as "/dev/ram does not exist"

I was able to boot with parameters "nomodeset text modprobe.blacklist=i915" and then log into a bash console as root.  

executing "lsmod|grep i915" showed the i915 module loaded.

I unloaded the module "modprobe -r i915" and confirmed it was removed from the kernel.   I then ran the following sequence of commands:

#echo freezer > /sys/power/pm_test
#systemctl suspend
#echo devices > /sys/power/pm_test
#systemctl suspend
#echo platform > /sys/power/pm_test
#systemctl suspend
#echo processors > /sys/power/pm_test
#systemctl suspend
#echo core > /sys/power/pm_test
#systemctl suspend

In each instance of commanding "systemctl suspend" the screen went blank except for a cursor in the top corner, the ethernet card shutoff (light at cable goes out) and then after a pause the system returned to the console screen.

Next I reloaded the i915 module, confirmed it was loaded and reran the sequence of writing parameters to /sys/power/pm_test and executing "systemctl suspend".  In each case the system went through the test and returned to console.
Comment 9 Dean DeVries 2016-02-10 02:49:58 UTC
I item I neglected to mention.  The "[drm:valleyview_update_wm [i915]] *ERROR* timed out waiting for Punit DDR  DVFS request" never appeared when I was running the test sequences described in the previous comment.

I've booted normally and I just logged into a tty terminal as root and the drm:valleyview_upate_wm error is showing up.
Comment 10 Dean DeVries 2016-02-18 19:35:45 UTC
i915 driver does not appear to be cause of kernel freeze.  I booted today with options "nomodeset text" and was able to remove the i915 driver from the kernel (verified via lsmod).  Writing various options to /sys/power/pm_test followed by "systemctl suspend" always resulted in the laptop returning to the text console.

When "none" was written to /sys/power/pm_test the laptop went fully into supsend (i.e. power light blinking) and come out of suspend (ethernet board comes alive as indicated by light, but monitor stays dark).
Comment 11 Dean DeVries 2016-02-18 22:47:34 UTC
Created attachment 203901 [details]
list of loaded modules for suspend test

output from lsmod prior to executing "systemctl suspend"
Comment 12 Dean DeVries 2016-02-18 22:49:31 UTC
Created attachment 203911 [details]
excerpt from /var/log/syslog

attached file with excerpt from /var/log/syslog after executing:
#echo core > /sys/power/pm_test
#systemctl suspend
Comment 13 Chen Yu 2016-02-19 03:20:52 UTC
(In reply to Dean DeVries from comment #10)
> i915 driver does not appear to be cause of kernel freeze.  I booted today
> with options "nomodeset text" and was able to remove the i915 driver from
> the kernel (verified via lsmod).  Writing various options to
> /sys/power/pm_test followed by "systemctl suspend" always resulted in the
> laptop returning to the text console.
> 
> When "none" was written to /sys/power/pm_test the laptop went fully into
> supsend (i.e. power light blinking) and come out of suspend (ethernet board
> comes alive as indicated by light, but monitor stays dark).

If you are using nomodeset text, after resumed, the monitor will keep black because the BIOS is in charge of the display, and BIOS display does not guarantee he will restore the graphic, so this is normal.
And "CAPS LOCK" does not react right?  how about booting with only init=/bin/bash appended(you might need to rebuild your kernel with
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
)
 the  and test the following script:

#!/bin/bash

echo none > /sys/power/pm_test
echo 7 > /proc/sys/kernel/printk

iteration=1
while [ $iteration != 10]
     do
         echo
        echo $iteration

        sudo rtcwake -m mem -s 20
        sleep 30

        iteration=$(($iteration + 1))
done
Comment 14 Chen Yu 2016-02-19 03:21:51 UTC
init=/bin/bash nomodeset text
Comment 15 Dean DeVries 2016-02-25 02:04:23 UTC
I'm still probably not doing the right steps.  I get a kernel panic error that /bin/bash can not be found and the kernel completely hangs.  I did check the kernel config file and it was built with:

 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y

Boot is with GRUB2 and I edit the boot file line starting with "linux /boot/vmlinuz-4.2.0-27" so the GRUB2 boot "stanza" looks like below:

recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  4c39e74b-6b4d-4d37-b45a-1524e44ebaf9
else
  search --no-floppy --fs-uuid --set=root 4c39e74b-6b4d-4d37-b45a-1524e44ebaf9
fi
echo	'Loading Linux 4.2.0-27-generic ...'
linux	/boot/vmlinuz-4.2.0-27-generic.efi.signed root=UUID=4c39e74b-6b4d-4d37-b45a-1524e44ebaf9 ro  init=/bin/bash nomodeset text
echo	'Loading initial ramdisk ...'
initrd	/boot/initrd.img-4.2.0-27-generic
Comment 16 Dean DeVries 2016-02-25 02:08:24 UTC
Created attachment 206001 [details]
grub config defaults

/etc/default/grub attached.  Researching how to implement init=/bin/bash
Comment 17 Dean DeVries 2016-03-19 19:52:36 UTC
Created attachment 209891 [details]
dmesg output after normal boot and suspend test (core)

kernel configuration is:
4.2.0-34-generic #39-Ubuntu SMP Thu Mar 10 22:13:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Comment 18 Dean DeVries 2016-03-19 19:58:25 UTC
Created attachment 209901 [details]
dmesg after boot with options "nomodeset text"

No luck in getting "init=/bin/bash"to work as boot option.  The latest test was performed with boot options "nomodeset text" and I logged into a text terminal as root.

modules i915 and all modules with "i2c" were manually removed and a suspend test done with option "core" in /sys/power/pm_test.

next the following script was executed:
#!/bin/bash

echo none > /sys/power/pm_test
echo 7 > /proc/sys/kernel/printk

iteration=1
while [ $iteration != 10]
     do
         echo
        echo $iteration

        rtcwake -m mem -s 20
        sleep 30

        iteration=$(($iteration + 1))
done
----
The laptop went into a suspend state with the power switch light blinking for approx. 20 seconds.  When the power switch light stopped blinking, the laptop froze (i.e. no response from "CAPS LOCK" key).
Comment 19 Chen Yu 2016-05-18 04:59:12 UTC
(In reply to Dean DeVries from comment #18)
> Created attachment 209901 [details]
> The laptop went into a suspend state with the power switch light blinking
> for approx. 20 seconds.  When the power switch light stopped blinking, the
> laptop froze (i.e. no response from "CAPS LOCK" key).
would you please set the following config as y and try init=/bin/bash again?
CONFIG_BLK_DEV_INITRD CONFIG_BLK_DEV_RAM
Comment 20 Chen Yu 2016-05-18 05:00:21 UTC
Created attachment 216471 [details]
kernel config

Here's my kernel config FYI.
Comment 21 Dean DeVries 2016-05-26 23:12:07 UTC
Created attachment 217801 [details]
kernel config file

Kernel config file attached.  Both options of CONFIG_BLK_DEV_INITRD and CONFIG_BLK_DEV_RAM are set "y"
Comment 22 Chen Yu 2016-06-17 11:13:35 UTC
(In reply to Dean DeVries from comment #21)
> Created attachment 217801 [details]
> kernel config file
> 
> Kernel config file attached.  Both options of CONFIG_BLK_DEV_INITRD and
> CONFIG_BLK_DEV_RAM are set "y"

Please set CONFIG_SATA_AHCI=m to CONFIG_SATA_AHCI=y and recompile the kernel, then try init=/bin/bash?
Comment 23 Zhang Rui 2016-06-27 05:47:14 UTC
ping...
Comment 24 Dean DeVries 2016-06-30 02:03:08 UTC
(In reply to Zhang Rui from comment #23)
> ping...

...pong

Upgraded Kernelto 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

suspend issue still present but the "[drm:valleyview_update_wm [i915]] *ERROR* timed out waiting for Punit DDR  DVFS request" error is gone, so that's progress.

Been busy with an airplane, but I should be able to get back to this issue in next week or so.
Comment 25 Dean DeVries 2016-07-17 20:40:12 UTC
Created attachment 224121 [details]
Kernel Config 07/13/2016
Comment 26 Dean DeVries 2016-07-17 20:41:27 UTC
Created attachment 224131 [details]
Modules loaded after init=/bin/bash (7/13/2016)
Comment 27 Dean DeVries 2016-07-17 20:42:11 UTC
Created attachment 224141 [details]
Ouptut from sleep test routine 07/13/16
Comment 28 Dean DeVries 2016-07-17 20:51:57 UTC
caveat:  This would be a lot easier if I knew what the [insert favourite expletive here] I was doing.

I managed (I think) to compile a custom Ubuntu Kernel based on 4.4.0-31 and was able to boot using "init=/bin/bash"  

I tried to remove as many modules as possible, since I need a minimal kernel to test the suspend to BIOS.  As a side note for those who are as equally inexperienced as I am, you need to compile the kernel with skipmodules=true:

"fakeroot debian/rules binary-headers binary-generic skipmodules=true"

I've attached the kernel config file from /boot, the output from "lsmod"and "uname -a" and the output from the following routine:

#!/bin/bash

echo none > /sys/power/pm_test
echo 7 > /proc/sys/kernel/printk

iteration=1
while [ $iteration != 10 ]
     do
         echo
        echo $iteration

        rtcwake -m mem -s 20
        sleep 30

        iteration=$(($iteration + 1))
done

The laptop would not wake and the kernel did not respond when I held "ALT+PRT SC" and typed "reisub"

On the positive side, I can now build a custom kernel with a reduced module set to support trouble shooting.   Ideally, I won't disable a critical module and have the laptop catch on fire, although my kids would probably think that was cool.
Comment 29 Dean DeVries 2016-08-04 02:53:28 UTC
Created attachment 227491 [details]
Loaded modules for suspend test

Check of suspend to memory with minimal loaded modules.

Is problem with a modules compiled into the kernel?
Comment 30 Chen Yu 2016-09-28 13:01:33 UTC
I rechecked your previous bootup dmesg, the rtc should be able to wake up the system:
[    1.777371] rtc_cmos 00:05: RTC can wake from S4
[    1.777789] rtc_cmos 00:05: rtc core: registered rtc_cmos as rtc0
[    1.777831] rtc_cmos 00:05: alarms up to one month, y3k, 242 bytes nvram
Then it should be a firmware issue that rtc does not trigger a fix event(sci)
OK, forget it about rtc..

After the system boots up with init=/bin/bash, is power button able to wake up the system? ( you might not have display after resumed, but you can verify by pressing Number Lock or Caps Lock) 
BTW, in your previous testing, can you connect to the platform after resumed?(you mentioned the ethernet card activates)

And I suggest always use the latest kernel, since you have the ability to compile your kernel now: )
it should be 4.8-rc8 now at https://www.kernel.org/
Comment 31 Dean DeVries 2016-10-06 00:17:43 UTC
(In reply to Chen Yu from comment #30)

> After the system boots up with init=/bin/bash, is power button able to wake
> up the system? ( you might not have display after resumed, but you can
> verify by pressing Number Lock or Caps Lock) 


CAPS LOCK does not light up and there is no response when I hold ALT+PRT SC and type "reisub".  I've verified reisub works with other kernel freezes.
Comment 32 Chen Yu 2017-03-13 13:27:23 UTC
(In reply to Dean DeVries from comment #29)
> Created attachment 227491 [details]
> Loaded modules for suspend test
> 
> Check of suspend to memory with minimal loaded modules.
> 
> Is problem with a modules compiled into the kernel?
I checked your log again and I thing I've missed something, the rtcwake worked when you tested with these modules loaded, right? 
rtcwake: assuming RTC uses UTC ...
rtcwake: wakeup from "freeze" using /dev/rtc0 at Thu Aug  4 02:36:53 2016
rtcwake: assuming RTC uses UTC ...
rtcwake: wakeup from "mem" using /dev/rtc0 at Thu Aug  4 02:37:26 2016
you can simply run rtcwake -m mem -s 20 manually without running that script.
Comment 33 Zhang Rui 2017-03-27 03:12:21 UTC
ping...
Comment 34 Dean DeVries 2017-04-02 18:58:15 UTC
(In reply to Zhang Rui from comment #33)
> ping...

I'll try a little more with the 4.4 kernel (Kubuntu 16.04LTS) then move on to 4.8 (16.10)
Comment 35 Chen Yu 2017-04-12 01:36:21 UTC
(In reply to Dean DeVries from comment #34)
> (In reply to Zhang Rui from comment #33)
> > ping...
> 
> I'll try a little more with the 4.4 kernel (Kubuntu 16.04LTS) then move on
> to 4.8 (16.10)
Maybe using latest upstream kernel is more applicable.
Comment 36 Zhang Rui 2017-06-16 04:12:26 UTC
ping...
Comment 37 Dean DeVries 2017-06-17 16:14:45 UTC
(In reply to Zhang Rui from comment #36)
> ping...

Kubuntu install became disabled after a recent update - boot wouldn't get past /system/init-premount scripts.   I've installed Kubuntu 17.04 with 4.10.0 kernel.  
I tested the suspend and the laptop still locks up.  Unfortunately I don't know the sequence for activating drivers, but the hard drive and ethernet card always become active.  

I'm going to have to get wireless and a bunch of other items working again before I can trouble shoot suspend.
Comment 38 Zhang Rui 2017-06-19 03:26:39 UTC
First of all, after installation, please either use latest linus' git or download the latest vanilla kernel source from kernel.org and build your kernel with distro config file, and then redo the test.

please attach the dmesg output with rtc_trace enabled if you can reproduce the problem with latest vanilla kernel.
Comment 39 Zhang Rui 2017-07-01 06:27:13 UTC
ping...
Comment 40 Dean DeVries 2017-07-04 19:15:57 UTC
(In reply to Zhang Rui from comment #39)
> ping..

Trying to make time for compiling kernel.  I need to identify the absolute minimum set of modules (enough to run monitor and input device) that can be built in and have no loadable modules.  I'm guessing the "vanilla" kernel is the most basic.
Comment 41 Zhang Rui 2017-07-05 00:58:12 UTC
(In reply to Dean DeVries from comment #40)
> (In reply to Zhang Rui from comment #39)
> > ping..
> 
> Trying to make time for compiling kernel.  I need to identify the absolute
> minimum set of modules (enough to run monitor and input device) that can be
> built in and have no loadable modules.  I'm guessing the "vanilla" kernel is
> the most basic.

yes, please use the latest vanilla kernel.
Comment 42 Dean DeVries 2017-07-05 02:22:23 UTC
Created attachment 257369 [details]
kernel 4.12.0 config

Kernel 4.12.0 downloaded from kernel.org.  Config. file attached.
Comment 43 Dean DeVries 2017-07-05 02:25:29 UTC
Created attachment 257371 [details]
syslog for kernel 4.12.0 rtcwake test

syslog for boot with kernel 4.12.0.  test of "rtcwake -m freeze -s 5" starts at 20:58:44
Comment 44 Dean DeVries 2017-07-05 02:27:04 UTC
Created attachment 257373 [details]
dmesg output kernel 4.12.0
Comment 45 Dean DeVries 2017-07-05 02:31:53 UTC
I think I got the full flavored 4.12.0 kernel.  I tried to reduce the number of modules but didn't do a very good job of it.  The laptop still hung during wake up from "rtcwake -m mem -s 5".   The .config, syslog and dmesg output are attached.  

I need to find out how to get the "vanilla" 4.12.0
Comment 46 Dean DeVries 2017-07-30 16:42:40 UTC
Created attachment 257769 [details]
dmesg output with PM-Trace

4.12.0 kernel /sys/power/pm_trace=1
no module hash appears to be recorded
Comment 47 Dean DeVries 2017-07-30 16:44:26 UTC
Created attachment 257771 [details]
syslog for rtcwake with pm_trace=1

syslog from rtcwake test kernel 4.12.0
Comment 48 Dean DeVries 2017-07-30 16:50:42 UTC
Booted with 4.12.0 kernel.
The following commands were executed in sequence, as root
#rtcwake -m freeze -s 5
#echo 1> /sys/power/pm_trace
#rtcwake -m mem -s 5

edited syslog is attached as syslog_30JUL17.2 shows rtcwake test results for (freeze) and that the system time was changed, which should indicate pm_trace was active.  The laptop hung after suspending to ram and the syslog shows the subsequent reboot.

dmesg output is in file dmesg_30JUL17.2   PM_trace does not appear to have been successful since no module hash is listed (i.e "hash matches")
Comment 49 Zhang Rui 2017-07-31 00:48:14 UTC
first of all, you'd better use a larger wakeup time.
say, rtcwake -m mem -s 15

second, as you can see there is a i915 call trace during suspend to freeze, which means that it is probably not working well before suspend to mem.

please check if the problem still exists with boot option nomodeset.

if the problem still exists, please try different pm_test mode, and see if they're working well.
Comment 50 Dean DeVries 2017-08-16 03:22:08 UTC
Created attachment 257935 [details]
syslog for rtcwake -m freeze with i915 unloaded

grub configuration file to boot into text:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="text"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
Comment 51 Dean DeVries 2017-08-16 03:24:39 UTC
Created attachment 257937 [details]
rtcwake run with i915 loaded

booted with grub config:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
Comment 52 Dean DeVries 2017-08-16 03:25:58 UTC
Created attachment 257939 [details]
bash script for stepping through pm_test states

bash script used to test suspend with and without i915 module loaded.
Comment 53 Zhang Rui 2017-10-10 06:37:58 UTC
Aug 15 21:53:44 Dino_laptop kernel: [  412.245329] PM: Unsupported test mode for suspend to idle, please choose none/freezer/devices/platform

you're actually testing suspend-to-idle rather than suspend-to-RAM?

[    0.472036] ACPI: (supports S0 S3 S4 S5)

suspend-to-RAM is actually supported, so I'm confused.
please confirm the problem is about suspend-to-idle or suspend-to-RAM first.
Comment 54 Dean DeVries 2017-10-11 03:24:40 UTC
(In reply to Zhang Rui from comment #53)

> please confirm the problem is about suspend-to-idle or suspend-to-RAM first.

Issue is suspend to ram.  I execute suspend to idle to trouble shoot.  The pm_trace method for writing module info to the hardware clock during wake from suspend has not been successful.
Comment 55 Chen Yu 2017-11-06 22:53:39 UTC
Please test pm_test w/o rtcwake script, it will resume automatically after 5 second, thus we can find out at which stage it failed to suspend.
Comment 56 Chen Yu 2017-11-06 22:54:30 UTC
and please append no_console_suspend in the grub commandline.
Comment 57 Dean DeVries 2017-11-26 03:49:40 UTC
Created attachment 260869 [details]
syslog extract

s
Comment 58 Dean DeVries 2017-11-26 03:51:18 UTC
Created attachment 260871 [details]
dmesg after startup pm_trace enabled

clock reset (2015) but no driver
Comment 59 Dean DeVries 2017-11-26 03:59:15 UTC
after case of pm_test = platform, several lines shown on console during resume (lines did not show in syslog)  last line was related to ethernet card (r8169 for enp2s0 )
Comment 60 Chen Yu 2017-11-27 03:05:38 UTC
(In reply to Dean DeVries from comment #59)
> after case of pm_test = platform, several lines shown on console during
> resume (lines did not show in syslog)  last line was related to ethernet
> card (r8169 for enp2s0 )

Do you mean, in the suspend to mem pm_test case, the 'freezer', 'devices' mode works, however 'platform' failed?  
Please help do the following:
1. append 'initcall_debug no_console_suspend' in grub commandline
2. append dyndbg='file drivers/base/power/main.c +p' in grub commandline
2. use the latest upstream kernel rather than 4.10.0-40-generic
3. do not enable pm_trace.
4. disable the pm_async via:
   echo 0 > /sys/power/pm_async
5. echo platform > /sys/power/pm_test

 please provide the log as much as possible, if it failed, please take a picture 
  of the screen that we can figure out at which stage it failed.
Comment 61 Chen Yu 2017-12-11 08:11:44 UTC
SYN...
Comment 62 Chen Yu 2017-12-18 04:35:02 UTC
Closed as no response for several days. Please feel free to reopen if you encounter this issue and please provide the information suggested at #Comment 60
Comment 63 Dean DeVries 2017-12-18 23:34:57 UTC
Marking bug as invalid is not appropriate.  I haven't had a lot of time lately to spend trouble-shooting kernel modules.  It also isn't practical to install kernels outside Ubuntu or Debian installations since it imposes a lot of extra work-load on the user when the distributions update.

Suspend to Ram issues appear to be common on HP laptops.  If the bug is to be closed, the resolution might as well be not to use an HP laptop for Linux.

I have upgrade to Ubuntu 17.10 with kernel 4.13.0-19 and the suspend to ram issue is still present.  End of year happens to be a high workload period at my paying job, which limits available time for non-paying interests.

(In reply to Chen Yu from comment #62)
> Closed as no response for several days. Please feel free to reopen if you
> encounter this issue and please provide the information suggested at
> #Comment 60
Comment 64 Chen Yu 2017-12-19 00:12:09 UTC
(In reply to Dean DeVries from comment #63)
> Marking bug as invalid is not appropriate.  I haven't had a lot of time
> lately to spend trouble-shooting kernel modules.  It also isn't practical to
> install kernels outside Ubuntu or Debian installations since it imposes a
> lot of extra work-load on the user when the distributions update.
> 
> Suspend to Ram issues appear to be common on HP laptops.  If the bug is to
> be closed, the resolution might as well be not to use an HP laptop for Linux.
> 
> I have upgrade to Ubuntu 17.10 with kernel 4.13.0-19 and the suspend to ram
> issue is still present.  End of year happens to be a high workload period at
> my paying job, which limits available time for non-paying interests.
> 
> (In reply to Chen Yu from comment #62)
> > Closed as no response for several days. Please feel free to reopen if you
> > encounter this issue and please provide the information suggested at
> > #Comment 60
Okay, then let's keep it open for some time.
According to the symptom, it might fail to resume during platform resume stage, and it might be hard to debug if there's no enough log during this stage. So it is necessary to track the logs and this is why step 1 and step 2 in #Comment 60 was introduced.
Comment 65 Dean DeVries 2017-12-19 01:27:34 UTC
Created attachment 261249 [details]
syslog kernel 4.13

attached.  La/var/log/syslog attached.  See linux boot command for options.  Search for "pm_test" to get cases. Laptop hung when pm_test set to "none" manually and pm-suspend excuted. Going to try again.  No screen output after hang-up with pm_test set to none.
Comment 66 Dean DeVries 2017-12-19 03:58:01 UTC
Created attachment 261251 [details]
sys log single user

boot into single user mode.  i915 module unloaded.  Loaded moules in separate list.
Comment 67 Dean DeVries 2017-12-19 03:59:10 UTC
Created attachment 261253 [details]
loaded kernel modules pm-suspend test
Comment 68 Chen Yu 2017-12-19 04:01:40 UTC
(In reply to Dean DeVries from comment #65)
> Created attachment 261249 [details]
> syslog kernel 4.13
> 
> attached.  La/var/log/syslog attached.  See linux boot command for options. 
> Search for "pm_test" to get cases. Laptop hung when pm_test set to "none"
> manually and pm-suspend excuted. Going to try again.  No screen output after
> hang-up with pm_test set to none.

Could you describe what the symptom is when the system hung? Since the only difference between "none" and "core" is the former only added a action on pm-register and asked the system to enter S3, I would expect the "hung" here means
all the lights are off and no fan spinning, but the system just can not be woken up by pressing any button?
Comment 69 Dean DeVries 2017-12-23 01:09:24 UTC
The laptop enters the suspend state, similar to how it does when running Windows 10.  Disk stops, ethernet link goes dark, screen goes dark and power button begins to blink.  When I push the power button I hear some device spin up (assume it is hard drive since I'm not sure if HP Pavillion laptop has a fan).  The ethernet card light comes on and then nothing more happens.  If I push the CAPS LOCK key the light does NOT come on.  I can't reboot using ALT+PRTC "reisub", unlike kernel panic cases.

If I boot into single user mode (Kubuntu rescue mode) with "nomodeset" in the grub command, I can unload the i915 module along with others.  I'm assuming that a modules which is not load (i.e. does not show in lsmod) can't be blamed.  I did update the BIOS recently to eliminate that possibility.  The fact that pm_trace doesn't work makes me wonder if it is a basic kernel function that is hanging.
Comment 70 Dean DeVries 2017-12-23 02:52:13 UTC
Created attachment 261309 [details]
loaded kernel modules

kernel 4.13 boot into single user, removed most modules prior to test of pm_suspend
Comment 71 Dean DeVries 2017-12-23 02:54:10 UTC
Created attachment 261311 [details]
syslog for pm_suspend test with minimal modules

pm_suspend test with minimal loaded kernel modules (see previous attachment)

laptop failed wake when pm_test = none
Comment 72 Chen Yu 2018-01-15 02:52:17 UTC
Since all the pm_test mode work well(except for the none mode, AKA, involve the BIOS in), I suspect there should be something wrong in the BIOS when trying to jump back the the OS, maybe the flow control was blocked there. The reason why Win10 works might be that it did not enter S3 but a standy state. How about 
the suspend-to-idle performed?

1. echo N > /sys/module/printk/parameters/console_suspend
2. echo freeze > /sys/power/state
   and press any key to wakeup.
   or
   echo s2idle > /sys/power/mem_sleep
   rtcwake -m freeze -s 60
Comment 73 Dean DeVries 2018-01-16 02:18:35 UTC
Created attachment 273643 [details]
syslog for comment 71

syslog for s2idle test.  System operates normally
Comment 74 Dean DeVries 2018-01-16 02:22:54 UTC
(In reply to Chen Yu from comment #72)
> Since all the pm_test mode work well(except for the none mode, AKA, involve
> the BIOS in), I suspect there should be something wrong in the BIOS when
> trying to jump back the the OS, maybe the flow control was blocked there.
> The reason why Win10 works might be that it did not enter S3 but a standy
> state. How about 
> the suspend-to-idle performed?
> 
> 1. echo N > /sys/module/printk/parameters/console_suspend
> 2. echo freeze > /sys/power/state
>    and press any key to wakeup.
>    or
>    echo s2idle > /sys/power/mem_sleep
>    rtcwake -m freeze -s 60

All results were normal when the above tests were run.

Currently testing with kernel 4.13.  I tried to blacklist modules using fake install "install ahci /bin/true".   I can't stop ahci and libahci from loading.  The system still hangs for full suspend to ram.  Same symptoms - laptop suspends to ram and power button slowly blinks.  After pushing power button the hard drive spins up but then the kernel hangs - CAPS LOCK light does not come on and no response to ALT+PRT SC reisub.
Comment 75 Dean DeVries 2018-02-18 15:53:18 UTC
Unable to spend more time on this issue.  At this point it is more cost effective to purchase a different brand of laptop or use a different OS.

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