[alsa-devel] [PATCH 2/2] ASoC: DAPM - Make sure DAPM widget IO ops hold the component mutex.

Liam Girdwood lrg at ti.com
Wed Mar 7 12:13:25 CET 2012


On Wed, 2012-03-07 at 10:54 +0000, Mark Brown wrote:
> On Wed, Mar 07, 2012 at 10:11:01AM +0000, Liam Girdwood wrote:
> > On Tue, 2012-03-06 at 20:03 +0000, Mark Brown wrote:
> 
> > > Actually for CODECs we don't need to hold the CODEC mutex for I/O if
> > > we've pushed the cache down into regmap - regmap does all the locking
> > > for us.  I'll send a followup patch.
> 
> > I know, but this patch did check for regmap usage in
> > soc_widget_update_bits_locked(). With your fix we are doing the regmap
> > test twice.
> 
> Yes, we are but it's a simple comparison with integer so not the end of
> the world.  I'd much rather have the check in the locking code so it's
> clear what's expected instead of split between one of the call sites and
> the locking function where it might easily get missed if someone adds a
> new user.

Ah, I'm thinking with a different perspective here ;-)

My reasoning is that the widget lock will guarantee the component lock.
With the regmap test we don't guarantee a component lock and subsequent
new widget lock users may depend on this lock.

Liam



More information about the Alsa-devel mailing list