alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Liam Girdwood <lrg@ti.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH 2/3] ASoC: dapm - Use card mutex for DAPM ops instead of codec mutex.
Date: Mon, 5 Mar 2012 20:34:09 +0000	[thread overview]
Message-ID: <20120305203409.GA3224@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1330967112.4370.23.camel@odin>


[-- Attachment #1.1: Type: text/plain, Size: 1569 bytes --]

On Mon, Mar 05, 2012 at 05:05:12PM +0000, Liam Girdwood wrote:
> On Mon, 2012-03-05 at 16:45 +0000, Mark Brown wrote:

> > control_rwsem isn't in mainline...

> Sorry, my typo controls_rwsem. Mostly used in sound/core/control.c

Oh, ick.  Right.  This is a bit nasty.  So, the ALSA core is assuming
that we won't lock against ourselves during probe, which is actually not
that unreasonable given that the driver model guarantees that probe
isn't going to get called multiple times.  Now, if Grant's probe
deferral stuff makes it in to 3.4 (which would be nice anyway and is
looking likely) we can actually pretty much do that as the driver core
will do the waiting for things to come up bit for us which is the main
thing we're worried about here.

That said there are cases where we want to do a DAPM run due to
interrupts.  Currently we're actually just suppressing all those DAPM
runs so perhaps we'd be home free, we'd just need to worry about widget
status updates and that's much more localised.  But let's just add the
nested mutex for now (well, I guess for 3.5 at this point - Linus is
threatening to open the merge window this week so probably shouldn't be
pushing much new stuff in now) and take another look later.

The other nicer thing to do would be to fix this at an ALSA level - the
controls_rwsem looks like a good candidate for something like RCU, it's
a read mostly list with very infrequent updates so even a rwsem is more
heavyweight than we need.  The index offset stuff does make things very
slightly more complex though I think it's tractable.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2012-03-05 20:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 18:11 [PATCH 1/3] ASoC: core - Add card mutex locking subclasses Liam Girdwood
2012-03-02 18:11 ` [PATCH 2/3] ASoC: dapm - Use card mutex for DAPM ops instead of codec mutex Liam Girdwood
2012-03-04 14:09   ` Mark Brown
2012-03-05 14:48     ` Liam Girdwood
2012-03-05 15:26       ` Mark Brown
2012-03-05 15:55         ` Liam Girdwood
2012-03-05 16:45           ` Mark Brown
2012-03-05 17:05             ` Liam Girdwood
2012-03-05 20:34               ` Mark Brown [this message]
2012-03-02 18:11 ` [PATCH 3/3] ASoC: dapm - lock mixer & mux update power with card mutex Liam Girdwood

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=20120305203409.GA3224@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@ti.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).