android_kernel_motorola_sm6225/sound
Banajit Goswami 7560c37851 ANDROID: GKI: 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
Test: build
Bug: 151372815
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>
(cherry picked from commit 853ed7c58fd03dd1b024f30a20f69a8df06cceed)
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-04-17 00:42:47 +00:00
..
ac97 ALSA: ac97: Fix double free of ac97_codec_device 2019-07-31 07:27:11 +02:00
aoa ALSA: aoa: onyx: always initialize register read value 2020-01-27 14:51:02 +01:00
arm ASoC: pxa2xx-pcm-lib: fix indenting 2018-06-29 12:05:05 +01:00
atmel
core ANDROID: GKI: ALSA: jack: Add support to report second microphone 2020-04-17 00:42:31 +00:00
drivers ALSA: dummy: Fix PCM format loop in proc output 2020-02-11 04:33:56 -08:00
firewire ALSA: dice: fix fallback from protocol extension into limited functionality 2020-01-23 08:21:28 +01:00
hda ALSA: hda: do not override bus codec_mask in link_get() 2020-03-11 14:14:47 +01:00
i2c ALSA: i2c/cs8427: Fix int to char conversion 2019-12-01 09:16:36 +01:00
isa ALSA: cs4236: fix error return comparison of an unsigned integer 2020-01-09 10:19:02 +01:00
mips ALSA: pcm: Nuke snd_pcm_lib_mmap_vmalloc() 2018-07-18 08:24:29 +02:00
oss treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
parisc
pci ALSA: hda/ca0132 - Add Recon3Di quirk to handle integrated sound on EVGA X99 Classified motherboard 2020-04-13 10:45:04 +02:00
pcmcia Merge branch 'for-linus' into topic/virmidi 2018-07-29 22:39:29 +02:00
ppc powerpc/ps3: Set driver coherent_dma_mask 2018-07-20 12:50:37 +10:00
sh ALSA: sh: Fix compile warning wrt const 2020-02-24 08:34:45 +01:00
soc ANDROID: GKI: ASoC: Add locking in DAPM widget power update 2020-04-17 00:42:47 +00:00
sparc ALSA: sparc: Fix invalid snd_free_pages() at error path 2018-12-05 19:32:08 +01:00
spi
synth ALSA: emux: Fix potential Spectre v1 vulnerabilities 2019-01-09 17:38:36 +01:00
usb ANDROID: GKI: sound: usb: Add snd_usb_enable_audio_stream/find_snd_usb_substream 2020-04-14 12:57:13 -07:00
x86 ALSA: x86: Fix runtime PM for hdmi-lpe-audio 2019-03-27 14:14:41 +09:00
xen ALSA: xen: Use standard pcm_format_to_bits() for ALSA format bits 2018-07-27 09:05:34 +02:00
ac97_bus.c
Kconfig ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver 2018-05-16 12:58:36 +02:00
last.c
Makefile ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver 2018-05-16 12:58:36 +02:00
sound_core.c sound: fix a memory leak bug 2019-08-16 10:12:39 +02:00