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

HDAudio upstream regression #3764

Closed
plbossart opened this issue Jul 15, 2022 · 4 comments
Closed

HDAudio upstream regression #3764

plbossart opened this issue Jul 15, 2022 · 4 comments

Comments

@plbossart
Copy link
Member

Tests with #3763 show problematic upstream change

[    6.588685] WARNING: CPU: 1 PID: 287 at sound/hda/array.c:21 snd_array_new+0x93/0xb0 [snd_hda_core]
[    6.588704] Modules linked in: snd_ctl_led snd_soc_skl_hda_dsp(+) snd_soc_intel_hda_dsp_common snd_sof_probes snd_soc_hdac_hdmi snd_sof_ipc_msg_injector snd_sof_ipc_flood_test snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_soc_dmic snd_sof_pci_intel_cnl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils soundwire_bus snd_soc_skl snd_soc_hdac_hda snd_hda_ext_core snd_soc_sst_ipc snd_soc_sst_dsp snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_compress snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hwdep snd_hda_core wmi_bmof snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq x86_pkg_temp_thermal intel_powerclamp i915 snd_seq_device snd_timer drm_buddy snd drm_display_helper processor_thermal_device_pci_legacy soundcore drm_kms_helper processor_thermal_device cfbfillrect syscopyarea cfbimgblt
[    6.588781]  processor_thermal_rfim sysfillrect sysimgblt fb_sys_fops cfbcopyarea processor_thermal_mbox int340x_thermal_zone mei_me intel_soc_dts_iosf mei ttm intel_pch_thermal wmi intel_pmc_core squashfs fuse drm drm_panel_orientation_quirks efivarfs mmc_block spi_pxa2xx_platform xhci_pci igb i2c_algo_bit sdhci_pci cqhci sdhci intel_lpss_pci intel_lpss idma64 mfd_core xhci_hcd
[    6.588823] CPU: 1 PID: 287 Comm: systemd-udevd Not tainted 5.19.0-rc2-test-05536-g24b6f4b3bd88 #281
[    6.588827] Hardware name: AAEON UP-WHL01/UP-WHL01, BIOS UPW1AM18 06/12/2020
[    6.588829] RIP: 0010:snd_array_new+0x93/0xb0 [snd_hda_core]
[    6.588841] Code: 8b 13 8b 43 08 4c 89 63 10 44 89 6b 04 eb 04 4c 8b 63 10 0f af c2 8d 4a 01 89 0b 49 01 c4 5b 4c 89 e0 5d 41 5c 41 5d 41 5e c3 <0f> 0b 45 31 e4 5b 5d 4c 89 e0 41 5c 41 5d 41 5e c3 0f 0b 45 31 e4
[    6.588844] RSP: 0018:ffffb5f800853ab0 EFLAGS: 00010246
[    6.588847] RAX: 0000000000000000 RBX: 0000000000000003 RCX: ffff9670cee14818
[    6.588850] RDX: ffff9670cee14818 RSI: ffffffffab5fc602 RDI: ffff9670cfba1958
[    6.588852] RBP: ffff9670cfba1958 R08: 0000000188b6eb0f R09: 0000000000000000
[    6.588854] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9670cfba1028
[    6.588856] R13: 0000000000000003 R14: ffff9670cc7a2030 R15: ffffffffc0b680e0
[    6.588858] FS:  00007fad176ba8c0(0000) GS:ffff967127c00000(0000) knlGS:0000000000000000
[    6.588861] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    6.588864] CR2: 00007f5e2023be24 CR3: 00000001050a4001 CR4: 00000000003706e0
[    6.588866] Call Trace:
[    6.588870]  <TASK>
[    6.588876]  read_pin_defaults+0x8d/0x100 [snd_hda_codec]
[    6.588896]  snd_hda_codec_device_new+0xad/0x1b0 [snd_hda_codec]
[    6.588909]  ? __mutex_unlock_slowpath+0x45/0x280
[    6.588922]  hdac_hda_codec_probe+0x7d/0x210 [snd_soc_hdac_hda]
[    6.588929]  snd_soc_component_probe+0x1e/0x40 [snd_soc_core]
[    6.588959]  soc_probe_component+0x1d2/0x2f0 [snd_soc_core]
[    6.588984]  snd_soc_bind_card+0x504/0xce0 [snd_soc_core]
[    6.589003]  ? is_module_address+0x43/0x70
[    6.589010]  ? lockdep_init_map_type+0x51/0x240
[    6.589016]  ? debug_mutex_init+0x33/0x40
[    6.589022]  devm_snd_soc_register_card+0x43/0x80 [snd_soc_core]
[    6.589049]  skl_hda_audio_probe+0x13e/0x2c0 [snd_soc_skl_hda_dsp]
[    6.589055]  platform_probe+0x54/0xb0
[    6.589062]  really_probe+0x1b6/0x390
[    6.589067]  __driver_probe_device+0xfe/0x180
[    6.589072]  driver_probe_device+0x1e/0x90
[    6.589076]  __driver_attach+0xc4/0x1e0
[    6.589079]  ? __device_attach_driver+0xe0/0xe0
[    6.589081]  ? __device_attach_driver+0xe0/0xe0
[    6.589085]  bus_for_each_dev+0x78/0xc0
[    6.589093]  bus_add_driver+0x157/0x200
[    6.589101]  driver_register+0x8f/0xe0
[    6.589104]  ? 0xffffffffc0b6c000
[    6.589108]  do_one_initcall+0x6f/0x270
[    6.589115]  ? kmem_cache_alloc_trace+0x4f/0x210
[    6.589124]  do_init_module+0x4c/0x1f0
[    6.589130]  __do_sys_finit_module+0xb4/0x120
[    6.589145]  do_syscall_64+0x38/0x90
[    6.589150]  entry_SYSCALL_64_after_hwframe+0x46/0xb0
[    6.589154] RIP: 0033:0x7fad17db2a3d
[    6.589158] Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 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 c3 a3 0f 00 f7 d8 64 89 01 48
[    6.589160] RSP: 002b:00007ffd06933de8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[    6.589164] RAX: ffffffffffffffda RBX: 000055b0cc2c43c0 RCX: 00007fad17db2a3d
[    6.589167] RDX: 0000000000000000 RSI: 000055b0cc1a9c50 RDI: 0000000000000012
[    6.589169] RBP: 0000000000020000 R08: 0000000000000000 R09: 0000000000000002
[    6.589171] R10: 0000000000000012 R11: 0000000000000246 R12: 000055b0cc1a9c50
[    6.589173] R13: 000055b0cc1aa560 R14: 0000000000000000 R15: 000055b0cc2c94f0
[    6.589186]  </TASK>
[    6.589188] ---[ end trace 0000000000000000 ]---
[    6.589192] snd_hda_codec_hdmi ehdaudio0D2: failed to create hda codec -12
[    6.589257] snd_hda_codec_hdmi ehdaudio0D2: ASoC: error at snd_soc_component_probe on ehdaudio0D2: -12
[    6.589311] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: failed to instantiate card -12
[    6.590180] skl_hda_dsp_generic: probe of skl_hda_dsp_generic failed with error -12

@tiwai FYI

@plbossart
Copy link
Member Author

plbossart commented Jul 15, 2022

git bisect results:

git bisect bad
980b3a8790b402e959a6d773b38b771019682be1 is the first bad commit
commit 980b3a8790b402e959a6d773b38b771019682be1
Author: Cezary Rojewski <cezary.rojewski@intel.com>
Date:   Wed Jul 6 14:02:27 2022 +0200

    ALSA: hda: Fix page fault in snd_hda_codec_shutdown()
    
    If early probe of HDAudio bus driver fails e.g.: due to missing
    firmware file, snd_hda_codec_shutdown() ends in manipulating
    uninitialized codec->pcm_list_head causing page fault.
    
    Iinitialization of HDAudio codec in ASoC is split in two:
    - snd_hda_codec_device_init()
    - snd_hda_codec_device_new()
    
    snd_hda_codec_device_init() is called during probe_codecs() by HDAudio
    bus driver while snd_hda_codec_device_new() is called by
    codec-component's ->probe(). The second call will not happen until all
    components required by related sound card are present within the ASoC
    framework. With firmware failing to load during the PCI's deferred
    initialization i.e.: probe_work(), no platform components are ever
    registered. HDAudio codec enumeration is done at that point though, so
    the codec components became registered to ASoC framework, calling
    snd_hda_codec_device_init() in the process.
    
    Now, during platform reboot snd_hda_codec_shutdown() is called for every
    codec found on the HDAudio bus causing oops if any of them has not
    completed both of their initialization steps. Relocating field
    initialization fixes the issue.
    
    Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
    Link: https://lore.kernel.org/r/20220706120230.427296-7-cezary.rojewski@intel.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>

 sound/pci/hda/hda_codec.c | 41 ++++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 21 deletions(-)

plbossart added a commit to plbossart/sound that referenced this issue Jul 15, 2022
This reverts commit 980b3a8.

BugLink: thesofproject#3764
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
Copy link
Member Author

@crojewsk revert fixes the issue. Will share the results on alsa-devel as well.

@plbossart
Copy link
Member Author

Commit reverted upstream, closing issue

@crojewsk
Copy link
Member

crojewsk commented Aug 2, 2022

Thanks for addressing the regression on upstream.

To the readers: subject has been continued in #3775.

heftig added a commit to zen-kernel/zen-kernel that referenced this issue Oct 22, 2022
This reverts commit 7494e2e.

This patch depends on others from its series, which were not
backported, causing probing to fail due to missing initialization.

See: thesofproject#3764
repinger pushed a commit to repinger/linux that referenced this issue Oct 22, 2022
This reverts commit 7494e2e.

This patch depends on others from its series, which were not
backported, causing probing to fail due to missing initialization.

See: thesofproject/linux#3764
sirlucjan pushed a commit to CachyOS/linux that referenced this issue Oct 22, 2022
This reverts commit 7494e2e.

This patch depends on others from its series, which were not
backported, causing probing to fail due to missing initialization.

See: thesofproject#3764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants