1. 28 Nov, 2018 1 commit
  2. 27 Nov, 2018 2 commits
  3. 26 Nov, 2018 1 commit
  4. 24 Nov, 2018 3 commits
    • Takashi Iwai's avatar
      ALSA: control: Fix race between adding and removing a user element · e1a7bfe3
      Takashi Iwai authored
      The procedure for adding a user control element has some window opened
      for race against the concurrent removal of a user element.  This was
      caught by syzkaller, hitting a KASAN use-after-free error.
      This patch addresses the bug by wrapping the whole procedure to add a
      user control element with the card->controls_rwsem, instead of only
      around the increment of card->user_ctl_count.
      This required a slight code refactoring, too.  The function
      snd_ctl_add() is split to two parts: a core function to add the
      control element and a part calling it.  The former is called from the
      function for adding a user control element inside the controls_rwsem.
      One change to be noted is that snd_ctl_notify() for adding a control
      element gets called inside the controls_rwsem as well while it was
      called outside the rwsem.  But this should be OK, as snd_ctl_notify()
      takes another (finer) rwlock instead of rwsem, and the call of
      snd_ctl_notify() inside rwsem is already done in another code path.
      Reported-by: syzbot+dc09047bce3820621ba2@syzkaller.appspotmail.com
      Cc: <stable@vger.kernel.org>
      Signed-off-by: Takashi Iwai's avatarTakashi Iwai <tiwai@suse.de>
    • Takashi Iwai's avatar
      ALSA: sparc: Fix invalid snd_free_pages() at error path · 9a20332a
      Takashi Iwai authored
      Some spurious calls of snd_free_pages() have been overlooked and
      remain in the error paths of sparc cs4231 driver code.  Since
      runtime->dma_area is managed by the PCM core helper, we shouldn't
      release manually.
      Drop the superfluous calls.
      Reviewed-by: Takashi Sakamoto's avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: Takashi Iwai's avatarTakashi Iwai <tiwai@suse.de>
    • Takashi Iwai's avatar
      ALSA: wss: Fix invalid snd_free_pages() at error path · 7b691541
      Takashi Iwai authored
      Some spurious calls of snd_free_pages() have been overlooked and
      remain in the error paths of wss driver code.  Since runtime->dma_area
      is managed by the PCM core helper, we shouldn't release manually.
      Drop the superfluous calls.
      Reviewed-by: Takashi Sakamoto's avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: Takashi Iwai's avatarTakashi Iwai <tiwai@suse.de>
  5. 23 Nov, 2018 6 commits
  6. 20 Nov, 2018 2 commits
  7. 19 Nov, 2018 2 commits
  8. 15 Nov, 2018 1 commit
  9. 14 Nov, 2018 3 commits
    • Tzung-Bi Shih's avatar
      ASoC: dapm: Recalculate audio map forcely when card instantiated · 882eab6c
      Tzung-Bi Shih authored
      Audio map are possible in wrong state before card->instantiated has
      been set to true.  Imaging the following examples:
      time 1: at the beginning
        in:-1    in:-1    in:-1    in:-1
       out:-1   out:-1   out:-1   out:-1
       SIGGEN        A        B      Spk
      time 2: after someone called snd_soc_dapm_new_widgets()
      (e.g. create_fill_widget_route_map() in sound/soc/codecs/hdac_hdmi.c)
         in:1     in:0     in:0     in:0
        out:0    out:0    out:0    out:1
       SIGGEN        A        B      Spk
      time 3: routes added
         in:1     in:0     in:0     in:0
        out:0    out:0    out:0    out:1
       SIGGEN -----> A -----> B ---> Spk
      In the end, the path should be powered on but it did not.  At time 3,
      "in" of SIGGEN and "out" of Spk did not propagate to their neighbors
      because snd_soc_dapm_add_path() will not invalidate the paths if
      the card has not instantiated (i.e. card->instantiated is false).
      To correct the state of audio map, recalculate the whole map forcely.
      Signed-off-by: default avatarTzung-Bi Shih <tzungbi@google.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    • Peter Ujfalusi's avatar
      ASoC: omap-abe-twl6040: Fix missing audio card caused by deferred probing · 76836fd3
      Peter Ujfalusi authored
      The machine driver fails to probe in next-20181113 with:
      [    2.539093] omap-abe-twl6040 sound: ASoC: CODEC DAI twl6040-legacy not registered
      [    2.546630] omap-abe-twl6040 sound: devm_snd_soc_register_card() failed: -517
      [    3.693206] omap-abe-twl6040 sound: ASoC: Both platform name/of_node are set for TWL6040
      [    3.701446] omap-abe-twl6040 sound: ASoC: failed to init link TWL6040
      [    3.708007] omap-abe-twl6040 sound: devm_snd_soc_register_card() failed: -22
      [    3.715148] omap-abe-twl6040: probe of sound failed with error -22
      Bisect pointed to a merge commit:
      first bad commit: [0f688ab20a540aafa984c5dbd68a71debebf4d7f] Merge remote-tracking branch 'net-next/master'
      and a diff between a working kernel does not reveal anything which would
      explain the change in behavior.
      Further investigation showed that on the second try of loading fails
      because the dai_link->platform is no longer NULL and it might be pointing
      to uninitialized memory.
      The fix is to move the snd_soc_dai_link and snd_soc_card inside of the
      abe_twl6040 struct, which is dynamically allocated every time the driver
      Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    • Kirill Marinushkin's avatar
      ASoC: pcm3060: Rename output widgets · 933a9549
      Kirill Marinushkin authored
      In the initial commit [1], I added differential output of the codec as
      separate `+` and `-` widgets:
      Later, in the commit [2], I added a device tree property to configure the
      output as single-ended or differential. Having this property, the `+` and
      `-` separation in widgets seems for me confusing. There are no functional
      benefits in such separation, so I find reasonable to get rid of it:
      The new naming is more friendly for sound cards, and is better aligned with
      other codec drivers in kernel.
      Renaming the output widgets now should not be a problem from the backwards-
      compatibility perspective, as the driver for PCM3060 is added into the
      mainline very recently, and did not yet appear in any releases.
      [1] commit 6ee47d4a
       ("ASoC: pcm3060: Add codec driver")
      [2] commit a78c62de00d5 ("ASoC: pcm3060: Add DT property for single-ended
      Signed-off-by: default avatarKirill Marinushkin <kmarinushkin@birdec.tech>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
  10. 13 Nov, 2018 5 commits
  11. 12 Nov, 2018 2 commits
  12. 09 Nov, 2018 2 commits
    • Vasily Khoruzhick's avatar
      ASoC: sun8i-codec: fix crash on module removal · 278df5e5
      Vasily Khoruzhick authored
      drvdata is actually sun8i_codec, not snd_soc_card, so it crashes
      when calling snd_soc_card_get_drvdata().
      Drop card and scodec vars anyway since we don't need to
      disable/unprepare clocks - it's already done by calling
      Drop clk_disable_unprepare() calls for the same reason.
      Fixes: 36c68493
       ("ASoC: Add sun8i digital audio codec")
      Signed-off-by: Vasily Khoruzhick's avatarVasily Khoruzhick <anarsoul@gmail.com>
      Acked-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    • Takashi Iwai's avatar
      ALSA: oss: Use kvzalloc() for local buffer allocations · 65766ee0
      Takashi Iwai authored
      PCM OSS layer may allocate a few temporary buffers, one for the core
      read/write and another for the conversions via plugins.  Currently
      both are allocated via vmalloc().  But as the allocation size is
      equivalent with the PCM period size, the required size might be quite
      small, depending on the application.
      This patch replaces these vmalloc() calls with kvzalloc() for covering
      small period sizes better.  Also, we use "z"-alloc variant here for
      addressing the possible uninitialized access reported by syzkaller.
      Reported-by: syzbot+1cb36954e127c98dd037@syzkaller.appspotmail.com
      Cc: <stable@vger.kernel.org>
      Signed-off-by: Takashi Iwai's avatarTakashi Iwai <tiwai@suse.de>
  13. 06 Nov, 2018 3 commits
  14. 05 Nov, 2018 3 commits
  15. 31 Oct, 2018 1 commit
  16. 30 Oct, 2018 1 commit
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib: fix insufficient PCM rule for period/buffer size · 826b5de9
      Takashi Sakamoto authored
      In a former commit, PCM constraint based on LCM of SYT_INTERVAL was
      obsoleted with PCM rule. However, the new PCM rule brings -EINVAL in
      some cases that max/min values of size of buffer/period is not
      multiples of one of values of SYT_INTERVAL. For example, pulseaudio
      always fail to configure PCM substream.
      This commit changes strategy for the PCM rule. Although the buggy rules
      had a single dependency (rate from period, period from rate, rate from
      buffer, buffer from rate), a revised rule has double dependencies
      (period from period/rate, buffer from buffer/rate). A step of value is
      calculated with table of SYT_INTERVAL and list of available rates. This
      prevents interval template which brings -EINVAL to a call of
      Fixes: 59502295
      ('ALSA: firewire-lib: add PCM rules to obsolete PCM constraints based on LCM of SYT_INTERVAL')
      Signed-off-by: Takashi Sakamoto's avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: Takashi Iwai's avatarTakashi Iwai <tiwai@suse.de>
  17. 29 Oct, 2018 1 commit
    • Alex Stanoev's avatar
      ALSA: ca0106: Disable IZD on SB0570 DAC to fix audio pops · ac237c28
      Alex Stanoev authored
      The Creative Audigy SE (SB0570) card currently exhibits an audible pop
      whenever playback is stopped or resumed, or during silent periods of an
      audio stream. Initialise the IZD bit to the 0 to eliminate these pops.
      The Infinite Zero Detection (IZD) feature on the DAC causes the output
      to be shunted to Vcap after 2048 samples of silence. This discharges the
      AC coupling capacitor through the output and causes the aforementioned
      pop/click noise.
      The behaviour of the IZD bit is described on page 15 of the WM8768GEDS
      datasheet: "With IZD=1, applying MUTE for 1024 consecutive input samples
      will cause all outputs to be connected directly to VCAP. This also
      happens if 2048 consecutive zero input samples are applied to all 6
      channels, and IZD=0. It will be removed as soon as any channel receives
      a non-zero input". I believe the second sentence might be referring to
      IZD=1 instead of IZD=0 given the observed behaviour of the card.
      This change should make the DAC initialisation consistent with
      Creative's Windows driver, as this popping persists when initialising
      the card in Linux and soft rebooting into Windows, but is not present on
      a cold boot to Windows.
      Signed-off-by: default avatarAlex Stanoev <alex@astanoev.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: Takashi Iwai's avatarTakashi Iwai <tiwai@suse.de>
  18. 27 Oct, 2018 1 commit