]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jul 2023 12:55:53 +0000 (14:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jul 2023 12:55:53 +0000 (14:55 +0200)
added patches:
alsa-hda-realtek-add-quirk-for-clevo-ns70au.patch
alsa-hda-realtek-enable-mute-led-on-hp-laptop-15s-eq2xxx.patch
alsa-hda-realtek-remove-3k-pull-low-procedure.patch
io_uring-fix-io_uring-mmap-by-using-architecture-provided-get_unmapped_area.patch
io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch
series

queue-6.4/alsa-hda-realtek-add-quirk-for-clevo-ns70au.patch [new file with mode: 0644]
queue-6.4/alsa-hda-realtek-enable-mute-led-on-hp-laptop-15s-eq2xxx.patch [new file with mode: 0644]
queue-6.4/alsa-hda-realtek-remove-3k-pull-low-procedure.patch [new file with mode: 0644]
queue-6.4/io_uring-fix-io_uring-mmap-by-using-architecture-provided-get_unmapped_area.patch [new file with mode: 0644]
queue-6.4/io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch [new file with mode: 0644]
queue-6.4/series [new file with mode: 0644]

diff --git a/queue-6.4/alsa-hda-realtek-add-quirk-for-clevo-ns70au.patch b/queue-6.4/alsa-hda-realtek-add-quirk-for-clevo-ns70au.patch
new file mode 100644 (file)
index 0000000..0eeb168
--- /dev/null
@@ -0,0 +1,32 @@
+From c250ef8954eda2024c8861c36e9fc1b589481fe7 Mon Sep 17 00:00:00 2001
+From: Christoffer Sandberg <cs@tuxedo.de>
+Date: Tue, 18 Jul 2023 16:57:22 +0200
+Subject: ALSA: hda/realtek: Add quirk for Clevo NS70AU
+
+From: Christoffer Sandberg <cs@tuxedo.de>
+
+commit c250ef8954eda2024c8861c36e9fc1b589481fe7 upstream.
+
+Fixes headset detection on Clevo NS70AU.
+
+Co-developed-by: Werner Sembach <wse@tuxedocomputers.com>
+Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
+Signed-off-by: Christoffer Sandberg <cs@tuxedo.de>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20230718145722.10592-1-wse@tuxedocomputers.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
+@@ -9647,6 +9647,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
++      SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
diff --git a/queue-6.4/alsa-hda-realtek-enable-mute-led-on-hp-laptop-15s-eq2xxx.patch b/queue-6.4/alsa-hda-realtek-enable-mute-led-on-hp-laptop-15s-eq2xxx.patch
new file mode 100644 (file)
index 0000000..d6ee032
--- /dev/null
@@ -0,0 +1,73 @@
+From 0659400f18c0e6c0c69d74fe5d09e7f6fbbd52a2 Mon Sep 17 00:00:00 2001
+From: Luka Guzenko <l.guzenko@web.de>
+Date: Tue, 18 Jul 2023 18:12:41 +0200
+Subject: ALSA: hda/realtek: Enable Mute LED on HP Laptop 15s-eq2xxx
+
+From: Luka Guzenko <l.guzenko@web.de>
+
+commit 0659400f18c0e6c0c69d74fe5d09e7f6fbbd52a2 upstream.
+
+The HP Laptop 15s-eq2xxx uses ALC236 codec and controls the mute LED using
+COEF 0x07 index 1. No existing quirk covers this configuration.
+Adds a new quirk and enables it for the device.
+
+Signed-off-by: Luka Guzenko <l.guzenko@web.de>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20230718161241.393181-1-l.guzenko@web.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_realtek.c |   21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -4624,6 +4624,21 @@ static void alc236_fixup_hp_mute_led_coe
+       }
+ }
++static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
++                                        const struct hda_fixup *fix, int action)
++{
++      struct alc_spec *spec = codec->spec;
++
++      if (action == HDA_FIXUP_ACT_PRE_PROBE) {
++              spec->mute_led_polarity = 0;
++              spec->mute_led_coef.idx = 0x07;
++              spec->mute_led_coef.mask = 1;
++              spec->mute_led_coef.on = 1;
++              spec->mute_led_coef.off = 0;
++              snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
++      }
++}
++
+ /* turn on/off mic-mute LED per capture hook by coef bit */
+ static int coef_micmute_led_set(struct led_classdev *led_cdev,
+                               enum led_brightness brightness)
+@@ -7134,6 +7149,7 @@ enum {
+       ALC285_FIXUP_HP_GPIO_LED,
+       ALC285_FIXUP_HP_MUTE_LED,
+       ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
++      ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
+       ALC236_FIXUP_HP_GPIO_LED,
+       ALC236_FIXUP_HP_MUTE_LED,
+       ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
+@@ -8557,6 +8573,10 @@ static const struct hda_fixup alc269_fix
+               .type = HDA_FIXUP_FUNC,
+               .v.func = alc285_fixup_hp_spectre_x360_mute_led,
+       },
++      [ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
++          .type = HDA_FIXUP_FUNC,
++          .v.func = alc236_fixup_hp_mute_led_coefbit2,
++      },
+       [ALC236_FIXUP_HP_GPIO_LED] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = alc236_fixup_hp_gpio_led,
+@@ -9441,6 +9461,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
+       SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
+       SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
++      SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
+       SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
+       SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
+       SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
diff --git a/queue-6.4/alsa-hda-realtek-remove-3k-pull-low-procedure.patch b/queue-6.4/alsa-hda-realtek-remove-3k-pull-low-procedure.patch
new file mode 100644 (file)
index 0000000..3eb0d00
--- /dev/null
@@ -0,0 +1,66 @@
+From 69ea4c9d02b7947cdd612335a61cc1a02e544ccd Mon Sep 17 00:00:00 2001
+From: Kailang Yang <kailang@realtek.com>
+Date: Thu, 13 Jul 2023 15:57:13 +0800
+Subject: ALSA: hda/realtek - remove 3k pull low procedure
+
+From: Kailang Yang <kailang@realtek.com>
+
+commit 69ea4c9d02b7947cdd612335a61cc1a02e544ccd upstream.
+
+This was the ALC283 depop procedure.
+Maybe this procedure wasn't suitable with new codec.
+So, let us remove it. But HP 15z-fc000 must do 3k pull low. If it
+reboot with plugged headset,
+it will have errors show don't find codec error messages. Run 3k pull
+low will solve issues.
+So, let AMD chipset will run this for workarround.
+
+Fixes: 5aec98913095 ("ALSA: hda/realtek - ALC236 headset MIC recording issue")
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Cc: <stable@vger.kernel.org>
+Reported-by: Joseph C. Sible <josephcsible@gmail.com>
+Closes: https://lore.kernel.org/r/CABpewhE4REgn9RJZduuEU6Z_ijXNeQWnrxO1tg70Gkw=F8qNYg@mail.gmail.com/
+Link: https://lore.kernel.org/r/4678992299664babac4403d9978e7ba7@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 |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -122,6 +122,7 @@ struct alc_spec {
+       unsigned int ultra_low_power:1;
+       unsigned int has_hs_key:1;
+       unsigned int no_internal_mic_pin:1;
++      unsigned int en_3kpull_low:1;
+       /* for PLL fix */
+       hda_nid_t pll_nid;
+@@ -3622,6 +3623,7 @@ static void alc256_shutup(struct hda_cod
+       if (!hp_pin)
+               hp_pin = 0x21;
++      alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
+       hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
+       if (hp_pin_sense)
+@@ -3638,8 +3640,7 @@ static void alc256_shutup(struct hda_cod
+       /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
+        * when booting with headset plugged. So skip setting it for the codec alc257
+        */
+-      if (codec->core.vendor_id != 0x10ec0236 &&
+-          codec->core.vendor_id != 0x10ec0257)
++      if (spec->en_3kpull_low)
+               alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
+       if (!spec->no_shutup_pins)
+@@ -10601,6 +10602,8 @@ static int patch_alc269(struct hda_codec
+               spec->shutup = alc256_shutup;
+               spec->init_hook = alc256_init;
+               spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
++              if (codec->bus->pci->vendor == PCI_VENDOR_ID_AMD)
++                      spec->en_3kpull_low = true;
+               break;
+       case 0x10ec0257:
+               spec->codec_variant = ALC269_TYPE_ALC257;
diff --git a/queue-6.4/io_uring-fix-io_uring-mmap-by-using-architecture-provided-get_unmapped_area.patch b/queue-6.4/io_uring-fix-io_uring-mmap-by-using-architecture-provided-get_unmapped_area.patch
new file mode 100644 (file)
index 0000000..3fa307b
--- /dev/null
@@ -0,0 +1,134 @@
+From 32832a407a7178eec3215fad9b1a3298c14b0d69 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Fri, 21 Jul 2023 17:24:31 +0200
+Subject: io_uring: Fix io_uring mmap() by using architecture-provided get_unmapped_area()
+
+From: Helge Deller <deller@gmx.de>
+
+commit 32832a407a7178eec3215fad9b1a3298c14b0d69 upstream.
+
+The io_uring testcase is broken on IA-64 since commit d808459b2e31
+("io_uring: Adjust mapping wrt architecture aliasing requirements").
+
+The reason is, that this commit introduced an own architecture
+independend get_unmapped_area() search algorithm which finds on IA-64 a
+memory region which is outside of the regular memory region used for
+shared userspace mappings and which can't be used on that platform
+due to aliasing.
+
+To avoid similar problems on IA-64 and other platforms in the future,
+it's better to switch back to the architecture-provided
+get_unmapped_area() function and adjust the needed input parameters
+before the call. Beside fixing the issue, the function now becomes
+easier to understand and maintain.
+
+This patch has been successfully tested with the io_uring testcase on
+physical x86-64, ppc64le, IA-64 and PA-RISC machines. On PA-RISC the LTP
+mmmap testcases did not report any regressions.
+
+Cc: stable@vger.kernel.org # 6.4
+Signed-off-by: Helge Deller <deller@gmx.de>
+Reported-by: matoro <matoro_mailinglist_kernel@matoro.tk>
+Fixes: d808459b2e31 ("io_uring: Adjust mapping wrt architecture aliasing requirements")
+Link: https://lore.kernel.org/r/20230721152432.196382-2-deller@gmx.de
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/parisc/kernel/sys_parisc.c |   15 +++++++++-----
+ io_uring/io_uring.c             |   42 ++++++++++++++++------------------------
+ 2 files changed, 27 insertions(+), 30 deletions(-)
+
+--- a/arch/parisc/kernel/sys_parisc.c
++++ b/arch/parisc/kernel/sys_parisc.c
+@@ -26,12 +26,17 @@
+ #include <linux/compat.h>
+ /*
+- * Construct an artificial page offset for the mapping based on the physical
++ * Construct an artificial page offset for the mapping based on the virtual
+  * address of the kernel file mapping variable.
++ * If filp is zero the calculated pgoff value aliases the memory of the given
++ * address. This is useful for io_uring where the mapping shall alias a kernel
++ * address and a userspace adress where both the kernel and the userspace
++ * access the same memory region.
+  */
+-#define GET_FILP_PGOFF(filp)          \
+-      (filp ? (((unsigned long) filp->f_mapping) >> 8)        \
+-               & ((SHM_COLOUR-1) >> PAGE_SHIFT) : 0UL)
++#define GET_FILP_PGOFF(filp, addr)            \
++      ((filp ? (((unsigned long) filp->f_mapping) >> 8)       \
++               & ((SHM_COLOUR-1) >> PAGE_SHIFT) : 0UL)        \
++        + (addr >> PAGE_SHIFT))
+ static unsigned long shared_align_offset(unsigned long filp_pgoff,
+                                        unsigned long pgoff)
+@@ -111,7 +116,7 @@ static unsigned long arch_get_unmapped_a
+       do_color_align = 0;
+       if (filp || (flags & MAP_SHARED))
+               do_color_align = 1;
+-      filp_pgoff = GET_FILP_PGOFF(filp);
++      filp_pgoff = GET_FILP_PGOFF(filp, addr);
+       if (flags & MAP_FIXED) {
+               /* Even MAP_FIXED mappings must reside within TASK_SIZE */
+--- a/io_uring/io_uring.c
++++ b/io_uring/io_uring.c
+@@ -3433,8 +3433,6 @@ static unsigned long io_uring_mmu_get_un
+                       unsigned long addr, unsigned long len,
+                       unsigned long pgoff, unsigned long flags)
+ {
+-      const unsigned long mmap_end = arch_get_mmap_end(addr, len, flags);
+-      struct vm_unmapped_area_info info;
+       void *ptr;
+       /*
+@@ -3449,32 +3447,26 @@ static unsigned long io_uring_mmu_get_un
+       if (IS_ERR(ptr))
+               return -ENOMEM;
+-      info.flags = VM_UNMAPPED_AREA_TOPDOWN;
+-      info.length = len;
+-      info.low_limit = max(PAGE_SIZE, mmap_min_addr);
+-      info.high_limit = arch_get_mmap_base(addr, current->mm->mmap_base);
++      /*
++       * Some architectures have strong cache aliasing requirements.
++       * For such architectures we need a coherent mapping which aliases
++       * kernel memory *and* userspace memory. To achieve that:
++       * - use a NULL file pointer to reference physical memory, and
++       * - use the kernel virtual address of the shared io_uring context
++       *   (instead of the userspace-provided address, which has to be 0UL
++       *   anyway).
++       * For architectures without such aliasing requirements, the
++       * architecture will return any suitable mapping because addr is 0.
++       */
++      filp = NULL;
++      flags |= MAP_SHARED;
++      pgoff = 0;      /* has been translated to ptr above */
+ #ifdef SHM_COLOUR
+-      info.align_mask = PAGE_MASK & (SHM_COLOUR - 1UL);
++      addr = (uintptr_t) ptr;
+ #else
+-      info.align_mask = PAGE_MASK & (SHMLBA - 1UL);
++      addr = 0UL;
+ #endif
+-      info.align_offset = (unsigned long) ptr;
+-
+-      /*
+-       * A failed mmap() very likely causes application failure,
+-       * so fall back to the bottom-up function here. This scenario
+-       * can happen with large stack limits and large mmap()
+-       * allocations.
+-       */
+-      addr = vm_unmapped_area(&info);
+-      if (offset_in_page(addr)) {
+-              info.flags = 0;
+-              info.low_limit = TASK_UNMAPPED_BASE;
+-              info.high_limit = mmap_end;
+-              addr = vm_unmapped_area(&info);
+-      }
+-
+-      return addr;
++      return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags);
+ }
+ #else /* !CONFIG_MMU */
diff --git a/queue-6.4/io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch b/queue-6.4/io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch
new file mode 100644 (file)
index 0000000..7b407db
--- /dev/null
@@ -0,0 +1,39 @@
+From a9be202269580ca611c6cebac90eaf1795497800 Mon Sep 17 00:00:00 2001
+From: Jens Axboe <axboe@kernel.dk>
+Date: Thu, 20 Jul 2023 13:16:53 -0600
+Subject: io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq
+
+From: Jens Axboe <axboe@kernel.dk>
+
+commit a9be202269580ca611c6cebac90eaf1795497800 upstream.
+
+io-wq assumes that an issue is blocking, but it may not be if the
+request type has asked for a non-blocking attempt. If we get
+-EAGAIN for that case, then we need to treat it as a final result
+and not retry or arm poll for it.
+
+Cc: stable@vger.kernel.org # 5.10+
+Link: https://github.com/axboe/liburing/issues/897
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ io_uring/io_uring.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/io_uring/io_uring.c
++++ b/io_uring/io_uring.c
+@@ -2032,6 +2032,14 @@ fail:
+               ret = io_issue_sqe(req, issue_flags);
+               if (ret != -EAGAIN)
+                       break;
++
++              /*
++               * If REQ_F_NOWAIT is set, then don't wait or retry with
++               * poll. -EAGAIN is final for that case.
++               */
++              if (req->flags & REQ_F_NOWAIT)
++                      break;
++
+               /*
+                * We can get EAGAIN for iopolled IO even though we're
+                * forcing a sync submission from here, since we can't
diff --git a/queue-6.4/series b/queue-6.4/series
new file mode 100644 (file)
index 0000000..6eb754b
--- /dev/null
@@ -0,0 +1,5 @@
+io_uring-treat-eagain-for-req_f_nowait-as-final-for-io-wq.patch
+io_uring-fix-io_uring-mmap-by-using-architecture-provided-get_unmapped_area.patch
+alsa-hda-realtek-remove-3k-pull-low-procedure.patch
+alsa-hda-realtek-add-quirk-for-clevo-ns70au.patch
+alsa-hda-realtek-enable-mute-led-on-hp-laptop-15s-eq2xxx.patch