ACK/Cmnt: [SRU][F][PATCH 1/1] UBUNTU: SAUCE: ASoC: SOF: Intel: hda: move the probe_bus ahead of creation of mach device
Tim Gardner
tim.gardner at canonical.com
Fri May 7 11:56:50 UTC 2021
Acked-by: Tim Gardner <tim.gardner at canonical.com>
Reordering does not appear to orphan any resources since there is no
early return from the function after the call to hda_codec_probe_bus().
Good test results.
On 5/7/21 1:39 AM, Hui Wang wrote:
> BugLink: https://bugs.launchpad.net/bugs/1927672
>
> We backported many patches to enable the sof audio driver in the focal
> kernel, the driver worked well on cml and cfl machines if they have
> both analog codec and HDMI/DP codec.
>
> On some machines they only have analog codec, the current sof driver
> can't work on them, we already backported related patches like "allow
> operation without i915 gfx" and "drop HDA codec upon probe failure",
> but we still miss one important patch:
> commit 285880a23d10
> ("ASoC: SOF: Make creation of machine device from SOF core optional")
>
> The patch is big, it is prone to introduce regression if applying
> such a big patch, here I only picked a small part which is helpful
> to enable sof driver without HDMI/DP codec.
>
> After the change, The probe_bus() will probe the codec first and set
> the codec_mask according to the probing result, then the driver create
> mach device according to codec_mask.
>
> Referred-To: commit 285880a23d10
> ("ASoC: SOF: Make creation of machine device from SOF core optional")
> Signed-off-by: Hui Wang <hui.wang at canonical.com>
> ---
> sound/soc/sof/intel/hda.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
> index d743e27f063f..ef6a1113b178 100644
> --- a/sound/soc/sof/intel/hda.c
> +++ b/sound/soc/sof/intel/hda.c
> @@ -387,6 +387,9 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
> if (bus->mlcap)
> snd_hdac_ext_bus_get_ml_capabilities(bus);
>
> + /* create codec instances */
> + hda_codec_probe_bus(sdev, hda_codec_use_common_hdmi);
> +
> /* codec detection */
> if (!bus->codec_mask) {
> dev_info(bus->dev, "no hda codecs found!\n");
> @@ -480,9 +483,6 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
> mach_params->dmic_num = dmic_num;
> }
>
> - /* create codec instances */
> - hda_codec_probe_bus(sdev, hda_codec_use_common_hdmi);
> -
> if (!HDA_IDISP_CODEC(bus->codec_mask))
> hda_codec_i915_put(sdev);
>
>
--
-----------
Tim Gardner
Canonical, Inc
More information about the kernel-team
mailing list