alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Arnaud Pouliquen <arnaud.pouliquen@st.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Jean-Francois Moine <moinejf@free.fr>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	David Airlie <airlied@linux.ie>,
	Liam Girdwood <lgirdwood@gmail.com>, Jyri Sarha <jsarha@ti.com>,
	Takashi Iwai <tiwai@suse.de>, Mark Brown <broonie@kernel.org>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>
Subject: Re: [RFC v2 2/6] ALSA: pcm: add IEC958 channel status control helper
Date: Wed, 17 Feb 2016 10:07:49 +0100	[thread overview]
Message-ID: <56C43865.9070008@st.com> (raw)
In-Reply-To: <20160217003145.GF19428@n2100.arm.linux.org.uk>



On 02/17/2016 01:31 AM, Russell King - ARM Linux wrote:
> On Fri, Jan 22, 2016 at 06:48:28PM +0100, Arnaud Pouliquen wrote:
>> +static int snd_pcm_iec958_get(struct snd_kcontrol *kcontrol,
>> +			      struct snd_ctl_elem_value *uctl)
>> +{
>> +	struct snd_pcm_iec958_params *params = snd_kcontrol_chip(kcontrol);
>> +
>> +	if (params->mutex)
>> +		mutex_unlock(params->mutex);
>> +	uctl->value.iec958.status[0] = params->iec->status[0];
>> +	uctl->value.iec958.status[1] = params->iec->status[1];
>> +	uctl->value.iec958.status[2] = params->iec->status[2];
>> +	uctl->value.iec958.status[3] = params->iec->status[3];
>> +	uctl->value.iec958.status[4] = params->iec->status[4];
>> +	if (params->mutex)
>> +		mutex_unlock(params->mutex);
> 
> I thought I had already commented about the mutex - maybe not.  Please
> don't make these conditional like this: if you need the mutex to
> eliminate a race condition, then you need it to eliminate the race
> condition and it can't be "optional".  Elimination of race conditions
> is never optional!
> 
> Please get rid of all these conditions and make it mandatory that a
> mutex is supplied.
> 
> Thanks.

Ok, i will suppress condition. I also need to use a spinlock instead of
the mutex, to be able to support race condition with atomic callbacks
(trigger, pointer, and ack)

  reply	other threads:[~2016-02-17  9:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22 17:48 [RFC v2 0/6] sti: add audio interface to the hdmi driver Arnaud Pouliquen
2016-01-22 17:48 ` [RFC v2 1/6] video: hdmi: add helper function for N and CTS Arnaud Pouliquen
2016-02-18 14:20   ` Philipp Zabel
2016-02-19  8:20     ` Arnaud Pouliquen
2016-01-22 17:48 ` [RFC v2 2/6] ALSA: pcm: add IEC958 channel status control helper Arnaud Pouliquen
2016-02-16 20:17   ` Jyri Sarha
2016-02-17  8:37     ` Arnaud Pouliquen
2016-02-17  0:31   ` Russell King - ARM Linux
2016-02-17  9:07     ` Arnaud Pouliquen [this message]
2016-01-22 17:48 ` [RFC v2 3/6] ASoC: core: add code to complete dai init after pcm creation Arnaud Pouliquen
2016-02-05  9:58   ` Jyri Sarha
2016-02-15 10:39     ` Arnaud Pouliquen
2016-01-22 17:48 ` [RFC v2 4/6] drm: sti: Add ASoC generic hdmi codec support Arnaud Pouliquen
2016-01-22 17:48 ` [RFC v2 5/6] ASoc: hdmi-codec: add IEC control Arnaud Pouliquen
2016-02-06 19:29   ` Jyri Sarha
2016-02-15 10:51     ` Arnaud Pouliquen
2016-02-16 20:16       ` Jyri Sarha
2016-01-22 17:48 ` [RFC v2 6/6] ARM: DT: b2120: add audio HDMI dai link in audio card Arnaud Pouliquen

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=56C43865.9070008@st.com \
    --to=arnaud.pouliquen@st.com \
    --cc=airlied@linux.ie \
    --cc=alsa-devel@alsa-project.org \
    --cc=benjamin.gaignard@linaro.org \
    --cc=broonie@kernel.org \
    --cc=jsarha@ti.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux@arm.linux.org.uk \
    --cc=moinejf@free.fr \
    --cc=p.zabel@pengutronix.de \
    --cc=tiwai@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).