linux-stable/sound/soc/sof
Kai Vehmanen e43ab59fb1 ASoC: SOF: Intel: fix HDA codec driver probe with multiple controllers
[ Upstream commit 2c63bea714 ]

In case system has multiple HDA controllers, it can happen that
same HDA codec driver is used for codecs of multiple controllers.
In this case, SOF may fail to probe the HDA driver and SOF
initialization fails.

SOF HDA code currently relies that a call to request_module() will
also run device matching logic to attach driver to the codec instance.
However if driver for another HDA controller was already loaded and it
already loaded the HDA codec driver, this breaks current logic in SOF.
In this case the request_module() SOF does becomes a no-op and HDA
Codec driver is not attached to the codec instance sitting on the HDA
bus SOF is controlling. Typical scenario would be a system with both
external and internal GPUs, with driver of the external GPU loaded
first.

Fix this by adding similar logic as is used in legacy HDA driver
where an explicit device_attach() call is done after request_module().

Also add logic to propagate errors reported by device_attach() back
to caller. This also works in the case where drivers are not built
as modules.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200110235751.3404-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-05 21:22:45 +00:00
..
imx ASoC: SOF: imx8: Fix dsp_box offset 2020-01-17 19:48:19 +01:00
intel ASoC: SOF: Intel: fix HDA codec driver probe with multiple controllers 2020-02-05 21:22:45 +00:00
xtensa sound fixes for 5.2-rc5 2019-06-14 05:37:06 -10:00
control.c ASoC: SOF: control: return true when kcontrol values change 2019-10-18 18:09:22 +01:00
core.c ASoC: SOF: core: increase default IPC timeouts 2019-07-23 12:19:11 +01:00
debug.c ASoC: SOF: Fix memory leak in sof_dfsentry_write 2019-10-28 13:10:23 +00:00
ipc.c ASoC: SOF: fix fault at driver unload after failed probe 2020-02-01 09:34:41 +00:00
Kconfig ASoC: SOF: imx: Add i.MX8 HW support 2019-08-22 18:28:32 +01:00
loader.c ASoC: SOF: loader: snd_sof_fw_parse_ext_data log warning on unknown header 2020-01-12 12:21:22 +01:00
Makefile ASoC: SOF: imx: Add i.MX8 HW support 2019-08-22 18:28:32 +01:00
nocodec.c ASoC: sof: use modern dai_link style 2019-06-06 22:10:38 +01:00
ops.c ASoC: SOF: Fix a compile warning with CONFIG_PCI=n 2019-05-07 11:23:57 +09:00
ops.h ASoC: SOF: Introduce snd_sof_dsp_get_window_offset 2019-08-09 13:26:02 +01:00
pcm.c ASoC: SOF: pcm: harden PCM STOP sequence 2019-10-01 18:31:25 +01:00
pm.c ASoC: SOF: remove unused state variable in suspend function 2019-07-23 12:20:21 +01:00
sof-acpi-dev.c ASoC: SOF: add runtime idle callback 2019-07-06 12:23:24 +01:00
sof-of-dev.c ASoC: SOF: Add OF DSP device support 2019-08-22 18:28:20 +01:00
sof-pci-dev.c ASoC: SOF: Intel: initial support for Elkhart Lake 2019-08-15 18:13:39 +01:00
sof-priv.h ASoC: SOF: Intel: byt: Refactor fw ready / mem windows creation 2019-08-09 13:26:20 +01:00
topology.c ASoC: SOF: topology: set trigger order for FE DAI link 2019-12-31 16:44:44 +01:00
trace.c ASoC: SOF: no need to check return value of debugfs_create functions 2019-08-01 13:56:07 +01:00
utils.c ASoC: SOF: Add utils 2019-04-28 02:49:47 +09:00