Skip to content

[BUG] PM / Firmware boot failure due to timeout after resume from hibernate on linux kernel 5.18 #5892

Closed

Description

@mofrim

Describe the bug

I am running NixOS x86_64 Linux on a Dell XPS9310 with Intel Tiger Lake Sound. Just upgraded to most recent NixOS-version (22.05) which includes kernel upgrade from 5.17.11 to 5.18.
After the upgrade i came across following problematic behaviour:

  • when I boot to console, login and invoke systemctl hibernate hibernation works only one time because when i resume from hibernate i get the following log message:
[   41.583553] sof-audio-pci-intel-tgl 0000:00:1f.3: ------------[ DSP dump start ]------------
[   41.583557] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware boot failure due to timeout
[   41.583558] sof-audio-pci-intel-tgl 0000:00:1f.3: fw_state: SOF_FW_BOOT_IN_PROGRESS (2)
[   41.583651] sof-audio-pci-intel-tgl 0000:00:1f.3: invalid header size 0xffffffff. FW oops is bogus
[   41.583652] sof-audio-pci-intel-tgl 0000:00:1f.3: unexpected fault 0x00000000 trace 0x00000000
[   41.583652] sof-audio-pci-intel-tgl 0000:00:1f.3: ------------[ DSP dump end ]------------
[   41.583653] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to boot DSP firmware after resume -5
[   41.583654] sof-audio-pci-intel-tgl 0000:00:1f.3: PM: dpm_run_callback(): pci_pm_restore+0x0/0xe0 returns -5
[   41.583664] sof-audio-pci-intel-tgl 0000:00:1f.3: PM: failed to restore async: error -5

and after that hibernation or suspend is not possible anymore.

  • when i boot to sway / wayland and invoke systemctl hibernate from terminal there, screen freezes and i have to hard reset my computer in order to reboot. hibernation seems to take place in the background successfully though, because resume from hibernate succeeds but dmesg shows the same errors as above.

When i switched back to linux 5.17.11 the problem is gone again.

To Reproduce

Boot system with kernel 5.18 and sof-bin 2.1.1, invoke systemctl hibernate from console or wayland

Reproduction Rate

10/10

Expected behavior

Hibernation and resume do not produce errors and can be repeated as often as you want.

Impact

Just forces me to use older kernel version which isn't a problem so far.

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • Kernel: 5.18
    • SOF: sof-bin v2.1.1
  2. Name of the platform(s) on which the bug is observed.
    • Platform: x86_64 Linux

Activity

  1. added
    bug
    on Jun 5, 2022
  2. plbossart commented on Jun 6, 2022

    @plbossart
    Member

    Thanks for the report @friedelino, much appreciated.

    This looks like a regression, my money would be on the change we added for IMR support between 5.17 and 5.18
    5fb5f51185126 ('ASoC: SOF: Intel: hda-loader: add IMR restore support')

    Could you
    a) attach the result of 'alsa-info' so that we know what device you have
    b) try to use 'systemctl suspend' instead?
    c) disable the IMR boot by setting this bit
    sof-priv.h:#define SOF_DBG_IGNORE_D3_PERSISTENT BIT(7) /* ignore the DSP D3 persistent capability

    add this in /etc/modprobe.d/alsa-base.conf

    options snd-sof sof_debug=0x41
    

    reboot, re-run 'systemctl hibernate' and share the full dmesg log in attachment (not copy-paste please!).

    Thanks for your help in root-causing this problem.

  3. plbossart commented on Jun 6, 2022

    @plbossart
    Member
  4. ujfalusi commented on Jun 6, 2022

    @ujfalusi
    Contributor

    @friedelino would it be possible to attach the full kernel log?
    Since this happens after hibernate, it certainly looks like IMR boot issue.
    We have a followup patch for IMR boot which adds recovery for the IMR failure (but that showed rare sideffect for which we have another patch, not yet upstream).
    What is strange in the error is that we don't have any meaningful reason code from the DSP, 0xffffffff and 0x00000000. There might be something else happening, other than IMR.

    IMR boot: is a way to skip firmware re-loading, re-validating. To speed up resume time.

    Btw: does runtime resume works? Boot up, play audio, stop it, wait 7 sec, do another playback. That should also trigger IMR booting.

  5. mofrim commented on Jun 6, 2022

    @mofrim
    Author

    Could you a) attach the result of 'alsa-info' so that we know what device you have

    http://alsa-project.org/db/?f=4342d05ad4716decacf2320f2038192a758fabff

    this is the alsa-info output from my system booted with linux 5.18.0 after i did a couple of hibernate/suspend tries which are also logged in the alsa-dmesg log at the end of the file

    b) try to use 'systemctl suspend' instead?

    yes i tried it. it's almost the same behaviour again with one difference: when i boot a fresh system (with no anterior hibernation tries or anything) the first systemctl suspend succeeds and after wakeup there are no dsp-dump errors but after this first suspend systemctl suspend keeps failing without any logged error as you can see in this

    dmesg1.txt

    dmesg-log of several consecutive tries.

    c) disable the IMR boot by setting this bit sof-priv.h:#define SOF_DBG_IGNORE_D3_PERSISTENT BIT(7) /* ignore the DSP D3 persistent capability

    i've done that. after rebooting i did a sequence of

    • suspend (succeeds)
    • 2nd suspend (fails without error)
    • hibernation (succeeds until error after wakeup)

    the corresponding dmesg-log:

    dmesg2.txt

  6. plbossart commented on Jun 6, 2022

    @plbossart
    Member

    @friedelino I don't understand the comments with 'systemctl suspend', you only added a truncated dmesg log with zero information so it's hard to understand what happens.

    please add this file
    sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf (the extension matters), reboot, redo this step b) and attach the entire dmesg log (from the start and a couple of iterations). Thanks!

  7. mofrim commented on Jun 6, 2022

    @mofrim
    Author

    I truncated the first log because the relevant information is shown in the truncated Version (there are No Error messages). The 2nd (dmesg2.txt) Log is a full dmesg Log as you requested. Still, i can submit another one tomorrow.

  8. plbossart commented on Jun 6, 2022

    @plbossart
    Member

    @friedelino The suspend case is a lot more worrying and should be our first priority. This is what we test on a regular basis and SHOULD work. Hibernate is one step further, more complicated. Let's fix the 'simple' case first, shall we?

  9. ujfalusi commented on Jun 7, 2022

    @ujfalusi
    Contributor

    @friedelino, please try to attach full logs as hints might be visible outside of the 'interest area'. Can you check simple runtime suspend resume as well (aplay, wait, aplay, wait, ...)?
    Please also add the sof-dyndbg.conf so we can see more debug messages to help us rootcause and fix the issue.

    It looks to me that the DSP boot sequence was OK (IMR boot is suspected, which does not have much way to fail) but the firmware ready message is not received and that is printing the timeout error. The DSP registers are not telling much which might be an indication of non proper power up of the DSP.

  10. Noammac commented on Jun 7, 2022

    @Noammac

    Hello, I seem to be having the same issue. I installed the sof-dyndbg.conf file and found that even repeated systemctl suspend s would result in a working configuration, but a single systemctl hibernate would break sound and require removing the DSP and rescanning.
    Attached are two logs confirming this. It would appear that the problem arises when recovering from RAM image, at least in my experience.
    dmesg_log.txt
    dmesg_log2.txt

  11. plbossart commented on Jun 7, 2022

    @plbossart
    Member

    @Noammac are the two logs both with the hibernate option?

    If yes, can you add add this in /etc/modprobe.d/alsa-base.conf

    options snd-sof sof_debug=0x41

    reboot and re-check, thanks!

  12. Noammac commented on Jun 7, 2022

    @Noammac

    Both logs had attempted a systemctl suspend and then a systemctl hibernate.
    New log
    new_dmesg_log.txt

  13. plbossart commented on Jun 7, 2022

    @plbossart
    Member

    Is the new log with the option above @Noammac ? I still see 'booting from IMR directly'. It could also be that the option is incorrect...

  14. plbossart commented on Jun 7, 2022

    @plbossart
    Member

    sorry, my bad @Noammac @friedelino, the command should be

    options snd-sof sof_debug=0x81

    One day I'll learn how to count to 7.

  15. Noammac commented on Jun 7, 2022

    @Noammac

    Ah lol
    Changed setting, and can report that there's no error after hibernation. Log's attached.
    another_dmesg_log.txt

  16. 35 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions