Bug 217867

Summary: hda_codec_probe of Realtek ALC236 (10ec0236) returns incorrect PCI Id after warm boot
Product: Drivers Reporter: Brett Hassall (brett.hassall)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: NEW ---    
Severity: normal CC: nicktelindert, vt
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description Brett Hassall 2023-09-03 11:47:36 UTC
After a warm boot, the laptop will experience CPU soft lockups:

watchdog: BUG: soft lockup - CPU#2 stuck for 26s! [kworker/2:1:92]
...
kernel: CPU: 2 PID: 92 Comm: kworker/2:1 Tainted: G        W          6.5.0+ #6
kernel: Hardware name: HP HP Laptop 15s-fq4xxx/89BC, BIOS F.32 07/04/2023
kernel: Workqueue: events sof_probe_work [snd_sof]
kernel: RIP: 0010:_raw_spin_unlock_irq+0x15/0x50
kernel: Code: cc cc 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 55 48 89 e5 c6 07 00 0f 1f 00 fb 0f 1f 44 00 00 <65> ff 0d 4c 86 56 5c 74 10 5d 31 c0 31 d2 31 c9 31 f6 31 ff c3 cc
kernel: RSP: 0018:ffffa645005ebac0 EFLAGS: 00000246
kernel: RAX: 0000000000000007 RBX: 0000000000000007 RCX: 0000000000000000
kernel: RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff98ea47049cd8
kernel: RBP: ffffa645005ebac0 R08: 0000000000000000 R09: 0000000000000000
kernel: R10: 0000000000000000 R11: 0000000000000000 R12: ffff98ea47049830
kernel: R13: 00000000401f0005 R14: ffff98ea47049cd8 R15: ffff98ea47049840
kernel: FS:  0000000000000000(0000) GS:ffff98ebb7a80000(0000) knlGS:0000000000000000
kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: CR2: 00007fecb22282a8 CR3: 000000010afa2001 CR4: 0000000000770ee0
kernel: PKRU: 55555554
kernel: Call Trace:
kernel:  <IRQ>
kernel:  ? show_regs+0x72/0x90
kernel:  ? watchdog_timer_fn+0x1f7/0x260
kernel:  ? __pfx_watchdog_timer_fn+0x10/0x10
kernel:  ? __hrtimer_run_queues+0x10e/0x2a0
kernel:  ? clockevents_program_event+0xb2/0x140
kernel:  ? hrtimer_interrupt+0x101/0x250
kernel:  ? __sysvec_apic_timer_interrupt+0x61/0x140
kernel:  ? sysvec_apic_timer_interrupt+0x91/0xb0
kernel:  </IRQ>
kernel:  <TASK>
kernel:  ? asm_sysvec_apic_timer_interrupt+0x1b/0x20
kernel:  ? _raw_spin_unlock_irq+0x15/0x50
kernel:  snd_hdac_bus_send_cmd+0xcb/0x110 [snd_hda_core]
kernel:  snd_hdac_bus_exec_verb_unlocked+0x78/0x1b0 [snd_hda_core]
kernel:  snd_hdac_bus_exec_verb+0x3e/0x70 [snd_hda_core]
kernel:  snd_hdac_exec_verb+0x43/0x60 [snd_hda_core]
kernel:  hda_reg_read+0x1de/0x270 [snd_hda_core]
kernel:  __snd_hdac_regmap_read_raw+0x7e/0xf0 [snd_hda_core]
kernel:  snd_hdac_regmap_read_raw+0x10/0x20 [snd_hda_core]
kernel:  snd_hdac_device_init+0x21f/0x460 [snd_hda_core]
kernel:  snd_hda_codec_device_init+0xad/0x290 [snd_hda_codec]
kernel:  ? devres_add+0x6f/0xf0
kernel:  hda_codec_probe_bus+0x181/0x310 [snd_sof_intel_hda]
kernel:  hda_dsp_probe+0x476/0x870 [snd_sof_intel_hda_common]
kernel:  sof_probe_work+0x31/0x470 [snd_sof]
kernel:  process_one_work+0x229/0x450
kernel:  worker_thread+0x50/0x3f0
kernel:  ? __pfx_worker_thread+0x10/0x10
kernel:  kthread+0xf4/0x130
kernel:  ? __pfx_kthread+0x10/0x10
kernel:  ret_from_fork+0x43/0x70
kernel:  ? __pfx_kthread+0x10/0x10
kernel:  ret_from_fork_asm+0x1b/0x30
kernel:  </TASK>

Turning on audio debug shows:

cold boot (all entries below have the same timestamp)
  kernel: snd_sof_intel_hda:hda_codec_probe: sof-audio-pci-intel-tgl 0000:00:1f.3: HDA codec #0 probed OK: response: 10ec0236
  kernel: snd_sof_intel_hda:request_codec_module: hdaudio ehdaudio0D0: loading codec module: hdaudio:v10EC0236r00100002a01
  kernel: snd_sof_intel_hda:hda_codec_probe: sof-audio-pci-intel-tgl 0000:00:1f.3: HDA codec #2 probed OK: response: 80862812
  kernel: snd_sof_intel_hda:request_codec_module: hdaudio ehdaudio0D2: loading codec module: hdaudio:v80862812r00100000a01

warm boot
  kernel: snd_sof_intel_hda:hda_codec_probe: sof-audio-pci-intel-tgl 0000:00:1f.3: HDA codec #0 probed OK: response: fe05
  <then nothing for 26 sec until>
  kernel: watchdog: BUG: soft lockup - CPU#2 stuck for 26s! [kworker/2:1:92]

Laptop is a HP 15s-fq4011TU 11th Gen (Tiger Lake) Intel with (from lspci) Multimedia audio controller: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 30).

Ubuntu bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2027848 provides further background.
Comment 1 Vitaly Chikunov 2023-10-25 19:03:00 UTC
Also confirmed for HP 250 G9 (6S774EA) on ALT Linux kernels are 6.5.8, 6.1.57, 5.10.198 (which are basically usptream stable/lts branches).

  Machine:   Type: Laptop System: HP product: HP 250 15.6 inch G9 Notebook PC v: Type1ProductConfigId 
  Audio:     Device-1: Intel Alder Lake PCH-P High Definition Audio driver: N/A 

Downstream bug report for the record https://bugzilla.altlinux.org/48171
Comment 2 Nick 2024-04-19 10:46:36 UTC
Same problem here: 
I is caused by a code change in patch_realtek.c

I have a working kernel based on 6.8.7 here: https://github.com/nicktelindert/linux


I reverted this commit manually: https://github.com/torvalds/linux/commit/5aec989 
This fixed the issues for ALC236. I am not sure if it breaks other systems though.