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]
Date:	Mon, 17 Feb 2014 18:06:03 +0100
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
CC:	broonie@...nel.org, myungjoo.ham@...sung.com,
	cw00.choi@...sung.com, dmitry.torokhov@...il.com,
	lgirdwood@...il.com, peter.ujfalusi@...com,
	jarkko.nikula@...mer.com, eric.y.miao@...il.com,
	haojian.zhuang@...il.com, linux-kernel@...r.kernel.org,
	patches@...nsource.wolfsonmicro.com, alsa-devel@...a-project.org,
	linux@....linux.org.uk
Subject: Re: [PATCH 02/15] ASoC: dapm: Add locked version of snd_soc_dapm_xxxx_pin
 functions

[...]
> +int snd_soc_dapm_enable_pin_locked(struct snd_soc_dapm_context *dapm,
> +				   const char *pin)
> +{
> +	return snd_soc_dapm_set_pin(dapm, pin, 1);
> +}
> +EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin_locked);
> +
> +/**
>    * snd_soc_dapm_enable_pin - enable pin.
>    * @dapm: DAPM context
>    * @pin: pin name
>    *
>    * Enables input/output pin and its parents or children widgets iff there is
>    * a valid audio route and active audio stream.
> + *
>    * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to
>    * do any widget power switching.
>    */
>   int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin)
>   {
> -	return snd_soc_dapm_set_pin(dapm, pin, 1);
> +	int ret;
> +
> +	mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
> +
> +	ret = snd_soc_dapm_set_pin(dapm, pin, 1);
> +
> +	mutex_unlock(&dapm->card->dapm_mutex);
> +
> +	return ret;
>   }

Hm, this is a bit confusing. For other functions in ASoC when we have a pair 
of functions with the _locked suffix and without the one with _locked takes 
the lock, the other one doesn't. E.g. snd_soc_update_bits_locked. Here we do 
it the other way around.

- Lars

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ