1. 12 Aug, 2017 12 commits
  2. 10 Aug, 2017 11 commits
  3. 06 Aug, 2017 10 commits
  4. 04 Aug, 2017 6 commits
    • Takashi Sakamoto's avatar
      ALSA: control: code refactoring for TLV request handler to user element set · 6d4d41f0
      Takashi Sakamoto authored
      User-defined element set registers own handler to get callbacks from TLV
      ioctl handler. In the handler, execution path bifurcates depending on
      requests from user space. At write request, container in given buffer is
      registered to the element set, or replaced old TLV data. At the read
      request, the registered data is copied to user space. The command request
      is not allowed.  In current implementation, function of the handler
      includes codes for the two cases.
      
      This commit adds two helper functions for these cases so that readers can
      easily get the above design.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6d4d41f0
    • Takashi Sakamoto's avatar
      ALSA: control: code refactoring TLV ioctl handler · 450296f3
      Takashi Sakamoto authored
      In a design of ALSA control core, execution path bifurcates depending on
      target element. When a set with the target element has a handler, it's
      called. Else, registered buffer is copied to user space. These two
      operations are apparently different.  In current implementation, they're
      on the same function with a condition statement. This makes it a bit hard
      to understand conditions of each case.
      
      This commit splits codes for these two cases.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      450296f3
    • Takashi Sakamoto's avatar
      ALSA: control: obsolete user_ctl_lock · 30d8340b
      Takashi Sakamoto authored
      At a previous commit, concurrent requests for TLV data are maintained
      exclusively between read requests and write/command requests. TLV
      callback handlers in each driver has no risk from concurrent access for
      reference/change.
      
      In current implementation, 'struct snd_card' has a mutex to control
      concurrent accesses to user-defined element sets. This commit obsoletes it.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      30d8340b
    • Takashi Sakamoto's avatar
      ALSA: control: use counting semaphore as write lock for TLV write/command operations · 4c8099e9
      Takashi Sakamoto authored
      In ALSA control interface, applications can execute three types of request
      for Type-Length-Value (TLV) data to a set of elements; read, write and
      command. In ALSA control core, all of the requests are handled within read
      lock to a counting semaphore, therefore several processes can run to access
      to the data at the same time for any purposes. This has an issue because
      write and command requests have side effect to change state of a set of
      elements for the TLV data. Concurrent access should be controlled for each
      of reference/change case.
      
      This commit uses the counting semaphore as read lock for TLV read requests,
      while use it as write lock for TLV write/command requests. The state of a
      set of elements for the TLV data is maintained exclusively between read
      requests and write/command requests, or between write and command requests.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4c8099e9
    • Takashi Sakamoto's avatar
      ALSA: control: queue events within locking of controls_rwsem for TLV operation · 28a0989c
      Takashi Sakamoto authored
      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 TLV request handler, 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: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      28a0989c
    • Takashi Iwai's avatar
      Merge branch 'for-linus' into for-next · 74be62c7
      Takashi Iwai authored
      Back-merge 4.13-rc devel branch for later development.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      74be62c7
  5. 02 Aug, 2017 1 commit