1. 05 1月, 2018 3 次提交
    • T
      ALSA: aloop: Fix inconsistent format due to incomplete rule · b088b53e
      Takashi Iwai 提交于
      The extra hw constraint rule for the formats the aloop driver
      introduced has a slight flaw, where it doesn't return a positive value
      when the mask got changed.  It came from the fact that it's basically
      a copy&paste from snd_hw_constraint_mask64().  The original code is
      supposed to be a single-shot and it modifies the mask bits only once
      and never after, while what we need for aloop is the dynamic hw rule
      that limits the mask bits.
      
      This difference results in the inconsistent state, as the hw_refine
      doesn't apply the dependencies fully.  The worse and surprisingly
      result is that it causes a crash in OSS emulation when multiple
      full-duplex reads/writes are performed concurrently (I leave why it
      triggers Oops to readers as a homework).
      
      For fixing this, replace a few open-codes with the standard
      snd_mask_*() macros.
      
      Reported-by: syzbot+3902b5220e8ca27889ca@syzkaller.appspotmail.com
      Fixes: b1c73fc8 ("ALSA: snd-aloop: Fix hw_params restrictions and checking")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b088b53e
    • T
      ALSA: aloop: Release cable upon open error path · 9685347a
      Takashi Iwai 提交于
      The aloop runtime object and its assignment in the cable are left even
      when opening a substream fails.  This doesn't mean any memory leak,
      but it still keeps the invalid pointer that may be referred by the
      another side of the cable spontaneously, which is a potential Oops
      cause.
      
      Clean up the cable assignment and the empty cable upon the error path
      properly.
      
      Fixes: 597603d6 ("ALSA: introduce the snd-aloop module for the PCM loopback")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9685347a
    • T
      ALSA: pcm: Workaround for weird PulseAudio behavior on rewind error · fb51f1cd
      Takashi Iwai 提交于
      The commit 9027c463 ("ALSA: pcm: Call ack() whenever appl_ptr is
      updated") introduced the possible error code returned from the PCM
      rewind ioctl.  Basically the change was for handling the indirect PCM
      more correctly, but ironically, it caused rather a side-effect:
      PulseAudio gets pissed off when receiving an error from rewind, throws
      everything away and stops processing further, resulting in the
      silence.
      
      It's clearly a failure in the application side, so the best would be
      to fix that bug in PA.  OTOH, PA is mostly the only user of the rewind
      feature, so it's not good to slap the sole customer.
      
      This patch tries to mitigate the situation: instead of returning an
      error, now the rewind ioctl returns zero when the driver can't rewind.
      It indicates that no rewind was performed, so the behavior is
      consistent, at least.
      
      Fixes: 9027c463 ("ALSA: pcm: Call ack() whenever appl_ptr is updated")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      fb51f1cd
  2. 04 1月, 2018 1 次提交
  3. 02 1月, 2018 1 次提交
    • T
      ALSA: pcm: Remove incorrect snd_BUG_ON() usages · fe08f34d
      Takashi Iwai 提交于
      syzkaller triggered kernel warnings through PCM OSS emulation at
      closing a stream:
        WARNING: CPU: 0 PID: 3502 at sound/core/pcm_lib.c:1635
        snd_pcm_hw_param_first+0x289/0x690 sound/core/pcm_lib.c:1635
        Call Trace:
        ....
         snd_pcm_hw_param_near.constprop.27+0x78d/0x9a0 sound/core/oss/pcm_oss.c:457
         snd_pcm_oss_change_params+0x17d3/0x3720 sound/core/oss/pcm_oss.c:969
         snd_pcm_oss_make_ready+0xaa/0x130 sound/core/oss/pcm_oss.c:1128
         snd_pcm_oss_sync+0x257/0x830 sound/core/oss/pcm_oss.c:1638
         snd_pcm_oss_release+0x20b/0x280 sound/core/oss/pcm_oss.c:2431
         __fput+0x327/0x7e0 fs/file_table.c:210
         ....
      
      This happens while it tries to open and set up the aloop device
      concurrently.  The warning above (invoked from snd_BUG_ON() macro) is
      to detect the unexpected logical error where snd_pcm_hw_refine() call
      shouldn't fail.  The theory is true for the case where the hw_params
      config rules are static.  But for an aloop device, the hw_params rule
      condition does vary dynamically depending on the connected target;
      when another device is opened and changes the parameters, the device
      connected in another side is also affected, and it caused the error
      from snd_pcm_hw_refine().
      
      That is, the simplest "solution" for this is to remove the incorrect
      assumption of static rules, and treat such an error as a normal error
      path.  As there are a couple of other places using snd_BUG_ON()
      incorrectly, this patch removes these spurious snd_BUG_ON() calls.
      
      Reported-by: syzbot+6f11c7e2a1b91d466432@syzkaller.appspotmail.com
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      fe08f34d
  4. 27 12月, 2017 1 次提交
  5. 22 12月, 2017 4 次提交
  6. 21 12月, 2017 1 次提交
    • T
      Merge tag 'asoc-fix-v4.15-rc4' of... · 1e9a328e
      Takashi Iwai 提交于
      Merge tag 'asoc-fix-v4.15-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Fixes for v4.15
      
      This is a fairly large set of fixes, they've been delayed partly as more
      and more keep coming in.  Most of them are very small driver specific
      fixes, the biggest individual thing is the revert of the rcar IOMMU
      support - it was causing problems and there wasn't the confidence that
      it could be resolved sensibly.  There's also a relatively large change
      in the Freescale SSI controller which resolves some issues with the
      AC'97 mode, these aren't that large in the grand scheme of things and
      reflect some fairly thorough review and testing.
      1e9a328e
  7. 20 12月, 2017 7 次提交
  8. 19 12月, 2017 3 次提交
    • B
      ASoC: rt5514-spi: only enable wakeup when fully initialized · 20220945
      Brian Norris 提交于
      If an rt5514-spi device is probed but the platform hasn't linked it in,
      we might never fully request the SPI IRQ, nor configure the rt5514 DSP,
      but we still might try to enable the SPI IRQ (enable_irq_wake()). This
      is bad, and among other things, can cause the interrupt to trigger every
      time we try to suspend the system (e.g., because the interrupt trigger
      setting was never set properly).
      
      Instead of setting our wakeup capabilities in the SPI driver probe
      routine, let's wait until we've actually requested the IRQ.
      
      Fixes issues seen on the "kevin" Chromebook (Samsung Chromebook Plus).
      
      Fixes: 58f1c07d ("ASoC: rt5514: Voice wakeup support.")
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      20220945
    • A
      ASoC: nau8825: fix issue that pop noise when start capture · d070f7c7
      Abhijeet Kumar 提交于
      In skylake platform, we hear a loud pop noise(0 dB) at start of
      audio capture power up sequence. This patch removes the pop noise
      from the recording by adding a delay before enabling ADC.
      Signed-off-by: NAbhijeet Kumar <abhijeet.kumar@intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      d070f7c7
    • T
      ALSA: usb-audio: Fix the missing ctl name suffix at parsing SU · 5a15f289
      Takashi Iwai 提交于
      The commit 89b89d12 ("ALSA: usb-audio: Add check return value for
      usb_string()") added the check of the return value from
      snd_usb_copy_string_desc(), which is correct per se, but it introduced
      a regression.  In the original code, either the "Clock Source",
      "Playback Source" or "Capture Source" suffix is added after the
      terminal string, while the commit changed it to add the suffix only
      when get_term_name() is failing.  It ended up with an incorrect ctl
      name like "PCM" instead of "PCM Capture Source".
      
      Also, even the original code has a similar bug: when the ctl name is
      generated from snd_usb_copy_string_desc() for the given iSelector, it
      also doesn't put the suffix.
      
      This patch addresses these issues: the suffix is added always when no
      static mapping is found.  Also the patch tries to put more comments
      and cleans up the if/else block for better readability in order to
      avoid the same pitfall again.
      
      Fixes: 89b89d12 ("ALSA: usb-audio: Add check return value for usb_string()")
      Reported-and-tested-by: NMauro Santos <registo.mailling@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      5a15f289
  9. 18 12月, 2017 10 次提交
  10. 17 12月, 2017 9 次提交