ASoC: Add locking in DAPM widget power update
While playback and capture is done concurrently the dapm widget data is accessed parallelly which results in data corruption and kernel panic. Fix this problem by serializing the stream event operation by adding lock dapm_seq_run will invoke dapm power sequence for pre-sorted list of widgets to be powered up. Kernel panic issue is observed during stability runs with the above sequence caused by null pointer dereference in dapm_seq_run_coalesced. Fix kernel panic issue by checking for valid snd_soc_dapm_context pointer in dapm_seq_run before invoking dapm_seq_run_coalesced Widget list in dapm is getting corrupted during concurrent use cases where dapm_power_widget is accessed. This corruption is resulting in kernel crash in dapm. Fix the issue by adding protection in dapm_power_widgets API. This change also squashes the below changes- (1) ASoC: dapm: fix race condition in dapm Dirty widget list can be accessed by multiple paths in dapm framework. Dirty list is protected by dapm mutex. Since dapm_force_enable_pin function accesses the dirty list, protect it using the dapm mutex. (2) soc-dapm: Fix double mutex lock dapm_mutex lock is acquired from soc_dapm_force_enable_pin_unlocked function which will cause double lock because the same mutex is acquired in soc_dapm_force_enable_pin(). Fix this issue by removing dapm_mutex acquire from soc_dapm_force_enable_pin_unlocked function. CRs-Fixed: 388785 Change-Id: I49d19860277726cf3152e104ab40627fd56c021c Signed-off-by:Sriranjan Srikantam <cssrika@codeaurora.org> Signed-off-by:
Gopikrishnaiah Anandan <agopik@codeaurora.org> Signed-off-by:
Banajit Goswami <bgoswami@codeaurora.org> Signed-off-by:
Meng Wang <mwang@codeaurora.org>
Loading
Please register or sign in to comment