mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
9c25af2502
The earlier commit to fix runtime PM in case i915 init fails,
introduces a possibility to hit a page fault.
snd_hdac_ext_bus_device_exit() is designed to be called from
dev.release(). Calling it outside device reference counting, is
not safe and may lead to calling the device_exit() function
twice. Additionally, as part of ext_bus_device_init(), the device
is also registered with snd_hdac_device_register(). Thus before
calling device_exit(), the device must be removed from device
hierarchy first.
Fix the issue by rolling back init actions by calling
hdac_device_unregister() and then releasing device with put_device().
This matches with existing code in hdac-ext module.
To complete the fix, add handling for the case where
hda_codec_load_module() returns -ENODEV, and clean up the hdac_ext
resources also in this case.
In future work, hdac-ext interface should be extended to allow clients
more flexibility to handle the life-cycle of individual devices, beyond
just the current snd_hdac_ext_bus_device_remove(), which removes all
devices.
BugLink: https://github.com/thesofproject/linux/issues/2646
Reported-by: Jaroslav Kysela <perex@perex.cz>
Fixes:
|
||
---|---|---|
.. | ||
imx | ||
intel | ||
xtensa | ||
compress.c | ||
compress.h | ||
control.c | ||
core.c | ||
debug.c | ||
ipc.c | ||
Kconfig | ||
loader.c | ||
Makefile | ||
nocodec.c | ||
ops.c | ||
ops.h | ||
pcm.c | ||
pm.c | ||
probe.c | ||
probe.h | ||
sof-acpi-dev.c | ||
sof-audio.c | ||
sof-audio.h | ||
sof-of-dev.c | ||
sof-pci-dev.c | ||
sof-priv.h | ||
topology.c | ||
trace.c | ||
utils.c |