Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][LNL] call trace error happens when doing audio playback on LNL-NOCODEC platform #4655

Closed
keqiaozhang opened this issue Oct 25, 2023 · 5 comments
Labels
I2S LNL Applies to Lunar Lake platform P1 Blocker bugs or important features

Comments

@keqiaozhang
Copy link
Collaborator

Describe the bug
This is a also a kernel regression and it may introduced by the upstream merge.
bi-section is ongoing, it takes time.

dmesg

[   94.513614] snd_sof:sof_pcm_open: sof-audio-pci-intel-lnl 0000:00:1f.3: pcm: open stream 0 dir 0
[   94.513625] snd_sof:sof_pcm_open: sof-audio-pci-intel-lnl 0000:00:1f.3: period min 192 max 16384 bytes
[   94.513633] snd_sof:sof_pcm_open: sof-audio-pci-intel-lnl 0000:00:1f.3: period count 2 max 16
[   94.513641] snd_sof:sof_pcm_open: sof-audio-pci-intel-lnl 0000:00:1f.3: buffer max 65536 bytes
[   94.514936] snd_sof:sof_ipc4_pcm_dai_link_fixup: sof-audio-pci-intel-lnl 0000:00:1f.3: Set NoCodec-0 to 32 bit format
[   94.515014] BUG: kernel NULL pointer dereference, address: 0000000000000004
[   94.515032] #PF: supervisor read access in kernel mode
[   94.515041] #PF: error_code(0x0000) - not-present page
[   94.515051] PGD 0 P4D 0
[   94.515067] Oops: 0000 [#1] PREEMPT SMP NOPTI
[   94.515079] CPU: 3 PID: 2296 Comm: speaker-test Not tainted 6.6.0-rc1-g0ca0a44d98db #dev
[   94.515089] Hardware name: Intel Corporation Lunar Lake Client Platform/LNL-M LP5 RVP1, BIOS LNLMFWI1.R00.2351.D86.2309202117 09/20/2023
[   94.515095] RIP: 0010:generic_calc_stream_format+0x49/0x190 [snd_sof_intel_hda_common]
[   94.515161] Code: 70 10 44 8b 46 28 45 85 c0 0f 84 10 01 00 00 4c 8b 90 00 06 00 00 44 8b 4e 18 31 c0 31 ff eb 13 48 8b 56 30 48 63 c8 83 c0 01 <0b> 7c ca 04 44 39 c0 74 0b 42 8d 14 08 49 83 3c d2 00 75 e2 44 8b
[   94.515169] RSP: 0018:ffffc90004c9b710 EFLAGS: 00010202
[   94.515179] RAX: 0000000000000001 RBX: ffff88810479c828 RCX: 0000000000000000
[   94.515186] RDX: 0000000000000000 RSI: ffff888104e84028 RDI: 0000000000000000
[   94.515191] RBP: ffffc90004c9b808 R08: 0000000000000001 R09: 0000000000000001
[   94.515196] R10: ffff888104971b68 R11: ffff888104971b78 R12: ffff88810479c828
[   94.515202] R13: ffff888106540400 R14: ffff888108460200 R15: ffffffffc0707000
[   94.515208] FS:  00007f3960974740(0000) GS:ffff88846f000000(0000) knlGS:0000000000000000
[   94.515215] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   94.515222] CR2: 0000000000000004 CR3: 0000000129c80003 CR4: 0000000000f70ee0
[   94.515229] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   94.515234] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 0000000000000400
[   94.515240] PKRU: 55555554
[   94.515244] Call Trace:
[   94.515254]  <TASK>
[   94.515262]  ? __die+0x24/0x70
[   94.515280]  ? page_fault_oops+0x15b/0x440
[   94.515293]  ? local_clock_noinstr+0xd/0xb0
[   94.515314]  ? exc_page_fault+0x64/0x190
[   94.515328]  ? asm_exc_page_fault+0x26/0x30
[   94.515346]  ? generic_calc_stream_format+0x49/0x190 [snd_sof_intel_hda_common]
[   94.515389]  hda_dai_hw_params+0x17f/0x2b0 [snd_sof_intel_hda_common]
[   94.515436]  non_hda_dai_hw_params+0x50/0x180 [snd_sof_intel_hda_common]
[   94.515476]  snd_soc_dai_hw_params+0x39/0xa0 [snd_soc_core]
[   94.515599]  __soc_pcm_hw_params+0x543/0x710 [snd_soc_core]
[   94.515735]  dpcm_be_dai_hw_params+0x1e5/0x390 [snd_soc_core]
[   94.515849]  dpcm_fe_dai_hw_params+0xd0/0x220 [snd_soc_core]
[   94.515928]  snd_pcm_hw_params+0x3ba/0x6a0 [snd_pcm]
[   94.515983]  ? __might_fault+0x26/0x30
[   94.515996]  ? _copy_from_user+0x24/0x90
[   94.516008]  snd_pcm_common_ioctl+0x1a4/0x1540 [snd_pcm]
[   94.516066]  ? ioctl_has_perm.constprop.0.isra.0+0xba/0x110
[   94.516092]  snd_pcm_ioctl+0x27/0x40 [snd_pcm]
[   94.516153]  __x64_sys_ioctl+0x8e/0xd0
[   94.516176]  do_syscall_64+0x3c/0x90
[   94.516193]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[   94.516211] RIP: 0033:0x7f3960a91aff
[   94.516224] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00
[   94.516235] RSP: 002b:00007ffeca7aec20 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[   94.516250] RAX: ffffffffffffffda RBX: 00007ffeca7aee10 RCX: 00007f3960a91aff
[   94.516259] RDX: 00007ffeca7aee10 RSI: 00000000c2604111 RDI: 0000000000000004
[   94.516267] RBP: 0000561073307d50 R08: 0000000000000000 R09: 0000000000000000
[   94.516275] R10: 0000000000000004 R11: 0000000000000246 R12: 0000561073307cd0
[   94.516284] R13: 000000000000bb80 R14: 0000000000000000 R15: 0000000000001000
[   94.516303]  </TASK>
[   94.516309] Modules linked in: squashfs r8153_ecm cdc_ether usbnet snd_sof_ipc_msg_injector snd_sof_nocodec snd_sof_probes r8152 snd_soc_dmic snd_sof_pci_intel_lnl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation snd_sof_intel_hda_mlink soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_compress snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device wmi_bmof snd_timer x86_pkg_temp_thermal snd soundcore intel_powerclamp soundwire_bus video wmi intel_pmc_core fuse drm efivarfs xhci_pci xhci_hcd
[   94.516436] CR2: 0000000000000004
[   94.516442] ---[ end trace 0000000000000000 ]---
[   94.516446] RIP: 0010:generic_calc_stream_format+0x49/0x190 [snd_sof_intel_hda_common]
[   94.516480] Code: 70 10 44 8b 46 28 45 85 c0 0f 84 10 01 00 00 4c 8b 90 00 06 00 00 44 8b 4e 18 31 c0 31 ff eb 13 48 8b 56 30 48 63 c8 83 c0 01 <0b> 7c ca 04 44 39 c0 74 0b 42 8d 14 08 49 83 3c d2 00 75 e2 44 8b
[   94.516484] RSP: 0018:ffffc90004c9b710 EFLAGS: 00010202
[   94.516489] RAX: 0000000000000001 RBX: ffff88810479c828 RCX: 0000000000000000
[   94.516492] RDX: 0000000000000000 RSI: ffff888104e84028 RDI: 0000000000000000
[   94.516496] RBP: ffffc90004c9b808 R08: 0000000000000001 R09: 0000000000000001
[   94.516499] R10: ffff888104971b68 R11: ffff888104971b78 R12: ffff88810479c828
[   94.516502] R13: ffff888106540400 R14: ffff888108460200 R15: ffffffffc0707000
[   94.516506] FS:  00007f3960974740(0000) GS:ffff88846f000000(0000) knlGS:0000000000000000
[   94.516510] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   94.516513] CR2: 0000000000000004 CR3: 0000000129c80003 CR4: 0000000000f70ee0
[   94.516516] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   94.516520] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 0000000000000400
[   94.516523] PKRU: 55555554
[   94.516526] note: speaker-test[2296] exited with irqs disabled

To Reproduce
speaker-test -Dhw:0,0 -t wav -c 2

Reproduction Rate
100%

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • Kernel: {SHA}
  2. Name of the topology file
    • Topology: {sof-lnl-nocodec.tplg}
  3. Name of the platform(s) on which the bug is observed.
    • Platform: {LNL-NOCODEC-RVP}
@keqiaozhang keqiaozhang added P1 Blocker bugs or important features I2S LNL Applies to Lunar Lake platform labels Oct 25, 2023
@keqiaozhang
Copy link
Collaborator Author

keqiaozhang commented Oct 25, 2023

Bi-sect is not progressing well. some commits failed to build.

The result shows that:
There are only 'skip'ped commits left to test.
The first bad commit could be any of:
#4533:
2b5b41a
8f6ba51
2b27701
d4c843e
42730b1
7f9512a
301cb61

#4628:
a8ab800
9917e64
We cannot bisect more!

Above commits are belong to 2 PRs: #4533 and #4628.
I will do more tests tomorrow.

@keqiaozhang
Copy link
Collaborator Author

There’s a strong dependency between these two PRs and I cannot revert them separately, so it's hard to locate the first bad commit.
The best result I got is that this issue cannot be reproduced after reverting #4628. +301cb61 + 7f9512a + 2b5b41a.

@plbossart
Copy link
Member

I'll work on this tomorrow @keqiaozhang

This was not tested before so there's no real point in bisecting, no one knows when the last stable point was.

@plbossart
Copy link
Member

I can reproduce this issue with the latest kernel

9c0dfcd ("ASoC: hdac_hda: Conditionally register dais for HDMI and Analog")

plbossart added a commit to plbossart/sound that referenced this issue Oct 26, 2023
Commit 7f9512a ("ASoC: SOF: Intel: hda-dai-ops: fix HDaudio link format")
assumed that the codec_ch_maps is set unconditionally.

This is however not true in the nocodec mode, the codec_ch_maps is not
set for the dummy dais.

Note that this fixes
thesofproject#4655 but on the second
playback we still have a DSP panic. It's likely a separate issue
likely tied to topology or multi-core handling.

[  118.660171] snd_sof:sof_widget_setup_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget smart_amp.2.1 setup complete
[  118.660174] snd_sof:sof_ipc4_widget_setup: sof-audio-pci-intel-lnl 0000:00:1f.3: Create widget dai-copier.SSP.NoCodec-0.playback instance 1 - pipe 2 - core 0
[  118.660176] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc tx      : 0x40010004|0x10056: MOD_INIT_INSTANCE [data size: 344]
[  118.663559] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc rx      : 0x1b0a0000|0x0: GLB_NOTIFICATION|EXCEPTION_CAUGHT
[  118.663565] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ DSP dump start ]------------
[  118.663571] sof-audio-pci-intel-lnl 0000:00:1f.3: DSP panic!
[  118.663573] sof-audio-pci-intel-lnl 0000:00:1f.3: fw_state: SOF_FW_BOOT_COMPLETE (7)
[  118.663585] sof-audio-pci-intel-lnl 0000:00:1f.3: ROM status: 0x5, ROM error: 0x0
[  118.663587] sof-audio-pci-intel-lnl 0000:00:1f.3: ROM debug status: 0x0, ROM debug error: 0x0
[  118.663592] sof-audio-pci-intel-lnl 0000:00:1f.3: ROM feature bit enabled
[  118.663614] snd_sof:sof_ipc4_find_debug_slot_offset_by_type: sof-audio-pci-intel-lnl 0000:00:1f.3: Slot type 0x4c455400 is not available in debug window
[  118.663616] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ DSP dump end ]------------
[  118.663619] snd_sof:sof_set_fw_state: sof-audio-pci-intel-lnl 0000:00:1f.3: fw_state change: 7 -> 8
[  118.663629] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc rx done : 0x1b0a0000|0x0: GLB_NOTIFICATION|EXCEPTION_CAUGHT
[  119.168384] sof-audio-pci-intel-lnl 0000:00:1f.3: ipc timed out for 0x40010004|0x10056
[  119.168396] sof-audio-pci-intel-lnl 0000:00:1f.3: Attempting to prevent DSP from entering D3 state to preserve context
[  119.168399] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ IPC dump start ]------------
[  119.168445] sof-audio-pci-intel-lnl 0000:00:1f.3: Host IPC initiator: 0xc0010004|0x10056|0x0, target: 0x1b0a0000|0x0|0x0, ctl: 0x3
[  119.168449] sof-audio-pci-intel-lnl 0000:00:1f.3: ------------[ IPC dump end ]------------
[  119.168452] sof-audio-pci-intel-lnl 0000:00:1f.3: IPC timeout
[  119.168476] sof-audio-pci-intel-lnl 0000:00:1f.3: failed to create module dai-copier.SSP.NoCodec-0.playback
[  119.168490] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget smart_amp.2.1 freed
[  119.168493] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget gain.2.1 freed
[  119.168498] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc tx      : 0x12010000|0x0: GLB_DELETE_PIPELINE
[  119.168605] sof-audio-pci-intel-lnl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0x12010000|0x0 failed: -19
[  119.168609] sof-audio-pci-intel-lnl 0000:00:1f.3: failed to free pipeline widget pipeline.2
[  119.168613] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget mixin.1.1 freed
[  119.168616] snd_sof:sof_widget_free_unlocked: sof-audio-pci-intel-lnl 0000:00:1f.3: widget gain.1.1 freed
[  119.168620] snd_sof:sof_ipc4_log_header: sof-audio-pci-intel-lnl 0000:00:1f.3: ipc tx      : 0x12000000|0x0: GLB_DELETE_PIPELINE
[  119.168622] sof-audio-pci-intel-lnl 0000:00:1f.3: ipc4_tx_msg_unlocked: ipc message send for 0x12000000|0x0 failed: -19
[  119.168625] sof-audio-pci-intel-lnl 0000:00:1f.3: failed to free pipeline widget pipeline.1
[  119.168627] sof-audio-pci-intel-lnl 0000:00:1f.3: Failed to set up connected widgets
[  119.168634] sof-audio-pci-intel-lnl 0000:00:1f.3: error: failed widget list set up for pcm 0 dir 0
[  119.168637] sof-audio-pci-intel-lnl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:1f.3: -110
[  119.168663]  Port0: ASoC: error at __soc_pcm_hw_params on Port0: -110
[  119.168695]  Port0: ASoC: error at dpcm_fe_dai_hw_params on Port0: -110

Signed-off-by: Pierre-Louis Bossart <[email protected]>
@plbossart
Copy link
Member

@keqiaozhang can you try PR #4665 to see if this works for you. Not sure what topology you are using, I used topology2/sof-ace-tplg/development/sof-lnl-nocodec.tplg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2S LNL Applies to Lunar Lake platform P1 Blocker bugs or important features
Projects
None yet
Development

No branches or pull requests

2 participants