1. 28 10月, 2015 1 次提交
  2. 22 10月, 2015 1 次提交
  3. 16 10月, 2015 1 次提交
  4. 15 10月, 2015 1 次提交
  5. 09 10月, 2015 1 次提交
    • K
      ALSA: seq_oss: fix waitqueue_active without memory barrier in snd-seq-oss · 69447027
      Kosuke Tatsukawa 提交于
      snd_seq_oss_readq_put_event() seems to be missing a memory barrier which
      might cause the waker to not notice the waiter and miss sending a
      wake_up as in the following figure.
      
          snd_seq_oss_readq_put_event		    snd_seq_oss_readq_wait
      ------------------------------------------------------------------------
      					/* wait_event_interruptible_timeout */
      					 /* __wait_event_interruptible_timeout */
      					  /* ___wait_event */
      					  for (;;) {									 prepare_to_wait_event(&wq, &__wait,
      					    state);
      spin_lock_irqsave(&q->lock, flags);
      if (waitqueue_active(&q->midi_sleep))
      /* The CPU might reorder the test for
         the waitqueue up here, before
         prior writes complete */
      					  if ((q->qlen>0 || q->head==q->tail)
      					  ...
      					  __ret = schedule_timeout(__ret)
      if (q->qlen >= q->maxlen - 1) {
      memcpy(&q->q[q->tail], ev, sizeof(*ev));
      q->tail = (q->tail + 1) % q->maxlen;
      q->qlen++;
      ------------------------------------------------------------------------
      
      There are two other place in sound/core/seq/oss/ which have similar
      code.  The attached patch removes the call to waitqueue_active() leaving
      just wake_up() behind.  This fixes the problem because the call to
      spin_lock_irqsave() in wake_up() will be an ACQUIRE operation.
      
      I found this issue when I was looking through the linux source code
      for places calling waitqueue_active() before wake_up*(), but without
      preceding memory barriers, after sending a patch to fix a similar
      issue in drivers/tty/n_tty.c  (Details about the original issue can be
      found here: https://lkml.org/lkml/2015/9/28/849).
      Signed-off-by: NKosuke Tatsukawa <tatsu@ab.jp.nec.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      69447027
  6. 29 9月, 2015 1 次提交
  7. 24 9月, 2015 1 次提交
  8. 13 9月, 2015 1 次提交
    • T
      ALSA: pcm: remove structure member of 'struct snd_pcm_hwptr_log *' type... · 0052b7dc
      Takashi Sakamoto 提交于
      ALSA: pcm: remove structure member of 'struct snd_pcm_hwptr_log *' type because this structure had been removed
      
      This structure was added by 4d96eb25 ('ALSA: pcm_lib - add possibility
      to log last 10 DMA ring buffer positions') to store PCM pointers
      information of latest 10 pointer movements (=XRUN_LOG_CNT). When
      CONFIG_SND_PCM_XRUN_DEBUG is configured, 'struct snd_pcm_runtime' has
      'hwptr_log' member with a pointer to the structure. When calling
      xrun_log() in pcm_lib.c, the structure was allocated to the pointer.
      When calling snd_pcm_detach_substream() in pcm.c, the allocated pointer
      is released.
      
      In f5914908 ('ALSA: pcm: Replace PCM hwptr tracking with tracepoints'),
      the pointer logging is replaced with using Linux Kernel Tracepoints. The
      structure was also removed, while it's just declared. The member and kfree
      still remains.
      
      This commit removes the member and related codes. I think this was
      overlooked because it brings no errors/warnings to C compilers.
      
      Fixes: f5914908 ('ALSA: pcm: Replace PCM hwptr tracking with tracepoints')
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0052b7dc
  9. 17 7月, 2015 1 次提交
    • T
      ALSA: pcm: Fix lockdep warning with nonatomic PCM ops · 67756e31
      Takashi Iwai 提交于
      With the nonatomic PCM ops, the system may spew lockdep warnings like:
      
       =============================================
       [ INFO: possible recursive locking detected ]
       4.2.0-rc1-jeejaval3 #12 Not tainted
       ---------------------------------------------
       aplay/4029 is trying to acquire lock:
        (snd_pcm_link_rwsem){.+.+.+}, at: [<ffffffff816fd473>] snd_pcm_stream_lock+0x43/0x60
      
       but task is already holding lock:
        (snd_pcm_link_rwsem){.+.+.+}, at: [<ffffffff816fcf29>] snd_pcm_action_nonatomic+0x29/0x80
      
       other info that might help us debug this:
        Possible unsafe locking scenario:
      
              CPU0
              ----
         lock(snd_pcm_link_rwsem);
         lock(snd_pcm_link_rwsem);
      
      Although this is false-positive as the rwsem is taken always as
      read-only for these code paths, it's certainly annoying to see this at
      any occasion.  A simple fix is to use down_read_nested() in
      snd_pcm_stream_lock() that can be called inside another lock.
      Reported-by: NVinod Koul <vinod.koul@intel.com>
      Reported-by: NJeeja Kp <jeeja.kp@intel.com>
      Tested-by: NJeeja Kp <jeeja.kp@intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      67756e31
  10. 01 7月, 2015 1 次提交
    • V
      genalloc: rename of_get_named_gen_pool() to of_gen_pool_get() · abdd4a70
      Vladimir Zapolskiy 提交于
      To be consistent with other kernel interface namings, rename
      of_get_named_gen_pool() to of_gen_pool_get().  In the original function
      name "_named" suffix references to a device tree property, which contains
      a phandle to a device and the corresponding device driver is assumed to
      register a gen_pool object.
      
      Due to a weak relation and to avoid any confusion (e.g.  in future
      possible scenario if gen_pool objects are named) the suffix is removed.
      
      [sfr@canb.auug.org.au: crypto/marvell/cesa - fix up for of_get_named_gen_pool() rename]
      Signed-off-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Philipp Zabel <p.zabel@pengutronix.de>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: Sascha Hauer <kernel@pengutronix.de>
      Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
      Cc: Vinod Koul <vinod.koul@intel.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      abdd4a70
  11. 30 6月, 2015 1 次提交
    • C
      ALSA: Fix uninintialized error return · 0755e74b
      Colin Ian King 提交于
      Static analysis with cppcheck found the following error:
        [sound/core/init.c:118]: (error) Uninitialized variable: err
      
      ..this was introduced by commit 2471b6c8
      ("ALSA: info: Register proc entries recursively, too") where the call
      to snd_info_card_register was removed and no longer setting the error
      return in err.  When snd_info_create_card_entry fails to allocate a
      an entry, the error path exits with garbage in err.  Fix is to return
      -ENOMEM if entry fails to be allocated.
      
      Fixes: 2471b6c8 ("ALSA: info: Register proc entries recursively, too")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0755e74b
  12. 26 6月, 2015 1 次提交
  13. 23 6月, 2015 1 次提交
    • T
      ALSA: pcm: Fix pcm_class sysfs output · 60b93030
      Takashi Iwai 提交于
      The pcm_class sysfs of each PCM substream gives only "none" since the
      recent code change to embed the struct device.  Fix the code to point
      directly to the embedded device object properly.
      
      Fixes: ef46c7af ('ALSA: pcm: Embed struct device')
      Cc: <stable@vger.kernel.org> # v4.0+
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      60b93030
  14. 29 5月, 2015 2 次提交
  15. 28 5月, 2015 2 次提交
  16. 22 5月, 2015 2 次提交
  17. 21 5月, 2015 1 次提交
  18. 19 5月, 2015 1 次提交
    • K
      ALSA: pcm: Modify double acknowledged interrupts check condition · 13a98839
      Koro Chen 提交于
      Currently in snd_pcm_update_hw_ptr0 during interrupt,
      we consider there were double acknowledged interrupts when:
      1. HW reported pointer is smaller than expected, and
      2. Time from last update time (hdelta) is over half a buffer time.
      
      However, when HW reported pointer is only a few bytes smaller than
      expected, and when hdelta is just a little larger than half a buffer time
      (e.g. ping-pong buffer), it wrongly treats this IRQ as double acknowledged.
      
      The condition #2 uses jiffies, but jiffies is not high resolution
      since it is integer. We should consider jiffies inaccuracy.
      Signed-off-by: NKoro Chen <koro.chen@mediatek.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      13a98839
  19. 18 5月, 2015 4 次提交
  20. 30 4月, 2015 2 次提交
  21. 28 4月, 2015 5 次提交
  22. 24 4月, 2015 6 次提交
  23. 23 4月, 2015 2 次提交
    • T
      ALSA: core: Fix possible memory leaks at error path in info.c · 886364f6
      Takashi Iwai 提交于
      Currently, snd_info_init() just returns an error without releasing the
      previously assigned resources at error path.  The assigned proc and
      info entries have to be released properly.  This patch covers it.
      
      While we are at it, refactor the code a bit, too.
      Acked-by: NJaroslav Kysela <perex@perex.cz>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      886364f6
    • T
      ALSA: core: Use seq_file for text proc file reads · 4adb7bcb
      Takashi Iwai 提交于
      seq_file is _the_ standard interface for simple text proc files.
      Though, we still need to support the binary proc files and the text
      file write, and also we need to manage the device disconnection
      gracefully.  Thus this patch just replaces the text file read code
      with seq_file while keeping the rest intact.
      
      snd_iprintf() helper function is now a macro to expand itself to
      seq_printf() to be compatible with the existing code.  The seq_file
      object is stored to the unused entry->rbuffer->buffer pointer.
      
      When the output size is expected to be large (greater than PAGE_SIZE),
      the driver should set entry->size field beforehand.  Then the given
      size will be preallocated and the multiple show calls can be avoided.
      Acked-by: NJaroslav Kysela <perex@perex.cz>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4adb7bcb