Bug 217442 - Freeze after resuming from hibernation
Summary: Freeze after resuming from hibernation
Status: RESOLVED CODE_FIX
Alias: None
Product: Linux
Classification: Unclassified
Component: Kernel (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: Virtual assignee for kernel bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-14 09:55 UTC by julien.falque
Modified: 2023-05-26 19:37 UTC (History)
4 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description julien.falque 2023-05-14 09:55:38 UTC
Since a Kernel update a few weeks ago, my laptop freezes when resuming from hibernation. It seems to handle the resume process normally but at the moment I should see Gnome login screen, I either get a black screen with just a white underscore instead, or nothing displayed at all (no backlight). I can't do anything at that point and I have to hard reboot.

Steps to reproduce:
- hibernate
- resume
- wait until the resuming process should finish: black screen instead of e.g. Gnome's login screen

journalctl gives nothing between the beginning of the resume and the crash, as if it never happened.

I have a Dell XPS 15 (9550) with Arch Linux. The issue happens on linux (since v6.2.0 I think) but linux-lts (currently v6.1.28) is fine.

A bisect on linux-git gave commit da6d9c8ecd00 as the cause of the problem.
Comment 1 Bagas Sanjaya 2023-05-15 01:38:40 UTC
(In reply to julien.falque from comment #0)
> Since a Kernel update a few weeks ago, my laptop freezes when resuming from
> hibernation. It seems to handle the resume process normally but at the
> moment I should see Gnome login screen, I either get a black screen with
> just a white underscore instead, or nothing displayed at all (no backlight).
> I can't do anything at that point and I have to hard reboot.
> 
> Steps to reproduce:
> - hibernate
> - resume
> - wait until the resuming process should finish: black screen instead of
> e.g. Gnome's login screen
> 
> journalctl gives nothing between the beginning of the resume and the crash,
> as if it never happened.
> 

Can you post dmesg messages, showing the error?
Comment 2 Hans de Goede 2023-05-15 08:57:26 UTC
da6d9c8ecd00e2 is known to cause a NULL pointer deref on resume,
which is likely what is happening here. This is fixed by:

https://lore.kernel.org/regressions/20230510141856.46532-1-hdegoede@redhat.com/

This patch is ready for merging and is waiting for the wireless-maintainer
to merge it and send it to Linus.
Comment 3 julien.falque 2023-05-15 11:42:32 UTC
> Can you post dmesg messages, showing the error?

I can't find those messages, journactl --list-boots does not show the boot that tried to resume from hibernation and crashed.
Comment 4 Bagas Sanjaya 2023-05-15 13:06:33 UTC
(In reply to julien.falque from comment #3)
> > Can you post dmesg messages, showing the error?
> 
> I can't find those messages, journactl --list-boots does not show the boot
> that tried to resume from hibernation and crashed.

Huh?

While booting last known good kernel, as root, run journalctl with --since argument that is about a day before
Comment 5 Bagas Sanjaya 2023-05-15 13:07:01 UTC
(In reply to Bagas Sanjaya from comment #4)
> (In reply to julien.falque from comment #3)
> > > Can you post dmesg messages, showing the error?
> > 
> > I can't find those messages, journactl --list-boots does not show the boot
> > that tried to resume from hibernation and crashed.
> 
> Huh?
> 
> While booting last known good kernel, as root, run journalctl with --since
> argument that is about a day before

Oops, I mean a day before now.
Comment 6 julien.falque 2023-05-15 16:38:53 UTC
I still can't find it. This is the last line given by journalctl when hibernating with bisected linux-git:

kernel: PM: hibernation: hibernation entry

This is immediatly followed by:

-- Boot a004a3b1769a4612a44ff91ff9d2cef6 --
kernel: microcode: microcode updated early to revision 0xf0, date = 2021-11-12
kernel: Linux version 6.1.27-1-lts (linux-lts@archlinux) (gcc (GCC) 13.1.1 20230429, GNU ld (GNU Binutils) 2.40.0) #1 SMP PREEMPT_DYNAMIC Mon, 01 May 2023 18:18:27 +0000

Which is the reboot on linux-lts, after resuming from hibernation crashed.
Comment 7 Felix 2023-05-26 07:55:38 UTC
So this is exactly the same issue that I had, with the same commit as the culprit. It's fixed in upstream now (by the commit titled wifi: brcmfmac: Check for probe() id argument being NULL) and there's a patch for the 6.3 series.

I also didn't have any meaningful entries in my journal, because the kernel crashed upon resume, not writing the crash info anywhere where one could read it. To read it, here's what I did:

1. disable the graphical interface (`systemctl disable gdm` in this case)
2. add `debug` and `no_console_suspend` kernel parameters in the bootloader configuration
3. reboot and reproduce the issue

Only then was I able to read the crash information, including kernel oops and stack trace. (One valuable piece of information for finding out which kernel parameters to use was: https://01.org/blogs/rzhang/2015/best-practice-debug-linux-suspend/hibernate-issues )

I hope this helps if anyone else encounters a similar bug and wants to debug it.
Comment 8 julien.falque 2023-05-26 19:37:00 UTC
Issue fixed with linux 6.3.4, thanks!

Note You need to log in before you can comment on or make changes to this bug.