09 Oct, 2020

1 commit

  • Current hdac_i915 uses a static completion instance to wait
    for i915 driver to complete the component bind.

    This design is not safe if multiple HDA controllers are active and
    communicating with different i915 instances, and can lead to list
    corruption and failed audio driver probe.

    Fix the design by moving completion mechanism to common acomp
    code and remove the related code from hdac_i915.

    Fixes: 7b882fe3e3e8 ("ALSA: hda - handle multiple i915 device instances")
    Co-developed-by: Kai Vehmanen
    Signed-off-by: Kai Vehmanen
    Link: https://lore.kernel.org/r/20201006161722.500256-1-kai.vehmanen@linux.intel.com
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

14 Jan, 2020

1 commit


15 Apr, 2019

1 commit


11 Apr, 2019

1 commit

  • …roonie/sound into for-linus

    ASoC: Fixes for v5.1

    A few core fixes along with the driver specific ones, mainly fixing
    small issues that only affect x86 platforms for various reasons (their
    unusual machine enumeration mechanisms mainly, plus a fix for error
    handling in topology).

    There's some of the driver fixes that look larger than they are, like
    the hdmi-codec changes which resulted in an indentation change, and most
    of the other large changes are for new drivers like the STM32 changes.

    Takashi Iwai
     

10 Apr, 2019

1 commit

  • snd_hdac_display_power() doesn't handle the concurrent calls carefully
    enough, and it may lead to the doubly get_power or put_power calls,
    when a runtime PM and an async work get called in racy way.

    This patch addresses it by reusing the bus->lock mutex that has been
    used for protecting the link state change in ext bus code, so that it
    can protect against racy display state changes. The initialization of
    bus->lock was moved from snd_hdac_ext_bus_init() to
    snd_hdac_bus_init() as well accordingly.

    Testcase: igt/i915_pm_rpm/module-reload #glk-dsi
    Reported-by: Chris Wilson
    Reviewed-by: Chris Wilson
    Cc: Imre Deak
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

20 Feb, 2019

1 commit

  • …ntel into drm-intel-next-queued

    Prep patches + headers for the mei-hdcp/i915 component interfaces

    Also contains the prep work in the component helpers plus adjustements
    for the snd-hda/i915 component interface.

    Plus one small static inline in the drm_hdcp.h header that both i915
    and mei_hdcp will need.

    Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    From: Daniel Vetter <daniel.vetter@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/20190219071619.GA11016@phenom.ffwll.local

    Joonas Lahtinen
     

15 Feb, 2019

1 commit

  • drm/i915 is tracking all wakeref owners with a cookie in order to
    identify leaks. To that end, each rpm acquisition ops->get_power is
    assigned a cookie which should be passed to ops->put_power to signify
    its release (and removal from the list of wakeref owners). As snd/hda is
    already using a bool to track current status of display_power extending
    that to an unsigned long to hold the boolean cookie is a trivial
    extension, and will quell all doubt that snd/hda is the cause of the
    device runtime pm leaks.

    v2: Keep using the power abstraction for local wakeref tracking.
    v3: BUILD_BUG_ON impedance mismatch

    Signed-off-by: Chris Wilson
    Cc: Takashi Iwai
    Cc: Jani Nikula
    Acked-by: Takashi Iwai
    Reviewed-by: Mika Kuoppala
    Link: https://patchwork.freedesktop.org/patch/msgid/20190213152109.16997-1-chris@chris-wilson.co.uk

    Chris Wilson
     

08 Feb, 2019

1 commit

  • Since we need multiple components for I915 for different purposes
    (Audio & Mei_hdcp), we adopt the subcomponents methodology introduced
    by the previous patch (mentioned below).

    Author: Daniel Vetter
    Date: Mon Jan 28 17:08:20 2019 +0530

    components: multiple components for a device

    Reviewed-by: Takashi Iwai
    Signed-off-by-by: Ramalingam C (commit message)
    Signed-off-by: Daniel Vetter (code)
    cc: Greg Kroah-Hartman
    cc: Russell King
    cc: Rafael J. Wysocki
    cc: Jaroslav Kysela
    cc: Takashi Iwai
    cc: Rodrigo Vivi
    cc: Jani Nikula
    Link: https://patchwork.freedesktop.org/patch/msgid/20190207232759.14553-4-daniel.vetter@ffwll.ch

    Daniel Vetter
     

11 Dec, 2018

2 commits

  • 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: Takashi Iwai

    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=106525
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

18 Jul, 2018

1 commit

  • This is the final step for more generic support of DRM audio
    component. The generic audio component code is now moved to its own
    file, and the symbols are renamed from snd_hac_i915_* to
    snd_hdac_acomp_*, respectively. The generic code is enabled via the
    new kconfig, CONFIG_SND_HDA_COMPONENT, while CONFIG_SND_HDA_I915 is
    kept as the super-class.

    Along with the split, three new callbacks are added to audio_ops:
    pin2port is for providing the conversion between the pin number and
    the widget id, and master_bind/master_unbin are called at binding /
    unbinding the master component, respectively. All these are optional,
    but used in i915 implementation and also other later implementations.

    A note about the new snd_hdac_acomp_init() function: there is a slight
    difference between this and the old snd_hdac_i915_init(). The latter
    (still) synchronizes with the master component binding, i.e. it
    assures that the relevant DRM component gets bound when it returns, or
    gives a negative error. Meanwhile the new function doesn't
    synchronize but just leaves as is. It's the responsibility by the
    caller's side to synchronize, or the caller may accept the
    asynchronous binding on the fly.

    v1->v2: Fix missing NULL check in master_bind/unbind

    Signed-off-by: Takashi Iwai

    Takashi Iwai