--- /dev/null
+From 855baf431be85c66663ca4f9d30d4c5d105d68bb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 10 Dec 2024 11:30:27 +0300
+Subject: clk: thead: Fix TH1520 emmc and shdci clock rate
+
+From: Maksim Kiselev <bigunclemax@gmail.com>
+
+[ Upstream commit f4bf0b909a6bf64a2220a42a7c8b8c2ee1b77b89 ]
+
+In accordance with LicheePi 4A BSP the clock that comes to emmc/sdhci
+is 198Mhz which is got through frequency division of source clock
+VIDEO PLL by 4 [1].
+
+But now the AP_SUBSYS driver sets the CLK EMMC SDIO to the same
+frequency as the VIDEO PLL, equal to 792 MHz. This causes emmc/sdhci
+to work 4 times slower.
+
+Let's fix this issue by adding fixed factor clock that divides
+VIDEO PLL by 4 for emmc/sdhci.
+
+Link: https://github.com/revyos/thead-kernel/blob/7563179071a314f41cdcdbfd8cf6e101e73707f3/drivers/clk/thead/clk-light-fm.c#L454
+
+Fixes: ae81b69fd2b1 ("clk: thead: Add support for T-Head TH1520 AP_SUBSYS clocks")
+Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
+Link: https://lore.kernel.org/r/20241210083029.92620-1-bigunclemax@gmail.com
+Tested-by: Xi Ruoyao <xry111@xry111.site>
+Reviewed-by: Drew Fustini <dfustini@tenstorrent.com>
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/thead/clk-th1520-ap.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/clk/thead/clk-th1520-ap.c b/drivers/clk/thead/clk-th1520-ap.c
+index 17e32ae08720..1015fab95251 100644
+--- a/drivers/clk/thead/clk-th1520-ap.c
++++ b/drivers/clk/thead/clk-th1520-ap.c
+@@ -779,6 +779,13 @@ static struct ccu_div dpu1_clk = {
+ },
+ };
+
++static CLK_FIXED_FACTOR_HW(emmc_sdio_ref_clk, "emmc-sdio-ref",
++ &video_pll_clk.common.hw, 4, 1, 0);
++
++static const struct clk_parent_data emmc_sdio_ref_clk_pd[] = {
++ { .hw = &emmc_sdio_ref_clk.hw },
++};
++
+ static CCU_GATE(CLK_BROM, brom_clk, "brom", ahb2_cpusys_hclk_pd, 0x100, BIT(4), 0);
+ static CCU_GATE(CLK_BMU, bmu_clk, "bmu", axi4_cpusys2_aclk_pd, 0x100, BIT(5), 0);
+ static CCU_GATE(CLK_AON2CPU_A2X, aon2cpu_a2x_clk, "aon2cpu-a2x", axi4_cpusys2_aclk_pd,
+@@ -798,7 +805,7 @@ static CCU_GATE(CLK_PERISYS_APB4_HCLK, perisys_apb4_hclk, "perisys-apb4-hclk", p
+ 0x150, BIT(12), 0);
+ static CCU_GATE(CLK_NPU_AXI, npu_axi_clk, "npu-axi", axi_aclk_pd, 0x1c8, BIT(5), 0);
+ static CCU_GATE(CLK_CPU2VP, cpu2vp_clk, "cpu2vp", axi_aclk_pd, 0x1e0, BIT(13), 0);
+-static CCU_GATE(CLK_EMMC_SDIO, emmc_sdio_clk, "emmc-sdio", video_pll_clk_pd, 0x204, BIT(30), 0);
++static CCU_GATE(CLK_EMMC_SDIO, emmc_sdio_clk, "emmc-sdio", emmc_sdio_ref_clk_pd, 0x204, BIT(30), 0);
+ static CCU_GATE(CLK_GMAC1, gmac1_clk, "gmac1", gmac_pll_clk_pd, 0x204, BIT(26), 0);
+ static CCU_GATE(CLK_PADCTRL1, padctrl1_clk, "padctrl1", perisys_apb_pclk_pd, 0x204, BIT(24), 0);
+ static CCU_GATE(CLK_DSMART, dsmart_clk, "dsmart", perisys_apb_pclk_pd, 0x204, BIT(23), 0);
+@@ -1059,6 +1066,10 @@ static int th1520_clk_probe(struct platform_device *pdev)
+ return ret;
+ priv->hws[CLK_PLL_GMAC_100M] = &gmac_pll_clk_100m.hw;
+
++ ret = devm_clk_hw_register(dev, &emmc_sdio_ref_clk.hw);
++ if (ret)
++ return ret;
++
+ ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, priv);
+ if (ret)
+ return ret;
+--
+2.39.5
+
--- /dev/null
+From d6f9540906fa0b600dfbe2d787e81d0b8fb93306 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 3 Jan 2025 19:20:23 +0100
+Subject: kbuild: pacman-pkg: provide versioned linux-api-headers package
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Thomas Weißschuh <linux@weissschuh.net>
+
+[ Upstream commit 385443057f475e775fe1c66e77d4be9727f40973 ]
+
+The Arch Linux glibc package contains a versioned dependency on
+"linux-api-headers". If the linux-api-headers package provided by
+pacman-pkg does not specify an explicit version this dependency is not
+satisfied.
+Fix the dependency by providing an explicit version.
+
+Fixes: c8578539deba ("kbuild: add script and target to generate pacman package")
+Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
+Reviewed-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ scripts/package/PKGBUILD | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
+index f83493838cf9..dca706617adc 100644
+--- a/scripts/package/PKGBUILD
++++ b/scripts/package/PKGBUILD
+@@ -103,7 +103,7 @@ _package-headers() {
+
+ _package-api-headers() {
+ pkgdesc="Kernel headers sanitized for use in userspace"
+- provides=(linux-api-headers)
++ provides=(linux-api-headers="${pkgver}")
+ conflicts=(linux-api-headers)
+
+ _prologue
+--
+2.39.5
+
--- /dev/null
+From 88fb0d5e961123cd00e957d88397fe3c5018f060 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 26 Dec 2024 00:33:35 +0900
+Subject: modpost: fix the missed iteration for the max bit in do_input()
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+[ Upstream commit bf36b4bf1b9a7a0015610e2f038ee84ddb085de2 ]
+
+This loop should iterate over the range from 'min' to 'max' inclusively.
+The last interation is missed.
+
+Fixes: 1d8f430c15b3 ("[PATCH] Input: add modalias support")
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ scripts/mod/file2alias.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
+index 634e40748287..721e0e9f17ca 100644
+--- a/scripts/mod/file2alias.c
++++ b/scripts/mod/file2alias.c
+@@ -742,7 +742,7 @@ static void do_input(char *alias,
+
+ for (i = min / BITS_PER_LONG; i < max / BITS_PER_LONG + 1; i++)
+ arr[i] = TO_NATIVE(arr[i]);
+- for (i = min; i < max; i++)
++ for (i = min; i <= max; i++)
+ if (arr[i / BITS_PER_LONG] & (1ULL << (i%BITS_PER_LONG)))
+ sprintf(alias + strlen(alias), "%X,*", i);
+ }
+--
+2.39.5
+
--- /dev/null
+From af26eff80966352a96d0706968dc8c7ecbc9eed3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 23 Dec 2024 12:44:53 +0000
+Subject: scripts/mksysmap: Fix escape chars '$'
+
+From: Mostafa Saleh <smostafa@google.com>
+
+[ Upstream commit 7a6c355b55c051eb37cb15d191241da3aa3d6cba ]
+
+Commit b18b047002b7 ("kbuild: change scripts/mksysmap into sed script")
+changed the invocation of the script, to call sed directly without
+shell.
+
+That means, the current extra escape that was added in:
+commit ec336aa83162 ("scripts/mksysmap: Fix badly escaped '$'")
+for the shell is not correct any more, at the moment the stack traces
+for nvhe are corrupted:
+[ 22.840904] kvm [190]: [<ffff80008116dd54>] __kvm_nvhe_$x.220+0x58/0x9c
+[ 22.842913] kvm [190]: [<ffff8000811709bc>] __kvm_nvhe_$x.9+0x44/0x50
+[ 22.844112] kvm [190]: [<ffff80008116f8fc>] __kvm_nvhe___skip_pauth_save+0x4/0x4
+
+With this patch:
+[ 25.793513] kvm [192]: nVHE call trace:
+[ 25.794141] kvm [192]: [<ffff80008116dd54>] __kvm_nvhe_hyp_panic+0xb0/0xf4
+[ 25.796590] kvm [192]: [<ffff8000811709bc>] __kvm_nvhe_handle_trap+0xe4/0x188
+[ 25.797553] kvm [192]: [<ffff80008116f8fc>] __kvm_nvhe___skip_pauth_save+0x4/0x4
+
+Fixes: b18b047002b7 ("kbuild: change scripts/mksysmap into sed script")
+Signed-off-by: Mostafa Saleh <smostafa@google.com>
+Reviewed-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ scripts/mksysmap | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/mksysmap b/scripts/mksysmap
+index c12723a04655..3accbdb269ac 100755
+--- a/scripts/mksysmap
++++ b/scripts/mksysmap
+@@ -26,7 +26,7 @@
+ # (do not forget a space before each pattern)
+
+ # local symbols for ARM, MIPS, etc.
+-/ \\$/d
++/ \$/d
+
+ # local labels, .LBB, .Ltmpxxx, .L__unnamed_xx, .LASANPC, etc.
+ / \.L/d
+@@ -39,7 +39,7 @@
+ / __pi_\.L/d
+
+ # arm64 local symbols in non-VHE KVM namespace
+-/ __kvm_nvhe_\\$/d
++/ __kvm_nvhe_\$/d
+ / __kvm_nvhe_\.L/d
+
+ # lld arm/aarch64/mips thunks
+--
+2.39.5
+
arc-build-try-to-guess-gcc-variant-of-cross-compiler.patch
bpf-refactor-bpf_helper_changes_pkt_data-to-use-help.patch
bpf-consider-that-tail-calls-invalidate-packet-point.patch
+clk-thead-fix-th1520-emmc-and-shdci-clock-rate.patch
+scripts-mksysmap-fix-escape-chars.patch
+modpost-fix-the-missed-iteration-for-the-max-bit-in-.patch
+kbuild-pacman-pkg-provide-versioned-linux-api-header.patch