Re: [PATCH] ASoC: core: Fix race in dapm_power_widgets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

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

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux