1

My laptop wakes up immediately after suspend (or it fails suspending? are they two different cases?). It is an old Toshiba Satellite C855D-S5105, 8Gb RAM. It has a recently installed bodhi Linux (an Ubuntu derivative, so for many many things it works the same as Ubuntu). None of the solutions I found works. The two candidates in BIOS are disabled (Wake on LAN and Wake on Keyboard). There is a touchpad too, no mouse or bluetooth receiver. Below I am posting relevant info, with sources.

$ uname -a
Linux Orion 5.4.0-107-generic #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Trying to identify candidates for the wakeup (assuming it suspends and wakes up).
Here there seem to be some devices enabled for wakeup (see this).

$ cat /proc/acpi/wakeup | grep enabled
Device  S-stateStatus   Sysfs node
OHC1      S3    *enabled   pci:0000:00:12.0       <- ?
OHC3      S3    *enabled   pci:0000:00:16.0       <- ?
EHC1      S3    *enabled   pci:0000:00:12.2       <- ?
EHC3      S3    *enabled   pci:0000:00:16.2       <- ?
LID0      S4    *enabled   platform:PNP0C0D:00    <- Lid

$ lspci | grep "00:1[2,6]."
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)
00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)
00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)

Here there seem to be no devices enabled for wakeup (source).

$ cat /sys/bus/usb/devices/*/power/wakeup
disabled
disabled
disabled
disabled
disabled
disabled
disabled    
$ ll /sys/bus/usb/devices/*/power/wakeup
-rw-r--r-- 1 root root 4,0K abr  6 07:33 /sys/bus/usb/devices/1-3/power/wakeup
-rw-r--r-- 1 root root 4,0K abr  6 07:33 /sys/bus/usb/devices/usb1/power/wakeup
-rw-r--r-- 1 root root 4,0K abr  6 07:33 /sys/bus/usb/devices/usb2/power/wakeup
-rw-r--r-- 1 root root 4,0K abr  6 07:33 /sys/bus/usb/devices/usb3/power/wakeup
-rw-r--r-- 1 root root 4,0K abr  6 07:33 /sys/bus/usb/devices/usb4/power/wakeup
-rw-r--r-- 1 root root 4,0K abr  6 07:33 /sys/bus/usb/devices/usb5/power/wakeup
-rw-r--r-- 1 root root 4,0K abr  6 07:33 /sys/bus/usb/devices/usb6/power/wakeup

Trying to identify the causes for failed suspend. It looks like there is no failure (as in here), but I am not sure it actually suspended and woke up, or it exited suspend (if they are two different things).

$ journalctl -b | grep -nH suspend
(standard input):1576:abr 06 07:28:55 Orion sudo[1196]:     root : TTY=unknown ; PWD=/home/santiago ; USER=root ; COMMAND=/usr/sbin/pm-suspend
(standard input):1578:abr 06 07:28:58 Orion kernel: PM: suspend entry (deep)
(standard input):1583:abr 06 07:29:04 Orion kernel: printk: Suspending console(s) (use no_console_suspend to debug)
(standard input):1627:abr 06 07:29:04 Orion kernel: PM: suspend exit

Adding possibly useful lines. It look like between lines 1591 and 1592 the wakeup takes place.

$ journalctl -b | grep -nH -A 40 -B 40 suspend
...
(standard input):1578:abr 06 07:28:58 Orion kernel: PM: suspend entry (deep)
(standard input)-1579-abr 06 07:28:58 Orion kernel: Filesystems sync: 0.191 seconds
(standard input)-1580-abr 06 07:29:04 Orion kernel: Freezing user space processes ... (elapsed 0.004 seconds) done.
(standard input)-1581-abr 06 07:29:04 Orion kernel: OOM killer disabled.
(standard input)-1582-abr 06 07:29:04 Orion kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
(standard input):1583:abr 06 07:29:04 Orion kernel: printk: Suspending console(s) (use no_console_suspend to debug)
(standard input)-1584-abr 06 07:29:04 Orion kernel: wlp2s0: deauthenticating from d0:6e:de:8e:25:f6 by local choice (Reason: 3=DEAUTH_LEAVING)
(standard input)-1585-abr 06 07:29:04 Orion kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
(standard input)-1586-abr 06 07:29:04 Orion kernel: sd 0:0:0:0: [sda] Stopping disk
(standard input)-1587-abr 06 07:29:04 Orion kernel: ACPI: Preparing to enter system sleep state S3
(standard input)-1588-abr 06 07:29:04 Orion kernel: PM: Saving platform NVS memory
(standard input)-1589-abr 06 07:29:04 Orion kernel: Disabling non-boot CPUs ...
(standard input)-1590-abr 06 07:29:04 Orion kernel: IRQ 30: no longer affine to CPU1
(standard input)-1591-abr 06 07:29:04 Orion kernel: smpboot: CPU 1 is now offline
(standard input)-1592-abr 06 07:29:04 Orion kernel: ACPI: Low-level resume complete
(standard input)-1593-abr 06 07:29:04 Orion kernel: PM: Restoring platform NVS memory
(standard input)-1594-abr 06 07:29:04 Orion kernel: LVT offset 0 assigned for vector 0x400
(standard input)-1595-abr 06 07:29:04 Orion kernel: microcode: reload patch_level=0x05000119
(standard input)-1596-abr 06 07:29:04 Orion kernel: Enabling non-boot CPUs ...
(standard input)-1597-abr 06 07:29:04 Orion kernel: x86: Booting SMP configuration:
(standard input)-1598-abr 06 07:29:04 Orion kernel: smpboot: Booting Node 0 Processor 1 APIC 0x1
(standard input)-1599-abr 06 07:29:04 Orion kernel: microcode: CPU1: patch_level=0x05000119
(standard input)-1600-abr 06 07:29:04 Orion kernel: CPU1 is up
(standard input)-1601-abr 06 07:29:04 Orion kernel: ACPI: Waking up from system sleep state S3
(standard input)-1602-abr 06 07:29:04 Orion kernel: [drm] Found smc ucode version: 0x00010601
(standard input)-1603-abr 06 07:29:04 Orion kernel: rtlwifi: rtlwifi: wireless switch is on
(standard input)-1604-abr 06 07:29:04 Orion kernel: [drm] PCIE GART of 1024M enabled (table at 0x0000000000162000).
(standard input)-1605-abr 06 07:29:04 Orion kernel: radeon 0000:00:01.0: WB enabled
...

There are no Nvidia drivers as in here. The graphics card is an ATI Radeon.

$ dpkg -l | grep nvidia
ii  bodhi-background-invidia              0.01                                all          Bodhi Sunshine Invidia

Related

  1. https://bbs.archlinux.org/viewtopic.php?id=263268
2
  • This kernel is terribly outdated. Please try 5.17.1 - if you can still reproduce it, file a bug report at bugzilla.kernel.org Make absolutely sure you have the latest BIOS version installed. Apr 6, 2022 at 12:15
  • @ArtemS.Tashkinov - I know it is old. It is always healthy to be up to date on this. But this is the latest in repo (I still have to dig a little about HWE in Bodhi). I would avoid compiling the kernel myself, if possible. I would also avoid updating BIOS, if possible. And I posted an answer where I worked around the problem, so it is in fact possible. Apr 6, 2022 at 13:37

2 Answers 2

1

I managed to avoid the wakeup, with the following. I put together a script disable_devices_from_wakeup.sh with the following contents (inspired by this)

#!/bin/bash

declare -a devices=(EHC1 EHC3 OHC1 OHC3)
for device in "${devices[@]}" ; do
    sudo sh -c "echo $device > /proc/acpi/wakeup"
done

set it to executable, and ran it. Now I have all 4 devices as disabled, and the laptop only wakes up with the lid or power button. So without knowing exactly the device/s responsible for the wake up, the problem went away.

On further testing, any of the 4 devices alone in an enabled state is enough for preventing suspend. This looks strange to me, but I didn't take the time to understand each one separately.

ToDos:

  1. Make the change permanent. This is the related question.
0

Many answers to this problem disable specific devices for waking the PC from suspend, but invariably new devices, updates, and other stuff happens and the problem comes back. Instead, this script disables every device for waking the PC from sleep other than the lid (LID) and the sleep button (SLPB):

#! /bin/bash
case $1 in
    pre)
        declare -a keep_devices=(SLPB LID) # <-- Add entries to keep activated here
        # Get the currently active devices in 
        readarray -t enabled_devices < <( grep enabled /proc/acpi/wakeup | awk '{print $1}' )
        # if it's enabled and not in our whitelist, disable it
        for device in "${enabled_devices[@]}"; do
            if [[ ! " ${keep_devices[*]} " =~ " ${device} " ]]; then
                echo ${device} > /proc/acpi/wakeup
            fi
        done
    ;;
esac

Following the advice here for Ubuntu, I copied this script to be run when sleep starts:

sudo cp disable-wakeup-devices /usr/lib/systemd/system-sleep/
sudo chmod 755 /usr/lib/systemd/system-sleep/disable-wakeup-devices

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .