[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140212154414.GW28112@sirena.org.uk>
Date: Wed, 12 Feb 2014 15:44:14 +0000
From: Mark Brown <broonie@...nel.org>
To: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
Cc: lgirdwood@...il.com, dmitry.torokhov@...il.com,
myungjoo.ham@...sung.com, cw00.choi@...sung.com,
alsa-devel@...a-project.org, patches@...nsource.wolfsonmicro.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: dapm: Add locking to snd_soc_dapm_xxxx_pin
functions
On Wed, Feb 12, 2014 at 11:24:09AM +0000, Charles Keepax wrote:
> On Mon, Feb 10, 2014 at 12:08:03PM +0000, Mark Brown wrote:
> > Unfortunately the fix needs to be in the callers to some extent - there
> > are situations where you want to do atomic updates of multiple pins so
> > that we don't end up bouncing the power up and down too much, we need
> > the unlocked version for things that care. This means we need to at
> > least preserve an unlocked version and translate those callers that
> > might care over to it (not sure if any of them are in mainline).
> There are indeed none in mainline at the moment, or at least if
> there are any they are not holding the lock at the moment so it
> is not obviously they require atomic update.
Anything doing this off jack detection probably falls into that category
so the core jack detection code ought to be doing a bulk update. For
safety I'd say that anything that's doing multiple updates at once
should be assumed to expect them to go through together (that is the
most likely outcome after all and the whole update then sync idiom means
the code looks that way).
> How would you feel about adding an extra functions that allows the
> caller to hold the lock and adding locking into the DAPM core for
> the existing users? Feels like the intention would be more clear
> and will allow out of mainline users requiring atomic updates to
> still do that.
That was roughly what I was suggesting, yes.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists