1. 18 2月, 2020 1 次提交
  2. 14 1月, 2020 1 次提交
  3. 13 1月, 2020 1 次提交
    • T
      ALSA: hda: Manage concurrent reg access more properly · 1a462be5
      Takashi Iwai 提交于
      In the commit 8e85def5 ("ALSA: hda: enable regmap internal
      locking"), we re-enabled the regmap lock due to the reported
      regression that showed the possible concurrent accesses.  It was a
      temporary workaround, and there are still a few opened races even
      after the revert.  In this patch, we cover those still opened windows
      with a proper mutex lock and disable the regmap internal lock again.
      
      First off, the patch introduces a new snd_hdac_device.regmap_lock
      mutex that is applied for each snd_hdac_regmap_*() call, including
      read, write and update helpers.  The mutex is applied carefully so
      that it won't block the self-power-up procedure in the helper
      function.  Also, this assures the protection for the accesses without
      regmap, too.
      
      The snd_hdac_regmap_update_raw() is refactored to use the standard
      regmap_update_bits_check() function instead of the open-code.  The
      non-regmap case is still open-coded but it's an easy part.  The all
      read and write operations are in the single mutex protection, so it's
      now race-free.
      
      In addition, a couple of new helper functions are added:
      snd_hdac_regmap_update_raw_once() and snd_hdac_regmap_sync().  Both
      are called from HD-audio legacy driver.  The former is to initialize
      the given verb bits but only once when it's not initialized yet.  Due
      to this condition, the function invokes regcache_cache_only(), and
      it's now performed inside the regmap_lock (formerly it was racy) too.
      The latter function is for simply invoking regcache_sync() inside the
      regmap_lock, which is called from the codec resume call path.
      Along with that, the HD-audio codec driver code is slightly modified /
      simplified to adapt those new functions.
      
      And finally, snd_hdac_regmap_read_raw(), *_write_raw(), etc are
      rewritten with the helper macro.  It's just for simplification because
      the code logic is identical among all those functions.
      Tested-by: NKai Vehmanen <kai.vehmanen@linux.intel.com>
      Link: https://lore.kernel.org/r/20200109090104.26073-1-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      1a462be5
  4. 05 1月, 2020 1 次提交
  5. 03 1月, 2020 2 次提交
  6. 22 7月, 2019 1 次提交
  7. 18 7月, 2019 1 次提交
  8. 17 7月, 2019 1 次提交
    • T
      ALSA: hda - Don't resume forcibly i915 HDMI/DP codec · 4914da2f
      Takashi Iwai 提交于
      We apply the codec resume forcibly at system resume callback for
      updating and syncing the jack detection state that may have changed
      during sleeping.  This is, however, superfluous for the codec like
      Intel HDMI/DP, where the jack detection is managed via the audio
      component notification; i.e. the jack state change shall be reported
      sooner or later from the graphics side at mode change.
      
      This patch changes the codec resume callback to avoid the forcible
      resume conditionally with a new flag, codec->relaxed_resume, for
      reducing the resume time.  The flag is set in the codec probe.
      
      Although this doesn't fix the entire bug mentioned in the bugzilla
      entry below, it's still a good optimization and some improvements are
      seen.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201901
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4914da2f
  9. 05 7月, 2019 1 次提交
    • T
      ALSA: hda: Simplify snd_hdac_refresh_widgets() · 774a075a
      Takashi Iwai 提交于
      Along with the recent fix for the races of snd_hdac_refresh_widgets()
      it turned out that the instantiation of widgets sysfs at
      snd_hdac_sysfs_reinit() could cause a race.  The race itself was
      already covered later by extending the mutex protection range, the
      commit 98482377 ("ALSA: hda: Fix widget_mutex incomplete
      protection"), but this also indicated that the call of *_reinit() is
      basically superfluous, as the widgets shall be created sooner or later
      from snd_hdac_device_register().
      
      This patch removes the redundant call of snd_hdac_sysfs_reinit() at
      first.  By this removal, the sysfs argument itself in
      snd_hdac_refresh_widgets() becomes superfluous, too, because the only
      case sysfs=false is always with codec->widgets=NULL.  So, we drop this
      redundant argument as well.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      774a075a
  10. 04 6月, 2019 1 次提交
  11. 31 5月, 2019 1 次提交
  12. 24 5月, 2019 1 次提交
  13. 29 4月, 2019 1 次提交
  14. 13 4月, 2019 1 次提交
    • T
      ALSA: hda: Initialize power_state field properly · 183ab39e
      Takashi Iwai 提交于
      The recent commit 98081ca6 ("ALSA: hda - Record the current power
      state before suspend/resume calls") made the HD-audio driver to store
      the PM state in power_state field.  This forgot, however, the
      initialization at power up.  Although the codec drivers usually don't
      need to refer to this field in the normal operation, let's initialize
      it properly for consistency.
      
      Fixes: 98081ca6 ("ALSA: hda - Record the current power state before suspend/resume calls")
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      183ab39e
  15. 19 3月, 2019 1 次提交
    • H
      ALSA: hda - Enforces runtime_resume after S3 and S4 for each codec · b5a236c1
      Hui Wang 提交于
      Recently we found the audio jack detection stop working after suspend
      on many machines with Realtek codec. Sometimes the audio selection
      dialogue didn't show up after users plugged headhphone/headset into
      the headset jack, sometimes after uses plugged headphone/headset, then
      click the sound icon on the upper-right corner of gnome-desktop, it
      also showed the speaker rather than the headphone.
      
      The root cause is that before suspend, the codec already call the
      runtime_suspend since this codec is not used by any apps, then in
      resume, it will not call runtime_resume for this codec. But for some
      realtek codec (so far, alc236, alc255 and alc891) with the specific
      BIOS, if it doesn't run runtime_resume after suspend, all codec
      functions including jack detection stop working anymore.
      
      This problem existed for a long time, but it was not exposed, that is
      because when problem happens, if users play sound or open
      sound-setting to check audio device, this will trigger calling to
      runtime_resume (via snd_hda_power_up), then the codec starts working
      again before users notice this problem.
      
      Since we don't know how many codec and BIOS combinations have this
      problem, to fix it, let the driver call runtime_resume for all codecs
      in pm_resume, maybe for some codecs, this is not needed, but it is
      harmless. After a codec is runtime resumed, if it is not used by any
      apps, it will be runtime suspended soon and furthermore we don't run
      suspend frequently, this change will not add much power consumption.
      
      Fixes: cc72da7d ("ALSA: hda - Use standard runtime PM for codec power-save control")
      Signed-off-by: NHui Wang <hui.wang@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b5a236c1
  16. 30 1月, 2019 2 次提交
    • T
      ALSA: hda - Use standard device registration for beep · 45571bb8
      Takashi Iwai 提交于
      Currently the registration and free of beep input device was done
      manually from the register and the disconnect callbacks of the
      assigned codec object.  This seems working in most cases, but this may
      be a cause of some races at probe.  Moreover, due to these manual
      calls, the total code became unnecessarily lengthy.
      
      This patch rewrites the beep registration code to follow the standard
      sound device object style.  This allows us reducing the code, in
      addition to avoiding the nested device registration calls.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      45571bb8
    • T
      ALSA: hda - Record the current power state before suspend/resume calls · 98081ca6
      Takashi Iwai 提交于
      Currently we deal with single codec and suspend codec callbacks for
      all S3, S4 and runtime PM handling.  But it turned out that we want
      distinguish the call patterns sometimes, e.g. for applying some init
      sequence only at probing and restoring from hibernate.
      
      This patch slightly modifies the common PM callbacks for HD-audio
      codec and stores the currently processed PM event in power_state of
      the codec's device.power field, which is currently unused.  The codec
      callback can take a look at this event value and judges which purpose
      it's being called.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      98081ca6
  17. 21 1月, 2019 1 次提交
  18. 16 1月, 2019 1 次提交
  19. 11 12月, 2018 1 次提交
    • 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
  20. 30 8月, 2018 2 次提交
  21. 29 8月, 2018 1 次提交
  22. 26 7月, 2018 1 次提交
  23. 28 6月, 2018 2 次提交
  24. 27 6月, 2018 1 次提交
  25. 21 6月, 2018 1 次提交
  26. 13 6月, 2018 1 次提交
    • K
      treewide: kmalloc() -> kmalloc_array() · 6da2ec56
      Kees Cook 提交于
      The kmalloc() function has a 2-factor argument form, kmalloc_array(). This
      patch replaces cases of:
      
              kmalloc(a * b, gfp)
      
      with:
              kmalloc_array(a * b, gfp)
      
      as well as handling cases of:
      
              kmalloc(a * b * c, gfp)
      
      with:
      
              kmalloc(array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              kmalloc_array(array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              kmalloc(4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The tools/ directory was manually excluded, since it has its own
      implementation of kmalloc().
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        kmalloc(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        kmalloc(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        kmalloc(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
      - kmalloc
      + kmalloc_array
        (
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        kmalloc(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kmalloc(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kmalloc(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kmalloc(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kmalloc(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        kmalloc(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kmalloc(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kmalloc(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        kmalloc(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        kmalloc(C1 * C2 * C3, ...)
      |
        kmalloc(
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kmalloc(
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kmalloc(
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kmalloc(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        kmalloc(sizeof(THING) * C2, ...)
      |
        kmalloc(sizeof(TYPE) * C2, ...)
      |
        kmalloc(C1 * C2 * C3, ...)
      |
        kmalloc(C1 * C2, ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6da2ec56
  27. 14 5月, 2018 1 次提交
  28. 24 4月, 2018 2 次提交
  29. 12 2月, 2018 1 次提交
  30. 22 11月, 2017 1 次提交
    • T
      ALSA: hda - Fix yet remaining issue with vmaster 0dB initialization · d6c0615f
      Takashi Iwai 提交于
      The previous fix for addressing the breakage in vmaster slave
      initialization, commit a91d6612 ("ALSA: hda - Fix incorrect TLV
      callback check introduced during set_fs() removal"), introduced a new
      helper to process over each slave kctl.  However, this helper passes
      only the original kctl, not the virtual slave kctl.  As a result,
      HD-audio driver (which is the only user so far) couldn't initialize
      the slave correctly because it's trying to update the value directly
      with the original kctl, not with the mapped kctl.
      
      This patch fixes the situation again by passing both the mapped slaved
      and original slave kctls to the function.  Luckily there is a single
      caller as of now, so changing the call signature is no big matter.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197959
      Fixes: a91d6612 ("ALSA: hda - Fix incorrect TLV callback check introduced during set_fs() removal")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d6c0615f
  31. 19 10月, 2017 1 次提交
    • T
      ALSA: hda: Avoid racy recreation of widget kobjects · 9780ded3
      Takashi Iwai 提交于
      The refresh of HD-audio widget sysfs kobjects via
      snd_hdac_refresh_widget_sysfs() is slightly racy.
      The driver recreates the whole tree from scratch after deleting the
      whole.  When CONFIG_DEBUG_KOBJECT_RELEASE option is used, kobject
      release doesn't happen immediately but delayed, while the re-creation
      of the same named kobject happens soon after invoking kobject_put().
      This may end up with the conflicts of duplicated kobjects, as found in
      the bug report below.
      
      In this patch, we take another approach to refresh the tree: instead
      of recreating the whole tree, just add the new nodes and delete the
      non-existing nodes.  Since the refresh happens only once at
      initialization, no longer race would happen.
      
      Along with the code change, merge snd_hdac_refresh_widget_sysfs() with
      the existing snd_hdac_refresh_widgets() with an additional bool flag
      for simplifying the code.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197307Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9780ded3
  32. 18 10月, 2017 2 次提交
    • T
      ALSA: hda - Fix incorrect TLV callback check introduced during set_fs() removal · a91d6612
      Takashi Iwai 提交于
      The commit 99b5c5bb ("ALSA: hda - Remove the use of set_fs()")
      converted the get_kctl_0dB_offset() call for killing set_fs() usage in
      HD-audio codec code.  The conversion assumed that the TLV callback
      used in HD-audio code is only snd_hda_mixer_amp() and applies the TLV
      calculation locally.
      
      Although this assumption is correct, and all slave kctls are actually
      with that callback, the current code is still utterly buggy; it
      doesn't hit this condition and falls back to the next check.  It's
      because the function gets called after adding slave kctls to vmaster.
      By assigning a slave kctl, the slave kctl object is faked inside
      vmaster code, and the whole kctl ops are overridden.  Thus the
      callback op points to a different value from what we've assumed.
      
      More badly, as reported by the KERNEXEC and UDEREF features of PaX,
      the code flow turns into the unexpected pitfall.  The next fallback
      check is SNDRV_CTL_ELEM_ACCESS_TLV_READ access bit, and this always
      hits for each kctl with TLV.  Then it evaluates the callback function
      pointer wrongly as if it were a TLV array.  Although currently its
      side-effect is fairly limited, this incorrect reference may lead to an
      unpleasant result.
      
      For addressing the regression, this patch introduces a new helper to
      vmaster code, snd_ctl_apply_vmaster_slaves().  This works similarly
      like the existing map_slaves() in hda_codec.c: it loops over the slave
      list of the given master, and applies the given function to each
      slave.  Then the initializer function receives the right kctl object
      and we can compare the correct pointer instead of the faked one.
      
      Also, for catching the similar breakage in future, give an error
      message when the unexpected TLV callback is found and bail out
      immediately.
      
      Fixes: 99b5c5bb ("ALSA: hda - Remove the use of set_fs()")
      Reported-by: NPaX Team <pageexec@freemail.hu>
      Cc: <stable@vger.kernel.org> # v4.13
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a91d6612
    • T
      ALSA: hda: Remove superfluous '-' added by printk conversion · 6bf88a34
      Takashi Iwai 提交于
      While converting the error messages to the standard macros in the
      commit 4e76a883 ("ALSA: hda - Replace with standard printk"), a
      superfluous '-' slipped in the code mistakenly.  Its influence is
      almost negligible, merely shows a dB value as negative integer instead
      of positive integer (or vice versa) in the rare error message.
      So let's kill this embarrassing byte to show more correct value.
      
      Fixes: 4e76a883 ("ALSA: hda - Replace with standard printk")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6bf88a34
  33. 03 9月, 2017 1 次提交
    • W
      ALSA: hda: Fix regression of hdmi eld control created based on invalid pcm · 1f7f51a6
      Wang YanQing 提交于
      Commit fb087eaa ("ALSA: hda - hdmi eld control created based on pcm")
      forget to filter out invalid pcm numbers, if there is only one invalid pcm
      number, then this issue causes we create eld control for invalid pcm silently,
      but when there are more than one invalid pcm numbers, then this issue bring
      probe error looks like below dmesg:
      "
      kernel: [    1.647283] snd_hda_intel 0000:00:03.0: bound 0000:00:02.0 (ops 0xc2967540)
      kernel: [    1.651192] snd_hda_intel 0000:00:03.0: Too many HDMI devices
      kernel: [    1.651195] snd_hda_intel 0000:00:03.0: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y
      kernel: [    1.651197] snd_hda_intel 0000:00:03.0: Too many HDMI devices
      kernel: [    1.651199] snd_hda_intel 0000:00:03.0: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y
      kernel: [    1.651201] snd_hda_intel 0000:00:03.0: Too many HDMI devices
      kernel: [    1.651203] snd_hda_intel 0000:00:03.0: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y
      kernel: [    1.651676] snd_hda_intel 0000:00:03.0: control 3:0:0:ELD:0 is already present
      kernel: [    1.651787] snd_hda_codec_hdmi: probe of hdaudioC0D0 failed with error -16
      "
      
      This patch add invalid pcm number filter before calling hdmi_create_eld_ctl.
      
      Fixes: fb087eaa ("ALSA: hda - hdmi eld control created based on pcm")
      Signed-off-by: NWang YanQing <udknight@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1f7f51a6
  34. 17 5月, 2017 1 次提交