NVME wake up after sleep problems

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

NVME wake up after sleep problems

Postby duncangareth » Aug 29th, '21, 22:02

I have a Lenovo Legion 5 15ach6 laptop with Mageia 8 installed.
The Ryzen 7 based machine has a 2TB Maxio NVME SSD and nothing else, no HDD bay, thus necessitating exclusive use of the NVME for root, swap and home.
I have been experiencing a rather irritating problem, which detracts somewhat from the pleasure I am deriving from the sheer speed of the system.

If I attempt to use the ACPI sleep function, either by closing the lid, or by issuing the command:
Code: Select all
systemctl sleep

when I try to use the system again, I find that the NVME drive does not "wake up". I get a console full of errors beginning with:

Aborting journal on device nvme0n1p2-0

followed by a whole series of errors all of which imply that the device is not being read as a result of an "io error". These are not really io errors but rather a situation whereby the device is not becoming available for normal rw access after the sleep is terminated.

I am not very familiar with the inner workings of ACPI and so on, but I was wondering if there is a way of running a script or other executable as part of the "waking up" procedure which ensures that the NVME drive is in the proper state, ie. mounted in read/write mode. I suspect that it is either in some sort of static state or else mounted in readonly mode, thus preventing normal resumption of services.

At the moment the only recourse I have is to shut the machine down instead of use the sleep function. Fortunately, the machine boots up very quickly, so I can live with it. However it would be great if I could resolve this issue.

The only other problem I found with this new machine was to do with the Realtek RTL8852 wifi adapter, but I seem to have resolved that one. (see another post I made on this forum.)

Does anyone have any bright ideas about this one? I have tried various additions to the kernel boot parameters as suggested in various Ubuntu, Arch and Fedora forums, but they seem to have no bearing on the issue, which I have been led to conclude is a case of the partitions being mounted in readonly mode on waking.
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby duncangareth » Aug 29th, '21, 22:09

I did not mention that there is no log entry reflecting the situation, since the /var/log directory is not accessible when the problem occurs.

I can try to take a photo of the error messages, but I don't think there would be much point since they all indicate an inability for the device to be accessed, either by reading or writing. My earlier remark about it appearing to be mounted readonly is probabiy incorrect since read errors are also present. It seems that the NVME partitions are not being remounted.
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby doktor5000 » Aug 29th, '21, 23:10

Would be helpful if you would add the output of
Code: Select all
lspcidrake -v
nvme list

and also
Code: Select all
journalctl -ab
output after fresh boot and resuming from sleep (including mentioning at what time you put the system to sleep and when it was resumed).

Also have a look at e.g. https://wiki.archlinux.org/title/Solid_ ... ST_support
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: NVME wake up after sleep problems

Postby duncangareth » Aug 30th, '21, 07:28

I shall do so later today. Unfortunately I have to go into the city first and attend to some clients' issues.
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby duncangareth » Sep 1st, '21, 10:25

As you requested, doktor5000, here are the various outputs:
Code: Select all
lspcidrake -v
unknown         : Advanced Micro Devices, Inc. [AMD]|FCH SATA Controller [AHCI mode] [STORAGE_SATA] (vendor:1022 device:7901 subv:17aa subd:383f) (rev: 81)
unknown         : Advanced Micro Devices, Inc. [AMD]|Device 166f [BRIDGE_HOST] (vendor:1022 device:166f)
snd_pci_acp3x   : Advanced Micro Devices, Inc. [AMD]|Raven/Raven2/FireFlight/Renoir Audio Processor [MULTIMEDIA_OTHER] (vendor:1022 device:15e2 subv:17aa subd:382c) (rev: 01)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir Internal PCIe GPP Bridge to Bus [BRIDGE_PCI] (vendor:1022 device:1635)
i2c_piix4       : Advanced Micro Devices, Inc. [AMD]|FCH SMBus Controller [SERIAL_SMBUS] (vendor:1022 device:790b subv:17aa subd:3842) (rev: 51)
unknown         : Advanced Micro Devices, Inc. [AMD]|Device 1671 [BRIDGE_HOST] (vendor:1022 device:1671)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir PCIe Dummy Host Bridge [BRIDGE_HOST] (vendor:1022 device:1632)
rtw89pci        : Realtek Semiconductor Co., Ltd.|Device 8852 [NETWORK_OTHER] (vendor:10ec device:8852 subv:17aa subd:4852)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir PCIe GPP Bridge [BRIDGE_PCI] (vendor:1022 device:1634)
snd_hda_intel   : NVIDIA Corporation|Device 2291 [MULTIMEDIA_AUDIO_DEV] (vendor:10de device:2291) (rev: a1)
unknown         : Advanced Micro Devices, Inc. [AMD]|Device 166a [BRIDGE_HOST] (vendor:1022 device:166a)
unknown         : Advanced Micro Devices, Inc. [AMD]|Zeppelin/Raven/Raven2 PCIe Dummy Function (vendor:1022 device:145a subv:17aa subd:3803) (rev: c5)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir PCIe GPP Bridge [BRIDGE_PCI] (vendor:1022 device:1633 subv:00fc subd:0000)
unknown         : Advanced Micro Devices, Inc. [AMD]|Device 166c [BRIDGE_HOST] (vendor:1022 device:166c)
ccp             : Advanced Micro Devices, Inc. [AMD]|Family 17h (Models 10h-1fh) Platform Security Processor [CRYPT_OTHER] (vendor:1022 device:15df subv:17aa subd:382a)
unknown         : Advanced Micro Devices, Inc. [AMD]|FCH SATA Controller [AHCI mode] [STORAGE_SATA] (vendor:1022 device:7901 subv:17aa subd:383f) (rev: 81)
unknown         : Advanced Micro Devices, Inc. [AMD]|Device 166e [BRIDGE_HOST] (vendor:1022 device:166e)
xhci_pci        : Advanced Micro Devices, Inc. [AMD]|Renoir USB 3.1 [SERIAL_USB] (vendor:1022 device:1639 subv:17aa subd:3829)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir Internal PCIe GPP Bridge to Bus [BRIDGE_PCI] (vendor:1022 device:1635)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir Root Complex [BRIDGE_HOST] (vendor:1022 device:1630 subv:17aa subd:3814)
unknown         : Advanced Micro Devices, Inc. [AMD]|Device 1670 [BRIDGE_HOST] (vendor:1022 device:1670)
snd_hda_intel   : Advanced Micro Devices, Inc. [AMD]|Family 17h (Models 10h-1fh) HD Audio Controller [MULTIMEDIA_AUDIO_DEV] (vendor:1022 device:15e3 subv:17aa subd:382b)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir IOMMU (vendor:1022 device:1631 subv:17aa subd:3815)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir PCIe GPP Bridge [BRIDGE_PCI] (vendor:1022 device:1634)
Card:NVIDIA GeForce 635 series and later: NVIDIA Corporation|GA107BM [GeForce RTX 3050 Ti Mobile] [DISPLAY_VGA] (vendor:10de device:25e0 subv:17aa subd:3aac) (rev: a1)
unknown         : Advanced Micro Devices, Inc. [AMD]|FCH LPC Bridge [BRIDGE_ISA] (vendor:1022 device:790e subv:17aa subd:3840) (rev: 51)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir PCIe Dummy Host Bridge [BRIDGE_HOST] (vendor:1022 device:1632)
unknown         : MAXIO Technology (Hangzhou) Ltd.|NVMe SSD Controller MAP1001 (vendor:1e4b device:1001) (rev: 01)
unknown         : Advanced Micro Devices, Inc. [AMD]|Device 166b [BRIDGE_HOST] (vendor:1022 device:166b)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir PCIe GPP Bridge [BRIDGE_PCI] (vendor:1022 device:1634)
k10temp         : Advanced Micro Devices, Inc. [AMD]|Device 166d [BRIDGE_HOST] (vendor:1022 device:166d)
xhci_pci        : Advanced Micro Devices, Inc. [AMD]|Renoir USB 3.1 [SERIAL_USB] (vendor:1022 device:1639 subv:17aa subd:3828)
unknown         : Advanced Micro Devices, Inc. [AMD]|Renoir PCIe Dummy Host Bridge [BRIDGE_HOST] (vendor:1022 device:1632)
r8169           : Realtek Semiconductor Co., Ltd.|RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [NETWORK_ETHERNET] (vendor:10ec device:8168 subv:17aa subd:3900) (rev: 15)
hub             : Linux 5.13.12-desktop-2.mga8 xhci-hcd|xHCI Host Controller [Hub|Unused|Full speed (or root) hub] (vendor:1d6b device:0002)
hub             : GenesysLogic|USB2.1 Hub [Hub|Unused|TT per port] (vendor:05e3 device:0610)
usbhid          : Lenovo|Lenovo Legion M300 RGB Gaming Mouse [Human Interface Device|Boot Interface Subclass|Mouse] (vendor:17ef device:60e4)
usbhid          : ITE Tech. Inc.|ITE Device(8910) [Human Interface Device|Boot Interface Subclass|Keyboard] (vendor:048d device:c101)
hub             : Linux 5.13.12-desktop-2.mga8 xhci-hcd|xHCI Host Controller [Hub|Unused|Full speed (or root) hub] (vendor:1d6b device:0003)
hub             : GenesysLogic|USB3.2 Hub [Hub|Unused|Full speed (or root) hub] (vendor:05e3 device:0620)
hub             : Linux 5.13.12-desktop-2.mga8 xhci-hcd|xHCI Host Controller [Hub|Unused|Full speed (or root) hub] (vendor:1d6b device:0002)
usbhid          : ITE Tech. Inc.|ITE Device(8295) [Human Interface Device|Boot Interface Subclass|Keyboard] (vendor:048d device:c965)
btusb           : Realtek|Bluetooth Radio [Wireless|Radio Frequency|Bluetooth] (vendor:0bda device:4852)
hub             : Linux 5.13.12-desktop-2.mga8 xhci-hcd|xHCI Host Controller [Hub|Unused|Full speed (or root) hub] (vendor:1d6b device:0003)
hid_generic     : ITE Tech. Inc. ITE Device(8295)
hid_generic     : Lenovo Lenovo Legion M300 RGB Gaming Mouse
hid_generic     : ITE Tech. Inc. ITE Device(8295)
hid_generic     : ITE Tech. Inc. ITE Device(8910)
hid_generic     : Lenovo Lenovo Legion M300 RGB Gaming Mouse
hid_generic     : Lenovo Lenovo Legion M300 RGB Gaming Mouse
hid_generic     : MSFT0001:00 04F3:31DD

Here is the output of the nvme command:
Code: Select all
nvme list
Node             SN                   Model                                    Namespace Usage                      Format           FW Rev 
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1     30044444093          HS-SSD-E2000 2048G                       1           2.05  TB /   2.05  TB    512   B +  0 B   B00u7M10

The output of journalctl -ab after a cold boot is too large to include in a message, so I have appended it as a file upload.
journalctl-ab-boot.txt
Output of "journalctl -ab" just after booting
(202.33 KiB) Downloaded 136 times

After I put the machine into "sleep" mode, it freezes and I can do nothing. I can't retrieve log output or anything. All I can do is hold down the power button and cold boot.

FYI, here is the kernel boot parameter string from /etc/default/grub:
Code: Select all
GRUB_CMDLINE_LINUX_DEFAULT="splash quiet noiswmd nokmsboot nvme_load=YES nvd_load=YES pcie_aspm=off nvme_core.default_ps_max_latency_us=0 resume=UUID=f2df3de2-968c-4cad-a9d7-74ef3dca567b audit=0 vga=791"


These parameters are the result of various suggestions made in various forums. So far I have not had any success.
The inference that the firmware may be at fault is worth pursuing(with reference to the link to the Arch Wiki).

This is a rather frustrating problem.
Last edited by doktor5000 on Sep 1st, '21, 18:22, edited 1 time in total.
Reason: fixed code tags
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby duncangareth » Sep 1st, '21, 15:14

On further examination of this situation, I have come to the conclusion that the NVME device is set to too low a power level during a suspend state for it to function on resumption of normal operation. For this reason I surmise that a possible solution would be to use the tmpfs to store the relevant commands which are needed to "wake up" the NVME device. In theory, this should work because the tmpfs resides in RAM, the contents of which are preserved during a sleep state.

I should be happy to consider any suggestions in this regard. The last time I played around with RAMdisks was on a Solaris system about 20 years ago. I suppose the trick will be to isolate which software needs to reside on the ramdisk in order to be sufficient for the re-awakening of the main storage device, ie. the NVME.
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby duncangareth » Sep 1st, '21, 17:12

Apropos of "waking" the NVME drive, would this work?
Code: Select all
nvme reset /dev/nvme0
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby doktor5000 » Sep 1st, '21, 18:36

Well, you would have to try out what works, as others can probably not reproduce your issue without the same hardware.

Also, did you follow the information on the link I posted above to disable power management for the NVME disk ?

What you should also check is the obvious, in UEFI check what the storage controller is configured as, should be AHCI (which is not the default from what I read, it's usually set to RAID/Intel RST)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: NVME wake up after sleep problems

Postby duncangareth » Sep 3rd, '21, 01:31

Thanks for your input, doktor5000. The device is using AHCI, and I have tried disabling power management, but I haven't been through all of the permutations yet.
I am in the process of finding out a bit more about the NVME support in the kernel. It may be possible to tweak something there. Unfortunately, I have not been able to find out very much about the device itself which is relatively new on the market. It is a "Hikvision" device which is manufactured by a company which is heavily involved with surveillance systems.
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby tis » Sep 4th, '21, 08:18

Hi,

I've searched the internet about this problem, and the g... search engine gave that Lenovo Legion's have something similar under W....
They mentioned BIOS upgrades... You should check for latest BIOS and latest ssd firmware...
tis
 
Posts: 148
Joined: Sep 30th, '19, 20:19

Re: NVME wake up after sleep problems

Postby duncangareth » Sep 6th, '21, 08:54

Thank you for the suggestion. I shall have to work out how to upgrade the BIOS without Windows. The Lenovo site only has a Windows binary. I think I shall have to install Windows on a secondary drive.
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby doktor5000 » Sep 6th, '21, 18:24

Seems for the recent models they really only offer BIOS updates for windows. You might need to create a WinPE media for that, have a look at e.g. http://win10se.cwcodes.net/
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: NVME wake up after sleep problems

Postby duncangareth » Sep 7th, '21, 23:14

Thanks doktor5000. I am about to try that. I have a Windows enthusiast working for me, and he has been kind enough to provide me with a bootable Windows 10 image which I have written to a USB drive. I am about to give it a try.
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby duncangareth » Sep 22nd, '21, 11:35

I have managed to update the BIOS by means of a bootable WIndows USB stick. I am going through various permutations of ACPI and APST settings and I shall post my findings here in due course. Unfortunately my machine is tied up at the moment doing data recovery on clients' hard drives.(testdisk and photorec are such brilliant tools!) As soon as I can get a bit of free time to experiment I shall do so. I have also found a section in the kernel driver source for the NVME devices which looks promising. I hope to provide a detailed explanation as soon as I can.
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby duncangareth » Mar 24th, '22, 11:04

I have not yet found a solution for this problem. I am ever hopeful that a new kernel revision will change matters.
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

Re: NVME wake up after sleep problems

Postby dronefight » Sep 2nd, '23, 21:21

Have you found a solution for this issue? I've a similar issue with a Lenovo Thinkpad L13 and an NVME drive
dronefight
 
Posts: 1
Joined: Sep 2nd, '23, 21:20


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest