alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com
Subject: Re: [PATCH] ASoC: core: Fix race in dapm_power_widgets
Date: Thu, 04 Nov 2010 09:51:02 +0000	[thread overview]
Message-ID: <1288864262.3277.10.camel@odin> (raw)
In-Reply-To: <1288858605-8388-1-git-send-email-peter.ujfalusi@nokia.com>

On Thu, 2010-11-04 at 10:16 +0200, Peter Ujfalusi wrote:
> dapm_power_widgets can be called from different context.
> When two calls are happening at the same time both will
> try to change states/lists. This can lead to kernel crash.
> 
> A simple way to reproduce the problem:
> 
> while [ "1" = "1" ] ; do
> amixer sset -Dhw:0 -q 'Mixer for loopback' on
> amixer sset -Dhw:0 -q 'Mixer for loopback' off
> done &
> 
> while [ "1" = "1" ] ; do
> aplay -Dplughw:0 -fdat -d 3 /dev/urandom
> echo "Playback finished"
> sleep 6
> done &
> 
> Add new card level mutex (dpw_mutex) to protect the
> dapm_power_widgets from race.
> The exisiting card->mutex can not be used for this purpose,
> since it has been taken in probe time in the
> snd_soc_instantiate_card function. Through probe calls from
> this function eventually dapm_power_widgets will be called,
> which will lead to dead lock.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

  reply	other threads:[~2010-11-04  9:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04  8:16 [PATCH] ASoC: core: Fix race in dapm_power_widgets Peter Ujfalusi
2010-11-04  9:51 ` Liam Girdwood [this message]
2010-11-04 13:43 ` Mark Brown
2010-11-04 14:18   ` Peter Ujfalusi
2010-11-04 18:08     ` Mark Brown
2010-11-05  7:53       ` Peter Ujfalusi
2010-11-05 14:38         ` Mark Brown
2010-11-06 11:00           ` Liam Girdwood
2010-11-06 15:10             ` Mark Brown

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=1288864262.3277.10.camel@odin \
    --to=lrg@slimlogic.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=peter.ujfalusi@nokia.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;
as well as URLs for NNTP newsgroup(s).