Re: [PATCH] Revert "ASoC: tegra: machine: Handle component name prefix"

From: Benjamin Bara
Date: Mon Oct 07 2024 - 09:18:15 EST


Hi Krzysztof,

On Mon, 7 Oct 2024 at 15:01, Krzysztof Kozlowski
<krzysztof.kozlowski@xxxxxxxxxx> wrote:
> On 07/10/2024 10:12, Benjamin Bara wrote:
> > From: Benjamin Bara <benjamin.bara@xxxxxxxxxxx>
> >
> > This reverts commit f82eb06a40c86c9a82537e956de401d497203d3a.
> >
> > Tegra is adding the DAPM of the respective widgets directly to the card
> > and therefore the DAPM has no component. Without the component, the
> > precondition for snd_soc_dapm_to_component() fails, which results in
> > undefined behavior. Use the old implementation, as we cannot have a
> > prefix without component.
> >
> > Cc: stable@xxxxxxxxxxxxxxx # v6.7+
>
> Fixes: f82eb06a40c8 ("ASoC: tegra: machine: Handle component name prefix")
>
> I think Samsung speyside from the same patchset might repeat this mistake.

Instead of reverting, we could probably also rewrite
snd_soc_dapm_widget_name_cmp() to directly use dapm->component, instead
of using snd_soc_dapm_to_component(). In this case, we can explicitly
check for a NULL and skip the prefix check - not sure why it currently
is implemented this way.

I think fixing snd_soc_dapm_widget_name_cmp() to be able to handle all
cases might be the better option, what do you think?

Thanks & best regards
Benjamin

> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
>
> Best regards,
> Krzysztof
>