7

Waking up from

$ sudo pm-suspend

results in anomalous behaviour depending on whether the laptop in connected to external power.

The following scenarios have been tested to be reproducible:

  1. Suspend while on AC power, wake up. Result: normal resumption.
  2. Suspend while on battery power, wake up. Result: full restart.
  3. Suspend while on AC power, disconnect AC power, wake up. Result: full restart.
  4. Suspend while on AC power, disconnect AC power, reconnect AC power, wake up. Result: full restart.
  5. Suspend while on battery power, connect AC power, wake up. Result: full restart.

EDIT 1: the 'full restart' does not follow a clean shut down, as evidenced by fsck running during start up, etc. I don't believe this is intended behaviour.

Can you, kind Internet, please help diagnose this problem?

Basic debug information is below. Please let me know what further debug information I can provide.

System: Ubuntu 16.04 LTS
Machine: Asus K501UX
Video Driver: xserver-xorg-video-nouveau
Video Card: NVIDIA GeForce GTX 950M

(Using proprietary nvidia drivers results in a blank screen after the driver is loaded.)

$ uname -a
Linux robyn-xenail 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Screenshots of Brightness settings and Power settings.

Two more bits of info:

  1. This problem did not used to exist. It is unclear to me what caused its onset. Loading Linux kernel version 4.2.0-27 (oldest I have installed currently) does not solve the problem.
  2. I don't suspect it is an issue with the suspend process initiated by pm-suspend, but rather to do with some power settings (acpi, etc). I have attached the log (/var/log/pm-suspend.log.1) for one instance of CASE 1 above. For all other cases, the log is identical (modulo timestamps, etc) down to the line

    Wed Feb 15 22:38:12 EST 2017: performing suspend

    , and the rest of the log is missing, i.e. the machine never comes 'awake', but rather restarts.

*** begin log file:

Initial commandline parameters:     
Wed Feb 15 22:38:11 EST 2017: Running hooks for suspend.    
Running hook /usr/lib/pm-utils/sleep.d/000kernel-change suspend suspend:    
/usr/lib/pm-utils/sleep.d/000kernel-change suspend suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/000record-status suspend suspend:    
/usr/lib/pm-utils/sleep.d/000record-status suspend suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/00logging suspend suspend:    
Linux robyn-xenial 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux    
Module                  Size  Used by    
drbg                   32768  1    
ansi_cprng             16384  0    
ctr                    16384  1    
ccm                    20480  1    
rfcomm                 69632  0    
bbswitch               16384  0    
bnep                   20480  2    
binfmt_misc            20480  1    
nls_iso8859_1          16384  1    
joydev                 20480  0    
i2c_designware_platform    16384  0    
i2c_designware_core    20480  1 i2c_designware_platform    
asus_nb_wmi            24576  0    
asus_wmi               28672  1 asus_nb_wmi    
sparse_keymap          16384  1 asus_wmi    
uvcvideo               90112  0    
arc4                   16384  2    
intel_rapl             20480  0    
videobuf2_vmalloc      16384  1 uvcvideo    
videobuf2_memops       16384  1 videobuf2_vmalloc    
videobuf2_v4l2         28672  1 uvcvideo    
x86_pkg_temp_thermal    16384  0    
intel_powerclamp       16384  0    
iwlmvm                311296  0    
coretemp               16384  0    
videobuf2_core         36864  2 uvcvideo,videobuf2_v4l2    
snd_soc_skl            49152  0    
snd_soc_skl_ipc        32768  1 snd_soc_skl    
snd_hda_ext_core       28672  1 snd_soc_skl    
snd_soc_sst_ipc        16384  1 snd_soc_skl_ipc    
mac80211              737280  1 iwlmvm    
snd_soc_sst_dsp        53248  1 snd_soc_skl_ipc    
snd_soc_core          212992  1 snd_soc_skl    
v4l2_common            16384  1 videobuf2_v4l2    
snd_compress           20480  1 snd_soc_core    
kvm_intel             172032  0    
ac97_bus               16384  1 snd_soc_core    
snd_hda_codec_hdmi     53248  1    
kvm                   540672  1 kvm_intel    
snd_pcm_dmaengine      16384  1 snd_soc_core    
snd_hda_codec_conexant    24576  1    
snd_hda_codec_generic    77824  1 snd_hda_codec_conexant    
videodev              176128  4 uvcvideo,v4l2_common,videobuf2_core,videobuf2_v4l2    
irqbypass              16384  1 kvm    
dw_dmac_core           24576  1 snd_soc_sst_dsp    
crct10dif_pclmul       16384  0    
crc32_pclmul           16384  0    
ghash_clmulni_intel    16384  0    
aesni_intel           167936  2    
media                  24576  2 uvcvideo,videodev    
snd_hda_intel          40960  3    
aes_x86_64             20480  1 aesni_intel    
snd_hda_codec         135168  4 snd_hda_codec_hdmi,snd_hda_codec_conexant,snd_hda_codec_generic,snd_hda_intel    
lrw                    16384  1 aesni_intel    
gf128mul               16384  1 lrw    
iwlwifi               200704  1 iwlmvm    
snd_hda_core           73728  7 snd_hda_ext_core,snd_hda_codec_hdmi,snd_hda_codec_conexant,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_soc_skl    
snd_hwdep              16384  1 snd_hda_codec    
glue_helper            16384  1 aesni_intel    
btusb                  45056  0    
hci_uart               77824  0    
snd_pcm               106496  8 snd_hda_ext_core,snd_soc_core,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_soc_skl,snd_pcm_dmaengine,snd_hda_core    
btrtl                  16384  1 btusb    
snd_seq_midi           16384  0    
snd_seq_midi_event     16384  1 snd_seq_midi    
snd_rawmidi            32768  1 snd_seq_midi    
btbcm                  16384  2 btusb,hci_uart    
btqca                  16384  1 hci_uart    
snd_seq                69632  2 snd_seq_midi_event,snd_seq_midi    
snd_seq_device         16384  3 snd_seq,snd_rawmidi,snd_seq_midi    
ablk_helper            16384  1 aesni_intel    
snd_timer              32768  2 snd_pcm,snd_seq    
cfg80211              565248  3 iwlwifi,mac80211,iwlmvm    
snd                    81920  19 snd_soc_core,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_hda_codec_conexant,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_seq_device,snd_compress    
mei_me                 36864  0    
btintel                16384  2 btusb,hci_uart    
input_leds             16384  0    
cryptd                 20480  3 ghash_clmulni_intel,aesni_intel,ablk_helper    
soundcore              16384  1 snd    
bluetooth             520192  31 bnep,btbcm,btqca,btrtl,btusb,hci_uart,rfcomm,btintel    
mei                    98304  1 mei_me    
elan_i2c               36864  0    
serio_raw              16384  0    
shpchp                 36864  0    
idma64                 20480  0    
virt_dma               16384  1 idma64    
processor_thermal_device    16384  0    
intel_lpss_pci         16384  0    
intel_soc_dts_iosf     16384  1 processor_thermal_device    
int3403_thermal        16384  0    
tpm_crb                16384  0    
intel_lpss_acpi        16384  0    
intel_lpss             16384  2 intel_lpss_pci,intel_lpss_acpi    
int3402_thermal        16384  0    
int3400_thermal        16384  0    
mac_hid                16384  0    
acpi_thermal_rel       16384  1 int3400_thermal    
int340x_thermal_zone    16384  3 int3402_thermal,processor_thermal_device,int3403_thermal    
acpi_pad               24576  0    
parport_pc             32768  0    
ppdev                  20480  0    
lp                     20480  0    
parport                49152  3 lp,ppdev,parport_pc    
autofs4                40960  2    
hid_generic            16384  0    
usbhid                 49152  0    
mxm_wmi                16384  0    
i915_bpo             1302528  5    
intel_ips              20480  1 i915_bpo    
i2c_algo_bit           16384  1 i915_bpo    
drm_kms_helper        155648  1 i915_bpo    
syscopyarea            16384  1 drm_kms_helper    
sysfillrect            16384  1 drm_kms_helper    
sysimgblt              16384  1 drm_kms_helper    
fb_sys_fops            16384  1 drm_kms_helper    
drm                   364544  6 i915_bpo,drm_kms_helper    
r8169                  81920  0    
ahci                   36864  4    
libahci                32768  1 ahci    
mii                    16384  1 r8169    
i2c_hid                20480  0    
hid                   118784  3 i2c_hid,hid_generic,usbhid    
wmi                    20480  2 mxm_wmi,asus_wmi    
pinctrl_sunrisepoint    28672  0    
pinctrl_intel          20480  1 pinctrl_sunrisepoint    
video                  40960  2 i915_bpo,asus_wmi    
fjes                   28672  0    
              total        used        free      shared  buff/cache   available    
Mem:       12193548     1565912     8941824      423648     1685812     9866024    
Swap:      26214396           0    26214396    
/usr/lib/pm-utils/sleep.d/00logging suspend suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/00powersave suspend suspend:    
/usr/lib/pm-utils/sleep.d/00powersave suspend suspend: success.    

Running hook /etc/pm/sleep.d/10_grub-common suspend suspend:    
/etc/pm/sleep.d/10_grub-common suspend suspend: success.    

Running hook /etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend:    
/etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/40inputattach suspend suspend:    
/usr/lib/pm-utils/sleep.d/40inputattach suspend suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/50unload_alx suspend suspend:    
/usr/lib/pm-utils/sleep.d/50unload_alx suspend suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend:    
Selected interface 'p2p-dev-wlan0'    
OK    
/usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/75modules suspend suspend:    
/usr/lib/pm-utils/sleep.d/75modules suspend suspend: not applicable.    

Running hook /usr/lib/pm-utils/sleep.d/90clock suspend suspend:    
/usr/lib/pm-utils/sleep.d/90clock suspend suspend: not applicable.    

Running hook /usr/lib/pm-utils/sleep.d/94cpufreq suspend suspend:    
/usr/lib/pm-utils/sleep.d/94cpufreq suspend suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/95anacron suspend suspend:    
/usr/lib/pm-utils/sleep.d/95anacron suspend suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/95hdparm-apm suspend suspend:    
/usr/lib/pm-utils/sleep.d/95hdparm-apm suspend suspend: not applicable.    

Running hook /usr/lib/pm-utils/sleep.d/95led suspend suspend:    
/usr/lib/pm-utils/sleep.d/95led suspend suspend: not applicable.    

Running hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler suspend suspend:    
Kernel modesetting video driver detected, not using quirks.    
/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler suspend suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/99video suspend suspend:    
kernel.acpi_video_flags = 0    
/usr/lib/pm-utils/sleep.d/99video suspend suspend: success.    

Running hook /etc/pm/sleep.d/novatel_3g_suspend suspend suspend:    
/etc/pm/sleep.d/novatel_3g_suspend suspend suspend: success.    

Wed Feb 15 22:38:12 EST 2017: performing suspend    
Wed Feb 15 22:38:18 EST 2017: Awake.    
Wed Feb 15 22:38:18 EST 2017: Running hooks for resume    
Running hook /etc/pm/sleep.d/novatel_3g_suspend resume suspend:    
/etc/pm/sleep.d/novatel_3g_suspend resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/99video resume suspend:    
/usr/lib/pm-utils/sleep.d/99video resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler resume suspend:    
/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/95led resume suspend:    
/usr/lib/pm-utils/sleep.d/95led resume suspend: not applicable.    

Running hook /usr/lib/pm-utils/sleep.d/95hdparm-apm resume suspend:    

/dev/sda:    
 setting Advanced Power Management level to 0xfe (254)    
 APM_level  = 254    
/usr/lib/pm-utils/sleep.d/95hdparm-apm resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/95anacron resume suspend:    
/usr/lib/pm-utils/sleep.d/95anacron resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/94cpufreq resume suspend:    
/usr/lib/pm-utils/sleep.d/94cpufreq resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/90clock resume suspend:    
/usr/lib/pm-utils/sleep.d/90clock resume suspend: not applicable.    

Running hook /usr/lib/pm-utils/sleep.d/75modules resume suspend:    
Reloaded unloaded modules.    
/usr/lib/pm-utils/sleep.d/75modules resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant resume suspend:    
Selected interface 'p2p-dev-wlan0'    
OK    
/usr/lib/pm-utils/sleep.d/60_wpa_supplicant resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/50unload_alx resume suspend:    
/usr/lib/pm-utils/sleep.d/50unload_alx resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/40inputattach resume suspend:    
/usr/lib/pm-utils/sleep.d/40inputattach resume suspend: success.    

Running hook /etc/pm/sleep.d/10_unattended-upgrades-hibernate resume suspend:    
/etc/pm/sleep.d/10_unattended-upgrades-hibernate resume suspend: success.    

Running hook /etc/pm/sleep.d/10_grub-common resume suspend:    
/etc/pm/sleep.d/10_grub-common resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/00powersave resume suspend:    
/usr/lib/pm-utils/sleep.d/00powersave resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/00logging resume suspend:    
/usr/lib/pm-utils/sleep.d/00logging resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/000record-status resume suspend:    
/usr/lib/pm-utils/sleep.d/000record-status resume suspend: success.    

Running hook /usr/lib/pm-utils/sleep.d/000kernel-change resume suspend:    
/usr/lib/pm-utils/sleep.d/000kernel-change resume suspend: success.    

Wed Feb 15 22:38:19 EST 2017: Finished.
Kaveh Gharavi
  • 87
  • 1
  • 6
  • Are you sure this isn't the intended behavior of whatever power manager you're using? Shutting down the computer if at any point AC is unavailable seems like a plausible behavior. – Catherine Holloway Feb 16 '17 at 20:08
  • What does your power.d file look like? – Catherine Holloway Feb 16 '17 at 20:10
  • @CatherineHolloway I don't believe it is intended behaviour b/c 1. the restart doesn't follow a clean shut down, and 2. this behavior didn't used to occur, and takes a away useful functionality. /etc/pm/power.d is an empty directory. /usr/lib/pm-utils/power.d contains the following files. Which one should I post? 95hdparm-apm disable_wol laptop-mode pcie_aspm sched-powersave wireless anacron intel-audio-powersave pci_devices sata_alpm usb_bluetooth xfs_buffer – Kaveh Gharavi Feb 16 '17 at 20:23

3 Answers3

1

I had similar problem. Everything was fine but suddenly, when I suspended my laptop (buy closing the lid or via menu), it was going to sleep mode with led blinking, but when I woke the laptop, it restarted as it was shutdown.

Laptop ASUS ZenBook UX305

Linux 4.13.0-38-generic #43~16.04.1-Ubuntu SMP x86_64

I tried many things, and no result, but one time I switch to TTY1 with Ctrl+Alt+F1 and logged in, and exited. After that it is working again.

Also I set the following setting in "sudo vim /etc/default/grub" :

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_sleep=nonvs intel_pstate=disable"

but it was not working before TTY1.

The things that was changing before the problem was :

  • I forgot my charger, and I used a different charger, the original is 19 volts but the one I used was 20 volts.
  • One time the laptop hanged during suspend process, so I did hard restart by pressing and holding the power button.
  • Recently, I updated the system with "Software Updater"

I thought it might help some one.

Developer Guy
  • 2,318
  • 6
  • 19
  • 37
karianpour
  • 704
  • 5
  • 15
  • this helped me. when I tried `sudo vim /etc/default/grub` the system alerted me that there is .swp file ( like it was editing by some other app which might be exited un-expectedly ) and there was an option to recover. I recovered it. Then I did TTY1 login and exit. Then I restarted. After that I could go to suspend and back normally. – karianpour Dec 02 '18 at 14:31
  • It happened again for me, and this time I this process did not work until I shutdown (no restart) and unplugged from AC and plugged again and started. Then it could wake from sleep mode. – karianpour Feb 15 '19 at 06:34
1

I ran down a similar problem. Everything was fine but suddenly, I was not able to suspend my laptop via closing the lid. So every time I had to suspend it using the menu, but waking it up doesn't work, it always requires a restart.

Laptop: Dell Inspiron 15-3567
kernel: 5.4.0-42-generic x64_86

I tried various things what worked for me was changing the file

sudo nano /etc/default/grub

changing the line to this

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
  • To clarify, acpi_backlight=vendor is the important kernel option here, right? B/c quite and splash are commonly used. – Kaveh Gharavi Aug 28 '20 at 15:12
  • 1
    acpi_backlight= [HW,ACPI] { vendor | video | native | none }, If set to vendor, prefer vendor-specific driver (e.g. thinkpad_acpi, sony_acpi, etc.) instead of the ACPI video.ko driver. If set to video, use the ACPI video.ko driver. If set to native, use the device's native backlight mode. If set to none, disable the ACPI backlight interface. Since I was facing the brightness issue too I tried to switch drivers to vendor-specific driver, which did the job. – Chirag Gandhi Aug 28 '20 at 22:20
0

Potential solution: I suspected this behaviour is brought about by the power manager. Using dconf-editor, changing the schema

org.gnome.settings-daemon.plugins.power.critical-battery-action

from 'shut down' to 'suspend' appears to have served as a potential solution/workaround. Wake-up from all of the cases above result in normal resumption, as far as my experimentation can tell.

I suspect interruption of the AC power results in an erroneous 'battery critical' message from the on-board controller, for an unknown reason. It is possible that due to degradation of the battery over time, the voltage drops below a certain threshold just as the AC power is removed before recovering to an acceptable value.

Kaveh Gharavi
  • 87
  • 1
  • 6
  • 1
    Not sure why you got downvoted. But i can confirm there is something to your answer. My laptop does this ONLY when the cpu frequency governor is set to powersave (and using pstate). If im using the performance governor (or connecting the charger before waking the laptop), i dont have this issue. – Bruce Jan 03 '19 at 18:14
  • If you please clarify how you modify the state of the cpu gov., I'll see if I can reproduce this. (Two years after the original question, I still haven't found a satisfactory explanation.) – Kaveh Gharavi Jan 07 '19 at 00:55
  • 1
    Sorry for the delay. I use cpupower on the command line. Just running "cpupower frequency-info" you will get the current state, and in my case, i just change it manually. I switch to performance using "cpupower frequency-set -g performance" most of the time, and change it to powersave to maximize battery power. (havent gotten around trying using old frequency scaling yet) – Bruce Jan 24 '19 at 18:08
  • Thanks for the detailed info! I have determined that my issue is independent of the cpu frequency governor state. *sigh* – Kaveh Gharavi Feb 09 '19 at 12:13