linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.48k stars 728 forks source link

Laptop not responsive when resuming from suspend #9554

Open Redsandro opened 4 years ago

Redsandro commented 4 years ago
 * Linux Mint 20 Cinnamon 4.6.7 64 bit

System Info

Issue

My Lenovo ThinkPad Yoga X1 laptop is not responsive when resuming from suspend. The mouse cursor moves, but I cannot click anything.

Steps to reproduce

This only happens when I close my laptop and it automatically suspends. If I go to the Mint Menu, choose Quit, and click Suspend before closing the laptop, everything works fine on resume.

Other information

The function keys still work, so I go to a TTY using Ctrl + Alt + F2, login, and type the following to continue using the laptop:

sudo service lightdm restart && exit

The problem is of course that I lose all the open apps and unsaved work.

This issue was introduced when upgrading Linux Mint 19.3 to Linux Mint 20.

h3k4t3 commented 4 years ago

Hi, if you want to not lose opened tabs try to use this in tty (after check w) cinnamon --replace --cluster-display=:0 2> /dev/null & Than go to tty7, where probably you have started session, and use shortcut alt+ctrl+esc (or alt+f2 and write r) to restart cinnamon again. Otherwise you would have problem with root privileges.

I've been trying to solve this problem permanently couple of hours but without any better result. (Clear Mint 20 install)

Possible solution is to change lightdm to other display manager.

Redsandro commented 4 years ago

Thanks @h3k4t3 I will try this workaround next time this occurs. For now I (try to remember to) manually suspend before closing the laptop.

cdeegz commented 3 years ago

If I am not mistaken, this is the same symptom as described in cinnamon-screensaver (https://github.com/linuxmint/cinnamon-screensaver/issues/342) and cinnamon #9414, neither of which are properly resolved imo, despite the latter being closed. My gut tells me the mentions of ecryptfs-utils are a red herring as I suspect the addition or removal of that package may trigger some other reconfiguration that rectifies or masks the primary cause.

The issue is that the lock screen upon wake is simply not rendering the password dialog, and the workaround is to pretend it is working fine and just type your password and hit enter to login! Your work will all be there.

I do acknowledge that it is frightening to blindly type your password in not knowing if you are accidentally typing it into a chat window or google search etc! But in theory the computer is on lock screen, which is what is surfacing this bug in the first place.

I don't know enough about cinnamon to know if this issue belongs with cinnamon-screensaver or cinnamon itself, but I can tell you that the problem still exists on my bullseye system with cinnamon 4.6.7-1 and cinnamon-screensaver 4.6.0-2

Redsandro commented 3 years ago

This could be caused by ecryptfs-utils? I'm not even using that. It's very outdated and relatively easy to hack because of the flawed and salt-less implementation.

I understand Linux Mint wants to bring non-full-disk-encryption back because many users (including me) want it. But the way to do that is not by going backwards, not by bringing back an outdated written off previously compromised encryption scheme that has default brute force templates in John the Ripper brute force apps. The real solution is to go forward, to implement a new cryptographically sound and maintained solution like fscrypt.

I'm not sure this is indeed related to ecryptfs-utils because I'm not using it, but I will check out if there is a difference without the package next time.

claudiux commented 3 years ago

Are you sure that all modules are correctly reloaded after suspend?

Try that:

  1. Before closing your laptop, open a terminal and type: lsmod > lsmod-ok.txt.
  2. Close your laptop, wait some dozens of seconds, then re-open it.
  3. Use ctrl-alt-F2 to open tty2, log in then type: lsmod > lsmod-bad.txt.
  4. Use the workaround of @h3k4t3 ( https://github.com/linuxmint/cinnamon/issues/9554#issuecomment-687873110 ).
  5. Compare the contents of lsmod-ok.txt and lsmod-bad.txt (with meld).

If there are any differences in these files, please report them here.

Redsandro commented 3 years ago

If there are any differences in these files, please report them here.

I just tried this out. When I experience the issue, there are no differences in these files (except for some pids).

The following dmesg might not be related but I see some errors so posting for brevity.

[ 7066.912199] ACPI: Waking up from system sleep state S3
[ 7068.002489] OOM killer enabled.
[ 7068.002490] Restarting tasks ... 
[ 7101.425755] pci 0000:06:00.0: BAR 13: no space for [io  size 0x4000]
[ 7101.425756] pci 0000:06:00.0: BAR 13: failed to assign [io  size 0x4000]
[ 7101.425758] pci 0000:06:00.0: BAR 13: no space for [io  size 0x4000]
[ 7101.425759] pci 0000:06:00.0: BAR 13: failed to assign [io  size 0x4000]
[ 7101.425763] pci 0000:07:02.0: BAR 15: no space for [mem size 0x00200000 64bit pref]
[ 7101.425765] pci 0000:07:02.0: BAR 15: failed to assign [mem size 0x00200000 64bit pref]
[ 7101.428920] xhci_hcd 0000:3c:00.0: xHCI Host Controller
[ 7101.428925] xhci_hcd 0000:3c:00.0: new USB bus registered, assigned bus number 3
[ 7101.430047] xhci_hcd 0000:3c:00.0: hcc params 0x200077c1 hci version 0x110 quirks 0x0000000200009810
[ 7142.678787] xhci_hcd 0000:3c:00.0: Refused to change power state, currently in D3
[ 7142.754678] xhci_hcd 0000:3c:00.0: Refused to change power state, currently in D3
[ 7142.754694] xhci_hcd 0000:3c:00.0: Controller not ready at resume -19
[ 7142.754695] xhci_hcd 0000:3c:00.0: PCI post-resume error -19!
[ 7142.754698] xhci_hcd 0000:3c:00.0: HC died; cleaning up
[ 7142.755245] xhci_hcd 0000:3c:00.0: Host halt failed, -19
[ 7142.755247] xhci_hcd 0000:3c:00.0: Host not accessible, reset failed.
claudiux commented 3 years ago

@Redsandro Is there an option Power Off Energy Saving in your Bios? If yes, then try to set it to 'Disabled'.

If you want to disable the lid button, then edit /etc/UPower/UPower.conf and change the line IgnoreLid=false to IgnoreLid=true. Reboot your laptop.

EDIT: Also, take a look to the /etc/default/acpi-support configuration file.

Redsandro commented 3 years ago

@Redsandro Is there an option Power Off Energy Saving in your Bios? If yes, then try to set it to 'Disabled'.

I have to check this. But what does it do? Because suspend worked fine in Mint 19, and I haven't changed any BIOS options when installing Mint 20.

EDIT: Also, take a look to the /etc/default/acpi-support configuration file.

Skipping commented defaults, I have:

SUSPEND_METHODS="dbus-pm dbus-hal pm-utils"
ACPI_SLEEP=true
ACPI_HIBERNATE=true
ACPI_SLEEP_MODE=mem
SAVE_VBE_STATE=true
VBESTATE=/var/lib/acpi-support/vbestate
POST_VIDEO=true
USE_DPMS=true
HIBERNATE_MODE=shutdown
LOCK_SCREEN=true
RESTART_IRDA=false
SKIP_INTERFACES="dummy qemu"
claudiux commented 3 years ago

What does it do?

I've read in some documentation that when this option is set to “Enabled”, waking up from sleep can be problematic.

I have the same /etc/default/acpi-support. I have these two more lines, but it won't do anything more in your case:

MODULES=""
MODULES_WHITELIST=""

Which of these commands put your laptop to sleep? (Save your work before using them!)

  1. dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
  2. systemctl suspend
nickstock commented 3 years ago

My xps 13 does this some times, I have found that when opened my desktop is visible (all opened apps are hidden) but no password entry is shown, I have found that after typing a few chars I stop entering my pass as its not displayed. If i then tap the power button the password dialog appears and records an invalid password attempt, I can then log in and get a shutdown ?yes no dialog, so I click cancel and resume as normal. perhaps just fully typing my password into nothing might just work.

GopherJ commented 3 years ago

I'm experiencing this in my HW matebook x pro kernel 5.4.0-60, any news on this?

mondalaci commented 3 years ago

My Ryzen-Nvidia PC is unresponsive quite often after I wake it up from sleep and enter my password. On such occasions, the mouse pointer moves, but the UI is extremely sluggish to react.

Hitting Alt+F2, then typing "r" recovers it, but the quickest recovery method is simply switching to a virtual terminal with Ctrl+Alt+F1 and switching back to X with Ctrl+Alt+F7.