18 Oct, 2018

2 commits

  • [ Upstream commit 75383f8d39d4c0fb96083dd460b7b139fbdac492 ]

    Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which
    1) sets bus->chip_init to prevent multiple entrances before device
    is stopped; 2) enables interrupt.

    We shouldn't use it for the purpose of resetting device only because
    1) when we really want to initialize device, we won't be able to do
    so; 2) we are ready to handle interrupt yet, and kernel crashes when
    interrupt comes in.

    Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset
    device properly.

    Fixes: 60767abcea3d ("ASoC: Intel: Skylake: Reset the controller in probe")
    Reviewed-by: Takashi Iwai
    Signed-off-by: Yu Zhao
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Yu Zhao
     
  • [ Upstream commit b61749a89f826eb61fc59794d9e4697bd246eb61 ]

    In snd_hdac_bus_init_chip(), we enable interrupt before
    snd_hdac_bus_init_cmd_io() initializing dma buffers. If irq has
    been acquired and irq handler uses the dma buffer, kernel may crash
    when interrupt comes in.

    Fix the problem by postponing enabling irq after dma buffer
    initialization. And warn once on null dma buffer pointer during the
    initialization.

    Reviewed-by: Takashi Iwai
    Signed-off-by: Yu Zhao
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Yu Zhao
     

03 Jan, 2018

1 commit

  • commit a36c2638380c0a4676647a1f553b70b20d3ebce1 upstream.

    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")
    Reported-by: Kouta Okamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

30 Nov, 2017

1 commit

  • commit c2432466f583cb719b35a41e757da587d9ab1d00 upstream.

    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
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    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
     

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


29 Apr, 2016

1 commit


27 Apr, 2016

2 commits


26 Apr, 2016

2 commits

  • For taking back the recent change of HDA HDMI fixes for i915 HSW/BDW.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The recent bug report suggests that BCLK setup for i915 HSW/BDW needs
    to be updated at each HDMI hotplug, not only at initialization and
    resume. That is, we need to update HSW_EM4 and HSW_EM5 registers at
    ELD notification, too. Otherwise the HDMI audio may be out of sync
    and played in a wrong pitch.

    However, the HDA codec driver has no access to the controller
    registers, and currently the code managing these registers is in
    hda_intel.c, i.e. local to the controller driver. For allowing the
    explicit BCLK update from the codec driver, as in this patch, the
    former haswell_set_bclk() in hda_intel.c is moved to hdac_i915.c and
    exposed as snd_hdac_i915_set_bclk(). This is called from both the HDA
    controller driver and intel_pin_eld_notify() in HDMI codec driver.

    Along with this change, snd_hdac_get_display_clk() gets dropped as
    it's no longer used.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91410
    Cc: # v4.5+
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

21 Apr, 2016

1 commit

  • HD-audio driver uses regmap cache bypass feature for reading a raw
    value without the cache. But this is racy since both the cached and
    the uncached reads may occur concurrently. The former is done via the
    normal control API access while the latter comes from the proc file
    read.

    Even though the regmap itself has the protection against the
    concurrent accesses, the flag set/reset is done without the
    protection, so it may lead to inconsistent state of bypass flag that
    doesn't match with the current read and occasionally result in a
    kernel WARNING like:
    WARNING: CPU: 3 PID: 2731 at drivers/base/regmap/regcache.c:499 regcache_cache_only+0x78/0x93

    One way to work around such a problem is to wrap with a mutex. But in
    this case, the solution is simpler: for the uncached read, we just
    skip the regmap and directly calls its accessor. The verb execution
    there is protected by itself, so basically it's safe to call
    individually.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=116171
    Signed-off-by: Takashi Iwai

    Takashi Iwai