]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Oct 2024 11:57:09 +0000 (13:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Oct 2024 11:57:09 +0000 (13:57 +0200)
added patches:
iio-magnetometer-ak8975-fix-unexpected-device-error.patch
libbpf-ensure-undefined-bpf_attr-field-stays-0.patch
pci-pm-mark-devices-disconnected-if-upstream-pcie-link-is-down-on-resume.patch
perf-arm-cmn-fail-dtc-counter-allocation-correctly.patch
powerpc-allow-config_ppc64_big_endian_elf_abi_v2-with-ld.lld-15.patch
usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch

queue-6.1/iio-magnetometer-ak8975-fix-unexpected-device-error.patch [new file with mode: 0644]
queue-6.1/libbpf-ensure-undefined-bpf_attr-field-stays-0.patch [new file with mode: 0644]
queue-6.1/pci-pm-mark-devices-disconnected-if-upstream-pcie-link-is-down-on-resume.patch [new file with mode: 0644]
queue-6.1/perf-arm-cmn-fail-dtc-counter-allocation-correctly.patch [new file with mode: 0644]
queue-6.1/powerpc-allow-config_ppc64_big_endian_elf_abi_v2-with-ld.lld-15.patch [new file with mode: 0644]
queue-6.1/series
queue-6.1/usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch [new file with mode: 0644]

diff --git a/queue-6.1/iio-magnetometer-ak8975-fix-unexpected-device-error.patch b/queue-6.1/iio-magnetometer-ak8975-fix-unexpected-device-error.patch
new file mode 100644 (file)
index 0000000..0168650
--- /dev/null
@@ -0,0 +1,82 @@
+From 848f68c760ab1e14a9046ea6e45e3304ab9fa50b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= <git@apitzsch.eu>
+Date: Sun, 1 Oct 2023 18:09:56 +0200
+Subject: iio: magnetometer: ak8975: Fix 'Unexpected device' error
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: AndrĂ© Apitzsch <git@apitzsch.eu>
+
+commit 848f68c760ab1e14a9046ea6e45e3304ab9fa50b upstream.
+
+Explicity specify array indices to fix mapping between
+asahi_compass_chipset and ak_def_array.
+While at it, remove unneeded AKXXXX.
+
+Fixes: 4f9ea93afde1 ("iio: magnetometer: ak8975: Convert enum->pointer for data in the match tables")
+Signed-off-by: AndrĂ© Apitzsch <git@apitzsch.eu>
+Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Link: https://lore.kernel.org/r/20231001-ak_magnetometer-v1-1-09bf3b8798a3@apitzsch.eu
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/magnetometer/ak8975.c |   11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+--- a/drivers/iio/magnetometer/ak8975.c
++++ b/drivers/iio/magnetometer/ak8975.c
+@@ -204,7 +204,6 @@ static long ak09912_raw_to_gauss(u16 dat
+ /* Compatible Asahi Kasei Compass parts */
+ enum asahi_compass_chipset {
+-      AKXXXX          = 0,
+       AK8975,
+       AK8963,
+       AK09911,
+@@ -248,7 +247,7 @@ struct ak_def {
+ };
+ static const struct ak_def ak_def_array[] = {
+-      {
++      [AK8975] = {
+               .type = AK8975,
+               .raw_to_gauss = ak8975_raw_to_gauss,
+               .range = 4096,
+@@ -273,7 +272,7 @@ static const struct ak_def ak_def_array[
+                       AK8975_REG_HYL,
+                       AK8975_REG_HZL},
+       },
+-      {
++      [AK8963] = {
+               .type = AK8963,
+               .raw_to_gauss = ak8963_09911_raw_to_gauss,
+               .range = 8190,
+@@ -298,7 +297,7 @@ static const struct ak_def ak_def_array[
+                       AK8975_REG_HYL,
+                       AK8975_REG_HZL},
+       },
+-      {
++      [AK09911] = {
+               .type = AK09911,
+               .raw_to_gauss = ak8963_09911_raw_to_gauss,
+               .range = 8192,
+@@ -323,7 +322,7 @@ static const struct ak_def ak_def_array[
+                       AK09912_REG_HYL,
+                       AK09912_REG_HZL},
+       },
+-      {
++      [AK09912] = {
+               .type = AK09912,
+               .raw_to_gauss = ak09912_raw_to_gauss,
+               .range = 32752,
+@@ -348,7 +347,7 @@ static const struct ak_def ak_def_array[
+                       AK09912_REG_HYL,
+                       AK09912_REG_HZL},
+       },
+-      {
++      [AK09916] = {
+               .type = AK09916,
+               .raw_to_gauss = ak09912_raw_to_gauss,
+               .range = 32752,
diff --git a/queue-6.1/libbpf-ensure-undefined-bpf_attr-field-stays-0.patch b/queue-6.1/libbpf-ensure-undefined-bpf_attr-field-stays-0.patch
new file mode 100644 (file)
index 0000000..4fd11ee
--- /dev/null
@@ -0,0 +1,45 @@
+From c9f115564561af63db662791e9a35fcf1dfefd2a Mon Sep 17 00:00:00 2001
+From: Martin KaFai Lau <martin.lau@kernel.org>
+Date: Wed, 24 Jan 2024 14:44:18 -0800
+Subject: libbpf: Ensure undefined bpf_attr field stays 0
+
+From: Martin KaFai Lau <martin.lau@kernel.org>
+
+commit c9f115564561af63db662791e9a35fcf1dfefd2a upstream.
+
+The commit 9e926acda0c2 ("libbpf: Find correct module BTFs for struct_ops maps and progs.")
+sets a newly added field (value_type_btf_obj_fd) to -1 in libbpf when
+the caller of the libbpf's bpf_map_create did not define this field by
+passing a NULL "opts" or passing in a "opts" that does not cover this
+new field. OPT_HAS(opts, field) is used to decide if the field is
+defined or not:
+
+       ((opts) && opts->sz >= offsetofend(typeof(*(opts)), field))
+
+Once OPTS_HAS decided the field is not defined, that field should
+be set to 0. For this particular new field (value_type_btf_obj_fd),
+its corresponding map_flags "BPF_F_VTYPE_BTF_OBJ_FD" is not set.
+Thus, the kernel does not treat it as an fd field.
+
+Fixes: 9e926acda0c2 ("libbpf: Find correct module BTFs for struct_ops maps and progs.")
+Reported-by: Andrii Nakryiko <andrii@kernel.org>
+Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
+Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
+Link: https://lore.kernel.org/bpf/20240124224418.2905133-1-martin.lau@linux.dev
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/lib/bpf/bpf.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/lib/bpf/bpf.c
++++ b/tools/lib/bpf/bpf.c
+@@ -192,7 +192,7 @@ int bpf_map_create(enum bpf_map_type map
+       attr.btf_key_type_id = OPTS_GET(opts, btf_key_type_id, 0);
+       attr.btf_value_type_id = OPTS_GET(opts, btf_value_type_id, 0);
+       attr.btf_vmlinux_value_type_id = OPTS_GET(opts, btf_vmlinux_value_type_id, 0);
+-      attr.value_type_btf_obj_fd = OPTS_GET(opts, value_type_btf_obj_fd, -1);
++      attr.value_type_btf_obj_fd = OPTS_GET(opts, value_type_btf_obj_fd, 0);
+       attr.inner_map_fd = OPTS_GET(opts, inner_map_fd, 0);
+       attr.map_flags = OPTS_GET(opts, map_flags, 0);
diff --git a/queue-6.1/pci-pm-mark-devices-disconnected-if-upstream-pcie-link-is-down-on-resume.patch b/queue-6.1/pci-pm-mark-devices-disconnected-if-upstream-pcie-link-is-down-on-resume.patch
new file mode 100644 (file)
index 0000000..6a7c0b8
--- /dev/null
@@ -0,0 +1,77 @@
+From c82458101d5490230d735caecce14c9c27b1010c Mon Sep 17 00:00:00 2001
+From: Mika Westerberg <mika.westerberg@linux.intel.com>
+Date: Mon, 18 Sep 2023 08:30:41 +0300
+Subject: PCI/PM: Mark devices disconnected if upstream PCIe link is down on resume
+
+From: Mika Westerberg <mika.westerberg@linux.intel.com>
+
+commit c82458101d5490230d735caecce14c9c27b1010c upstream.
+
+Mark Blakeney reported that when suspending system with a Thunderbolt
+dock connected and then unplugging the dock before resume (which is
+pretty normal flow with laptops), resuming takes long time.
+
+What happens is that the PCIe link from the root port to the PCIe switch
+inside the Thunderbolt device does not train (as expected, the link is
+unplugged):
+
+  pcieport 0000:00:07.2: restoring config space at offset 0x24 (was 0x3bf12001, writing 0x3bf12001)
+  pcieport 0000:00:07.0: waiting 100 ms for downstream link
+  pcieport 0000:01:00.0: not ready 1023ms after resume; giving up
+
+However, at this point we still try to resume the devices below that
+unplugged link:
+
+  pcieport 0000:01:00.0: Unable to change power state from D3cold to D0, device inaccessible
+  ...
+  pcieport 0000:01:00.0: restoring config space at offset 0x38 (was 0xffffffff, writing 0x0)
+  ...
+  pcieport 0000:02:02.0: waiting 100 ms for downstream link, after activation
+
+And this is the link from PCIe switch downstream port to the xHCI on the
+dock:
+
+  xhci_hcd 0000:03:00.0: not ready 65535ms after resume; giving up
+  xhci_hcd 0000:03:00.0: Unable to change power state from D3cold to D0, device inaccessible
+  xhci_hcd 0000:03:00.0: restoring config space at offset 0x3c (was 0xffffffff, writing 0x1ff)
+
+This ends up slowing down the resume time considerably. For this reason
+mark these devices as disconnected if the link above them did not train
+properly.
+
+Fixes: e8b908146d44 ("PCI/PM: Increase wait time after resume")
+Link: https://lore.kernel.org/r/20230918053041.1018876-1-mika.westerberg@linux.intel.com
+Reported-by: Mark Blakeney <mark.blakeney@bullet-systems.net>
+Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217915
+Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Reviewed-by: Lukas Wunner <lukas@wunner.de>
+Cc: stable@vger.kernel.org     # v6.4+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pci/pci-driver.c |   14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+--- a/drivers/pci/pci-driver.c
++++ b/drivers/pci/pci-driver.c
+@@ -579,7 +579,19 @@ static void pci_pm_default_resume_early(
+ static void pci_pm_bridge_power_up_actions(struct pci_dev *pci_dev)
+ {
+-      pci_bridge_wait_for_secondary_bus(pci_dev, "resume");
++      int ret;
++
++      ret = pci_bridge_wait_for_secondary_bus(pci_dev, "resume");
++      if (ret) {
++              /*
++               * The downstream link failed to come up, so mark the
++               * devices below as disconnected to make sure we don't
++               * attempt to resume them.
++               */
++              pci_walk_bus(pci_dev->subordinate, pci_dev_set_disconnected,
++                           NULL);
++              return;
++      }
+       /*
+        * When powering on a bridge from D3cold, the whole hierarchy may be
diff --git a/queue-6.1/perf-arm-cmn-fail-dtc-counter-allocation-correctly.patch b/queue-6.1/perf-arm-cmn-fail-dtc-counter-allocation-correctly.patch
new file mode 100644 (file)
index 0000000..c234419
--- /dev/null
@@ -0,0 +1,38 @@
+From 1892fe103c3a20fced306c8dafa74f7f6d4ea0a3 Mon Sep 17 00:00:00 2001
+From: Robin Murphy <robin.murphy@arm.com>
+Date: Mon, 11 Dec 2023 19:27:28 +0000
+Subject: perf/arm-cmn: Fail DTC counter allocation correctly
+
+From: Robin Murphy <robin.murphy@arm.com>
+
+commit 1892fe103c3a20fced306c8dafa74f7f6d4ea0a3 upstream.
+
+Calling arm_cmn_event_clear() before all DTC indices are allocated is
+wrong, and can lead to arm_cmn_event_add() erroneously clearing live
+counters from full DTCs where allocation fails. Since the DTC counters
+are only updated by arm_cmn_init_counter() after all DTC and DTM
+allocations succeed, nothing actually needs cleaning up in this case
+anyway, and it should just return directly as it did before.
+
+Fixes: 7633ec2c262f ("perf/arm-cmn: Rework DTC counters (again)")
+Signed-off-by: Robin Murphy <robin.murphy@arm.com>
+Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
+Acked-by: Will Deacon <will@kernel.org>
+Link: https://lore.kernel.org/r/ed589c0d8e4130dc68b8ad1625226d28bdc185d4.1702322847.git.robin.murphy@arm.com
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/perf/arm-cmn.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/perf/arm-cmn.c
++++ b/drivers/perf/arm-cmn.c
+@@ -1671,7 +1671,7 @@ static int arm_cmn_event_add(struct perf
+                       idx = 0;
+                       while (cmn->dtc[j].counters[idx])
+                               if (++idx == CMN_DT_NUM_COUNTERS)
+-                                      goto free_dtms;
++                                      return -ENOSPC;
+               }
+               hw->dtc_idx[j] = idx;
+       }
diff --git a/queue-6.1/powerpc-allow-config_ppc64_big_endian_elf_abi_v2-with-ld.lld-15.patch b/queue-6.1/powerpc-allow-config_ppc64_big_endian_elf_abi_v2-with-ld.lld-15.patch
new file mode 100644 (file)
index 0000000..f5e9e48
--- /dev/null
@@ -0,0 +1,45 @@
+From a11334d8327b3fd7987cbfb38e956a44c722d88f Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Wed, 15 Feb 2023 11:41:17 -0700
+Subject: powerpc: Allow CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 with ld.lld 15+
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit a11334d8327b3fd7987cbfb38e956a44c722d88f upstream.
+
+Commit 5017b4594672 ("powerpc/64: Option to build big-endian with ELFv2
+ABI") restricted the ELFv2 ABI configuration such that it can only be
+selected when linking with ld.bfd, due to lack of testing with LLVM.
+
+ld.lld can link ELFv2 kernels without any issues; in fact, it is the
+only ABI that ld.lld supports, as ELFv1 is not supported in ld.lld.
+
+As this has not seen a ton of real world testing yet, be conservative
+and only allow this option to be selected with the latest stable release
+of LLVM (15.x) and newer.
+
+While in the area, remove 'default n', as it is unnecessary to specify
+it explicitly since all boolean/tristate configuration symbols default
+to n.
+
+Tested-by: "Erhard F." <erhard_f@mailbox.org>
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://msgid.link/20230118-ppc64-elfv2-llvm-v1-3-b9e2ec9da11d@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/Kconfig |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/arch/powerpc/Kconfig
++++ b/arch/powerpc/Kconfig
+@@ -593,8 +593,7 @@ config PPC64_BIG_ENDIAN_ELF_ABI_V2
+       bool "Build big-endian kernel using ELF ABI V2 (EXPERIMENTAL)"
+       depends on PPC64 && CPU_BIG_ENDIAN
+       depends on CC_HAS_ELFV2
+-      depends on LD_IS_BFD && LD_VERSION >= 22400
+-      default n
++      depends on LD_VERSION >= 22400 || LLD_VERSION >= 150000
+       help
+         This builds the kernel image using the "Power Architecture 64-Bit ELF
+         V2 ABI Specification", which has a reduced stack overhead and faster
index b83713f06a6b816e703fac87a8e82106e3a15eb1..1861431e036cdf728a94324b0023d52dd90020fa 100644 (file)
@@ -380,3 +380,9 @@ module-fix-kcov-ignored-file-name.patch
 mm-damon-vaddr-protect-vma-traversal-in-__damon_va_thre_regions-with-rcu-read-lock.patch
 i2c-aspeed-update-the-stop-sw-state-when-the-bus-recovery-occurs.patch
 i2c-isch-add-missed-else.patch
+usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch
+perf-arm-cmn-fail-dtc-counter-allocation-correctly.patch
+iio-magnetometer-ak8975-fix-unexpected-device-error.patch
+libbpf-ensure-undefined-bpf_attr-field-stays-0.patch
+powerpc-allow-config_ppc64_big_endian_elf_abi_v2-with-ld.lld-15.patch
+pci-pm-mark-devices-disconnected-if-upstream-pcie-link-is-down-on-resume.patch
diff --git a/queue-6.1/usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch b/queue-6.1/usb-yurex-fix-inconsistent-locking-bug-in-yurex_read.patch
new file mode 100644 (file)
index 0000000..ac0528a
--- /dev/null
@@ -0,0 +1,36 @@
+From e7d3b9f28654dbfce7e09f8028210489adaf6a33 Mon Sep 17 00:00:00 2001
+From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
+Date: Mon, 18 Dec 2023 22:36:35 -0800
+Subject: usb: yurex: Fix inconsistent locking bug in yurex_read()
+
+From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
+
+commit e7d3b9f28654dbfce7e09f8028210489adaf6a33 upstream.
+
+Unlock before returning on the error path.
+
+Fixes: 86b20af11e84 ("usb: yurex: Replace snprintf() with the safer scnprintf() variant")
+Reported-by: Dan Carpenter <error27@gmail.com>
+Reported-by: kernel test robot <lkp@intel.com>
+Closes: https://lore.kernel.org/r/202312170252.3udgrIcP-lkp@intel.com/
+Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
+Link: https://lore.kernel.org/r/20231219063639.450994-1-harshit.m.mogalapalli@oracle.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/misc/yurex.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/misc/yurex.c
++++ b/drivers/usb/misc/yurex.c
+@@ -413,8 +413,10 @@ static ssize_t yurex_read(struct file *f
+               return -ENODEV;
+       }
+-      if (WARN_ON_ONCE(dev->bbu > S64_MAX || dev->bbu < S64_MIN))
++      if (WARN_ON_ONCE(dev->bbu > S64_MAX || dev->bbu < S64_MIN)) {
++              mutex_unlock(&dev->io_mutex);
+               return -EIO;
++      }
+       spin_lock_irq(&dev->lock);
+       scnprintf(in_buffer, MAX_S64_STRLEN, "%lld\n", dev->bbu);