]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: control: queue events within locking of controls_rwsem for ELEM_WRITE operation
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 20 Aug 2017 04:49:06 +0000 (13:49 +0900)
committerTakashi Iwai <tiwai@suse.de>
Sun, 20 Aug 2017 07:39:53 +0000 (09:39 +0200)
commit998b00f81dc3ed5fd286049163d853bc1cc2f5b4
tree7046be0c50860a09203864757869d4311a7d89d2
parent04126b2c7d3b591724f128126a4919b7eb24efec
ALSA: control: queue events within locking of controls_rwsem for ELEM_WRITE operation

Any control event is queued by a call of snd_ctl_notify(). This function
adds the event to each queue of opened file data corresponding to ALSA
control character devices. This function acquired two types of lock; a
counting semaphore for a list of the opened file data and a spinlock for
card data opened by the file. Typically, this function is called after
acquiring a counting semaphore for a list of elements in the card data.

In current implementation of a handler for ELEM_WRITE request, the
function is called after releasing the semaphore for a list of elements
in the card data. This release is not necessarily needed.

This commit removes the release to call the function within the critical
section so that later commits are simple.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/control.c