07 Feb, 2019

1 commit

  • commit 693abe11aa6b27aed6eb8222162f8fb986325cef upstream.

    Fix hp_pin always no value.

    [More notes on the changes:

    The hp_pin value that is referred in alc294_hp_init() is always zero
    at the moment the function gets called, hence this is actually
    useless as in the current code.

    And, this kind of init sequence should be called from the codec init
    callback, instead of the parser function. So, the first fix in this
    patch to move the call call into its own init_hook.

    OTOH, this function is needed to be called only once after the boot,
    and it'd take too long for invoking at each resume (where the init
    callback gets called). So we add a new flag and invoke this only
    once as an additional fix.

    The one case is still not covered, though: S4 resume. But this
    change itself won't lead to any regression in that regard, so we
    leave S4 issue as is for now and fix it later. -- tiwai ]

    Fixes: bde1a7459623 ("ALSA: hda/realtek - Fixed headphone issue for ALC700")
    Signed-off-by: Kailang Yang
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     

31 Jan, 2019

1 commit


17 Jan, 2019

3 commits


13 Jan, 2019

1 commit


10 Jan, 2019

4 commits

  • commit 63d2a9ec310d8bcc955574220d4631aa55c1a80c upstream.

    Even after disabling interrupts on the module, it could be possible
    that irq handlers are still running. System hang is seen during
    suspend path. It was found that, there were pending writes on the
    HDA bus and clock was disabled by that time.

    Above mentioned issue is fixed by clearing any pending irq handlers
    before disabling clocks and returning from hda suspend.

    Suggested-by: Mohan Kumar
    Suggested-by: Dara Ramesh
    Signed-off-by: Sameer Pujar
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Sameer Pujar
     
  • commit 40906ebe3af6a48457151b3c6726b480f6a6cb13 upstream.

    Tested with 4.19.9.

    v2: Changed from CXT_FIXUP_MUTE_LED_GPIO to CXT_FIXUP_HP_DOCK because
    that's what the existing fixups for EliteBooks use.

    Signed-off-by: Mantas Mikulėnas
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Mantas Mikulėnas
     
  • commit 5ae4f61f012a097df93de2285070ec8e34716d29 upstream.

    ipcm->substream is indirectly controlled by user-space, hence leading to
    a potential exploitation of the Spectre variant 1 vulnerability.

    This issue was detected with the help of Smatch:

    sound/pci/emu10k1/emufx.c:1031 snd_emu10k1_ipcm_poke() warn: potential spectre issue 'emu->fx8010.pcm' [r] (local cap)
    sound/pci/emu10k1/emufx.c:1075 snd_emu10k1_ipcm_peek() warn: potential spectre issue 'emu->fx8010.pcm' [r] (local cap)

    Fix this by sanitizing ipcm->substream before using it to index emu->fx8010.pcm

    Notice that given that speculation windows are large, the policy is
    to kill the speculation on the first load and not worry if it can be
    completed with a dependent load/store [1].

    [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

    Cc: stable@vger.kernel.org
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     
  • commit 0b84304ef5da92add8dc75a1b07879c5374cdb05 upstream.

    info->channel is indirectly controlled by user-space, hence leading to
    a potential exploitation of the Spectre variant 1 vulnerability.

    This issue was detected with the help of Smatch:

    sound/pci/rme9652/hdsp.c:4100 snd_hdsp_channel_info() warn: potential spectre issue 'hdsp->channel_map' [r] (local cap)

    Fix this by sanitizing info->channel before using it to index hdsp->channel_map

    Notice that given that speculation windows are large, the policy is
    to kill the speculation on the first load and not worry if it can be
    completed with a dependent load/store [1].

    Also, notice that I refactored the code a bit in order to get rid of the
    following checkpatch warning:

    ERROR: do not use assignment in if condition
    FILE: sound/pci/rme9652/hdsp.c:4103:
    if ((mapped_channel = hdsp->channel_map[info->channel]) < 0)

    [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

    Cc: stable@vger.kernel.org
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     

17 Dec, 2018

1 commit

  • commit bde1a7459623a66c2abec4d0a841e4b06cc88d9a upstream.

    If it plugged headphone or headset into the jack, then
    do the reboot, it will have a chance to cause headphone no sound.
    It just need to run the headphone mode procedure after boot time.
    The issue will be fixed.
    It also suitable for ALC234 ALC274 and ALC294.

    Signed-off-by: Kailang Yang
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     

13 Dec, 2018

2 commits

  • commit 54947cd64c1b8290f64bb2958e343c07270e3a58 upstream.

    We've got a regression report for some Thinkpad models (at least
    T570s) which shows the too low speaker output volume. The bisection
    leaded to the commit 61fcf8ece9b6 ("ALSA: hda/realtek - Enable Thinkpad
    Dock device for ALC298 platform"), and it's basically adding the two
    pin configurations for the dock, and looks harmless.

    The real culprit seems, though, that the DAC assignment for the
    speaker pin is implicitly assumed on these devices, i.e. pin NID 0x14
    to be coupled with DAC NID 0x03. When more pins are configured by the
    commit above, the auto-parser changes the DAC assignment, and this
    resulted in the regression.

    As a workaround, just provide the fixed pin / DAC mapping table for
    this Thinkpad fixup function. It's no generic solution, but the
    problem itself is pretty much device-specific, so must be good
    enough.

    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1554304
    Fixes: 61fcf8ece9b6 ("ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform")
    Cc:
    Reported-and-tested-by: Jeremy Cline
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 3deef52ce10514ccdebba8e8ab85f9cebd0eb3f7 upstream.

    It's similar to other AMD audio devices, it also supports D3, which can
    save some power drain.

    Signed-off-by: Kai-Heng Feng
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kai-Heng Feng
     

08 Dec, 2018

1 commit

  • commit d6b340d7cb33c816ef4abe8143764ec5ab14a5cc upstream.

    The meddlesome gcc warns about the possible shortname string in
    trident driver code:
    sound/pci/trident/trident.c: In function ‘snd_trident_probe’:
    sound/pci/trident/trident.c:126:2: warning: ‘strcat’ accessing 17 or more bytes at offsets 36 and 20 may overlap 1 byte at offset 36 [-Wrestrict]
    strcat(card->shortname, card->driver);

    It happens since gcc calculates the possible string size from
    card->driver, but this can't be true since we did set the string just
    before that, and they are much shorter.

    For shutting it up, use the exactly same string set to card->driver
    for strcat() to card->shortname, too.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

06 Dec, 2018

3 commits

  • commit 8cd65271f8e545ddeed10ecc2e417936bdff168e upstream.

    MSI Cubi N 8GL (MS-B171) needs the same fixup as its older model, the
    MS-B120, in order for the headset mic to be properly detected.

    They both use a single 3-way jack for both mic and headset with an
    ALC283 codec, with the same pins used.

    Cc: stable@vger.kernel.org
    Signed-off-by: Anisse Astier
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Anisse Astier
     
  • commit 1078bef0cd9291355a20369b21cd823026ab8eaa upstream.

    This patch will enable ALC300.

    [ It's almost equivalent with other ALC269-compatible ones, and
    apparently has no loopback mixer -- tiwai ]

    Signed-off-by: Kailang Yang
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     
  • commit 7194eda1ba0872d917faf3b322540b4f57f11ba5 upstream.

    The function snd_ac97_put_spsa() gets the bit shift value from the
    associated private_value, but it extracts too much; the current code
    extracts 8 bit values in bits 8-15, but this is a combination of two
    nibbles (bits 8-11 and bits 12-15) for left and right shifts.
    Due to the incorrect bits extraction, the actual shift may go beyond
    the 32bit value, as spotted recently by UBSAN check:
    UBSAN: Undefined behaviour in sound/pci/ac97/ac97_codec.c:836:7
    shift exponent 68 is too large for 32-bit type 'int'

    This patch fixes the shift value extraction by masking the properly
    with 0x0f instead of 0xff.

    Reported-and-tested-by: Meelis Roos
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

14 Nov, 2018

6 commits

  • [ Upstream commit 78c9be61c3a5cd9e2439fd27a5ffad73a81958c7 ]

    Introduce a new flag, uc_buffer, to indicate that the controller
    requires the non-cached pages for stream buffers, either as a
    chip-specific requirement or specified via snoop=0 option.
    This improves the code-readability.

    Also, this patch fixes the incorrect behavior for C-Media chip where
    the stream buffers were never handled as non-cached due to the check
    of driver_type even if you pass snoop=0 option.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit ac237c28d5ac1b241d58b1b7b4b9fa10efb22fb5 upstream.

    The Creative Audigy SE (SB0570) card currently exhibits an audible pop
    whenever playback is stopped or resumed, or during silent periods of an
    audio stream. Initialise the IZD bit to the 0 to eliminate these pops.

    The Infinite Zero Detection (IZD) feature on the DAC causes the output
    to be shunted to Vcap after 2048 samples of silence. This discharges the
    AC coupling capacitor through the output and causes the aforementioned
    pop/click noise.

    The behaviour of the IZD bit is described on page 15 of the WM8768GEDS
    datasheet: "With IZD=1, applying MUTE for 1024 consecutive input samples
    will cause all outputs to be connected directly to VCAP. This also
    happens if 2048 consecutive zero input samples are applied to all 6
    channels, and IZD=0. It will be removed as soon as any channel receives
    a non-zero input". I believe the second sentence might be referring to
    IZD=1 instead of IZD=0 given the observed behaviour of the card.

    This change should make the DAC initialisation consistent with
    Creative's Windows driver, as this popping persists when initialising
    the card in Linux and soft rebooting into Windows, but is not present on
    a cold boot to Windows.

    Signed-off-by: Alex Stanoev
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Alex Stanoev
     
  • commit e7bb6ad5685f05685dd8a6a5eda7bfcd14d5f95b upstream.

    The Lenovo G50-30, like other G50 models, has a Conexant codec that
    requires a quirk for its inverted stereo dmic.

    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1249364
    Reported-by: Alexander Ploumistos
    Tested-by: Alexander Ploumistos
    Cc: stable@vger.kernel.org
    Signed-off-by: Jeremy Cline
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Jeremy Cline
     
  • commit d06fb562bff5d14defdacbd92449bacbaedd5cdf upstream.

    The front MIC on the Lenovo M715 can't record sound, after applying
    the ALC294_FIXUP_LENOVO_MIC_LOCATION, the problem is fixed. So add
    the pin configuration of this machine to the pin quirk table.

    Cc:
    Signed-off-by: Hui Wang
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hui Wang
     
  • commit 5b7c5e1f4c36b99d0f694f38b9ad910f520cb7ef upstream.

    BIOS on ASUS G751 doesn't seem to map the headphone pin (NID 0x16)
    correctly. Add a quirk to address it, as well as chaining to the
    previous fix for the microphone.

    Reported-by: Håvard
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 11ba6111160290ccd35562f4e05cec08942a6c4c upstream.

    ASUS G751 requires the extra COEF initialization to make it microphone
    working properly.

    Reported-and-tested-by: Håvard
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

10 Oct, 2018

1 commit

  • commit 709ae62e8e6d9ac4df7dadb3b8ae432675c45ef9 upstream.

    The issue is the same as commit dd9aa335c880 ("ALSA: hda/realtek - Can't
    adjust speaker's volume on a Dell AIO"), the output requires to connect
    to a node with Amp-out capability.

    Applying the same fixup ALC298_FIXUP_SPK_VOLUME can fix the issue.

    BugLink: https://bugs.launchpad.net/bugs/1775068
    Signed-off-by: Kai-Heng Feng
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kai-Heng Feng
     

04 Oct, 2018

1 commit

  • [ Upstream commit 1adca4b0cd65c14cb8b8c9c257720385869c3d5f ]

    This patch can make audio controller in AMD Raven Ridge gets runtime
    suspended to D3, to save ~1W power when it's not in use.

    Cc: Vijendar Mukunda
    Signed-off-by: Kai-Heng Feng
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Kai-Heng Feng
     

29 Sep, 2018

1 commit

  • commit 49434c6c575d2008c0abbc93e615019f39e01252 upstream.

    snd_emu10k1_fx8010_ioctl(SNDRV_EMU10K1_IOCTL_INFO) allocates
    memory using kmalloc() and partially fills it by calling
    snd_emu10k1_fx8010_info() before returning the resulting
    structure to userspace, leaving uninitialized holes. Let's
    just use kzalloc() here.

    BugLink: http://blog.infosectcbr.com.au/2018/09/linux-kernel-infoleaks.html
    Signed-off-by: Willy Tarreau
    Cc: Jann Horn
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Willy Tarreau
     

20 Sep, 2018

1 commit

  • commit 16037643969e095509cd8446a3f8e406a6dc3a2c upstream.

    On AMD/ATI controllers, the HD-audio controller driver allows a bus
    reset upon the error recovery, and its procedure includes the
    cancellation of pending jack polling work as found in
    snd_hda_bus_codec_reset(). This works usually fine, but it becomes a
    problem when the reset happens from the jack poll work itself; then
    calling cancel_work_sync() from the work being processed tries to wait
    the finish endlessly.

    As a workaround, this patch adds the check of current_work() and
    applies the cancel_work_sync() only when it's not from the
    jackpoll_work.

    This doesn't fix the root cause of the reported error below, but at
    least, it eases the unexpected stall of the whole system.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200937
    Cc:
    Cc: Lukas Wunner
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

22 Aug, 2018

5 commits

  • commit 8e82a728792bf66b9f0a29c9d4c4b0630f7b9c79 upstream.

    I added the subsys product-id for the HDMI HDA device rather then for
    the PCH one, this commit fixes this.

    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104
    Cc: stable@vger.kernel.org
    Signed-off-by: Hans de Goede
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • commit 69756930f2de0457d51db7d505a1e4f40e9fd116 upstream.

    One place in cs5535audio_build_dma_packets() does an extra conversion
    via cpu_to_le32(); namely jmpprd_addr is passed to setup_prd() ops,
    which writes the value via cs_writel(). That is, the callback does
    the conversion by itself, and we don't need to convert beforehand.

    This patch fixes that bogus conversion.

    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit fff71a4c050ba46e305d910c837b99ba1728135e upstream.

    The endian conversions used in vx2_dma_read() and vx2_dma_write() are
    superfluous and even wrong on big-endian machines, as inl() and outl()
    already do conversions. Kill them.

    Spotted by sparse, a warning like:
    sound/pci/vx222/vx222_ops.c:278:30: warning: incorrect type in argument 1 (different base types)

    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit d77a4b4a5b0b2ebcbc9840995d91311ef28302ab upstream.

    As an equivalent codec with CX20724,
    CX8200 is also subject to the reboot bug.

    Late 2017 and 2018 LG Gram and some HP Spectre laptops are known victims
    to this issue, causing extremely loud noises upon reboot.

    Now that we know that this bug is subject to multiple codecs,
    fix the comment as well.

    Signed-off-by: Park Ju Hyung
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Park Ju Hyung
     
  • commit f59cf9a0551dd954ad8b752461cf19d9789f4b1d upstream.

    On rare occasions, we are still noticing that the internal speaker
    spitting out spurious noises even after adding the problematic codec
    to the list.

    Adding a 10ms artificial delay before rebooting fixes the issue entirely.

    Patch for Realtek codecs also adds the same amount of delay after
    entering D3.

    Signed-off-by: Park Ju Hyung
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Park Ju Hyung
     

03 Aug, 2018

4 commits

  • [ Upstream commit 8e142e9e628975b0dddd05cf1b095331dff6e2de ]

    DECLARE_TLV_DB_SCALE (alias of SNDRV_CTL_TLVD_DECLARE_DB_SCALE) is used but
    tlv.h is not included. This causes build failure when local macro is
    defined by comment-out.

    This commit fixes the bug. At the same time, the alias macro is replaced
    with a destination macro added at a commit 46e860f76804 ("ALSA: rename
    TLV-related macros so that they're friendly to user applications")

    Reported-by: Connor McAdams
    Fixes: 44f0c9782cc6 ('ALSA: hda/ca0132: Add tuning controls')
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     
  • [ Upstream commit 11d42c81036324697d367600bfc16f6dd37636fd ]

    The error messages at sanity checks of memory pages tend to repeat too
    many times once when it hits, and without the rate limit, it may flood
    and become unreadable. Replace such messages with the *_ratelimited()
    variant.

    Bugzilla: http://bugzilla.opensuse.org/show_bug.cgi?id=1093027
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • [ Upstream commit ef1ffbe7889e99f5b5cccb41c89e5c94f50f3218 ]

    When snd_ctl_add fails, the lack of error-handling code may
    cause unexpected results.

    This patch adds error-handling code after calling snd_ctl_add.

    Signed-off-by: Zhouyang Jia
    Acked-by: Andy Shevchenko
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Zhouyang Jia
     
  • [ Upstream commit 6d531e7b972cb62ded011c2dfcc2d9f72ea6c421 ]

    When snd_ctl_add fails, the lack of error-handling code may
    cause unexpected results.

    This patch adds error-handling code after calling snd_ctl_add.

    Signed-off-by: Zhouyang Jia
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Zhouyang Jia
     

25 Jul, 2018

2 commits


17 Jul, 2018

2 commits

  • commit aaa23f86001bdb82d2f937c5c7bce0a1e11a6c5b upstream.

    Obtaining the runtime pm wakeref can fail, especially in a hotplug
    scenario where i915.ko has been unloaded. If we do not catch the
    failure, we end up with an unbalanced pm.

    v2 additions by tiwai:
    hdmi_present_sense() checks the return value and handle only a
    negative error case and bails out only if it's really still suspended.
    Also, snd_hda_power_down() is called at the error path so that the
    refcount is balanced.

    Along with it, the spec->pcm_lock is taken outside
    hdmi_present_sense() in the caller side, so that it won't cause
    deadlock at reentrace via runtime resume.

    v3 fix by tiwai:
    Missing linux/pm_runtime.h is included.

    References: 222bde03881c ("ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug")
    Signed-off-by: Chris Wilson
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Chris Wilson
     
  • commit c6b17f1020d956f4113d478cae6171b9093817ba upstream.

    We have two new lenovo desktop models which need to apply the fixup of
    ALC294_FIXUP_LENOVO_MIC_LOCATION, and they have the same pin cfg as
    the machine with subsystem id:0x17aa3136, now use the pincfg table
    to apply the fixup for them.

    Cc:
    Signed-off-by: Hui Wang
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hui Wang