Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Cezary Rojewski <cezary.rojewski@intel.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: Re: [PATCH v2 09/25] ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()
Date: Tue, 20 Aug 2019 09:05:18 -0500	[thread overview]
Message-ID: <fc461e37-7363-af5a-63a4-9db7a2b8c1cd@linux.intel.com> (raw)
In-Reply-To: <1bbf24d4-c6cb-00ee-ffbe-18da53d1f942@intel.com>



On 8/20/19 8:38 AM, Cezary Rojewski wrote:
> On 2019-08-20 14:36, Pierre-Louis Bossart wrote:
>>
>>
>> On 8/20/19 6:18 AM, Cezary Rojewski wrote:
>>> On 2019-08-07 03:31, Kuninori Morimoto wrote:
>>>>
>>>> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>>>>
>>>> snd_soc_dapm_add_routes() registers routes by using
>>>> for(... i < num; ...). If routes was NULL, num should be zero.
>>>> Thus, we don't need to check about route pointer.
>>>> This patch also cares missing return value.
>>>>
>>>> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>>>> ---
>>>> v1 -> v2
>>>>
>>>>     - check return value
>>>>     - change Subject
>>>>
>>>>   sound/soc/soc-core.c | 23 +++++++++++++----------
>>>>   1 file changed, 13 insertions(+), 10 deletions(-)
>>>>
>>>> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
>>>> index 21cdd3c..ca1b04c 100644
>>>> --- a/sound/soc/soc-core.c
>>>> +++ b/sound/soc/soc-core.c
>>>> @@ -1310,10 +1310,11 @@ static int soc_probe_component(struct 
>>>> snd_soc_card *card,
>>>>       if (ret < 0)
>>>>           goto err_probe;
>>>> -    if (component->driver->dapm_routes)
>>>> -        snd_soc_dapm_add_routes(dapm,
>>>> -                    component->driver->dapm_routes,
>>>> -                    component->driver->num_dapm_routes);
>>>> +    ret = snd_soc_dapm_add_routes(dapm,
>>>> +                      component->driver->dapm_routes,
>>>> +                      component->driver->num_dapm_routes);
>>>> +    if (ret < 0)
>>>> +        goto err_probe;
>>>>       list_add(&dapm->list, &card->dapm_list);
>>>>       /* see for_each_card_components */
>>>> @@ -2060,13 +2061,15 @@ static int snd_soc_instantiate_card(struct 
>>>> snd_soc_card *card)
>>>>           snd_soc_add_card_controls(card, card->controls,
>>>>                         card->num_controls);
>>>> -    if (card->dapm_routes)
>>>> -        snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
>>>> -                    card->num_dapm_routes);
>>>> +    ret = snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
>>>> +                      card->num_dapm_routes);
>>>> +    if (ret < 0)
>>>> +        goto probe_end;
>>>> -    if (card->of_dapm_routes)
>>>> -        snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes,
>>>> -                    card->num_of_dapm_routes);
>>>> +    ret = snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes,
>>>> +                      card->num_of_dapm_routes);
>>>> +    if (ret < 0)
>>>> +        goto probe_end;
>>>>       /* try to set some sane longname if DMI is available */
>>>>       snd_soc_set_dmi_name(card, NULL);
>>>>
>>>
>>> Hello there,
>>>
>>> I've run a validation cycle on recent broonie/for-next and this 
>>> commit caused regression. However, it may be simply an error on board 
>>> side instead.
>>>
>>> Previously, ret from snd_soc_dapm_add_routes has been ignored thus it 
>>> was permissive for addition of several routes to fail. As long as 
>>> some routes succeeded, card was working just fine. Now it's no longer 
>>> the case - behavior of the card initialization has changed: it is 
>>> required for ALL routes to succeed before card can be fully 
>>> instantiated.
>>>
>>> Must say collapsing snd_soc_instantiate_card is a wonderful way to 
>>> test your card's removal flow (soc__cleanup_card_resources and 
>>> friends)..
>>>
>>> Question is simple: are we staying with all-for-one/ one-for-all 
>>> approach or we reverting to permissive behavior?
>>
>> Can you elaborate in which test case this patch creates a problem? 
>> Just curious why the route addition fails in the first place.
> 
> If snd_soc_instantiate_card fails so does any test, really. Red wall was 
> easy to spot even for a hungry developer : )
> 
> Our cnl_rt274 board declares several routes, yet our topology does not 
> provide necessary info for all of them. And thus, addition of some 
> routes fails. This was fine till now. That's also why I'd mentioned in 
> the very first sentence: it might be simply a board issue. Maybe we 
> should have never abused permissive behavior in the first place.

Yep, and that driver is not upstream as well so Intel can't complain here...
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-08-20 14:05 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07  1:29 [PATCH v2 00/25] ASoC: cleanup patches for soc-core Kuninori Morimoto
2019-08-07  1:29 ` [PATCH v2 01/25] ASoC: soc-core: use device_register() Kuninori Morimoto
2019-08-07  1:30 ` [PATCH v2 02/25] ASoC: soc-core: set component->debugfs_root NULL Kuninori Morimoto
2019-08-07 13:30   ` Applied "ASoC: soc-core: set component->debugfs_root NULL" to the asoc tree Mark Brown
2019-08-07  1:30 ` [PATCH v2 03/25] ASoC: soc-core: add comment for for_each_xxx Kuninori Morimoto
2019-08-07 13:30   ` Applied "ASoC: soc-core: add comment for for_each_xxx" to the asoc tree Mark Brown
2019-08-07  1:30 ` [PATCH v2 04/25] ASoC: soc-core: check return value of snd_soc_add_dai_link() Kuninori Morimoto
2019-08-07 13:30   ` Applied "ASoC: soc-core: check return value of snd_soc_add_dai_link()" to the asoc tree Mark Brown
2019-08-07  1:30 ` [PATCH v2 05/25] ASoC: soc-core: don't use for_each_card_links_safe() at snd_soc_find_dai_link() Kuninori Morimoto
2019-08-07 13:30   ` Applied "ASoC: soc-core: don't use for_each_card_links_safe() at snd_soc_find_dai_link()" to the asoc tree Mark Brown
2019-08-07  1:30 ` [PATCH v2 06/25] ASoC: soc-core: reuse rtdcom at snd_soc_rtdcom_add() Kuninori Morimoto
2019-08-07 13:30   ` Applied "ASoC: soc-core: reuse rtdcom at snd_soc_rtdcom_add()" to the asoc tree Mark Brown
2019-08-07  1:30 ` [PATCH v2 07/25] ASoC: soc-core: tidyup for snd_soc_dapm_new_controls() Kuninori Morimoto
2019-08-07 13:30   ` Applied "ASoC: soc-core: tidyup for snd_soc_dapm_new_controls()" to the asoc tree Mark Brown
2019-08-07  1:30 ` [PATCH v2 08/25] ASoC: soc-core: tidyup for snd_soc_add_component_controls() Kuninori Morimoto
2019-08-08 20:33   ` Applied "ASoC: soc-core: tidyup for snd_soc_add_component_controls()" to the asoc tree Mark Brown
2019-08-07  1:31 ` [PATCH v2 09/25] ASoC: soc-core: tidyup for snd_soc_dapm_add_routes() Kuninori Morimoto
2019-08-08 20:33   ` Applied "ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()" to the asoc tree Mark Brown
2019-08-20 11:18   ` [PATCH v2 09/25] ASoC: soc-core: tidyup for snd_soc_dapm_add_routes() Cezary Rojewski
2019-08-20 12:36     ` Pierre-Louis Bossart
2019-08-20 13:38       ` Cezary Rojewski
2019-08-20 14:05         ` Pierre-Louis Bossart [this message]
2019-08-20 15:04           ` Cezary Rojewski
2019-08-20 17:39             ` Pierre-Louis Bossart
2019-08-20 17:40     ` Mark Brown
2019-08-07  1:31 ` [PATCH v2 10/25] ASoC: soc-core: tidyup for snd_soc_add_card_controls() Kuninori Morimoto
2019-08-08 20:33   ` Applied "ASoC: soc-core: tidyup for snd_soc_add_card_controls()" to the asoc tree Mark Brown
2019-08-07  1:31 ` [PATCH v2 11/25] ASoC: soc-core: call snd_soc_dapm_debugfs_init() at soc_init_card_debugfs() Kuninori Morimoto
2019-08-08 20:33   ` Applied "ASoC: soc-core: call snd_soc_dapm_debugfs_init() at soc_init_card_debugfs()" to the asoc tree Mark Brown
2019-08-07  1:31 ` [PATCH v2 12/25] ASoC: soc-core: remove unneeded list_empty() check for snd_soc_try_rebind_card() Kuninori Morimoto
2019-08-08 20:33   ` Applied "ASoC: soc-core: remove unneeded list_empty() check for snd_soc_try_rebind_card()" to the asoc tree Mark Brown
2019-08-07  1:31 ` [PATCH v2 13/25] ASoC: soc-core: tidyup for card->deferred_resume_work Kuninori Morimoto
2019-08-08 20:33   ` Applied "ASoC: soc-core: tidyup for card->deferred_resume_work" to the asoc tree Mark Brown
2019-08-07  1:31 ` [PATCH v2 14/25] ASoC: soc-core: define soc_dpcm_debugfs_add() for non CONFIG_DEBUG_FS Kuninori Morimoto
2019-08-08 20:33   ` Applied "ASoC: soc-core: define soc_dpcm_debugfs_add() for non CONFIG_DEBUG_FS" to the asoc tree Mark Brown
2019-08-07  1:31 ` [PATCH v2 15/25] ASoC: soc-core: dai_link check under soc_dpcm_debugfs_add() Kuninori Morimoto
2019-08-08 20:33   ` Applied "ASoC: soc-core: dai_link check under soc_dpcm_debugfs_add()" to the asoc tree Mark Brown
2019-08-07  1:31 ` [PATCH v2 16/25] ASoC: soc-core: merge snd_soc_initialize_card_lists() Kuninori Morimoto
2019-08-07  1:31 ` [PATCH v2 17/25] ASoC: soc-core: remove unneeded dai_link check from snd_soc_remove_dai_link() Kuninori Morimoto
2019-08-07  1:31 ` [PATCH v2 18/25] ASoC: soc-core: add NOTE to snd_soc_rtdcom_lookup() Kuninori Morimoto
2019-08-07  1:31 ` [PATCH v2 19/25] ASoC: soc-core: don't call snd_soc_component_set_jack() Kuninori Morimoto
2019-08-07 18:49   ` Cezary Rojewski
2019-08-08  9:14     ` Amadeusz Sławiński
2019-08-20  4:24       ` Kuninori Morimoto
2019-08-28 12:06         ` Mark Brown
2019-08-29  0:16           ` Kuninori Morimoto
2019-08-29  9:58             ` Mark Brown
2019-08-07  1:31 ` [PATCH v2 20/25] ASoC: soc-core: don't alloc memory carelessly when creating debugfs Kuninori Morimoto
2019-08-07  1:32 ` [PATCH v2 21/25] ASoC: soc-core: soc_cleanup_card_resources() become void Kuninori Morimoto
2019-08-07  1:32 ` [PATCH v2 22/25] ASoC: soc-core: initialize component list Kuninori Morimoto
2019-08-07  1:32 ` [PATCH v2 23/25] ASoC: soc-core: initialize list at one place Kuninori Morimoto
2019-08-07  1:32 ` [PATCH v2 24/25] ASoC: soc-dai: use bit field for bus_control Kuninori Morimoto
2019-08-07  1:32 ` [PATCH v2 25/25] ASoC: soc-topology: use for_each_component_dais() at remove_dai() Kuninori Morimoto
2019-08-07  3:20   ` Sridharan, Ranjani

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=fc461e37-7363-af5a-63a4-9db7a2b8c1cd@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=kuninori.morimoto.gx@renesas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox