LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Laptop Won't Wake From Suspend (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/laptop-wont-wake-from-suspend-4175730794/)

will41 11-11-2023 05:30 PM

Laptop Won't Wake From Suspend
 
I am working with an Lenovo Ideapad C940 Yoga. It has a 512gb ssd, 16gb mem and i7 intel processor. It dual boots with Win 10 and Fedora 38 Cinnamon with standard ext4 partitions including /, /home, /swap.

Following is some information generated by lsblk:

Code:

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
zram0      252:0    0    8G  0 disk [SWAP]
nvme0n1    259:0    0 476.9G  0 disk
├─nvme0n1p1 259:1    0  260M  0 part
├─nvme0n1p2 259:2    0    16M  0 part
├─nvme0n1p3 259:3    0  118G  0 part
├─nvme0n1p4 259:4    0  1000M  0 part
├─nvme0n1p5 259:5    0  250M  0 part /boot/efi
├─nvme0n1p6 259:6    0 254.4G  0 part /home
├─nvme0n1p7 259:7    0  93.1G  0 part /
└─nvme0n1p8 259:8    0    10G  0 part [SWAP]
nvme1n1    259:9    0  27.3G  0 disk
└─nvme1n1p1 259:10  0  27.3G  0 part

Following is information from /sbin/lspci:

Code:

bash-5.2$ /sbin/lspci
00:00.0 Host bridge: Intel Corporation Ice Lake-LP Processor Host Bridge/DRAM Registers (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Iris Plus Graphics G7 (rev 07)
00:04.0 Signal processing controller: Intel Corporation Processor Power and Thermal Controller (rev 03)
00:07.0 PCI bridge: Intel Corporation Ice Lake Thunderbolt 3 PCI Express Root Port #0 (rev 03)
00:07.1 PCI bridge: Intel Corporation Ice Lake Thunderbolt 3 PCI Express Root Port #1 (rev 03)
00:0d.0 USB controller: Intel Corporation Ice Lake Thunderbolt 3 USB Controller (rev 03)
00:0d.2 System peripheral: Intel Corporation Ice Lake Thunderbolt 3 NHI #0 (rev 03)
00:12.0 Serial controller: Intel Corporation Ice Lake-LP Integrated Sensor Solution (rev 30)
00:14.0 USB controller: Intel Corporation Ice Lake-LP USB 3.1 xHCI Host Controller (rev 30)
00:14.2 RAM memory: Intel Corporation Ice Lake-LP DRAM Controller (rev 30)
00:14.3 Network controller: Intel Corporation Ice Lake-LP PCH CNVi WiFi (rev 30)
00:15.0 Serial bus controller: Intel Corporation Ice Lake-LP Serial IO I2C Controller #0 (rev 30)
00:15.1 Serial bus controller: Intel Corporation Ice Lake-LP Serial IO I2C Controller #1 (rev 30)
00:15.2 Serial bus controller: Intel Corporation Ice Lake-LP Serial IO I2C Controller #2 (rev 30)
00:16.0 Communication controller: Intel Corporation Ice Lake-LP Management Engine (rev 30)
00:17.0 RAID bus controller: Intel Corporation 82801 Mobile SATA Controller [RAID mode] (rev 30)
00:1d.0 PCI bridge: Intel Corporation Ice Lake-LP PCI Express Root Port #9 (rev 30)
00:1d.2 PCI bridge: Intel Corporation Device 34b2 (rev 30)
00:1f.0 ISA bridge: Intel Corporation Ice Lake-LP LPC Controller (rev 30)
00:1f.3 Multimedia audio controller: Intel Corporation Ice Lake-LP Smart Sound Technology Audio Controller (rev 30)
00:1f.4 SMBus: Intel Corporation Ice Lake-LP SMBus Controller (rev 30)
00:1f.5 Serial bus controller: Intel Corporation Ice Lake-LP SPI Controller (rev 30)
55:00.0 Non-Volatile memory controller: Intel Corporation Optane NVME SSD H10 with Solid State Storage [Teton Glacier] (rev 03)
56:00.0 Non-Volatile memory controller: Intel Corporation Optane NVME SSD H10 with Solid State Storage [Teton Glacier]
bash-5.2$

The Optane NVME has been disabled in the BIOS.

I am trying to correct two seemingly related problems. Under mem_sleep=s2idle, power use during sleep (suspend) is in the range of 6% per hour. Attempting to correct that, I have changed to mem_sleep=deep (see GRUB_CMDLINE entry below):

After inserting the GRUB-CMDLINE statement into /etc/default/grub, I ran:
sudo grub2-mkconfig -o /etc/grub2-efi.cfg
and then re-booted

GRUB currently looks like this:

Code:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
# GRUB_CMDLINE_LINUX="rhgb quiet"
# GRUB_CMDLINE_LINUX="resume=UUID=47fd7e34-a729-49e2-97f0-a1c8b0acc75f rhgb quiet"
# GRUB_CMDLINE_LINUX="resume=UUID=47fd7e34-a729-49e2-97f0-a1c8b0acc75f"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mem_sleep_default=deep"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

mem_sleep now looks like this:

Code:

cat /sys/power/mem_sleep
s2idle [deep]

At this point, I cannot confirm that this solved the problem because now, when I close the lid to suspend or run "systemctl suspend", it appears to suspend but it will not wake up. The only way I’ve found to “wake it” is to hold the start button to re-set the system and then re-boot by clicking it again. Searching for a solution, I found suggestions to add the location of the “swap” partition for saving and recovering data for the suspend operation. As you see I have 3 commented out lines trying different syntax attempts; none of which work.

When installing F38, I understood that a swap partition is required for suspend or hibernate and for 12-16 gb of memory, about 10gb is satisfactory. I’m not sure this is correct, nor am I sure that having a swap partition and zram at the same time is proper.

I have run the command “journal -b” following a lid closure and re-boot. I’ve looked for clues toward the end of the file as to what is going on but there are thousands of lines which mean little to me. I see nothing regarding "suspend" in that timeframe. I can provide a copy of as many lines as might be useful to you but I will need some guidance as to what to look for.

I found on this suggestion on this forum from a year ago:
"Briefly, the issue was caused by problems with ASPM resulting in the system not being able to properly wake up the SSD after suspend. To fix, "pcie_aspm=off" was added to the kernel parameters in order to explicitly disable ASPM."
It does not explain how to do this and I would be going blind and dumb to proceed on my own. So, I would like some advice on this before proceeding.

Any advice would be appreciated.

jailbait 11-11-2023 06:30 PM

Quote:

Originally Posted by will41 (Post 6464233)
When installing F38, I understood that a swap partition is required for suspend or hibernate and for 12-16 gb of memory, about 10gb is satisfactory. I’m not sure this is correct, nor am I sure that having a swap partition and zram at the same time is proper.

As I understand the documentation on suspend mem_sleep=s2idle does not use any swap space but mem_sleep=deep does. Since you have 16gb of memory and you have 10gb of swap the problem may be lack of swap space. The recommendations for the size of swap space when hibernating run all over the place. I would try the maximum swap space recommendation I found for 16gb memory which is 20gb of swap space.

will41 11-11-2023 09:52 PM

Certainly worth a try. Does everything else in GRUB loo OK?

lvm_ 11-12-2023 12:53 AM

Deep sleep may have to be enabled in BIOS - check your ACPI/power BIOS settings, it is usually called 'Suspend to RAM' or STR there (which makes rather obvious that it doesn't use swap and cannot be affected by swap settings). If your notebook has a sleep LED, does it behave as expected when suspended?

will41 11-12-2023 10:38 AM

First. To JailBait, No. Increasing the size of of Swap did not make anything better.
To lvm, I checked the BIOS again to make sure and, no, there is no setting regarding ACP/power, sleep, or hibernation. This is a relatively new (2021) Lenovo and the BIOS is apparently Lenovo's with their label on the BIOS page and is very limited in what settings it offers. It is not the more comprehensive "blue text on grey background" one that I am used to seeing. I have read that there are boot up key combinations that will open the "advanced" BIOS but none of those combinations work for me.
Also, while checking, I noticed that under "storage" settings the "mode" is still at RTS which is a setting used by Optane. I thought when I disabled Optane that I also reset the mode to AHCI. Apparently I didn't and perhaps that has an effect on my current issues? However, If I select it to make the change I get a warning that the disk will be erased which would mean re-installing both Windows and Fedora. I'm, of course, willing to do that if it will result in a fix. Any advice on that?lv
o
Update: lvm, Sorry. I forgot to answer your last question. No. The power indicator light does not flash which is normal during sleep. It stays steady on.

will41 11-13-2023 10:38 PM

I have found some different processes to change RST to ACHI in my BIOS. Does anyone have an opinion as to which is the best:
Quote:

A. Change RST to ACHI in BIOS using the Windows Registry:
Start Registry Editor, and navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\iaStorV\

Here, in the right column, double-click on the Start key, and change its value to 0.

Next, double-click on the iaStorV entry in the left column to expand it, select the StartOverride entry, and then in the right column, change the value of the key 0 to 0.

Repeat this set of changes for the following path in the Registry Editor:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\storahci\

Once this step is complete, reboot and start your computer’s BIOS. Normally, BIOS is accessed by hitting the F2 or Del key during the early boot sequence. In the BIOS menu, change the hard disk controller type to AHCI. The exact terminology and steps required to access and manage controller type in BIOS often depend on the specific implementation by the platform vendor.

Exit BIOS, and let the system boot. Windows should load normally, and you can check the controller mode in the Device Manager. It should read: Standard SATA AHCI Controller.
Quote:

B. Change RST to ACHI in BIOS using Windows Safeboot:

Boot into Windows
Open a shell as administrator
Run bcdedit /set safeboot minimal
Reboot, enter BIOS and switch to AHCI
Reboot into Windows again
Open another shell as administrator
Run bcdedit /deletevalue safeboot
Reboot
Quote:

C. Change RST to ACHI in BIOS using Re-install (I have no source indicating that this will work):
Boot to BIOS without any Windows prep
Change RST to ACHI
Do a complete Windows re-install from Windows Installer USB.

will41 11-19-2023 10:57 PM

It appears that I have found a solution to my suspend issues (actually it wasn't suspending at all but just locking up after turning off the screen). A while back, I installed Fedora 38 Cinnamon spin. After using it a while, I decided to try the Gnome desktop and installed it along with Cinnamon. After wasting a lot of time and questions trying to fix the suspend issue it finally occurred to me that there could be some issues with the combination after trying to do some configurations of Gnome. Anyway, this evening I reinstalled the Cinnamon spin and removed every remnant of Gnome I could find from my dot files. It now seems to be working perfectly; close the lid and it goes right to sleep and open it and it wakes right up. Hooray! And, the little white light on the power button winks very nicely when it is asleep.

I hope this helps someone.


All times are GMT -5. The time now is 09:59 PM.