24 Apr, 2018

1 commit

  • Introduce a new helper macro, snd_array_for_each(), to iterate for
    each snd_array element. It slightly improves the readability than
    lengthy open codes at each place.

    Along with it, add const prefix to some obvious places.

    There should be no functional changes by this.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

12 Feb, 2018

1 commit


05 Jan, 2018

1 commit


22 Dec, 2017

1 commit

  • Since the commit 97cc2ed27e5a ("ALSA: hda - Fix yet another i915
    pointer leftover in error path") cleared hdac_acomp pointer, the
    WARN_ON() non-NULL check in snd_hdac_i915_register_notifier() may give
    a false-positive warning, as the function gets called no matter
    whether the component is registered or not. For fixing it, let's get
    rid of the spurious WARN_ON().

    Fixes: 97cc2ed27e5a ("ALSA: hda - Fix yet another i915 pointer leftover in error path")
    Cc:
    Reported-by: Kouta Okamoto
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

01 Dec, 2017

1 commit

  • This patch renames all the variable instances of hdac_device with hdev
    to prepare the code base to remove the usage of hdac_ext_device
    data structures done in the following patches. Existing code uses hdev
    and hdac as variable names for hdac_device as well as hdac_ext_device,
    which creates confusion.

    Signed-off-by: Rakesh Ughreja
    Signed-off-by: Mark Brown

    Ughreja, Rakesh A
     

17 Nov, 2017

1 commit

  • We got a regression report about the HD-audio HDMI chmap, where some
    surround channels are reported as UNKNOWN. The git bisection pointed
    the culprit at the commit 9b3dc8aa3fb1 ("ALSA: hda - Register chmap
    obj as priv data instead of codec"). The story behind scene is like
    this:

    - While moving the code out of the legacy HDA to the HDA common place,
    the patch modifies the code to obtain the chmap array indirectly in
    a byte array, and it expands it to kctl value array.
    - At the latter operation, the size of the array is wrongly passed by
    sizeof() to the pointer.
    - It can be 4 on 32bit arch, thus too short for 6+ channels.
    (And that's the reason why it didn't hit other persons; it's 8 on
    64bit arch, thus it's usually enough.)

    The code was further changed meanwhile, but the problem persisted.
    Let's fix it by correctly evaluating the array size.

    Fixes: 9b3dc8aa3fb1 ("ALSA: hda - Register chmap obj as priv data instead of codec")
    Reported-by: VDR User
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

13 Nov, 2017

2 commits

  • …e/sound into for-linus

    ASoC: Updates for v4.15

    The biggest thing this release has been the conversion of the AC98 bus
    to the driver model, that's been a long time coming so thanks to Robert
    Jarzmik for his dedication there. Due to there being some AC97 MFD
    there's a few fairly large changes in input and the MFD layer, mainly to
    the wm97xx driver.

    There's also some drivers/drm changes to support the new AMD Stoney
    platform, these are shared with the DRM subsystem and should be being
    merged via both.

    Within the subsystem the overwhelming bulk of the changes is in the
    Intel drivers which continue to need lots of cleanups and fixes, this
    release they've also gained support for their open source firmware.
    There's also some large changs in the core as Morimoto-san continues to
    mirror operations into the component level in preparation for conversion
    of drivers to that.

    - The AC97 bus has finally caught up with the driver model thanks to
    some dedicated and persistent work from Robert Jarzmik.
    - Continued work from Morimoto-san on moving us towards being able to
    use components for everything.
    - Lots of cleanups for the Intel platform code, including support for
    their open source audio firmware.
    - Support for scaling MCLK with sample rate in simple-card.
    - Support for AMD Stoney platform.

    Takashi Iwai
     
  • Pull 4.15 updates to take over the previous urgent fixes.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

24 Oct, 2017

1 commit


19 Oct, 2017

1 commit

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

    Takashi Iwai
     

18 Oct, 2017

1 commit

  • The loop in snd_hdac_bus_parse_capabilities() may go to nirvana when
    it hits an invalid register value read:

    BUG: unable to handle kernel paging request at ffffad5dc41f3fff
    IP: pci_azx_readl+0x5/0x10 [snd_hda_intel]
    Call Trace:
    snd_hdac_bus_parse_capabilities+0x3c/0x1f0 [snd_hda_core]
    azx_probe_continue+0x7d5/0x940 [snd_hda_intel]
    .....

    This happened on a new Intel machine, and we need to check the value
    and abort the loop accordingly.

    [Note: the fixes tag below indicates only the commit where this patch
    can be applied; the original problem was introduced even before that
    commit]

    Fixes: 6720b38420a0 ("ALSA: hda - move bus_parse_capabilities to core")
    Cc:
    Acked-by: Vinod Koul
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

19 Jul, 2017

1 commit

  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    2610 304 8 2922 b6a sound/hda/hdac_i915.o

    File size After adding 'const':
    text data bss dec hex filename
    2674 240 8 2922 b6a sound/hda/hdac_i915.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: Takashi Iwai

    Arvind Yadav
     

20 Jun, 2017

1 commit

  • When the codec device is unregistered / freed, it may release the
    resource while being used in an unsolicited event like the jack
    detection work. This leads to use-after-free.

    The fix here is to unregister the device at first, i.e. removing the
    codec from the list, then flushing the pending works to assure that
    all unsol events are gone. After this point, we're free from
    accessing the codec via unsol events, thus can release the resources
    gracefully.

    The issue was spotted originally by Intel CI, but it couldn't be
    reproduced reliably by its nature. So let's hope this fix really
    addresses the whole issues.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196045
    Reported-by: Martin Peres
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

10 May, 2017

1 commit

  • Using jiffies in hdac_wait_for_cmd_dmas() to determine when to time out
    when interrupts are off (snd_hdac_bus_stop_cmd_io()/spin_lock_irq())
    causes hard lockup so unlock while waiting using jiffies.

    ------
    [ 1211.603046] NMI watchdog: Watchdog detected hard LOCKUP on cpu 3
    [ 1211.603047] Modules linked in: snd_hda_intel i915 vgem
    [ 1211.603053] irq event stamp: 13366
    [ 1211.603053] hardirqs last enabled at (13365):
    ...
    [ 1211.603059] Call Trace:
    [ 1211.603059] ? delay_tsc+0x3d/0xc0
    [ 1211.603059] __delay+0xa/0x10
    [ 1211.603060] __const_udelay+0x31/0x40
    [ 1211.603060] snd_hdac_bus_stop_cmd_io+0x96/0xe0 [snd_hda_core]
    [ 1211.603060] ? azx_dev_disconnect+0x20/0x20 [snd_hda_intel]
    [ 1211.603061] snd_hdac_bus_stop_chip+0xb1/0x100 [snd_hda_core]
    [ 1211.603061] azx_stop_chip+0x9/0x10 [snd_hda_codec]
    [ 1211.603061] azx_suspend+0x72/0x220 [snd_hda_intel]
    [ 1211.603061] pci_pm_suspend+0x71/0x140
    [ 1211.603062] dpm_run_callback+0x6f/0x330
    [ 1211.603062] ? pci_pm_freeze+0xe0/0xe0
    [ 1211.603062] __device_suspend+0xf9/0x370
    [ 1211.603062] ? dpm_watchdog_set+0x60/0x60
    [ 1211.603063] async_suspend+0x1a/0x90
    [ 1211.603063] async_run_entry_fn+0x34/0x160
    [ 1211.603063] process_one_work+0x1f4/0x6d0
    [ 1211.603063] ? process_one_work+0x16e/0x6d0
    [ 1211.603064] worker_thread+0x49/0x4a0
    [ 1211.603064] kthread+0x107/0x140
    [ 1211.603064] ? process_one_work+0x6d0/0x6d0
    [ 1211.603065] ? kthread_create_on_node+0x40/0x40
    [ 1211.603065] ret_from_fork+0x2e/0x40

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100419
    Fixes: 38b19ed7f81ec ("ALSA: hda: fix to wait for RIRB & CORB DMA to set")
    Reported-by: Marta Lofstedt
    Suggested-by: Takashi Iwai
    Signed-off-by: Jeeja KP
    Acked-by: Vinod Koul
    CC: stable # 4.7
    Signed-off-by: Takashi Iwai

    Jeeja KP
     

02 May, 2017

1 commit


07 Apr, 2017

1 commit


03 Apr, 2017

1 commit

  • The macros _snd_hdac_chip_read() and *_write() expand to different
    types (b,w,l) per their argument. They were thought to be used only
    internally for other snd_hdac_chip_*() macros, but in some situations
    we need to call these directly, and they are way too ugly.

    Instead of saving a few lines, we just write these macros explicitly
    with the types, so that they can be used in a saner way.

    Acked-by: Vinod Koul
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

29 Mar, 2017

2 commits


25 Jan, 2017

1 commit


07 Jan, 2017

1 commit


25 Dec, 2016

1 commit


25 Oct, 2016

1 commit

  • - first slice of the gvt device model (Zhenyu et al)
    - compression support for gpu error states (Chris)
    - sunset clause on gpu errors resulting in dmesg noise telling users
    how to report them
    - .rodata diet from Tvrtko
    - switch over lots of macros to only take dev_priv (Tvrtko)
    - underrun suppression for dp link training (Ville)
    - lspcon (hmdi 2.0 on skl/bxt) support from Shashank Sharma, polish
    from Jani
    - gen9 wm fixes from Paulo&Lyude
    - updated ddi programming for kbl (Rodrigo)
    - respect alternate aux/ddc pins (from vbt) for all ddi ports (Ville)

    * tag 'drm-intel-next-2016-10-24' of git://anongit.freedesktop.org/drm-intel: (227 commits)
    drm/i915: Update DRIVER_DATE to 20161024
    drm/i915: Stop setting SNB min-freq-table 0 on powersave setup
    drm/i915/dp: add lane_count check in intel_dp_check_link_status
    drm/i915: Fix whitespace issues
    drm/i915: Clean up DDI DDC/AUX CH sanitation
    drm/i915: Respect alternate_ddc_pin for all DDI ports
    drm/i915: Respect alternate_aux_channel for all DDI ports
    drm/i915/gen9: Remove WaEnableYV12BugFixInHalfSliceChicken7
    drm/i915: KBL - Recommended buffer translation programming for DisplayPort
    drm/i915: Move down skl/kbl ddi iboost and n_edp_entires fixup
    drm/i915: Add a sunset clause to GPU hang logging
    drm/i915: Stop reporting error details in dmesg as well as the error-state
    drm/i915/gvt: do not ignore return value of create_scratch_page
    drm/i915/gvt: fix spare warnings on odd constant _Bool cast
    drm/i915/gvt: mark symbols static where possible
    drm/i915/gvt: fix sparse warnings on different address spaces
    drm/i915/gvt: properly access enabled intel_engine_cs
    drm/i915/gvt: Remove defunct vmap_batch()
    drm/i915/gvt: Use common mapping routines for shadow_bb object
    drm/i915/gvt: Use common mapping routines for indirect_ctx object
    ...

    Dave Airlie
     

23 Sep, 2016

1 commit

  • DP MST provides the capability to send multiple video and audio streams
    through a single port. This requires the API's between i915 and audio
    drivers to distinguish between multiple audio capable displays that can be
    connected to a port. Currently only the port identity is shared in the
    APIs. This patch adds support for MST with an additional parameter
    'int pipe'. The existing parameter 'port' does not change it's meaning.

    pipe =
    MST : display pipe that the stream originates from
    Non-MST : -1

    Affected APIs:
    struct i915_audio_component_ops
    - int (*sync_audio_rate)(struct device *, int port, int rate);
    + int (*sync_audio_rate)(struct device *, int port, int pipe,
    + int rate);

    - int (*get_eld)(struct device *, int port, bool *enabled,
    - unsigned char *buf, int max_bytes);
    + int (*get_eld)(struct device *, int port, int pipe,
    + bool *enabled, unsigned char *buf, int max_bytes);

    struct i915_audio_component_audio_ops
    - void (*pin_eld_notify)(void *audio_ptr, int port);
    + void (*pin_eld_notify)(void *audio_ptr, int port, int pipe);

    This patch makes dummy changes in the audio drivers (thanks Libin) for
    build to succeed. The audio side drivers will send the right 'pipe' values
    for MST in patches that will follow.

    v2:
    Renamed the new API parameter from 'dev_id' to 'pipe'. (Jim, Ville)
    Included Asoc driver API compatibility changes from Jeeja.
    Added WARN_ON() for invalid pipe in get_saved_encoder(). (Takashi)
    Added comment for av_enc_map[] definition. (Takashi)

    v3:
    Fixed logic error introduced while renaming 'dev_id' as 'pipe' (Ville)
    Renamed get_saved_encoder() to get_saved_enc() to reduce line length

    v4:
    Rebased.
    Parameter check for pipe < -1 values in get_saved_enc() (Ville)
    Switched to for_each_pipe() in get_saved_enc() (Ville)
    Renamed 'pipe' to 'dev_id' in audio side code (Takashi)

    v5:
    Included a comment for the dev_id arg. (Libin)

    Signed-off-by: Dhinakaran Pandiyan
    Reviewed-by: Takashi Iwai
    Reviewed-by: Ville Syrjälä
    Signed-off-by: Rodrigo Vivi
    Link: http://patchwork.freedesktop.org/patch/msgid/1474488168-2343-1-git-send-email-dhinakaran.pandiyan@intel.com

    Pandiyan, Dhinakaran
     

17 Sep, 2016

1 commit


09 Aug, 2016

3 commits


03 Aug, 2016

1 commit


25 Jul, 2016

1 commit


17 Jun, 2016

1 commit

  • Call path:

    1) snd_hdac_power_up_pm()
    2) snd_hdac_power_up()
    3) pm_runtime_get_sync()
    4) __pm_runtime_resume()
    5) rpm_resume()

    The rpm_resume() returns 1 when the device is already active.
    Because the return value is unmodified, the hdac regmap read/write
    functions should allow this value for the retry I/O operation, too.

    Signed-off-by: Jaroslav Kysela
    Cc:
    Signed-off-by: Takashi Iwai

    Jaroslav Kysela
     

16 Jun, 2016

1 commit


16 May, 2016

1 commit


13 May, 2016

3 commits


10 May, 2016

1 commit


08 May, 2016

2 commits