1. 15 Apr, 2019 1 commit
    • Roope Salmi's avatar
      ALSA: usb-audio: Add quirk for Focusrite Scarlett Solo · 46f5710f
      Roope Salmi authored
      The device reports Synch: Synchronous on the playback interface.
      This causes regular audible napping on sample rates that are not multiples
      of 1 kHz. Fix to Synch: Asynchronous.
      
      Specifically observed on Focusrite Scarlett Solo 2nd generation. I assume
      the first generation model has a different device ID. A first generation
      Scarlett 2i2 I was able to test advertised Synch: Asynchronous by default.
      
      For example, with a sample rate of 44100 Hz, a silent sample is played
      every 40.96 seconds (likely 44.0 samples instead of 44.1 transmitted per
      USB frame on average, 4096 being the size of some internal buffer).
      There may be some other bug at play here since this doesn't happen
      on other platforms. However, a feedback endpoint is listed and using it
      fixes the issue. That is the only change in the quirk,
      but I didn't find a way to declare only it.
      
      Tested on two units and on two different computers.
      Signed-off-by: default avatarRoope Salmi <rpsalmi@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      46f5710f
  2. 13 Apr, 2019 3 commits
  3. 12 Apr, 2019 3 commits
    • Takashi Iwai's avatar
      ALSA: seq: Protect racy pool manipulation from OSS sequencer · 6b580f52
      Takashi Iwai authored
      OSS sequencer emulation still allows to queue and issue the events
      that manipulate the client pool concurrently in a racy way.  This
      patch serializes the access like the normal sequencer write / ioctl
      via taking the client ioctl_mutex.  Since the access to the sequencer
      client is done indirectly via a client id number, a new helper to
      take/release the mutex is introduced.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6b580f52
    • Takashi Iwai's avatar
      ALSA: seq: Simplify snd_seq_kernel_client_enqueue() helper · 6740ea67
      Takashi Iwai authored
      We have two helpers for queuing a sequencer event from the kernel
      client, and both are used only from OSS sequencer layer without any
      hop and atomic set.  Let's simplify and unify two helpers into one.
      
      No functional change, just a call pattern change.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6740ea67
    • Takashi Iwai's avatar
      ALSA: seq: Cover unsubscribe_port() in list_mutex · 7c32ae35
      Takashi Iwai authored
      The call of unsubscribe_port() which manages the group count and
      module refcount from delete_and_unsubscribe_port() looks racy; it's
      not covered by the group list lock, and it's likely a cause of the
      reported unbalance at port deletion.  Let's move the call inside the
      group list_mutex to plug the hole.
      
      Reported-by: syzbot+e4c8abb920efa77bace9@syzkaller.appspotmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7c32ae35
  4. 11 Apr, 2019 2 commits
    • Takashi Iwai's avatar
      Revert "ALSA: seq: Protect in-kernel ioctl calls with mutex" · f0654ba9
      Takashi Iwai authored
      This reverts commit feb68902.
      
      The fix attempt was incorrect, leading to the mutex deadlock through
      the close of OSS sequencer client.  The proper fix needs more
      consideration, so let's revert it now.
      
      Fixes: feb68902 ("ALSA: seq: Protect in-kernel ioctl calls with mutex")
      Reported-by: syzbot+47ded6c0f23016cde310@syzkaller.appspotmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f0654ba9
    • Takashi Iwai's avatar
      Merge tag 'asoc-fix-v5.1-rc4' of... · 9b0dcd0e
      Takashi Iwai authored
      Merge tag 'asoc-fix-v5.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Fixes for v5.1
      
      A few core fixes along with the driver specific ones, mainly fixing
      small issues that only affect x86 platforms for various reasons (their
      unusual machine enumeration mechanisms mainly, plus a fix for error
      handling in topology).
      
      There's some of the driver fixes that look larger than they are, like
      the hdmi-codec changes which resulted in an indentation change, and most
      of the other large changes are for new drivers like the STM32 changes.
      9b0dcd0e
  5. 10 Apr, 2019 7 commits
  6. 09 Apr, 2019 6 commits
    • Takashi Iwai's avatar
      ALSA: seq: Fix race of get-subscription call vs port-delete ioctls · 2eabc5ec
      Takashi Iwai authored
      The snd_seq_ioctl_get_subscription() retrieves the port subscriber
      information as a pointer, while the object isn't protected, hence it
      may be deleted before the actual reference.  This race was spotted by
      syzkaller and may lead to a UAF.
      
      The fix is simply copying the data in the lookup function that
      performs in the rwsem to protect against the deletion.
      
      Reported-by: syzbot+9437020c82413d00222d@syzkaller.appspotmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2eabc5ec
    • Takashi Iwai's avatar
      ALSA: seq: Protect in-kernel ioctl calls with mutex · feb68902
      Takashi Iwai authored
      ALSA OSS sequencer calls the ioctl function indirectly via
      snd_seq_kernel_client_ctl().  While we already applied the protection
      against races between the normal ioctls and writes via the client's
      ioctl_mutex, this code path was left untouched.  And this seems to be
      the cause of still remaining some rare UAF as spontaneously triggered
      by syzkaller.
      
      For the sake of robustness, wrap the ioctl_mutex also for the call via
      snd_seq_kernel_client_ctl(), too.
      
      Reported-by: syzbot+e4c8abb920efa77bace9@syzkaller.appspotmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      feb68902
    • Takashi Iwai's avatar
      ALSA: seq: Remove superfluous irqsave flags · f823b8a7
      Takashi Iwai authored
      spin_lock_irqsave() is used unnecessarily in various places in
      sequencer core code although it's pretty obvious that the context is
      sleepable.  Remove irqsave and use the plain spin_lock_irq() in such
      places for simplicity.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f823b8a7
    • Takashi Iwai's avatar
      ALSA: seq: Align temporary re-locking with irqsave version · 4b24b960
      Takashi Iwai authored
      In a few places in sequencer core, we temporarily unlock / re-lock the
      pool spin lock while waiting for the allocation in the blocking mode.
      There spin_unlock_irq() / spin_lock_irq() pairs are called while
      initially spin_lock_irqsave() is used (and spin_lock_irqrestore() at
      the end of the function again).  This is likely OK for now, but it's a
      bit confusing and error-prone.
      
      This patch replaces these temporary relocking lines with the irqsave
      variant to make the lock/unlock sequence more consistently.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4b24b960
    • Takashi Iwai's avatar
      ALSA: seq: Use kvmalloc() for cell pools · fd7ae83d
      Takashi Iwai authored
      Use kvmalloc() for allocating cell pools since the pool size can be
      relatively small that may be covered better by slab.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      fd7ae83d
    • Takashi Iwai's avatar
      ALSA: timer: Revert active callback sync check at close · df55531b
      Takashi Iwai authored
      This is essentially a revert of the commit a7588c89 ("ALSA: timer:
      Check ack_list emptiness instead of bit flag").  The intended change
      by the commit turns out to be insufficient, as snd_timer_close*()
      always calls snd_timer_stop() that deletes the ack_list beforehand.
      
      In theory, we can change the behavior of snd_timer_stop() to sync the
      pending ack_list, but this will become a deadlock for the callback
      like sequencer that calls again snd_timer_stop() from itself.  So,
      reverting the change is a more straightforward solution.
      
      Fixes: a7588c89 ("ALSA: timer: Check ack_list emptiness instead of bit flag")
      Reported-by: syzbot+58813d77154713f4de15@syzkaller.appspotmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      df55531b
  7. 08 Apr, 2019 5 commits
  8. 05 Apr, 2019 3 commits
  9. 04 Apr, 2019 6 commits
  10. 03 Apr, 2019 4 commits
    • Christina Quast's avatar
      ALSA: doc: my_chip has no element ioport · 4b81dad1
      Christina Quast authored
      chip->ioport is dereferenced in two places, but the struct is
      defined as follows:
      
      struct mychip {
      	struct snd_card *card;
      	struct pci_dev *pci;
      
      	unsigned long port;
      	int irq;
      };
      Signed-off-by: default avatarChristina Quast <cquast@hanoverdisplays.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4b81dad1
    • Richard Sailer's avatar
      ALSA: hda/realtek - Add quirk for Tuxedo XC 1509 · 80690a27
      Richard Sailer authored
      This adds a SND_PCI_QUIRK(...) line for the Tuxedo XC 1509.
      
      The Tuxedo XC 1509 and the System76 oryp5 are the same barebone
      notebooks manufactured by Clevo. To name the fixups both use after the
      actual underlying hardware, this patch also changes System76_orpy5
      to clevo_pb51ed in 2 enum symbols and one function name,
      matching the other pci_quirk entries which are also named after the
      device ODM.
      
      Fixes: 7f665b1c ("ALSA: hda/realtek - Headset microphone and internal speaker support for System76 oryp5")
      Signed-off-by: default avatarRichard Sailer <rs@tuxedocomputers.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      80690a27
    • Kailang Yang's avatar
      ALSA: hda/realtek - Move to ACT_INIT state · 8983eb60
      Kailang Yang authored
      It will be lose Mic JD state when Chrome OS boot and headset was plugged.
      Just Implement of reset combo jack JD verb for ACT_PRE_PROBE state.
      Intel test result was also failed.
      It test passed until changed the initial state to ACT_INIT.
      Mic JD will show every time.
      This patch also changed the model name as 'alc-chrome-book' for
      application of Chrome OS.
      
      Fixes: 10f5b1b8 ("ALSA: hda/realtek - Fixed Headset Mic JD not stable")
      Signed-off-by: default avatarKailang Yang <kailang@realtek.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      8983eb60
    • Hans de Goede's avatar
      ASoC: Intel: cht_bsw_max98090_ti: Enable codec clock once and keep it enabled · 4bcdec39
      Hans de Goede authored
      Users have been seeing sound stability issues with max98090 codecs since:
      commit 648e9218 ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
      
      At first that commit broke sound for Chromebook Swanky and Clapper models,
      the problem was that the machine-driver has been controlling the wrong
      clock on those models since support for them was added. This was hidden by
      clk-pmc-atom.c keeping the actual clk on unconditionally.
      
      With the machine-driver controlling the proper clock, sound works again
      but we are seeing bug reports describing it as: low volume,
      "sounds like played at 10x speed" and instable.
      
      When these issues are hit the following message is seen in dmesg:
      "max98090 i2c-193C9890:00: PLL unlocked".
      
      Attempts have been made to fix this by inserting a delay between enabling
      the clk and enabling and checking the pll, but this has not helped.
      
      It seems that at least on boards which use pmc_plt_clk_0 as clock,
      if we ever disable the clk, the pll looses its lock and after that we get
      various issues.
      
      This commit fixes this by enabling the clock once at probe time on
      these boards. In essence this restores the old behavior of clk-pmc-atom.c
      always keeping the clk on on these boards.
      
      Fixes: 648e9218 ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
      Reported-by: default avatarMogens Jensen <mogens-jensen@protonmail.com>
      Reported-by: default avatarDean Wallace <duffydack73@gmail.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      4bcdec39