1. 03 7月, 2017 2 次提交
  2. 30 6月, 2017 6 次提交
  3. 29 6月, 2017 5 次提交
  4. 28 6月, 2017 2 次提交
    • T
      ALSA: hda - Fix endless loop of codec configure · d94815f9
      Takashi Iwai 提交于
      azx_codec_configure() loops over the codecs found on the given
      controller via a linked list.  The code used to work in the past, but
      in the current version, this may lead to an endless loop when a codec
      binding returns an error.
      
      The culprit is that the snd_hda_codec_configure() unregisters the
      device upon error, and this eventually deletes the given codec object
      from the bus.  Since the list is initialized via list_del_init(), the
      next object points to the same device itself.  This behavior change
      was introduced at splitting the HD-audio code code, and forgotten to
      adapt it here.
      
      For fixing this bug, just use a *_safe() version of list iteration.
      
      Fixes: d068ebc2 ("ALSA: hda - Move some codes up to hdac_bus struct")
      Reported-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d94815f9
    • H
      ALSA: hda - set input_path bitmap to zero after moving it to new place · a8f20fd2
      Hui Wang 提交于
      Recently we met a problem, the codec has valid adcs and input pins,
      and they can form valid input paths, but the driver does not build
      valid controls for them like "Mic boost", "Capture Volume" and
      "Capture Switch".
      
      Through debugging, I found the driver needs to shrink the invalid
      adcs and input paths for this machine, so it will move the whole
      column bitmap value to the previous column, after moving it, the
      driver forgets to set the original column bitmap value to zero, as a
      result, the driver will invalidate the path whose index value is the
      original colume bitmap value. After executing this function, all
      valid input paths are invalidated by a mistake, there are no any
      valid input paths, so the driver won't build controls for them.
      
      Fixes: 3a65bcdc ("ALSA: hda - Fix inconsistent input_paths after ADC reduction")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NHui Wang <hui.wang@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a8f20fd2
  5. 20 6月, 2017 3 次提交
  6. 19 6月, 2017 6 次提交
    • T
      ALSA: firewire-lib: Fix stall of process context at packet error · 4a9bfafc
      Takashi Sakamoto 提交于
      At Linux v3.5, packet processing can be done in process context of ALSA
      PCM application as well as software IRQ context for OHCI 1394. Below is
      an example of the callgraph (some calls are omitted).
      
      ioctl(2) with e.g. HWSYNC
      (sound/core/pcm_native.c)
      ->snd_pcm_common_ioctl1()
        ->snd_pcm_hwsync()
          ->snd_pcm_stream_lock_irq
          (sound/core/pcm_lib.c)
          ->snd_pcm_update_hw_ptr()
            ->snd_pcm_udpate_hw_ptr0()
              ->struct snd_pcm_ops.pointer()
              (sound/firewire/*)
              = Each handler on drivers in ALSA firewire stack
                (sound/firewire/amdtp-stream.c)
                ->amdtp_stream_pcm_pointer()
                  (drivers/firewire/core-iso.c)
                  ->fw_iso_context_flush_completions()
                    ->struct fw_card_driver.flush_iso_completion()
                    (drivers/firewire/ohci.c)
                    = flush_iso_completions()
                      ->struct fw_iso_context.callback.sc
                      (sound/firewire/amdtp-stream.c)
                      = in_stream_callback() or out_stream_callback()
                        ->...
          ->snd_pcm_stream_unlock_irq
      
      When packet queueing error occurs or detecting invalid packets in
      'in_stream_callback()' or 'out_stream_callback()', 'snd_pcm_stop_xrun()'
      is called on local CPU with disabled IRQ.
      
      (sound/firewire/amdtp-stream.c)
      in_stream_callback() or out_stream_callback()
      ->amdtp_stream_pcm_abort()
        ->snd_pcm_stop_xrun()
          ->snd_pcm_stream_lock_irqsave()
          ->snd_pcm_stop()
          ->snd_pcm_stream_unlock_irqrestore()
      
      The process is stalled on the CPU due to attempt to acquire recursive lock.
      
      [  562.630853] INFO: rcu_sched detected stalls on CPUs/tasks:
      [  562.630861]      2-...: (1 GPs behind) idle=37d/140000000000000/0 softirq=38323/38323 fqs=7140
      [  562.630862]      (detected by 3, t=15002 jiffies, g=21036, c=21035, q=5933)
      [  562.630866] Task dump for CPU 2:
      [  562.630867] alsa-source-OXF R  running task        0  6619      1 0x00000008
      [  562.630870] Call Trace:
      [  562.630876]  ? vt_console_print+0x79/0x3e0
      [  562.630880]  ? msg_print_text+0x9d/0x100
      [  562.630883]  ? up+0x32/0x50
      [  562.630885]  ? irq_work_queue+0x8d/0xa0
      [  562.630886]  ? console_unlock+0x2b6/0x4b0
      [  562.630888]  ? vprintk_emit+0x312/0x4a0
      [  562.630892]  ? dev_vprintk_emit+0xbf/0x230
      [  562.630895]  ? do_sys_poll+0x37a/0x550
      [  562.630897]  ? dev_printk_emit+0x4e/0x70
      [  562.630900]  ? __dev_printk+0x3c/0x80
      [  562.630903]  ? _raw_spin_lock+0x20/0x30
      [  562.630909]  ? snd_pcm_stream_lock+0x31/0x50 [snd_pcm]
      [  562.630914]  ? _snd_pcm_stream_lock_irqsave+0x2e/0x40 [snd_pcm]
      [  562.630918]  ? snd_pcm_stop_xrun+0x16/0x70 [snd_pcm]
      [  562.630922]  ? in_stream_callback+0x3e6/0x450 [snd_firewire_lib]
      [  562.630925]  ? handle_ir_packet_per_buffer+0x8e/0x1a0 [firewire_ohci]
      [  562.630928]  ? ohci_flush_iso_completions+0xa3/0x130 [firewire_ohci]
      [  562.630932]  ? fw_iso_context_flush_completions+0x15/0x20 [firewire_core]
      [  562.630935]  ? amdtp_stream_pcm_pointer+0x2d/0x40 [snd_firewire_lib]
      [  562.630938]  ? pcm_capture_pointer+0x19/0x20 [snd_oxfw]
      [  562.630943]  ? snd_pcm_update_hw_ptr0+0x47/0x3d0 [snd_pcm]
      [  562.630945]  ? poll_select_copy_remaining+0x150/0x150
      [  562.630947]  ? poll_select_copy_remaining+0x150/0x150
      [  562.630952]  ? snd_pcm_update_hw_ptr+0x10/0x20 [snd_pcm]
      [  562.630956]  ? snd_pcm_hwsync+0x45/0xb0 [snd_pcm]
      [  562.630960]  ? snd_pcm_common_ioctl1+0x1ff/0xc90 [snd_pcm]
      [  562.630962]  ? futex_wake+0x90/0x170
      [  562.630966]  ? snd_pcm_capture_ioctl1+0x136/0x260 [snd_pcm]
      [  562.630970]  ? snd_pcm_capture_ioctl+0x27/0x40 [snd_pcm]
      [  562.630972]  ? do_vfs_ioctl+0xa3/0x610
      [  562.630974]  ? vfs_read+0x11b/0x130
      [  562.630976]  ? SyS_ioctl+0x79/0x90
      [  562.630978]  ? entry_SYSCALL_64_fastpath+0x1e/0xad
      
      This commit fixes the above bug. This assumes two cases:
      1. Any error is detected in software IRQ context of OHCI 1394 context.
      In this case, PCM substream should be aborted in packet handler. On the
      other hand, it should not be done in any process context. TO distinguish
      these two context, use 'in_interrupt()' macro.
      2. Any error is detect in process context of ALSA PCM application.
      In this case, PCM substream should not be aborted in packet handler
      because PCM substream lock is acquired. The task to abort PCM substream
      should be done in ALSA PCM core. For this purpose, SNDRV_PCM_POS_XRUN is
      returned at 'struct snd_pcm_ops.pointer()'.
      Suggested-by: NClemens Ladisch <clemens@ladisch.de>
      Fixes: e9148ddd("ALSA: firewire-lib: flush completed packets when reading PCM position")
      Cc: <stable@vger.kernel.org> # 4.9+
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4a9bfafc
    • A
      ASoC: Intel: bxt: Move codec sysclk config to codec_init function · fd0f2375
      Adam Thomson 提交于
      The MCLK for DA7219 does not change in this platform, but is
      currently being configured everytime as part of the platform_clock
      event handler for DAPM. The upshot of this is that we have
      unnecessary calls to this function, and it also means that if
      a stream hasn't yet been started, DA7219 driver does not have the
      correct MCLK rates programmed and so the HP detection feature does
      not operate as expected.
      
      This patch rectifies this issue by moving the sysclk call to
      codec_init function so it's only called once at initialisation.
      Signed-off-by: NAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
      Acked-by: NSathyanarayana Nujella <sathyanarayana.nujella@intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      fd0f2375
    • A
      ASoC: da7219: Fix HP detection procedure for all MCLK frequencies · 2a0c2189
      Adam Thomson 提交于
      Currently when HP detection procedure runs for certain MCLK
      frequencies, when PLL is bypassed, the procedure will incorrectly
      report Lineout instead of Headphones due to timing incosistencies.
      To avoid this problem, the PLL is temporarily enabled (if currently
      bypassed and MCLK present) to provide consistent timings for the
      procedure, regardless of MCLK frequency.
      Signed-off-by: NAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
      Acked-by: NSathyanarayana Nujella <sathyanarayana.nujella@intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      2a0c2189
    • S
      ASoC: skl_rt286: Add deepbuffer dai link · 1f0f8bde
      Subhransu S. Prusty 提交于
      This patch adds the deepbuffer device which can be opened with a bigger
      buffer size. The application can disable interrupts and sleep for longer
      duration.
      Signed-off-by: NSubhransu S. Prusty <subhransu.s.prusty@intel.com>
      Acked-By: NVinod Koul <vinod.koul@intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      1f0f8bde
    • R
      ASoC: Intel: Skylake: Fix dma buffer size calculation · f6e6ab1d
      Ramesh Babu 提交于
      DMA buffer size for gateway copier will be calculated based on:
      
      For host DMA copier:
      Input buffer size (ibs) for output direction (playback)
      Output buffer size (obs) for input direction (capture)
      
      For link DMA copier:
      IBS for input direction (capture)
      OBS for output direction (playback)
      
      Update the driver to use the above.
      Signed-off-by: NRamesh Babu <ramesh.babu@intel.com>
      Signed-off-by: NSubhransu S. Prusty <subhransu.s.prusty@intel.com>
      Acked-By: NVinod Koul <vinod.koul@intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      f6e6ab1d
    • R
      ASoC: Intel: Skylake: Add deep buffer support · 939df3ad
      Ramesh Babu 提交于
      With this patch, the dma buffer size is fetched from topology binary. This
      buffer size is applicable for gateway copier modules.
      
      Now that we can configure DSP dma buffer size, the device can support deep
      buffer playback. DSP fetches large buffer and can result fewer wakes,
      which helps in power reduction.
      Signed-off-by: NRamesh Babu <ramesh.babu@intel.com>
      Signed-off-by: NSubhransu S. Prusty <subhransu.s.prusty@intel.com>
      Acked-By: NVinod Koul <vinod.koul@intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      939df3ad
  7. 17 6月, 2017 3 次提交
  8. 16 6月, 2017 1 次提交
  9. 15 6月, 2017 3 次提交
  10. 14 6月, 2017 9 次提交