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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96d80637-3c3b-6a72-85d2-4ee37c371804@samsung.com>
Date:   Wed, 19 Feb 2020 14:00:42 +0100
From:   Marek Szyprowski <m.szyprowski@...sung.com>
To:     Jerome Brunet <jbrunet@...libre.com>,
        Mark Brown <broonie@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>
Cc:     alsa-devel@...a-project.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        linux-rpi-kernel <linux-rpi-kernel@...ts.infradead.org>
Subject: Re: [PATCH] ASoC: fix card registration regression.

Hi Jerome,

On 19.02.2020 11:25, Jerome Brunet wrote:
> This reverts commit b2354e4009a773c00054b964d937e1b81cb92078.
>
> This change might have been desirable to ensure the uniqueness of
> the component name. It would have helped to better support linux
> devices which register multiple components, something is which more
> common than initially thought.
>
> However, some card driver are directly using dev_name() to fill the
> component names of the dai_link which is a problem if want to change
> the way ASoC generates the component names.
>
> Until we figure out the appropriate way to deal with this, revert the
> change and keep the names as they were. There might be a couple of warning
> related to debugfs (which were already present before the change) but it
> is still better than breaking working audio cards.
>
> Cc: Marek Szyprowski <m.szyprowski@...sung.com>
> Signed-off-by: Jerome Brunet <jbrunet@...libre.com>

As expected, this fixes vc4-drm driver registration on RPi3.

Tested-by: Marek Szyprowski <m.szyprowski@...sung.com>

> ---
>   sound/soc/soc-core.c | 29 +----------------------------
>   1 file changed, 1 insertion(+), 28 deletions(-)
>
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 30c17fde14ca..518b652cf872 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -2442,33 +2442,6 @@ static int snd_soc_register_dais(struct snd_soc_component *component,
>   	return ret;
>   }
>   
> -static char *snd_soc_component_unique_name(struct device *dev,
> -					   struct snd_soc_component *component)
> -{
> -	struct snd_soc_component *pos;
> -	int count = 0;
> -	char *name, *unique;
> -
> -	name = fmt_single_name(dev, &component->id);
> -	if (!name)
> -		return name;
> -
> -	/* Count the number of components registred by the device */
> -	for_each_component(pos) {
> -		if (dev == pos->dev)
> -			count++;
> -	}
> -
> -	/* Keep naming as it is for the 1st component */
> -	if (!count)
> -		return name;
> -
> -	unique = devm_kasprintf(dev, GFP_KERNEL, "%s-%d", name, count);
> -	devm_kfree(dev, name);
> -
> -	return unique;
> -}
> -
>   static int snd_soc_component_initialize(struct snd_soc_component *component,
>   	const struct snd_soc_component_driver *driver, struct device *dev)
>   {
> @@ -2477,7 +2450,7 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
>   	INIT_LIST_HEAD(&component->card_list);
>   	mutex_init(&component->io_mutex);
>   
> -	component->name = snd_soc_component_unique_name(dev, component);
> +	component->name = fmt_single_name(dev, &component->id);
>   	if (!component->name) {
>   		dev_err(dev, "ASoC: Failed to allocate name\n");
>   		return -ENOMEM;

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ