]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Feb 2025 12:35:27 +0000 (13:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Feb 2025 12:35:27 +0000 (13:35 +0100)
added patches:
arm64-handle-.arm.attributes-section-in-linker-scripts.patch
mlxsw-add-return-value-check-for-mlxsw_sp_port_get_stats_raw.patch
mmc-mtk-sd-fix-register-settings-for-hs400-es-mode.patch
regmap-irq-add-missing-kfree.patch

queue-6.1/arm64-handle-.arm.attributes-section-in-linker-scripts.patch [new file with mode: 0644]
queue-6.1/mlxsw-add-return-value-check-for-mlxsw_sp_port_get_stats_raw.patch [new file with mode: 0644]
queue-6.1/mmc-mtk-sd-fix-register-settings-for-hs400-es-mode.patch [new file with mode: 0644]
queue-6.1/regmap-irq-add-missing-kfree.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/arm64-handle-.arm.attributes-section-in-linker-scripts.patch b/queue-6.1/arm64-handle-.arm.attributes-section-in-linker-scripts.patch
new file mode 100644 (file)
index 0000000..afd66a4
--- /dev/null
@@ -0,0 +1,57 @@
+From ca0f4fe7cf7183bfbdc67ca2de56ae1fc3a8db2b Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Thu, 6 Feb 2025 10:21:38 -0700
+Subject: arm64: Handle .ARM.attributes section in linker scripts
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit ca0f4fe7cf7183bfbdc67ca2de56ae1fc3a8db2b upstream.
+
+A recent LLVM commit [1] started generating an .ARM.attributes section
+similar to the one that exists for 32-bit, which results in orphan
+section warnings (or errors if CONFIG_WERROR is enabled) from the linker
+because it is not handled in the arm64 linker scripts.
+
+  ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes'
+  ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes'
+
+  ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes'
+  ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes'
+  ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes'
+
+Discard the new sections in the necessary linker scripts to resolve the
+warnings, as the kernel and vDSO do not need to retain it, similar to
+the .note.gnu.property section.
+
+Cc: stable@vger.kernel.org
+Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement")
+Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1]
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Link: https://lore.kernel.org/r/20250206-arm64-handle-arm-attributes-in-linker-script-v3-1-d53d169913eb@kernel.org
+Signed-off-by: Will Deacon <will@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/kernel/vdso/vdso.lds.S |    1 +
+ arch/arm64/kernel/vmlinux.lds.S   |    1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/arch/arm64/kernel/vdso/vdso.lds.S
++++ b/arch/arm64/kernel/vdso/vdso.lds.S
+@@ -38,6 +38,7 @@ SECTIONS
+        */
+       /DISCARD/       : {
+               *(.note.GNU-stack .note.gnu.property)
++              *(.ARM.attributes)
+       }
+       .note           : { *(.note.*) }                :text   :note
+--- a/arch/arm64/kernel/vmlinux.lds.S
++++ b/arch/arm64/kernel/vmlinux.lds.S
+@@ -149,6 +149,7 @@ SECTIONS
+       /DISCARD/ : {
+               *(.interp .dynamic)
+               *(.dynsym .dynstr .hash .gnu.hash)
++              *(.ARM.attributes)
+       }
+       . = KIMAGE_VADDR;
diff --git a/queue-6.1/mlxsw-add-return-value-check-for-mlxsw_sp_port_get_stats_raw.patch b/queue-6.1/mlxsw-add-return-value-check-for-mlxsw_sp_port_get_stats_raw.patch
new file mode 100644 (file)
index 0000000..4435c4d
--- /dev/null
@@ -0,0 +1,38 @@
+From fee5d688940690cc845937459e340e4e02598e90 Mon Sep 17 00:00:00 2001
+From: Wentao Liang <vulab@iscas.ac.cn>
+Date: Wed, 12 Feb 2025 23:23:11 +0800
+Subject: mlxsw: Add return value check for mlxsw_sp_port_get_stats_raw()
+
+From: Wentao Liang <vulab@iscas.ac.cn>
+
+commit fee5d688940690cc845937459e340e4e02598e90 upstream.
+
+Add a check for the return value of mlxsw_sp_port_get_stats_raw()
+in __mlxsw_sp_port_get_stats(). If mlxsw_sp_port_get_stats_raw()
+returns an error, exit the function to prevent further processing
+with potentially invalid data.
+
+Fixes: 614d509aa1e7 ("mlxsw: Move ethtool_ops to spectrum_ethtool.c")
+Cc: stable@vger.kernel.org # 5.9+
+Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
+Reviewed-by: Petr Machata <petrm@nvidia.com>
+Link: https://patch.msgid.link/20250212152311.1332-1-vulab@iscas.ac.cn
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c
++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c
+@@ -768,7 +768,9 @@ static void __mlxsw_sp_port_get_stats(st
+       err = mlxsw_sp_get_hw_stats_by_group(&hw_stats, &len, grp);
+       if (err)
+               return;
+-      mlxsw_sp_port_get_stats_raw(dev, grp, prio, ppcnt_pl);
++      err = mlxsw_sp_port_get_stats_raw(dev, grp, prio, ppcnt_pl);
++      if (err)
++              return;
+       for (i = 0; i < len; i++) {
+               data[data_index + i] = hw_stats[i].getter(ppcnt_pl);
+               if (!hw_stats[i].cells_bytes)
diff --git a/queue-6.1/mmc-mtk-sd-fix-register-settings-for-hs400-es-mode.patch b/queue-6.1/mmc-mtk-sd-fix-register-settings-for-hs400-es-mode.patch
new file mode 100644 (file)
index 0000000..955d71a
--- /dev/null
@@ -0,0 +1,104 @@
+From 3e68abf2b9cebe76c6cd4b1aca8e95cd671035a3 Mon Sep 17 00:00:00 2001
+From: Andy-ld Lu <andy-ld.lu@mediatek.com>
+Date: Thu, 23 Jan 2025 17:26:01 +0800
+Subject: mmc: mtk-sd: Fix register settings for hs400(es) mode
+
+From: Andy-ld Lu <andy-ld.lu@mediatek.com>
+
+commit 3e68abf2b9cebe76c6cd4b1aca8e95cd671035a3 upstream.
+
+For hs400(es) mode, the 'hs400-ds-delay' is typically configured in the
+dts. However, some projects may only define 'mediatek,hs400-ds-dly3',
+which can lead to initialization failures in hs400es mode. CMD13 reported
+response crc error in the mmc_switch_status() just after switching to
+hs400es mode.
+
+[    1.914038][   T82] mmc0: mmc_select_hs400es failed, error -84
+[    1.914954][   T82] mmc0: error -84 whilst initialising MMC card
+
+Currently, the hs400_ds_dly3 value is set within the tuning function. This
+means that the PAD_DS_DLY3 field is not configured before tuning process,
+which is the reason for the above-mentioned CMD13 response crc error.
+
+Move the PAD_DS_DLY3 field configuration into msdc_prepare_hs400_tuning(),
+and add a value check of hs400_ds_delay to prevent overwriting by zero when
+the 'hs400-ds-delay' is not set in the dts. In addition, since hs400(es)
+only tune the PAD_DS_DLY1, the PAD_DS_DLY2_SEL bit should be cleared to
+bypass it.
+
+Fixes: c4ac38c6539b ("mmc: mtk-sd: Add HS400 online tuning support")
+Signed-off-by: Andy-ld Lu <andy-ld.lu@mediatek.com>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20250123092644.7359-1-andy-ld.lu@mediatek.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mmc/host/mtk-sd.c |   31 ++++++++++++++++++++-----------
+ 1 file changed, 20 insertions(+), 11 deletions(-)
+
+--- a/drivers/mmc/host/mtk-sd.c
++++ b/drivers/mmc/host/mtk-sd.c
+@@ -262,6 +262,7 @@
+ #define MSDC_PAD_TUNE_CMD_SEL   BIT(21)   /* RW */
+ #define PAD_DS_TUNE_DLY_SEL       BIT(0)        /* RW */
++#define PAD_DS_TUNE_DLY2_SEL      BIT(1)        /* RW */
+ #define PAD_DS_TUNE_DLY1        GENMASK(6, 2)   /* RW */
+ #define PAD_DS_TUNE_DLY2        GENMASK(11, 7)  /* RW */
+ #define PAD_DS_TUNE_DLY3        GENMASK(16, 12) /* RW */
+@@ -307,6 +308,7 @@
+ /* EMMC50_PAD_DS_TUNE mask */
+ #define PAD_DS_DLY_SEL                BIT(16) /* RW */
++#define PAD_DS_DLY2_SEL               BIT(15) /* RW */
+ #define PAD_DS_DLY1           GENMASK(14, 10) /* RW */
+ #define PAD_DS_DLY3           GENMASK(4, 0)   /* RW */
+@@ -2293,13 +2295,23 @@ tune_done:
+ static int msdc_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios)
+ {
+       struct msdc_host *host = mmc_priv(mmc);
++
+       host->hs400_mode = true;
+-      if (host->top_base)
+-              writel(host->hs400_ds_delay,
+-                     host->top_base + EMMC50_PAD_DS_TUNE);
+-      else
+-              writel(host->hs400_ds_delay, host->base + PAD_DS_TUNE);
++      if (host->top_base) {
++              if (host->hs400_ds_dly3)
++                      sdr_set_field(host->top_base + EMMC50_PAD_DS_TUNE,
++                                    PAD_DS_DLY3, host->hs400_ds_dly3);
++              if (host->hs400_ds_delay)
++                      writel(host->hs400_ds_delay,
++                             host->top_base + EMMC50_PAD_DS_TUNE);
++      } else {
++              if (host->hs400_ds_dly3)
++                      sdr_set_field(host->base + PAD_DS_TUNE,
++                                    PAD_DS_TUNE_DLY3, host->hs400_ds_dly3);
++              if (host->hs400_ds_delay)
++                      writel(host->hs400_ds_delay, host->base + PAD_DS_TUNE);
++      }
+       /* hs400 mode must set it to 0 */
+       sdr_clr_bits(host->base + MSDC_PATCH_BIT2, MSDC_PATCH_BIT2_CFGCRCSTS);
+       /* to improve read performance, set outstanding to 2 */
+@@ -2319,14 +2331,11 @@ static int msdc_execute_hs400_tuning(str
+       if (host->top_base) {
+               sdr_set_bits(host->top_base + EMMC50_PAD_DS_TUNE,
+                            PAD_DS_DLY_SEL);
+-              if (host->hs400_ds_dly3)
+-                      sdr_set_field(host->top_base + EMMC50_PAD_DS_TUNE,
+-                                    PAD_DS_DLY3, host->hs400_ds_dly3);
++              sdr_clr_bits(host->top_base + EMMC50_PAD_DS_TUNE,
++                           PAD_DS_DLY2_SEL);
+       } else {
+               sdr_set_bits(host->base + PAD_DS_TUNE, PAD_DS_TUNE_DLY_SEL);
+-              if (host->hs400_ds_dly3)
+-                      sdr_set_field(host->base + PAD_DS_TUNE,
+-                                    PAD_DS_TUNE_DLY3, host->hs400_ds_dly3);
++              sdr_clr_bits(host->base + PAD_DS_TUNE, PAD_DS_TUNE_DLY2_SEL);
+       }
+       host->hs400_tuning = true;
diff --git a/queue-6.1/regmap-irq-add-missing-kfree.patch b/queue-6.1/regmap-irq-add-missing-kfree.patch
new file mode 100644 (file)
index 0000000..8511c1c
--- /dev/null
@@ -0,0 +1,40 @@
+From 32ffed055dcee17f6705f545b069e44a66067808 Mon Sep 17 00:00:00 2001
+From: Jiasheng Jiang <jiashengjiangcool@gmail.com>
+Date: Wed, 5 Feb 2025 00:43:43 +0000
+Subject: regmap-irq: Add missing kfree()
+
+From: Jiasheng Jiang <jiashengjiangcool@gmail.com>
+
+commit 32ffed055dcee17f6705f545b069e44a66067808 upstream.
+
+Add kfree() for "d->main_status_buf" to the error-handling path to prevent
+a memory leak.
+
+Fixes: a2d21848d921 ("regmap: regmap-irq: Add main status register support")
+Cc: stable@vger.kernel.org  # v5.1+
+Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
+Link: https://patch.msgid.link/20250205004343.14413-1-jiashengjiangcool@gmail.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/base/regmap/regmap-irq.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/base/regmap/regmap-irq.c
++++ b/drivers/base/regmap/regmap-irq.c
+@@ -1059,6 +1059,7 @@ err_alloc:
+       kfree(d->wake_buf);
+       kfree(d->mask_buf_def);
+       kfree(d->mask_buf);
++      kfree(d->main_status_buf);
+       kfree(d->status_buf);
+       kfree(d->status_reg_buf);
+       if (d->virt_buf) {
+@@ -1139,6 +1140,7 @@ void regmap_del_irq_chip(int irq, struct
+       kfree(d->wake_buf);
+       kfree(d->mask_buf_def);
+       kfree(d->mask_buf);
++      kfree(d->main_status_buf);
+       kfree(d->status_reg_buf);
+       kfree(d->status_buf);
+       if (d->config_buf) {
index 0c9d78878ad1ab62e79f44d5de0a28bd4fce1b70..afe99dfcd18366d7c72b6c7c4f54c5fbfbd72622 100644 (file)
@@ -528,3 +528,7 @@ alpha-align-stack-for-page-fault-and-user-unaligned-trap-handlers.patch
 gpiolib-acpi-add-a-quirk-for-acer-nitro-anv14.patch
 gpio-stmpe-check-return-value-of-stmpe_reg_read-in-stmpe_gpio_irq_sync_unlock.patch
 partitions-mac-fix-handling-of-bogus-partition-table.patch
+regmap-irq-add-missing-kfree.patch
+arm64-handle-.arm.attributes-section-in-linker-scripts.patch
+mmc-mtk-sd-fix-register-settings-for-hs400-es-mode.patch
+mlxsw-add-return-value-check-for-mlxsw_sp_port_get_stats_raw.patch