aboutsummaryrefslogtreecommitdiff
path: root/sound/firewire
diff options
context:
space:
mode:
authorGravatar Takashi Sakamoto <o-takashi@sakamocchi.jp> 2017-08-20 13:49:07 +0900
committerGravatar Takashi Iwai <tiwai@suse.de> 2017-08-20 09:39:54 +0200
commitbecf9e5d553c2389d857a3c178ce80fdb34a02e1 (patch)
tree06995f7d47c8d0e0f7e13bcdf8e14eac1de6bf0e /sound/firewire
parentALSA: control: queue events within locking of controls_rwsem for ELEM_WRITE o... (diff)
downloadlinux-becf9e5d553c2389d857a3c178ce80fdb34a02e1.tar.gz
linux-becf9e5d553c2389d857a3c178ce80fdb34a02e1.tar.bz2
linux-becf9e5d553c2389d857a3c178ce80fdb34a02e1.zip
ALSA: control: code refactoring for ELEM_READ/ELEM_WRITE operations
ALSA control core handles ELEM_READ/ELEM_WRITE requests within lock acquisition of a counting semaphore. The lock is acquired in helper functions in the end of call path before calling implementations of each driver. ioctl(2) with SNDRV_CTL_ELEM_READ ... ->snd_ctl_ioctl() ->snd_ctl_elem_read_user() ->snd_ctl_elem_read() ->down_read(controls_rwsem) ->snd_ctl_find_id() ->struct snd_kcontrol.get() ->up_read(controls_rwsem) ioctl(2) with SNDRV_CTL_ELEM_WRITE ... ->snd_ctl_ioctl() ->snd_ctl_elem_write_user() ->snd_ctl_elem_write() ->down_read(controls_rwsem) ->snd_ctl_find_id() ->struct snd_kcontrol.put() ->up_read(controls_rwsem) This commit moves the lock acquisition to middle of the call graph to simplify the helper functions. As a result: ioctl(2) with SNDRV_CTL_ELEM_READ ... ->snd_ctl_ioctl() ->snd_ctl_elem_read_user() ->down_read(controls_rwsem) ->snd_ctl_elem_read() ->snd_ctl_find_id() ->struct snd_kcontrol.get() ->up_read(controls_rwsem) ioctl(2) with SNDRV_CTL_ELEM_WRITE ... ->snd_ctl_ioctl() ->snd_ctl_elem_write_user() ->down_read(controls_rwsem) ->snd_ctl_elem_write() ->snd_ctl_find_id() ->struct snd_kcontrol.put() ->up_read(controls_rwsem) Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire')
0 files changed, 0 insertions, 0 deletions