17 Apr, 2019

3 commits

  • commit cae30527901d9590db0e12ace994c1d58bea87fd upstream.

    Recently we set CONFIG_SND_HDA_POWER_SAVE_DEFAULT to 1 when
    configuring the kernel, then two machines were reported to have noise
    after installing the new kernel. Put them in the blacklist, the
    noise disappears.

    https://bugs.launchpad.net/bugs/1821663
    Cc:
    Signed-off-by: Hui Wang
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hui Wang
     
  • commit 80690a276f444a68a332136d98bfea1c338bc263 upstream.

    This adds a SND_PCI_QUIRK(...) line for the Tuxedo XC 1509.

    The Tuxedo XC 1509 and the System76 oryp5 are the same barebone
    notebooks manufactured by Clevo. To name the fixups both use after the
    actual underlying hardware, this patch also changes System76_orpy5
    to clevo_pb51ed in 2 enum symbols and one function name,
    matching the other pci_quirk entries which are also named after the
    device ODM.

    Fixes: 7f665b1c3283 ("ALSA: hda/realtek - Headset microphone and internal speaker support for System76 oryp5")
    Signed-off-by: Richard Sailer
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Richard Sailer
     
  • commit ea5c7eba216e832906e594799b8670f1954a588c upstream.

    The Acer TravelMate B114-21 laptop cannot detect and record sound from
    headset MIC. This patch adds the ALC233_FIXUP_ACER_HEADSET_MIC HDA verb
    quirk chained with ALC233_FIXUP_ASUS_MIC_NO_PRESENCE pin quirk to fix
    this issue.

    [ fixed the missing brace and reordered the entry -- tiwai ]

    Signed-off-by: Jian-Hong Pan
    Signed-off-by: Daniel Drake
    Reviewed-by: Kailang Yang
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Jian-Hong Pan
     

03 Apr, 2019

9 commits


27 Mar, 2019

4 commits

  • commit b5a236c175b0d984552a5f7c9d35141024c2b261 upstream.

    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: cc72da7d4d06 ("ALSA: hda - Use standard runtime PM for codec power-save control")
    Signed-off-by: Hui Wang
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hui Wang
     
  • commit 98081ca62cbac31fb0f7efaf90b2e7384ce22257 upstream.

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

    Takashi Iwai
     
  • commit 1e73359a24fad529b0794515b46cbfff99e5fbe6 upstream.

    When building without CONFIG_PCI, we can (depending on the architecture)
    get a link failure:

    ERROR: "pci_iounmap" [sound/pci/hda/snd-hda-codec-ca0132.ko] undefined!

    Adding a compile-time check for PCI gets it to work correctly on
    32-bit ARM.

    Fixes: d99501b8575d ("ALSA: hda/ca0132 - Call pci_iounmap() instead of iounmap()")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 721f1e6c1fd137e7e2053d8e103b666faaa2d50c upstream.

    Another machine which does not like the power saving (noise):
    https://bugzilla.redhat.com/show_bug.cgi?id=1689623

    Also, reorder the Lenovo C50 entry to keep the table sorted.

    Reported-by: hs.guimaraes@outlook.com
    Signed-off-by: Jaroslav Kysela
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Jaroslav Kysela
     

19 Mar, 2019

4 commits

  • commit cbc05fd6708c1744ee6a61cb4c461ff956d30524 upstream.

    The Acer TravelMate X514-51T with ALC255 cannot detect the headset MIC
    until ALC255_FIXUP_ACER_HEADSET_MIC quirk applied. Although, the
    internal DMIC uses another module - snd_soc_skl as the driver. We still
    need the NID 0x1a in the quirk to enable the headset MIC.

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

    Jian-Hong Pan
     
  • commit c0ca5eced22215c1e03e3ad479f8fab0bbb30772 upstream.

    Dell Precision 5820 with ALC3234 codec (which is equivalent with
    ALC255) shows click noises at (runtime) PM resume on the headphone.
    The biggest source of the noise comes from the cleared headphone pin
    control at resume, which is done via the standard shutup procedure.

    Although we have an override of the standard shutup callback to
    replace with NOP, this would skip other needed stuff (e.g. the pull
    down of headset power). So, instead, this "fixes" the behavior of
    alc_fixup_no_shutup() by introducing spec->no_shutup_pins flag.
    When this flag is set, Realtek codec won't call the standard
    snd_hda_shutup_pins() & co. Now alc_fixup_no_shutup() just sets this
    flag instead of overriding spec->shutup callback itself. This allows
    us to apply the similar fix for other entries easily if needed in
    future.

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

    Takashi Iwai
     
  • commit 8bb37a2a4d7c02affef554f5dc05f6d2e39c31f9 upstream.

    The ASUS UX362FA with ALC294 cannot detect the headset MIC and outputs
    through the internal speaker and the headphone. This issue can be fixed
    by the quirk in the commit 4e0511067 ALSA: hda/realtek: Enable audio
    jacks of ASUS UX533FD with ALC294.

    Besides, ASUS UX362FA and UX533FD have the same audio initial pin config
    values. So, this patch replaces SND_PCI_QUIRK of UX533FD with a new
    SND_HDA_PIN_QUIRK which benefits both UX362FA and UX533FD.

    Fixes: 4e051106730d ("ALSA: hda/realtek: Enable audio jacks of ASUS UX533FD with ALC294")
    Signed-off-by: Jian-Hong Pan
    Signed-off-by: Ming Shuo Chiu
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Jian-Hong Pan
     
  • commit 167897f4b32c2bc18b3b6183029a33fb420a114e upstream.

    Apply the HP_MIC_NO_PRESENCE fixups for the more HP Z2 G4 and
    HP Z240 models.

    Reported-by: Jeff Burrell
    Signed-off-by: Jaroslav Kysela
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Jaroslav Kysela
     

27 Feb, 2019

2 commits

  • commit c8c6ee611926685a7d753409e0a6e48b9e1b8748 upstream.

    It is reported that there's a constant background "hum/whitenoise"
    in the headset on the Lenovo X1 machines with the codec alc285, and it
    is confirmed that if we run the command below, the noise will stop.
    sudo hda-verb /dev/snd/hwC0D0 0x1d SET_PIN_WIDGET_CONTROL 0x0

    Then I consulted this issue with Kailang, he told me the pin 0x1d on
    this codec is used for PC beep in, the noise probably comes from this
    pin and we can also disable the PC beep in passthrough, then the PC
    beep in will not affect other sound playback.

    Fixes: c4cfcf6f4297 ("ALSA: hda/realtek - fix the pop noise on headphone for lenovo laptops")
    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1660581
    Cc:
    Signed-off-by: Kailang Yang
    Signed-off-by: Hui Wang
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hui Wang
     
  • commit 7f665b1c3283aae5b61843136d0a8ee808ba3199 upstream.

    On the System76 Oryx Pro (oryp5), there is a headset microphone input
    attached to 0x19 that does not have a jack detect. In order to get it
    working, the pin configuration needs to be set correctly, and the
    ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC fixup needs to be applied. This is
    similar to the MIC_NO_PRESENCE fixups for some Dell laptops, except we
    have a separate microphone jack that is already configured correctly.

    Since the ALC1220 does not have a fixup similar to
    ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, I have exposed the fixup from the
    ALC269 in a way that it can be accessed from the
    alc1220_fixup_system76_oryp5 function. In addition, the
    alc1220_fixup_clevo_p950 needs to be applied to gain speaker output.

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

    Jeremy Soller
     

20 Feb, 2019

1 commit


13 Feb, 2019

4 commits

  • commit 89e3a5682edaa4e5bb334719afb180256ac7bf78 upstream.

    On the System76 Darter Pro (darp5), there is a headset microphone
    input attached to 0x1a that does not have a jack detect. In order to
    get it working, the pin configuration needs to be set correctly, and
    the ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC fixup needs to be applied.
    This is similar to the MIC_NO_PRESENCE fixups for some Dell laptops,
    except we have a separate microphone jack that is already configured
    correctly.

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

    Jeremy Soller
     
  • commit 35a39f98567d8d3f1cea48f0f30de1a7e736b644 upstream.

    Replace the open-codes in many places with a new common helper for
    performing the same thing: referring to the primary headphone pin.

    This eventually fixes the potentially missing headphone pin on some
    weird devices, too.

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

    Takashi Iwai
     
  • commit d561aa0a70bb2e1dd85fde98b6a5561e4175ac3e upstream.

    When auto_mute = no or spec->suppress_auto_mute = 1, cfg->hp_pins will
    lose value.

    Add this patch to find hp_pins value.
    I add fixed for ALC282 ALC225 ALC256 ALC294 and alc_default_init()
    alc_default_shutup().

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

    Kailang Yang
     
  • commit 305a0ade180981686eec1f92aa6252a7c6ebb1cf upstream.

    In the current code, the codec registration may happen both at the
    codec bind time and the end of the controller probe time. In a rare
    occasion, they race with each other, leading to Oops due to the still
    uninitialized card device.

    This patch introduces a simple flag to prevent the codec registration
    at the codec bind time as long as the controller probe is going on.
    The controller probe invokes snd_card_register() that does the whole
    registration task, and we don't need to register each piece
    beforehand.

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

    Takashi Iwai
     

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

2 commits

  • commit 699390381a7bae2fab01a22f742a17235c44ed8a upstream.

    Support speaker and mic mute LEDs on HP ProBook 470 G5.

    BugLink: https://bugs.launchpad.net/bugs/1811254
    Signed-off-by: Anthony Wong
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Anthony Wong
     
  • commit 82aa0d7e09840704d9a37434fef1770179d663fb upstream.

    Fix typo for model alc255-dell1 to alc225-dell1.

    Enable headset mode support for new WYSE NB platform.

    Fixes: a26d96c7802e ("ALSA: hda/realtek - Comprehensive model list for ALC259 & co")
    Signed-off-by: Kailang Yang
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     

17 Jan, 2019

3 commits


13 Jan, 2019

1 commit


10 Jan, 2019

6 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 82b01149ec94d746867d7f9156c44d775d4d2d67 upstream.

    The headset mic of ASUS laptops like UX533FD, UX433FN and UX333FA, whose
    CODEC is Realtek ALC294 has jack auto detection feature. This patch
    enables the feature.

    Fixes: 4e051106730d ("ALSA: hda/realtek: Enable audio jacks of ASUS UX533FD with ALC294")
    Signed-off-by: Daniel Drake
    Signed-off-by: Jian-Hong Pan
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Jian-Hong Pan
     
  • commit 9cf6533e8060d3896b88ea14b27f620e6504b84b upstream.

    By default, there is no sound on Asus UX391UA on Linux.

    This patch adds sound support on Asus UX391UA. Tested working by three
    different users.

    The problem has also been described at
    https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1784485

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

    Wandrille RONCE
     
  • 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