From 4b0731dc26da3ccde35fa66277a29ea4f7527c6c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 25 Jun 2022 16:03:24 +0200 Subject: [PATCH] 5.15-stable patches added patches: alsa-hda-conexant-fix-missing-beep-setup.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 random-quiet-urandom-warning-ratelimit-suppression-message.patch random-schedule-mix_interrupt_randomness-less-often.patch --- ...-hda-conexant-fix-missing-beep-setup.patch | 44 ++++++ ...dd-mute-led-quirk-for-hp-omen-laptop.patch | 30 ++++ ...a-realtek-add-quirk-for-clevo-ns50pu.patch | 30 ++++ ...-realtek-add-quirk-for-clevo-pd70pnt.patch | 30 ++++ ...-realtek-alc897-headset-mic-no-sound.patch | 54 +++++++ ...ixup-for-lenovo-yoga-duet-7-properly.patch | 139 ++++++++++++++++++ .../alsa-hda-via-fix-missing-beep-setup.patch | 41 ++++++ ...arning-ratelimit-suppression-message.patch | 72 +++++++++ ...-mix_interrupt_randomness-less-often.patch | 56 +++++++ queue-5.15/series | 9 ++ 10 files changed, 505 insertions(+) create mode 100644 queue-5.15/alsa-hda-conexant-fix-missing-beep-setup.patch create mode 100644 queue-5.15/alsa-hda-realtek-add-mute-led-quirk-for-hp-omen-laptop.patch create mode 100644 queue-5.15/alsa-hda-realtek-add-quirk-for-clevo-ns50pu.patch create mode 100644 queue-5.15/alsa-hda-realtek-add-quirk-for-clevo-pd70pnt.patch create mode 100644 queue-5.15/alsa-hda-realtek-alc897-headset-mic-no-sound.patch create mode 100644 queue-5.15/alsa-hda-realtek-apply-fixup-for-lenovo-yoga-duet-7-properly.patch create mode 100644 queue-5.15/alsa-hda-via-fix-missing-beep-setup.patch create mode 100644 queue-5.15/random-quiet-urandom-warning-ratelimit-suppression-message.patch create mode 100644 queue-5.15/random-schedule-mix_interrupt_randomness-less-often.patch diff --git a/queue-5.15/alsa-hda-conexant-fix-missing-beep-setup.patch b/queue-5.15/alsa-hda-conexant-fix-missing-beep-setup.patch new file mode 100644 index 00000000000..68835c33a29 --- /dev/null +++ b/queue-5.15/alsa-hda-conexant-fix-missing-beep-setup.patch @@ -0,0 +1,44 @@ +From 5faa0bc69102f3a4c605581564c367be5eb94dfa Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 20 Jun 2022 12:40:07 +0200 +Subject: ALSA: hda/conexant: Fix missing beep setup + +From: Takashi Iwai + +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: +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 +Signed-off-by: Greg Kroah-Hartman +--- + 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.15/alsa-hda-realtek-add-mute-led-quirk-for-hp-omen-laptop.patch b/queue-5.15/alsa-hda-realtek-add-mute-led-quirk-for-hp-omen-laptop.patch new file mode 100644 index 00000000000..f5b7da8453b --- /dev/null +++ b/queue-5.15/alsa-hda-realtek-add-mute-led-quirk-for-hp-omen-laptop.patch @@ -0,0 +1,30 @@ +From b2e6b3d9bbb0a59ba7c710cc06e44cc548301f5f Mon Sep 17 00:00:00 2001 +From: Soham Sen +Date: Thu, 9 Jun 2022 23:49:20 +0530 +Subject: ALSA: hda/realtek: Add mute LED quirk for HP Omen laptop + +From: Soham Sen + +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 +Cc: +Link: https://lore.kernel.org/r/20220609181919.45535-1-contact@sohamsen.me +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -8830,6 +8830,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.15/alsa-hda-realtek-add-quirk-for-clevo-ns50pu.patch b/queue-5.15/alsa-hda-realtek-add-quirk-for-clevo-ns50pu.patch new file mode 100644 index 00000000000..53ec231978c --- /dev/null +++ b/queue-5.15/alsa-hda-realtek-add-quirk-for-clevo-ns50pu.patch @@ -0,0 +1,30 @@ +From 627ce0d68eb4b53e995b08089fa9da1e513ec5ba Mon Sep 17 00:00:00 2001 +From: Tim Crawford +Date: Wed, 22 Jun 2022 09:00:17 -0600 +Subject: ALSA: hda/realtek: Add quirk for Clevo NS50PU + +From: Tim Crawford + +commit 627ce0d68eb4b53e995b08089fa9da1e513ec5ba upstream. + +Fixes headset detection on Clevo NS50PU. + +Signed-off-by: Tim Crawford +Cc: +Link: https://lore.kernel.org/r/20220622150017.9897-1-tcrawford@system76.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -9000,6 +9000,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.15/alsa-hda-realtek-add-quirk-for-clevo-pd70pnt.patch b/queue-5.15/alsa-hda-realtek-add-quirk-for-clevo-pd70pnt.patch new file mode 100644 index 00000000000..e811d6a595a --- /dev/null +++ b/queue-5.15/alsa-hda-realtek-add-quirk-for-clevo-pd70pnt.patch @@ -0,0 +1,30 @@ +From d49951219b0249d3eff49e4f02e0de82357bc8a0 Mon Sep 17 00:00:00 2001 +From: Tim Crawford +Date: Fri, 17 Jun 2022 07:30:28 -0600 +Subject: ALSA: hda/realtek: Add quirk for Clevo PD70PNT + +From: Tim Crawford + +commit d49951219b0249d3eff49e4f02e0de82357bc8a0 upstream. + +Fixes speaker output and headset detection on Clevo PD70PNT. + +Signed-off-by: Tim Crawford +Cc: +Link: https://lore.kernel.org/r/20220617133028.50568-1-tcrawford@system76.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -2629,6 +2629,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.15/alsa-hda-realtek-alc897-headset-mic-no-sound.patch b/queue-5.15/alsa-hda-realtek-alc897-headset-mic-no-sound.patch new file mode 100644 index 00000000000..002ae6038c0 --- /dev/null +++ b/queue-5.15/alsa-hda-realtek-alc897-headset-mic-no-sound.patch @@ -0,0 +1,54 @@ +From fe6900bd8156467365bd5b976df64928fdebfeb0 Mon Sep 17 00:00:00 2001 +From: Kailang Yang +Date: Mon, 13 Jun 2022 14:57:19 +0800 +Subject: ALSA: hda/realtek - ALC897 headset MIC no sound + +From: Kailang Yang + +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 +Cc: +Link: https://lore.kernel.org/r/719133a27d8844a890002cb817001dfa@realtek.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -10522,6 +10522,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[] = { +@@ -10941,6 +10942,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[] = { +@@ -10966,6 +10974,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.15/alsa-hda-realtek-apply-fixup-for-lenovo-yoga-duet-7-properly.patch b/queue-5.15/alsa-hda-realtek-apply-fixup-for-lenovo-yoga-duet-7-properly.patch new file mode 100644 index 00000000000..dd0c180ff51 --- /dev/null +++ b/queue-5.15/alsa-hda-realtek-apply-fixup-for-lenovo-yoga-duet-7-properly.patch @@ -0,0 +1,139 @@ +From 56ec3e755bd1041d35bdec020a99b327697ee470 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 14 Jun 2022 07:48:31 +0200 +Subject: ALSA: hda/realtek: Apply fixup for Lenovo Yoga Duet 7 properly + +From: Takashi Iwai + +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 +Tested-by: nikitashvets@flyium.com +Cc: +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 +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -823,7 +823,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; + +@@ -833,7 +833,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: +@@ -874,6 +874,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 +@@ -883,7 +884,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 +@@ -350,6 +350,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 +@@ -6883,6 +6883,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, +@@ -6892,6 +6893,23 @@ enum { + ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, + }; + ++/* 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, +@@ -8591,6 +8609,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[]) { +@@ -9060,7 +9082,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.15/alsa-hda-via-fix-missing-beep-setup.patch b/queue-5.15/alsa-hda-via-fix-missing-beep-setup.patch new file mode 100644 index 00000000000..ea4eafd6fdd --- /dev/null +++ b/queue-5.15/alsa-hda-via-fix-missing-beep-setup.patch @@ -0,0 +1,41 @@ +From c7807b27d510e5aa53c8a120cfc02c33c24ebb5f Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 20 Jun 2022 12:40:08 +0200 +Subject: ALSA: hda/via: Fix missing beep setup + +From: Takashi Iwai + +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: +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 +Signed-off-by: Greg Kroah-Hartman +--- + 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.15/random-quiet-urandom-warning-ratelimit-suppression-message.patch b/queue-5.15/random-quiet-urandom-warning-ratelimit-suppression-message.patch new file mode 100644 index 00000000000..f5f07d2e0dd --- /dev/null +++ b/queue-5.15/random-quiet-urandom-warning-ratelimit-suppression-message.patch @@ -0,0 +1,72 @@ +From c01d4d0a82b71857be7449380338bc53dde2da92 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Thu, 16 Jun 2022 15:00:51 +0200 +Subject: random: quiet urandom warning ratelimit suppression message + +From: Jason A. Donenfeld + +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 +Reported-by: Ron Economos +Tested-by: Ron Economos +Signed-off-by: Jason A. Donenfeld +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -88,7 +88,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.15/random-schedule-mix_interrupt_randomness-less-often.patch b/queue-5.15/random-schedule-mix_interrupt_randomness-less-often.patch new file mode 100644 index 00000000000..8a581a5e151 --- /dev/null +++ b/queue-5.15/random-schedule-mix_interrupt_randomness-less-often.patch @@ -0,0 +1,56 @@ +From 534d2eaf1970274150596fdd2bf552721e65d6b2 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Thu, 16 Jun 2022 02:03:12 +0200 +Subject: random: schedule mix_interrupt_randomness() less often + +From: Jason A. Donenfeld + +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 +Acked-by: Sebastian Andrzej Siewior +Signed-off-by: Jason A. Donenfeld +Signed-off-by: Greg Kroah-Hartman +--- + drivers/char/random.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -1000,7 +1000,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)) diff --git a/queue-5.15/series b/queue-5.15/series index e69de29bb2d..84f6f3950e7 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -0,0 +1,9 @@ +random-schedule-mix_interrupt_randomness-less-often.patch +random-quiet-urandom-warning-ratelimit-suppression-message.patch +alsa-hda-via-fix-missing-beep-setup.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 -- 2.47.3