Skip to content

Broadwell: kernel warning w/ failed hw_params on media pipeline #932

Closed

Description

@plbossart

Bad kernel oops when using device 0,1 (media)

root@galliumos:~# speaker-test -Dhw:0,1 -c2 -r48000 

speaker-test 1.1.0

Playback device is hw:0,1
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 2096640
Period size range from 48 to 65520
Using max buffer size 2096640
Periods = 4
Unable to set hw params for playback: Invalid argument
Setting of hwparams failed: Invalid argument
[   40.252524] sof-audio-acpi INT3438:00: ipc tx: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[   40.252682] sof-audio-acpi INT3438:00: error: ipc error for 0x60010000 size 20
[   40.252687] sof-audio-acpi INT3438:00: error: hw params ipc failed for stream 0
[   40.252690] sof-audio-acpi INT3438:00: ASoC: INT3438:00 hw params failed: -22
[   40.252694]  Media Playback 1: ASoC: hw_params FE failed -22
[   40.252700] sof-audio-acpi INT3438:00: pcm: free stream 1 dir 0
[   40.252703] sof-audio-acpi INT3438:00: ipc tx: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[   40.252839] sof-audio-acpi INT3438:00: ipc tx succeeded: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[   40.252852] WARNING: CPU: 0 PID: 2841 at /data/pbossart/ktest/sof-dev/kernel/workqueue.c:3030 __flush_work+0x19f/0x1b0
[   40.252853] Modules linked in: snd_soc_sst_bdw_rt5677_mach x86_pkg_temp_thermal intel_powerclamp iwlmvm sof_acpi_dev iwlwifi snd_sof_intel_byt snd_sof_intel_bdw snd_sof_intel_ipc snd_sof snd_sof_xtensa_dsp intel_pch_thermal snd_soc_rt5677 snd_soc_acpi_intel_match snd_soc_rl6231 snd_soc_acpi snd_soc_core snd_pcm snd_soc_rt5677_spi xhci_pci xhci_hcd
[   40.252867] CPU: 0 PID: 2841 Comm: speaker-test Not tainted 5.1.0-test+ #77
[   40.252868] Hardware name: GOOGLE Samus, BIOS  08/17/2016
[   40.252871] RIP: 0010:__flush_work+0x19f/0x1b0
[   40.252873] Code: ff 8b 4d 00 48 8b 55 08 83 e1 08 48 0f ba 6d 00 03 80 c9 f0 eb c6 41 c6 45 00 00 fb 31 c0 e9 e1 fe ff ff 0f 0b e9 da fe ff ff <0f> 0b 31 c0 e9 d1 fe ff ff e8 33 2d fe ff 0f 1f 00 31 f6 e9 49 fe
[   40.252875] RSP: 0018:ffffb39e021bbbd0 EFLAGS: 00010246
[   40.252877] RAX: 0000000000000000 RBX: ffff8afc6c7b2428 RCX: 0000000000000000
[   40.252878] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff8afc6c7b2428
[   40.252879] RBP: ffff8afc6c7b2428 R08: 000000000000038b R09: 0000000000000004
[   40.252880] R10: 0000000000000981 R11: 0000000000000001 R12: 0000000000000000
[   40.252881] R13: ffffb39e021bbc68 R14: ffffffffa707c890 R15: 0000000000000000
[   40.252883] FS:  00007f72e4861700(0000) GS:ffff8afc6ea00000(0000) knlGS:0000000000000000
[   40.252884] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   40.252885] CR2: 00007ffeb97f8080 CR3: 0000000453cc2002 CR4: 00000000003606f0
[   40.252886] Call Trace:
[   40.252895]  ? ipc_log_header+0x1a6/0x4b0 [snd_sof]
[   40.252899]  ? sof_ipc_tx_message_unlocked+0x12d/0x2d0 [snd_sof]
[   40.252903]  __cancel_work_timer+0x11f/0x1a0
[   40.252907]  ? sof_ipc_tx_message+0x61/0x80 [snd_sof]
[   40.252910]  sof_pcm_hw_free+0x158/0x170 [snd_sof]
[   40.252919]  soc_pcm_components_hw_free+0x5c/0x80 [snd_soc_core]
[   40.252926]  soc_pcm_hw_free+0x121/0x1d0 [snd_soc_core]
[   40.252932]  dpcm_fe_dai_hw_free+0x73/0x100 [snd_soc_core]
[   40.252937]  snd_pcm_hw_params+0x12d/0x5d0 [snd_pcm]
[   40.252942]  ? _cond_resched+0x10/0x40
[   40.252945]  ? __kmalloc_track_caller+0x130/0x1b0
[   40.252950]  snd_pcm_common_ioctl+0x19e/0xc80 [snd_pcm]
[   40.252954]  snd_pcm_ioctl+0x25/0x30 [snd_pcm]
[   40.252958]  do_vfs_ioctl+0x9f/0x620
[   40.252961]  ksys_ioctl+0x6b/0x80
[   40.252963]  ? __x64_sys_fcntl+0x79/0xa0
[   40.252965]  __x64_sys_ioctl+0x11/0x20
[   40.252968]  do_syscall_64+0x43/0xf0
[   40.252972]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   40.252975] RIP: 0033:0x7f72e3b62f47
[   40.252977] Code: 00 00 00 48 8b 05 51 6f 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 21 6f 2c 00 f7 d8 64 89 01 48
[   40.252978] RSP: 002b:00007ffeb97d6058 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[   40.252980] RAX: ffffffffffffffda RBX: 0000000000ca8930 RCX: 00007f72e3b62f47
[   40.252981] RDX: 00007ffeb97d6200 RSI: 00000000c2604111 RDI: 0000000000000004
[   40.252982] RBP: 00007ffeb97d6200 R08: 0000000000000000 R09: 0000000000000000
[   40.252983] R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000cb0f30
[   40.252984] R13: 00007ffeb97d6084 R14: 000000000000fff0 R15: 000000000000bb80
[   40.252986] ---[ end trace f650cc8d0b7400b0 ]---
[   40.253192] sof-audio-acpi INT3438:00: pcm: close stream 1 dir 0
[   40.253858] speaker-test (2841) used greatest stack depth: 11672 bytes left
[   40.339637] sof-audio-acpi INT3438:00: ipc rx: 0x90020000: GLB_TRACE_MSG
[   40.339648] sof-audio-acpi INT3438:00: ipc rx done: 0x90020000: GLB_TRACE_MSG

dmesg.log

firmware 6eb79af
kernel 35d7759

Activity

  1. added
    BDWApplies to Broadwell platform
    bugSomething isn't working
    on May 11, 2019
  2. plbossart commented on May 14, 2019

    @plbossart
    MemberAuthor

    @keyonjie this can be root caused to your changes for the period_elapsed work queue. When an error occurs in sof_pcm_hw_params(), the INIT_WORK is not executed, but we still call sof_pcm_hw_free() and call cancel_work_sync() with an uninitialized work queue. that's not so good.

    I am not sure how to deal with this except with a flag that indicates the workqueue was successfully initialized.

  3. plbossart commented on May 14, 2019

    @plbossart
    MemberAuthor

    PR947 fixes the issue

    root@galliumos:~# speaker-test -Dhw:1,1 -c2 -r48000 
    
    speaker-test 1.1.0
    
    Playback device is hw:1,1
    Stream parameters are 48000Hz, S16_LE, 2 channels
    Using 16 octaves of pink noise
    Rate set to 48000Hz (requested 48000Hz)
    Buffer size range from 96 to 2096640
    Period size range from 48 to 65520
    Using max buffer size 2096640
    Periods = 4
    Unable to set hw params for playback: Invalid argument
    Setting of hwparams failed: Invalid argument
    
    [   71.939204] sof-audio-acpi INT3438:00: pcm: open stream 1 dir 0
    [   71.939210] sof-audio-acpi INT3438:00: period min 192 max 262144 bytes
    [   71.939213] sof-audio-acpi INT3438:00: period count 2 max 32
    [   71.939216] sof-audio-acpi INT3438:00: buffer max 8388608 bytes
    [   71.939487] sof-audio-acpi INT3438:00: rate_min: 48000 rate_max: 48000
    [   71.939489] sof-audio-acpi INT3438:00: channels_min: 2 channels_max: 2
    [   71.939492] sof-audio-acpi INT3438:00: rate_min: 48000 rate_max: 48000
    [   71.939494] sof-audio-acpi INT3438:00: channels_min: 2 channels_max: 2
    [   71.939499] sof-audio-acpi INT3438:00: rate_min: 48000 rate_max: 48000
    [   71.939501] sof-audio-acpi INT3438:00: channels_min: 2 channels_max: 2
    [   71.939503] sof-audio-acpi INT3438:00: pcm: hw params stream 1 dir 0
    [   71.939506] sof-audio-acpi INT3438:00: generating page table for 000000007d5b824f size 0x7ff800 pages 2048
    [   71.939517] sof-audio-acpi INT3438:00: stream_tag 0
    [   71.939523] sof-audio-acpi INT3438:00: ipc tx: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
    [   71.939612] sof-audio-acpi INT3438:00: error: ipc error for 0x60010000 size 20
    [   71.939616] sof-audio-acpi INT3438:00: error: hw params ipc failed for stream 0
    [   71.939619] sof-audio-acpi INT3438:00: ASoC: INT3438:00 hw params failed: -22
    [   71.939621]  Media Playback 1: ASoC: hw_params FE failed -22
    [   71.939625] sof-audio-acpi INT3438:00: pcm: free stream 1 dir 0
    [   71.939628] sof-audio-acpi INT3438:00: ipc tx: 0x60030000: GLB_STREAM_MSG: PCM_FREE
    [   71.939695] sof-audio-acpi INT3438:00: ipc tx succeeded: 0x60030000: GLB_STREAM_MSG: PCM_FREE
    [   71.939776] sof-audio-acpi INT3438:00: pcm: close stream 1 dir 0
    
  4. changed the title [-]Broadwell: kernel oops on using media pipeline[/-] [+]Broadwell: kernel warning w/ failed hw_params on media pipeline[/+] on May 14, 2019
  5. wenqingfu commented on May 22, 2019

    @wenqingfu

    fixed by #947

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

    BDWApplies to Broadwell platformbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions