1. 29 Apr, 2015 2 commits
  2. 28 Apr, 2015 1 commit
    • Takashi Iwai's avatar
      ALSA: emux: Fix mutex deadlock in OSS emulation · 1c94e65c
      Takashi Iwai authored
      The OSS emulation in synth-emux helper has a potential AB/BA deadlock
      at the simultaneous closing and opening:
        close ->
          snd_seq_release() ->
            sne_seq_free_client() ->
              snd_seq_delete_all_ports(): takes client->ports_mutex ->
      	  port_delete() ->
      	    snd_emux_unuse(): takes emux->register_mutex
        open ->
          snd_seq_oss_open() ->
            snd_emux_open_seq_oss(): takes emux->register_mutex ->
              snd_seq_event_port_attach() ->
      	  snd_seq_create_port(): takes client->ports_mutex
      This patch addresses the deadlock by reducing the rance taking
      emux->register_mutex in snd_emux_open_seq_oss().  The lock is needed
      for the refcount handling, so move it locally.  The calls in
      emux_seq.c are already with the mutex, thus they are replaced with the
      version without mutex lock/unlock.
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  3. 27 Apr, 2015 7 commits
  4. 24 Apr, 2015 3 commits
  5. 23 Apr, 2015 2 commits
  6. 21 Apr, 2015 3 commits
    • David Henningsson's avatar
      ALSA: hda - fix "num_steps = 0" error on ALC256 · 7d1b6e29
      David Henningsson authored
      The ALC256 does not have a mixer nid at 0x0b, and there's no
      loopback path (the output pins are directly connected to the DACs).
      This commit fixes an "num_steps = 0 for NID=0xb (ctl = Beep Playback Volume)"
      error (and as a result, problems with amixer/alsamixer).
      If there's pcbeep functionality, it certainly isn't controlled by setting an
      amp on 0x0b, so disable beep functionality (at least for now).
      Cc: stable@vger.kernel.org
      BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1446517Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • Takamichi Horikawa's avatar
      ALSA: usb-audio: Fix audio output on Roland SC-D70 sound module · 6d1f2f60
      Takamichi Horikawa authored
      Roland SC-D70 reports its device class as vendor specific class and
      the quirk QUIRK_AUDIO_FIXED_ENDPOINT was used for audio output.
      In the quirks table the sampling rate was hard-coded to 44100 Hz
      and therefore not worked when the sound module was in 48000 Hz mode.
      In this change the quirk is changed to QUIRK_AUDIO_STANDARD_INTERFACE
      but as the sound module reports incorrect bSubframeSize in its
      descriptors, additional change is made in format.c to detect it and
      to override it (which uses the existing code for Edirol SD-90).
      Tested both when the sound module was in 44100 Hz mode and 48000 Hz
      mode and both audio input and output. MIDI related part of the driver
      is not touched.
      Signed-off-by: default avatarTakamichi Horikawa <takamichiho@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • Mengdong Lin's avatar
      ALSA: hda - add AZX_DCAPS_I915_POWERWELL to Baytrail · 40cc2392
      Mengdong Lin authored
      This patch addes AZX_DCAPS_I915_POWERWELL to BYT (Baytrail).
      Like Braswell and Skylake, the HDMI codec on Bytrail is also in the shared
      power well with GPU. This power well must be turned on before we reset link
      to probe the codec, to avoid communication failure with the codec.
      The side effect is that this power is always ON in S0 because the BYT HDMI
      codec does not support EPSS or D3ClkStop and so the controller doesn't enter
      D3 at runtime, and the HDMI codec and analog codec share a single physical
      HD-A link and so we cannot reset the HD-A link freely when we re-enable the
      power to use the HDMI codec.
      Next step is to test if an AGP reset or double AGP reset on BYT HDMI codec is
      okay to bring the HDMI codec back to a functional state after restoring the
      power. If okay, we can bind the power on/off with the HDMI codec PM without
      interrupting the analog audio.
      Signed-off-by: default avatarMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  7. 20 Apr, 2015 2 commits
  8. 18 Apr, 2015 1 commit
    • Alexey Khoroshilov's avatar
      sound/oss: fix deadlock in sequencer_ioctl(SNDCTL_SEQ_OUTOFBAND) · bc26d4d0
      Alexey Khoroshilov authored
      A deadlock can be initiated by userspace via ioctl(SNDCTL_SEQ_OUTOFBAND)
      on /dev/sequencer with TMR_ECHO midi event.
      In this case the control flow is:
      -> case SND_DEV_SEQ:
         case SND_DEV_SEQ2:
           -> case SNDCTL_SEQ_OUTOFBAND:
                -> case EV_TIMING:
                     -> case TMR_ECHO:
                          -> spin_lock_irqsave(&lock,flags);
      It seems that spin_lock_irqsave() around play_event() is not necessary,
      because the only other call location in seq_startplay() makes the call
      without acquiring spinlock.
      So, the patch just removes spinlocks around play_event().
      By the way, it removes unreachable code in seq_timing_event(),
      since (seq_mode == SEQ_2) case is handled in the beginning.
      Compile tested only.
      Found by Linux Driver Verification project (linuxtesting.org).
      Signed-off-by: Alexey Khoroshilov's avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  9. 17 Apr, 2015 6 commits
  10. 16 Apr, 2015 3 commits
  11. 15 Apr, 2015 3 commits
  12. 14 Apr, 2015 1 commit
  13. 13 Apr, 2015 4 commits
    • Jo-Philipp Wich's avatar
      ALSA: hda/realtek - Enable the ALC292 dock fixup on the Thinkpad T450 · f2aa1110
      Jo-Philipp Wich authored
      The Lenovo Thinkpad T450 requires the ALC292_FIXUP_TPT440_DOCK as well in
      order to get working sound output on the docking stations headphone jack.
      Patch tested on a Thinkpad T450 (20BVCTO1WW) using kernel 4.0-rc7 in
      conjunction with a ThinkPad Ultradock.
      Signed-off-by: default avatarJo-Philipp Wich <jow@openwrt.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • Takashi Iwai's avatar
      ALSA: hda - Fix another race in runtime PM refcounting · c3aeda62
      Takashi Iwai authored
      Although some races in runtime PM refcount was fixed by the commit
      [664c7155: ALSA: hda - Work around races of power up/down with
      runtime PM], there is still a race in the following case:
      CPU0:                   CPU1 :
      runtime suspend:
        codec->in_pm = 1
                                pm_runtime_get_sync() skipped
      suspend finished:
        codec->in_pm = 0
                                pm_runtime_put_*() is called!
      For avoiding this situation, increment in_pm flag atomically when it's
      non-zero, and decrement accordingly, to ensure that in_pm is set
      consistently for the whole concurrent operations.
      Also, since atomic_inc_not_zero() and atomic_dec_if_positive() are
      lengthy inline functions, move snd_hdac_power_up_pm() and _down_pm()
      to sound/hda/hdac_device.c as no inline functions.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • Takashi Iwai's avatar
      ALSA: hda - Expose codec type sysfs · eacf6e0a
      Takashi Iwai authored
      The type field of HD-audio codec object should be exposed to
      user-space so that it can identify which driver type to bind (legacy /
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • 坂本 貴史's avatar
      ALSA: ctl: fix to handle several elements added by one operation for userspace element · e1c78df1
      坂本 貴史 authored
      An element instance can have several elements with the same feature.
      Some userspace applications can add such an element instance by add
      operation with the number of elements. Then, the element instance
      gets a memory object to keep states of these elements.
      But the element instance has just one memory object for the elements.
      This causes the same result to each read/write operations to the
      different elements.
      This commit fixes this bug by allocating enough memory objects to the
      element instance for each of elements.
      Signed-off-by: 坂本 貴史's avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  14. 12 Apr, 2015 2 commits