lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <599701D2.5080001@rock-chips.com>
Date:   Fri, 18 Aug 2017 23:03:46 +0800
From:   jeffy <jeffy.chen@...k-chips.com>
To:     Mark Brown <broonie@...nel.org>
CC:     linux-kernel@...r.kernel.org, dgreid@...omium.org, heiko@...ech.de,
        briannorris@...omium.org, mka@...omium.org, dianders@...omium.org,
        Jaroslav Kysela <perex@...ex.cz>, alsa-devel@...a-project.org,
        Oder Chiou <oder_chiou@...ltek.com>,
        Takashi Iwai <tiwai@...e.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Bard Liao <bardliao@...ltek.com>
Subject: Re: [PATCH v4 1/9] ASoC: rt5514: Avoid legacy dai naming

Hi Mark,

On 08/18/2017 07:45 PM, Mark Brown wrote:
> On Fri, Aug 18, 2017 at 11:11:39AM +0800, Jeffy Chen wrote:
>> Currently we are using devm_snd_soc_register_component, which would
>> use legacy dai naming when dai drv id is zero.
>>
>> Set a non-zero dai drv id to use dai drv name for dai name.
>
> Why?  This is clearly not good, we shouldn't be expecting all devices
> with a single DAI to set the DAI number to 1 and the changelog doesn't
> articulate any reason why anything cares what the name is.
>

i was trying to avoid legacy dai naming, because snd_soc_find_dai will 
try to match the dai name:

struct snd_soc_dai *snd_soc_find_dai(
         const struct snd_soc_dai_link_component *dlc)
{
...

                 list_for_each_entry(dai, &component->dai_list, list) {
                         if (dlc->dai_name && strcmp(dai->name, 
dlc->dai_name))
                                 continue;

                         return dai;


if match failed, it would break soc_bind_dai_link:

static int soc_bind_dai_link(struct snd_soc_card *card,
         struct snd_soc_dai_link *dai_link)
{
...
         /* Find CODEC from registered CODECs */
         codec_dais = rtd->codec_dais;
         for (i = 0; i < rtd->num_codecs; i++) {
                 codec_dais[i] = snd_soc_find_dai(&codecs[i]);
                 if (!codec_dais[i]) {
                         dev_err(card->dev, "ASoC: CODEC DAI %s not 
registered\n",
                                 codecs[i].dai_name);
                         goto _err_defer;
                 }




when using legacy dai naming, the dai->name for rt5514-spi would be the 
dev name, which is spi2.0 with my local 4.4 kernel, and would be 
spi32765.0 with upstream kernel.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ