1. 28 3月, 2016 7 次提交
    • T
      ALSA: hda - Enable i915 ELD notifier for Intel IronLake and Baytrail · 7ff652ff
      Takashi Iwai 提交于
      Since we have the fixed pin-port mapping for Intel IronLake (IbexPeak)
      and Baytrail (ValleyView) platforms in the code side, now it's time to
      add the support in the codec driver side.  This patch simply enables
      the i915 ELD notifier for these in addition with the fix of the
      mapping from the port to NID in the callback.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7ff652ff
    • T
      ALSA: hda - Add the pin / port mapping on Intel ILK and VLV · d745f5e7
      Takashi Iwai 提交于
      Intel IronLake and ValleyView platforms have different HDMI widget pin
      and digital port mapping from other newer ones.  The recent ones
      (HSW+) have NID 0x05 to 0x07 for port B to port D, while these chips
      have NID 0x04 to 0x06.
      
      For adapting this mapping, pass the codec object instead of the bus
      object to snd_hdac_sync_audio_rate() and snd_hdac_acomp_get_eld() so
      that they can check the codec ID and calculate the mapping properly.
      
      The changes in the HDMI codec driver side will follow in the later
      patch.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d745f5e7
    • T
      ALSA: hda - Use eld notifier for Intel SandyBridge and IvyBridge HDMI/DP · e85015a3
      Takashi Iwai 提交于
      Intel SandyBridge and IvyBridge (CougarPoint and PantherPoint
      platforms) have also the same digital port vs audio widget mapping
      (from port B = NID 0x05 to port D = NID 0x07) as Haswell & co.
      So, we can reuse the existing functions for HSW+ for these platforms
      without changing there, but just by re-adding the on-demand i915
      binding in HDMI codec driver.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e85015a3
    • T
      ALSA: hda - Introduce pin_cvt_fixup() ops to hdmi parser · 4846a67e
      Takashi Iwai 提交于
      For reducing the splat of is_haswell_plus() or such macros, this patch
      introduces pin_cvt_fixup() ops to hdmi_spec.  For HSW+ and VLV+
      codecs, set this ops so that the driver can call the Intel-specific
      workarounds appropriately.
      
      A gratis bonus that we can remove the mux_id argument from
      hdmi_choose_cvt(), too, since the fixup function always refers the
      mux_idx from the given per_pin object.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4846a67e
    • T
      ALSA: hda - Override HDMI setup_stream ops for Intel HSW+ · 2c1c9b86
      Takashi Iwai 提交于
      Instead of checking at each time with is_haswell_plus() macro,
      override the setup_stream ops itself for HSW+ chips.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2c1c9b86
    • T
      ALSA: hda - Apply AMP fix in hdmi_setup_audio_infoframe() generically · 44bb6d0c
      Takashi Iwai 提交于
      The need for reprogramming the AMP mute bit at each audio info frame
      setup isn't always specific to Intel chips.  It's safer to set it
      generically for all codecs with the amp bit, as this verb execution
      itself isn't too much load.  This eliminates one usage of
      is_haswell_plus() macro, after all.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      44bb6d0c
    • T
      ALSA: hda - Split out Intel-specific codes from patch_generic_hdmi() · a686632f
      Takashi Iwai 提交于
      We have too many Intel-specific codes in patch_hdmi_generic() despite
      its function name.  And this makes it difficult to adjust per chipset,
      e.g. for allowing the audio notifier on an old chipset, one would need
      to add an explicit if() check.
      
      This patch attempts some code refactoring and cleanups in this regard;
      the Intel-specific codes are moved out of patch_generic_hdmi() into
      the new functions, patch_i915_hsw_hdmi() and patch_i915_byt_hdmi(),
      depending on the chipset.  The other old Intel chipsets keep using
      patch_generic_hdmi() without Intel hacks.  The existing
      patch_generic_hdmi() is also split to a few components so that they
      can be called from the Intel codec parsers.
      
      There are still many is_haswell*() and is_valleyview*() macro usages
      in the code.  They will be cleaned up later.  For the time being, only
      the entry are concerned.
      
      Along with this change, the i915_bound flag and the on-demand i915
      component binding have been removed as a cleanup, since there is no
      user at this moment.  This will be added back later once when Cougar
      Point and else start using the i915 eld notifier.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a686632f
  2. 21 3月, 2016 1 次提交
  3. 20 3月, 2016 1 次提交
    • T
      ALSA: hda - Workaround for unbalanced i915 power refcount by concurrent probe · 7169701a
      Takashi Iwai 提交于
      The recent addition of on-demand i915 audio component binding in the
      codec driver seems leading to the unbalanced i915 power refcount,
      according to Intel CI tests.  Typically, it gets a kernel WARNING
      like:
        WARNING: CPU: 3 PID: 173 at sound/hda/hdac_i915.c:91 snd_hdac_display_power+0xf1/0x110 [snd_hda_core]()
        Call Trace:
         [<ffffffff813fef15>] dump_stack+0x67/0x92
         [<ffffffff81078a21>] warn_slowpath_common+0x81/0xc0
         [<ffffffff81078b15>] warn_slowpath_null+0x15/0x20
         [<ffffffffa00f77e1>] snd_hdac_display_power+0xf1/0x110 [snd_hda_core]
         [<ffffffffa015039d>] azx_intel_link_power+0xd/0x10 [snd_hda_intel]
         [<ffffffffa011e32a>] azx_link_power+0x1a/0x30 [snd_hda_codec]
         [<ffffffffa00f21f9>] snd_hdac_link_power+0x29/0x40 [snd_hda_core]
         [<ffffffffa01192a6>] hda_codec_runtime_suspend+0x76/0xa0 [snd_hda_codec]
         .....
      
      The scenario is like below:
      - HD-audio driver and i915 driver are probed concurrently at the
        (almost) same time; HDA bus tries to bind with i915, but it fails
        because i915 initialization is still being processed.
      - Later on, HD-audio probes the HDMI codec, where it again tries to
        bind with i915.  At this time, it succeeds.
      - At finishing the probe of HDA, it decreases the refcount as if it
        were already bound at the bus probe, since the component is bound
        now.  This triggers a kernel WARNING due to the unbalance.
      
      As a workaround, in this patch, we just disable the on-demand i915
      component binding in the codec driver.  This essentially reverts back
      to the state of 4.4 kernel.
      
      We know that this is no real solution, but it's a minimalistic simple
      change that can be applied to 4.5.x kernel as stable.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94566Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.5
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7169701a
  4. 19 3月, 2016 2 次提交
  5. 18 3月, 2016 1 次提交
    • T
      ALSA: hda - Really restrict i915 notifier to HSW+ · 691be973
      Takashi Iwai 提交于
      The commit [b62232d4: ALSA: hda - Limit i915 HDMI binding only for
      HSW and later] tried to limit the usage of i915 audio notifier to the
      recent Intel models and switch to the old method on pre-Haswell
      models.  However, it assumed that the i915 component binding hasn't
      been done on such models, and the assumption was wrong: namely,
      Baytrail had already the i915 component binding due to powerwell
      control.  Thus, the workaround wasn't applied to Baytrail.
      
      For fixing this properly, this patch introduces a new flag indicating
      the usage of audio notifier and codec_has_acomp() refers to this flag
      instead of checking the existence of audio component.
      Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.5
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      691be973
  6. 17 3月, 2016 1 次提交
    • T
      ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug · 222bde03
      Takashi Iwai 提交于
      The recent change in HD-audio HDMI/DP codec driver for allowing the
      dynamic PCM binding introduced a new spec->pcm_mutex.  One of the
      protected area by this mutex is hdmi_present_sense().  As reported by
      Intel CI tests, unfortunately, the new mutex causes a deadlock when
      the hotplug/unplug is triggered during the codec is in runtime
      suspend.  The buggy code path is like the following:
      
        hdmi_unsol_event() -> ...
          -> hdmi_present_sense()
      ==>     ** here taking pcm_mutex
            -> hdmi_present_sense_via_verbs()
              -> snd_hda_power_up_pm() -> ... (runtime resume calls)
                -> generic_hdmi_resume()
                  -> hdmi_present_sense()
      ==>           ** here taking pcm_mutex again!
      
      As we can see here, the problem is that the mutex is taken before
      snd_hda_power_up_pm() call that triggers the runtime resume.  That is,
      the obvious solution is to move the power up/down call outside the
      mutex; it is exactly what this patch provides.
      
      The patch also clarifies why this bug wasn't caught beforehand.  We
      used to have the i915 audio component for hotplug for all Intel chips,
      and in that code path, there is no power up required but the
      information is taken directly from the graphics side.  However, we
      recently switched back to the old method for some old Intel chips due
      to regressions, and now the deadlock issue is surfaced.
      
      Fixes: a76056f2 ('ALSA: hda - hdmi dynamically bind PCM to pin when monitor hotplug')
      Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Tested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      222bde03
  7. 16 3月, 2016 1 次提交
  8. 14 3月, 2016 2 次提交
  9. 10 3月, 2016 1 次提交
    • T
      ALSA: hda - Don't handle ELD notify from invalid port · 4f8e4f35
      Takashi Iwai 提交于
      The current Intel HDMI codec driver supports only three fixed ports
      from port B to port D.  However, i915 driver may assign a DP on other
      ports, e.g. port A, when no eDP is used.  This incompatibility is
      caught later at pin_nid_to_pin_index() and results in a warning
      message like "HDMI: pin nid 4 not registered" at each time.
      
      This patch filters out such invalid events beforehand, so that the
      kernel won't be too grumbling.
      Reported-by: NStefan Assmann <sassmann@kpanic.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4f8e4f35
  10. 07 3月, 2016 7 次提交
  11. 04 3月, 2016 2 次提交
  12. 01 3月, 2016 1 次提交
  13. 23 2月, 2016 1 次提交
  14. 19 2月, 2016 1 次提交
  15. 09 2月, 2016 1 次提交
    • T
      ALSA: hda - Fix bad dereference of jack object · 2ebab40e
      Takashi Iwai 提交于
      The hda_jack_tbl entries are managed by snd_array for allowing
      multiple jacks.  It's good per se, but the problem is that struct
      hda_jack_callback keeps the hda_jack_tbl pointer.  Since snd_array
      doesn't preserve each pointer at resizing the array, we can't keep the
      original pointer but have to deduce the pointer at each time via
      snd_array_entry() instead.  Actually, this resulted in the deference
      to the wrong pointer on codecs that have many pins such as CS4208.
      
      This patch replaces the pointer to the NID value as the search key.
      As an unexpected good side effect, this even simplifies the code, as
      only NID is needed in most cases.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2ebab40e
  16. 05 2月, 2016 1 次提交
  17. 03 2月, 2016 1 次提交
  18. 29 1月, 2016 8 次提交