All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	<broonie@kernel.org>
Cc: <alsa-devel@alsa-project.org>, <linux-sound@vger.kernel.org>,
	<tiwai@suse.com>, <perex@perex.cz>,
	<amadeuszx.slawinski@linux.intel.com>, <hdegoede@redhat.com>
Subject: Re: [PATCH 2/5] ASoC: topology: Do not ignore route checks when parsing graphs
Date: Mon, 4 Mar 2024 21:50:42 +0100	[thread overview]
Message-ID: <ea72dd2e-587d-4660-9a8b-da3048819e6b@intel.com> (raw)
In-Reply-To: <14a2f9b8-7711-47c4-9f57-bd839c700d4e@linux.intel.com>

On 2024-03-04 8:32 PM, Pierre-Louis Bossart wrote:
> On 3/4/24 13:05, Cezary Rojewski wrote:
>> One of the framework responsibilities is to ensure that the enumerated
>> DPCMs are valid i.e.: a valid BE is connected to a valid FE DAI. While
>> the are checks in soc-core.c and soc-pcm.c that verify this, a component
>> driver may attempt to workaround this by loading an invalid graph
>> through the topology file.
>>
>> Be strict and fail topology loading when invalid graph is encountered.
> 
> This is very invasive, it's perfectly possible that we have a number of
> 'broken' topologies where one path is 'invalid' but it doesn't impact
> functionality.
> 
> This should be an opt-in behavior IMHO, not a blanket change.

To my best knowledge, soc-topology.c' first "customer" was the 
skylake-driver and the final details were cloudy at best back then.

Right now sound-drivers utilizing the topology feature do so in more 
refined fashion. Next, in ASoC we have three locations where 
snd_soc_dapm_add_routes() is called but error-checks are done only in 
2/3 of them. This is bogus.

If the intended way of using snd_soc_dapm_add_routes() is to ignore the 
return, it should be converted to void and flag ->disable_route_checks 
removed.


Kind regards,
Czarek


>> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
>> ---
>>   sound/soc/soc-topology.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
>> index d6d368837235..778f539d9ff5 100644
>> --- a/sound/soc/soc-topology.c
>> +++ b/sound/soc/soc-topology.c
>> @@ -1083,8 +1083,9 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg,
>>   			break;
>>   		}
>>   
>> -		/* add route, but keep going if some fail */
>> -		snd_soc_dapm_add_routes(dapm, route, 1);
>> +		ret = snd_soc_dapm_add_routes(dapm, route, 1);
>> +		if (ret && !dapm->card->disable_route_checks)
>> +			break;
>>   	}
>>   
>>   	return ret;

  reply	other threads:[~2024-03-04 20:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 19:05 [PATCH 0/5] ASoC: Harden DAPM route checks and Intel fixes Cezary Rojewski
2024-03-04 19:05 ` [PATCH 1/5] ASoC: Intel: Disable route checks for Skylake boards Cezary Rojewski
2024-03-04 19:28   ` Pierre-Louis Bossart
2024-03-04 20:40     ` Cezary Rojewski
2024-03-04 21:02       ` Pierre-Louis Bossart
2024-03-06 16:08         ` Cezary Rojewski
2024-03-04 19:05 ` [PATCH 2/5] ASoC: topology: Do not ignore route checks when parsing graphs Cezary Rojewski
2024-03-04 19:32   ` Pierre-Louis Bossart
2024-03-04 20:50     ` Cezary Rojewski [this message]
2024-03-04 21:25       ` Pierre-Louis Bossart
2024-03-06 16:11         ` Cezary Rojewski
2024-03-04 19:05 ` [PATCH 3/5] ASoC: Intel: avs: ssm4567: Do not ignore route checks Cezary Rojewski
2024-03-04 19:05 ` [PATCH 4/5] ASoC: Intel: avs: ssm4567: Board cleanup Cezary Rojewski
2024-03-04 19:05 ` [PATCH 5/5] ASoC: Intel: avs: i2s_test: Remove redundant dapm routes Cezary Rojewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea72dd2e-587d-4660-9a8b-da3048819e6b@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.