]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.15
authorSasha Levin <sashal@kernel.org>
Sat, 26 Oct 2024 15:33:10 +0000 (11:33 -0400)
committerSasha Levin <sashal@kernel.org>
Sat, 26 Oct 2024 15:33:10 +0000 (11:33 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.15/alsa-firewire-lib-avoid-division-by-zero-in-apply_co.patch [new file with mode: 0644]
queue-5.15/alsa-hda-realtek-update-default-depop-procedure.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/alsa-firewire-lib-avoid-division-by-zero-in-apply_co.patch b/queue-5.15/alsa-firewire-lib-avoid-division-by-zero-in-apply_co.patch
new file mode 100644 (file)
index 0000000..ef9067e
--- /dev/null
@@ -0,0 +1,49 @@
+From 5dd4b30236306d1e958d939fbecba8ea7e9638ec Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 18 Oct 2024 09:00:18 +0300
+Subject: ALSA: firewire-lib: Avoid division by zero in
+ apply_constraint_to_size()
+
+From: Andrey Shumilin <shum.sdl@nppct.ru>
+
+[ Upstream commit 72cafe63b35d06b5cfbaf807e90ae657907858da ]
+
+The step variable is initialized to zero. It is changed in the loop,
+but if it's not changed it will remain zero. Add a variable check
+before the division.
+
+The observed behavior was introduced by commit 826b5de90c0b
+("ALSA: firewire-lib: fix insufficient PCM rule for period/buffer size"),
+and it is difficult to show that any of the interval parameters will
+satisfy the snd_interval_test() condition with data from the
+amdtp_rate_table[] table.
+
+Found by Linux Verification Center (linuxtesting.org) with SVACE.
+
+Fixes: 826b5de90c0b ("ALSA: firewire-lib: fix insufficient PCM rule for period/buffer size")
+Signed-off-by: Andrey Shumilin <shum.sdl@nppct.ru>
+Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
+Link: https://patch.msgid.link/20241018060018.1189537-1-shum.sdl@nppct.ru
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/firewire/amdtp-stream.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c
+index 842fe127c5378..b5b3b4d177aaf 100644
+--- a/sound/firewire/amdtp-stream.c
++++ b/sound/firewire/amdtp-stream.c
+@@ -172,6 +172,9 @@ static int apply_constraint_to_size(struct snd_pcm_hw_params *params,
+                       step = max(step, amdtp_syt_intervals[i]);
+       }
++      if (step == 0)
++              return -EINVAL;
++
+       t.min = roundup(s->min, step);
+       t.max = rounddown(s->max, step);
+       t.integer = 1;
+-- 
+2.43.0
+
diff --git a/queue-5.15/alsa-hda-realtek-update-default-depop-procedure.patch b/queue-5.15/alsa-hda-realtek-update-default-depop-procedure.patch
new file mode 100644 (file)
index 0000000..9b0e320
--- /dev/null
@@ -0,0 +1,88 @@
+From 5d9da6fdb6c7d9f9baa1fac1b8c05c4038e19cd0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 23 Oct 2024 16:13:10 +0800
+Subject: ALSA: hda/realtek: Update default depop procedure
+
+From: Kailang Yang <kailang@realtek.com>
+
+[ Upstream commit e3ea2757c312e51bbf62ebc434a6f7df1e3a201f ]
+
+Old procedure has a chance to meet Headphone no output.
+
+Fixes: c2d6af53a43f ("ALSA: hda/realtek - Add default procedure for suspend and resume state")
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Link: https://lore.kernel.org/17b717a0a0b04a77aea4a8ec820cba13@realtek.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/pci/hda/patch_realtek.c | 38 ++++++++++++++++-------------------
+ 1 file changed, 17 insertions(+), 21 deletions(-)
+
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index d76e0a2618afc..4ce2f042c04e7 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -3848,20 +3848,18 @@ static void alc_default_init(struct hda_codec *codec)
+       hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
+-      if (hp_pin_sense)
++      if (hp_pin_sense) {
+               msleep(2);
+-      snd_hda_codec_write(codec, hp_pin, 0,
+-                          AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+-
+-      if (hp_pin_sense)
+-              msleep(85);
++              snd_hda_codec_write(codec, hp_pin, 0,
++                                  AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
+-      snd_hda_codec_write(codec, hp_pin, 0,
+-                          AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
++              msleep(75);
+-      if (hp_pin_sense)
+-              msleep(100);
++              snd_hda_codec_write(codec, hp_pin, 0,
++                                  AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
++              msleep(75);
++      }
+ }
+ static void alc_default_shutup(struct hda_codec *codec)
+@@ -3877,22 +3875,20 @@ static void alc_default_shutup(struct hda_codec *codec)
+       hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
+-      if (hp_pin_sense)
++      if (hp_pin_sense) {
+               msleep(2);
+-      snd_hda_codec_write(codec, hp_pin, 0,
+-                          AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+-
+-      if (hp_pin_sense)
+-              msleep(85);
+-
+-      if (!spec->no_shutup_pins)
+               snd_hda_codec_write(codec, hp_pin, 0,
+-                                  AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
++                                  AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+-      if (hp_pin_sense)
+-              msleep(100);
++              msleep(75);
++              if (!spec->no_shutup_pins)
++                      snd_hda_codec_write(codec, hp_pin, 0,
++                                          AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
++
++              msleep(75);
++      }
+       alc_auto_setup_eapd(codec, false);
+       alc_shutup_pins(codec);
+ }
+-- 
+2.43.0
+
index 07e493aee75a334a4ed29c013374ec7756610d0a..903f80644221e6cc54fe26f68a4917e89e087204 100644 (file)
@@ -61,3 +61,5 @@ net-sched-fix-use-after-free-in-taprio_change.patch
 r8169-avoid-unsolicited-interrupts.patch
 posix-clock-posix-clock-fix-unbalanced-locking-in-pc.patch
 bpf-perf-fix-perf_event_detach_bpf_prog-error-handli.patch
+alsa-firewire-lib-avoid-division-by-zero-in-apply_co.patch
+alsa-hda-realtek-update-default-depop-procedure.patch