alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Peter Ujfalusi <peter.ujfalusi@nokia.com>
Subject: Re: [PATCH] ASoC: core: Fix race in dapm_power_widgets
Date: Sat, 06 Nov 2010 11:00:06 +0000	[thread overview]
Message-ID: <1289041206.3318.12.camel@odin> (raw)
In-Reply-To: <20101105143809.GD15977@opensource.wolfsonmicro.com>

On Fri, 2010-11-05 at 10:38 -0400, Mark Brown wrote:
> On Fri, Nov 05, 2010 at 09:53:35AM +0200, Peter Ujfalusi wrote:
> 
> > Well, I think if we want to have one place to use a lock, this is the highest we 
> > can go.
> 
> This assumes that we've figured out the correct thing to lock and where
> we need to hold it - if you want to lock the DAPM algorithm then that's
> one thing, but it's not clear to me that this is the only thing we need
> to lock or if we need to ensure that the users of DAPM are handled and
> therefore this level of stuff becomes redundant.
> 
> > All other places, when dapm_power_widgets called are protected by codec->mutex 
> > so those paths are safe.
> > By replacing the custom kcontrol/callbacks with SOC_DAPM_PIN_SWITCH() the 
> > problem is gone.
> > So it seams that my case can be solved easily with the SOC_DAPM_PIN_SWITCH(), 
> > but the race remains, and other setups might fail under some rare scenario
> 
> This is all smelling like we should be doing something to ensure that
> all the controls take the CODEC lock.  We're relying pretty heavily on
> that throughout the code so there's going to be other smoking guns
> there.
> 

I think we need to consider non CODEC components too that have DAPM
controls (and have no CODEC mutex). i.e OMAP4 ABE. 

I'll try and look into this later as part of the OMAP4 upstream. Ideally
a card/DAPM mutex may be more desirable here.

Liam
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

  reply	other threads:[~2010-11-06 11:00 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
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 [this message]
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=1289041206.3318.12.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).