On Fri, 2012-07-06 at 17:02 +0100, Mark Brown wrote:
On Fri, Jul 06, 2012 at 04:57:05PM +0100, Liam Girdwood wrote:
Codec shutdown performs a DAPM power sequence that might cause conflicts and/or race conditions if another stream power event is running simultaneously. Use card's dapm mutex to protect any potential race condition between them.
There's a bigger problem here if we're managing to run into this - the shutdown function is only supposed to be being called while the system is in the middle of shutting down so we've probably got a bunch of other races further up the stack to worry about too...
I don't think there is anything explicitly stopping a power off from happening during a stream shutdown atm without this patch. It was reported to me that this would fail 1 in 20 times on a certain device and that the above patch fixed the issue (1200 tests completed OK after the patch).
I do think we need this patch atm since we are accessing the same resources as the stream event.
Liam