1. 06 12月, 2018 11 次提交
  2. 01 12月, 2018 1 次提交
    • T
      ALSA: oss: Use kvzalloc() for local buffer allocations · 27d6abfb
      Takashi Iwai 提交于
      commit 65766ee0bf7fe8b3be80e2e1c3ef54ad59b29476 upstream.
      
      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: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      27d6abfb
  3. 27 11月, 2018 2 次提交
  4. 14 11月, 2018 11 次提交
  5. 04 10月, 2018 1 次提交
  6. 20 9月, 2018 1 次提交
    • T
      ALSA: hda: Fix the audio-component completion timeout · b3a5402c
      Takashi Iwai 提交于
      The timeout of audio component binding was incorrectly specified in
      msec, not in jiffies, which results in way too shorter timeout than
      expected.
      
      Along with fixing it, add the information print about the binding
      failure to show the unexpected situation more clearly.
      
      Fixes: a57942bf ("ALSA: hda: Make audio component support more generic")
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b3a5402c
  7. 17 9月, 2018 4 次提交
  8. 13 9月, 2018 4 次提交
    • T
      ALSA: hda - Enable runtime PM only for discrete GPU · 37a3a98e
      Takashi Iwai 提交于
      The recent change of vga_switcheroo allowed the runtime PM for
      HD-audio on AMD GPUs, but this also resulted in a regression.  When
      the HD-audio controller driver gets runtime-suspended, HD-audio link
      is turned off, and the hotplug notification is ignored.  This leads to
      the inconsistent audio state (the connection isn't notified and ELD is
      ignored).
      
      The best fix would be to implement the proper ELD notification via the
      audio component, but it's still not ready.  As a quick workaround,
      this patch adds the check of runtime_idle and allows the runtime
      suspend only when the vga_switcheroo is bound with discrete GPU.
      That is, a system with a single GPU and APU would be again without
      runtime PM to keep the HD-audio link for the hotplug notification and
      ELD read out.
      
      Also, the codec->auto_runtime_pm flag is set only for the discrete GPU
      at the time GPU gets bound via vga_switcheroo (i.e. only dGPU is
      forcibly runtime-PM enabled), so that APU can still get the ELD
      notification.
      
      For identifying which GPU is bound, a new vga_switcheroo client
      callback, gpu_bound, is implemented.  The vga_switcheroo simply calls
      this when GPU is bound, and tells whether it's dGPU or APU.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200945
      Fixes: 07f4f97d ("vga_switcheroo: Use device link for HDA controller")
      Reported-by: NJian-Hong Pan <jian-hong@endlessm.com>
      Tested-by: NJian-Hong Pan <jian-hong@endlessm.com>
      Acked-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      37a3a98e
    • T
      ALSA: oxfw: fix memory leak of private data · 498fe23a
      Takashi Sakamoto 提交于
      Although private data of sound card instance is usually allocated in the
      tail of the instance, drivers in ALSA firewire stack allocate the private
      data before allocating the instance. In this case, the private data
      should be released explicitly at .private_free callback of the instance.
      
      This commit fixes memory leak following to the above design.
      
      Fixes: 6c29230e ('ALSA: oxfw: delayed registration of sound card')
      Cc: <stable@vger.kernel.org> # v4.7+
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      498fe23a
    • T
      ALSA: firewire-tascam: fix memory leak of private data · 8d28277c
      Takashi Sakamoto 提交于
      Although private data of sound card instance is usually allocated in the
      tail of the instance, drivers in ALSA firewire stack allocate the private
      data before allocating the instance. In this case, the private data
      should be released explicitly at .private_free callback of the instance.
      
      This commit fixes memory leak following to the above design.
      
      Fixes: b610386c ('ALSA: firewire-tascam: deleyed registration of sound card')
      Cc: <stable@vger.kernel.org> # v4.7+
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      8d28277c
    • T
      ALSA: firewire-digi00x: fix memory leak of private data · a49a83ab
      Takashi Sakamoto 提交于
      Although private data of sound card instance is usually allocated in the
      tail of the instance, drivers in ALSA firewire stack allocate the private
      data before allocating the instance. In this case, the private data
      should be released explicitly at .private_free callback of the instance.
      
      This commit fixes memory leak following to the above design.
      
      Fixes: 86c8dd7f ('ALSA: firewire-digi00x: delayed registration of sound card')
      Cc: <stable@vger.kernel.org> # v4.7+
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a49a83ab
  9. 12 9月, 2018 3 次提交
    • Y
      sound: don't call skl_init_chip() to reset intel skl soc · 75383f8d
      Yu Zhao 提交于
      Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which
      1) sets bus->chip_init to prevent multiple entrances before device
      is stopped; 2) enables interrupt.
      
      We shouldn't use it for the purpose of resetting device only because
      1) when we really want to initialize device, we won't be able to do
      so; 2) we are ready to handle interrupt yet, and kernel crashes when
      interrupt comes in.
      
      Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset
      device properly.
      
      Fixes: 60767abc ("ASoC: Intel: Skylake: Reset the controller in probe")
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NYu Zhao <yuzhao@google.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      75383f8d
    • Y
      sound: enable interrupt after dma buffer initialization · b61749a8
      Yu Zhao 提交于
      In snd_hdac_bus_init_chip(), we enable interrupt before
      snd_hdac_bus_init_cmd_io() initializing dma buffers. If irq has
      been acquired and irq handler uses the dma buffer, kernel may crash
      when interrupt comes in.
      
      Fix the problem by postponing enabling irq after dma buffer
      initialization. And warn once on null dma buffer pointer during the
      initialization.
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NYu Zhao <yuzhao@google.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      b61749a8
    • Y
      Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation" · 542cedec
      Yu Zhao 提交于
      This reverts commit 12eeeb4f.
      
      The patch doesn't fix accessing memory with null pointer in
      skl_interrupt().
      
      There are two problems: 1) skl_init_chip() is called twice, before
      and after dma buffer is allocate. The first call sets bus->chip_init
      which prevents the second from initializing bus->corb.buf and
      rirb.buf from bus->rb.area. 2) snd_hdac_bus_init_chip() enables
      interrupt before snd_hdac_bus_init_cmd_io() initializing dma buffers.
      There is a small window which skl_interrupt() can be called if irq
      has been acquired. If so, it crashes when using null dma buffer
      pointers.
      
      Will fix the problems in the following patches. Also attaching the
      crash for future reference.
      
      [   16.949148] general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI
      <snipped>
      [   16.950903] Call Trace:
      [   16.950906]  <IRQ>
      [   16.950918]  skl_interrupt+0x19e/0x2d6 [snd_soc_skl]
      [   16.950926]  ? dma_supported+0xb5/0xb5 [snd_soc_skl]
      [   16.950933]  __handle_irq_event_percpu+0x27a/0x6c8
      [   16.950937]  ? __irq_wake_thread+0x1d1/0x1d1
      [   16.950942]  ? __do_softirq+0x57a/0x69e
      [   16.950944]  handle_irq_event_percpu+0x95/0x1ba
      [   16.950948]  ? _raw_spin_unlock+0x65/0xdc
      [   16.950951]  ? __handle_irq_event_percpu+0x6c8/0x6c8
      [   16.950953]  ? _raw_spin_unlock+0x65/0xdc
      [   16.950957]  ? time_cpufreq_notifier+0x483/0x483
      [   16.950959]  handle_irq_event+0x89/0x123
      [   16.950962]  handle_fasteoi_irq+0x16f/0x425
      [   16.950965]  handle_irq+0x1fe/0x28e
      [   16.950969]  do_IRQ+0x6e/0x12e
      [   16.950972]  common_interrupt+0x7a/0x7a
      [   16.950974]  </IRQ>
      <snipped>
      [   16.951031] RIP: snd_hdac_bus_update_rirb+0x19b/0x4cf [snd_hda_core] RSP: ffff88015c807c08
      [   16.951036] ---[ end trace 58bf9ece1775bc92 ]---
      
      Fixes: 2eeeb4f4733b ("ASoC: Intel: Skylake: Acquire irq after RIRB allocation")
      Signed-off-by: NYu Zhao <yuzhao@google.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      542cedec
  10. 10 9月, 2018 2 次提交