]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 14:03:34 +0000 (16:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 14:03:34 +0000 (16:03 +0200)
added patches:
alsa-hda-conexant-fix-missing-beep-setup.patch
alsa-hda-fix-discovery-of-i915-graphics-pci-device.patch
alsa-hda-realtek-add-mute-led-quirk-for-hp-omen-laptop.patch
alsa-hda-realtek-add-quirk-for-clevo-ns50pu.patch
alsa-hda-realtek-add-quirk-for-clevo-pd70pnt.patch
alsa-hda-realtek-alc897-headset-mic-no-sound.patch
alsa-hda-realtek-apply-fixup-for-lenovo-yoga-duet-7-properly.patch
alsa-hda-via-fix-missing-beep-setup.patch
alsa-memalloc-drop-x86-specific-hack-for-wc-allocations.patch
random-quiet-urandom-warning-ratelimit-suppression-message.patch
random-schedule-mix_interrupt_randomness-less-often.patch

12 files changed:
queue-5.18/alsa-hda-conexant-fix-missing-beep-setup.patch [new file with mode: 0644]
queue-5.18/alsa-hda-fix-discovery-of-i915-graphics-pci-device.patch [new file with mode: 0644]
queue-5.18/alsa-hda-realtek-add-mute-led-quirk-for-hp-omen-laptop.patch [new file with mode: 0644]
queue-5.18/alsa-hda-realtek-add-quirk-for-clevo-ns50pu.patch [new file with mode: 0644]
queue-5.18/alsa-hda-realtek-add-quirk-for-clevo-pd70pnt.patch [new file with mode: 0644]
queue-5.18/alsa-hda-realtek-alc897-headset-mic-no-sound.patch [new file with mode: 0644]
queue-5.18/alsa-hda-realtek-apply-fixup-for-lenovo-yoga-duet-7-properly.patch [new file with mode: 0644]
queue-5.18/alsa-hda-via-fix-missing-beep-setup.patch [new file with mode: 0644]
queue-5.18/alsa-memalloc-drop-x86-specific-hack-for-wc-allocations.patch [new file with mode: 0644]
queue-5.18/random-quiet-urandom-warning-ratelimit-suppression-message.patch [new file with mode: 0644]
queue-5.18/random-schedule-mix_interrupt_randomness-less-often.patch [new file with mode: 0644]
queue-5.18/series

diff --git a/queue-5.18/alsa-hda-conexant-fix-missing-beep-setup.patch b/queue-5.18/alsa-hda-conexant-fix-missing-beep-setup.patch
new file mode 100644 (file)
index 0000000..68835c3
--- /dev/null
@@ -0,0 +1,44 @@
+From 5faa0bc69102f3a4c605581564c367be5eb94dfa Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 20 Jun 2022 12:40:07 +0200
+Subject: ALSA: hda/conexant: Fix missing beep setup
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 5faa0bc69102f3a4c605581564c367be5eb94dfa upstream.
+
+Currently the Conexant codec driver sets up the beep NID after calling
+snd_hda_gen_parse_auto_config().  It turned out that this results in
+the insufficient setup for the beep control, as the generic parser
+handles the fake path in snd_hda_gen_parse_auto_config() only if the
+beep_nid is set up beforehand.
+
+For dealing with the beep widget properly, call cx_auto_parse_beep()
+before snd_hda_gen_parse_auto_config() call.
+
+Fixes: 51e19ca5f755 ("ALSA: hda/conexant - Clean up beep code")
+Cc: <stable@vger.kernel.org>
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=216152
+Link: https://lore.kernel.org/r/20220620104008.1994-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_conexant.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -1079,11 +1079,11 @@ static int patch_conexant_auto(struct hd
+       if (err < 0)
+               goto error;
+-      err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
++      err = cx_auto_parse_beep(codec);
+       if (err < 0)
+               goto error;
+-      err = cx_auto_parse_beep(codec);
++      err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
+       if (err < 0)
+               goto error;
diff --git a/queue-5.18/alsa-hda-fix-discovery-of-i915-graphics-pci-device.patch b/queue-5.18/alsa-hda-fix-discovery-of-i915-graphics-pci-device.patch
new file mode 100644 (file)
index 0000000..d2c8d76
--- /dev/null
@@ -0,0 +1,70 @@
+From 36a38c53b4ee51b90566f8f44a613601eb31a10e Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 21 Jun 2022 14:00:44 +0200
+Subject: ALSA: hda: Fix discovery of i915 graphics PCI device
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 36a38c53b4ee51b90566f8f44a613601eb31a10e upstream.
+
+It's been reported that the recent fix for skipping the
+component-binding with D-GPU caused a regression on some systems; it
+resulted in the completely missing component binding with i915 GPU.
+
+The problem was the use of pci_get_class() function.  It matches with
+the full PCI class bits, while we want to match only partially the PCI
+base class bits.  So, when a system has an i915 graphics device with
+the PCI class 0380, it won't hit because we're looking for only the
+PCI class 0300.
+
+This patch fixes i915_gfx_present() to look up each PCI device and
+match with PCI base class explicitly instead of pci_get_class().
+
+Fixes: c9db8a30d9f0 ("ALSA: hda/i915 - skip acomp init if no matching display")
+Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
+Tested-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
+Cc: <stable@vger.kernel.org>
+Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1200611
+Link: https://lore.kernel.org/r/87bkunztec.wl-tiwai@suse.de
+Link: https://lore.kernel.org/r/20220621120044.11573-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/hda/hdac_i915.c | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c
+index 3f35972e1cf7..161a9711cd63 100644
+--- a/sound/hda/hdac_i915.c
++++ b/sound/hda/hdac_i915.c
+@@ -119,21 +119,18 @@ static int i915_component_master_match(struct device *dev, int subcomponent,
+ /* check whether Intel graphics is present and reachable */
+ static int i915_gfx_present(struct pci_dev *hdac_pci)
+ {
+-      unsigned int class = PCI_BASE_CLASS_DISPLAY << 16;
+       struct pci_dev *display_dev = NULL;
+-      bool match = false;
+-      do {
+-              display_dev = pci_get_class(class, display_dev);
+-
+-              if (display_dev && display_dev->vendor == PCI_VENDOR_ID_INTEL &&
++      for_each_pci_dev(display_dev) {
++              if (display_dev->vendor == PCI_VENDOR_ID_INTEL &&
++                  (display_dev->class >> 16) == PCI_BASE_CLASS_DISPLAY &&
+                   connectivity_check(display_dev, hdac_pci)) {
+                       pci_dev_put(display_dev);
+-                      match = true;
++                      return true;
+               }
+-      } while (!match && display_dev);
++      }
+-      return match;
++      return false;
+ }
+ /**
+-- 
+2.36.1
+
diff --git a/queue-5.18/alsa-hda-realtek-add-mute-led-quirk-for-hp-omen-laptop.patch b/queue-5.18/alsa-hda-realtek-add-mute-led-quirk-for-hp-omen-laptop.patch
new file mode 100644 (file)
index 0000000..6c8945b
--- /dev/null
@@ -0,0 +1,30 @@
+From b2e6b3d9bbb0a59ba7c710cc06e44cc548301f5f Mon Sep 17 00:00:00 2001
+From: Soham Sen <contact@sohamsen.me>
+Date: Thu, 9 Jun 2022 23:49:20 +0530
+Subject: ALSA: hda/realtek: Add mute LED quirk for HP Omen laptop
+
+From: Soham Sen <contact@sohamsen.me>
+
+commit b2e6b3d9bbb0a59ba7c710cc06e44cc548301f5f upstream.
+
+The HP Omen 15 laptop needs a quirk to toggle the mute LED. It already is implemented for a different variant of the HP Omen laptop so a fixup entry is needed for this variant.
+
+Signed-off-by: Soham Sen <contact@sohamsen.me>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20220609181919.45535-1-contact@sohamsen.me
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_realtek.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -9074,6 +9074,7 @@ static const struct snd_pci_quirk alc269
+                     ALC285_FIXUP_HP_GPIO_AMP_INIT),
+       SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
+                     ALC285_FIXUP_HP_GPIO_AMP_INIT),
++      SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
+       SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
+       SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
+       SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
diff --git a/queue-5.18/alsa-hda-realtek-add-quirk-for-clevo-ns50pu.patch b/queue-5.18/alsa-hda-realtek-add-quirk-for-clevo-ns50pu.patch
new file mode 100644 (file)
index 0000000..c48a5c1
--- /dev/null
@@ -0,0 +1,30 @@
+From 627ce0d68eb4b53e995b08089fa9da1e513ec5ba Mon Sep 17 00:00:00 2001
+From: Tim Crawford <tcrawford@system76.com>
+Date: Wed, 22 Jun 2022 09:00:17 -0600
+Subject: ALSA: hda/realtek: Add quirk for Clevo NS50PU
+
+From: Tim Crawford <tcrawford@system76.com>
+
+commit 627ce0d68eb4b53e995b08089fa9da1e513ec5ba upstream.
+
+Fixes headset detection on Clevo NS50PU.
+
+Signed-off-by: Tim Crawford <tcrawford@system76.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20220622150017.9897-1-tcrawford@system76.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_realtek.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -9263,6 +9263,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
++      SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
diff --git a/queue-5.18/alsa-hda-realtek-add-quirk-for-clevo-pd70pnt.patch b/queue-5.18/alsa-hda-realtek-add-quirk-for-clevo-pd70pnt.patch
new file mode 100644 (file)
index 0000000..a595411
--- /dev/null
@@ -0,0 +1,30 @@
+From d49951219b0249d3eff49e4f02e0de82357bc8a0 Mon Sep 17 00:00:00 2001
+From: Tim Crawford <tcrawford@system76.com>
+Date: Fri, 17 Jun 2022 07:30:28 -0600
+Subject: ALSA: hda/realtek: Add quirk for Clevo PD70PNT
+
+From: Tim Crawford <tcrawford@system76.com>
+
+commit d49951219b0249d3eff49e4f02e0de82357bc8a0 upstream.
+
+Fixes speaker output and headset detection on Clevo PD70PNT.
+
+Signed-off-by: Tim Crawford <tcrawford@system76.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20220617133028.50568-1-tcrawford@system76.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_realtek.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -2634,6 +2634,7 @@ static const struct snd_pci_quirk alc882
+       SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
+       SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
+       SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
++      SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
+       SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
+       SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
+       SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
diff --git a/queue-5.18/alsa-hda-realtek-alc897-headset-mic-no-sound.patch b/queue-5.18/alsa-hda-realtek-alc897-headset-mic-no-sound.patch
new file mode 100644 (file)
index 0000000..66c5ce8
--- /dev/null
@@ -0,0 +1,54 @@
+From fe6900bd8156467365bd5b976df64928fdebfeb0 Mon Sep 17 00:00:00 2001
+From: Kailang Yang <kailang@realtek.com>
+Date: Mon, 13 Jun 2022 14:57:19 +0800
+Subject: ALSA: hda/realtek - ALC897 headset MIC no sound
+
+From: Kailang Yang <kailang@realtek.com>
+
+commit fe6900bd8156467365bd5b976df64928fdebfeb0 upstream.
+
+There is not have Headset Mic verb table in BIOS default.
+So, it will have recording issue from headset MIC.
+Add the verb table value without jack detect. It will turn on Headset Mic.
+
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/719133a27d8844a890002cb817001dfa@realtek.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_realtek.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -10790,6 +10790,7 @@ enum {
+       ALC668_FIXUP_MIC_DET_COEF,
+       ALC897_FIXUP_LENOVO_HEADSET_MIC,
+       ALC897_FIXUP_HEADSET_MIC_PIN,
++      ALC897_FIXUP_HP_HSMIC_VERB,
+ };
+ static const struct hda_fixup alc662_fixups[] = {
+@@ -11209,6 +11210,13 @@ static const struct hda_fixup alc662_fix
+               .chained = true,
+               .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
+       },
++      [ALC897_FIXUP_HP_HSMIC_VERB] = {
++              .type = HDA_FIXUP_PINS,
++              .v.pins = (const struct hda_pintbl[]) {
++                      { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
++                      { }
++              },
++      },
+ };
+ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
+@@ -11234,6 +11242,7 @@ static const struct snd_pci_quirk alc662
+       SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
++      SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
+       SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
+       SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
+       SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
diff --git a/queue-5.18/alsa-hda-realtek-apply-fixup-for-lenovo-yoga-duet-7-properly.patch b/queue-5.18/alsa-hda-realtek-apply-fixup-for-lenovo-yoga-duet-7-properly.patch
new file mode 100644 (file)
index 0000000..869808f
--- /dev/null
@@ -0,0 +1,139 @@
+From 56ec3e755bd1041d35bdec020a99b327697ee470 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 14 Jun 2022 07:48:31 +0200
+Subject: ALSA: hda/realtek: Apply fixup for Lenovo Yoga Duet 7 properly
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 56ec3e755bd1041d35bdec020a99b327697ee470 upstream.
+
+It turned out that Lenovo shipped two completely different products
+with the very same PCI SSID, where both require different quirks;
+namely, Lenovo C940 has already the fixup for its speaker
+(ALC298_FIXUP_LENOVO_SPK_VOLUME) with the PCI SSID 17aa:3818, while
+Yoga Duet 7 has also the very same PCI SSID but requires a different
+quirk, ALC287_FIXUP_YOGA7_14TIL_SPEAKERS.
+
+Fortunately, both are with different codecs (C940 with ALC298 and Duet
+7 with ALC287), hence we can apply different fixes by checking the
+codec ID.  This patch implements that special fixup function.
+
+For easier handling, the internal function for applying a specific
+fixup entry is exported as __snd_hda_apply_fixup(), so that it can be
+called from the codec driver.  The rest is simply calling it with a
+different fixup ID depending on the codec ID.
+
+Reported-by: Hans de Goede <hdegoede@redhat.com>
+Tested-by: nikitashvets@flyium.com
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/5ca147d1-3a2d-60c6-c491-8aa844183222@redhat.com
+Link: https://lore.kernel.org/r/20220614054831.14648-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/hda_auto_parser.c |    7 ++++---
+ sound/pci/hda/hda_local.h       |    1 +
+ sound/pci/hda/patch_realtek.c   |   24 +++++++++++++++++++++++-
+ 3 files changed, 28 insertions(+), 4 deletions(-)
+
+--- a/sound/pci/hda/hda_auto_parser.c
++++ b/sound/pci/hda/hda_auto_parser.c
+@@ -819,7 +819,7 @@ static void set_pin_targets(struct hda_c
+               snd_hda_set_pin_ctl_cache(codec, cfg->nid, cfg->val);
+ }
+-static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
++void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth)
+ {
+       const char *modelname = codec->fixup_name;
+@@ -829,7 +829,7 @@ static void apply_fixup(struct hda_codec
+               if (++depth > 10)
+                       break;
+               if (fix->chained_before)
+-                      apply_fixup(codec, fix->chain_id, action, depth + 1);
++                      __snd_hda_apply_fixup(codec, fix->chain_id, action, depth + 1);
+               switch (fix->type) {
+               case HDA_FIXUP_PINS:
+@@ -870,6 +870,7 @@ static void apply_fixup(struct hda_codec
+               id = fix->chain_id;
+       }
+ }
++EXPORT_SYMBOL_GPL(__snd_hda_apply_fixup);
+ /**
+  * snd_hda_apply_fixup - Apply the fixup chain with the given action
+@@ -879,7 +880,7 @@ static void apply_fixup(struct hda_codec
+ void snd_hda_apply_fixup(struct hda_codec *codec, int action)
+ {
+       if (codec->fixup_list)
+-              apply_fixup(codec, codec->fixup_id, action, 0);
++              __snd_hda_apply_fixup(codec, codec->fixup_id, action, 0);
+ }
+ EXPORT_SYMBOL_GPL(snd_hda_apply_fixup);
+--- a/sound/pci/hda/hda_local.h
++++ b/sound/pci/hda/hda_local.h
+@@ -348,6 +348,7 @@ void snd_hda_apply_verbs(struct hda_code
+ void snd_hda_apply_pincfgs(struct hda_codec *codec,
+                          const struct hda_pintbl *cfg);
+ void snd_hda_apply_fixup(struct hda_codec *codec, int action);
++void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth);
+ void snd_hda_pick_fixup(struct hda_codec *codec,
+                       const struct hda_model_fixup *models,
+                       const struct snd_pci_quirk *quirk,
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -7056,6 +7056,7 @@ enum {
+       ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
+       ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
+       ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
++      ALC298_FIXUP_LENOVO_C940_DUET7,
+       ALC287_FIXUP_13S_GEN2_SPEAKERS,
+       ALC256_FIXUP_SET_COEF_DEFAULTS,
+       ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
+@@ -7074,6 +7075,23 @@ enum {
+       ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
+ };
++/* A special fixup for Lenovo C940 and Yoga Duet 7;
++ * both have the very same PCI SSID, and we need to apply different fixups
++ * depending on the codec ID
++ */
++static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
++                                         const struct hda_fixup *fix,
++                                         int action)
++{
++      int id;
++
++      if (codec->core.vendor_id == 0x10ec0298)
++              id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
++      else
++              id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
++      __snd_hda_apply_fixup(codec, id, action, 0);
++}
++
+ static const struct hda_fixup alc269_fixups[] = {
+       [ALC269_FIXUP_GPIO2] = {
+               .type = HDA_FIXUP_FUNC,
+@@ -8773,6 +8791,10 @@ static const struct hda_fixup alc269_fix
+               .chained = true,
+               .chain_id = ALC269_FIXUP_HEADSET_MODE,
+       },
++      [ALC298_FIXUP_LENOVO_C940_DUET7] = {
++              .type = HDA_FIXUP_FUNC,
++              .v.func = alc298_fixup_lenovo_c940_duet7,
++      },
+       [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
+               .type = HDA_FIXUP_VERBS,
+               .v.verbs = (const struct hda_verb[]) {
+@@ -9326,7 +9348,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
+       SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
+       SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
+-      SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
++      SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
+       SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
+       SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
+       SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
diff --git a/queue-5.18/alsa-hda-via-fix-missing-beep-setup.patch b/queue-5.18/alsa-hda-via-fix-missing-beep-setup.patch
new file mode 100644 (file)
index 0000000..ea4eafd
--- /dev/null
@@ -0,0 +1,41 @@
+From c7807b27d510e5aa53c8a120cfc02c33c24ebb5f Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 20 Jun 2022 12:40:08 +0200
+Subject: ALSA: hda/via: Fix missing beep setup
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit c7807b27d510e5aa53c8a120cfc02c33c24ebb5f upstream.
+
+Like the previous fix for Conexant codec, the beep_nid has to be set
+up before calling snd_hda_gen_parse_auto_config(); otherwise it'd miss
+the path setup.
+
+Fix the call order for addressing the missing beep setup.
+
+Fixes: 0e8f9862493a ("ALSA: hda/via - Simplify control management")
+Cc: <stable@vger.kernel.org>
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=216152
+Link: https://lore.kernel.org/r/20220620104008.1994-2-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_via.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/hda/patch_via.c
++++ b/sound/pci/hda/patch_via.c
+@@ -520,11 +520,11 @@ static int via_parse_auto_config(struct
+       if (err < 0)
+               return err;
+-      err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
++      err = auto_parse_beep(codec);
+       if (err < 0)
+               return err;
+-      err = auto_parse_beep(codec);
++      err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
+       if (err < 0)
+               return err;
diff --git a/queue-5.18/alsa-memalloc-drop-x86-specific-hack-for-wc-allocations.patch b/queue-5.18/alsa-memalloc-drop-x86-specific-hack-for-wc-allocations.patch
new file mode 100644 (file)
index 0000000..ecbd4ff
--- /dev/null
@@ -0,0 +1,86 @@
+From 9882d63bea14c8b3ed2c9360b9ab9f0e2f64ae2b Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 20 Jun 2022 09:34:40 +0200
+Subject: ALSA: memalloc: Drop x86-specific hack for WC allocations
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 9882d63bea14c8b3ed2c9360b9ab9f0e2f64ae2b upstream.
+
+The recent report for a crash on Haswell machines implied that the
+x86-specific (rather hackish) implementation for write-cache memory
+buffer allocation in ALSA core is buggy with the recent kernel in some
+corner cases.  This patch drops the x86-specific implementation and
+uses the standard dma_alloc_wc() & co generically for avoiding the bug
+and also for simplification.
+
+BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216112
+Cc: <stable@vger.kernel.org> # v5.18+
+Link: https://lore.kernel.org/r/20220620073440.7514-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/core/memalloc.c | 23 +----------------------
+ 1 file changed, 1 insertion(+), 22 deletions(-)
+
+diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
+index 15dc7160ba34..8cfdaee77905 100644
+--- a/sound/core/memalloc.c
++++ b/sound/core/memalloc.c
+@@ -431,33 +431,17 @@ static const struct snd_malloc_ops snd_dma_iram_ops = {
+  */
+ static void *snd_dma_dev_alloc(struct snd_dma_buffer *dmab, size_t size)
+ {
+-      void *p;
+-
+-      p = dma_alloc_coherent(dmab->dev.dev, size, &dmab->addr, DEFAULT_GFP);
+-#ifdef CONFIG_X86
+-      if (p && dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC)
+-              set_memory_wc((unsigned long)p, PAGE_ALIGN(size) >> PAGE_SHIFT);
+-#endif
+-      return p;
++      return dma_alloc_coherent(dmab->dev.dev, size, &dmab->addr, DEFAULT_GFP);
+ }
+ static void snd_dma_dev_free(struct snd_dma_buffer *dmab)
+ {
+-#ifdef CONFIG_X86
+-      if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC)
+-              set_memory_wb((unsigned long)dmab->area,
+-                            PAGE_ALIGN(dmab->bytes) >> PAGE_SHIFT);
+-#endif
+       dma_free_coherent(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
+ }
+ static int snd_dma_dev_mmap(struct snd_dma_buffer *dmab,
+                           struct vm_area_struct *area)
+ {
+-#ifdef CONFIG_X86
+-      if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC)
+-              area->vm_page_prot = pgprot_writecombine(area->vm_page_prot);
+-#endif
+       return dma_mmap_coherent(dmab->dev.dev, area,
+                                dmab->area, dmab->addr, dmab->bytes);
+ }
+@@ -471,10 +455,6 @@ static const struct snd_malloc_ops snd_dma_dev_ops = {
+ /*
+  * Write-combined pages
+  */
+-#ifdef CONFIG_X86
+-/* On x86, share the same ops as the standard dev ops */
+-#define snd_dma_wc_ops        snd_dma_dev_ops
+-#else /* CONFIG_X86 */
+ static void *snd_dma_wc_alloc(struct snd_dma_buffer *dmab, size_t size)
+ {
+       return dma_alloc_wc(dmab->dev.dev, size, &dmab->addr, DEFAULT_GFP);
+@@ -497,7 +477,6 @@ static const struct snd_malloc_ops snd_dma_wc_ops = {
+       .free = snd_dma_wc_free,
+       .mmap = snd_dma_wc_mmap,
+ };
+-#endif /* CONFIG_X86 */
+ #ifdef CONFIG_SND_DMA_SGBUF
+ static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size);
+-- 
+2.36.1
+
diff --git a/queue-5.18/random-quiet-urandom-warning-ratelimit-suppression-message.patch b/queue-5.18/random-quiet-urandom-warning-ratelimit-suppression-message.patch
new file mode 100644 (file)
index 0000000..89b1c43
--- /dev/null
@@ -0,0 +1,72 @@
+From c01d4d0a82b71857be7449380338bc53dde2da92 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Date: Thu, 16 Jun 2022 15:00:51 +0200
+Subject: random: quiet urandom warning ratelimit suppression message
+
+From: Jason A. Donenfeld <Jason@zx2c4.com>
+
+commit c01d4d0a82b71857be7449380338bc53dde2da92 upstream.
+
+random.c ratelimits how much it warns about uninitialized urandom reads
+using __ratelimit(). When the RNG is finally initialized, it prints the
+number of missed messages due to ratelimiting.
+
+It has been this way since that functionality was introduced back in
+2018. Recently, cc1e127bfa95 ("random: remove ratelimiting for in-kernel
+unseeded randomness") put a bit more stress on the urandom ratelimiting,
+which teased out a bug in the implementation.
+
+Specifically, when under pressure, __ratelimit() will print its own
+message and reset the count back to 0, making the final message at the
+end less useful. Secondly, it does so as a pr_warn(), which apparently
+is undesirable for people's CI.
+
+Fortunately, __ratelimit() has the RATELIMIT_MSG_ON_RELEASE flag exactly
+for this purpose, so we set the flag.
+
+Fixes: 4e00b339e264 ("random: rate limit unseeded randomness warnings")
+Cc: stable@vger.kernel.org
+Reported-by: Jon Hunter <jonathanh@nvidia.com>
+Reported-by: Ron Economos <re@w6rz.net>
+Tested-by: Ron Economos <re@w6rz.net>
+Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/char/random.c           |    2 +-
+ include/linux/ratelimit_types.h |   12 ++++++++----
+ 2 files changed, 9 insertions(+), 5 deletions(-)
+
+--- a/drivers/char/random.c
++++ b/drivers/char/random.c
+@@ -87,7 +87,7 @@ static RAW_NOTIFIER_HEAD(random_ready_ch
+ /* Control how we warn userspace. */
+ static struct ratelimit_state urandom_warning =
+-      RATELIMIT_STATE_INIT("warn_urandom_randomness", HZ, 3);
++      RATELIMIT_STATE_INIT_FLAGS("urandom_warning", HZ, 3, RATELIMIT_MSG_ON_RELEASE);
+ static int ratelimit_disable __read_mostly =
+       IS_ENABLED(CONFIG_WARN_ALL_UNSEEDED_RANDOM);
+ module_param_named(ratelimit_disable, ratelimit_disable, int, 0644);
+--- a/include/linux/ratelimit_types.h
++++ b/include/linux/ratelimit_types.h
+@@ -23,12 +23,16 @@ struct ratelimit_state {
+       unsigned long   flags;
+ };
+-#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) {               \
+-              .lock           = __RAW_SPIN_LOCK_UNLOCKED(name.lock),  \
+-              .interval       = interval_init,                        \
+-              .burst          = burst_init,                           \
++#define RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, flags_init) { \
++              .lock           = __RAW_SPIN_LOCK_UNLOCKED(name.lock),            \
++              .interval       = interval_init,                                  \
++              .burst          = burst_init,                                     \
++              .flags          = flags_init,                                     \
+       }
++#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) \
++      RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, 0)
++
+ #define RATELIMIT_STATE_INIT_DISABLED                                 \
+       RATELIMIT_STATE_INIT(ratelimit_state, 0, DEFAULT_RATELIMIT_BURST)
diff --git a/queue-5.18/random-schedule-mix_interrupt_randomness-less-often.patch b/queue-5.18/random-schedule-mix_interrupt_randomness-less-often.patch
new file mode 100644 (file)
index 0000000..df71283
--- /dev/null
@@ -0,0 +1,56 @@
+From 534d2eaf1970274150596fdd2bf552721e65d6b2 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Date: Thu, 16 Jun 2022 02:03:12 +0200
+Subject: random: schedule mix_interrupt_randomness() less often
+
+From: Jason A. Donenfeld <Jason@zx2c4.com>
+
+commit 534d2eaf1970274150596fdd2bf552721e65d6b2 upstream.
+
+It used to be that mix_interrupt_randomness() would credit 1 bit each
+time it ran, and so add_interrupt_randomness() would schedule mix() to
+run every 64 interrupts, a fairly arbitrary number, but nonetheless
+considered to be a decent enough conservative estimate.
+
+Since e3e33fc2ea7f ("random: do not use input pool from hard IRQs"),
+mix() is now able to credit multiple bits, depending on the number of
+calls to add(). This was done for reasons separate from this commit, but
+it has the nice side effect of enabling this patch to schedule mix()
+less often.
+
+Currently the rules are:
+a) Credit 1 bit for every 64 calls to add().
+b) Schedule mix() once a second that add() is called.
+c) Schedule mix() once every 64 calls to add().
+
+Rules (a) and (c) no longer need to be coupled. It's still important to
+have _some_ value in (c), so that we don't "over-saturate" the fast
+pool, but the once per second we get from rule (b) is a plenty enough
+baseline. So, by increasing the 64 in rule (c) to something larger, we
+avoid calling queue_work_on() as frequently during irq storms.
+
+This commit changes that 64 in rule (c) to be 1024, which means we
+schedule mix() 16 times less often. And it does *not* need to change the
+64 in rule (a).
+
+Fixes: 58340f8e952b ("random: defer fast pool mixing to worker")
+Cc: stable@vger.kernel.org
+Cc: Dominik Brodowski <linux@dominikbrodowski.net>
+Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/char/random.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/char/random.c
++++ b/drivers/char/random.c
+@@ -1038,7 +1038,7 @@ void add_interrupt_randomness(int irq)
+       if (new_count & MIX_INFLIGHT)
+               return;
+-      if (new_count < 64 && !time_is_before_jiffies(fast_pool->last + HZ))
++      if (new_count < 1024 && !time_is_before_jiffies(fast_pool->last + HZ))
+               return;
+       if (unlikely(!fast_pool->mix.func))
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b37f59ddbd69920fe4418cd29ffec8971b0f2f9f 100644 (file)
@@ -0,0 +1,11 @@
+random-schedule-mix_interrupt_randomness-less-often.patch
+random-quiet-urandom-warning-ratelimit-suppression-message.patch
+alsa-memalloc-drop-x86-specific-hack-for-wc-allocations.patch
+alsa-hda-via-fix-missing-beep-setup.patch
+alsa-hda-fix-discovery-of-i915-graphics-pci-device.patch
+alsa-hda-conexant-fix-missing-beep-setup.patch
+alsa-hda-realtek-add-mute-led-quirk-for-hp-omen-laptop.patch
+alsa-hda-realtek-alc897-headset-mic-no-sound.patch
+alsa-hda-realtek-apply-fixup-for-lenovo-yoga-duet-7-properly.patch
+alsa-hda-realtek-add-quirk-for-clevo-pd70pnt.patch
+alsa-hda-realtek-add-quirk-for-clevo-ns50pu.patch