Linux 5.8.0-49+ fails to resume from suspend

Bug #1925843 reported by Steven
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Expected Result: System resumes from suspend and displays the log in screen to unlock the computer.

Actual Result: System displays a black screen with a flashing cursor in the upper left and cannot be interacted with. Hard reboot is required to get back to a working system.

Additional information:

When I boot my computer with 5.8.0-48, the system resumes from suspend as expected. Both 5.8.0-49 and 5.8.0-50 fail to resume from suspend.

This problem began after I updated from 20.04 to 20.10 using the Software Updater on 4-19-21. I was using the latest kernel available for 20.04 at that time (5.8.0-48, I think) before updating.

ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: linux-image-5.8.0-50-generic 5.8.0-50.56
ProcVersionSignature: Ubuntu 5.8.0-50.56-generic 5.8.18
Uname: Linux 5.8.0-50-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu50.5
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: steven 1268 F.... pulseaudio
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Fri Apr 23 12:54:52 2021
InstallationDate: Installed on 2020-09-01 (234 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
Lsusb:
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 001 Device 003: ID 8087:0a2a Intel Corp. Bluetooth wireless interface
 Bus 001 Device 002: ID 0bda:58eb Realtek Semiconductor Corp. HP Wide Vision HD Camera
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: HP OMEN by HP Laptop 15-ce0xx
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.8.0-50-generic root=UUID=208c1c0d-3e9e-43da-ba24-0d1cd92b5ad0 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-5.8.0-50-generic N/A
 linux-backports-modules-5.8.0-50-generic N/A
 linux-firmware 1.190.3
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 10/30/2020
dmi.bios.release: 15.23
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: F.23
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: 838F
dmi.board.vendor: HP
dmi.board.version: 40.28
dmi.chassis.type: 10
dmi.chassis.vendor: HP
dmi.chassis.version: Chassis Version
dmi.ec.firmware.release: 40.28
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrF.23:bd10/30/2020:br15.23:efr40.28:svnHP:pnOMENbyHPLaptop15-ce0xx:pvr:rvnHP:rn838F:rvr40.28:cvnHP:ct10:cvrChassisVersion:
dmi.product.family: 103C_5335KV HP OMEN
dmi.product.name: OMEN by HP Laptop 15-ce0xx
dmi.product.sku: 1KV78UA#ABA
dmi.sys.vendor: HP

Revision history for this message
Steven (blistercoilkrasis) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Steven (blistercoilkrasis) wrote :

Thank you for your suggestion to test the latest kernel. Unfortunately, I am having trouble booting using the suggested kernel (5.13-rc2).

I have downloaded the appropriate (I think) kernel packages from the link you provided:
linux-modules-5.13.0-051300rc2-generic_5.13.0-051300rc2.202105162330_amd64.deb
linux-image-unsigned-5.13.0-051300rc2-generic_5.13.0-051300rc2.202105162330_amd64.deb
linux-headers-5.13.0-051300rc2-generic_5.13.0-051300rc2.202105162330_amd64.deb
linux-headers-5.13.0-051300rc2_5.13.0-051300rc2.202105162330_all.deb

I have verified the checksums, installed the packages, and configured them using dpkg --configure -a.

When I try to boot using kernel 5.13-rc2, I receive the following errors:
error: /boot/vmlinuz-5.13.0-051300rc2-generic has invalid signature.
error: you need to load the kernel first

Please advise.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Please disable Secureboot in the BIOS.

Revision history for this message
Steven (blistercoilkrasis) wrote :

With Secure Boot disabled, I can boot kernel 5.13.0-rc2 fine (if a few acpi errors).

Resuming from suspend works as expected on this kernel.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

To find the fix, we can do a reverse kernel bisection:

First, find the first -rc kernel works and the last -rc kernel doesn’t work from http://kernel.ubuntu.com/~kernel-ppa/mainline/

Then,
$ sudo apt build-dep linux
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
$ cd linux
$ git bisect start
$ git bisect new $(the working version you found)
$ git bisect old $(the non-working version found)
$ make localmodconfig
$ make -j`nproc` deb-pkg
Install the newly built kernel, then reboot with it.
If it doesn’t work,
$ git bisect old
Otherwise,
$ git bisect new
Repeat to "make -j`nproc` deb-pkg" until you find the commit fixes the issue.

Revision history for this message
Steven (blistercoilkrasis) wrote :

I am not terribly familiar with the git and make commands so I want to give a full account of my process in case I did something wrong.

First, I can confirm that 5.12-rc8 is the last kernel that doesn't work for me and 5.13-rc2 is the first one that does.

I am skipping over 5.13-rc1 because I don't believe I can install it on my machine. It doesn't seem to be compatible with my Nvidia drivers as per this error:
ERROR (dkms apport): kernel package linux-headers-5.13.0-051300rc1-generic is not supported
Error! Bad return status for module build on kernel: 5.13.0-051300rc1-generic (x86_64)
Consult /var/lib/dkms/nvidia/460.73.01/build/make.log for more information.

Maybe I am just unwilling to mess with drivers enough to make it work, though.

As for the bisect, I ran 'apt build-dep linux' (after checking 'Source Code' in Software and Updates so I could actually find the right packages) and cloned the git repository.

Using 5.12-rc8 as the last non-working kernel and 5.13-rc2 as the first working kernel, I ran:
cd linux
git bisect start
git bisect good v5.13-rc2
git bisect bad v5.12-rc8

This simply returned:
Bisecting: a merge base must be tested
[bf05bf16c76bb44ab5156223e1e58e26dfe30a88] Linux 5.12-rc8

which I didn't find particularly helpful. I had to use 'good' and 'bad' instead of 'new' and 'old' because the latter returned '[a string of numbers] is both old and new', which seemed wrong.

To build the new kernel, I ran:
make olddefconfig
make localmodconfig
make -j`nproc` deb-pkg

This gave several warnings, but seemed to run OK. I can attached a file with the outputs if you want.

It looks like it just built 5.12-rc8, although maybe the file name is misleading.

I assume to install this kernel I should install the four .deb that make made:
linux-headers-5.12.0-rc8_5.12.0-rc8-1_amd64.deb
linux-image-5.12.0-rc8_5.12.0-rc8-1_amd64.deb
linux-image-5.12.0-rc8-dbg_5.12.0-rc8-1_amd64.deb
linux-libc-dev_5.12.0-rc8-1_amd64.deb

I will do that when I have some time to test the new kernel unless I hear from you first. Hopefully, I did everything right.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

If you want to use "good" and "bad", you need to do it in reverse fashion:
git bisect bad v5.13-rc2
git bisect good v5.12-rc8

Revision history for this message
Steven (blistercoilkrasis) wrote :

OK. That explains why I accidentally rebuilt 5.12-rc8.

I tried again. Running the commands as you have listed them:

cd linux
git bisect start
git bisect bad v5.13-rc2
git bisect good v5.12-rc8

returns:

ce6471a4dff253eab89bd4eb3a84eef6bdba1f44 was both good and bad

which seems like an error.

I instead tried the following command as per https://wiki.ubuntu.com/Kernel/KernelBisection:

cd linux
git bisect start v5.13-rc2 v5.12-rc8

which output:

Bisecting: 7697 revisions left to test after this (roughly 13 steps)
[35655ceb31b56cd1cb52635a725dfcdb9662d7b7] Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

This seems like its actually getting somewhere. I will attempt to build a new kernel with the rest of the steps and test it.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

I think that's a git bug. Use sha1 directly to workaround the issue:
$ git bisect new ce6471a4dff253eab89bd4eb3a84eef6bdba1f44
$ git bisect old 939326287f7e63045200ed4ee1653029a7aa8065

Revision history for this message
Steven (blistercoilkrasis) wrote :

Using the sha1 gave the same error (ce6471a4dff253eab89bd4eb3a84eef6bdba1f44 was both old and new)

I built a new kernel (5.12.0+-1) using:

cd linux
git bisect start v5.13-rc2 v5.12-rc8
make olddefconfig
make localmodconfig
make -j`nproc` deb-pkg

This kernel can correctly resume from suspend.
The output from git bisect log is:

# bad: [d07f6ca923ea0927a1024dfccafc5b53b61cfecc] Linux 5.13-rc2
# good: [bf05bf16c76bb44ab5156223e1e58e26dfe30a88] Linux 5.12-rc8
git bisect start 'v5.13-rc2' 'v5.12-rc8'
# good: [35655ceb31b56cd1cb52635a725dfcdb9662d7b7] Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
git bisect good 35655ceb31b56cd1cb52635a725dfcdb9662d7b7

I marked it as 'good' in the bisect log since it works, but should I have marked it as 'bad' since we are doing it in reverse?

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Yes, you should use good/bad in reverse.

Revision history for this message
Steven (blistercoilkrasis) wrote :

I've gotten part way through the bisect. Make has been giving me several errors and warnings and then hanging when I try to create the test kernel and I don't really have the knowledge, time, or inclination to debug what is wrong with it on my own.

Since it seems like this suspend bug only affects me and kernel 5.13 fixes the problem, I am fine with living with the suspend issue until 5.13 is released. If this ends up being a more widespread/critical problem and you want me to reopen the issue, I can, but otherwise I am going to stop here. Thank you for your help with the bisect.

Here is as far as I have gotten in the bisect, in case it is helpful

$ git bisect log
# bad: [d07f6ca923ea0927a1024dfccafc5b53b61cfecc] Linux 5.13-rc2
# good: [bf05bf16c76bb44ab5156223e1e58e26dfe30a88] Linux 5.12-rc8
git bisect start 'v5.13-rc2' 'v5.12-rc8'
# bad: [35655ceb31b56cd1cb52635a725dfcdb9662d7b7] Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
git bisect bad 35655ceb31b56cd1cb52635a725dfcdb9662d7b7
# good: [55ba0fe059a577fa08f23223991b24564962620f] Merge tag 'for-5.13-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
git bisect good 55ba0fe059a577fa08f23223991b24564962620f
# bad: [a1a1ca70deb3ec600eeabb21de7f3f48aaae5695] Merge tag 'drm-misc-next-fixes-2021-04-22' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
git bisect bad a1a1ca70deb3ec600eeabb21de7f3f48aaae5695

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Maybe upgrade to Hirsute? It uses 5.11 kernel.

Revision history for this message
Paddy Landau (paddy-landau) wrote :

> Maybe upgrade to Hirsute? It uses 5.11 kernel.

Unfortunately, the bug is still present in kernel version 5.11.0-25.

In any case, for those who (like me) use the LTS versions, upgrading to 21.04 wouldn't be a solution.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Then I think it's better to stick to 5.13 based kernel, like linux-oem-20.04c.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Paddy Landau (paddy-landau) wrote :

This has been marked as expired, but it is still a valid bug.
Remarking as Confirmed.

Changed in linux (Ubuntu):
status: Expired → Confirmed
Revision history for this message
Paddy Landau (paddy-landau) wrote :

My computer is now running kernel 5.13.0-25, which works correctly.

Marking as Fix Released.

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.