Skip to content

SoundWire: kernel oops on COMP_NEW IPC fail. #3641

Closed

Description

@plbossart

While running experiments with a modified SoundWire driver to allow for driver bind/unbind and the following script:

set -e

echo "removing machine driver"
modprobe -r snd-soc-sof-sdw
sleep 1
echo "removing mic"
modprobe -r snd_soc_rt715_sdca
sleep 1

echo "adding mic"
modprobe snd_soc_rt715_sdca
sleep 1
echo "adding machine driver"
modprobe snd-soc-sof-sdw
sleep 1

I ended-up with a kernel oops on an IPC error.

The IPC error is bad enough in itself, the kernel oops cannot happen.

[  459.060320] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx error for 0x30010000 (msg/reply size: 92/20): -22
[  459.060336] sof-audio-pci-intel-tgl 0000:00:1f.3: Failed to setup widget PCM7P
[  459.060353] BUG: kernel NULL pointer dereference, address: 0000000000000078
[  459.060359] #PF: supervisor read access in kernel mode
[  459.060364] #PF: error_code(0x0000) - not-present page
[  459.060370] PGD 0 P4D 0 
[  459.060377] Oops: 0000 [#1] PREEMPT SMP NOPTI
[  459.060385] CPU: 1 PID: 1603 Comm: modprobe Not tainted 5.18.0-rc2-test-05255-g3ba5af85a845-dirty #179
[  459.060393] Hardware name: Dell Inc. Latitude 9420/0208BI, BIOS 99.1.42 08/21/2020
[  459.060397] RIP: 0010:sof_widget_free+0x13/0x270 [snd_sof]
[  459.060441] Code: ff ff ff 0f 1f 40 00 0f 1f 44 00 00 be 01 00 00 00 e9 31 ff ff ff 90 0f 1f 44 00 00 41 57 41 56 41 55 41 54 55 53 48 83 ec 08 <48> 83 7e 78 00 0f 84 a0 01 00 00 48 8b 87 78 03 00 00 49 89 ff 48
[  459.060449] RSP: 0018:ffffa81d0196f948 EFLAGS: 00010296
[  459.060457] RAX: 0000000000000028 RBX: ffff9f3405839e80 RCX: ffff9f34148db928
[  459.060461] RDX: 0000000000000164 RSI: 0000000000000000 RDI: ffff9f340e18c828
[  459.060465] RBP: ffffffffc09674c0 R08: ffffffffa5f62d68 R09: 0000000000009ffb
[  459.060468] R10: 000000000000197e R11: ffffffffa5f32d80 R12: 00000000ffffffea
[  459.060471] R13: ffff9f340e18c828 R14: 0000000000000000 R15: 0000000000000000
[  459.060475] FS:  00007f69171d1540(0000) GS:ffff9f377ea00000(0000) knlGS:0000000000000000
[  459.060479] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  459.060483] CR2: 0000000000000078 CR3: 0000000142242004 CR4: 0000000000770ee0
[  459.060486] PKRU: 55555554
[  459.060489] Call Trace:
[  459.060495]  <TASK>
[  459.060502]  sof_widget_setup+0x28c/0x330 [snd_sof]
[  459.060524]  sof_ipc3_set_up_all_pipelines+0x91/0x1c0 [snd_sof]
[  459.060547]  ? soc_tplg_check_elem_count+0x40/0x40 [snd_soc_core]
[  459.060584]  snd_soc_tplg_component_load+0x23d/0x280 [snd_soc_core]
[  459.060616]  snd_sof_load_topology+0x5b/0xd0 [snd_sof]
[  459.060638]  sof_pcm_probe+0x4f/0x70 [snd_sof]
[  459.060656]  snd_soc_component_probe+0x1e/0x40 [snd_soc_core]
[  459.060689]  soc_probe_component+0x1d0/0x300 [snd_soc_core]
[  459.060715]  snd_soc_bind_card+0x504/0xce0 [snd_soc_core]
[  459.060738]  ? is_module_address+0x43/0x70
[  459.060750]  ? lockdep_init_map_type+0x51/0x240
[  459.060757]  ? debug_mutex_init+0x33/0x40
[  459.060764]  devm_snd_soc_register_card+0x43/0x80 [snd_soc_core]
[  459.060796]  mc_probe+0x9bb/0x1060 [snd_soc_sof_sdw]
[  459.060813]  platform_probe+0x54/0xb0
[  459.060823]  really_probe+0x199/0x380
[  459.060831]  __driver_probe_device+0xfe/0x180
[  459.060838]  driver_probe_device+0x1e/0x90
[  459.060844]  __driver_attach+0xc4/0x1d0
[  459.060850]  ? __device_attach_driver+0xe0/0xe0
[  459.060856]  ? __device_attach_driver+0xe0/0xe0
[  459.060862]  bus_for_each_dev+0x78/0xc0
[  459.060869]  bus_add_driver+0x14c/0x1f0
[  459.060876]  driver_register+0x8f/0xe0
[  459.060884]  ? 0xffffffffc0248000
[  459.060889]  do_one_initcall+0x6f/0x270
[  459.060898]  ? kmem_cache_alloc_trace+0x4f/0x210
[  459.060907]  do_init_module+0x4c/0x240
[  459.060916]  __do_sys_finit_module+0xb4/0x120
[  459.060932]  do_syscall_64+0x38/0x90
[  459.060945]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[  459.060955] RIP: 0033:0x7f691731376d
[  459.060962] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01 48
[  459.060969] RSP: 002b:00007fff3d42b458 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[  459.060977] RAX: ffffffffffffffda RBX: 00005584561c49c0 RCX: 00007f691731376d
[  459.060982] RDX: 0000000000000000 RSI: 00005584561cc9e0 RDI: 0000000000000004
[  459.060987] RBP: 0000000000040000 R08: 0000000000000000 R09: 0000000000000000
[  459.060991] R10: 0000000000000004 R11: 0000000000000246 R12: 00005584561cc9e0
[  459.060996] R13: 0000000000000000 R14: 00005584561c4af0 R15: 00005584561c49c0
[  459.061004]  </TASK>
[  459.061007] Modules linked in: snd_soc_sof_sdw(+) snd_soc_intel_sof_maxim_common snd_soc_rt715_sdca snd_soc_rt711_sdca fuse snd_ctl_led ledtrig_audio snd_soc_rt1316_sdw regmap_sdw_mbq regmap_sdw snd_sof_probes snd_soc_dmic snd_sof_ipc_flood_test snd_sof_ipc_msg_injector snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress wmi_bmof snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hwdep snd_hda_core ax88179_178a usbnet snd_pcm x86_pkg_temp_thermal snd_seq_midi snd_seq_midi_event intel_powerclamp snd_rawmidi snd_seq snd_seq_device snd_timer snd soundcore iwlmvm mei_me iwlwifi hid_multitouch mei i915 i2c_algo_bit drm_buddy processor_thermal_device_pci_legacy drm_dp_helper processor_thermal_device drm_kms_helper processor_thermal_rfim ttm processor_thermal_mbox intel_soc_dts_iosf wmi
[  459.061130]  int3403_thermal int340x_thermal_zone int3400_thermal intel_pmc_core acpi_thermal_rel squashfs drm drm_panel_orientation_quirks efivarfs intel_ishtp_hid spi_pxa2xx_platform psmouse intel_lpss_pci xhci_pci intel_lpss idma64 intel_ish_ipc mfd_core xhci_hcd intel_ishtp vmd i2c_hid_acpi i2c_hid [last unloaded: snd_soc_rt715_sdca]
[  459.061176] CR2: 0000000000000078
[  459.061182] ---[ end trace 0000000000000000 ]---
[  459.061186] RIP: 0010:sof_widget_free+0x13/0x270 [snd_sof]
[  459.061211] Code: ff ff ff 0f 1f 40 00 0f 1f 44 00 00 be 01 00 00 00 e9 31 ff ff ff 90 0f 1f 44 00 00 41 57 41 56 41 55 41 54 55 53 48 83 ec 08 <48> 83 7e 78 00 0f 84 a0 01 00 00 48 8b 87 78 03 00 00 49 89 ff 48
[  459.061215] RSP: 0018:ffffa81d0196f948 EFLAGS: 00010296
[  459.061219] RAX: 0000000000000028 RBX: ffff9f3405839e80 RCX: ffff9f34148db928
[  459.061224] RDX: 0000000000000164 RSI: 0000000000000000 RDI: ffff9f340e18c828
[  459.061229] RBP: ffffffffc09674c0 R08: ffffffffa5f62d68 R09: 0000000000009ffb
[  459.061233] R10: 000000000000197e R11: ffffffffa5f32d80 R12: 00000000ffffffea
[  459.061236] R13: ffff9f340e18c828 R14: 0000000000000000 R15: 0000000000000000
[  459.061239] FS:  00007f69171d1540(0000) GS:ffff9f377ea00000(0000) knlGS:0000000000000000
[  459.061243] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  459.061248] CR2: 0000000000000078 CR3: 0000000142242004 CR4: 0000000000770ee0
[  459.061253] PKRU: 55555554

Activity

  1. plbossart commented on May 12, 2022

    @plbossart
    MemberAuthor

    Another IPC error

    [  652.200599] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x30100000: GLB_TPLG_MSG: PIPE_NEW
    [  652.200802] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx error for 0x30100000 (msg/reply size: 48/20): -22
    [  652.200819] sof-audio-pci-intel-tgl 0000:00:1f.3: Failed to setup widget PIPELINE.30.ALH2.OUT
    [  652.201227] sof-audio-pci-intel-tgl 0000:00:1f.3: error: tplg component load failed -22
    [  652.201235] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to load DSP topology -22
    [  652.201237] sof-audio-pci-intel-tgl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22
    [  652.201274] sof_sdw sof_sdw: ASoC: failed to instantiate card -22
    [  652.201466] sof_sdw sof_sdw: snd_soc_register_card failed -22
    [  652.201468] sof_sdw: probe of sof_sdw failed with error -22
    
    
  2. plbossart commented on May 16, 2022

    @plbossart
    MemberAuthor

    Looks like we have 2 IPC issues, one on PIPE_NEW tracked by #3652 and the other on COMP_NEW:

    [   91.546264] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x30010000: GLB_TPLG_MSG: COMP_NEW
    [   91.546566] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx error for 0x30010000 (msg/reply size: 92/20): -22
    [   91.546570] sof-audio-pci-intel-tgl 0000:00:1f.3: Failed to setup widget PCM7P
    [   91.546573] BUG: kernel NULL pointer dereference, address: 0000000000000078
    [   91.546574] #PF: supervisor read access in kernel mode
    [   91.546575] #PF: error_code(0x0000) - not-present page
    [   91.546577] PGD 0 P4D 0 
    [   91.546578] Oops: 0000 [#1] PREEMPT SMP NOPTI
    [   91.546580] CPU: 2 PID: 338 Comm: kworker/u16:9 Not tainted 5.18.0-rc2-test-05360-gd2e9a6dfa605-dirty #199
    [   91.546582] Hardware name: Dell Inc. Latitude 9520/020844, BIOS 88.26.9 08/14/2020
    [   91.546583] Workqueue: events_unbound deferred_probe_work_func
    [   91.546587] RIP: 0010:sof_widget_free+0x13/0x270 [snd_sof]
    [   91.546596] Code: ff ff ff 0f 1f 40 00 0f 1f 44 00 00 be 01 00 00 00 e9 31 ff ff ff 90 0f 1f 44 00 00 41 57 41 56 41 55 41 54 55 53 48 83 ec 08 <48> 83 7e 78 00 0f 84 a0 01 00 00 48 8b 87 78 03 00 00 49 89 ff 48
    [   91.546597] RSP: 0018:ffffb937c125f990 EFLAGS: 00010286
    [   91.546599] RAX: 0000000000000028 RBX: ffff9d19ffd74000 RCX: ffff9d19c1579628
    [   91.546600] RDX: 0000000000000164 RSI: 0000000000000000 RDI: ffff9d19d7912028
    [   91.546601] RBP: ffffffffc0b394c0 R08: ffffffffb6362d68 R09: 0000000000009ffb
    [   91.546602] R10: 0000000000001992 R11: ffffffffb6332d80 R12: 00000000ffffffea
    [   91.546603] R13: ffff9d19d7912028 R14: 0000000000000000 R15: 0000000000000000
    [   91.546604] FS:  0000000000000000(0000) GS:ffff9d1d3ec00000(0000) knlGS:0000000000000000
    [   91.546605] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [   91.546606] CR2: 0000000000000078 CR3: 00000001139f2002 CR4: 0000000000770ee0
    [   91.546607] PKRU: 55555554
    [   91.546608] Call Trace:
    [   91.546610]  <TASK>
    [   91.546612]  sof_widget_setup+0x28c/0x330 [snd_sof]
    [   91.546619]  sof_ipc3_set_up_all_pipelines+0x91/0x1c0 [snd_sof]
    [   91.546626]  ? soc_tplg_check_elem_count+0x40/0x40 [snd_soc_core]
    [   91.546637]  snd_soc_tplg_component_load+0x23d/0x280 [snd_soc_core]
    [   91.546647]  snd_sof_load_topology+0x5b/0xd0 [snd_sof]
    [   91.546653]  sof_pcm_probe+0x4f/0x70 [snd_sof]
    [   91.546658]  snd_soc_component_probe+0x1e/0x40 [snd_soc_core]
    [   91.546667]  soc_probe_component+0x1d0/0x300 [snd_soc_core]
    [   91.546675]  snd_soc_bind_card+0x504/0xce0 [snd_soc_core]
    [   91.546681]  ? is_module_address+0x43/0x70
    [   91.546685]  ? lockdep_init_map_type+0x51/0x240
    [   91.546687]  ? debug_mutex_init+0x33/0x40
    [   91.546689]  devm_snd_soc_register_card+0x43/0x80 [snd_soc_core]
    [   91.546697]  mc_probe+0x9b1/0x1050 [snd_soc_sof_sdw]
    [   91.546701]  platform_probe+0x54/0xb0
    [   91.546704]  really_probe+0x199/0x380
    [   91.546706]  __driver_probe_device+0xfe/0x180
    [   91.546708]  driver_probe_device+0x1e/0x90
    [   91.546709]  __device_attach_driver+0x72/0xe0
    [   91.546711]  ? driver_allows_async_probing+0x50/0x50
    [   91.546713]  ? driver_allows_async_probing+0x50/0x50
    [   91.546714]  bus_for_each_drv+0x7e/0xd0
    [   91.546716]  __device_attach+0xdd/0x1e0
    [   91.546718]  bus_probe_device+0x9f/0xb0
    [   91.546720]  deferred_probe_work_func+0x8c/0xe0
    [   91.546722]  process_one_work+0x29a/0x530
    [   91.546725]  worker_thread+0x4f/0x3e0
    [   91.546727]  ? rescuer_thread+0x370/0x370
    [   91.546728]  kthread+0xf0/0x120
    [   91.546730]  ? kthread_complete_and_exit+0x20/0x20
    [   91.546731]  ret_from_fork+0x1f/0x30
    [   91.546735]  </TASK>
    [   91.546736] Modules linked in: snd_soc_rt1308_sdw snd_soc_rt1316_sdw snd_soc_rt715 snd_soc_rt715_sdca snd_soc_rt711 snd_soc_rt711_sdca regmap_sdw_mbq regmap_sdw snd_soc_sof_sdw snd_soc_intel_sof_maxim_common snd_ctl_led ledtrig_audio snd_sof_ipc_flood_test snd_soc_dmic snd_sof_probes snd_sof_ipc_msg_injector snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hwdep snd_hda_core snd_pcm wmi_bmof ax88179_178a snd_seq_midi usbnet snd_seq_midi_event snd_rawmidi x86_pkg_temp_thermal snd_seq hid_multitouch intel_powerclamp snd_seq_device snd_timer snd mei_me soundcore mei i915 i2c_algo_bit iwlmvm drm_buddy drm_dp_helper processor_thermal_device_pci_legacy drm_kms_helper processor_thermal_device ttm processor_thermal_rfim iwlwifi
    [   91.546761]  processor_thermal_mbox intel_soc_dts_iosf wmi int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel intel_pmc_core squashfs drm fuse drm_panel_orientation_quirks efivarfs intel_ishtp_hid psmouse intel_lpss_pci xhci_pci intel_lpss intel_ish_ipc idma64 mfd_core xhci_hcd intel_ishtp vmd i2c_hid_acpi i2c_hid [last unloaded: regmap_sdw]
    [   91.546773] CR2: 0000000000000078
    [   91.546775] ---[ end trace 0000000000000000 ]---
    [   91.546776] RIP: 0010:sof_widget_free+0x13/0x270 [snd_sof]
    [   91.546781] Code: ff ff ff 0f 1f 40 00 0f 1f 44 00 00 be 01 00 00 00 e9 31 ff ff ff 90 0f 1f 44 00 00 41 57 41 56 41 55 41 54 55 53 48 83 ec 08 <48> 83 7e 78 00 0f 84 a0 01 00 00 48 8b 87 78 03 00 00 49 89 ff 48
    [   91.546782] RSP: 0018:ffffb937c125f990 EFLAGS: 00010286
    [   91.546784] RAX: 0000000000000028 RBX: ffff9d19ffd74000 RCX: ffff9d19c1579628
    [   91.546785] RDX: 0000000000000164 RSI: 0000000000000000 RDI: ffff9d19d7912028
    [   91.546785] RBP: ffffffffc0b394c0 R08: ffffffffb6362d68 R09: 0000000000009ffb
    [   91.546786] R10: 0000000000001992 R11: ffffffffb6332d80 R12: 00000000ffffffea
    [   91.546787] R13: ffff9d19d7912028 R14: 0000000000000000 R15: 0000000000000000
    [   91.546788] FS:  0000000000000000(0000) GS:ffff9d1d3ec00000(0000) knlGS:0000000000000000
    [   91.546789] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [   91.546790] CR2: 0000000000000078 CR3: 00000001139f2002 CR4: 0000000000770ee0
    [   91.546791] PKRU: 55555554
    [   93.207416] soundwire sdw-master-1: clock stop prep/de-prep done slave:15
    

    sof-logger throws the following errors:

    [    60366256.976] (          44.115) c0 component             src/ipc/ipc3/helper.c:298  INFO comp new host <8b9d100c-6d78-418f-90a3-e0e805d0852b> type 1 id 8.322
    [    60366302.237] (          45.260) c0 dma                           src/lib/dma.c:83   ERROR No DMAC dir 2 caps 0x0 dev 0x1 flags 0x0
    [    60366323.799] (          21.562) c0 dma                           src/lib/dma.c:90   ERROR  DMAC ID 0 users 0 busy channels 0
    [    60366345.258] (          21.458) c0 dma                           src/lib/dma.c:92   ERROR   caps 0x2 dev 0x2c
    [    60366365.518] (          20.260) c0 dma                           src/lib/dma.c:90   ERROR  DMAC ID 1 users 0 busy channels 0
    [    60366385.258] (          19.740) c0 dma                           src/lib/dma.c:92   ERROR   caps 0x2 dev 0x2c
    [    60366405.674] (          20.417) c0 dma                           src/lib/dma.c:90   ERROR  DMAC ID 4 users 1 busy channels 1
    [    60366424.789] (          19.115) c0 dma                           src/lib/dma.c:92   ERROR   caps 0x1 dev 0x1
    [    60366445.101] (          20.312) c0 dma                           src/lib/dma.c:90   ERROR  DMAC ID 5 users 9 busy channels 0
    [    60366464.060] (          18.958) c0 dma                           src/lib/dma.c:92   ERROR   caps 0x1 dev 0x1
    [    60366535.257] (          71.198) c0 host         8.322         src/audio/host.c:647  ERROR host_new(): dma_get() returned NULL
    [    60366571.247] (          35.990) c0 host                  src/ipc/ipc3/helper.c:305  ERROR comp_new(): unable to create the new component
    [    60366587.601] (          16.354) c0 dma-trace                 src/trace/trace.c:138  INFO Suppressed 2 similar messages:  DMAC ID %d users %d busy channels %ld
    [    60366602.080] (          14.479) c0 ipc                   src/ipc/ipc3/helper.c:626  ERROR ipc_comp_new(): component cd = NULL
    [    60366619.372] (          17.292) c0 dma-trace                 src/trace/trace.c:138  INFO Suppressed 2 similar messages:   caps 0x%x dev 0x%x
    
  3. changed the title [-]SoundWire: kernel oops on IPC fail.[/-] [+]SoundWire: kernel oops on COMP_NEW IPC fail.[/+] on May 16, 2022
  4. plbossart commented on May 16, 2022

    @plbossart
    MemberAuthor

    KASAN traces are not super helpful

    [  329.439706] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x30010000: GLB_TPLG_MSG: COMP_NEW
    [  329.440024] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx error for 0x30010000 (msg/reply size: 92/20): -22
    [  329.440034] sof-audio-pci-intel-tgl 0000:00:1f.3: Failed to setup widget PCM7P
    [  329.440039] ==================================================================
    [  329.440041] BUG: KASAN: null-ptr-deref in sof_widget_free+0x22/0x460 [snd_sof]
    [  329.440071] Read of size 8 at addr 0000000000000078 by task kworker/u16:0/8
    
    [  329.440078] CPU: 7 PID: 8 Comm: kworker/u16:0 Not tainted 5.18.0-rc2-test-05360-gd2e9a6dfa605 #200
    [  329.440083] Hardware name: Dell Inc. Latitude 9520/020844, BIOS 88.26.9 08/14/2020
    [  329.440086] Workqueue: events_unbound deferred_probe_work_func
    [  329.440094] Call Trace:
    [  329.440098]  <TASK>
    [  329.440101]  dump_stack_lvl+0x34/0x44
    [  329.440107]  kasan_report+0xbe/0x170
    [  329.440114]  ? sof_widget_free+0x22/0x460 [snd_sof]
    [  329.440142]  sof_widget_free+0x22/0x460 [snd_sof]
    [  329.440169]  ? sof_ipc3_widget_kcontrol_setup+0x7f/0xd0 [snd_sof]
    [  329.440198]  sof_widget_setup+0x4aa/0x570 [snd_sof]
    [  329.440227]  sof_ipc3_set_up_all_pipelines+0xfd/0x300 [snd_sof]
    [  329.440255]  ? soc_tplg_check_elem_count+0x90/0x90 [snd_soc_core]
    [  329.440293]  snd_soc_tplg_component_load+0x404/0x480 [snd_soc_core]
    [  329.440331]  ? soc_tplg_add_kcontrol.isra.0+0xb0/0xb0 [snd_soc_core]
    [  329.440373]  snd_sof_load_topology+0xb7/0x160 [snd_sof]
    [  329.440401]  ? sof_dai_unload+0xe0/0xe0 [snd_sof]
    [  329.440430]  sof_pcm_probe+0xa8/0xd0 [snd_sof]
    [  329.440457]  snd_soc_component_probe+0x36/0x60 [snd_soc_core]
    [  329.440495]  soc_probe_component+0x359/0x5c0 [snd_soc_core]
    [  329.440546]  ? snd_soc_of_get_dai_link_cpus+0x260/0x260 [snd_soc_core]
    [  329.440615]  ? is_module_address+0x43/0x70
    [  329.440628]  snd_soc_bind_card+0x8a2/0x13f0 [snd_soc_core]
    [  329.440698]  devm_snd_soc_register_card+0x43/0x90 [snd_soc_core]
    [  329.440739]  mc_probe+0xff9/0x1700 [snd_soc_sof_sdw]
    [  329.440749]  ? lock_is_held_type+0xd9/0x130
    [  329.440756]  ? create_sdw_dailink.constprop.0+0xe30/0xe30 [snd_soc_sof_sdw]
    [  329.440766]  ? kernfs_create_link+0x90/0x120
    [  329.440772]  ? acpi_dev_pm_attach+0x30/0x180
    [  329.440778]  platform_probe+0x81/0xf0
    [  329.440784]  really_probe+0x26b/0x510
    [  329.440788]  ? driver_allows_async_probing+0x80/0x80
    [  329.440793]  __driver_probe_device+0x18c/0x220
    [  329.440797]  ? driver_allows_async_probing+0x80/0x80
    [  329.440801]  driver_probe_device+0x49/0xf0
    [  329.440806]  __device_attach_driver+0xce/0x130
    [  329.440810]  bus_for_each_drv+0xed/0x150
    [  329.440816]  ? bus_for_each_dev+0x140/0x140
    [  329.440820]  ? do_raw_spin_unlock+0x93/0xf0
    [  329.440825]  ? preempt_count_sub+0x14/0xc0
    [  329.440831]  ? _raw_spin_unlock_irqrestore+0x33/0x50
    [  329.440836]  __device_attach+0x179/0x2a0
    [  329.440840]  ? device_driver_attach+0xf0/0xf0
    [  329.440846]  bus_probe_device+0xfe/0x120
    [  329.440851]  deferred_probe_work_func+0xf1/0x150
    [  329.440855]  process_one_work+0x5e4/0xa00
    [  329.440862]  ? flush_delayed_work+0x60/0x60
    [  329.440867]  ? lock_acquired+0x177/0x5b0
    [  329.440874]  worker_thread+0x2c0/0x710
    [  329.440881]  ? rescuer_thread+0x610/0x610
    [  329.440885]  kthread+0x17b/0x1b0
    [  329.440889]  ? kthread_complete_and_exit+0x20/0x20
    [  329.440894]  ret_from_fork+0x1f/0x30
    [  329.440901]  </TASK>
    [  329.440904] ==================================================================
    [  329.441323] Disabling lock debugging due to kernel taint
    [  329.441327] BUG: kernel NULL pointer dereference, address: 0000000000000078
    [  329.441330] #PF: supervisor read access in kernel mode
    [  329.441333] #PF: error_code(0x0000) - not-present page
    [  329.441336] PGD 0 P4D 0 
    [  329.441341] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN NOPTI
    [  329.441345] CPU: 7 PID: 8 Comm: kworker/u16:0 Tainted: G    B             5.18.0-rc2-test-05360-gd2e9a6dfa605 #200
    [  329.441349] Hardware name: Dell Inc. Latitude 9520/020844, BIOS 88.26.9 08/14/2020
    [  329.441352] Workqueue: events_unbound deferred_probe_work_func
    [  329.441357] RIP: 0010:sof_widget_free+0x22/0x460 [snd_sof]
    [  329.441384] Code: 00 00 e9 d1 fe ff ff 90 0f 1f 44 00 00 41 57 41 56 41 55 41 54 55 48 89 fd 48 8d 7e 78 53 48 89 f3 48 83 ec 18 e8 9e 21 82 d9 <48> 83 7b 78 00 0f 84 95 01 00 00 4c 8d ad 78 03 00 00 4c 89 ef e8
    [  329.441388] RSP: 0018:ffff888101987490 EFLAGS: 00010296
    [  329.441393] RAX: 0000000000000001 RBX: 0000000000000000 RCX: ffffffff9aab11a6
    [  329.441396] RDX: fffffbfff3cec019 RSI: 0000000000000008 RDI: ffffffff9e7600c0
    [  329.441399] RBP: ffff88810d528828 R08: 0000000000000001 R09: ffffffff9e7600c7
    [  329.441402] R10: fffffbfff3cec018 R11: 0000000000000001 R12: 0000000000000000
    [  329.441404] R13: ffff88810d526118 R14: ffff88810c907dd0 R15: 00000000ffffffea
    [  329.441408] FS:  0000000000000000(0000) GS:ffff8883fe800000(0000) knlGS:0000000000000000
    [  329.441413] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  329.441419] CR2: 0000000000000078 CR3: 0000000108c92002 CR4: 0000000000770ee0
    [  329.441424] PKRU: 55555554
    [  329.441429] Call Trace:
    [  329.441435]  <TASK>
    [  329.441439]  ? sof_ipc3_widget_kcontrol_setup+0x7f/0xd0 [snd_sof]
    [  329.441488]  sof_widget_setup+0x4aa/0x570 [snd_sof]
    [  329.441536]  sof_ipc3_set_up_all_pipelines+0xfd/0x300 [snd_sof]
    [  329.441582]  ? soc_tplg_check_elem_count+0x90/0x90 [snd_soc_core]
    [  329.441650]  snd_soc_tplg_component_load+0x404/0x480 [snd_soc_core]
    [  329.441720]  ? soc_tplg_add_kcontrol.isra.0+0xb0/0xb0 [snd_soc_core]
    [  329.441792]  snd_sof_load_topology+0xb7/0x160 [snd_sof]
    [  329.441843]  ? sof_dai_unload+0xe0/0xe0 [snd_sof]
    [  329.441896]  sof_pcm_probe+0xa8/0xd0 [snd_sof]
    [  329.441945]  snd_soc_component_probe+0x36/0x60 [snd_soc_core]
    [  329.442013]  soc_probe_component+0x359/0x5c0 [snd_soc_core]
    [  329.442084]  ? snd_soc_of_get_dai_link_cpus+0x260/0x260 [snd_soc_core]
    [  329.442149]  ? is_module_address+0x43/0x70
    [  329.442159]  snd_soc_bind_card+0x8a2/0x13f0 [snd_soc_core]
    [  329.442231]  devm_snd_soc_register_card+0x43/0x90 [snd_soc_core]
    [  329.442300]  mc_probe+0xff9/0x1700 [snd_soc_sof_sdw]
    [  329.442316]  ? lock_is_held_type+0xd9/0x130
    [  329.442327]  ? create_sdw_dailink.constprop.0+0xe30/0xe30 [snd_soc_sof_sdw]
    [  329.442344]  ? kernfs_create_link+0x90/0x120
    [  329.442352]  ? acpi_dev_pm_attach+0x30/0x180
    [  329.442362]  platform_probe+0x81/0xf0
    [  329.442370]  really_probe+0x26b/0x510
    [  329.442377]  ? driver_allows_async_probing+0x80/0x80
    [  329.442385]  __driver_probe_device+0x18c/0x220
    [  329.442393]  ? driver_allows_async_probing+0x80/0x80
    [  329.442401]  driver_probe_device+0x49/0xf0
    [  329.442409]  __device_attach_driver+0xce/0x130
    [  329.442417]  bus_for_each_drv+0xed/0x150
    [  329.442425]  ? bus_for_each_dev+0x140/0x140
    [  329.442434]  ? do_raw_spin_unlock+0x93/0xf0
    [  329.442442]  ? preempt_count_sub+0x14/0xc0
    [  329.442451]  ? _raw_spin_unlock_irqrestore+0x33/0x50
    [  329.442459]  __device_attach+0x179/0x2a0
    [  329.442466]  ? device_driver_attach+0xf0/0xf0
    [  329.442476]  bus_probe_device+0xfe/0x120
    [  329.442484]  deferred_probe_work_func+0xf1/0x150
    [  329.442491]  process_one_work+0x5e4/0xa00
    [  329.442500]  ? flush_delayed_work+0x60/0x60
    [  329.442508]  ? lock_acquired+0x177/0x5b0
    [  329.442520]  worker_thread+0x2c0/0x710
    [  329.442531]  ? rescuer_thread+0x610/0x610
    [  329.442539]  kthread+0x17b/0x1b0
    [  329.442546]  ? kthread_complete_and_exit+0x20/0x20
    [  329.442555]  ret_from_fork+0x1f/0x30
    [  329.442564]  </TASK>
    [  329.442566] Modules linked in: snd_soc_rt1308_sdw snd_soc_rt1316_sdw snd_soc_rt715 snd_soc_rt715_sdca snd_soc_rt711 snd_soc_rt711_sdca regmap_sdw_mbq regmap_sdw snd_soc_sof_sdw snd_soc_intel_sof_maxim_common wmi_bmof snd_ctl_led ledtrig_audio snd_sof_ipc_msg_injector snd_sof_probes snd_sof_ipc_flood_test snd_soc_dmic x86_pkg_temp_thermal intel_powerclamp snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress snd_hda_intel 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 ax88179_178a usbnet snd_seq snd_seq_device snd_timer iwlmvm hid_multitouch snd mei_me soundcore mei i915 i2c_algo_bit iwlwifi drm_buddy processor_thermal_device_pci_legacy drm_dp_helper processor_thermal_device processor_thermal_rfim drm_kms_helper
    [  329.442688]  processor_thermal_mbox ttm intel_soc_dts_iosf wmi int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel intel_pmc_core squashfs drm drm_panel_orientation_quirks fuse efivarfs intel_ishtp_hid xhci_pci psmouse intel_lpss_pci intel_lpss intel_ish_ipc idma64 intel_ishtp vmd mfd_core xhci_hcd i2c_hid_acpi i2c_hid [last unloaded: regmap_sdw]
    [  329.442760] CR2: 0000000000000078
    [  329.442766] ---[ end trace 0000000000000000 ]---
    [  329.442771] RIP: 0010:sof_widget_free+0x22/0x460 [snd_sof]
    [  329.442822] Code: 00 00 e9 d1 fe ff ff 90 0f 1f 44 00 00 41 57 41 56 41 55 41 54 55 48 89 fd 48 8d 7e 78 53 48 89 f3 48 83 ec 18 e8 9e 21 82 d9 <48> 83 7b 78 00 0f 84 95 01 00 00 4c 8d ad 78 03 00 00 4c 89 ef e8
    [  329.442829] RSP: 0018:ffff888101987490 EFLAGS: 00010296
    [  329.442837] RAX: 0000000000000001 RBX: 0000000000000000 RCX: ffffffff9aab11a6
    [  329.442842] RDX: fffffbfff3cec019 RSI: 0000000000000008 RDI: ffffffff9e7600c0
    [  329.442847] RBP: ffff88810d528828 R08: 0000000000000001 R09: ffffffff9e7600c7
    [  329.442852] R10: fffffbfff3cec018 R11: 0000000000000001 R12: 0000000000000000
    [  329.442858] R13: ffff88810d526118 R14: ffff88810c907dd0 R15: 00000000ffffffea
    [  329.442864] FS:  0000000000000000(0000) GS:ffff8883fe800000(0000) knlGS:0000000000000000
    [  329.442869] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  329.442875] CR2: 0000000000000078 CR3: 0000000108c92002 CR4: 0000000000770ee0
    [  329.442880] PKRU: 55555554
    [  330.871220] soundwire sdw-master-1: clock stop prep/de-prep done slave:15
    
    
  5. plbossart commented on May 16, 2022

    @plbossart
    MemberAuthor

    Additional traces show that we are attempting to free a NULL swidget on IPC error

    [  341.387003] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x30010000: GLB_TPLG_MSG: COMP_NEW
    [  341.387361] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx error for 0x30010000 (msg/reply size: 92/20): -22
    [  341.387370] sof-audio-pci-intel-tgl 0000:00:1f.3: Failed to setup widget PCM7P
    [  341.387375] sof-audio-pci-intel-tgl 0000:00:1f.3: sof_widget_free: swidget is NULL
    [  341.393724] sof-audio-pci-intel-tgl 0000:00:1f.3: error: tplg component load failed -22
    [  341.393994] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to load DSP topology -22
    [  341.394004] sof-audio-pci-intel-tgl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22
    [  341.396992] sof_sdw sof_sdw: ASoC: failed to instantiate card -22
    [  341.399987] sof_sdw sof_sdw: snd_soc_register_card failed -22
    

    Returning -EINVAL is enough to avoid the kernel oops - but the question is why we have an IPC failure in the first place.

  6. added
    SDWApplies to SoundWire bus for codec connection
    P1Blocker bugs or important features
    on May 16, 2022
  7. plbossart commented on May 19, 2022

    @plbossart
    MemberAuthor

    I cannot reproduce this with the latest changes in PR #3642

  8. plbossart commented on May 19, 2022

    @plbossart
    MemberAuthor

    What solves this problem is the commit e760c99

    ASoC: soc-component: make sure device is resumed before probe/remove

    Wow. @ranj063 any ideas?

  9. plbossart commented on Jun 22, 2022

    @plbossart
    MemberAuthor

    fixed

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

    P1Blocker bugs or important featuresSDWApplies to SoundWire bus for codec connection

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions