Skip to content

[Bug]IPC error, aplay cannot recover if system aborts S3 and SOF PM is interrupted  #1057

Closed

Description

@ClarexZhou

Describe the bug
aplay exit and IPC error when enter and exit suspend in 1s, driver isn't update after runtime PM is interrupted.

To Reproduce

  1. Run 'aplay -Dhw:0,0 -fS16_LE -c2 -r48000 -d1 /dev/zero' in one terminal
  2. Run 'while rtcwake -m mem -s 1 ; do sleep 1 ; done ' in another terminal

frequency
100%

Actual result
Aplay stopped after S3 enter and wake up at 18th time and ipc error can be found in dmesg

Expected result
Driver should update normally.

Environment
Firmware: 6cc8da10, https://github.com/thesofproject/sof/tree/cml-hda-dmic-001-drop-stable
Kernel: 1cd1a89 sof-v5.0
Topology: file: sof-hda-generic.tplg same path as firmware

dmesg

[  215.661995] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[  215.661998] sof-audio-pci 0000:00:1f.3: pcm: stream dir 0, posn mailbox offset is 790528
[  215.662161] sof-audio-pci 0000:00:1f.3: pcm: trigger stream 0 dir 0 cmd 1
[  215.662166] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60040000: GLB_STREAM_MSG: TRIG_START
[  215.662310] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60040000: GLB_STREAM_MSG: TRIG_START
[  215.662316] sof-audio-pci 0000:00:1f.3: In hda_link_pcm_trigger cmd=1
[  215.691742] PM: suspend exit
[  216.607890] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
[  216.607923] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
[  216.730457] PM: suspend entry (s2idle)
[  216.730458] PM: Syncing filesystems ... done.
[  216.731586] Freezing user space processes ... (elapsed 0.001 seconds) done.
[  216.733303] OOM killer disabled.
[  216.733303] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[  216.734554] printk: Suspending console(s) (use no_console_suspend to debug)
[  216.735126] sof-audio-pci 0000:00:1f.3: pcm: trigger stream 0 dir 0 cmd 5
[  216.735138] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60050000: GLB_STREAM_MSG: TRIG_STOP
[  216.735303] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60050000: GLB_STREAM_MSG: TRIG_STOP
[  216.735306] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[  216.735415] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[  216.735425] sof-audio-pci 0000:00:1f.3: In hda_link_pcm_trigger cmd=5
[  216.735431] sof-audio-pci 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG
[  216.735696] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG
[  217.607962] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
[  217.607990] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
[  217.751371] PM: Some devices failed to suspend, or early wake event detected
[  217.751466] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense: disconnect for pin:port 5:0
[  217.751516] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense: disconnect for pin:port 6:0
[  217.751534] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense: disconnect for pin:port 7:0
[  217.786659] snd_hda_codec_realtek ehdaudio0D0: Headset jack set to unplugged mode.
[  217.787589] OOM killer enabled.
[  217.787591] Restarting tasks ... done.
[  217.795726] sof-audio-pci 0000:00:1f.3: pcm: trigger stream 0 dir 0 cmd 1
[  217.795744] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60040000: GLB_STREAM_MSG: TRIG_START
[  217.795825] sof-audio-pci 0000:00:1f.3: error: ipc error for 0x60040000 size 12
[  217.795828]  HDA Analog: ASoC: trigger FE failed -22
[  217.795832] sof-audio-pci 0000:00:1f.3: pcm: trigger stream 0 dir 0 cmd 0
[  217.795844] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60050000: GLB_STREAM_MSG: TRIG_STOP
[  217.795937] sof-audio-pci 0000:00:1f.3: error: ipc error for 0x60050000 size 12
[  217.795939]  HDA Analog: ASoC: trigger FE failed -22
[  217.824229] PM: suspend exit
[  218.398931] sof-audio-pci 0000:00:1f.3: pcm: free stream 0 dir 0
[  218.398943] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[  218.399090] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[  218.399134] sof-audio-pci 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG
[  218.399313] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG
[  218.399497] sof-audio-pci 0000:00:1f.3: pcm: close stream 0 dir 0
[  218.608072] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
[  218.608097] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
[  219.108045] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
[  219.108073] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
[  220.913282] sof-audio-pci 0000:00:1f.3: ipc tx: 0x40010000: GLB_PM_MSG: CTX_SAVE
[  220.913558] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x40010000: GLB_PM_MSG: CTX_SAVE
[  220.913614] sof-audio-pci 0000:00:1f.3: FW Poll Status: reg=0x1010f0f successful
[  220.913623] sof-audio-pci 0000:00:1f.3: FW Poll Status: reg=0xf0f successful
[  220.913630] sof-audio-pci 0000:00:1f.3: DSP core(s) enabled? 0 : core_mask f
[  220.913681] sof-audio-pci 0000:00:1f.3: Debug PCIR: 00000010 at  00000044

S3_aplay_dmesg.log
S3_aplay_logger.log

Activity

  1. wenqingfu commented on Jun 25, 2019

    @wenqingfu
  2. changed the title [-][Bug]IPC error, driver isn't update after runtime PM is interrupted.[/-] [+][Bug]IPC error, aplay cannot recover if system aborts S3 and SOF PM is interrupted [/+] on Jun 26, 2019
  3. lyakh commented on Jun 26, 2019

    @lyakh
    Collaborator

    @ClarexZhou are you also able to reproduce this problem with the current sof-dev? If I try your recipe on my Mantis with sof-dev I do get interrupted suspends rather easily, but aplay continues normally and no errors are reported. BTW, you specified "-d1" parameter in your aplay command line, that's probably a typo?

  4. RanderWang commented on Jul 5, 2019

    @RanderWang

    For this case, the S3 is interrupted by RTC event, and ASoC only trigger SUSPEND to SOF in both FE & BE. There is no chance to invoke sof_suspend. Then SOF prepare functions are invoked by ASoC. We need to refine some flags to fix it. #1049 will fix it.

  5. RanderWang commented on Jul 8, 2019

    @RanderWang

    The patch is merged

  6. mengdonglin commented on Jul 8, 2019

    @mengdonglin

    @RanderWang thanks for the info! And thank @kv2019i for the nice fix
    @ClarexZhou please help to verify this fix in our daily recipe.

  7. ClarexZhou commented on Jul 8, 2019

    @ClarexZhou
    Author

    Test on CFL laptop and CML laptop. Error not seen on top/sof-dev fdfcca4. Verify closed.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsuspend resumeIssues related to suspend resume (e.g. rtcwake)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions