linux/sound
Chaitanya Kumar Borah 90f8917e7a
ASoC: SOF: Core: Add remove_late() to sof_init_environment failure path
In cases where the sof driver is unable to find the firmware and/or
topology file [1], it exits without releasing the i915 runtime
pm wakeref [2]. This results in dmesg warnings[3] during
suspend/resume or driver unbind. Add remove_late() to the failure path
of sof_init_environment so that i915 wakeref is released appropriately

[1]

[    8.990366] sof-audio-pci-intel-mtl 0000:00:1f.3: SOF firmware and/or topology file not found.
[    8.990396] sof-audio-pci-intel-mtl 0000:00:1f.3: Supported default profiles
[    8.990398] sof-audio-pci-intel-mtl 0000:00:1f.3: - ipc type 1 (Requested):
[    8.990399] sof-audio-pci-intel-mtl 0000:00:1f.3:  Firmware file: intel/sof-ipc4/mtl/sof-mtl.ri
[    8.990401] sof-audio-pci-intel-mtl 0000:00:1f.3:  Topology file: intel/sof-ace-tplg/sof-mtl-rt711-2ch.tplg
[    8.990402] sof-audio-pci-intel-mtl 0000:00:1f.3: Check if you have 'sof-firmware' package installed.
[    8.990403] sof-audio-pci-intel-mtl 0000:00:1f.3: Optionally it can be manually downloaded from:
[    8.990404] sof-audio-pci-intel-mtl 0000:00:1f.3:    https://github.com/thesofproject/sof-bin/
[    8.999088] sof-audio-pci-intel-mtl 0000:00:1f.3: error: sof_probe_work failed err: -2

[2]

ref_tracker: 0000:00:02.0@ffff9b8511b6a378 has 1/5 users at
     track_intel_runtime_pm_wakeref.part.0+0x36/0x70 [i915]
     __intel_runtime_pm_get+0x51/0xb0 [i915]
     intel_runtime_pm_get+0x17/0x20 [i915]
     intel_display_power_get+0x2f/0x70 [i915]
     i915_audio_component_get_power+0x23/0x120 [i915]
     snd_hdac_display_power+0x89/0x130 [snd_hda_core]
     hda_codec_i915_init+0x3f/0x50 [snd_sof_intel_hda]
     hda_dsp_probe_early+0x170/0x250 [snd_sof_intel_hda_common]
     snd_sof_device_probe+0x224/0x320 [snd_sof]
     sof_pci_probe+0x15b/0x220 [snd_sof_pci]
     hda_pci_intel_probe+0x30/0x70 [snd_sof_intel_hda_common]
     local_pci_probe+0x4c/0xb0
     pci_device_probe+0xcc/0x250
     really_probe+0x18e/0x420
     __driver_probe_device+0x7e/0x170
     driver_probe_device+0x23/0xa0

[3]
[  484.105070] ------------[ cut here ]------------
[  484.108238] thunderbolt 0000:00:0d.2: PM: pci_pm_suspend_late+0x0/0x50 returned 0 after 0 usecs
[  484.117106] i915 0000:00:02.0: i915 raw-wakerefs=1 wakelocks=1 on cleanup
[  484.792005] WARNING: CPU: 2 PID: 2405 at drivers/gpu/drm/i915/intel_runtime_pm.c:444 intel_runtime_pm_driver_release+0x6c/0x80

Tested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://github.com/thesofproject/linux/pull/4878
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://msgid.link/r/20240404184813.134566-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-04 19:51:51 +01:00
..
ac97 ALSA: ac97: fix build regression 2024-01-03 11:47:04 +01:00
aoa powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
arm ALSA: aaci: Delete unused variable in aaci_do_suspend 2024-03-12 12:30:51 +01:00
atmel
core ALSA: control: Fix unannotated kfree() cleanup 2024-03-20 07:30:48 +01:00
drivers TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
firewire Merge branch 'for-linus' into for-next 2024-02-21 11:17:06 +01:00
hda sound updates for 6.9-rc1 2024-03-14 11:10:43 -07:00
i2c
isa ALSA: wavefront: copy userspace array safely 2023-11-20 12:38:31 +01:00
mips
oss OSS: dmasound/paula: Convert to platform remove callback returning void 2023-11-09 17:44:52 +01:00
parisc
pci ALSA: hda/realtek: Add quirks for some Clevo laptops 2024-03-20 07:29:30 +01:00
pcmcia
ppc
sh
soc ASoC: SOF: Core: Add remove_late() to sof_init_environment failure path 2024-04-04 19:51:51 +01:00
sparc
spi ALSA: at73c213: Replace with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:25 +01:00
synth ALSA: synth: Save a few bytes of memory when registering a 'snd_emux' 2024-01-22 13:04:22 +01:00
usb Revert "ALSA: usb-audio: Name feature ctl using output if input is PCM" 2024-03-17 09:32:49 +01:00
virtio ALSA: virtio: Fix "Coverity: virtsnd_kctl_tlv_op(): Uninitialized variables" warning. 2024-02-16 15:01:31 +01:00
x86 drm/edid: include drm_eld.h only where required 2023-11-09 16:47:31 +02:00
xen ALSA: xen: Fix -Wformat-truncation warning 2023-09-15 13:21:35 +02:00
ac97_bus.c ALSA: mark all struct bus_type as const 2023-12-30 10:10:41 +01:00
Kconfig
last.c
Makefile
sound_core.c