1. 25 7月, 2019 1 次提交
    • T
      ALSA: hda - Fix intermittent CORB/RIRB stall on Intel chips · 2756d914
      Takashi Iwai 提交于
      It turned out that the recent Intel HD-audio controller chips show a
      significant stall during the system PM resume intermittently.  It
      doesn't happen so often and usually it may read back successfully
      after one or more seconds, but in some rare worst cases the driver
      went into fallback mode.
      
      After trial-and-error, we found out that the communication stall seems
      covered by issuing the sync after each verb write, as already done for
      AMD and other chipsets.  So this patch enables the write-sync flag for
      the recent Intel chips, Skylake and onward, as a workaround.
      
      Also, since Broxton and co have the very same driver flags as Skylake,
      refer to the Skylake driver flags instead of defining the same
      contents again for simplification.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=201901Reported-and-tested-by: NTodd Brandt <todd.e.brandt@linux.intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2756d914
  2. 25 6月, 2019 1 次提交
  3. 13 6月, 2019 1 次提交
  4. 31 5月, 2019 1 次提交
  5. 28 5月, 2019 3 次提交
  6. 08 5月, 2019 1 次提交
  7. 30 4月, 2019 1 次提交
    • T
      ALSA: hda - Register irq handler after the chip initialization · f495222e
      Takashi Iwai 提交于
      Currently the IRQ handler in HD-audio controller driver is registered
      before the chip initialization.  That is, we have some window opened
      between the azx_acquire_irq() call and the CORB/RIRB setup.  If an
      interrupt is triggered in this small window, the IRQ handler may
      access to the uninitialized RIRB buffer, which leads to a NULL
      dereference Oops.
      
      This is usually no big problem since most of Intel chips do register
      the IRQ via MSI, and we've already fixed the order of the IRQ
      enablement and the CORB/RIRB setup in the former commit b61749a8
      ("sound: enable interrupt after dma buffer initialization"), hence the
      IRQ won't be triggered in that room.  However, some platforms use a
      shared IRQ, and this may allow the IRQ trigger by another source.
      
      Another possibility is the kdump environment: a stale interrupt might
      be present in there, the IRQ handler can be falsely triggered as well.
      
      For covering this small race, let's move the azx_acquire_irq() call
      after hda_intel_init_chip() call.  Although this is a bit radical
      change, it can cover more widely than checking the CORB/RIRB setup
      locally in the callee side.
      Reported-by: NLiwei Song <liwei.song@windriver.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f495222e
  8. 08 4月, 2019 1 次提交
  9. 19 3月, 2019 1 次提交
    • H
      ALSA: hda - Don't trigger jackpoll_work in azx_resume · 744c67ff
      Hui Wang 提交于
      The commit 3baffc4a (ALSA: hda/intel: Refactoring PM code) changed
      the behaviour of azx_resume(), it triggers the jackpoll_work after
      applying this commit.
      
      This change introduced a new issue, all codecs are runtime active
      after S3, and will not call runtime_suspend() automatically.
      
      The root cause is the jackpoll_work calls snd_hda_power_up/down_pm,
      and it calls up_pm before snd_hdac_enter_pm is called, while calls
      the down_pm in the middle of enter_pm and leave_pm is called. This
      makes the dev->power.usage_count unbalanced after S3.
      
      To fix it, let azx_resume() don't trigger jackpoll_work as before
      it did.
      
      Fixes: 3baffc4a ("ALSA: hda/intel: Refactoring PM code")
      Signed-off-by: NHui Wang <hui.wang@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      744c67ff
  10. 18 3月, 2019 1 次提交
  11. 01 2月, 2019 1 次提交
    • T
      ALSA: hda - Serialize codec registrations · 305a0ade
      Takashi Iwai 提交于
      In the current code, the codec registration may happen both at the
      codec bind time and the end of the controller probe time.  In a rare
      occasion, they race with each other, leading to Oops due to the still
      uninitialized card device.
      
      This patch introduces a simple flag to prevent the codec registration
      at the codec bind time as long as the controller probe is going on.
      The controller probe invokes snd_card_register() that does the whole
      registration task, and we don't need to register each piece
      beforehand.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      305a0ade
  12. 02 1月, 2019 1 次提交
    • T
      ALSA: hda - Revert DSP detection on legacy HD-audio driver · 3e9ad24b
      Takashi Iwai 提交于
      This essentially reverts the commits
        c337104b ("ALSA: HD-Audio: SKL+: abort probe if DSP is present
        and Skylake driver selected")
      and
        d82b51c8 ("ALSA: HD-Audio: SKL+: force HDaudio legacy or SKL+
        driver selection")
      for the path of legacy HD-audio controller (snd-hda-intel).
      
      The automatic DSP detection and skip of binding with the legacy driver
      caused regressions on several machines like Dell XPS13.  They give the
      PCI class 0x40380 indicating the availability of DSP while they don't
      work with ASoC SKL driver (yet).
      
      As the support of ASoC driver for such devices isn't available, it's
      better to revert the whole DSP-detection-and-skip behavior of the
      legacy driver, so that we can get the old good driver working on such
      devices.
      
      The pci_binding option for ASoC SKL driver is still kept so that it
      can work without blacklisting.
      
      Fixes: c337104b ("ALSA: HD-Audio: SKL+: abort probe if DSP is present and Skylake driver selected")
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Reported-by: NHans de Goede <hdegoede@redhat.com>
      Reported-by: NAzat Khuzhin <dohardgopro@gmail.com>
      Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3e9ad24b
  13. 20 12月, 2018 2 次提交
    • P
      ALSA: HD-Audio: SKL+: force HDaudio legacy or SKL+ driver selection · d82b51c8
      Pierre-Louis Bossart 提交于
      For HDaudio and Skylake drivers, add module parameter "pci_binding"
      
      When pci_binding == 0 (AUTO), the PCI class/subclass info is used to
      select drivers based on the presence of the DSP.
      
      pci_binding == 1 (LEGACY) forces the use of the HDAudio legacy driver,
      even if the DSP is present.
      
      pci_binding == 2 (ASOC) forces the use of the ASOC driver. The
      information on the DSP presence is bypassed.
      
      The value for the module parameter needs to be identical for both
      drivers. This parameter is intended as a back-up solution if the
      automatic detection fails or when the DSP usage fails. Such cases
      should be reported on the alsa-devel mailing list for analysis.
      Signed-off-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d82b51c8
    • P
      ALSA: HD-Audio: SKL+: abort probe if DSP is present and Skylake driver selected · c337104b
      Pierre-Louis Bossart 提交于
      Now that the SST/Skylake driver supports per platform selectors, we
      can add logic to automatically select the right driver.
      
      If the Skylake driver is selected for a specific platform, and the DSP
      is detected at run-time based on the PCI class/subclass/prog-if
      information, the legacy HDaudio driver aborts the probe. This will
      result in a single driver probing and remove the need for modprobe
      blacklists.
      
      Follow-up patches will add a module parameter to bypass the logic if
      this automatic detection fails, or if the Skylake driver is unable to
      actually support the platform (firmware authentication, missing
      topology file, hardware issue, etc).
      
      The same mechanism will be used to conflicts generated by the same PCI
      ID being registered by both legacy HDAuudio and SOF drivers for Intel
      platforms. In other words SOF will not require changes to the HDaudio
      legacy.
      Signed-off-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c337104b
  14. 11 12月, 2018 4 次提交
    • T
      ALSA: hda: Make snd_hdac_display_power() void function · 4f799e73
      Takashi Iwai 提交于
      After the recent refactoring, snd_hdac_display_power() doesn't return
      any error, hence it can be defined to return void.
      This makes many error checks redundant and allows us to reduce them
      gracefully.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4f799e73
    • T
      ALSA: hda/intel: Properly free the display power at error path · 457f3c86
      Takashi Iwai 提交于
      When an error occurs in azx_probe_continue(), we should release the
      display power.  However, the current code ignores it and releases the
      display power only for HSW/BDW cases.  Fix it.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      457f3c86
    • T
      ALSA: hda/intel: Drop superfluous AZX_DCAPS_I915_POWERWELL checks · e454ff8e
      Takashi Iwai 提交于
      snd_hdac_display_power() can be called even for a HDA controller
      without DRM binding.  The same is true for other helpers,
      snd_hdac_i915_set_bclk() and snd_hdac_set_codec_wakeup().
      So all superfluous AZX_DCAPS_I915_POWERWELL  checks in hda_intel.c can
      be dropped, and the definition of AZX_DCAPS_I915_POWERWELL itself can
      be removed as well.  This simplifies the code a lot.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e454ff8e
    • T
      ALSA: hda: Refactor display power management · 029d92c2
      Takashi Iwai 提交于
      The current HD-audio code manages the DRM audio power via too complex
      redirections, and this seems even still unbalanced in a corner case as
      Intel DRM CI has been intermittently reporting.  This patch is a big
      surgery for addressing the complexity and the possible unbalance.
      
      Basically the patch changes the display PM in the following ways:
      
      - Both HD-audio controller and codec drivers call a single helper,
        snd_hdac_display_power().  (Formerly, the display power control from
        a codec was done indirectly via link_power bus ops.)
      
      - snd_hdac_display_power() receives the codec address index.  For
        turning on/off from the controller, pass HDA_CODEC_IDX_CONTROLLER.
      
      - snd_hdac_display_power() doesn't manage refcounts any longer, but
        keeps the power status in bitmap.  If any of controller or codecs is
        turned on, the function updates the DRM power state via get_power()
        or put_power().
      
      Also this refactor allows us more cleanup:
      
      - The link_power bus ops is dropped, so there is no longer indirect
        management, as mentioned in the above.
      
      - hdac_device link_power_control flag is moved to hda_codec
        display_power_control flag, as it's only for HDA legacy.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106525Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      029d92c2
  15. 09 12月, 2018 1 次提交
    • T
      ALSA: hda/intel: Refactoring PM code · 3baffc4a
      Takashi Iwai 提交于
      Make unified suspend / resume helpers and call them from both the
      runtime- and the system-PM callbacks for simplifying code.
      
      There are slight changes of call orders, but there shouldn't be any
      functional difference after refactoring.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3baffc4a
  16. 29 11月, 2018 1 次提交
  17. 24 11月, 2018 1 次提交
  18. 16 10月, 2018 1 次提交
  19. 13 9月, 2018 1 次提交
    • 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
  20. 30 8月, 2018 2 次提交
  21. 29 8月, 2018 1 次提交
  22. 28 8月, 2018 3 次提交
    • T
      ALSA: hda: Remove substream allocation/free ops · 193c7e14
      Takashi Iwai 提交于
      Since we dropped the memory page fiddling in the own allocators in
      hda_intel.c, the substream allocation and free ops in both hda_intel.c
      and hda_tegra.c became nothing but the simple calls of the standard
      snd_pcm_lib helpers.  As both are identical, there is no longer need
      for indirect calls via ops; it's a good opportunity for removing ops
      and simplifying the codes.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      193c7e14
    • T
      ALSA: hda: Use new non-cached allocation for non-snoop mode · fc478143
      Takashi Iwai 提交于
      Now the ALSA memory allocator helper supports the new non-cached
      pages, let's use the new type, SNDRV_DMA_TYPE_DEV_UC_SG, for HD-audio
      driver.  This allows us to reduce lots of codes.
      
      As another positive side-effect by this patch, the long-standing issue
      with non-snoop mode playing in the non-mmap mode is fixed.  The core
      memalloc helper does the proper pgprot setup for non-cached pages for
      vmap(), which was missing in the past.
      Reported-and-tested-by: NHans Hu <HansHu@zhaoxin.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      fc478143
    • T
      ALSA: hda: Check the non-cached stream buffers more explicitly · 78c9be61
      Takashi Iwai 提交于
      Introduce a new flag, uc_buffer, to indicate that the controller
      requires the non-cached pages for stream buffers, either as a
      chip-specific requirement or specified via snoop=0 option.
      This improves the code-readability.
      
      Also, this patch fixes the incorrect behavior for C-Media chip where
      the stream buffers were never handled as non-cached due to the check
      of driver_type even if you pass snoop=0 option.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      78c9be61
  23. 02 8月, 2018 1 次提交
  24. 17 7月, 2018 1 次提交
    • J
      vga_switcheroo: set audio client id according to bound GPU id · 4aaf448f
      Jim Qu 提交于
      On modern laptop, there are more and more platforms
      have two GPUs, and each of them maybe have audio codec
      for HDMP/DP output. For some dGPU which is no output,
      audio codec usually is disabled.
      
      In currect HDA audio driver, it will set all codec as
      VGA_SWITCHEROO_DIS, the audio which is binded to UMA
      will be suspended if user use debugfs to contorl power
      
      In HDA driver side, it is difficult to know which GPU
      the audio has binded to. So set the bound gpu pci dev
      to vga_switcheroo.
      
      if the audio client is not the third registration, audio
      id will set in vga_switcheroo enable function. if the
      audio client is the last registration when vga_switcheroo
      _ready() get true, we should get audio client id from bound
      GPU directly.
      Signed-off-by: NJim Qu <Jim.Qu@amd.com>
      Reviewed-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4aaf448f
  25. 16 7月, 2018 1 次提交
  26. 28 6月, 2018 1 次提交
  27. 29 5月, 2018 1 次提交
  28. 23 5月, 2018 4 次提交