linux-stable/sound/soc/sof
Peter Ujfalusi c344ef36db ASoC: SOF: Intel: hda-codec: Delay the codec device registration
The current code flow is:
1. snd_hdac_device_register()
2. set parameters needed by the hdac driver
3. request_codec_module()
   the hdac driver is probed at this point

During boot the codec drivers are not loaded when the hdac device is
registered, it is going to be probed later when loading the codec module,
which point the parameters are set.

On module remove/insert
rmmod snd_sof_pci_intel_tgl
modprobe snd_sof_pci_intel_tgl

The codec module remains loaded and the driver will be probed when the
hdac device is created right away, before the parameters for the driver
has been configured:

1. snd_hdac_device_register()
   the hdac driver is probed at this point
2. set parameters needed by the hdac driver
3. request_codec_module()
   will be a NOP as the module is already loaded

Move the snd_hdac_device_register() later, to be done right before
requesting the codec module to make sure that the parameters are all set
before the device is created:

1. set parameters needed by the hdac driver
2. snd_hdac_device_register()
3. request_codec_module()

This way at the hdac driver probe all parameters will be set in all cases.

Link: https://github.com/thesofproject/linux/issues/4731
Fixes: a0575b4add ("ASoC: hdac_hda: Conditionally register dais for HDMI and Analog")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231207095425.19597-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/ZYvUIxtrqBQZbNlC@shine.dominikbrodowski.net
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218304
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-01-03 15:33:01 +01:00
..
amd ASoC: SOF: amd: add option to use sram for data bin loading 2023-10-23 13:29:56 +01:00
imx ASoC: SOF: make .remove callback return void 2023-10-12 20:28:12 +01:00
intel ASoC: SOF: Intel: hda-codec: Delay the codec device registration 2024-01-03 15:33:01 +01:00
mediatek ASoC: SOF: mediatek: mt8186: Revert Add Google Steelix topology compatible 2023-12-06 16:31:09 +00:00
xtensa ASoC: SOF: Xtensa: dump ar registers to restore call stack 2023-09-19 13:48:44 +01:00
compress.c ASoC: SOF: Use no_reply calls for TX 2023-04-20 12:51:45 +01:00
control.c ASoC: SOF: control: Extend the optionality of IPC ops to IPC as well 2022-12-25 23:32:33 +00:00
core.c ASoC: SOF: core: Add probe_early and remove_late callbacks 2023-10-19 14:53:50 +02:00
debug.c ASoC: SOF: debug: conditionally bump runtime_pm counter on exceptions 2023-05-15 10:20:57 +09:00
iomem-utils.c
ipc.c ASoC: SOF: Use generic names for IPC types 2023-09-19 13:49:08 +01:00
ipc3-control.c ASoC: sof: Improve sof_ipc3_bytes_ext_put function 2023-05-23 19:31:14 +01:00
ipc3-dtrace.c ASoC: SOF: Use generic names for IPC types 2023-09-19 13:49:08 +01:00
ipc3-loader.c ASoC: SOF: Introduce container struct for SOF firmware 2022-10-21 13:04:54 +01:00
ipc3-pcm.c ASoC: sof: convert not to use asoc_xxx() 2023-09-26 17:18:42 +02:00
ipc3-priv.h ASoC: SOF: Refactor rx function for fuzzing 2023-06-09 10:44:39 +01:00
ipc3-topology.c ASoC: SOF: ipc4-topology: Add core_mask in struct snd_sof_pipeline 2023-11-24 14:15:06 +00:00
ipc3.c ASoC: SOF: ipc3: Use devm_kmemdup to replace devm_kmalloc + memcpy 2023-08-14 19:44:39 +01:00
ipc4-control.c ASoC: SOF: ipc4-topology: Correct data structures for the GAIN module 2023-12-01 14:13:03 +00:00
ipc4-fw-reg.h ASoC: SOF: add ipc4_fw_reg header file 2023-02-03 12:03:48 +00:00
ipc4-loader.c ASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest 2023-05-22 11:18:38 +01:00
ipc4-mtrace.c ASoC: SOF: ipc4-mtrace: move debug slot related definitions to header.h 2023-09-19 13:48:45 +01:00
ipc4-pcm.c ASoC: SOF: IPC4: sort pipeline based on priority 2023-10-06 12:30:23 +01:00
ipc4-priv.h ASoC: SOF: ipc4: add a helper function to search debug slot 2023-09-19 13:48:46 +01:00
ipc4-telemetry.c ASoC: SOF: ipc4: add definition of telemetry slot for exception handling 2023-09-19 13:48:47 +01:00
ipc4-telemetry.h ASoC: SOF: ipc4: add definition of telemetry slot for exception handling 2023-09-19 13:48:47 +01:00
ipc4-topology.c ASoC: SOF: ipc4-topology: Correct data structures for the GAIN module 2023-12-01 14:13:03 +00:00
ipc4-topology.h ASoC: SOF: ipc4-topology: Correct data structures for the GAIN module 2023-12-01 14:13:03 +00:00
ipc4.c ASoC: SOF: ipc4: Dump the notification payload 2023-10-12 20:28:11 +01:00
Kconfig ASoC: SOF: Kconfig: Rename SND_SOC_SOF_INTEL_IPC4 to SND_SOC_SOF_IPC4 2023-09-19 13:49:07 +01:00
loader.c ASoC: SOF: loader: Remove log prefixes for snd_sof_run_firmware 2023-03-07 13:58:16 +00:00
Makefile ASoC: SOF: ipc4/Intel: Support for firmware exception 2023-09-19 18:22:11 +01:00
nocodec.c ASoC: sof: convert not to use asoc_xxx() 2023-09-26 17:18:42 +02:00
ops.c ASoC: SOF: Switch to IPC generic firmware tracing 2022-05-19 16:44:15 +01:00
ops.h ASoC: SOF: Make return of remove_late void, too 2023-10-25 08:38:35 +02:00
pcm.c ASoC: sof: convert not to use asoc_xxx() 2023-09-26 17:18:42 +02:00
pm.c ASoC: SOF: pm: Remove duplicated code in sof_suspend 2023-06-16 12:53:53 +01:00
sof-acpi-dev.c ASoC: SOF: Convert to platform remove callback returning void 2023-10-10 19:21:04 +01:00
sof-acpi-dev.h ASoC: SOF: Convert to platform remove callback returning void 2023-10-10 19:21:04 +01:00
sof-audio.c ASoC: SOF: sof-audio: Modify logic for enabling/disabling topology cores 2023-11-24 14:15:06 +00:00
sof-audio.h ASoC: SOF: ipc4-topology: Add core_mask in struct snd_sof_pipeline 2023-11-24 14:15:06 +00:00
sof-client-ipc-flood-test.c ASoC: SOF: Use no_reply calls for TX 2023-04-20 12:51:45 +01:00
sof-client-ipc-kernel-injector.c ASoC: SOF: Add IPC3 Kernel Injector 2023-06-09 10:44:40 +01:00
sof-client-ipc-msg-injector.c ASoC: SOF: Use generic names for IPC types 2023-09-19 13:49:08 +01:00
sof-client-probes-ipc3.c ASoC: SOF: Use no_reply calls for TX 2023-04-20 12:51:45 +01:00
sof-client-probes-ipc4.c ASoC: SOF: sof-client-probes-ipc4: add checks to prevent static analysis warnings 2023-07-31 23:22:12 +01:00
sof-client-probes.c ASoC: SOF: Use generic names for IPC types 2023-09-19 13:49:08 +01:00
sof-client-probes.h ASoC: SOF: IPC4: probes: Implement IPC4 ops for probes client device 2022-10-31 13:20:22 +00:00
sof-client.c ASoC: SOF: sof-client: trivial: fix comment typo 2023-11-07 11:10:19 +00:00
sof-client.h ASoC: SOF: Add IPC3 Kernel Injector 2023-06-09 10:44:40 +01:00
sof-of-dev.c ASoC: SOF: Convert to platform remove callback returning void 2023-10-10 19:21:04 +01:00
sof-of-dev.h ASoC: SOF: Convert to platform remove callback returning void 2023-10-10 19:21:04 +01:00
sof-pci-dev.c ASoC: Merge up workaround for CODECs that play noise on stopped stream 2023-10-27 22:33:15 +01:00
sof-pci-dev.h
sof-priv.h ASoC: SOF: Make return of remove_late void, too 2023-10-25 08:38:35 +02:00
sof-utils.c ASoC: SOF: remove unneeded dev_vdbg 2022-09-19 15:44:06 +01:00
sof-utils.h
stream-ipc.c ASoC: SOF: Add support for compress API for stream data/offset 2023-01-17 13:37:53 +00:00
topology.c ASoC: SOF: topology: Fix mem leak in sof_dai_load() 2023-11-17 12:47:50 +00:00
trace.c ASoC: SOF: trace: No need to check for op pointer in sof_fw_trace_free() 2022-12-25 23:32:39 +00:00