]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Aug 2025 13:19:27 +0000 (15:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Aug 2025 13:19:27 +0000 (15:19 +0200)
added patches:
hwmon-gsc-hwmon-fix-fan-pwm-setpoint-show-functions.patch
pwm-imx-tpm-reset-counter-if-cmod-is-0.patch
wifi-ath11k-fix-source-ring-buffer-corruption.patch
wifi-brcmsmac-remove-const-from-tbl_ptr-parameter-in-wlc_lcnphy_common_read_table.patch
zynq_fpga-use-sgtable-based-scatterlist-wrappers.patch

queue-5.10/hwmon-gsc-hwmon-fix-fan-pwm-setpoint-show-functions.patch [new file with mode: 0644]
queue-5.10/pwm-imx-tpm-reset-counter-if-cmod-is-0.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/wifi-ath11k-fix-source-ring-buffer-corruption.patch [new file with mode: 0644]
queue-5.10/wifi-brcmsmac-remove-const-from-tbl_ptr-parameter-in-wlc_lcnphy_common_read_table.patch [new file with mode: 0644]
queue-5.10/zynq_fpga-use-sgtable-based-scatterlist-wrappers.patch [new file with mode: 0644]

diff --git a/queue-5.10/hwmon-gsc-hwmon-fix-fan-pwm-setpoint-show-functions.patch b/queue-5.10/hwmon-gsc-hwmon-fix-fan-pwm-setpoint-show-functions.patch
new file mode 100644 (file)
index 0000000..6d56699
--- /dev/null
@@ -0,0 +1,59 @@
+From 9c62e2282900332c8b711d9f9e37af369a8ef71b Mon Sep 17 00:00:00 2001
+From: Tim Harvey <tharvey@gateworks.com>
+Date: Fri, 18 Jul 2025 13:02:59 -0700
+Subject: hwmon: (gsc-hwmon) fix fan pwm setpoint show functions
+
+From: Tim Harvey <tharvey@gateworks.com>
+
+commit 9c62e2282900332c8b711d9f9e37af369a8ef71b upstream.
+
+The Linux hwmon sysfs API values for pwmX_auto_pointY_pwm represent an
+integer value between 0 (0%) to 255 (100%) and the pwmX_auto_pointY_temp
+represent millidegrees Celcius.
+
+Commit a6d80df47ee2 ("hwmon: (gsc-hwmon) fix fan pwm temperature
+scaling") properly addressed the incorrect scaling in the
+pwm_auto_point_temp_store implementation but erroneously scaled
+the pwm_auto_point_pwm_show (pwm value) instead of the
+pwm_auto_point_temp_show (temp value) resulting in:
+ # cat /sys/class/hwmon/hwmon0/pwm1_auto_point6_pwm
+ 25500
+ # cat /sys/class/hwmon/hwmon0/pwm1_auto_point6_temp
+ 4500
+
+Fix the scaling of these attributes:
+ # cat /sys/class/hwmon/hwmon0/pwm1_auto_point6_pwm
+ 255
+ # cat /sys/class/hwmon/hwmon0/pwm1_auto_point6_temp
+ 45000
+
+Fixes: a6d80df47ee2 ("hwmon: (gsc-hwmon) fix fan pwm temperature scaling")
+Cc: stable@vger.kernel.org
+Signed-off-by: Tim Harvey <tharvey@gateworks.com>
+Link: https://lore.kernel.org/r/20250718200259.1840792-1-tharvey@gateworks.com
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hwmon/gsc-hwmon.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/hwmon/gsc-hwmon.c
++++ b/drivers/hwmon/gsc-hwmon.c
+@@ -65,7 +65,7 @@ static ssize_t pwm_auto_point_temp_show(
+               return ret;
+       ret = regs[0] | regs[1] << 8;
+-      return sprintf(buf, "%d\n", ret * 10);
++      return sprintf(buf, "%d\n", ret * 100);
+ }
+ static ssize_t pwm_auto_point_temp_store(struct device *dev,
+@@ -100,7 +100,7 @@ static ssize_t pwm_auto_point_pwm_show(s
+ {
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+-      return sprintf(buf, "%d\n", 255 * (50 + (attr->index * 10)));
++      return sprintf(buf, "%d\n", 255 * (50 + (attr->index * 10)) / 100);
+ }
+ static SENSOR_DEVICE_ATTR_RO(pwm1_auto_point1_pwm, pwm_auto_point_pwm, 0);
diff --git a/queue-5.10/pwm-imx-tpm-reset-counter-if-cmod-is-0.patch b/queue-5.10/pwm-imx-tpm-reset-counter-if-cmod-is-0.patch
new file mode 100644 (file)
index 0000000..5c685fc
--- /dev/null
@@ -0,0 +1,58 @@
+From 65c6f742ab14ab1a2679fba72b82dcc0289d96f1 Mon Sep 17 00:00:00 2001
+From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
+Date: Mon, 28 Jul 2025 15:41:44 -0400
+Subject: pwm: imx-tpm: Reset counter if CMOD is 0
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
+
+commit 65c6f742ab14ab1a2679fba72b82dcc0289d96f1 upstream.
+
+As per the i.MX93 TRM, section 67.3.2.1 "MOD register update", the value
+of the TPM counter does NOT get updated when writing MOD.MOD unless
+SC.CMOD != 0. Therefore, with the current code, assuming the following
+sequence:
+
+       1) pwm_disable()
+       2) pwm_apply_might_sleep() /* period is changed here */
+       3) pwm_enable()
+
+and assuming only one channel is active, if CNT.COUNT is higher than the
+MOD.MOD value written during the pwm_apply_might_sleep() call then, when
+re-enabling the PWM during pwm_enable(), the counter will end up resetting
+after UINT32_MAX - CNT.COUNT + MOD.MOD cycles instead of MOD.MOD cycles as
+normally expected.
+
+Fix this problem by forcing a reset of the TPM counter before MOD.MOD is
+written.
+
+Fixes: 738a1cfec2ed ("pwm: Add i.MX TPM PWM driver support")
+Cc: stable@vger.kernel.org
+Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
+Link: https://lore.kernel.org/r/20250728194144.22884-1-laurentiumihalcea111@gmail.com
+Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pwm/pwm-imx-tpm.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/pwm/pwm-imx-tpm.c
++++ b/drivers/pwm/pwm-imx-tpm.c
+@@ -203,6 +203,15 @@ static int pwm_imx_tpm_apply_hw(struct p
+               writel(val, tpm->base + PWM_IMX_TPM_SC);
+               /*
++               * if the counter is disabled (CMOD == 0), programming the new
++               * period length (MOD) will not reset the counter (CNT). If
++               * CNT.COUNT happens to be bigger than the new MOD value then
++               * the counter will end up being reset way too late. Therefore,
++               * manually reset it to 0.
++               */
++              if (!cmod)
++                      writel(0x0, tpm->base + PWM_IMX_TPM_CNT);
++              /*
+                * set period count:
+                * if the PWM is disabled (CMOD[1:0] = 2b00), then MOD register
+                * is updated when MOD register is written.
index eb447b91b864b29847a353a910c10c73b2bc573b..337c15c3dc4170cad96c926e9bb2af1ae952678b 100644 (file)
@@ -366,3 +366,8 @@ ext4-check-fast-symlink-for-ea_inode-correctly.patch
 ext4-fix-fsmap-end-of-range-reporting-with-bigalloc.patch
 ext4-fix-reserved-gdt-blocks-handling-in-fsmap.patch
 ata-libata-scsi-fix-ata_to_sense_error-status-handling.patch
+zynq_fpga-use-sgtable-based-scatterlist-wrappers.patch
+wifi-brcmsmac-remove-const-from-tbl_ptr-parameter-in-wlc_lcnphy_common_read_table.patch
+wifi-ath11k-fix-source-ring-buffer-corruption.patch
+pwm-imx-tpm-reset-counter-if-cmod-is-0.patch
+hwmon-gsc-hwmon-fix-fan-pwm-setpoint-show-functions.patch
diff --git a/queue-5.10/wifi-ath11k-fix-source-ring-buffer-corruption.patch b/queue-5.10/wifi-ath11k-fix-source-ring-buffer-corruption.patch
new file mode 100644 (file)
index 0000000..1faf7ff
--- /dev/null
@@ -0,0 +1,56 @@
+From 6efa0df54022c6c9fd4d294b87622c7fcdc418c8 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan+linaro@kernel.org>
+Date: Wed, 4 Jun 2025 16:34:56 +0200
+Subject: wifi: ath11k: fix source ring-buffer corruption
+
+From: Johan Hovold <johan+linaro@kernel.org>
+
+commit 6efa0df54022c6c9fd4d294b87622c7fcdc418c8 upstream.
+
+Add the missing memory barrier to make sure that LMAC source ring
+descriptors are written before updating the head pointer to avoid
+passing stale data to the firmware on weakly ordered architectures like
+aarch64.
+
+Note that non-LMAC rings use MMIO write accessors which have the
+required write memory barrier.
+
+Tested-on: WCN6855 hw2.1 WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41
+
+Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
+Cc: stable@vger.kernel.org      # 5.6
+Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
+Reviewed-by: Baochen Qiang <quic_bqiang@quicinc.com>
+Link: https://patch.msgid.link/20250604143457.26032-5-johan+linaro@kernel.org
+Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/wireless/ath/ath11k/hal.c |   10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/ath/ath11k/hal.c
++++ b/drivers/net/wireless/ath/ath11k/hal.c
+@@ -841,7 +841,11 @@ void ath11k_hal_srng_access_end(struct a
+               if (srng->ring_dir == HAL_SRNG_DIR_SRC) {
+                       srng->u.src_ring.last_tp =
+                               *(volatile u32 *)srng->u.src_ring.tp_addr;
+-                      *srng->u.src_ring.hp_addr = srng->u.src_ring.hp;
++                      /* Make sure descriptor is written before updating the
++                       * head pointer.
++                       */
++                      dma_wmb();
++                      WRITE_ONCE(*srng->u.src_ring.hp_addr, srng->u.src_ring.hp);
+               } else {
+                       srng->u.dst_ring.last_hp = *srng->u.dst_ring.hp_addr;
+                       *srng->u.dst_ring.tp_addr = srng->u.dst_ring.tp;
+@@ -850,6 +854,10 @@ void ath11k_hal_srng_access_end(struct a
+               if (srng->ring_dir == HAL_SRNG_DIR_SRC) {
+                       srng->u.src_ring.last_tp =
+                               *(volatile u32 *)srng->u.src_ring.tp_addr;
++                      /* Assume implementation use an MMIO write accessor
++                       * which has the required wmb() so that the descriptor
++                       * is written before the updating the head pointer.
++                       */
+                       ath11k_hif_write32(ab,
+                                          (unsigned long)srng->u.src_ring.hp_addr -
+                                          (unsigned long)ab->mem,
diff --git a/queue-5.10/wifi-brcmsmac-remove-const-from-tbl_ptr-parameter-in-wlc_lcnphy_common_read_table.patch b/queue-5.10/wifi-brcmsmac-remove-const-from-tbl_ptr-parameter-in-wlc_lcnphy_common_read_table.patch
new file mode 100644 (file)
index 0000000..a22e24e
--- /dev/null
@@ -0,0 +1,46 @@
+From 81284e86bf8849f8e98e8ead3ff5811926b2107f Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Tue, 15 Jul 2025 19:45:23 -0700
+Subject: wifi: brcmsmac: Remove const from tbl_ptr parameter in wlc_lcnphy_common_read_table()
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit 81284e86bf8849f8e98e8ead3ff5811926b2107f upstream.
+
+A new warning in clang [1] complains that diq_start in
+wlc_lcnphy_tx_iqlo_cal() is passed uninitialized as a const pointer to
+wlc_lcnphy_common_read_table():
+
+  drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c:2728:13: error: variable 'diq_start' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
+   2728 |                                                      &diq_start, 1, 16, 69);
+        |                                                       ^~~~~~~~~
+
+The table pointer passed to wlc_lcnphy_common_read_table() should not be
+considered constant, as wlc_phy_read_table() is ultimately going to
+update it. Remove the const qualifier from the tbl_ptr to clear up the
+warning.
+
+Cc: stable@vger.kernel.org
+Closes: https://github.com/ClangBuiltLinux/linux/issues/2108
+Fixes: 5b435de0d786 ("net: wireless: add brcm80211 drivers")
+Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1]
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>>
+Link: https://patch.msgid.link/20250715-brcmsmac-fix-uninit-const-pointer-v1-1-16e6a51a8ef4@kernel.org
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
+@@ -919,7 +919,7 @@ void wlc_lcnphy_read_table(struct brcms_
+ static void
+ wlc_lcnphy_common_read_table(struct brcms_phy *pi, u32 tbl_id,
+-                           const u16 *tbl_ptr, u32 tbl_len,
++                           u16 *tbl_ptr, u32 tbl_len,
+                            u32 tbl_width, u32 tbl_offset)
+ {
+       struct phytbl_info tab;
diff --git a/queue-5.10/zynq_fpga-use-sgtable-based-scatterlist-wrappers.patch b/queue-5.10/zynq_fpga-use-sgtable-based-scatterlist-wrappers.patch
new file mode 100644 (file)
index 0000000..288b4ed
--- /dev/null
@@ -0,0 +1,46 @@
+From 37e00703228ab44d0aacc32a97809a4f6f58df1b Mon Sep 17 00:00:00 2001
+From: Marek Szyprowski <m.szyprowski@samsung.com>
+Date: Mon, 16 Jun 2025 14:09:32 +0200
+Subject: zynq_fpga: use sgtable-based scatterlist wrappers
+
+From: Marek Szyprowski <m.szyprowski@samsung.com>
+
+commit 37e00703228ab44d0aacc32a97809a4f6f58df1b upstream.
+
+Use common wrappers operating directly on the struct sg_table objects to
+fix incorrect use of statterlists related calls. dma_unmap_sg() function
+has to be called with the number of elements originally passed to the
+dma_map_sg() function, not the one returned in sgtable's nents.
+
+CC: stable@vger.kernel.org
+Fixes: 425902f5c8e3 ("fpga zynq: Use the scatterlist interface")
+Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
+Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
+Reviewed-by: Xu Yilun <yilun.xu@intel.com>
+Link: https://lore.kernel.org/r/20250616120932.1090614-1-m.szyprowski@samsung.com
+Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/fpga/zynq-fpga.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/fpga/zynq-fpga.c
++++ b/drivers/fpga/zynq-fpga.c
+@@ -406,7 +406,7 @@ static int zynq_fpga_ops_write(struct fp
+       }
+       priv->dma_nelms =
+-          dma_map_sg(mgr->dev.parent, sgt->sgl, sgt->nents, DMA_TO_DEVICE);
++          dma_map_sgtable(mgr->dev.parent, sgt, DMA_TO_DEVICE, 0);
+       if (priv->dma_nelms == 0) {
+               dev_err(&mgr->dev, "Unable to DMA map (TO_DEVICE)\n");
+               return -ENOMEM;
+@@ -478,7 +478,7 @@ out_clk:
+       clk_disable(priv->clk);
+ out_free:
+-      dma_unmap_sg(mgr->dev.parent, sgt->sgl, sgt->nents, DMA_TO_DEVICE);
++      dma_unmap_sgtable(mgr->dev.parent, sgt, DMA_TO_DEVICE, 0);
+       return err;
+ }