Ubuntu – Dell Latitude 7390 – Ubuntu 20.04 – Sometimes hangs and reboot after pressing “Suspend”

20.04dellsuspend

I installed Ubuntu 20.04 in my Dell Latitude 7390 (this has an
i5-8250U with Intel HD 620 graphics).

I've been trying to fix the Sleep issues for several hours/days without success so far. I'm starting to think there is no solution. There are a lot of old posts about older Linux kernels and Ubuntu versions. But not a lot of info for 20.04.

Scenario: In the same SSD I have Windows 10 installed (UEFI + Bitlocker + TPM) and 3 partitions for Ubuntu 20.04: one for SWAP 8GB, one for "/" 20GB and one for /HOME 30GB) | I have 8GB of RAM | Secure boot enabled.
Yesterday I also tried with an Ubuntu installation where I encrypted SWAP and /HOME. Today I started fresh with a new Ubuntu installation.

The laptop can sleep fine in Windows 10. I've been using it for a year. (I have the latest BIOS installed SSD firmware as well).
The only issue I faced in Windows 10 is that I can only use DELL Intel HD graphic drivers. If I try to install the Intel generic DCH drivers, it install fine, but after a reboot I have a frozen screen in Windows login. (Even after a Windows 10 clean install I have to install Dell GPU driver before my first restart, otherwise problem).
I'm not sure if this is related. But just so you know that this Dell laptop requires their own Dell drivers in Windows to work properly.

Issue: When I press "Suspend" option. Sometimes it works and PC suspends in 2-6 seconds. Sometimes doesn't work, Screen instantly goes black, the Keyboard is still with lights and the power led remains on. When this happens, I noticed that after a while, PC shutdowns and Ubuntu boots again from scratch.

This can happen by using the suspend button, closing the lid, pressing the power button (configured to suspend when pressed) or just selecting "Suspend" via the GUI.

I know that a lot of people are having issues "waking up" the PC from sleep. I'm having issues trying to suspend the laptop. I still haven't got wake up issues.

I think to reproduce this, It's better to open Chrome with some tabs (so I have more stuff loaded in RAM).

Settings tried:

  • mem_sleep_default=deep in /etc/default/grub (I think by default s2idle is enabled)
  • Uncomment the typical options with =suspend in etc/systemd/logind
  • Tried installing that "TLP" package in a previous installation.
  • And a lot of more stuff that I think might not be related.
  • I managed to install "S2RAM" and this works perfectly. PC sleeps in maximum 1 second and resumes without any problem by just running "sudo s2ram". But I couldn't replace Ubuntu 20.04 systemd with S2RAM, tried some guides without success. If somebody knows the proper way to do this. I'd take this as a solution

Anybody has any recent hint to try regarding this?


Update: Some more facts:

From TTY "systemctl suspend" works better (it suspends almost always in less than a minute and power led goes off). Also tried leaving the PC suspended the whole night and turned back on fine.
But if I open a YouTube Video, switch to TTY and call a suspend, it seems i end up with a failed suspend like always.

So If I try Suspend, while running a process or audio, suspend doesn't work (I play some video with audio to quickly know if the PC crashed or if the PC is still OK. If the audio goes crazy in a short loop I assume it crashed).


Update 20200524 (Edit: not fixed):

I found one setting that seems to fixed my Suspend (systemctl suspend) crash issues.
I basically added to grub this Kernel parameter:

snd_hda_intel.dmic_detect=0

And this are all the parameters I'm using right now, the last 2 are custom. But only the last parameter finally did the trick.

quiet splash mem_sleep_default=deep snd_hda_intel.dmic_detect=0

Source:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1867388

https://forum.manjaro.org/t/bug-in-5-4-2-1-with-suspend-and-snd-hda-intel/114726

Update 20200524-1230:

After fixing suspend issues I noticed:

1) Now when I suspend from the terminal, the borders of the terminal go black (graphical glitch), then it finally suspends.

2) Suspends is not bad, after sleeping for 6 hours laptop lost 2% battery.

3) When waking up the laptop —> Desktop appears instantly and after 1-2 seconds Desktops is "re-loaded" again.

4) "Lock" function doesn't work anymore. Every time I wake up the PC or every time I press < Start + L > hotkey. The laptop reloads the desktop UI without locking the screen (Like in point 3). I tried to fix this issue and installed some stuff like gnome-screensaver, some unity tools, but then something broke suspend again. (After a reboot managed to fix suspend again) –> DMESG add lines like this (with different stuff) everytime I try to "Lock":

[  853.654889] gnome-shell[4051]: segfault at 0 ip 00007fa295588252 sp 00007ffcb00160f0 error 4 in libst-1.0.so[7fa295568000+4c000]
[  853.654897] Code: 48 83 c3 01 41 39 9f 30 01 00 00 0f 8e 27 01 00 00 49 8b 87 28 01 00 00 48 8d 35 ee 07 03 00 48 8b 2c d8 48 8b 45 00 48 8b 00 <4c> 8b 20 4c 89 e7 e8 63 31 fe ff 85 c0 74 c7 41 80 7c 24 0a 00 0f

And lastly, I tried to remove the flag I added "snd_hda_intel.dmic_detect=0" and suspends still works. So I don't know exactly if this flag fixed suspend issues (and broke the "Lock" function). I'm sorry about this.

Update 20200524-1345:

I think the problem is related to GNOME. I just did a clean install of Ubuntu 20.04. After trying to fix (again) suspend without success. I tried to install "KDE Plasma Desktop" with

sudo apt install kde-plasma-desktop

And after a reboot Suspend works fine and lock screen also works fine.
I'll try doing a clean install of Kubuntu next.

In the past I also tried lighdm but this one didn't fixed anything.

If this is wrong I'll remove it from the post. Just testing right now.

Update 20200524-1605:

Kubuntu seems really stable. Suspend and Lock work out of the box. No need for any modding. So far no issues.

KDE is quite complex though. A lot of options and customizations. I might try something simpler in the future.
But for now I'm loving it. Works amazing.

Best Answer

After almost a week trying without success, finally my Latitude 7390 run smoothly under Ubuntu 20.04 and Pop!_OS 20.04 .

- Short story -

Just like sebastianer, I upgraded my laptop to latest Pop!_OS 20.04 at first time. Just realize the laptop freeze after I leave it almost hours (the power button still on, when it should be already on suspend) with blank screen, try hit the power button and press some key didn't work, so I need to force shutdown by long pressing the power button.

The second time, the laptop charging led blinking 2 times in amber and 1 time in white not long after the laptop going into lock state. According to Latitude 7390 manual, this mean something wrong with the processor. This happen too when I installing Ubuntu 18.04.4 and Ubuntu 20.04. This only happen in latest Ubuntu but not another distro.

Try to touch the processor side under the laptop after hung, but not feel hot. So I assume there must be something in the processor that can't run correctly under new (kernel?) in Ubuntu. Ah and I have an custom AMD APU PC with ASUS motherboard that have same problem, but seems like appear not often. But my other laptop (ThinkPad E540 and Vostro V131) are run smoothly without any problem.

The problem is on the locking state not the suspend. Because somehow I can doing suspend and wake it up normally, but not when locking the system. Just try disable the lock and going to suspend, or just click the suspend button or run sudo systemctl suspend.

- The Fix -

(Latitude 7390 - i7-8650U - BIOS v1.14.0)

So I focused on the System Setup (BIOS). This time to change some setting related with the processor. Here is what I have done (in the BIOS - System Setup Manual):

  1. Disable "Intel Speed Shift Technology", this can be found under Power Management menu
  2. Disable "Trusted Execution" and "TPM 2.0 Security", this can be found under this link for Trusted Execution and this link for TPM
  3. Disable "Wireless Radio Control", this can be found under Power Management menu. By disabling both of WLAN and WWAN in this menu, it fix problem with "disabled by hardware" problem after wake up from suspend.
  4. Disable "Intel Software Guard Extensions", this can be found under Intel Software Guard Extensions.

(Custom PC with ASUS motherboard (F2A85-M LE) and AMD APU A10-5800K - BIOS v6504)

  1. Disable "Deep S4", this can be found under the Advance BIOS menu.

- Conclusion -

Seems like the Intel Speed Shift Technology, TPM, and Intel software Guard Extensions have problem with the new kernel. Maybe there still need a tweak in the driver side, a conflict with the P-State, or the combination all of it, idk. But after I disable all of it, my laptop work smoothly using Ubuntu 20.04 and Pop!_OS 20.04.

In the AMD side seems like S4 bring the system into a very deep sleep that no one can bring it up gracefully except to force it wake up by resetting the system.

I already run both system more than 24 hours now with latest update (kernel 5.4.0-7634-generic). Seems all the system working fine.

- Update 20200610 1813 -

After using almost a weeks or more, seems like my laptop fine but, then I need TPM due to app I made, so I enable all feature that I already disabled before in the BIOS. Then my system back to crash. But the strange things is even I revert it back to disable, it keep crashing after lock, going to CPU Failure. After googling looking for the right answer what happen with my CPU, then I found this and this articles.

I have i7-8650U which is Kaby Lake Refresh. In the article said "Some Intel systems, like Kaby Lake Refresh chips, require both intel_idle.max_cstate=1 and i915.enable_dc=0 to ensure a hang-free experience." so I put

intel_idle.max_cstate=1 i915.enable_dc=0

in my GRUB kernel parameter. Seems like it was the correct settings to make my Latitude 7390 laptop able to lock and/or suspend without CPU Failure and enable again the Intel Speed Shift Technology, TPM, and Trusted Execution .

Hope the answer help you and some people. Thank you and Good Luck

Related Question