--- /dev/null
+From 6c2b75404d33caa46a582f2791a70f92232adb71 Mon Sep 17 00:00:00 2001
+From: Andrzej Kacprowski <Andrzej.Kacprowski@intel.com>
+Date: Tue, 1 Apr 2025 17:59:11 +0200
+Subject: accel/ivpu: Fix the NPU's DPU frequency calculation
+
+From: Andrzej Kacprowski <Andrzej.Kacprowski@intel.com>
+
+commit 6c2b75404d33caa46a582f2791a70f92232adb71 upstream.
+
+Fix the frequency returned to the user space by
+the DRM_IVPU_PARAM_CORE_CLOCK_RATE GET_PARAM IOCTL.
+The kernel driver returned CPU frequency for MTL and bare
+PLL frequency for LNL - this was inconsistent and incorrect
+for both platforms. With this fix the driver returns maximum
+frequency of the NPU data processing unit (DPU) for all HW
+generations. This is what user space always expected.
+
+Also do not set CPU frequency in boot params - the firmware
+does not use frequency passed from the driver, it was only
+used by the early pre-production firmware.
+With that we can remove CPU frequency calculation code.
+
+Show NPU frequency in FREQ_CHANGE interrupt when frequency
+tracking is enabled.
+
+Fixes: 8a27ad81f7d3 ("accel/ivpu: Split IP and buttress code")
+Cc: stable@vger.kernel.org # v6.11+
+Signed-off-by: Andrzej Kacprowski <Andrzej.Kacprowski@intel.com>
+Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
+Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
+Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
+Link: https://lore.kernel.org/r/20250401155912.4049340-2-maciej.falkowski@linux.intel.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/accel/ivpu/ivpu_drv.c | 4 -
+ drivers/accel/ivpu/ivpu_fw.c | 3
+ drivers/accel/ivpu/ivpu_hw.h | 11 ---
+ drivers/accel/ivpu/ivpu_hw_btrs.c | 126 ++++++++++++++++----------------------
+ drivers/accel/ivpu/ivpu_hw_btrs.h | 6 -
+ include/uapi/drm/ivpu_accel.h | 4 -
+ 6 files changed, 66 insertions(+), 88 deletions(-)
+
+--- a/drivers/accel/ivpu/ivpu_drv.c
++++ b/drivers/accel/ivpu/ivpu_drv.c
+@@ -1,6 +1,6 @@
+ // SPDX-License-Identifier: GPL-2.0-only
+ /*
+- * Copyright (C) 2020-2024 Intel Corporation
++ * Copyright (C) 2020-2025 Intel Corporation
+ */
+
+ #include <linux/firmware.h>
+@@ -167,7 +167,7 @@ static int ivpu_get_param_ioctl(struct d
+ args->value = vdev->platform;
+ break;
+ case DRM_IVPU_PARAM_CORE_CLOCK_RATE:
+- args->value = ivpu_hw_ratio_to_freq(vdev, vdev->hw->pll.max_ratio);
++ args->value = ivpu_hw_dpu_max_freq_get(vdev);
+ break;
+ case DRM_IVPU_PARAM_NUM_CONTEXTS:
+ args->value = ivpu_get_context_count(vdev);
+--- a/drivers/accel/ivpu/ivpu_fw.c
++++ b/drivers/accel/ivpu/ivpu_fw.c
+@@ -1,6 +1,6 @@
+ // SPDX-License-Identifier: GPL-2.0-only
+ /*
+- * Copyright (C) 2020-2024 Intel Corporation
++ * Copyright (C) 2020-2025 Intel Corporation
+ */
+
+ #include <linux/firmware.h>
+@@ -561,7 +561,6 @@ void ivpu_fw_boot_params_setup(struct iv
+
+ boot_params->magic = VPU_BOOT_PARAMS_MAGIC;
+ boot_params->vpu_id = to_pci_dev(vdev->drm.dev)->bus->number;
+- boot_params->frequency = ivpu_hw_pll_freq_get(vdev);
+
+ /*
+ * This param is a debug firmware feature. It switches default clock
+--- a/drivers/accel/ivpu/ivpu_hw.h
++++ b/drivers/accel/ivpu/ivpu_hw.h
+@@ -1,6 +1,6 @@
+ /* SPDX-License-Identifier: GPL-2.0-only */
+ /*
+- * Copyright (C) 2020-2024 Intel Corporation
++ * Copyright (C) 2020-2025 Intel Corporation
+ */
+
+ #ifndef __IVPU_HW_H__
+@@ -86,9 +86,9 @@ static inline u64 ivpu_hw_range_size(con
+ return range->end - range->start;
+ }
+
+-static inline u32 ivpu_hw_ratio_to_freq(struct ivpu_device *vdev, u32 ratio)
++static inline u32 ivpu_hw_dpu_max_freq_get(struct ivpu_device *vdev)
+ {
+- return ivpu_hw_btrs_ratio_to_freq(vdev, ratio);
++ return ivpu_hw_btrs_dpu_max_freq_get(vdev);
+ }
+
+ static inline void ivpu_hw_irq_clear(struct ivpu_device *vdev)
+@@ -96,11 +96,6 @@ static inline void ivpu_hw_irq_clear(str
+ ivpu_hw_ip_irq_clear(vdev);
+ }
+
+-static inline u32 ivpu_hw_pll_freq_get(struct ivpu_device *vdev)
+-{
+- return ivpu_hw_btrs_pll_freq_get(vdev);
+-}
+-
+ static inline u32 ivpu_hw_profiling_freq_get(struct ivpu_device *vdev)
+ {
+ return vdev->hw->pll.profiling_freq;
+--- a/drivers/accel/ivpu/ivpu_hw_btrs.c
++++ b/drivers/accel/ivpu/ivpu_hw_btrs.c
+@@ -1,8 +1,10 @@
+ // SPDX-License-Identifier: GPL-2.0-only
+ /*
+- * Copyright (C) 2020-2024 Intel Corporation
++ * Copyright (C) 2020-2025 Intel Corporation
+ */
+
++#include <linux/units.h>
++
+ #include "ivpu_drv.h"
+ #include "ivpu_hw.h"
+ #include "ivpu_hw_btrs.h"
+@@ -28,17 +30,13 @@
+
+ #define BTRS_LNL_ALL_IRQ_MASK ((u32)-1)
+
+-#define BTRS_MTL_WP_CONFIG_1_TILE_5_3_RATIO WP_CONFIG(MTL_CONFIG_1_TILE, MTL_PLL_RATIO_5_3)
+-#define BTRS_MTL_WP_CONFIG_1_TILE_4_3_RATIO WP_CONFIG(MTL_CONFIG_1_TILE, MTL_PLL_RATIO_4_3)
+-#define BTRS_MTL_WP_CONFIG_2_TILE_5_3_RATIO WP_CONFIG(MTL_CONFIG_2_TILE, MTL_PLL_RATIO_5_3)
+-#define BTRS_MTL_WP_CONFIG_2_TILE_4_3_RATIO WP_CONFIG(MTL_CONFIG_2_TILE, MTL_PLL_RATIO_4_3)
+-#define BTRS_MTL_WP_CONFIG_0_TILE_PLL_OFF WP_CONFIG(0, 0)
+
+ #define PLL_CDYN_DEFAULT 0x80
+ #define PLL_EPP_DEFAULT 0x80
+ #define PLL_CONFIG_DEFAULT 0x0
+-#define PLL_SIMULATION_FREQ 10000000
+-#define PLL_REF_CLK_FREQ 50000000
++#define PLL_REF_CLK_FREQ 50000000ull
++#define PLL_RATIO_TO_FREQ(x) ((x) * PLL_REF_CLK_FREQ)
++
+ #define PLL_TIMEOUT_US (1500 * USEC_PER_MSEC)
+ #define IDLE_TIMEOUT_US (5 * USEC_PER_MSEC)
+ #define TIMEOUT_US (150 * USEC_PER_MSEC)
+@@ -62,6 +60,8 @@
+ #define DCT_ENABLE 0x1
+ #define DCT_DISABLE 0x0
+
++static u32 pll_ratio_to_dpu_freq(struct ivpu_device *vdev, u32 ratio);
++
+ int ivpu_hw_btrs_irqs_clear_with_0_mtl(struct ivpu_device *vdev)
+ {
+ REGB_WR32(VPU_HW_BTRS_MTL_INTERRUPT_STAT, BTRS_MTL_ALL_IRQ_MASK);
+@@ -156,7 +156,7 @@ static int info_init_mtl(struct ivpu_dev
+
+ hw->tile_fuse = BTRS_MTL_TILE_FUSE_ENABLE_BOTH;
+ hw->sku = BTRS_MTL_TILE_SKU_BOTH;
+- hw->config = BTRS_MTL_WP_CONFIG_2_TILE_4_3_RATIO;
++ hw->config = WP_CONFIG(MTL_CONFIG_2_TILE, MTL_PLL_RATIO_4_3);
+
+ return 0;
+ }
+@@ -334,8 +334,8 @@ int ivpu_hw_btrs_wp_drive(struct ivpu_de
+
+ prepare_wp_request(vdev, &wp, enable);
+
+- ivpu_dbg(vdev, PM, "PLL workpoint request: %u Hz, config: 0x%x, epp: 0x%x, cdyn: 0x%x\n",
+- PLL_RATIO_TO_FREQ(wp.target), wp.cfg, wp.epp, wp.cdyn);
++ ivpu_dbg(vdev, PM, "PLL workpoint request: %lu MHz, config: 0x%x, epp: 0x%x, cdyn: 0x%x\n",
++ pll_ratio_to_dpu_freq(vdev, wp.target) / HZ_PER_MHZ, wp.cfg, wp.epp, wp.cdyn);
+
+ ret = wp_request_send(vdev, &wp);
+ if (ret) {
+@@ -573,6 +573,39 @@ int ivpu_hw_btrs_wait_for_idle(struct iv
+ return REGB_POLL_FLD(VPU_HW_BTRS_LNL_VPU_STATUS, IDLE, 0x1, IDLE_TIMEOUT_US);
+ }
+
++static u32 pll_config_get_mtl(struct ivpu_device *vdev)
++{
++ return REGB_RD32(VPU_HW_BTRS_MTL_CURRENT_PLL);
++}
++
++static u32 pll_config_get_lnl(struct ivpu_device *vdev)
++{
++ return REGB_RD32(VPU_HW_BTRS_LNL_PLL_FREQ);
++}
++
++static u32 pll_ratio_to_dpu_freq_mtl(u16 ratio)
++{
++ return (PLL_RATIO_TO_FREQ(ratio) * 2) / 3;
++}
++
++static u32 pll_ratio_to_dpu_freq_lnl(u16 ratio)
++{
++ return PLL_RATIO_TO_FREQ(ratio) / 2;
++}
++
++static u32 pll_ratio_to_dpu_freq(struct ivpu_device *vdev, u32 ratio)
++{
++ if (ivpu_hw_btrs_gen(vdev) == IVPU_HW_BTRS_MTL)
++ return pll_ratio_to_dpu_freq_mtl(ratio);
++ else
++ return pll_ratio_to_dpu_freq_lnl(ratio);
++}
++
++u32 ivpu_hw_btrs_dpu_max_freq_get(struct ivpu_device *vdev)
++{
++ return pll_ratio_to_dpu_freq(vdev, vdev->hw->pll.max_ratio);
++}
++
+ /* Handler for IRQs from Buttress core (irqB) */
+ bool ivpu_hw_btrs_irq_handler_mtl(struct ivpu_device *vdev, int irq)
+ {
+@@ -582,9 +615,12 @@ bool ivpu_hw_btrs_irq_handler_mtl(struct
+ if (!status)
+ return false;
+
+- if (REG_TEST_FLD(VPU_HW_BTRS_MTL_INTERRUPT_STAT, FREQ_CHANGE, status))
+- ivpu_dbg(vdev, IRQ, "FREQ_CHANGE irq: %08x",
+- REGB_RD32(VPU_HW_BTRS_MTL_CURRENT_PLL));
++ if (REG_TEST_FLD(VPU_HW_BTRS_MTL_INTERRUPT_STAT, FREQ_CHANGE, status)) {
++ u32 pll = pll_config_get_mtl(vdev);
++
++ ivpu_dbg(vdev, IRQ, "FREQ_CHANGE irq, wp %08x, %lu MHz",
++ pll, pll_ratio_to_dpu_freq_mtl(pll) / HZ_PER_MHZ);
++ }
+
+ if (REG_TEST_FLD(VPU_HW_BTRS_MTL_INTERRUPT_STAT, ATS_ERR, status)) {
+ ivpu_err(vdev, "ATS_ERR irq 0x%016llx", REGB_RD64(VPU_HW_BTRS_MTL_ATS_ERR_LOG_0));
+@@ -634,8 +670,12 @@ bool ivpu_hw_btrs_irq_handler_lnl(struct
+ ivpu_err_ratelimited(vdev, "IRQ FIFO full\n");
+ }
+
+- if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, FREQ_CHANGE, status))
+- ivpu_dbg(vdev, IRQ, "FREQ_CHANGE irq: %08x", REGB_RD32(VPU_HW_BTRS_LNL_PLL_FREQ));
++ if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, FREQ_CHANGE, status)) {
++ u32 pll = pll_config_get_lnl(vdev);
++
++ ivpu_dbg(vdev, IRQ, "FREQ_CHANGE irq, wp %08x, %lu MHz",
++ pll, pll_ratio_to_dpu_freq_lnl(pll) / HZ_PER_MHZ);
++ }
+
+ if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, ATS_ERR, status)) {
+ ivpu_err(vdev, "ATS_ERR LOG1 0x%08x ATS_ERR_LOG2 0x%08x\n",
+@@ -718,60 +758,6 @@ void ivpu_hw_btrs_dct_set_status(struct
+ REGB_WR32(VPU_HW_BTRS_LNL_PCODE_MAILBOX_STATUS, val);
+ }
+
+-static u32 pll_ratio_to_freq_mtl(u32 ratio, u32 config)
+-{
+- u32 pll_clock = PLL_REF_CLK_FREQ * ratio;
+- u32 cpu_clock;
+-
+- if ((config & 0xff) == MTL_PLL_RATIO_4_3)
+- cpu_clock = pll_clock * 2 / 4;
+- else
+- cpu_clock = pll_clock * 2 / 5;
+-
+- return cpu_clock;
+-}
+-
+-u32 ivpu_hw_btrs_ratio_to_freq(struct ivpu_device *vdev, u32 ratio)
+-{
+- struct ivpu_hw_info *hw = vdev->hw;
+-
+- if (ivpu_hw_btrs_gen(vdev) == IVPU_HW_BTRS_MTL)
+- return pll_ratio_to_freq_mtl(ratio, hw->config);
+- else
+- return PLL_RATIO_TO_FREQ(ratio);
+-}
+-
+-static u32 pll_freq_get_mtl(struct ivpu_device *vdev)
+-{
+- u32 pll_curr_ratio;
+-
+- pll_curr_ratio = REGB_RD32(VPU_HW_BTRS_MTL_CURRENT_PLL);
+- pll_curr_ratio &= VPU_HW_BTRS_MTL_CURRENT_PLL_RATIO_MASK;
+-
+- if (!ivpu_is_silicon(vdev))
+- return PLL_SIMULATION_FREQ;
+-
+- return pll_ratio_to_freq_mtl(pll_curr_ratio, vdev->hw->config);
+-}
+-
+-static u32 pll_freq_get_lnl(struct ivpu_device *vdev)
+-{
+- u32 pll_curr_ratio;
+-
+- pll_curr_ratio = REGB_RD32(VPU_HW_BTRS_LNL_PLL_FREQ);
+- pll_curr_ratio &= VPU_HW_BTRS_LNL_PLL_FREQ_RATIO_MASK;
+-
+- return PLL_RATIO_TO_FREQ(pll_curr_ratio);
+-}
+-
+-u32 ivpu_hw_btrs_pll_freq_get(struct ivpu_device *vdev)
+-{
+- if (ivpu_hw_btrs_gen(vdev) == IVPU_HW_BTRS_MTL)
+- return pll_freq_get_mtl(vdev);
+- else
+- return pll_freq_get_lnl(vdev);
+-}
+-
+ u32 ivpu_hw_btrs_telemetry_offset_get(struct ivpu_device *vdev)
+ {
+ if (ivpu_hw_btrs_gen(vdev) == IVPU_HW_BTRS_MTL)
+--- a/drivers/accel/ivpu/ivpu_hw_btrs.h
++++ b/drivers/accel/ivpu/ivpu_hw_btrs.h
+@@ -1,6 +1,6 @@
+ /* SPDX-License-Identifier: GPL-2.0-only */
+ /*
+- * Copyright (C) 2020-2024 Intel Corporation
++ * Copyright (C) 2020-2025 Intel Corporation
+ */
+
+ #ifndef __IVPU_HW_BTRS_H__
+@@ -13,7 +13,6 @@
+
+ #define PLL_PROFILING_FREQ_DEFAULT 38400000
+ #define PLL_PROFILING_FREQ_HIGH 400000000
+-#define PLL_RATIO_TO_FREQ(x) ((x) * PLL_REF_CLK_FREQ)
+
+ #define DCT_DEFAULT_ACTIVE_PERCENT 15u
+ #define DCT_PERIOD_US 35300u
+@@ -32,12 +31,11 @@ int ivpu_hw_btrs_ip_reset(struct ivpu_de
+ void ivpu_hw_btrs_profiling_freq_reg_set_lnl(struct ivpu_device *vdev);
+ void ivpu_hw_btrs_ats_print_lnl(struct ivpu_device *vdev);
+ void ivpu_hw_btrs_clock_relinquish_disable_lnl(struct ivpu_device *vdev);
++u32 ivpu_hw_btrs_dpu_max_freq_get(struct ivpu_device *vdev);
+ bool ivpu_hw_btrs_irq_handler_mtl(struct ivpu_device *vdev, int irq);
+ bool ivpu_hw_btrs_irq_handler_lnl(struct ivpu_device *vdev, int irq);
+ int ivpu_hw_btrs_dct_get_request(struct ivpu_device *vdev, bool *enable);
+ void ivpu_hw_btrs_dct_set_status(struct ivpu_device *vdev, bool enable, u32 dct_percent);
+-u32 ivpu_hw_btrs_pll_freq_get(struct ivpu_device *vdev);
+-u32 ivpu_hw_btrs_ratio_to_freq(struct ivpu_device *vdev, u32 ratio);
+ u32 ivpu_hw_btrs_telemetry_offset_get(struct ivpu_device *vdev);
+ u32 ivpu_hw_btrs_telemetry_size_get(struct ivpu_device *vdev);
+ u32 ivpu_hw_btrs_telemetry_enable_get(struct ivpu_device *vdev);
+--- a/include/uapi/drm/ivpu_accel.h
++++ b/include/uapi/drm/ivpu_accel.h
+@@ -1,6 +1,6 @@
+ /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
+ /*
+- * Copyright (C) 2020-2024 Intel Corporation
++ * Copyright (C) 2020-2025 Intel Corporation
+ */
+
+ #ifndef __UAPI_IVPU_DRM_H__
+@@ -128,7 +128,7 @@ struct drm_ivpu_param {
+ * platform type when executing on a simulator or emulator (read-only)
+ *
+ * %DRM_IVPU_PARAM_CORE_CLOCK_RATE:
+- * Current PLL frequency (read-only)
++ * Maximum frequency of the NPU data processing unit clock (read-only)
+ *
+ * %DRM_IVPU_PARAM_NUM_CONTEXTS:
+ * Maximum number of simultaneously existing contexts (read-only)
--- /dev/null
+From e6e07b696da529e85d1ba880555b5df5c80a46bd Mon Sep 17 00:00:00 2001
+From: "T.J. Mercier" <tjmercier@google.com>
+Date: Wed, 9 Apr 2025 22:51:11 +0000
+Subject: alloc_tag: handle incomplete bulk allocations in vm_module_tags_populate
+
+From: T.J. Mercier <tjmercier@google.com>
+
+commit e6e07b696da529e85d1ba880555b5df5c80a46bd upstream.
+
+alloc_pages_bulk_node() may partially succeed and allocate fewer than the
+requested nr_pages. There are several conditions under which this can
+occur, but we have encountered the case where CONFIG_PAGE_OWNER is enabled
+causing all bulk allocations to always fallback to single page allocations
+due to commit 187ad460b841 ("mm/page_alloc: avoid page allocator recursion
+with pagesets.lock held").
+
+Currently vm_module_tags_populate() immediately fails when
+alloc_pages_bulk_node() returns fewer than the requested number of pages.
+When this happens memory allocation profiling gets disabled, for example
+
+[ 14.297583] [9: modprobe: 465] Failed to allocate memory for allocation tags in the module scsc_wlan. Memory allocation profiling is disabled!
+[ 14.299339] [9: modprobe: 465] modprobe: Failed to insmod '/vendor/lib/modules/scsc_wlan.ko' with args '': Out of memory
+
+This patch causes vm_module_tags_populate() to retry bulk allocations for
+the remaining memory instead of failing immediately which will avoid the
+disablement of memory allocation profiling.
+
+Link: https://lkml.kernel.org/r/20250409225111.3770347-1-tjmercier@google.com
+Fixes: 0f9b685626da ("alloc_tag: populate memory for module tags as needed")
+Signed-off-by: T.J. Mercier <tjmercier@google.com>
+Reported-by: Janghyuck Kim <janghyuck.kim@samsung.com>
+Acked-by: Suren Baghdasaryan <surenb@google.com>
+Cc: Kent Overstreet <kent.overstreet@linux.dev>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ lib/alloc_tag.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+--- a/lib/alloc_tag.c
++++ b/lib/alloc_tag.c
+@@ -422,11 +422,20 @@ static int vm_module_tags_populate(void)
+ unsigned long old_shadow_end = ALIGN(phys_end, MODULE_ALIGN);
+ unsigned long new_shadow_end = ALIGN(new_end, MODULE_ALIGN);
+ unsigned long more_pages;
+- unsigned long nr;
++ unsigned long nr = 0;
+
+ more_pages = ALIGN(new_end - phys_end, PAGE_SIZE) >> PAGE_SHIFT;
+- nr = alloc_pages_bulk_node(GFP_KERNEL | __GFP_NOWARN,
+- NUMA_NO_NODE, more_pages, next_page);
++ while (nr < more_pages) {
++ unsigned long allocated;
++
++ allocated = alloc_pages_bulk_node(GFP_KERNEL | __GFP_NOWARN,
++ NUMA_NO_NODE, more_pages - nr, next_page + nr);
++
++ if (!allocated)
++ break;
++ nr += allocated;
++ }
++
+ if (nr < more_pages ||
+ vmap_pages_range(phys_end, phys_end + (nr << PAGE_SHIFT), PAGE_KERNEL,
+ next_page, PAGE_SHIFT) < 0) {
--- /dev/null
+From 7648beb65600220996ebb2da207610b1ff9b735e Mon Sep 17 00:00:00 2001
+From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Date: Thu, 3 Apr 2025 17:02:09 +0100
+Subject: ASoC: codecs:lpass-wsa-macro: Fix logic of enabling vi channels
+
+From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+
+commit 7648beb65600220996ebb2da207610b1ff9b735e upstream.
+
+Existing code only configures one of WSA_MACRO_TX0 or WSA_MACRO_TX1
+paths eventhough we enable both of them. Fix this bug by adding proper
+checks and rearranging some of the common code to able to allow setting
+both TX0 and TX1 paths
+
+Without this patch only one channel gets enabled in VI path instead of 2
+channels. End result would be 1 channel recording instead of 2.
+
+Fixes: 2c4066e5d428 ("ASoC: codecs: lpass-wsa-macro: add dapm widgets and route")
+Cc: stable@vger.kernel.org
+Co-developed-by: Manikantan R <quic_manrav@quicinc.com>
+Signed-off-by: Manikantan R <quic_manrav@quicinc.com>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
+Link: https://patch.msgid.link/20250403160209.21613-3-srinivas.kandagatla@linaro.org
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/soc/codecs/lpass-wsa-macro.c | 108 +++++++++++++++++++++----------------
+ 1 file changed, 63 insertions(+), 45 deletions(-)
+
+--- a/sound/soc/codecs/lpass-wsa-macro.c
++++ b/sound/soc/codecs/lpass-wsa-macro.c
+@@ -1459,6 +1459,67 @@ static void wsa_macro_mclk_enable(struct
+ }
+ }
+
++static void wsa_macro_enable_disable_vi_sense(struct snd_soc_component *component, bool enable,
++ u32 tx_reg0, u32 tx_reg1, u32 val)
++{
++ if (enable) {
++ /* Enable V&I sensing */
++ snd_soc_component_update_bits(component, tx_reg0,
++ CDC_WSA_TX_SPKR_PROT_RESET_MASK,
++ CDC_WSA_TX_SPKR_PROT_RESET);
++ snd_soc_component_update_bits(component, tx_reg1,
++ CDC_WSA_TX_SPKR_PROT_RESET_MASK,
++ CDC_WSA_TX_SPKR_PROT_RESET);
++ snd_soc_component_update_bits(component, tx_reg0,
++ CDC_WSA_TX_SPKR_PROT_PCM_RATE_MASK,
++ val);
++ snd_soc_component_update_bits(component, tx_reg1,
++ CDC_WSA_TX_SPKR_PROT_PCM_RATE_MASK,
++ val);
++ snd_soc_component_update_bits(component, tx_reg0,
++ CDC_WSA_TX_SPKR_PROT_CLK_EN_MASK,
++ CDC_WSA_TX_SPKR_PROT_CLK_ENABLE);
++ snd_soc_component_update_bits(component, tx_reg1,
++ CDC_WSA_TX_SPKR_PROT_CLK_EN_MASK,
++ CDC_WSA_TX_SPKR_PROT_CLK_ENABLE);
++ snd_soc_component_update_bits(component, tx_reg0,
++ CDC_WSA_TX_SPKR_PROT_RESET_MASK,
++ CDC_WSA_TX_SPKR_PROT_NO_RESET);
++ snd_soc_component_update_bits(component, tx_reg1,
++ CDC_WSA_TX_SPKR_PROT_RESET_MASK,
++ CDC_WSA_TX_SPKR_PROT_NO_RESET);
++ } else {
++ snd_soc_component_update_bits(component, tx_reg0,
++ CDC_WSA_TX_SPKR_PROT_RESET_MASK,
++ CDC_WSA_TX_SPKR_PROT_RESET);
++ snd_soc_component_update_bits(component, tx_reg1,
++ CDC_WSA_TX_SPKR_PROT_RESET_MASK,
++ CDC_WSA_TX_SPKR_PROT_RESET);
++ snd_soc_component_update_bits(component, tx_reg0,
++ CDC_WSA_TX_SPKR_PROT_CLK_EN_MASK,
++ CDC_WSA_TX_SPKR_PROT_CLK_DISABLE);
++ snd_soc_component_update_bits(component, tx_reg1,
++ CDC_WSA_TX_SPKR_PROT_CLK_EN_MASK,
++ CDC_WSA_TX_SPKR_PROT_CLK_DISABLE);
++ }
++}
++
++static void wsa_macro_enable_disable_vi_feedback(struct snd_soc_component *component,
++ bool enable, u32 rate)
++{
++ struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
++
++ if (test_bit(WSA_MACRO_TX0, &wsa->active_ch_mask[WSA_MACRO_AIF_VI]))
++ wsa_macro_enable_disable_vi_sense(component, enable,
++ CDC_WSA_TX0_SPKR_PROT_PATH_CTL,
++ CDC_WSA_TX1_SPKR_PROT_PATH_CTL, rate);
++
++ if (test_bit(WSA_MACRO_TX1, &wsa->active_ch_mask[WSA_MACRO_AIF_VI]))
++ wsa_macro_enable_disable_vi_sense(component, enable,
++ CDC_WSA_TX2_SPKR_PROT_PATH_CTL,
++ CDC_WSA_TX3_SPKR_PROT_PATH_CTL, rate);
++}
++
+ static int wsa_macro_mclk_event(struct snd_soc_dapm_widget *w,
+ struct snd_kcontrol *kcontrol, int event)
+ {
+@@ -1475,7 +1536,6 @@ static int wsa_macro_enable_vi_feedback(
+ {
+ struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+ struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
+- u32 tx_reg0, tx_reg1;
+ u32 rate_val;
+
+ switch (wsa->pcm_rate_vi) {
+@@ -1499,56 +1559,14 @@ static int wsa_macro_enable_vi_feedback(
+ break;
+ }
+
+- if (test_bit(WSA_MACRO_TX0, &wsa->active_ch_mask[WSA_MACRO_AIF_VI])) {
+- tx_reg0 = CDC_WSA_TX0_SPKR_PROT_PATH_CTL;
+- tx_reg1 = CDC_WSA_TX1_SPKR_PROT_PATH_CTL;
+- } else if (test_bit(WSA_MACRO_TX1, &wsa->active_ch_mask[WSA_MACRO_AIF_VI])) {
+- tx_reg0 = CDC_WSA_TX2_SPKR_PROT_PATH_CTL;
+- tx_reg1 = CDC_WSA_TX3_SPKR_PROT_PATH_CTL;
+- }
+-
+ switch (event) {
+ case SND_SOC_DAPM_POST_PMU:
+ /* Enable V&I sensing */
+- snd_soc_component_update_bits(component, tx_reg0,
+- CDC_WSA_TX_SPKR_PROT_RESET_MASK,
+- CDC_WSA_TX_SPKR_PROT_RESET);
+- snd_soc_component_update_bits(component, tx_reg1,
+- CDC_WSA_TX_SPKR_PROT_RESET_MASK,
+- CDC_WSA_TX_SPKR_PROT_RESET);
+- snd_soc_component_update_bits(component, tx_reg0,
+- CDC_WSA_TX_SPKR_PROT_PCM_RATE_MASK,
+- rate_val);
+- snd_soc_component_update_bits(component, tx_reg1,
+- CDC_WSA_TX_SPKR_PROT_PCM_RATE_MASK,
+- rate_val);
+- snd_soc_component_update_bits(component, tx_reg0,
+- CDC_WSA_TX_SPKR_PROT_CLK_EN_MASK,
+- CDC_WSA_TX_SPKR_PROT_CLK_ENABLE);
+- snd_soc_component_update_bits(component, tx_reg1,
+- CDC_WSA_TX_SPKR_PROT_CLK_EN_MASK,
+- CDC_WSA_TX_SPKR_PROT_CLK_ENABLE);
+- snd_soc_component_update_bits(component, tx_reg0,
+- CDC_WSA_TX_SPKR_PROT_RESET_MASK,
+- CDC_WSA_TX_SPKR_PROT_NO_RESET);
+- snd_soc_component_update_bits(component, tx_reg1,
+- CDC_WSA_TX_SPKR_PROT_RESET_MASK,
+- CDC_WSA_TX_SPKR_PROT_NO_RESET);
++ wsa_macro_enable_disable_vi_feedback(component, true, rate_val);
+ break;
+ case SND_SOC_DAPM_POST_PMD:
+ /* Disable V&I sensing */
+- snd_soc_component_update_bits(component, tx_reg0,
+- CDC_WSA_TX_SPKR_PROT_RESET_MASK,
+- CDC_WSA_TX_SPKR_PROT_RESET);
+- snd_soc_component_update_bits(component, tx_reg1,
+- CDC_WSA_TX_SPKR_PROT_RESET_MASK,
+- CDC_WSA_TX_SPKR_PROT_RESET);
+- snd_soc_component_update_bits(component, tx_reg0,
+- CDC_WSA_TX_SPKR_PROT_CLK_EN_MASK,
+- CDC_WSA_TX_SPKR_PROT_CLK_DISABLE);
+- snd_soc_component_update_bits(component, tx_reg1,
+- CDC_WSA_TX_SPKR_PROT_CLK_EN_MASK,
+- CDC_WSA_TX_SPKR_PROT_CLK_DISABLE);
++ wsa_macro_enable_disable_vi_feedback(component, false, rate_val);
+ break;
+ }
+
--- /dev/null
+From d7bff1415e85b889dc8908be6aedba8807ae5e37 Mon Sep 17 00:00:00 2001
+From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Date: Thu, 3 Apr 2025 17:02:08 +0100
+Subject: ASoC: codecs:lpass-wsa-macro: Fix vi feedback rate
+
+From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+
+commit d7bff1415e85b889dc8908be6aedba8807ae5e37 upstream.
+
+Currently the VI feedback rate is set to fixed 8K, fix this by getting
+the correct rate from params_rate.
+
+Without this patch incorrect rate will be set on the VI feedback
+recording resulting in rate miss match and audio artifacts.
+
+Fixes: 2c4066e5d428 ("ASoC: codecs: lpass-wsa-macro: add dapm widgets and route")
+Cc: stable@vger.kernel.org
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
+Link: https://patch.msgid.link/20250403160209.21613-2-srinivas.kandagatla@linaro.org
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/soc/codecs/lpass-wsa-macro.c | 39 ++++++++++++++++++++++++++++++++++---
+ 1 file changed, 36 insertions(+), 3 deletions(-)
+
+--- a/sound/soc/codecs/lpass-wsa-macro.c
++++ b/sound/soc/codecs/lpass-wsa-macro.c
+@@ -63,6 +63,10 @@
+ #define CDC_WSA_TX_SPKR_PROT_CLK_DISABLE 0
+ #define CDC_WSA_TX_SPKR_PROT_PCM_RATE_MASK GENMASK(3, 0)
+ #define CDC_WSA_TX_SPKR_PROT_PCM_RATE_8K 0
++#define CDC_WSA_TX_SPKR_PROT_PCM_RATE_16K 1
++#define CDC_WSA_TX_SPKR_PROT_PCM_RATE_24K 2
++#define CDC_WSA_TX_SPKR_PROT_PCM_RATE_32K 3
++#define CDC_WSA_TX_SPKR_PROT_PCM_RATE_48K 4
+ #define CDC_WSA_TX0_SPKR_PROT_PATH_CFG0 (0x0248)
+ #define CDC_WSA_TX1_SPKR_PROT_PATH_CTL (0x0264)
+ #define CDC_WSA_TX1_SPKR_PROT_PATH_CFG0 (0x0268)
+@@ -407,6 +411,7 @@ struct wsa_macro {
+ int ear_spkr_gain;
+ int spkr_gain_offset;
+ int spkr_mode;
++ u32 pcm_rate_vi;
+ int is_softclip_on[WSA_MACRO_SOFTCLIP_MAX];
+ int softclip_clk_users[WSA_MACRO_SOFTCLIP_MAX];
+ struct regmap *regmap;
+@@ -1280,6 +1285,7 @@ static int wsa_macro_hw_params(struct sn
+ struct snd_soc_dai *dai)
+ {
+ struct snd_soc_component *component = dai->component;
++ struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
+ int ret;
+
+ switch (substream->stream) {
+@@ -1292,6 +1298,11 @@ static int wsa_macro_hw_params(struct sn
+ return ret;
+ }
+ break;
++ case SNDRV_PCM_STREAM_CAPTURE:
++ if (dai->id == WSA_MACRO_AIF_VI)
++ wsa->pcm_rate_vi = params_rate(params);
++
++ break;
+ default:
+ break;
+ }
+@@ -1465,6 +1476,28 @@ static int wsa_macro_enable_vi_feedback(
+ struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+ struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
+ u32 tx_reg0, tx_reg1;
++ u32 rate_val;
++
++ switch (wsa->pcm_rate_vi) {
++ case 8000:
++ rate_val = CDC_WSA_TX_SPKR_PROT_PCM_RATE_8K;
++ break;
++ case 16000:
++ rate_val = CDC_WSA_TX_SPKR_PROT_PCM_RATE_16K;
++ break;
++ case 24000:
++ rate_val = CDC_WSA_TX_SPKR_PROT_PCM_RATE_24K;
++ break;
++ case 32000:
++ rate_val = CDC_WSA_TX_SPKR_PROT_PCM_RATE_32K;
++ break;
++ case 48000:
++ rate_val = CDC_WSA_TX_SPKR_PROT_PCM_RATE_48K;
++ break;
++ default:
++ rate_val = CDC_WSA_TX_SPKR_PROT_PCM_RATE_8K;
++ break;
++ }
+
+ if (test_bit(WSA_MACRO_TX0, &wsa->active_ch_mask[WSA_MACRO_AIF_VI])) {
+ tx_reg0 = CDC_WSA_TX0_SPKR_PROT_PATH_CTL;
+@@ -1476,7 +1509,7 @@ static int wsa_macro_enable_vi_feedback(
+
+ switch (event) {
+ case SND_SOC_DAPM_POST_PMU:
+- /* Enable V&I sensing */
++ /* Enable V&I sensing */
+ snd_soc_component_update_bits(component, tx_reg0,
+ CDC_WSA_TX_SPKR_PROT_RESET_MASK,
+ CDC_WSA_TX_SPKR_PROT_RESET);
+@@ -1485,10 +1518,10 @@ static int wsa_macro_enable_vi_feedback(
+ CDC_WSA_TX_SPKR_PROT_RESET);
+ snd_soc_component_update_bits(component, tx_reg0,
+ CDC_WSA_TX_SPKR_PROT_PCM_RATE_MASK,
+- CDC_WSA_TX_SPKR_PROT_PCM_RATE_8K);
++ rate_val);
+ snd_soc_component_update_bits(component, tx_reg1,
+ CDC_WSA_TX_SPKR_PROT_PCM_RATE_MASK,
+- CDC_WSA_TX_SPKR_PROT_PCM_RATE_8K);
++ rate_val);
+ snd_soc_component_update_bits(component, tx_reg0,
+ CDC_WSA_TX_SPKR_PROT_CLK_EN_MASK,
+ CDC_WSA_TX_SPKR_PROT_CLK_ENABLE);
--- /dev/null
+From 9aa33d5b4a53a1945dd2aee45c09282248d3c98b Mon Sep 17 00:00:00 2001
+From: Herve Codina <herve.codina@bootlin.com>
+Date: Thu, 10 Apr 2025 11:16:43 +0200
+Subject: ASoC: fsl: fsl_qmc_audio: Reset audio data pointers on TRIGGER_START event
+
+From: Herve Codina <herve.codina@bootlin.com>
+
+commit 9aa33d5b4a53a1945dd2aee45c09282248d3c98b upstream.
+
+On SNDRV_PCM_TRIGGER_START event, audio data pointers are not reset.
+
+This leads to wrong data buffer usage when multiple TRIGGER_START are
+received and ends to incorrect buffer usage between the user-space and
+the driver. Indeed, the driver can read data that are not already set by
+the user-space or the user-space and the driver are writing and reading
+the same area.
+
+Fix that resetting data pointers on each SNDRV_PCM_TRIGGER_START events.
+
+Fixes: 075c7125b11c ("ASoC: fsl: Add support for QMC audio")
+Cc: stable@vger.kernel.org
+Signed-off-by: Herve Codina <herve.codina@bootlin.com>
+Link: https://patch.msgid.link/20250410091643.535627-1-herve.codina@bootlin.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/soc/fsl/fsl_qmc_audio.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/sound/soc/fsl/fsl_qmc_audio.c
++++ b/sound/soc/fsl/fsl_qmc_audio.c
+@@ -250,6 +250,9 @@ static int qmc_audio_pcm_trigger(struct
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ bitmap_zero(prtd->chans_pending, 64);
++ prtd->buffer_ended = 0;
++ prtd->ch_dma_addr_current = prtd->ch_dma_addr_start;
++
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ for (i = 0; i < prtd->channels; i++)
+ prtd->qmc_dai->chans[i].prtd_tx = prtd;
--- /dev/null
+From dfcf3dde45df383f2695c3d3475fec153d2c7dbe Mon Sep 17 00:00:00 2001
+From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
+Date: Fri, 4 Apr 2025 16:32:13 +0300
+Subject: ASoC: Intel: sof_sdw: Add quirk for Asus Zenbook S16
+
+From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
+
+commit dfcf3dde45df383f2695c3d3475fec153d2c7dbe upstream.
+
+Asus laptops with sound PCI subsystem ID 1043:1f43 have the DMICs
+connected to the host instead of the CS42L43 so need the
+SOC_SDW_CODEC_MIC quirk.
+
+Link: https://github.com/thesofproject/sof/issues/9930
+Fixes: 084344970808 ("ASoC: Intel: sof_sdw: Add quirk for Asus Zenbook S14")
+Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
+Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
+Reviewed-by: Simon Trimmer <simont@opensource.cirrus.com>
+Cc: stable@vger.kernel.org
+Link: https://patch.msgid.link/20250404133213.4658-1-peter.ujfalusi@linux.intel.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/soc/intel/boards/sof_sdw.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/soc/intel/boards/sof_sdw.c
++++ b/sound/soc/intel/boards/sof_sdw.c
+@@ -764,6 +764,7 @@ static const struct dmi_system_id sof_sd
+
+ static const struct snd_pci_quirk sof_sdw_ssid_quirk_table[] = {
+ SND_PCI_QUIRK(0x1043, 0x1e13, "ASUS Zenbook S14", SOC_SDW_CODEC_MIC),
++ SND_PCI_QUIRK(0x1043, 0x1f43, "ASUS Zenbook S16", SOC_SDW_CODEC_MIC),
+ {}
+ };
+
--- /dev/null
+From a31a4934b31faea76e735bab17e63d02fcd8e029 Mon Sep 17 00:00:00 2001
+From: Evgeny Pimenov <pimenoveu12@gmail.com>
+Date: Tue, 1 Apr 2025 23:40:58 +0300
+Subject: ASoC: qcom: Fix sc7280 lpass potential buffer overflow
+
+From: Evgeny Pimenov <pimenoveu12@gmail.com>
+
+commit a31a4934b31faea76e735bab17e63d02fcd8e029 upstream.
+
+Case values introduced in commit
+5f78e1fb7a3e ("ASoC: qcom: Add driver support for audioreach solution")
+cause out of bounds access in arrays of sc7280 driver data (e.g. in case
+of RX_CODEC_DMA_RX_0 in sc7280_snd_hw_params()).
+
+Redefine LPASS_MAX_PORTS to consider the maximum possible port id for
+q6dsp as sc7280 driver utilizes some of those values.
+
+Found by Linux Verification Center (linuxtesting.org) with SVACE.
+
+Fixes: 77d0ffef793d ("ASoC: qcom: Add macro for lpass DAI id's max limit")
+Cc: stable@vger.kernel.org # v6.0+
+Suggested-by: Mikhail Kobuk <m.kobuk@ispras.ru>
+Suggested-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
+Signed-off-by: Evgeny Pimenov <pimenoveu12@gmail.com>
+Link: https://patch.msgid.link/20250401204058.32261-1-pimenoveu12@gmail.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/soc/qcom/lpass.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/sound/soc/qcom/lpass.h
++++ b/sound/soc/qcom/lpass.h
+@@ -13,10 +13,11 @@
+ #include <linux/platform_device.h>
+ #include <linux/regmap.h>
+ #include <dt-bindings/sound/qcom,lpass.h>
++#include <dt-bindings/sound/qcom,q6afe.h>
+ #include "lpass-hdmi.h"
+
+ #define LPASS_AHBIX_CLOCK_FREQUENCY 131072000
+-#define LPASS_MAX_PORTS (LPASS_CDC_DMA_VA_TX8 + 1)
++#define LPASS_MAX_PORTS (DISPLAY_PORT_RX_7 + 1)
+ #define LPASS_MAX_MI2S_PORTS (8)
+ #define LPASS_MAX_DMA_CHANNELS (8)
+ #define LPASS_MAX_HDMI_DMA_CHANNELS (4)
--- /dev/null
+From 6c683c6887e4addcd6bd1ddce08cafccb0a21e32 Mon Sep 17 00:00:00 2001
+From: Denis Arefev <arefev@swemel.ru>
+Date: Thu, 3 Apr 2025 15:26:01 +0300
+Subject: asus-laptop: Fix an uninitialized variable
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Denis Arefev <arefev@swemel.ru>
+
+commit 6c683c6887e4addcd6bd1ddce08cafccb0a21e32 upstream.
+
+The value returned by acpi_evaluate_integer() is not checked,
+but the result is not always successful, so it is necessary to
+add a check of the returned value.
+
+If the result remains negative during three iterations of the loop,
+then the uninitialized variable 'val' will be used in the clamp_val()
+macro, so it must be initialized with the current value of the 'curr'
+variable.
+
+In this case, the algorithm should be less noisy.
+
+Found by Linux Verification Center (linuxtesting.org) with SVACE.
+
+Fixes: b23910c2194e ("asus-laptop: Pegatron Lucid accelerometer")
+Cc: stable@vger.kernel.org
+Signed-off-by: Denis Arefev <arefev@swemel.ru>
+Link: https://lore.kernel.org/r/20250403122603.18172-1-arefev@swemel.ru
+Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/asus-laptop.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/platform/x86/asus-laptop.c
++++ b/drivers/platform/x86/asus-laptop.c
+@@ -426,11 +426,14 @@ static int asus_pega_lucid_set(struct as
+
+ static int pega_acc_axis(struct asus_laptop *asus, int curr, char *method)
+ {
++ unsigned long long val = (unsigned long long)curr;
++ acpi_status status;
+ int i, delta;
+- unsigned long long val;
+- for (i = 0; i < PEGA_ACC_RETRIES; i++) {
+- acpi_evaluate_integer(asus->handle, method, NULL, &val);
+
++ for (i = 0; i < PEGA_ACC_RETRIES; i++) {
++ status = acpi_evaluate_integer(asus->handle, method, NULL, &val);
++ if (ACPI_FAILURE(status))
++ continue;
+ /* The output is noisy. From reading the ASL
+ * dissassembly, timeout errors are returned with 1's
+ * in the high word, and the lack of locking around
--- /dev/null
+From 39e160505198ff8c158f11bce2ba19809a756e8b Mon Sep 17 00:00:00 2001
+From: "Martin K. Petersen" <martin.petersen@oracle.com>
+Date: Wed, 16 Apr 2025 16:04:10 -0400
+Subject: block: integrity: Do not call set_page_dirty_lock()
+
+From: Martin K. Petersen <martin.petersen@oracle.com>
+
+commit 39e160505198ff8c158f11bce2ba19809a756e8b upstream.
+
+Placing multiple protection information buffers inside the same page
+can lead to oopses because set_page_dirty_lock() can't be called from
+interrupt context.
+
+Since a protection information buffer is not backed by a file there is
+no point in setting its page dirty, there is nothing to synchronize.
+Drop the call to set_page_dirty_lock() and remove the last argument to
+bio_integrity_unpin_bvec().
+
+Cc: stable@vger.kernel.org
+Fixes: 492c5d455969 ("block: bio-integrity: directly map user buffers")
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Reviewed-by: Keith Busch <kbusch@kernel.org>
+Link: https://lore.kernel.org/r/yq1v7r3ev9g.fsf@ca-mkp.ca.oracle.com
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/bio-integrity.c | 17 ++++++-----------
+ 1 file changed, 6 insertions(+), 11 deletions(-)
+
+--- a/block/bio-integrity.c
++++ b/block/bio-integrity.c
+@@ -104,16 +104,12 @@ err:
+ }
+ EXPORT_SYMBOL(bio_integrity_alloc);
+
+-static void bio_integrity_unpin_bvec(struct bio_vec *bv, int nr_vecs,
+- bool dirty)
++static void bio_integrity_unpin_bvec(struct bio_vec *bv, int nr_vecs)
+ {
+ int i;
+
+- for (i = 0; i < nr_vecs; i++) {
+- if (dirty && !PageCompound(bv[i].bv_page))
+- set_page_dirty_lock(bv[i].bv_page);
++ for (i = 0; i < nr_vecs; i++)
+ unpin_user_page(bv[i].bv_page);
+- }
+ }
+
+ static void bio_integrity_uncopy_user(struct bio_integrity_payload *bip)
+@@ -129,7 +125,7 @@ static void bio_integrity_uncopy_user(st
+ ret = copy_to_iter(bvec_virt(bounce_bvec), bytes, &orig_iter);
+ WARN_ON_ONCE(ret != bytes);
+
+- bio_integrity_unpin_bvec(orig_bvecs, orig_nr_vecs, true);
++ bio_integrity_unpin_bvec(orig_bvecs, orig_nr_vecs);
+ }
+
+ /**
+@@ -149,8 +145,7 @@ void bio_integrity_unmap_user(struct bio
+ return;
+ }
+
+- bio_integrity_unpin_bvec(bip->bip_vec, bip->bip_max_vcnt,
+- bio_data_dir(bio) == READ);
++ bio_integrity_unpin_bvec(bip->bip_vec, bip->bip_max_vcnt);
+ }
+
+ /**
+@@ -236,7 +231,7 @@ static int bio_integrity_copy_user(struc
+ }
+
+ if (write)
+- bio_integrity_unpin_bvec(bvec, nr_vecs, false);
++ bio_integrity_unpin_bvec(bvec, nr_vecs);
+ else
+ memcpy(&bip->bip_vec[1], bvec, nr_vecs * sizeof(*bvec));
+
+@@ -357,7 +352,7 @@ int bio_integrity_map_user(struct bio *b
+ return 0;
+
+ release_pages:
+- bio_integrity_unpin_bvec(bvec, nr_bvecs, false);
++ bio_integrity_unpin_bvec(bvec, nr_bvecs);
+ free_bvec:
+ if (bvec != stack_vec)
+ kfree(bvec);
--- /dev/null
+From a3cd5f507b72c0532c3345b6913557efab34f405 Mon Sep 17 00:00:00 2001
+From: Miguel Ojeda <ojeda@kernel.org>
+Date: Sun, 13 Apr 2025 02:23:38 +0200
+Subject: objtool/rust: add one more `noreturn` Rust function for Rust 1.86.0
+
+From: Miguel Ojeda <ojeda@kernel.org>
+
+commit a3cd5f507b72c0532c3345b6913557efab34f405 upstream.
+
+Starting with Rust 1.86.0 (see upstream commit b151b513ba2b ("Insert null
+checks for pointer dereferences when debug assertions are enabled") [1]),
+under some kernel configurations with `CONFIG_RUST_DEBUG_ASSERTIONS=y`,
+one may trigger a new `objtool` warning:
+
+ rust/kernel.o: warning: objtool: _R..._6kernel9workqueue6system()
+ falls through to next function _R...9workqueue14system_highpri()
+
+due to a call to the `noreturn` symbol:
+
+ core::panicking::panic_null_pointer_dereference
+
+Thus add it to the list so that `objtool` knows it is actually `noreturn`.
+
+See commit 56d680dd23c3 ("objtool/rust: list `noreturn` Rust functions")
+for more details.
+
+Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
+Fixes: 56d680dd23c3 ("objtool/rust: list `noreturn` Rust functions")
+Link: https://github.com/rust-lang/rust/commit/b151b513ba2b65c7506ec1a80f2712bbd09154d1 [1]
+Reviewed-by: Alice Ryhl <aliceryhl@google.com>
+Link: https://lore.kernel.org/r/20250413002338.1741593-1-ojeda@kernel.org
+Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/objtool/check.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/tools/objtool/check.c
++++ b/tools/objtool/check.c
+@@ -226,6 +226,7 @@ static bool is_rust_noreturn(const struc
+ str_ends_with(func->name, "_4core9panicking14panic_nounwind") ||
+ str_ends_with(func->name, "_4core9panicking18panic_bounds_check") ||
+ str_ends_with(func->name, "_4core9panicking19assert_failed_inner") ||
++ str_ends_with(func->name, "_4core9panicking30panic_null_pointer_dereference") ||
+ str_ends_with(func->name, "_4core9panicking36panic_misaligned_pointer_dereference") ||
+ strstr(func->name, "_4core9panicking13assert_failed") ||
+ strstr(func->name, "_4core9panicking11panic_const24panic_const_") ||
--- /dev/null
+From bc0b828ef6e561081ebc4c758d0c4d166bb9829c Mon Sep 17 00:00:00 2001
+From: Alex Williamson <alex.williamson@redhat.com>
+Date: Mon, 14 Apr 2025 15:18:23 -0600
+Subject: Revert "PCI: Avoid reset when disabled via sysfs"
+
+From: Alex Williamson <alex.williamson@redhat.com>
+
+commit bc0b828ef6e561081ebc4c758d0c4d166bb9829c upstream.
+
+This reverts commit 479380efe1625e251008d24b2810283db60d6fcd.
+
+The reset_method attribute on a PCI device is only intended to manage the
+availability of function scoped resets for a device. It was never intended
+to restrict resets targeting the bus or slot.
+
+In introducing a restriction that each device must support function level
+reset by testing pci_reset_supported(), we essentially create a catch-22,
+that a device must have a function scope reset in order to support bus/slot
+reset, when we use bus/slot reset to effect a reset of a device that does
+not support a function scoped reset, especially multi-function devices.
+
+This breaks the majority of uses cases where vfio-pci uses bus/slot resets
+to manage multifunction devices that do not support function scoped resets.
+
+Fixes: 479380efe162 ("PCI: Avoid reset when disabled via sysfs")
+Reported-by: Cal Peake <cp@absolutedigital.net>
+Closes: https://lore.kernel.org/all/808e1111-27b7-f35b-6d5c-5b275e73677b@absolutedigital.net
+Reported-by: Athul Krishna <athul.krishna.kr@protonmail.com>
+Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220010
+Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Reviewed-by: Kevin Tian <kevin.tian@intel.com>
+Cc: stable@vger.kernel.org
+Link: https://patch.msgid.link/20250414211828.3530741-1-alex.williamson@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pci/pci.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/drivers/pci/pci.c
++++ b/drivers/pci/pci.c
+@@ -5419,8 +5419,6 @@ static bool pci_bus_resettable(struct pc
+ return false;
+
+ list_for_each_entry(dev, &bus->devices, bus_list) {
+- if (!pci_reset_supported(dev))
+- return false;
+ if (dev->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET ||
+ (dev->subordinate && !pci_bus_resettable(dev->subordinate)))
+ return false;
+@@ -5497,8 +5495,6 @@ static bool pci_slot_resettable(struct p
+ list_for_each_entry(dev, &slot->bus->devices, bus_list) {
+ if (!dev->slot || dev->slot != slot)
+ continue;
+- if (!pci_reset_supported(dev))
+- return false;
+ if (dev->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET ||
+ (dev->subordinate && !pci_bus_resettable(dev->subordinate)))
+ return false;
--- /dev/null
+From 0866ee8e50f017731b80891294c0edd0f5fcd0a9 Mon Sep 17 00:00:00 2001
+From: Miguel Ojeda <ojeda@kernel.org>
+Date: Thu, 3 Apr 2025 18:38:05 +0200
+Subject: rust: disable `clippy::needless_continue`
+
+From: Miguel Ojeda <ojeda@kernel.org>
+
+commit 0866ee8e50f017731b80891294c0edd0f5fcd0a9 upstream.
+
+Starting with Rust 1.86.0, Clippy's `needless_continue` lint complains
+about the last statement of a loop [1], including cases like:
+
+ while ... {
+ match ... {
+ ... if ... => {
+ ...
+ return ...;
+ }
+ _ => continue,
+ }
+ }
+
+as well as nested `match`es in a loop.
+
+One solution is changing `continue` for `()` [2], but arguably using
+`continue` shows the intent better when it is alone in an arm like that.
+
+Moreover, I am not sure we want to force people to try to find other
+ways to write the code either, in cases when that applies.
+
+In addition, the help text does not really apply in the new cases the
+lint has introduced, e.g. here one cannot simply "drop" the expression:
+
+ warning: this `continue` expression is redundant
+ --> rust/macros/helpers.rs:85:18
+ |
+ 85 | _ => continue,
+ | ^^^^^^^^
+ |
+ = help: consider dropping the `continue` expression
+ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_continue
+ = note: requested on the command line with `-W clippy::needless-continue`
+
+The examples in the documentation do not show a case like this, either,
+so the second "help" line does not help.
+
+In addition, locally disabling the lint is not possible with `expect`,
+since the behavior differs across versions. Using `allow` would be
+possible, but, even then, an extra line just for this is a bit too much,
+especially if there are other ways to satisfy the lint.
+
+Finally, the lint is still in the "pedantic" category and disabled by
+default by Clippy.
+
+Thus disable the lint, at least for the time being.
+
+Feedback was submitted to upstream Clippy, in case this can be improved
+or perhaps the lint split into several [3].
+
+Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
+Link: https://github.com/rust-lang/rust-clippy/pull/13891 [1]
+Link: https://lore.kernel.org/rust-for-linux/20250401221205.52381-1-ojeda@kernel.org/ [2]
+Link: https://github.com/rust-lang/rust-clippy/issues/14536 [3]
+Link: https://lore.kernel.org/r/20250403163805.67770-1-ojeda@kernel.org
+Reviewed-by: Alice Ryhl <aliceryhl@google.com>
+Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -480,7 +480,6 @@ export rust_common_flags := --edition=20
+ -Wclippy::ignored_unit_patterns \
+ -Wclippy::mut_mut \
+ -Wclippy::needless_bitwise_bool \
+- -Wclippy::needless_continue \
+ -Aclippy::needless_lifetimes \
+ -Wclippy::no_mangle_with_rust_abi \
+ -Wclippy::undocumented_unsafe_blocks \
--- /dev/null
+From 584e61452f75bfeac2cdd83730b4059526ec60c7 Mon Sep 17 00:00:00 2001
+From: FUJITA Tomonori <fujita.tomonori@gmail.com>
+Date: Sat, 12 Apr 2025 09:53:41 +0900
+Subject: rust: helpers: Remove volatile qualifier from io helpers
+
+From: FUJITA Tomonori <fujita.tomonori@gmail.com>
+
+commit 584e61452f75bfeac2cdd83730b4059526ec60c7 upstream.
+
+Remove the `volatile` qualifier used with __iomem in helper functions
+in io.c. These helper functions are just wrappers around the
+corresponding accessors so they are unnecessary.
+
+This fixes the following UML build error with CONFIG_RUST enabled:
+
+In file included from rust/helpers/helpers.c:19:
+rust/helpers/io.c:12:10: error: passing 'volatile void *' to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
+ 12 | iounmap(addr);
+ | ^~~~
+arch/um/include/asm/io.h:19:42: note: passing argument to parameter 'addr' here
+ 19 | static inline void iounmap(void __iomem *addr)
+ | ^
+1 error generated.
+
+[ Arnd explains [1] that removing the qualifier is the way forward
+ (thanks!):
+
+ Rihgt, I tried this last week when it came up first, removing the
+ 'volatile' annotations in the asm-generic/io.h header and then
+ all the ones that caused build regressions on arm/arm64/x86
+ randconfig and allmodconfig builds. This patch is a little
+ longer than my original version as I did run into a few
+ regressions later.
+
+ As far as I can tell, none of these volatile annotations have
+ any actual effect, and most of them date back to ancient kernels
+ where this may have been required.
+
+ Leaving it out of the rust interface is clearly the right way,
+ and it shouldn't be too hard to upstream the changes below
+ when we need to, but I also don't see any priority to send these.
+ If anyone wants to help out, I can send them the whole patch.
+
+ I created an issue [2] in case someone wants to help. - Miguel ]
+
+Fixes: ce30d94e6855 ("rust: add `io::{Io, IoRaw}` base types")
+Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
+Cc: stable@vger.kernel.org
+Reviewed-by: Danilo Krummrich <dakr@kernel.org>
+Link: https://lore.kernel.org/rust-for-linux/0c844b70-19c7-4b14-ba29-fc99ae0d69f0@app.fastmail.com/ [1]
+Link: https://github.com/Rust-for-Linux/linux/issues/1156 [2]
+Link: https://lore.kernel.org/r/20250412005341.157150-1-fujita.tomonori@gmail.com
+[ Reworded for relative paths. - Miguel ]
+Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ rust/helpers/io.c | 34 +++++++++++++++++-----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/rust/helpers/io.c b/rust/helpers/io.c
+index 4c2401ccd720..15ea187c5466 100644
+--- a/rust/helpers/io.c
++++ b/rust/helpers/io.c
+@@ -7,94 +7,94 @@ void __iomem *rust_helper_ioremap(phys_addr_t offset, size_t size)
+ return ioremap(offset, size);
+ }
+
+-void rust_helper_iounmap(volatile void __iomem *addr)
++void rust_helper_iounmap(void __iomem *addr)
+ {
+ iounmap(addr);
+ }
+
+-u8 rust_helper_readb(const volatile void __iomem *addr)
++u8 rust_helper_readb(const void __iomem *addr)
+ {
+ return readb(addr);
+ }
+
+-u16 rust_helper_readw(const volatile void __iomem *addr)
++u16 rust_helper_readw(const void __iomem *addr)
+ {
+ return readw(addr);
+ }
+
+-u32 rust_helper_readl(const volatile void __iomem *addr)
++u32 rust_helper_readl(const void __iomem *addr)
+ {
+ return readl(addr);
+ }
+
+ #ifdef CONFIG_64BIT
+-u64 rust_helper_readq(const volatile void __iomem *addr)
++u64 rust_helper_readq(const void __iomem *addr)
+ {
+ return readq(addr);
+ }
+ #endif
+
+-void rust_helper_writeb(u8 value, volatile void __iomem *addr)
++void rust_helper_writeb(u8 value, void __iomem *addr)
+ {
+ writeb(value, addr);
+ }
+
+-void rust_helper_writew(u16 value, volatile void __iomem *addr)
++void rust_helper_writew(u16 value, void __iomem *addr)
+ {
+ writew(value, addr);
+ }
+
+-void rust_helper_writel(u32 value, volatile void __iomem *addr)
++void rust_helper_writel(u32 value, void __iomem *addr)
+ {
+ writel(value, addr);
+ }
+
+ #ifdef CONFIG_64BIT
+-void rust_helper_writeq(u64 value, volatile void __iomem *addr)
++void rust_helper_writeq(u64 value, void __iomem *addr)
+ {
+ writeq(value, addr);
+ }
+ #endif
+
+-u8 rust_helper_readb_relaxed(const volatile void __iomem *addr)
++u8 rust_helper_readb_relaxed(const void __iomem *addr)
+ {
+ return readb_relaxed(addr);
+ }
+
+-u16 rust_helper_readw_relaxed(const volatile void __iomem *addr)
++u16 rust_helper_readw_relaxed(const void __iomem *addr)
+ {
+ return readw_relaxed(addr);
+ }
+
+-u32 rust_helper_readl_relaxed(const volatile void __iomem *addr)
++u32 rust_helper_readl_relaxed(const void __iomem *addr)
+ {
+ return readl_relaxed(addr);
+ }
+
+ #ifdef CONFIG_64BIT
+-u64 rust_helper_readq_relaxed(const volatile void __iomem *addr)
++u64 rust_helper_readq_relaxed(const void __iomem *addr)
+ {
+ return readq_relaxed(addr);
+ }
+ #endif
+
+-void rust_helper_writeb_relaxed(u8 value, volatile void __iomem *addr)
++void rust_helper_writeb_relaxed(u8 value, void __iomem *addr)
+ {
+ writeb_relaxed(value, addr);
+ }
+
+-void rust_helper_writew_relaxed(u16 value, volatile void __iomem *addr)
++void rust_helper_writew_relaxed(u16 value, void __iomem *addr)
+ {
+ writew_relaxed(value, addr);
+ }
+
+-void rust_helper_writel_relaxed(u32 value, volatile void __iomem *addr)
++void rust_helper_writel_relaxed(u32 value, void __iomem *addr)
+ {
+ writel_relaxed(value, addr);
+ }
+
+ #ifdef CONFIG_64BIT
+-void rust_helper_writeq_relaxed(u64 value, volatile void __iomem *addr)
++void rust_helper_writeq_relaxed(u64 value, void __iomem *addr)
+ {
+ writeq_relaxed(value, addr);
+ }
+--
+2.49.0
+
--- /dev/null
+From 46e24a545cdb4556f8128c90ecc34eeae52477a0 Mon Sep 17 00:00:00 2001
+From: Miguel Ojeda <ojeda@kernel.org>
+Date: Wed, 9 Apr 2025 00:03:11 +0200
+Subject: rust: kasan/kbuild: fix missing flags on first build
+
+From: Miguel Ojeda <ojeda@kernel.org>
+
+commit 46e24a545cdb4556f8128c90ecc34eeae52477a0 upstream.
+
+If KASAN is enabled, and one runs in a clean repository e.g.:
+
+ make LLVM=1 prepare
+ make LLVM=1 prepare
+
+Then the Rust code gets rebuilt, which should not happen.
+
+The reason is some of the LLVM KASAN `rustc` flags are added in the
+second run:
+
+ -Cllvm-args=-asan-instrumentation-with-call-threshold=10000
+ -Cllvm-args=-asan-stack=0
+ -Cllvm-args=-asan-globals=1
+ -Cllvm-args=-asan-kernel-mem-intrinsic-prefix=1
+
+Further runs do not rebuild Rust because the flags do not change anymore.
+
+Rebuilding like that in the second run is bad, even if this just happens
+with KASAN enabled, but missing flags in the first one is even worse.
+
+The root issue is that we pass, for some architectures and for the moment,
+a generated `target.json` file. That file is not ready by the time `rustc`
+gets called for the flag test, and thus the flag test fails just because
+the file is not available, e.g.:
+
+ $ ... --target=./scripts/target.json ... -Cllvm-args=...
+ error: target file "./scripts/target.json" does not exist
+
+There are a few approaches we could take here to solve this. For instance,
+we could ensure that every time that the config is rebuilt, we regenerate
+the file and recompute the flags. Or we could use the LLVM version to
+check for these flags, instead of testing the flag (which may have other
+advantages, such as allowing us to detect renames on the LLVM side).
+
+However, it may be easier than that: `rustc` is aware of the `-Cllvm-args`
+regardless of the `--target` (e.g. I checked that the list printed
+is the same, plus that I can check for these flags even if I pass
+a completely unrelated target), and thus we can just eliminate the
+dependency completely.
+
+Thus filter out the target.
+
+This does mean that `rustc-option` cannot be used to test a flag that
+requires the right target, but we don't have other users yet, it is a
+minimal change and we want to get rid of custom targets in the future.
+
+We could only filter in the case `target.json` is used, to make it work
+in more cases, but then it would be harder to notice that it may not
+work in a couple architectures.
+
+Cc: Matthew Maurer <mmaurer@google.com>
+Cc: Sami Tolvanen <samitolvanen@google.com>
+Cc: stable@vger.kernel.org
+Fixes: e3117404b411 ("kbuild: rust: Enable KASAN support")
+Tested-by: Alice Ryhl <aliceryhl@google.com>
+Link: https://lore.kernel.org/r/20250408220311.1033475-1-ojeda@kernel.org
+Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ scripts/Makefile.compiler | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/scripts/Makefile.compiler
++++ b/scripts/Makefile.compiler
+@@ -76,7 +76,7 @@ ld-option = $(call try-run, $(LD) $(KBUI
+ # TODO: remove RUSTC_BOOTSTRAP=1 when we raise the minimum GNU Make version to 4.4
+ __rustc-option = $(call try-run,\
+ echo '#![allow(missing_docs)]#![feature(no_core)]#![no_core]' | RUSTC_BOOTSTRAP=1\
+- $(1) --sysroot=/dev/null $(filter-out --sysroot=/dev/null,$(2)) $(3)\
++ $(1) --sysroot=/dev/null $(filter-out --sysroot=/dev/null --target=%,$(2)) $(3)\
+ --crate-type=rlib --out-dir=$(TMPOUT) --emit=obj=- - >/dev/null,$(3),$(4))
+
+ # rustc-option
--- /dev/null
+From c59026c0570a2a97ce2e7d5ae5e9c48fc841542b Mon Sep 17 00:00:00 2001
+From: Sami Tolvanen <samitolvanen@google.com>
+Date: Tue, 18 Mar 2025 23:18:16 +0000
+Subject: rust: kbuild: Don't export __pfx symbols
+
+From: Sami Tolvanen <samitolvanen@google.com>
+
+commit c59026c0570a2a97ce2e7d5ae5e9c48fc841542b upstream.
+
+With CONFIG_PREFIX_SYMBOLS, objtool adds __pfx prefix symbols
+to claim the compiler emitted call padding bytes. When
+CONFIG_X86_KERNEL_IBT is not selected, the symbols are added to
+individual object files and for Rust objects, they end up being
+exported, resulting in warnings with CONFIG_GENDWARFKSYMS as the
+symbols have no debugging information:
+
+warning: gendwarfksyms: symbol_print_versions: no information for symbol __pfx_rust_helper_put_task_struct
+warning: gendwarfksyms: symbol_print_versions: no information for symbol __pfx_rust_helper_task_euid
+warning: gendwarfksyms: symbol_print_versions: no information for symbol __pfx_rust_helper_readq_relaxed
+...
+
+Filter out the __pfx prefix from exported symbols similarly to
+the existing __cfi and __odr_asan prefixes.
+
+Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
+Reviewed-by: Alice Ryhl <aliceryhl@google.com>
+Cc: stable@vger.kernel.org
+Fixes: ac61506bf2d1 ("rust: Use gendwarfksyms + extended modversions for CONFIG_MODVERSIONS")
+Link: https://lore.kernel.org/r/20250318231815.917621-2-samitolvanen@google.com
+Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ rust/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/rust/Makefile
++++ b/rust/Makefile
+@@ -334,7 +334,7 @@ $(obj)/bindings/bindings_helpers_generat
+ $(obj)/bindings/bindings_helpers_generated.rs: $(src)/helpers/helpers.c FORCE
+ $(call if_changed_dep,bindgen)
+
+-rust_exports = $(NM) -p --defined-only $(1) | awk '$$2~/(T|R|D|B)/ && $$3!~/__cfi/ && $$3!~/__odr_asan/ { printf $(2),$$3 }'
++rust_exports = $(NM) -p --defined-only $(1) | awk '$$2~/(T|R|D|B)/ && $$3!~/__(pfx|cfi|odr_asan)/ { printf $(2),$$3 }'
+
+ quiet_cmd_exports = EXPORTS $@
+ cmd_exports = \
--- /dev/null
+From 1c4494c14b4124f3a13a7f4912b84b633ff4f9ba Mon Sep 17 00:00:00 2001
+From: Miguel Ojeda <ojeda@kernel.org>
+Date: Mon, 14 Apr 2025 19:12:41 +0200
+Subject: rust: kbuild: use `pound` to support GNU Make < 4.3
+
+From: Miguel Ojeda <ojeda@kernel.org>
+
+commit 1c4494c14b4124f3a13a7f4912b84b633ff4f9ba upstream.
+
+GNU Make 4.3 changed the behavior of `#` inside commands in commit
+c6966b323811 ("[SV 20513] Un-escaped # are not comments in function
+invocations"):
+
+ * WARNING: Backward-incompatibility!
+ Number signs (#) appearing inside a macro reference or function invocation
+ no longer introduce comments and should not be escaped with backslashes:
+ thus a call such as:
+ foo := $(shell echo '#')
+ is legal. Previously the number sign needed to be escaped, for example:
+ foo := $(shell echo '\#')
+ Now this latter will resolve to "\#". If you want to write makefiles
+ portable to both versions, assign the number sign to a variable:
+ H := \#
+ foo := $(shell echo '$H')
+ This was claimed to be fixed in 3.81, but wasn't, for some reason.
+ To detect this change search for 'nocomment' in the .FEATURES variable.
+
+Unlike other commits in the kernel about this issue, such as commit
+633174a7046e ("lib/raid6/test/Makefile: Use $(pound) instead of \#
+for Make 4.3"), that fixed the issue for newer GNU Makes, in our case
+it was the opposite, i.e. we need to fix it for the older ones: someone
+building with e.g. 4.2.1 gets the following error:
+
+ scripts/Makefile.compiler:81: *** unterminated call to function 'call': missing ')'. Stop.
+
+Thus use the existing variable to fix it.
+
+Reported-by: moyi geek <1441339168@qq.com>
+Closes: https://rust-for-linux.zulipchat.com/#narrow/channel/291565/topic/x/near/512001985
+Cc: stable@vger.kernel.org
+Fixes: e72a076c620f ("kbuild: fix issues with rustc-option")
+Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
+Reviewed-by: Alice Ryhl <aliceryhl@google.com>
+Link: https://lore.kernel.org/r/20250414171241.2126137-1-ojeda@kernel.org
+Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ scripts/Makefile.compiler | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/scripts/Makefile.compiler
++++ b/scripts/Makefile.compiler
+@@ -75,7 +75,7 @@ ld-option = $(call try-run, $(LD) $(KBUI
+ # Usage: MY_RUSTFLAGS += $(call __rustc-option,$(RUSTC),$(MY_RUSTFLAGS),-Cinstrument-coverage,-Zinstrument-coverage)
+ # TODO: remove RUSTC_BOOTSTRAP=1 when we raise the minimum GNU Make version to 4.4
+ __rustc-option = $(call try-run,\
+- echo '#![allow(missing_docs)]#![feature(no_core)]#![no_core]' | RUSTC_BOOTSTRAP=1\
++ echo '$(pound)![allow(missing_docs)]$(pound)![feature(no_core)]$(pound)![no_core]' | RUSTC_BOOTSTRAP=1\
+ $(1) --sysroot=/dev/null $(filter-out --sysroot=/dev/null --target=%,$(2)) $(3)\
+ --crate-type=rlib --out-dir=$(TMPOUT) --emit=obj=- - >/dev/null,$(3),$(4))
+
riscv-kgdb-do-not-inline-arch_kgdb_breakpoint.patch
riscv-kgdb-remove-.option-norvc-.option-rvc-for-kgdb.patch
cpufreq-sched-fix-the-usage-of-cpufreq_need_update_l.patch
+objtool-rust-add-one-more-noreturn-rust-function-for-rust-1.86.0.patch
+rust-helpers-remove-volatile-qualifier-from-io-helpers.patch
+rust-kasan-kbuild-fix-missing-flags-on-first-build.patch
+rust-disable-clippy-needless_continue.patch
+rust-kbuild-don-t-export-__pfx-symbols.patch
+rust-kbuild-use-pound-to-support-gnu-make-4.3.patch
+writeback-fix-false-warning-in-inode_to_wb.patch
+revert-pci-avoid-reset-when-disabled-via-sysfs.patch
+asoc-fsl-fsl_qmc_audio-reset-audio-data-pointers-on-trigger_start-event.patch
+asoc-codecs-lpass-wsa-macro-fix-vi-feedback-rate.patch
+asoc-codecs-lpass-wsa-macro-fix-logic-of-enabling-vi-channels.patch
+asoc-intel-sof_sdw-add-quirk-for-asus-zenbook-s16.patch
+asoc-qcom-fix-sc7280-lpass-potential-buffer-overflow.patch
+accel-ivpu-fix-the-npu-s-dpu-frequency-calculation.patch
+alloc_tag-handle-incomplete-bulk-allocations-in-vm_module_tags_populate.patch
+asus-laptop-fix-an-uninitialized-variable.patch
+block-integrity-do-not-call-set_page_dirty_lock.patch
--- /dev/null
+From 9e888998ea4d22257b07ce911576509486fa0667 Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <agruenba@redhat.com>
+Date: Sat, 12 Apr 2025 18:39:12 +0200
+Subject: writeback: fix false warning in inode_to_wb()
+
+From: Andreas Gruenbacher <agruenba@redhat.com>
+
+commit 9e888998ea4d22257b07ce911576509486fa0667 upstream.
+
+inode_to_wb() is used also for filesystems that don't support cgroup
+writeback. For these filesystems inode->i_wb is stable during the
+lifetime of the inode (it points to bdi->wb) and there's no need to hold
+locks protecting the inode->i_wb dereference. Improve the warning in
+inode_to_wb() to not trigger for these filesystems.
+
+Link: https://lkml.kernel.org/r/20250412163914.3773459-3-agruenba@redhat.com
+Fixes: aaa2cacf8184 ("writeback: add lockdep annotation to inode_to_wb()")
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
+Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/backing-dev.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/include/linux/backing-dev.h
++++ b/include/linux/backing-dev.h
+@@ -249,6 +249,7 @@ static inline struct bdi_writeback *inod
+ {
+ #ifdef CONFIG_LOCKDEP
+ WARN_ON_ONCE(debug_locks &&
++ (inode->i_sb->s_iflags & SB_I_CGROUPWB) &&
+ (!lockdep_is_held(&inode->i_lock) &&
+ !lockdep_is_held(&inode->i_mapping->i_pages.xa_lock) &&
+ !lockdep_is_held(&inode->i_wb->list_lock)));