From: Sasha Levin Date: Sat, 15 Mar 2025 13:34:14 +0000 (-0400) Subject: Fixes for 6.13 X-Git-Tag: v6.6.84~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d1f16e6fc133973152cde9c19cc0ebc24eb8ba2f;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 6.13 Signed-off-by: Sasha Levin --- diff --git a/queue-6.13/acpi-resource-irq-override-for-eluktronics-mech-17.patch b/queue-6.13/acpi-resource-irq-override-for-eluktronics-mech-17.patch new file mode 100644 index 0000000000..e31e2cfd4c --- /dev/null +++ b/queue-6.13/acpi-resource-irq-override-for-eluktronics-mech-17.patch @@ -0,0 +1,43 @@ +From 8476ae8ad7bc771311907d58b428062e868a7d38 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 27 Jan 2025 02:39:02 -0700 +Subject: ACPI: resource: IRQ override for Eluktronics MECH-17 + +From: Gannon Kolding + +[ Upstream commit 607ab6f85f4194b644ea95ac5fe660ef575db3b4 ] + +The Eluktronics MECH-17 (GM7RG7N) needs IRQ overriding for the +keyboard to work. + +Adding a DMI_MATCH entry for this laptop model makes the internal +keyboard function normally. + +Signed-off-by: Gannon Kolding +Link: https://patch.msgid.link/20250127093902.328361-1-gannon.kolding@gmail.com +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + drivers/acpi/resource.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c +index 90aaec923889c..b4cd14e7fa76c 100644 +--- a/drivers/acpi/resource.c ++++ b/drivers/acpi/resource.c +@@ -563,6 +563,12 @@ static const struct dmi_system_id irq1_edge_low_force_override[] = { + DMI_MATCH(DMI_BOARD_NAME, "RP-15"), + }, + }, ++ { ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Eluktronics Inc."), ++ DMI_MATCH(DMI_BOARD_NAME, "MECH-17"), ++ }, ++ }, + { + /* TongFang GM6XGxX/TUXEDO Stellaris 16 Gen5 AMD */ + .matches = { +-- +2.39.5 + diff --git a/queue-6.13/alpha-elf-fix-misc-setarch-test-of-util-linux-by-rem.patch b/queue-6.13/alpha-elf-fix-misc-setarch-test-of-util-linux-by-rem.patch new file mode 100644 index 0000000000..d61f3ae48c --- /dev/null +++ b/queue-6.13/alpha-elf-fix-misc-setarch-test-of-util-linux-by-rem.patch @@ -0,0 +1,152 @@ +From 05f405f82c09fd984c985e5cf0caa3f405a08e44 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 12 Jan 2025 23:39:01 -0600 +Subject: alpha/elf: Fix misc/setarch test of util-linux by removing 32bit + support + +From: Eric W. Biederman + +[ Upstream commit b029628be267cba3c7684ec684749fe3e4372398 ] + +Richard Henderson writes[1]: + +> There was a Spec benchmark (I forget which) which was memory bound and ran +> twice as fast with 32-bit pointers. +> +> I copied the idea from DEC to the ELF abi, but never did all the other work +> to allow the toolchain to take advantage. +> +> Amusingly, a later Spec changed the benchmark data sets to not fit into a +> 32-bit address space, specifically because of this. +> +> I expect one could delete the ELF bit and personality and no one would +> notice. Not even the 10 remaining Alpha users. + +In [2] it was pointed out that parts of setarch weren't working +properly on alpha because it has it's own SET_PERSONALITY +implementation. In the discussion that followed Richard Henderson +pointed out that the 32bit pointer support for alpha was never +completed. + +Fix this by removing alpha's 32bit pointer support. + +As a bit of paranoia refuse to execute any alpha binaries that have +the EF_ALPHA_32BIT flag set. Just in case someone somewhere has +binaries that try to use alpha's 32bit pointer support. + +Link: https://lkml.kernel.org/r/CAFXwXrkgu=4Qn-v1PjnOR4SG0oUb9LSa0g6QXpBq4ttm52pJOQ@mail.gmail.com [1] +Link: https://lkml.kernel.org/r/20250103140148.370368-1-glaubitz@physik.fu-berlin.de [2] +Signed-off-by: Eric W. Biederman +Reviewed-by: Richard Henderson +Reviewed-by: Arnd Bergmann +Reviewed-by: John Paul Adrian Glaubitz +Tested-by: John Paul Adrian Glaubitz +Link: https://lore.kernel.org/r/87y0zfs26i.fsf_-_@email.froward.int.ebiederm.org +Signed-off-by: Kees Cook +Signed-off-by: Sasha Levin +--- + arch/alpha/include/asm/elf.h | 6 +----- + arch/alpha/include/asm/pgtable.h | 2 +- + arch/alpha/include/asm/processor.h | 8 ++------ + arch/alpha/kernel/osf_sys.c | 11 ++--------- + 4 files changed, 6 insertions(+), 21 deletions(-) + +diff --git a/arch/alpha/include/asm/elf.h b/arch/alpha/include/asm/elf.h +index 4d7c46f50382e..50c82187e60ec 100644 +--- a/arch/alpha/include/asm/elf.h ++++ b/arch/alpha/include/asm/elf.h +@@ -74,7 +74,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + /* + * This is used to ensure we don't load something for the wrong architecture. + */ +-#define elf_check_arch(x) ((x)->e_machine == EM_ALPHA) ++#define elf_check_arch(x) (((x)->e_machine == EM_ALPHA) && !((x)->e_flags & EF_ALPHA_32BIT)) + + /* + * These are used to set parameters in the core dumps. +@@ -137,10 +137,6 @@ extern int dump_elf_task(elf_greg_t *dest, struct task_struct *task); + : amask (AMASK_CIX) ? "ev6" : "ev67"); \ + }) + +-#define SET_PERSONALITY(EX) \ +- set_personality(((EX).e_flags & EF_ALPHA_32BIT) \ +- ? PER_LINUX_32BIT : PER_LINUX) +- + extern int alpha_l1i_cacheshape; + extern int alpha_l1d_cacheshape; + extern int alpha_l2_cacheshape; +diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h +index 635f0a5f5bbde..02e8817a89212 100644 +--- a/arch/alpha/include/asm/pgtable.h ++++ b/arch/alpha/include/asm/pgtable.h +@@ -360,7 +360,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte) + + extern void paging_init(void); + +-/* We have our own get_unmapped_area to cope with ADDR_LIMIT_32BIT. */ ++/* We have our own get_unmapped_area */ + #define HAVE_ARCH_UNMAPPED_AREA + + #endif /* _ALPHA_PGTABLE_H */ +diff --git a/arch/alpha/include/asm/processor.h b/arch/alpha/include/asm/processor.h +index 55bb1c09fd39d..5dce5518a2111 100644 +--- a/arch/alpha/include/asm/processor.h ++++ b/arch/alpha/include/asm/processor.h +@@ -8,23 +8,19 @@ + #ifndef __ASM_ALPHA_PROCESSOR_H + #define __ASM_ALPHA_PROCESSOR_H + +-#include /* for ADDR_LIMIT_32BIT */ +- + /* + * We have a 42-bit user address space: 4TB user VM... + */ + #define TASK_SIZE (0x40000000000UL) + +-#define STACK_TOP \ +- (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL) ++#define STACK_TOP (0x00120000000UL) + + #define STACK_TOP_MAX 0x00120000000UL + + /* This decides where the kernel will search for a free chunk of vm + * space during mmap's. + */ +-#define TASK_UNMAPPED_BASE \ +- ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2) ++#define TASK_UNMAPPED_BASE (TASK_SIZE / 2) + + /* This is dead. Everything has been moved to thread_info. */ + struct thread_struct { }; +diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c +index 86185021f75ae..a08e8edef1a44 100644 +--- a/arch/alpha/kernel/osf_sys.c ++++ b/arch/alpha/kernel/osf_sys.c +@@ -1210,8 +1210,7 @@ SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p) + return ret; + } + +-/* Get an address range which is currently unmapped. Similar to the +- generic version except that we know how to honor ADDR_LIMIT_32BIT. */ ++/* Get an address range which is currently unmapped. */ + + static unsigned long + arch_get_unmapped_area_1(unsigned long addr, unsigned long len, +@@ -1230,13 +1229,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, + unsigned long len, unsigned long pgoff, + unsigned long flags, vm_flags_t vm_flags) + { +- unsigned long limit; +- +- /* "32 bit" actually means 31 bit, since pointers sign extend. */ +- if (current->personality & ADDR_LIMIT_32BIT) +- limit = 0x80000000; +- else +- limit = TASK_SIZE; ++ unsigned long limit = TASK_SIZE; + + if (len > limit) + return -ENOMEM; +-- +2.39.5 + diff --git a/queue-6.13/alsa-hda-hda-intel-add-panther-lake-h-support.patch b/queue-6.13/alsa-hda-hda-intel-add-panther-lake-h-support.patch new file mode 100644 index 0000000000..d07bd3a844 --- /dev/null +++ b/queue-6.13/alsa-hda-hda-intel-add-panther-lake-h-support.patch @@ -0,0 +1,38 @@ +From 57aa27e0ed7fb771075eb115c857d7e5df460623 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 10 Feb 2025 10:17:30 +0200 +Subject: ALSA: hda: hda-intel: add Panther Lake-H support + +From: Pierre-Louis Bossart + +[ Upstream commit d7e2447a4d51de5c3c03e3b7892898e98ddd9769 ] + +Add Intel PTL-H audio Device ID. + +Signed-off-by: Pierre-Louis Bossart +Signed-off-by: Peter Ujfalusi +Reviewed-by: Kai Vehmanen +Reviewed-by: Bard Liao +Signed-off-by: Takashi Iwai +Link: https://patch.msgid.link/20250210081730.22916-5-peter.ujfalusi@linux.intel.com +Signed-off-by: Sasha Levin +--- + sound/pci/hda/hda_intel.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c +index 188b64c0ed75f..c050539d6057b 100644 +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -2498,6 +2498,8 @@ static const struct pci_device_id azx_ids[] = { + { PCI_DEVICE_DATA(INTEL, HDA_ARL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) }, + /* Panther Lake */ + { PCI_DEVICE_DATA(INTEL, HDA_PTL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_LNL) }, ++ /* Panther Lake-H */ ++ { PCI_DEVICE_DATA(INTEL, HDA_PTL_H, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_LNL) }, + /* Apollolake (Broxton-P) */ + { PCI_DEVICE_DATA(INTEL, HDA_APL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON) }, + /* Gemini-Lake */ +-- +2.39.5 + diff --git a/queue-6.13/alsa-hda-intel-dsp-config-add-ptl-h-support.patch b/queue-6.13/alsa-hda-intel-dsp-config-add-ptl-h-support.patch new file mode 100644 index 0000000000..07b390aa37 --- /dev/null +++ b/queue-6.13/alsa-hda-intel-dsp-config-add-ptl-h-support.patch @@ -0,0 +1,41 @@ +From c4ce26cfc284aab3136be55487f195f4651ad884 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 10 Feb 2025 10:17:28 +0200 +Subject: ALSA: hda: intel-dsp-config: Add PTL-H support + +From: Pierre-Louis Bossart + +[ Upstream commit 214e6be2d91d5d58f28d3a37630480077a1aafbd ] + +Use same recipes as PTL for PTL-H. + +Signed-off-by: Pierre-Louis Bossart +Signed-off-by: Peter Ujfalusi +Reviewed-by: Kai Vehmanen +Reviewed-by: Bard Liao +Signed-off-by: Takashi Iwai +Link: https://patch.msgid.link/20250210081730.22916-3-peter.ujfalusi@linux.intel.com +Signed-off-by: Sasha Levin +--- + sound/hda/intel-dsp-config.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c +index f564ec7af1940..ce3ae2cba6607 100644 +--- a/sound/hda/intel-dsp-config.c ++++ b/sound/hda/intel-dsp-config.c +@@ -539,6 +539,11 @@ static const struct config_entry config_table[] = { + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, + .device = PCI_DEVICE_ID_INTEL_HDA_PTL, + }, ++ { ++ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, ++ .device = PCI_DEVICE_ID_INTEL_HDA_PTL_H, ++ }, ++ + #endif + + }; +-- +2.39.5 + diff --git a/queue-6.13/alsa-hda-realtek-limit-mic-boost-on-positivo-arn50.patch b/queue-6.13/alsa-hda-realtek-limit-mic-boost-on-positivo-arn50.patch new file mode 100644 index 0000000000..52710bed24 --- /dev/null +++ b/queue-6.13/alsa-hda-realtek-limit-mic-boost-on-positivo-arn50.patch @@ -0,0 +1,36 @@ +From fadcf3ce165b6cf75cdbd2c605e943316d083184 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 1 Feb 2025 11:39:30 -0300 +Subject: ALSA: hda/realtek: Limit mic boost on Positivo ARN50 + +From: Edson Juliano Drosdeck + +[ Upstream commit 76b0a22d4cf7dc9091129560fdc04e73eb9db4cb ] + +The internal mic boost on the Positivo ARN50 is too high. +Fix this by applying the ALC269_FIXUP_LIMIT_INT_MIC_BOOST fixup to the machine +to limit the gain. + +Signed-off-by: Edson Juliano Drosdeck +Link: https://patch.msgid.link/20250201143930.25089-1-edson.drosdeck@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 10e9ec74104d2..f952918191ef2 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -11096,6 +11096,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = { + SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC), + SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), + SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2), ++ SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), + SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), + SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13), + SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO), +-- +2.39.5 + diff --git a/queue-6.13/apple-nvme-release-power-domains-when-probe-fails.patch b/queue-6.13/apple-nvme-release-power-domains-when-probe-fails.patch new file mode 100644 index 0000000000..3a6377b2d7 --- /dev/null +++ b/queue-6.13/apple-nvme-release-power-domains-when-probe-fails.patch @@ -0,0 +1,42 @@ +From 4f1acb204a5cdda064ae82ed7782711195d81e6b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 13 Feb 2025 11:12:59 -0500 +Subject: apple-nvme: Release power domains when probe fails + +From: Hector Martin + +[ Upstream commit eefa72a15ea03fd009333aaa9f0e360b2578e434 ] + +Signed-off-by: Hector Martin +Reviewed-by: Neal Gompa +Reviewed-by: Sven Peter +Signed-off-by: Alyssa Rosenzweig +Signed-off-by: Keith Busch +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/apple.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c +index 4319ab50c10d1..0bca33dc48cc9 100644 +--- a/drivers/nvme/host/apple.c ++++ b/drivers/nvme/host/apple.c +@@ -1518,6 +1518,7 @@ static struct apple_nvme *apple_nvme_alloc(struct platform_device *pdev) + + return anv; + put_dev: ++ apple_nvme_detach_genpd(anv); + put_device(anv->dev); + return ERR_PTR(ret); + } +@@ -1551,6 +1552,7 @@ static int apple_nvme_probe(struct platform_device *pdev) + nvme_uninit_ctrl(&anv->ctrl); + out_put_ctrl: + nvme_put_ctrl(&anv->ctrl); ++ apple_nvme_detach_genpd(anv); + return ret; + } + +-- +2.39.5 + diff --git a/queue-6.13/arm64-amu-delay-allocating-cpumask-for-amu-fie-suppo.patch b/queue-6.13/arm64-amu-delay-allocating-cpumask-for-amu-fie-suppo.patch new file mode 100644 index 0000000000..4081b055f4 --- /dev/null +++ b/queue-6.13/arm64-amu-delay-allocating-cpumask-for-amu-fie-suppo.patch @@ -0,0 +1,77 @@ +From 651c9bfb3ba0cc0f88eb3a0c4eaedbdda6e4718c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 31 Jan 2025 15:58:42 +0000 +Subject: arm64: amu: Delay allocating cpumask for AMU FIE support + +From: Beata Michalska + +[ Upstream commit d923782b041218ef3804b2fed87619b5b1a497f3 ] + +For the time being, the amu_fie_cpus cpumask is being exclusively used +by the AMU-related internals of FIE support and is guaranteed to be +valid on every access currently made. Still the mask is not being +invalidated on one of the error handling code paths, which leaves +a soft spot with theoretical risk of UAF for CPUMASK_OFFSTACK cases. +To make things sound, delay allocating said cpumask +(for CPUMASK_OFFSTACK) avoiding otherwise nasty sanitising case failing +to register the cpufreq policy notifications. + +Signed-off-by: Beata Michalska +Reviewed-by: Prasanna Kumar T S M +Reviewed-by: Sumit Gupta +Reviewed-by: Sudeep Holla +Link: https://lore.kernel.org/r/20250131155842.3839098-1-beata.michalska@arm.com +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + arch/arm64/kernel/topology.c | 22 ++++++++++------------ + 1 file changed, 10 insertions(+), 12 deletions(-) + +diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c +index 1a2c72f3e7f80..cb180684d10d5 100644 +--- a/arch/arm64/kernel/topology.c ++++ b/arch/arm64/kernel/topology.c +@@ -194,12 +194,19 @@ static void amu_fie_setup(const struct cpumask *cpus) + int cpu; + + /* We are already set since the last insmod of cpufreq driver */ +- if (unlikely(cpumask_subset(cpus, amu_fie_cpus))) ++ if (cpumask_available(amu_fie_cpus) && ++ unlikely(cpumask_subset(cpus, amu_fie_cpus))) + return; + +- for_each_cpu(cpu, cpus) { ++ for_each_cpu(cpu, cpus) + if (!freq_counters_valid(cpu)) + return; ++ ++ if (!cpumask_available(amu_fie_cpus) && ++ !zalloc_cpumask_var(&amu_fie_cpus, GFP_KERNEL)) { ++ WARN_ONCE(1, "Failed to allocate FIE cpumask for CPUs[%*pbl]\n", ++ cpumask_pr_args(cpus)); ++ return; + } + + cpumask_or(amu_fie_cpus, amu_fie_cpus, cpus); +@@ -237,17 +244,8 @@ static struct notifier_block init_amu_fie_notifier = { + + static int __init init_amu_fie(void) + { +- int ret; +- +- if (!zalloc_cpumask_var(&amu_fie_cpus, GFP_KERNEL)) +- return -ENOMEM; +- +- ret = cpufreq_register_notifier(&init_amu_fie_notifier, ++ return cpufreq_register_notifier(&init_amu_fie_notifier, + CPUFREQ_POLICY_NOTIFIER); +- if (ret) +- free_cpumask_var(amu_fie_cpus); +- +- return ret; + } + core_initcall(init_amu_fie); + +-- +2.39.5 + diff --git a/queue-6.13/asoc-arizona-madera-use-fsleep-in-up-down-dapm-event.patch b/queue-6.13/asoc-arizona-madera-use-fsleep-in-up-down-dapm-event.patch new file mode 100644 index 0000000000..742ef2dbb4 --- /dev/null +++ b/queue-6.13/asoc-arizona-madera-use-fsleep-in-up-down-dapm-event.patch @@ -0,0 +1,174 @@ +From c2834bf7922f027ddce540c3bd2d9e7559a4ba96 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Feb 2025 16:08:46 +0000 +Subject: ASoC: arizona/madera: use fsleep() in up/down DAPM event delays. + +From: Vitaly Rodionov + +[ Upstream commit 679074942c2502a95842a80471d8fb718165ac77 ] + +Using `fsleep` instead of `msleep` resolves some customer complaints +regarding the precision of up/down DAPM event timing. `fsleep()` +automatically selects the appropriate sleep function, making the delay +time more predictable. + +Signed-off-by: Vitaly Rodionov +Link: https://patch.msgid.link/20250205160849.500306-1-vitalyr@opensource.cirrus.com +Reviewed-by: Charles Keepax +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/arizona.c | 14 +++++++------- + sound/soc/codecs/madera.c | 10 +++++----- + sound/soc/codecs/wm5110.c | 8 ++++---- + 3 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c +index 402b9a2ff0240..68cdb1027d0c0 100644 +--- a/sound/soc/codecs/arizona.c ++++ b/sound/soc/codecs/arizona.c +@@ -967,7 +967,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w, + case ARIZONA_OUT3L_ENA_SHIFT: + case ARIZONA_OUT3R_ENA_SHIFT: + priv->out_up_pending++; +- priv->out_up_delay += 17; ++ priv->out_up_delay += 17000; + break; + case ARIZONA_OUT4L_ENA_SHIFT: + case ARIZONA_OUT4R_ENA_SHIFT: +@@ -977,7 +977,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w, + case WM8997: + break; + default: +- priv->out_up_delay += 10; ++ priv->out_up_delay += 10000; + break; + } + break; +@@ -999,7 +999,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w, + if (!priv->out_up_pending && priv->out_up_delay) { + dev_dbg(component->dev, "Power up delay: %d\n", + priv->out_up_delay); +- msleep(priv->out_up_delay); ++ fsleep(priv->out_up_delay); + priv->out_up_delay = 0; + } + break; +@@ -1017,7 +1017,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w, + case ARIZONA_OUT3L_ENA_SHIFT: + case ARIZONA_OUT3R_ENA_SHIFT: + priv->out_down_pending++; +- priv->out_down_delay++; ++ priv->out_down_delay += 1000; + break; + case ARIZONA_OUT4L_ENA_SHIFT: + case ARIZONA_OUT4R_ENA_SHIFT: +@@ -1028,10 +1028,10 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w, + break; + case WM8998: + case WM1814: +- priv->out_down_delay += 5; ++ priv->out_down_delay += 5000; + break; + default: +- priv->out_down_delay++; ++ priv->out_down_delay += 1000; + break; + } + break; +@@ -1053,7 +1053,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w, + if (!priv->out_down_pending && priv->out_down_delay) { + dev_dbg(component->dev, "Power down delay: %d\n", + priv->out_down_delay); +- msleep(priv->out_down_delay); ++ fsleep(priv->out_down_delay); + priv->out_down_delay = 0; + } + break; +diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c +index b24d6472ad5fc..fbfd7fb7f1685 100644 +--- a/sound/soc/codecs/madera.c ++++ b/sound/soc/codecs/madera.c +@@ -2322,10 +2322,10 @@ int madera_out_ev(struct snd_soc_dapm_widget *w, + case CS42L92: + case CS47L92: + case CS47L93: +- out_up_delay = 6; ++ out_up_delay = 6000; + break; + default: +- out_up_delay = 17; ++ out_up_delay = 17000; + break; + } + +@@ -2356,7 +2356,7 @@ int madera_out_ev(struct snd_soc_dapm_widget *w, + case MADERA_OUT3R_ENA_SHIFT: + priv->out_up_pending--; + if (!priv->out_up_pending) { +- msleep(priv->out_up_delay); ++ fsleep(priv->out_up_delay); + priv->out_up_delay = 0; + } + break; +@@ -2375,7 +2375,7 @@ int madera_out_ev(struct snd_soc_dapm_widget *w, + case MADERA_OUT3L_ENA_SHIFT: + case MADERA_OUT3R_ENA_SHIFT: + priv->out_down_pending++; +- priv->out_down_delay++; ++ priv->out_down_delay += 1000; + break; + default: + break; +@@ -2392,7 +2392,7 @@ int madera_out_ev(struct snd_soc_dapm_widget *w, + case MADERA_OUT3R_ENA_SHIFT: + priv->out_down_pending--; + if (!priv->out_down_pending) { +- msleep(priv->out_down_delay); ++ fsleep(priv->out_down_delay); + priv->out_down_delay = 0; + } + break; +diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c +index 502196253d42a..64eee0d2347da 100644 +--- a/sound/soc/codecs/wm5110.c ++++ b/sound/soc/codecs/wm5110.c +@@ -302,7 +302,7 @@ static int wm5110_hp_pre_enable(struct snd_soc_dapm_widget *w) + } else { + wseq = wm5110_no_dre_left_enable; + nregs = ARRAY_SIZE(wm5110_no_dre_left_enable); +- priv->out_up_delay += 10; ++ priv->out_up_delay += 10000; + } + break; + case ARIZONA_OUT1R_ENA_SHIFT: +@@ -312,7 +312,7 @@ static int wm5110_hp_pre_enable(struct snd_soc_dapm_widget *w) + } else { + wseq = wm5110_no_dre_right_enable; + nregs = ARRAY_SIZE(wm5110_no_dre_right_enable); +- priv->out_up_delay += 10; ++ priv->out_up_delay += 10000; + } + break; + default: +@@ -338,7 +338,7 @@ static int wm5110_hp_pre_disable(struct snd_soc_dapm_widget *w) + snd_soc_component_update_bits(component, + ARIZONA_SPARE_TRIGGERS, + ARIZONA_WS_TRG1, 0); +- priv->out_down_delay += 27; ++ priv->out_down_delay += 27000; + } + break; + case ARIZONA_OUT1R_ENA_SHIFT: +@@ -350,7 +350,7 @@ static int wm5110_hp_pre_disable(struct snd_soc_dapm_widget *w) + snd_soc_component_update_bits(component, + ARIZONA_SPARE_TRIGGERS, + ARIZONA_WS_TRG2, 0); +- priv->out_down_delay += 27; ++ priv->out_down_delay += 27000; + } + break; + default: +-- +2.39.5 + diff --git a/queue-6.13/asoc-dapm-graph-set-fill-colour-of-turned-on-nodes.patch b/queue-6.13/asoc-dapm-graph-set-fill-colour-of-turned-on-nodes.patch new file mode 100644 index 0000000000..1003da6602 --- /dev/null +++ b/queue-6.13/asoc-dapm-graph-set-fill-colour-of-turned-on-nodes.patch @@ -0,0 +1,45 @@ +From e362f49163b783b490701aaa91342c9830ec6b5d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 Feb 2025 21:39:32 +0100 +Subject: ASoC: dapm-graph: set fill colour of turned on nodes + +From: Nicolas Frattaroli + +[ Upstream commit d31babd7e304d3b800d36ff74be6739405b985f2 ] + +Some tools like KGraphViewer interpret the "ON" nodes not having an +explicitly set fill colour as them being entirely black, which obscures +the text on them and looks funny. In fact, I thought they were off for +the longest time. Comparing to the output of the `dot` tool, I assume +they are supposed to be white. + +Instead of speclawyering over who's in the wrong and must immediately +atone for their wickedness at the altar of RFC2119, just be explicit +about it, set the fillcolor to white, and nobody gets confused. + +Signed-off-by: Nicolas Frattaroli +Tested-by: Luca Ceresoli +Reviewed-by: Luca Ceresoli +Link: https://patch.msgid.link/20250221-dapm-graph-node-colour-v1-1-514ed0aa7069@collabora.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + tools/sound/dapm-graph | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/sound/dapm-graph b/tools/sound/dapm-graph +index f14bdfedee8f1..b6196ee5065a4 100755 +--- a/tools/sound/dapm-graph ++++ b/tools/sound/dapm-graph +@@ -10,7 +10,7 @@ set -eu + + STYLE_COMPONENT_ON="color=dodgerblue;style=bold" + STYLE_COMPONENT_OFF="color=gray40;style=filled;fillcolor=gray90" +-STYLE_NODE_ON="shape=box,style=bold,color=green4" ++STYLE_NODE_ON="shape=box,style=bold,color=green4,fillcolor=white" + STYLE_NODE_OFF="shape=box,style=filled,color=gray30,fillcolor=gray95" + + # Print usage and exit +-- +2.39.5 + diff --git a/queue-6.13/asoc-intel-soc-acpi-intel-mtl-match-declare-adr-as-u.patch b/queue-6.13/asoc-intel-soc-acpi-intel-mtl-match-declare-adr-as-u.patch new file mode 100644 index 0000000000..c17833b645 --- /dev/null +++ b/queue-6.13/asoc-intel-soc-acpi-intel-mtl-match-declare-adr-as-u.patch @@ -0,0 +1,40 @@ +From 76edf7d3323c6a9f807f22030b25341b46e74344 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 4 Feb 2025 11:31:34 +0800 +Subject: ASoC: Intel: soc-acpi-intel-mtl-match: declare adr as ull +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Bard Liao + +[ Upstream commit 20efccc53abf99fa52ea30a43dec758f6b6b9940 ] + +The adr is u64. + +Signed-off-by: Bard Liao +Reviewed-by: Péter Ujfalusi +Reviewed-by: Ranjani Sridharan +Link: https://patch.msgid.link/20250204033134.92332-3-yung-chuan.liao@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/common/soc-acpi-intel-mtl-match.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/intel/common/soc-acpi-intel-mtl-match.c b/sound/soc/intel/common/soc-acpi-intel-mtl-match.c +index 03fc5a1870123..9b9098485b8c3 100644 +--- a/sound/soc/intel/common/soc-acpi-intel-mtl-match.c ++++ b/sound/soc/intel/common/soc-acpi-intel-mtl-match.c +@@ -330,7 +330,7 @@ static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = { + + static const struct snd_soc_acpi_adr_device rt1318_1_single_adr[] = { + { +- .adr = 0x000130025D131801, ++ .adr = 0x000130025D131801ull, + .num_endpoints = 1, + .endpoints = &single_endpoint, + .name_prefix = "rt1318-1" +-- +2.39.5 + diff --git a/queue-6.13/asoc-intel-sof_sdw-add-lookup-of-quirk-using-pci-sub.patch b/queue-6.13/asoc-intel-sof_sdw-add-lookup-of-quirk-using-pci-sub.patch new file mode 100644 index 0000000000..53658f70bb --- /dev/null +++ b/queue-6.13/asoc-intel-sof_sdw-add-lookup-of-quirk-using-pci-sub.patch @@ -0,0 +1,95 @@ +From 4d8c9013ca08f58efbc7ab42d0feab45439f012f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 4 Feb 2025 13:39:41 +0800 +Subject: ASoC: Intel: sof_sdw: Add lookup of quirk using PCI subsystem ID + +From: Richard Fitzgerald + +[ Upstream commit fc016ef7da64fd473d73ee6c261ba1b0b47afe2b ] + +Add lookup of PCI subsystem vendor:device ID to find a quirk. + +The subsystem ID (SSID) is part of the PCI specification to uniquely +identify a particular system-specific implementation of a hardware +device. + +Unlike DMI information, it identifies the sound hardware itself, rather +than a specific model of PC. SSID can be more reliable and stable than +DMI strings, and is preferred by some vendors as the way to identify +the actual sound hardware. + +Signed-off-by: Richard Fitzgerald +Reviewed-by: Liam Girdwood +Signed-off-by: Bard Liao +Link: https://patch.msgid.link/20250204053943.93596-2-yung-chuan.liao@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/boards/sof_sdw.c | 30 ++++++++++++++++++++++++------ + 1 file changed, 24 insertions(+), 6 deletions(-) + +diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c +index 65e55c46fb064..62e71f56269d8 100644 +--- a/sound/soc/intel/boards/sof_sdw.c ++++ b/sound/soc/intel/boards/sof_sdw.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include "sof_sdw_common.h" + #include "../../codecs/rt711.h" +@@ -749,6 +750,22 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { + {} + }; + ++static const struct snd_pci_quirk sof_sdw_ssid_quirk_table[] = { ++ {} ++}; ++ ++static void sof_sdw_check_ssid_quirk(const struct snd_soc_acpi_mach *mach) ++{ ++ const struct snd_pci_quirk *quirk_entry; ++ ++ quirk_entry = snd_pci_quirk_lookup_id(mach->mach_params.subsystem_vendor, ++ mach->mach_params.subsystem_device, ++ sof_sdw_ssid_quirk_table); ++ ++ if (quirk_entry) ++ sof_sdw_quirk = quirk_entry->value; ++} ++ + static struct snd_soc_dai_link_component platform_component[] = { + { + /* name might be overridden during probe */ +@@ -1276,6 +1293,13 @@ static int mc_probe(struct platform_device *pdev) + + snd_soc_card_set_drvdata(card, ctx); + ++ if (mach->mach_params.subsystem_id_set) { ++ snd_soc_card_set_pci_ssid(card, ++ mach->mach_params.subsystem_vendor, ++ mach->mach_params.subsystem_device); ++ sof_sdw_check_ssid_quirk(mach); ++ } ++ + dmi_check_system(sof_sdw_quirk_table); + + if (quirk_override != -1) { +@@ -1291,12 +1315,6 @@ static int mc_probe(struct platform_device *pdev) + for (i = 0; i < ctx->codec_info_list_count; i++) + codec_info_list[i].amp_num = 0; + +- if (mach->mach_params.subsystem_id_set) { +- snd_soc_card_set_pci_ssid(card, +- mach->mach_params.subsystem_vendor, +- mach->mach_params.subsystem_device); +- } +- + ret = sof_card_dai_links_create(card); + if (ret < 0) + return ret; +-- +2.39.5 + diff --git a/queue-6.13/asoc-intel-sof_sdw-add-quirk-for-asus-zenbook-s14.patch b/queue-6.13/asoc-intel-sof_sdw-add-quirk-for-asus-zenbook-s14.patch new file mode 100644 index 0000000000..550484cad2 --- /dev/null +++ b/queue-6.13/asoc-intel-sof_sdw-add-quirk-for-asus-zenbook-s14.patch @@ -0,0 +1,38 @@ +From 9da09da862ba723ccd5b7fb4ccd413f4c9bfccf3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 4 Feb 2025 13:39:42 +0800 +Subject: ASoC: Intel: sof_sdw: Add quirk for Asus Zenbook S14 + +From: Richard Fitzgerald + +[ Upstream commit 0843449708085c4fb45a3c325c2fbced556f6abf ] + +Asus laptops with sound PCI subsystem ID 1043:1e13 have the DMICs +connected to the host instead of the CS42L43 so need the +SOC_SDW_CODEC_MIC quirk. + +Signed-off-by: Richard Fitzgerald +Reviewed-by: Liam Girdwood +Signed-off-by: Bard Liao +Link: https://patch.msgid.link/20250204053943.93596-3-yung-chuan.liao@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/boards/sof_sdw.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c +index 62e71f56269d8..352c7a84cc2e8 100644 +--- a/sound/soc/intel/boards/sof_sdw.c ++++ b/sound/soc/intel/boards/sof_sdw.c +@@ -751,6 +751,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { + }; + + static const struct snd_pci_quirk sof_sdw_ssid_quirk_table[] = { ++ SND_PCI_QUIRK(0x1043, 0x1e13, "ASUS Zenbook S14", SOC_SDW_CODEC_MIC), + {} + }; + +-- +2.39.5 + diff --git a/queue-6.13/asoc-intel-sof_sdw-add-support-for-fatcat-board-with.patch b/queue-6.13/asoc-intel-sof_sdw-add-support-for-fatcat-board-with.patch new file mode 100644 index 0000000000..e87273fe14 --- /dev/null +++ b/queue-6.13/asoc-intel-sof_sdw-add-support-for-fatcat-board-with.patch @@ -0,0 +1,48 @@ +From aaf77b52bce234813ed565b89b72d0baff615c6f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 4 Feb 2025 13:39:43 +0800 +Subject: ASoC: Intel: sof_sdw: Add support for Fatcat board with BT offload + enabled in PTL platform + +From: Uday M Bhat + +[ Upstream commit d8989106287d3735c7e7fc6acb3811d62ebb666c ] + + This change adds an entry for fatcat boards in soundwire quirk table + and also, enables BT offload for PTL RVP. + +Signed-off-by: Uday M Bhat +Signed-off-by: Jairaj Arava +Reviewed-by: Ranjani Sridharan +Signed-off-by: Bard Liao +Link: https://patch.msgid.link/20250204053943.93596-4-yung-chuan.liao@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/boards/sof_sdw.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c +index 352c7a84cc2e8..e3e474fa4dae4 100644 +--- a/sound/soc/intel/boards/sof_sdw.c ++++ b/sound/soc/intel/boards/sof_sdw.c +@@ -747,6 +747,16 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { + }, + .driver_data = (void *)(SOC_SDW_PCH_DMIC), + }, ++ { ++ .callback = sof_sdw_quirk_cb, ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Fatcat"), ++ }, ++ .driver_data = (void *)(SOC_SDW_PCH_DMIC | ++ SOF_BT_OFFLOAD_SSP(2) | ++ SOF_SSP_BT_OFFLOAD_PRESENT), ++ }, + {} + }; + +-- +2.39.5 + diff --git a/queue-6.13/asoc-rsnd-adjust-convert-rate-limitation.patch b/queue-6.13/asoc-rsnd-adjust-convert-rate-limitation.patch new file mode 100644 index 0000000000..bc9400640b --- /dev/null +++ b/queue-6.13/asoc-rsnd-adjust-convert-rate-limitation.patch @@ -0,0 +1,216 @@ +From 4fa4c292a39681c141a849e8ae048e6b70a563ad Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Feb 2025 00:20:48 +0000 +Subject: ASoC: rsnd: adjust convert rate limitation + +From: Kuninori Morimoto + +[ Upstream commit 89f9cf185885d4358aa92b48e51d0f09b71775aa ] + +Current rsnd driver supports Synchronous SRC Mode, but HW allow to update +rate only within 1% from current rate. Adjust to it. + +Becially, this feature is used to fine-tune subtle difference that occur +during sampling rate conversion in SRC. So, it should be called within 1% +margin of rate difference. + +If there was difference over 1%, it will apply with 1% increments by using +loop without indicating error message. + +Cc: Yoshihiro Shimoda +Signed-off-by: Kuninori Morimoto +Reviewed-by: Yoshihiro Shimoda +Tested-by: Yoshihiro Shimoda +Link: https://patch.msgid.link/871pwd2qe8.wl-kuninori.morimoto.gx@renesas.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/renesas/rcar/src.c | 98 ++++++++++++++++++++++++++++-------- + 1 file changed, 76 insertions(+), 22 deletions(-) + +diff --git a/sound/soc/renesas/rcar/src.c b/sound/soc/renesas/rcar/src.c +index 3099180297722..7d73b183bda68 100644 +--- a/sound/soc/renesas/rcar/src.c ++++ b/sound/soc/renesas/rcar/src.c +@@ -35,6 +35,7 @@ struct rsnd_src { + struct rsnd_mod *dma; + struct rsnd_kctrl_cfg_s sen; /* sync convert enable */ + struct rsnd_kctrl_cfg_s sync; /* sync convert */ ++ u32 current_sync_rate; + int irq; + }; + +@@ -100,7 +101,7 @@ static u32 rsnd_src_convert_rate(struct rsnd_dai_stream *io, + if (!rsnd_src_sync_is_enabled(mod)) + return rsnd_io_converted_rate(io); + +- convert_rate = src->sync.val; ++ convert_rate = src->current_sync_rate; + + if (!convert_rate) + convert_rate = rsnd_io_converted_rate(io); +@@ -201,13 +202,73 @@ static const u32 chan222222[] = { + static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, + struct rsnd_mod *mod) + { ++ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); +- struct device *dev = rsnd_priv_to_dev(priv); ++ struct rsnd_src *src = rsnd_mod_to_src(mod); ++ u32 fin, fout, new_rate; ++ int inc, cnt, rate; ++ u64 base, val; ++ ++ if (!runtime) ++ return; ++ ++ if (!rsnd_src_sync_is_enabled(mod)) ++ return; ++ ++ fin = rsnd_src_get_in_rate(priv, io); ++ fout = rsnd_src_get_out_rate(priv, io); ++ ++ new_rate = src->sync.val; ++ ++ if (!new_rate) ++ new_rate = fout; ++ ++ /* Do nothing if no diff */ ++ if (new_rate == src->current_sync_rate) ++ return; ++ ++ /* ++ * SRCm_IFSVR::INTIFS can change within 1% ++ * see ++ * SRCm_IFSVR::INTIFS Note ++ */ ++ inc = fout / 100; ++ cnt = abs(new_rate - fout) / inc; ++ if (fout > new_rate) ++ inc *= -1; ++ ++ /* ++ * After start running SRC, we can update only SRC_IFSVR ++ * for Synchronous Mode ++ */ ++ base = (u64)0x0400000 * fin; ++ rate = fout; ++ for (int i = 0; i < cnt; i++) { ++ val = base; ++ rate += inc; ++ do_div(val, rate); ++ ++ rsnd_mod_write(mod, SRC_IFSVR, val); ++ } ++ val = base; ++ do_div(val, new_rate); ++ ++ rsnd_mod_write(mod, SRC_IFSVR, val); ++ ++ /* update current_sync_rate */ ++ src->current_sync_rate = new_rate; ++} ++ ++static void rsnd_src_init_convert_rate(struct rsnd_dai_stream *io, ++ struct rsnd_mod *mod) ++{ + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); ++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod); ++ struct device *dev = rsnd_priv_to_dev(priv); + int is_play = rsnd_io_is_play(io); + int use_src = 0; + u32 fin, fout; +- u32 ifscr, fsrate, adinr; ++ u32 ifscr, adinr; + u32 cr, route; + u32 i_busif, o_busif, tmp; + const u32 *bsdsr_table; +@@ -245,26 +306,15 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, + adinr = rsnd_get_adinr_bit(mod, io) | chan; + + /* +- * SRC_IFSCR / SRC_IFSVR +- */ +- ifscr = 0; +- fsrate = 0; +- if (use_src) { +- u64 n; +- +- ifscr = 1; +- n = (u64)0x0400000 * fin; +- do_div(n, fout); +- fsrate = n; +- } +- +- /* ++ * SRC_IFSCR + * SRC_SRCCR / SRC_ROUTE_MODE0 + */ ++ ifscr = 0; + cr = 0x00011110; + route = 0x0; + if (use_src) { + route = 0x1; ++ ifscr = 0x1; + + if (rsnd_src_sync_is_enabled(mod)) { + cr |= 0x1; +@@ -335,7 +385,6 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, + rsnd_mod_write(mod, SRC_SRCIR, 1); /* initialize */ + rsnd_mod_write(mod, SRC_ADINR, adinr); + rsnd_mod_write(mod, SRC_IFSCR, ifscr); +- rsnd_mod_write(mod, SRC_IFSVR, fsrate); + rsnd_mod_write(mod, SRC_SRCCR, cr); + rsnd_mod_write(mod, SRC_BSDSR, bsdsr_table[idx]); + rsnd_mod_write(mod, SRC_BSISR, bsisr_table[idx]); +@@ -348,6 +397,9 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, + + rsnd_adg_set_src_timesel_gen2(mod, io, fin, fout); + ++ /* update SRC_IFSVR */ ++ rsnd_src_set_convert_rate(io, mod); ++ + return; + + convert_rate_err: +@@ -467,7 +519,8 @@ static int rsnd_src_init(struct rsnd_mod *mod, + int ret; + + /* reset sync convert_rate */ +- src->sync.val = 0; ++ src->sync.val = ++ src->current_sync_rate = 0; + + ret = rsnd_mod_power_on(mod); + if (ret < 0) +@@ -475,7 +528,7 @@ static int rsnd_src_init(struct rsnd_mod *mod, + + rsnd_src_activation(mod); + +- rsnd_src_set_convert_rate(io, mod); ++ rsnd_src_init_convert_rate(io, mod); + + rsnd_src_status_clear(mod); + +@@ -493,7 +546,8 @@ static int rsnd_src_quit(struct rsnd_mod *mod, + rsnd_mod_power_off(mod); + + /* reset sync convert_rate */ +- src->sync.val = 0; ++ src->sync.val = ++ src->current_sync_rate = 0; + + return 0; + } +@@ -601,7 +655,7 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod, + "SRC Out Rate Switch" : + "SRC In Rate Switch", + rsnd_kctrl_accept_anytime, +- rsnd_src_set_convert_rate, ++ rsnd_src_init_convert_rate, + &src->sen, 1); + if (ret < 0) + return ret; +-- +2.39.5 + diff --git a/queue-6.13/asoc-rsnd-don-t-indicate-warning-on-rsnd_kctrl_accep.patch b/queue-6.13/asoc-rsnd-don-t-indicate-warning-on-rsnd_kctrl_accep.patch new file mode 100644 index 0000000000..c960859c8e --- /dev/null +++ b/queue-6.13/asoc-rsnd-don-t-indicate-warning-on-rsnd_kctrl_accep.patch @@ -0,0 +1,125 @@ +From a811e4ef2f38930da3515fdacbec2e18d88b017e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Feb 2025 00:20:42 +0000 +Subject: ASoC: rsnd: don't indicate warning on rsnd_kctrl_accept_runtime() + +From: Kuninori Morimoto + +[ Upstream commit c3fc002b206c6c83d1e3702b979733002ba6fb2c ] + +rsnd_kctrl_accept_runtime() (1) is used for runtime convert rate +(= Synchronous SRC Mode). Now, rsnd driver has 2 kctrls for it + +(A): "SRC Out Rate Switch" +(B): "SRC Out Rate" // it calls (1) + +(A): can be called anytime +(B): can be called only runtime, and will indicate warning if it was used + at non-runtime. + +To use runtime convert rate (= Synchronous SRC Mode), user might uses +command in below order. + +(X): > amixer set "SRC Out Rate" on + > aplay xxx.wav & +(Y): > amixer set "SRC Out Rate" 48010 // convert rate to 48010Hz + +(Y): calls B +(X): calls both A and B. + +In this case, when user calls (X), it calls both (A) and (B), but it is not +yet start running. So, (B) will indicate warning. + +This warning was added by commit b5c088689847 ("ASoC: rsnd: add warning +message to rsnd_kctrl_accept_runtime()"), but the message sounds like the +operation was not correct. Let's update warning message. + +The message is very SRC specific, implement it in src.c + +Signed-off-by: Kuninori Morimoto +Reviewed-by: Yoshihiro Shimoda +Link: https://patch.msgid.link/8734gt2qed.wl-kuninori.morimoto.gx@renesas.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/renesas/rcar/core.c | 14 -------------- + sound/soc/renesas/rcar/rsnd.h | 1 - + sound/soc/renesas/rcar/src.c | 18 +++++++++++++++++- + 3 files changed, 17 insertions(+), 16 deletions(-) + +diff --git a/sound/soc/renesas/rcar/core.c b/sound/soc/renesas/rcar/core.c +index d3709fd0409e4..f3f0c3f0bb9f5 100644 +--- a/sound/soc/renesas/rcar/core.c ++++ b/sound/soc/renesas/rcar/core.c +@@ -1770,20 +1770,6 @@ int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io) + return 1; + } + +-int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io) +-{ +- struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); +- struct rsnd_priv *priv = rsnd_io_to_priv(io); +- struct device *dev = rsnd_priv_to_dev(priv); +- +- if (!runtime) { +- dev_warn(dev, "Can't update kctrl when idle\n"); +- return 0; +- } +- +- return 1; +-} +- + struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg) + { + cfg->cfg.val = cfg->val; +diff --git a/sound/soc/renesas/rcar/rsnd.h b/sound/soc/renesas/rcar/rsnd.h +index a5f54b65313c4..04c70690f7a25 100644 +--- a/sound/soc/renesas/rcar/rsnd.h ++++ b/sound/soc/renesas/rcar/rsnd.h +@@ -742,7 +742,6 @@ struct rsnd_kctrl_cfg_s { + #define rsnd_kctrl_vals(x) ((x).val) /* = (x).cfg.val[0] */ + + int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io); +-int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io); + struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg); + struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct rsnd_kctrl_cfg_s *cfg); + int rsnd_kctrl_new(struct rsnd_mod *mod, +diff --git a/sound/soc/renesas/rcar/src.c b/sound/soc/renesas/rcar/src.c +index e7f86db0d94c3..3099180297722 100644 +--- a/sound/soc/renesas/rcar/src.c ++++ b/sound/soc/renesas/rcar/src.c +@@ -531,6 +531,22 @@ static irqreturn_t rsnd_src_interrupt(int irq, void *data) + return IRQ_HANDLED; + } + ++static int rsnd_src_kctrl_accept_runtime(struct rsnd_dai_stream *io) ++{ ++ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); ++ ++ if (!runtime) { ++ struct rsnd_priv *priv = rsnd_io_to_priv(io); ++ struct device *dev = rsnd_priv_to_dev(priv); ++ ++ dev_warn(dev, "\"SRC Out Rate\" can use during running\n"); ++ ++ return 0; ++ } ++ ++ return 1; ++} ++ + static int rsnd_src_probe_(struct rsnd_mod *mod, + struct rsnd_dai_stream *io, + struct rsnd_priv *priv) +@@ -594,7 +610,7 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod, + rsnd_io_is_play(io) ? + "SRC Out Rate" : + "SRC In Rate", +- rsnd_kctrl_accept_runtime, ++ rsnd_src_kctrl_accept_runtime, + rsnd_src_set_convert_rate, + &src->sync, 192000); + +-- +2.39.5 + diff --git a/queue-6.13/asoc-rsnd-indicate-unsupported-clock-rate.patch b/queue-6.13/asoc-rsnd-indicate-unsupported-clock-rate.patch new file mode 100644 index 0000000000..be6c7a1441 --- /dev/null +++ b/queue-6.13/asoc-rsnd-indicate-unsupported-clock-rate.patch @@ -0,0 +1,38 @@ +From 818901172ce3b7ca9c3bb68b0640b9bc7ea70114 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Feb 2025 00:20:36 +0000 +Subject: ASoC: rsnd: indicate unsupported clock rate + +From: Kuninori Morimoto + +[ Upstream commit 796106e29e5df6cd4b4e2b51262a8a19e9fa0625 ] + +It will indicate "unsupported clock rate" when setup clock failed. +But it is unclear what kind of rate was failed. Indicate it. + +Signed-off-by: Kuninori Morimoto +Reviewed-by: Yoshihiro Shimoda +Link: https://patch.msgid.link/874j192qej.wl-kuninori.morimoto.gx@renesas.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/renesas/rcar/ssi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/renesas/rcar/ssi.c b/sound/soc/renesas/rcar/ssi.c +index b3d4e8ae07eff..0c6424a1fcac0 100644 +--- a/sound/soc/renesas/rcar/ssi.c ++++ b/sound/soc/renesas/rcar/ssi.c +@@ -336,7 +336,8 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod, + return 0; + + rate_err: +- dev_err(dev, "unsupported clock rate\n"); ++ dev_err(dev, "unsupported clock rate (%d)\n", rate); ++ + return ret; + } + +-- +2.39.5 + diff --git a/queue-6.13/asoc-simple-card-utils.c-add-missing-dlc-of_node.patch b/queue-6.13/asoc-simple-card-utils.c-add-missing-dlc-of_node.patch new file mode 100644 index 0000000000..227e767bf9 --- /dev/null +++ b/queue-6.13/asoc-simple-card-utils.c-add-missing-dlc-of_node.patch @@ -0,0 +1,49 @@ +From 0cf6c67673f6d4a3da02223adb0821f94a970295 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 4 Feb 2025 23:50:08 +0000 +Subject: ASoC: simple-card-utils.c: add missing dlc->of_node + +From: Kuninori Morimoto + +[ Upstream commit dabbd325b25edb5cdd99c94391817202dd54b651 ] + +commit 90de551c1bf ("ASoC: simple-card-utils.c: enable multi Component +support") added muiti Component support, but was missing to add +dlc->of_node. Because of it, Sound device list will indicates strange +name if it was DPCM connection and driver supports dai->driver->dai_args, +like below + + > aplay -l + card X: sndulcbmix [xxxx], device 0: fe.(null).rsnd-dai.0 (*) [] + ... ^^^^^^ + +It will be fixed by this patch + + > aplay -l + card X: sndulcbmix [xxxx], device 0: fe.sound@ec500000.rsnd-dai.0 (*) [] + ... ^^^^^^^^^^^^^^ + +Signed-off-by: Kuninori Morimoto +Reviewed-by: Daniel Baluta +Link: https://patch.msgid.link/87ikpp2rtb.wl-kuninori.morimoto.gx@renesas.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/generic/simple-card-utils.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c +index 24b371f320663..5b6c2f7f288a0 100644 +--- a/sound/soc/generic/simple-card-utils.c ++++ b/sound/soc/generic/simple-card-utils.c +@@ -1103,6 +1103,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep, + args.np = ep; + dai = snd_soc_get_dai_via_args(&args); + if (dai) { ++ dlc->of_node = node; + dlc->dai_name = snd_soc_dai_name_get(dai); + dlc->dai_args = snd_soc_copy_dai_args(dev, &args); + if (!dlc->dai_args) +-- +2.39.5 + diff --git a/queue-6.13/asoc-sof-amd-add-post_fw_run_delay-acp-quirk.patch b/queue-6.13/asoc-sof-amd-add-post_fw_run_delay-acp-quirk.patch new file mode 100644 index 0000000000..c3225cb549 --- /dev/null +++ b/queue-6.13/asoc-sof-amd-add-post_fw_run_delay-acp-quirk.patch @@ -0,0 +1,120 @@ +From 5976cd812323d2a07b64389e5dd9a591986c85f5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 7 Feb 2025 13:46:02 +0200 +Subject: ASoC: SOF: amd: Add post_fw_run_delay ACP quirk + +From: Cristian Ciocaltea + +[ Upstream commit 91b98d5a6e8067c5226207487681a48f0d651e46 ] + +Stress testing resume from suspend on Valve Steam Deck OLED (Galileo) +revealed that the DSP firmware could enter an unrecoverable faulty +state, where the kernel ring buffer is flooded with IPC related error +messages: + +[ +0.017002] snd_sof_amd_vangogh 0000:04:00.5: acp_sof_ipc_send_msg: Failed to acquire HW lock +[ +0.000054] snd_sof_amd_vangogh 0000:04:00.5: ipc3_tx_msg_unlocked: ipc message send for 0x30100000 failed: -22 +[ +0.000005] snd_sof_amd_vangogh 0000:04:00.5: Failed to setup widget PIPELINE.6.ACPHS1.IN +[ +0.000004] snd_sof_amd_vangogh 0000:04:00.5: Failed to restore pipeline after resume -22 +[ +0.000003] snd_sof_amd_vangogh 0000:04:00.5: PM: dpm_run_callback(): pci_pm_resume returns -22 +[ +0.000009] snd_sof_amd_vangogh 0000:04:00.5: PM: failed to resume async: error -22 +[...] +[ +0.002582] PM: suspend exit +[ +0.065085] snd_sof_amd_vangogh 0000:04:00.5: ipc tx error for 0x30130000 (msg/reply size: 12/0): -22 +[ +0.000499] snd_sof_amd_vangogh 0000:04:00.5: error: failed widget list set up for pcm 1 dir 0 +[ +0.000011] snd_sof_amd_vangogh 0000:04:00.5: error: set pcm hw_params after resume +[ +0.000006] snd_sof_amd_vangogh 0000:04:00.5: ASoC: error at snd_soc_pcm_component_prepare on 0000:04:00.5: -22 +[...] + +A system reboot would be necessary to restore the speakers +functionality. + +However, by delaying a bit any host to DSP transmission right after +the firmware boot completed, the issue could not be reproduced anymore +and sound continued to work flawlessly even after performing thousands +of suspend/resume cycles. + +Introduce the post_fw_run_delay ACP quirk to allow providing the +aforementioned delay via the snd_sof_dsp_ops->post_fw_run() callback for +the affected devices. + +Signed-off-by: Cristian Ciocaltea +Link: https://patch.msgid.link/20250207-sof-vangogh-fixes-v1-1-67824c1e4c9a@collabora.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sof/amd/acp.c | 1 + + sound/soc/sof/amd/acp.h | 1 + + sound/soc/sof/amd/vangogh.c | 18 ++++++++++++++++++ + 3 files changed, 20 insertions(+) + +diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c +index 33648ff8b8336..9e13c96528be3 100644 +--- a/sound/soc/sof/amd/acp.c ++++ b/sound/soc/sof/amd/acp.c +@@ -27,6 +27,7 @@ MODULE_PARM_DESC(enable_fw_debug, "Enable Firmware debug"); + static struct acp_quirk_entry quirk_valve_galileo = { + .signed_fw_image = true, + .skip_iram_dram_size_mod = true, ++ .post_fw_run_delay = true, + }; + + const struct dmi_system_id acp_sof_quirk_table[] = { +diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h +index 800594440f739..2a19d82d62002 100644 +--- a/sound/soc/sof/amd/acp.h ++++ b/sound/soc/sof/amd/acp.h +@@ -220,6 +220,7 @@ struct sof_amd_acp_desc { + struct acp_quirk_entry { + bool signed_fw_image; + bool skip_iram_dram_size_mod; ++ bool post_fw_run_delay; + }; + + /* Common device data struct for ACP devices */ +diff --git a/sound/soc/sof/amd/vangogh.c b/sound/soc/sof/amd/vangogh.c +index 8e2672106ac60..d5f1dddd43e72 100644 +--- a/sound/soc/sof/amd/vangogh.c ++++ b/sound/soc/sof/amd/vangogh.c +@@ -11,6 +11,7 @@ + * Hardware interface for Audio DSP on Vangogh platform + */ + ++#include + #include + #include + +@@ -136,6 +137,20 @@ static struct snd_soc_dai_driver vangogh_sof_dai[] = { + }, + }; + ++static int sof_vangogh_post_fw_run_delay(struct snd_sof_dev *sdev) ++{ ++ /* ++ * Resuming from suspend in some cases my cause the DSP firmware ++ * to enter an unrecoverable faulty state. Delaying a bit any host ++ * to DSP transmission right after firmware boot completion seems ++ * to resolve the issue. ++ */ ++ if (!sdev->first_boot) ++ usleep_range(100, 150); ++ ++ return 0; ++} ++ + /* Vangogh ops */ + struct snd_sof_dsp_ops sof_vangogh_ops; + EXPORT_SYMBOL_NS(sof_vangogh_ops, "SND_SOC_SOF_AMD_COMMON"); +@@ -157,6 +172,9 @@ int sof_vangogh_ops_init(struct snd_sof_dev *sdev) + + if (quirks->signed_fw_image) + sof_vangogh_ops.load_firmware = acp_sof_load_signed_firmware; ++ ++ if (quirks->post_fw_run_delay) ++ sof_vangogh_ops.post_fw_run = sof_vangogh_post_fw_run_delay; + } + + return 0; +-- +2.39.5 + diff --git a/queue-6.13/asoc-sof-amd-handle-ipc-replies-before-fw_boot_compl.patch b/queue-6.13/asoc-sof-amd-handle-ipc-replies-before-fw_boot_compl.patch new file mode 100644 index 0000000000..f54bfdd3c3 --- /dev/null +++ b/queue-6.13/asoc-sof-amd-handle-ipc-replies-before-fw_boot_compl.patch @@ -0,0 +1,68 @@ +From f2989d9c850b90fa38b8e4a19280d22f00a5bb6a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 7 Feb 2025 13:46:04 +0200 +Subject: ASoC: SOF: amd: Handle IPC replies before FW_BOOT_COMPLETE + +From: Cristian Ciocaltea + +[ Upstream commit ac84ca815adb4171a4276b1d44096b75f6a150b7 ] + +In some cases, e.g. during resuming from suspend, there is a possibility +that some IPC reply messages get received by the host while the DSP +firmware has not yet reached the complete boot state. + +Detect when this happens and do not attempt to process the unexpected +replies from DSP. Instead, provide proper debugging support. + +Signed-off-by: Cristian Ciocaltea +Link: https://patch.msgid.link/20250207-sof-vangogh-fixes-v1-3-67824c1e4c9a@collabora.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sof/amd/acp-ipc.c | 23 ++++++++++++++++------- + 1 file changed, 16 insertions(+), 7 deletions(-) + +diff --git a/sound/soc/sof/amd/acp-ipc.c b/sound/soc/sof/amd/acp-ipc.c +index 5f371d9263f3b..12caefd087885 100644 +--- a/sound/soc/sof/amd/acp-ipc.c ++++ b/sound/soc/sof/amd/acp-ipc.c +@@ -167,6 +167,7 @@ irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context) + + if (sdev->first_boot && sdev->fw_state != SOF_FW_BOOT_COMPLETE) { + acp_mailbox_read(sdev, sdev->dsp_box.offset, &status, sizeof(status)); ++ + if ((status & SOF_IPC_PANIC_MAGIC_MASK) == SOF_IPC_PANIC_MAGIC) { + snd_sof_dsp_panic(sdev, sdev->dsp_box.offset + sizeof(status), + true); +@@ -188,13 +189,21 @@ irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context) + + dsp_ack = snd_sof_dsp_read(sdev, ACP_DSP_BAR, ACP_SCRATCH_REG_0 + dsp_ack_write); + if (dsp_ack) { +- spin_lock_irq(&sdev->ipc_lock); +- /* handle immediate reply from DSP core */ +- acp_dsp_ipc_get_reply(sdev); +- snd_sof_ipc_reply(sdev, 0); +- /* set the done bit */ +- acp_dsp_ipc_dsp_done(sdev); +- spin_unlock_irq(&sdev->ipc_lock); ++ if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { ++ spin_lock_irq(&sdev->ipc_lock); ++ ++ /* handle immediate reply from DSP core */ ++ acp_dsp_ipc_get_reply(sdev); ++ snd_sof_ipc_reply(sdev, 0); ++ /* set the done bit */ ++ acp_dsp_ipc_dsp_done(sdev); ++ ++ spin_unlock_irq(&sdev->ipc_lock); ++ } else { ++ dev_dbg_ratelimited(sdev->dev, "IPC reply before FW_BOOT_COMPLETE: %#x\n", ++ dsp_ack); ++ } ++ + ipc_irq = true; + } + +-- +2.39.5 + diff --git a/queue-6.13/asoc-sof-intel-don-t-check-number-of-sdw-links-when-.patch b/queue-6.13/asoc-sof-intel-don-t-check-number-of-sdw-links-when-.patch new file mode 100644 index 0000000000..588950e90b --- /dev/null +++ b/queue-6.13/asoc-sof-intel-don-t-check-number-of-sdw-links-when-.patch @@ -0,0 +1,60 @@ +From 38bc4036d26c35114728abe5dae8c4f388d97393 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 25 Feb 2025 17:37:15 +0800 +Subject: ASoC: SOF: Intel: don't check number of sdw links when set dmic_fixup +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Bard Liao + +[ Upstream commit 56a677293509b2a0d39ac8d02b583c1ab1fe4d94 ] + +Currently, we assume that the PCH DMIC pins are pin-muxed with SoundWire +links. However, we do see a HW design that use PCH DMIC along with 3 +SoundWire links. Remove the check now. +With this change the PCM DMIC will be presented if it is reported by the +BIOS irrespective of whether there are SDW links present or not. + +Signed-off-by: Bard Liao +Reviewed-by: Ranjani Sridharan +Reviewed-by: Péter Ujfalusi +Link: https://patch.msgid.link/20250225093716.67240-2-yung-chuan.liao@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sof/intel/hda.c | 18 ++---------------- + 1 file changed, 2 insertions(+), 16 deletions(-) + +diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c +index be689f6e10c81..a1ccd95da8bb7 100644 +--- a/sound/soc/sof/intel/hda.c ++++ b/sound/soc/sof/intel/hda.c +@@ -1312,22 +1312,8 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) + /* report to machine driver if any DMICs are found */ + mach->mach_params.dmic_num = check_dmic_num(sdev); + +- if (sdw_mach_found) { +- /* +- * DMICs use up to 4 pins and are typically pin-muxed with SoundWire +- * link 2 and 3, or link 1 and 2, thus we only try to enable dmics +- * if all conditions are true: +- * a) 2 or fewer links are used by SoundWire +- * b) the NHLT table reports the presence of microphones +- */ +- if (hweight_long(mach->link_mask) <= 2) +- dmic_fixup = true; +- else +- mach->mach_params.dmic_num = 0; +- } else { +- if (mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER) +- dmic_fixup = true; +- } ++ if (sdw_mach_found || mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER) ++ dmic_fixup = true; + + if (tplg_fixup && + dmic_fixup && +-- +2.39.5 + diff --git a/queue-6.13/asoc-sof-intel-hda-add-softdep-pre-to-snd-hda-codec-.patch b/queue-6.13/asoc-sof-intel-hda-add-softdep-pre-to-snd-hda-codec-.patch new file mode 100644 index 0000000000..23955dfd62 --- /dev/null +++ b/queue-6.13/asoc-sof-intel-hda-add-softdep-pre-to-snd-hda-codec-.patch @@ -0,0 +1,44 @@ +From cd185d01d70213a55618fd1de5a514bfdf6de56f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 6 Feb 2025 11:47:23 +0200 +Subject: ASoC: SOF: Intel: hda: add softdep pre to snd-hda-codec-hdmi module +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Terry Cheong + +[ Upstream commit 33b7dc7843dbdc9b90c91d11ba30b107f9138ffd ] + +In enviornment without KMOD requesting module may fail to load +snd-hda-codec-hdmi, resulting in HDMI audio not usable. +Add softdep to loading HDMI codec module first to ensure we can load it +correctly. + +Signed-off-by: Terry Cheong +Reviewed-by: Bard Liao +Reviewed-by: Johny Lin +Reviewed-by: Péter Ujfalusi +Signed-off-by: Peter Ujfalusi +Link: https://patch.msgid.link/20250206094723.18013-1-peter.ujfalusi@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sof/intel/hda-codec.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c +index 568f3dfe822f5..2f9925830d1d5 100644 +--- a/sound/soc/sof/intel/hda-codec.c ++++ b/sound/soc/sof/intel/hda-codec.c +@@ -454,6 +454,7 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev) + } + EXPORT_SYMBOL_NS_GPL(hda_codec_i915_exit, "SND_SOC_SOF_HDA_AUDIO_CODEC_I915"); + ++MODULE_SOFTDEP("pre: snd-hda-codec-hdmi"); + #endif + + MODULE_LICENSE("Dual BSD/GPL"); +-- +2.39.5 + diff --git a/queue-6.13/asoc-sof-intel-pci-ptl-add-support-for-ptl-h.patch b/queue-6.13/asoc-sof-intel-pci-ptl-add-support-for-ptl-h.patch new file mode 100644 index 0000000000..5c032acb01 --- /dev/null +++ b/queue-6.13/asoc-sof-intel-pci-ptl-add-support-for-ptl-h.patch @@ -0,0 +1,37 @@ +From f5fc5c1b040a19c1b0a49cc5ad5a016e10e161bd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 10 Feb 2025 10:17:29 +0200 +Subject: ASoC: SOF: Intel: pci-ptl: Add support for PTL-H + +From: Peter Ujfalusi + +[ Upstream commit 4e9c87cfcd0584f2a2e2f352a43ff003d688f3a4 ] + +PTL-H uses the same configuration as PTL. + +Signed-off-by: Peter Ujfalusi +Reviewed-by: Kai Vehmanen +Reviewed-by: Bard Liao +Acked-by: Mark Brown +Signed-off-by: Takashi Iwai +Link: https://patch.msgid.link/20250210081730.22916-4-peter.ujfalusi@linux.intel.com +Signed-off-by: Sasha Levin +--- + sound/soc/sof/intel/pci-ptl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/sof/intel/pci-ptl.c b/sound/soc/sof/intel/pci-ptl.c +index 0aacdfac9fb43..c4fb6a2441b76 100644 +--- a/sound/soc/sof/intel/pci-ptl.c ++++ b/sound/soc/sof/intel/pci-ptl.c +@@ -50,6 +50,7 @@ static const struct sof_dev_desc ptl_desc = { + /* PCI IDs */ + static const struct pci_device_id sof_pci_ids[] = { + { PCI_DEVICE_DATA(INTEL, HDA_PTL, &ptl_desc) }, /* PTL */ ++ { PCI_DEVICE_DATA(INTEL, HDA_PTL_H, &ptl_desc) }, /* PTL-H */ + { 0, } + }; + MODULE_DEVICE_TABLE(pci, sof_pci_ids); +-- +2.39.5 + diff --git a/queue-6.13/asoc-tas2764-fix-power-control-mask.patch b/queue-6.13/asoc-tas2764-fix-power-control-mask.patch new file mode 100644 index 0000000000..f215d1d662 --- /dev/null +++ b/queue-6.13/asoc-tas2764-fix-power-control-mask.patch @@ -0,0 +1,35 @@ +From 2381145fd1f00130071f53a1d501ebf6e2ea816b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 18 Feb 2025 18:35:35 +1000 +Subject: ASoC: tas2764: Fix power control mask + +From: Hector Martin + +[ Upstream commit a3f172359e22b2c11b750d23560481a55bf86af1 ] + +Reviewed-by: Neal Gompa +Signed-off-by: Hector Martin +Signed-off-by: James Calligeros +Link: https://patch.msgid.link/20250218-apple-codec-changes-v2-1-932760fd7e07@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/tas2764.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/tas2764.h b/sound/soc/codecs/tas2764.h +index 168af772a898f..d13ecae9c9c2f 100644 +--- a/sound/soc/codecs/tas2764.h ++++ b/sound/soc/codecs/tas2764.h +@@ -25,7 +25,7 @@ + + /* Power Control */ + #define TAS2764_PWR_CTRL TAS2764_REG(0X0, 0x02) +-#define TAS2764_PWR_CTRL_MASK GENMASK(1, 0) ++#define TAS2764_PWR_CTRL_MASK GENMASK(2, 0) + #define TAS2764_PWR_CTRL_ACTIVE 0x0 + #define TAS2764_PWR_CTRL_MUTE BIT(0) + #define TAS2764_PWR_CTRL_SHUTDOWN BIT(1) +-- +2.39.5 + diff --git a/queue-6.13/asoc-tas2764-set-the-sdout-polarity-correctly.patch b/queue-6.13/asoc-tas2764-set-the-sdout-polarity-correctly.patch new file mode 100644 index 0000000000..42e01e37a4 --- /dev/null +++ b/queue-6.13/asoc-tas2764-set-the-sdout-polarity-correctly.patch @@ -0,0 +1,84 @@ +From 45386370eb1bdd906ad399785b7b3ca53ed458b8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 18 Feb 2025 18:36:02 +1000 +Subject: ASoC: tas2764: Set the SDOUT polarity correctly + +From: Hector Martin + +[ Upstream commit f5468beeab1b1adfc63c2717b1f29ef3f49a5fab ] + +TX launch polarity needs to be the opposite of RX capture polarity, to +generate the right bit slot alignment. + +Reviewed-by: Neal Gompa +Signed-off-by: Hector Martin +Signed-off-by: James Calligeros +Link: https://patch.msgid.link/20250218-apple-codec-changes-v2-28-932760fd7e07@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/tas2764.c | 10 +++++++++- + sound/soc/codecs/tas2764.h | 6 ++++++ + 2 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c +index d482cd194c08c..58315eab492a1 100644 +--- a/sound/soc/codecs/tas2764.c ++++ b/sound/soc/codecs/tas2764.c +@@ -365,7 +365,7 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) + { + struct snd_soc_component *component = dai->component; + struct tas2764_priv *tas2764 = snd_soc_component_get_drvdata(component); +- u8 tdm_rx_start_slot = 0, asi_cfg_0 = 0, asi_cfg_1 = 0; ++ u8 tdm_rx_start_slot = 0, asi_cfg_0 = 0, asi_cfg_1 = 0, asi_cfg_4 = 0; + int ret; + + switch (fmt & SND_SOC_DAIFMT_INV_MASK) { +@@ -374,12 +374,14 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) + fallthrough; + case SND_SOC_DAIFMT_NB_NF: + asi_cfg_1 = TAS2764_TDM_CFG1_RX_RISING; ++ asi_cfg_4 = TAS2764_TDM_CFG4_TX_FALLING; + break; + case SND_SOC_DAIFMT_IB_IF: + asi_cfg_0 ^= TAS2764_TDM_CFG0_FRAME_START; + fallthrough; + case SND_SOC_DAIFMT_IB_NF: + asi_cfg_1 = TAS2764_TDM_CFG1_RX_FALLING; ++ asi_cfg_4 = TAS2764_TDM_CFG4_TX_RISING; + break; + } + +@@ -389,6 +391,12 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) + if (ret < 0) + return ret; + ++ ret = snd_soc_component_update_bits(component, TAS2764_TDM_CFG4, ++ TAS2764_TDM_CFG4_TX_MASK, ++ asi_cfg_4); ++ if (ret < 0) ++ return ret; ++ + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { + case SND_SOC_DAIFMT_I2S: + asi_cfg_0 ^= TAS2764_TDM_CFG0_FRAME_START; +diff --git a/sound/soc/codecs/tas2764.h b/sound/soc/codecs/tas2764.h +index d13ecae9c9c2f..9490f2686e389 100644 +--- a/sound/soc/codecs/tas2764.h ++++ b/sound/soc/codecs/tas2764.h +@@ -79,6 +79,12 @@ + #define TAS2764_TDM_CFG3_RXS_SHIFT 0x4 + #define TAS2764_TDM_CFG3_MASK GENMASK(3, 0) + ++/* TDM Configuration Reg4 */ ++#define TAS2764_TDM_CFG4 TAS2764_REG(0X0, 0x0d) ++#define TAS2764_TDM_CFG4_TX_MASK BIT(0) ++#define TAS2764_TDM_CFG4_TX_RISING 0x0 ++#define TAS2764_TDM_CFG4_TX_FALLING BIT(0) ++ + /* TDM Configuration Reg5 */ + #define TAS2764_TDM_CFG5 TAS2764_REG(0X0, 0x0e) + #define TAS2764_TDM_CFG5_VSNS_MASK BIT(6) +-- +2.39.5 + diff --git a/queue-6.13/asoc-tas2770-fix-volume-scale.patch b/queue-6.13/asoc-tas2770-fix-volume-scale.patch new file mode 100644 index 0000000000..09d14683c5 --- /dev/null +++ b/queue-6.13/asoc-tas2770-fix-volume-scale.patch @@ -0,0 +1,36 @@ +From 78d292af5309e84720ff64933bd5ea50254838e1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 8 Feb 2025 00:54:35 +0000 +Subject: ASoC: tas2770: Fix volume scale + +From: Hector Martin + +[ Upstream commit 579cd64b9df8a60284ec3422be919c362de40e41 ] + +The scale starts at -100dB, not -128dB. + +Signed-off-by: Hector Martin +Signed-off-by: Mark Brown +Link: https://patch.msgid.link/20250208-asoc-tas2770-v1-1-cf50ff1d59a3@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/tas2770.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c +index 9f93b230652a5..863c3f672ba98 100644 +--- a/sound/soc/codecs/tas2770.c ++++ b/sound/soc/codecs/tas2770.c +@@ -506,7 +506,7 @@ static int tas2770_codec_probe(struct snd_soc_component *component) + } + + static DECLARE_TLV_DB_SCALE(tas2770_digital_tlv, 1100, 50, 0); +-static DECLARE_TLV_DB_SCALE(tas2770_playback_volume, -12750, 50, 0); ++static DECLARE_TLV_DB_SCALE(tas2770_playback_volume, -10050, 50, 0); + + static const struct snd_kcontrol_new tas2770_snd_controls[] = { + SOC_SINGLE_TLV("Speaker Playback Volume", TAS2770_PLAY_CFG_REG2, +-- +2.39.5 + diff --git a/queue-6.13/block-fix-kmem_cache-of-name-bio-108-already-exists.patch b/queue-6.13/block-fix-kmem_cache-of-name-bio-108-already-exists.patch new file mode 100644 index 0000000000..e012879802 --- /dev/null +++ b/queue-6.13/block-fix-kmem_cache-of-name-bio-108-already-exists.patch @@ -0,0 +1,41 @@ +From 5d7ec3e4baba0262538e1e79a3ffcb84ce740732 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 28 Feb 2025 21:26:56 +0800 +Subject: block: fix 'kmem_cache of name 'bio-108' already exists' + +From: Ming Lei + +[ Upstream commit b654f7a51ffb386131de42aa98ed831f8c126546 ] + +Device mapper bioset often has big bio_slab size, which can be more than +1000, then 8byte can't hold the slab name any more, cause the kmem_cache +allocation warning of 'kmem_cache of name 'bio-108' already exists'. + +Fix the warning by extending bio_slab->name to 12 bytes, but fix output +of /proc/slabinfo + +Reported-by: Guangwu Zhang +Signed-off-by: Ming Lei +Link: https://lore.kernel.org/r/20250228132656.2838008-1-ming.lei@redhat.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + block/bio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/block/bio.c b/block/bio.c +index d5bdc31d88d32..f54e8572affc1 100644 +--- a/block/bio.c ++++ b/block/bio.c +@@ -77,7 +77,7 @@ struct bio_slab { + struct kmem_cache *slab; + unsigned int slab_ref; + unsigned int slab_size; +- char name[8]; ++ char name[12]; + }; + static DEFINE_MUTEX(bio_slab_lock); + static DEFINE_XARRAY(bio_slabs); +-- +2.39.5 + diff --git a/queue-6.13/bluetooth-l2cap-fix-slab-use-after-free-read-in-l2ca.patch b/queue-6.13/bluetooth-l2cap-fix-slab-use-after-free-read-in-l2ca.patch new file mode 100644 index 0000000000..40b97e6ad3 --- /dev/null +++ b/queue-6.13/bluetooth-l2cap-fix-slab-use-after-free-read-in-l2ca.patch @@ -0,0 +1,196 @@ +From 32bde0795028e0d13f4e709fd06934abb0eb6b2e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Jan 2025 10:35:03 -0500 +Subject: Bluetooth: L2CAP: Fix slab-use-after-free Read in l2cap_send_cmd + +From: Luiz Augusto von Dentz + +[ Upstream commit b4f82f9ed43aefa79bec2504ae8c29be0c0f5d1d ] + +After the hci sync command releases l2cap_conn, the hci receive data work +queue references the released l2cap_conn when sending to the upper layer. +Add hci dev lock to the hci receive data work queue to synchronize the two. + +[1] +BUG: KASAN: slab-use-after-free in l2cap_send_cmd+0x187/0x8d0 net/bluetooth/l2cap_core.c:954 +Read of size 8 at addr ffff8880271a4000 by task kworker/u9:2/5837 + +CPU: 0 UID: 0 PID: 5837 Comm: kworker/u9:2 Not tainted 6.13.0-rc5-syzkaller-00163-gab75170520d4 #0 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 +Workqueue: hci1 hci_rx_work +Call Trace: + + __dump_stack lib/dump_stack.c:94 [inline] + dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 + print_address_description mm/kasan/report.c:378 [inline] + print_report+0x169/0x550 mm/kasan/report.c:489 + kasan_report+0x143/0x180 mm/kasan/report.c:602 + l2cap_build_cmd net/bluetooth/l2cap_core.c:2964 [inline] + l2cap_send_cmd+0x187/0x8d0 net/bluetooth/l2cap_core.c:954 + l2cap_sig_send_rej net/bluetooth/l2cap_core.c:5502 [inline] + l2cap_sig_channel net/bluetooth/l2cap_core.c:5538 [inline] + l2cap_recv_frame+0x221f/0x10db0 net/bluetooth/l2cap_core.c:6817 + hci_acldata_packet net/bluetooth/hci_core.c:3797 [inline] + hci_rx_work+0x508/0xdb0 net/bluetooth/hci_core.c:4040 + process_one_work kernel/workqueue.c:3229 [inline] + process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 + worker_thread+0x870/0xd30 kernel/workqueue.c:3391 + kthread+0x2f0/0x390 kernel/kthread.c:389 + ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 + ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 + + +Allocated by task 5837: + kasan_save_stack mm/kasan/common.c:47 [inline] + kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 + poison_kmalloc_redzone mm/kasan/common.c:377 [inline] + __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 + kasan_kmalloc include/linux/kasan.h:260 [inline] + __kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4329 + kmalloc_noprof include/linux/slab.h:901 [inline] + kzalloc_noprof include/linux/slab.h:1037 [inline] + l2cap_conn_add+0xa9/0x8e0 net/bluetooth/l2cap_core.c:6860 + l2cap_connect_cfm+0x115/0x1090 net/bluetooth/l2cap_core.c:7239 + hci_connect_cfm include/net/bluetooth/hci_core.h:2057 [inline] + hci_remote_features_evt+0x68e/0xac0 net/bluetooth/hci_event.c:3726 + hci_event_func net/bluetooth/hci_event.c:7473 [inline] + hci_event_packet+0xac2/0x1540 net/bluetooth/hci_event.c:7525 + hci_rx_work+0x3f3/0xdb0 net/bluetooth/hci_core.c:4035 + process_one_work kernel/workqueue.c:3229 [inline] + process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 + worker_thread+0x870/0xd30 kernel/workqueue.c:3391 + kthread+0x2f0/0x390 kernel/kthread.c:389 + ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 + ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 + +Freed by task 54: + kasan_save_stack mm/kasan/common.c:47 [inline] + kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 + kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582 + poison_slab_object mm/kasan/common.c:247 [inline] + __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 + kasan_slab_free include/linux/kasan.h:233 [inline] + slab_free_hook mm/slub.c:2353 [inline] + slab_free mm/slub.c:4613 [inline] + kfree+0x196/0x430 mm/slub.c:4761 + l2cap_connect_cfm+0xcc/0x1090 net/bluetooth/l2cap_core.c:7235 + hci_connect_cfm include/net/bluetooth/hci_core.h:2057 [inline] + hci_conn_failed+0x287/0x400 net/bluetooth/hci_conn.c:1266 + hci_abort_conn_sync+0x56c/0x11f0 net/bluetooth/hci_sync.c:5603 + hci_cmd_sync_work+0x22b/0x400 net/bluetooth/hci_sync.c:332 + process_one_work kernel/workqueue.c:3229 [inline] + process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 + worker_thread+0x870/0xd30 kernel/workqueue.c:3391 + kthread+0x2f0/0x390 kernel/kthread.c:389 + ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 + ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 + +Reported-by: syzbot+31c2f641b850a348a734@syzkaller.appspotmail.com +Closes: https://syzkaller.appspot.com/bug?extid=31c2f641b850a348a734 +Tested-by: syzbot+31c2f641b850a348a734@syzkaller.appspotmail.com +Signed-off-by: Edward Adam Davis +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + net/bluetooth/l2cap_core.c | 39 +++++++++++++++++++++++++++++++++----- + 1 file changed, 34 insertions(+), 5 deletions(-) + +diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c +index 4db2d6363bbb5..09c08d0a13321 100644 +--- a/net/bluetooth/l2cap_core.c ++++ b/net/bluetooth/l2cap_core.c +@@ -949,6 +949,16 @@ static u8 l2cap_get_ident(struct l2cap_conn *conn) + return id; + } + ++static void l2cap_send_acl(struct l2cap_conn *conn, struct sk_buff *skb, ++ u8 flags) ++{ ++ /* Check if the hcon still valid before attempting to send */ ++ if (hci_conn_valid(conn->hcon->hdev, conn->hcon)) ++ hci_send_acl(conn->hchan, skb, flags); ++ else ++ kfree_skb(skb); ++} ++ + static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, + void *data) + { +@@ -971,7 +981,7 @@ static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, + bt_cb(skb)->force_active = BT_POWER_FORCE_ACTIVE_ON; + skb->priority = HCI_PRIO_MAX; + +- hci_send_acl(conn->hchan, skb, flags); ++ l2cap_send_acl(conn, skb, flags); + } + + static void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb) +@@ -1793,13 +1803,10 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err) + + mutex_unlock(&conn->chan_lock); + +- hci_chan_del(conn->hchan); +- + if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) + cancel_delayed_work_sync(&conn->info_timer); + + hcon->l2cap_data = NULL; +- conn->hchan = NULL; + l2cap_conn_put(conn); + } + +@@ -1807,6 +1814,7 @@ static void l2cap_conn_free(struct kref *ref) + { + struct l2cap_conn *conn = container_of(ref, struct l2cap_conn, ref); + ++ hci_chan_del(conn->hchan); + hci_conn_put(conn->hcon); + kfree(conn); + } +@@ -7472,14 +7480,33 @@ static void l2cap_recv_reset(struct l2cap_conn *conn) + conn->rx_len = 0; + } + ++static struct l2cap_conn *l2cap_conn_hold_unless_zero(struct l2cap_conn *c) ++{ ++ BT_DBG("conn %p orig refcnt %u", c, kref_read(&c->ref)); ++ ++ if (!kref_get_unless_zero(&c->ref)) ++ return NULL; ++ ++ return c; ++} ++ + void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags) + { +- struct l2cap_conn *conn = hcon->l2cap_data; ++ struct l2cap_conn *conn; + int len; + ++ /* Lock hdev to access l2cap_data to avoid race with l2cap_conn_del */ ++ hci_dev_lock(hcon->hdev); ++ ++ conn = hcon->l2cap_data; ++ + if (!conn) + conn = l2cap_conn_add(hcon); + ++ conn = l2cap_conn_hold_unless_zero(conn); ++ ++ hci_dev_unlock(hcon->hdev); ++ + if (!conn) + goto drop; + +@@ -7571,6 +7598,8 @@ void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags) + break; + } + ++ l2cap_conn_put(conn); ++ + drop: + kfree_skb(skb); + } +-- +2.39.5 + diff --git a/queue-6.13/btrfs-avoid-starting-new-transaction-when-cleaning-q.patch b/queue-6.13/btrfs-avoid-starting-new-transaction-when-cleaning-q.patch new file mode 100644 index 0000000000..7dab5b84aa --- /dev/null +++ b/queue-6.13/btrfs-avoid-starting-new-transaction-when-cleaning-q.patch @@ -0,0 +1,51 @@ +From 4a0fc13108e9cf695f34a3392d415350d04b7df9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 21 Jan 2025 12:24:39 +0000 +Subject: btrfs: avoid starting new transaction when cleaning qgroup during + subvolume drop + +From: Filipe Manana + +[ Upstream commit fdef89ce6fada462aef9cb90a140c93c8c209f0f ] + +At btrfs_qgroup_cleanup_dropped_subvolume() all we want to commit the +current transaction in order to have all the qgroup rfer/excl numbers up +to date. However we are using btrfs_start_transaction(), which joins the +current transaction if there is one that is not yet committing, but also +starts a new one if there is none or if the current one is already +committing (its state is >= TRANS_STATE_COMMIT_START). This later case +results in unnecessary IO, wasting time and a pointless rotation of the +backup roots in the super block. + +So instead of using btrfs_start_transaction() followed by a +btrfs_commit_transaction(), use btrfs_commit_current_transaction() which +achieves our purpose and avoids starting and committing new transactions. + +Reviewed-by: Qu Wenruo +Signed-off-by: Filipe Manana +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/qgroup.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c +index 5ab51781d0e4f..20b025f6ac3cc 100644 +--- a/fs/btrfs/qgroup.c ++++ b/fs/btrfs/qgroup.c +@@ -1898,11 +1898,7 @@ int btrfs_qgroup_cleanup_dropped_subvolume(struct btrfs_fs_info *fs_info, u64 su + * Commit current transaction to make sure all the rfer/excl numbers + * get updated. + */ +- trans = btrfs_start_transaction(fs_info->quota_root, 0); +- if (IS_ERR(trans)) +- return PTR_ERR(trans); +- +- ret = btrfs_commit_transaction(trans); ++ ret = btrfs_commit_current_transaction(fs_info->quota_root); + if (ret < 0) + return ret; + +-- +2.39.5 + diff --git a/queue-6.13/btrfs-fix-two-misuses-of-folio_shift.patch b/queue-6.13/btrfs-fix-two-misuses-of-folio_shift.patch new file mode 100644 index 0000000000..480b37b571 --- /dev/null +++ b/queue-6.13/btrfs-fix-two-misuses-of-folio_shift.patch @@ -0,0 +1,70 @@ +From 9ca865394b6be9e55b37fc87ab527686b0696ac7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 21 Jan 2025 05:40:51 +0000 +Subject: btrfs: fix two misuses of folio_shift() + +From: Matthew Wilcox (Oracle) + +[ Upstream commit 01af106a076352182b2916b143fc50272600bd81 ] + +It is meaningless to shift a byte count by folio_shift(). The folio index +is in units of PAGE_SIZE, not folio_size(). We can use folio_contains() +to make this work for arbitrary-order folios, so remove the assertion +that the folios are of order 0. + +Reviewed-by: Qu Wenruo +Signed-off-by: Matthew Wilcox (Oracle) +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/extent_io.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c +index 0dd24d1289863..95d3cf2e15c84 100644 +--- a/fs/btrfs/extent_io.c ++++ b/fs/btrfs/extent_io.c +@@ -526,8 +526,6 @@ static void end_bbio_data_read(struct btrfs_bio *bbio) + u64 end; + u32 len; + +- /* For now only order 0 folios are supported for data. */ +- ASSERT(folio_order(folio) == 0); + btrfs_debug(fs_info, + "%s: bi_sector=%llu, err=%d, mirror=%u", + __func__, bio->bi_iter.bi_sector, bio->bi_status, +@@ -555,7 +553,6 @@ static void end_bbio_data_read(struct btrfs_bio *bbio) + + if (likely(uptodate)) { + loff_t i_size = i_size_read(inode); +- pgoff_t end_index = i_size >> folio_shift(folio); + + /* + * Zero out the remaining part if this range straddles +@@ -564,9 +561,11 @@ static void end_bbio_data_read(struct btrfs_bio *bbio) + * Here we should only zero the range inside the folio, + * not touch anything else. + * +- * NOTE: i_size is exclusive while end is inclusive. ++ * NOTE: i_size is exclusive while end is inclusive and ++ * folio_contains() takes PAGE_SIZE units. + */ +- if (folio_index(folio) == end_index && i_size <= end) { ++ if (folio_contains(folio, i_size >> PAGE_SHIFT) && ++ i_size <= end) { + u32 zero_start = max(offset_in_folio(folio, i_size), + offset_in_folio(folio, start)); + u32 zero_len = offset_in_folio(folio, end) + 1 - +@@ -960,7 +959,7 @@ static int btrfs_do_readpage(struct folio *folio, struct extent_map **em_cached, + return ret; + } + +- if (folio->index == last_byte >> folio_shift(folio)) { ++ if (folio_contains(folio, last_byte >> PAGE_SHIFT)) { + size_t zero_offset = offset_in_folio(folio, last_byte); + + if (zero_offset) { +-- +2.39.5 + diff --git a/queue-6.13/cifs-throw-eopnotsupp-error-on-unsupported-reparse-p.patch b/queue-6.13/cifs-throw-eopnotsupp-error-on-unsupported-reparse-p.patch new file mode 100644 index 0000000000..8ac67f1ec3 --- /dev/null +++ b/queue-6.13/cifs-throw-eopnotsupp-error-on-unsupported-reparse-p.patch @@ -0,0 +1,46 @@ +From bb9e8b00c0e4d9341efc68c12a16f6c0a81d593e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Sep 2024 00:16:05 +0200 +Subject: cifs: Throw -EOPNOTSUPP error on unsupported reparse point type from + parse_reparse_point() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +[ Upstream commit cad3fc0a4c8cef07b07ceddc137f582267577250 ] + +This would help to track and detect by caller if the reparse point type was +processed or not. + +Signed-off-by: Pali Rohár +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/smb/client/reparse.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/fs/smb/client/reparse.c b/fs/smb/client/reparse.c +index b387dfbaf16b0..a93127c94aff9 100644 +--- a/fs/smb/client/reparse.c ++++ b/fs/smb/client/reparse.c +@@ -724,13 +724,12 @@ int parse_reparse_point(struct reparse_data_buffer *buf, + le32_to_cpu(buf->ReparseTag)); + return -EIO; + } +- break; ++ return 0; + default: + cifs_tcon_dbg(VFS | ONCE, "unhandled reparse tag: 0x%08x\n", + le32_to_cpu(buf->ReparseTag)); +- break; ++ return -EOPNOTSUPP; + } +- return 0; + } + + int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb, +-- +2.39.5 + diff --git a/queue-6.13/cifs-treat-unhandled-directory-name-surrogate-repars.patch b/queue-6.13/cifs-treat-unhandled-directory-name-surrogate-repars.patch new file mode 100644 index 0000000000..5d5f0a03d0 --- /dev/null +++ b/queue-6.13/cifs-treat-unhandled-directory-name-surrogate-repars.patch @@ -0,0 +1,73 @@ +From c5127a52c6ce26670ee3185068521f1780f024e7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Sep 2024 00:28:25 +0200 +Subject: cifs: Treat unhandled directory name surrogate reparse points as + mount directory nodes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +[ Upstream commit b587fd128660d48cd2122f870f720ff8e2b4abb3 ] + +If the reparse point was not handled (indicated by the -EOPNOTSUPP from +ops->parse_reparse_point() call) but reparse tag is of type name surrogate +directory type, then treat is as a new mount point. + +Name surrogate reparse point represents another named entity in the system. + +From SMB client point of view, this another entity is resolved on the SMB +server, and server serves its content automatically. Therefore from Linux +client point of view, this name surrogate reparse point of directory type +crosses mount point. + +Signed-off-by: Pali Rohár +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/smb/client/inode.c | 13 +++++++++++++ + fs/smb/common/smbfsctl.h | 3 +++ + 2 files changed, 16 insertions(+) + +diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c +index 4d8effe78be57..a1b06ca07fcc7 100644 +--- a/fs/smb/client/inode.c ++++ b/fs/smb/client/inode.c +@@ -1215,6 +1215,19 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data, + rc = server->ops->parse_reparse_point(cifs_sb, + full_path, + iov, data); ++ /* ++ * If the reparse point was not handled but it is the ++ * name surrogate which points to directory, then treat ++ * is as a new mount point. Name surrogate reparse point ++ * represents another named entity in the system. ++ */ ++ if (rc == -EOPNOTSUPP && ++ IS_REPARSE_TAG_NAME_SURROGATE(data->reparse.tag) && ++ (le32_to_cpu(data->fi.Attributes) & ATTR_DIRECTORY)) { ++ rc = 0; ++ cifs_create_junction_fattr(fattr, sb); ++ goto out; ++ } + } + break; + } +diff --git a/fs/smb/common/smbfsctl.h b/fs/smb/common/smbfsctl.h +index 4b379e84c46b9..3253a18ecb5cb 100644 +--- a/fs/smb/common/smbfsctl.h ++++ b/fs/smb/common/smbfsctl.h +@@ -159,6 +159,9 @@ + #define IO_REPARSE_TAG_LX_CHR 0x80000025 + #define IO_REPARSE_TAG_LX_BLK 0x80000026 + ++/* If Name Surrogate Bit is set, the file or directory represents another named entity in the system. */ ++#define IS_REPARSE_TAG_NAME_SURROGATE(tag) (!!((tag) & 0x20000000)) ++ + /* fsctl flags */ + /* If Flags is set to this value, the request is an FSCTL not ioctl request */ + #define SMB2_0_IOCTL_IS_FSCTL 0x00000001 +-- +2.39.5 + diff --git a/queue-6.13/drm-amd-display-fix-out-of-bound-accesses.patch b/queue-6.13/drm-amd-display-fix-out-of-bound-accesses.patch new file mode 100644 index 0000000000..b6ac171862 --- /dev/null +++ b/queue-6.13/drm-amd-display-fix-out-of-bound-accesses.patch @@ -0,0 +1,85 @@ +From d1cdaae1955996d511626f590a311c0c7463d857 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Jan 2025 12:37:11 -0700 +Subject: drm/amd/display: Fix out-of-bound accesses + +From: Alex Hung + +[ Upstream commit 8adbb2a98b00926315fd513b5fe2596b5716b82d ] + +[WHAT & HOW] +hpo_stream_to_link_encoder_mapping has size MAX_HPO_DP2_ENCODERS(=4), +but location can have size up to 6. As a result, it is necessary to +check location against MAX_HPO_DP2_ENCODERS. + +Similiarly, disp_cfg_stream_location can be used as an array index which +should be 0..5, so the ASSERT's conditions should be less without equal. + +Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3904 +Reviewed-by: Austin Zheng +Reviewed-by: Rodrigo Siqueira +Signed-off-by: Alex Hung +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + .../amd/display/dc/dml2/dml21/dml21_translation_helper.c | 4 ++-- + .../gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c | 6 +++--- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +index c6a5a86146797..de2b6e954fbd2 100644 +--- a/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c ++++ b/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +@@ -1010,7 +1010,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s + if (disp_cfg_stream_location < 0) + disp_cfg_stream_location = dml_dispcfg->num_streams++; + +- ASSERT(disp_cfg_stream_location >= 0 && disp_cfg_stream_location <= __DML2_WRAPPER_MAX_STREAMS_PLANES__); ++ ASSERT(disp_cfg_stream_location >= 0 && disp_cfg_stream_location < __DML2_WRAPPER_MAX_STREAMS_PLANES__); + populate_dml21_timing_config_from_stream_state(&dml_dispcfg->stream_descriptors[disp_cfg_stream_location].timing, context->streams[stream_index], dml_ctx); + adjust_dml21_hblank_timing_config_from_pipe_ctx(&dml_dispcfg->stream_descriptors[disp_cfg_stream_location].timing, &context->res_ctx.pipe_ctx[stream_index]); + populate_dml21_output_config_from_stream_state(&dml_dispcfg->stream_descriptors[disp_cfg_stream_location].output, context->streams[stream_index], &context->res_ctx.pipe_ctx[stream_index]); +@@ -1035,7 +1035,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s + if (disp_cfg_plane_location < 0) + disp_cfg_plane_location = dml_dispcfg->num_planes++; + +- ASSERT(disp_cfg_plane_location >= 0 && disp_cfg_plane_location <= __DML2_WRAPPER_MAX_STREAMS_PLANES__); ++ ASSERT(disp_cfg_plane_location >= 0 && disp_cfg_plane_location < __DML2_WRAPPER_MAX_STREAMS_PLANES__); + + populate_dml21_surface_config_from_plane_state(in_dc, &dml_dispcfg->plane_descriptors[disp_cfg_plane_location].surface, context->stream_status[stream_index].plane_states[plane_index]); + populate_dml21_plane_config_from_plane_state(dml_ctx, &dml_dispcfg->plane_descriptors[disp_cfg_plane_location], context->stream_status[stream_index].plane_states[plane_index], context, stream_index); +diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +index bde4250853b10..81ba8809a3b4c 100644 +--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c ++++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +@@ -746,7 +746,7 @@ static void populate_dml_output_cfg_from_stream_state(struct dml_output_cfg_st * + case SIGNAL_TYPE_DISPLAY_PORT_MST: + case SIGNAL_TYPE_DISPLAY_PORT: + out->OutputEncoder[location] = dml_dp; +- if (dml2->v20.scratch.hpo_stream_to_link_encoder_mapping[location] != -1) ++ if (location < MAX_HPO_DP2_ENCODERS && dml2->v20.scratch.hpo_stream_to_link_encoder_mapping[location] != -1) + out->OutputEncoder[dml2->v20.scratch.hpo_stream_to_link_encoder_mapping[location]] = dml_dp2p0; + break; + case SIGNAL_TYPE_EDP: +@@ -1303,7 +1303,7 @@ void map_dc_state_into_dml_display_cfg(struct dml2_context *dml2, struct dc_stat + if (disp_cfg_stream_location < 0) + disp_cfg_stream_location = dml_dispcfg->num_timings++; + +- ASSERT(disp_cfg_stream_location >= 0 && disp_cfg_stream_location <= __DML2_WRAPPER_MAX_STREAMS_PLANES__); ++ ASSERT(disp_cfg_stream_location >= 0 && disp_cfg_stream_location < __DML2_WRAPPER_MAX_STREAMS_PLANES__); + + populate_dml_timing_cfg_from_stream_state(&dml_dispcfg->timing, disp_cfg_stream_location, context->streams[i]); + populate_dml_output_cfg_from_stream_state(&dml_dispcfg->output, disp_cfg_stream_location, context->streams[i], current_pipe_context, dml2); +@@ -1343,7 +1343,7 @@ void map_dc_state_into_dml_display_cfg(struct dml2_context *dml2, struct dc_stat + if (disp_cfg_plane_location < 0) + disp_cfg_plane_location = dml_dispcfg->num_surfaces++; + +- ASSERT(disp_cfg_plane_location >= 0 && disp_cfg_plane_location <= __DML2_WRAPPER_MAX_STREAMS_PLANES__); ++ ASSERT(disp_cfg_plane_location >= 0 && disp_cfg_plane_location < __DML2_WRAPPER_MAX_STREAMS_PLANES__); + + populate_dml_surface_cfg_from_plane_state(dml2->v20.dml_core_ctx.project, &dml_dispcfg->surface, disp_cfg_plane_location, context->stream_status[i].plane_states[j]); + populate_dml_plane_cfg_from_plane_state( +-- +2.39.5 + diff --git a/queue-6.13/drm-nouveau-do-not-override-forced-connector-status.patch b/queue-6.13/drm-nouveau-do-not-override-forced-connector-status.patch new file mode 100644 index 0000000000..dce56fdf6e --- /dev/null +++ b/queue-6.13/drm-nouveau-do-not-override-forced-connector-status.patch @@ -0,0 +1,35 @@ +From 1c32f48ff802519ccb58d05c17ab91a01142508b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 14 Jan 2025 10:57:25 +0100 +Subject: drm/nouveau: Do not override forced connector status + +From: Thomas Zimmermann + +[ Upstream commit 01f1d77a2630e774ce33233c4e6723bca3ae9daa ] + +Keep user-forced connector status even if it cannot be programmed. Same +behavior as for the rest of the drivers. + +Signed-off-by: Thomas Zimmermann +Signed-off-by: Lyude Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20250114100214.195386-1-tzimmermann@suse.de +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/nouveau/nouveau_connector.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c +index 8d5c9c74cbb90..eac0d1d2dbda2 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_connector.c ++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c +@@ -775,7 +775,6 @@ nouveau_connector_force(struct drm_connector *connector) + if (!nv_encoder) { + NV_ERROR(drm, "can't find encoder to force %s on!\n", + connector->name); +- connector->status = connector_status_disconnected; + return; + } + +-- +2.39.5 + diff --git a/queue-6.13/drm-tests-hdmi-fix-recursive-locking.patch b/queue-6.13/drm-tests-hdmi-fix-recursive-locking.patch new file mode 100644 index 0000000000..4f2a40661b --- /dev/null +++ b/queue-6.13/drm-tests-hdmi-fix-recursive-locking.patch @@ -0,0 +1,370 @@ +From 217a7434cfaaafca4c7bdbf6ad152a8720ac3038 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Jan 2025 15:21:56 +0100 +Subject: drm/tests: hdmi: Fix recursive locking + +From: Maxime Ripard + +[ Upstream commit 5d14c08a47460e8eedf0185a28b116420ea7f29d ] + +The find_preferred_mode() functions takes the mode_config mutex, but due +to the order most tests have, is called with the crtc_ww_class_mutex +taken. This raises a warning for a circular dependency when running the +tests with lockdep. + +Reorder the tests to call find_preferred_mode before the acquire context +has been created to avoid the issue. + +Reviewed-by: Simona Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20250129-test-kunit-v2-4-fe59c43805d5@kernel.org +Signed-off-by: Maxime Ripard +Signed-off-by: Sasha Levin +--- + .../drm/tests/drm_hdmi_state_helper_test.c | 114 +++++++++--------- + 1 file changed, 57 insertions(+), 57 deletions(-) + +diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +index 1dfd346c6fb39..383fbe128348e 100644 +--- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c ++++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +@@ -262,12 +262,12 @@ static void drm_test_check_broadcast_rgb_crtc_mode_changed(struct kunit *test) + crtc = priv->crtc; + conn = &priv->connector; + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -326,12 +326,12 @@ static void drm_test_check_broadcast_rgb_crtc_mode_not_changed(struct kunit *tes + crtc = priv->crtc; + conn = &priv->connector; + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -391,13 +391,13 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode(struct kunit *test) + conn = &priv->connector; + KUNIT_ASSERT_TRUE(test, conn->display_info.is_hdmi); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_NE(test, drm_match_cea_mode(preferred), 1); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -502,13 +502,13 @@ static void drm_test_check_broadcast_rgb_full_cea_mode(struct kunit *test) + conn = &priv->connector; + KUNIT_ASSERT_TRUE(test, conn->display_info.is_hdmi); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_NE(test, drm_match_cea_mode(preferred), 1); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -617,13 +617,13 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode(struct kunit *test) + conn = &priv->connector; + KUNIT_ASSERT_TRUE(test, conn->display_info.is_hdmi); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_NE(test, drm_match_cea_mode(preferred), 1); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -737,12 +737,12 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test) + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz)); + KUNIT_ASSERT_GT(test, ret, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -811,12 +811,12 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test) + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz)); + KUNIT_ASSERT_GT(test, ret, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -885,12 +885,12 @@ static void drm_test_check_output_bpc_dvi(struct kunit *test) + info = &conn->display_info; + KUNIT_ASSERT_FALSE(test, info->is_hdmi); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -929,13 +929,13 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test) + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_200mhz)); + KUNIT_ASSERT_GT(test, ret, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -976,13 +976,13 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test) + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz)); + KUNIT_ASSERT_GT(test, ret, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -1023,13 +1023,13 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(struct kunit *test) + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz)); + KUNIT_ASSERT_GT(test, ret, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -1070,12 +1070,12 @@ static void drm_test_check_hdmi_funcs_reject_rate(struct kunit *test) + crtc = priv->crtc; + conn = &priv->connector; + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -1135,9 +1135,6 @@ static void drm_test_check_max_tmds_rate_bpc_fallback(struct kunit *test) + KUNIT_ASSERT_TRUE(test, info->is_hdmi); + KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); +@@ -1148,6 +1145,9 @@ static void drm_test_check_max_tmds_rate_bpc_fallback(struct kunit *test) + rate = drm_hdmi_compute_mode_clock(preferred, 10, HDMI_COLORSPACE_RGB); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +@@ -1204,9 +1204,6 @@ static void drm_test_check_max_tmds_rate_format_fallback(struct kunit *test) + KUNIT_ASSERT_TRUE(test, info->is_hdmi); + KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); +@@ -1220,6 +1217,9 @@ static void drm_test_check_max_tmds_rate_format_fallback(struct kunit *test) + rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +@@ -1266,9 +1266,6 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test) + KUNIT_ASSERT_TRUE(test, info->is_hdmi); + KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); + KUNIT_ASSERT_NOT_NULL(test, mode); + +@@ -1282,6 +1279,9 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test) + rate = mode->clock * 1500; + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, mode, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); +@@ -1327,9 +1327,6 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test) + KUNIT_ASSERT_TRUE(test, info->is_hdmi); + KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + +@@ -1348,6 +1345,9 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test) + rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +@@ -1394,9 +1394,6 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test + KUNIT_ASSERT_TRUE(test, info->is_hdmi); + KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + +@@ -1415,6 +1412,9 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test + rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +@@ -1460,9 +1460,6 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test + KUNIT_ASSERT_TRUE(test, info->is_hdmi); + KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + +@@ -1473,6 +1470,9 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test + rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +@@ -1520,9 +1520,6 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes + KUNIT_ASSERT_TRUE(test, info->is_hdmi); + KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0); + +- ctx = drm_kunit_helper_acquire_ctx_alloc(test); +- KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); +- + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + +@@ -1533,6 +1530,9 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes + rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + ++ ctx = drm_kunit_helper_acquire_ctx_alloc(test); ++ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); ++ + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +-- +2.39.5 + diff --git a/queue-6.13/drm-tests-hdmi-remove-redundant-assignments.patch b/queue-6.13/drm-tests-hdmi-remove-redundant-assignments.patch new file mode 100644 index 0000000000..42f54f9f85 --- /dev/null +++ b/queue-6.13/drm-tests-hdmi-remove-redundant-assignments.patch @@ -0,0 +1,60 @@ +From 61ed59da544cb46b2ede108cd25aac3774b84a74 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Jan 2025 15:21:54 +0100 +Subject: drm/tests: hdmi: Remove redundant assignments + +From: Maxime Ripard + +[ Upstream commit bb4f929a8875b4801db95b8cf3b2c527c1e475e0 ] + +Some tests have the drm pointer assigned multiple times to the same +value. Drop the redundant assignments. + +Reviewed-by: Simona Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20250129-test-kunit-v2-2-fe59c43805d5@kernel.org +Signed-off-by: Maxime Ripard +Stable-dep-of: 5d14c08a4746 ("drm/tests: hdmi: Fix recursive locking") +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +index cbd9584af3299..4e7369caa7369 100644 +--- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c ++++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +@@ -450,7 +450,6 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode_vic_1(struct kunit *test) + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); + KUNIT_ASSERT_NOT_NULL(test, mode); + +- drm = &priv->drm; + crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, mode, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); +@@ -564,7 +563,6 @@ static void drm_test_check_broadcast_rgb_full_cea_mode_vic_1(struct kunit *test) + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); + KUNIT_ASSERT_NOT_NULL(test, mode); + +- drm = &priv->drm; + crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, mode, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); +@@ -680,7 +678,6 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode_vic_1(struct kunit *te + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); + KUNIT_ASSERT_NOT_NULL(test, mode); + +- drm = &priv->drm; + crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, mode, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); +@@ -1282,7 +1279,6 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test) + rate = mode->clock * 1500; + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + +- drm = &priv->drm; + crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, mode, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); +-- +2.39.5 + diff --git a/queue-6.13/drm-tests-hdmi-reorder-drm-entities-variables-assign.patch b/queue-6.13/drm-tests-hdmi-reorder-drm-entities-variables-assign.patch new file mode 100644 index 0000000000..8dc2007852 --- /dev/null +++ b/queue-6.13/drm-tests-hdmi-reorder-drm-entities-variables-assign.patch @@ -0,0 +1,359 @@ +From bc3ff10de075b56b38c810e60184fbd393ddc06d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Jan 2025 15:21:55 +0100 +Subject: drm/tests: hdmi: Reorder DRM entities variables assignment + +From: Maxime Ripard + +[ Upstream commit 6b6bfd63e1626ceedc738b2a06505aa5b46c1481 ] + +The tests all deviate slightly in how they assign their local pointers +to DRM entities. This makes refactoring pretty difficult, so let's just +move the assignment as soon as the entities are allocated. + +Reviewed-by: Simona Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20250129-test-kunit-v2-3-fe59c43805d5@kernel.org +Signed-off-by: Maxime Ripard +Stable-dep-of: 5d14c08a4746 ("drm/tests: hdmi: Fix recursive locking") +Signed-off-by: Sasha Levin +--- + .../drm/tests/drm_hdmi_state_helper_test.c | 81 ++++++++++--------- + 1 file changed, 42 insertions(+), 39 deletions(-) + +diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +index 4e7369caa7369..1dfd346c6fb39 100644 +--- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c ++++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +@@ -258,15 +258,16 @@ static void drm_test_check_broadcast_rgb_crtc_mode_changed(struct kunit *test) + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; ++ conn = &priv->connector; ++ + ctx = drm_kunit_helper_acquire_ctx_alloc(test); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); + +- conn = &priv->connector; + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -321,15 +322,16 @@ static void drm_test_check_broadcast_rgb_crtc_mode_not_changed(struct kunit *tes + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; ++ conn = &priv->connector; ++ + ctx = drm_kunit_helper_acquire_ctx_alloc(test); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); + +- conn = &priv->connector; + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -384,6 +386,8 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode(struct kunit *test) + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + KUNIT_ASSERT_TRUE(test, conn->display_info.is_hdmi); + +@@ -394,8 +398,6 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode(struct kunit *test) + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_NE(test, drm_match_cea_mode(preferred), 1); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -495,6 +497,8 @@ static void drm_test_check_broadcast_rgb_full_cea_mode(struct kunit *test) + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + KUNIT_ASSERT_TRUE(test, conn->display_info.is_hdmi); + +@@ -505,8 +509,6 @@ static void drm_test_check_broadcast_rgb_full_cea_mode(struct kunit *test) + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_NE(test, drm_match_cea_mode(preferred), 1); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -610,6 +612,8 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode(struct kunit *test) + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + KUNIT_ASSERT_TRUE(test, conn->display_info.is_hdmi); + +@@ -620,8 +624,6 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode(struct kunit *test) + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_NE(test, drm_match_cea_mode(preferred), 1); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -727,6 +729,8 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test) + 10); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, +@@ -739,8 +743,6 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test) + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -801,6 +803,8 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test) + 10); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, +@@ -813,8 +817,6 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test) + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -872,6 +874,8 @@ static void drm_test_check_output_bpc_dvi(struct kunit *test) + 12); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_dvi_1080p, +@@ -887,8 +891,6 @@ static void drm_test_check_output_bpc_dvi(struct kunit *test) + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -919,6 +921,8 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test) + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_max_200mhz, +@@ -932,8 +936,6 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test) + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -966,6 +968,8 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test) + 10); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz, +@@ -979,8 +983,6 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test) + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -1013,6 +1015,8 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(struct kunit *test) + 12); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz, +@@ -1026,8 +1030,6 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(struct kunit *test) + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -1064,15 +1066,16 @@ static void drm_test_check_hdmi_funcs_reject_rate(struct kunit *test) + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; ++ conn = &priv->connector; ++ + ctx = drm_kunit_helper_acquire_ctx_alloc(test); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); + +- conn = &priv->connector; + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_ASSERT_EQ(test, ret, 0); + +@@ -1120,6 +1123,8 @@ static void drm_test_check_max_tmds_rate_bpc_fallback(struct kunit *test) + 12); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, +@@ -1143,8 +1148,6 @@ static void drm_test_check_max_tmds_rate_bpc_fallback(struct kunit *test) + rate = drm_hdmi_compute_mode_clock(preferred, 10, HDMI_COLORSPACE_RGB); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +@@ -1189,6 +1192,8 @@ static void drm_test_check_max_tmds_rate_format_fallback(struct kunit *test) + 12); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, +@@ -1215,8 +1220,6 @@ static void drm_test_check_max_tmds_rate_format_fallback(struct kunit *test) + rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +@@ -1312,6 +1315,8 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test) + 12); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, +@@ -1343,8 +1348,6 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test) + rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +@@ -1379,6 +1382,8 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test + 12); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_max_200mhz, +@@ -1410,8 +1415,6 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test + rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +@@ -1445,6 +1448,8 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test + 8); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz, +@@ -1468,8 +1473,6 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test + rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +@@ -1505,6 +1508,8 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes + 12); + KUNIT_ASSERT_NOT_NULL(test, priv); + ++ drm = &priv->drm; ++ crtc = priv->crtc; + conn = &priv->connector; + ret = set_connector_edid(test, conn, + test_edid_hdmi_1080p_rgb_max_340mhz, +@@ -1528,8 +1533,6 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes + rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB); + KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); + +- drm = &priv->drm; +- crtc = priv->crtc; + ret = light_up_connector(test, drm, crtc, conn, preferred, ctx); + KUNIT_EXPECT_EQ(test, ret, 0); + +-- +2.39.5 + diff --git a/queue-6.13/drm-vkms-round-fixp2int-conversion-in-lerp_u16.patch b/queue-6.13/drm-vkms-round-fixp2int-conversion-in-lerp_u16.patch new file mode 100644 index 0000000000..47d03db9e5 --- /dev/null +++ b/queue-6.13/drm-vkms-round-fixp2int-conversion-in-lerp_u16.patch @@ -0,0 +1,38 @@ +From aa2ae12b5e4a483d2acdcd7f6956a577411a3b2d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 19 Dec 2024 21:33:08 -0700 +Subject: drm/vkms: Round fixp2int conversion in lerp_u16 + +From: Harry Wentland + +[ Upstream commit 8ec43c58d3be615a71548bc09148212013fb7e5f ] + +fixp2int always rounds down, fixp2int_ceil rounds up. We need +the new fixp2int_round. + +Signed-off-by: Alex Hung +Signed-off-by: Harry Wentland +Reviewed-by: Louis Chauvet +Link: https://patchwork.freedesktop.org/patch/msgid/20241220043410.416867-3-alex.hung@amd.com +Signed-off-by: Louis Chauvet +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/vkms/vkms_composer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c +index 3f0977d746bee..87dfb9f69ee5b 100644 +--- a/drivers/gpu/drm/vkms/vkms_composer.c ++++ b/drivers/gpu/drm/vkms/vkms_composer.c +@@ -98,7 +98,7 @@ static u16 lerp_u16(u16 a, u16 b, s64 t) + + s64 delta = drm_fixp_mul(b_fp - a_fp, t); + +- return drm_fixp2int(a_fp + delta); ++ return drm_fixp2int_round(a_fp + delta); + } + + static s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value) +-- +2.39.5 + diff --git a/queue-6.13/drm-xe-make-guc-binaries-dump-consistent-with-other-.patch b/queue-6.13/drm-xe-make-guc-binaries-dump-consistent-with-other-.patch new file mode 100644 index 0000000000..60f9ffcc71 --- /dev/null +++ b/queue-6.13/drm-xe-make-guc-binaries-dump-consistent-with-other-.patch @@ -0,0 +1,78 @@ +From 85880f3b6cf1f1bfd6df3c0b0dce1a79748ec77c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2025 12:22:04 -0800 +Subject: drm/xe: Make GUC binaries dump consistent with other binaries in + devcoredump +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: José Roberto de Souza + +[ Upstream commit 643f209ba3fdd4099416aaf9efa8266f7366d6fb ] + +All other(hwsp, hwctx and vmas) binaries follow this format: +[name].length: 0x1000 +[name].data: xxxxxxx +[name].error: errno + +The error one is just in case by some reason it was not able to +capture the binary. + +So this GuC binaries should follow the same patern. + +v2: +- renamed GUC binary to LOG + +Cc: John Harrison +Cc: Lucas De Marchi +Reviewed-by: Lucas De Marchi +Signed-off-by: José Roberto de Souza +Link: https://patchwork.freedesktop.org/patch/msgid/20250123202307.95103-3-jose.souza@intel.com +Signed-off-by: Lucas De Marchi +(cherry picked from commit cb1f868ca13756c0c18ba54d1591332476760d07) +Signed-off-by: Rodrigo Vivi +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/xe/xe_guc_ct.c | 6 ++++-- + drivers/gpu/drm/xe/xe_guc_log.c | 3 ++- + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c +index 6eabf7a9d3b07..b527f34b979be 100644 +--- a/drivers/gpu/drm/xe/xe_guc_ct.c ++++ b/drivers/gpu/drm/xe/xe_guc_ct.c +@@ -1699,9 +1699,11 @@ void xe_guc_ct_snapshot_print(struct xe_guc_ct_snapshot *snapshot, + drm_printf(p, "\tg2h outstanding: %d\n", + snapshot->g2h_outstanding); + +- if (snapshot->ctb) +- xe_print_blob_ascii85(p, "CTB data", '\n', ++ if (snapshot->ctb) { ++ drm_printf(p, "[CTB].length: 0x%lx\n", snapshot->ctb_size); ++ xe_print_blob_ascii85(p, "[CTB].data", '\n', + snapshot->ctb, 0, snapshot->ctb_size); ++ } + } else { + drm_puts(p, "CT disabled\n"); + } +diff --git a/drivers/gpu/drm/xe/xe_guc_log.c b/drivers/gpu/drm/xe/xe_guc_log.c +index 2baa4d95571fb..2457572ed86ad 100644 +--- a/drivers/gpu/drm/xe/xe_guc_log.c ++++ b/drivers/gpu/drm/xe/xe_guc_log.c +@@ -208,10 +208,11 @@ void xe_guc_log_snapshot_print(struct xe_guc_log_snapshot *snapshot, struct drm_ + drm_printf(p, "GuC timestamp: 0x%08llX [%llu]\n", snapshot->stamp, snapshot->stamp); + drm_printf(p, "Log level: %u\n", snapshot->level); + ++ drm_printf(p, "[LOG].length: 0x%lx\n", snapshot->size); + remain = snapshot->size; + for (i = 0; i < snapshot->num_chunks; i++) { + size_t size = min(GUC_LOG_CHUNK_SIZE, remain); +- const char *prefix = i ? NULL : "Log data"; ++ const char *prefix = i ? NULL : "[LOG].data"; + char suffix = i == snapshot->num_chunks - 1 ? '\n' : 0; + + xe_print_blob_ascii85(p, prefix, suffix, snapshot->copy[i], 0, size); +-- +2.39.5 + diff --git a/queue-6.13/fuse-don-t-truncate-cached-mutated-symlink.patch b/queue-6.13/fuse-don-t-truncate-cached-mutated-symlink.patch new file mode 100644 index 0000000000..30eb913a4e --- /dev/null +++ b/queue-6.13/fuse-don-t-truncate-cached-mutated-symlink.patch @@ -0,0 +1,119 @@ +From 94ba2d2eec5e043ca69ec225b7964e4b43e4641d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 20 Feb 2025 11:02:58 +0100 +Subject: fuse: don't truncate cached, mutated symlink + +From: Miklos Szeredi + +[ Upstream commit b4c173dfbb6c78568578ff18f9e8822d7bd0e31b ] + +Fuse allows the value of a symlink to change and this property is exploited +by some filesystems (e.g. CVMFS). + +It has been observed, that sometimes after changing the symlink contents, +the value is truncated to the old size. + +This is caused by fuse_getattr() racing with fuse_reverse_inval_inode(). +fuse_reverse_inval_inode() updates the fuse_inode's attr_version, which +results in fuse_change_attributes() exiting before updating the cached +attributes + +This is okay, as the cached attributes remain invalid and the next call to +fuse_change_attributes() will likely update the inode with the correct +values. + +The reason this causes problems is that cached symlinks will be +returned through page_get_link(), which truncates the symlink to +inode->i_size. This is correct for filesystems that don't mutate +symlinks, but in this case it causes bad behavior. + +The solution is to just remove this truncation. This can cause a +regression in a filesystem that relies on supplying a symlink larger than +the file size, but this is unlikely. If that happens we'd need to make +this behavior conditional. + +Reported-by: Laura Promberger +Tested-by: Sam Lewis +Signed-off-by: Miklos Szeredi +Link: https://lore.kernel.org/r/20250220100258.793363-1-mszeredi@redhat.com +Reviewed-by: Bernd Schubert +Signed-off-by: Christian Brauner +Signed-off-by: Sasha Levin +--- + fs/fuse/dir.c | 2 +- + fs/namei.c | 24 +++++++++++++++++++----- + include/linux/fs.h | 2 ++ + 3 files changed, 22 insertions(+), 6 deletions(-) + +diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c +index e540d05549fff..b7944d8bfb171 100644 +--- a/fs/fuse/dir.c ++++ b/fs/fuse/dir.c +@@ -1633,7 +1633,7 @@ static const char *fuse_get_link(struct dentry *dentry, struct inode *inode, + goto out_err; + + if (fc->cache_symlinks) +- return page_get_link(dentry, inode, callback); ++ return page_get_link_raw(dentry, inode, callback); + + err = -ECHILD; + if (!dentry) +diff --git a/fs/namei.c b/fs/namei.c +index 9d30c7aa9aa6e..553729a29095d 100644 +--- a/fs/namei.c ++++ b/fs/namei.c +@@ -5354,10 +5354,9 @@ const char *vfs_get_link(struct dentry *dentry, struct delayed_call *done) + EXPORT_SYMBOL(vfs_get_link); + + /* get the link contents into pagecache */ +-const char *page_get_link(struct dentry *dentry, struct inode *inode, +- struct delayed_call *callback) ++static char *__page_get_link(struct dentry *dentry, struct inode *inode, ++ struct delayed_call *callback) + { +- char *kaddr; + struct page *page; + struct address_space *mapping = inode->i_mapping; + +@@ -5376,8 +5375,23 @@ const char *page_get_link(struct dentry *dentry, struct inode *inode, + } + set_delayed_call(callback, page_put_link, page); + BUG_ON(mapping_gfp_mask(mapping) & __GFP_HIGHMEM); +- kaddr = page_address(page); +- nd_terminate_link(kaddr, inode->i_size, PAGE_SIZE - 1); ++ return page_address(page); ++} ++ ++const char *page_get_link_raw(struct dentry *dentry, struct inode *inode, ++ struct delayed_call *callback) ++{ ++ return __page_get_link(dentry, inode, callback); ++} ++EXPORT_SYMBOL_GPL(page_get_link_raw); ++ ++const char *page_get_link(struct dentry *dentry, struct inode *inode, ++ struct delayed_call *callback) ++{ ++ char *kaddr = __page_get_link(dentry, inode, callback); ++ ++ if (!IS_ERR(kaddr)) ++ nd_terminate_link(kaddr, inode->i_size, PAGE_SIZE - 1); + return kaddr; + } + +diff --git a/include/linux/fs.h b/include/linux/fs.h +index f7efc6866ebc9..1f07469f3d6e1 100644 +--- a/include/linux/fs.h ++++ b/include/linux/fs.h +@@ -3353,6 +3353,8 @@ extern const struct file_operations generic_ro_fops; + + extern int readlink_copy(char __user *, int, const char *); + extern int page_readlink(struct dentry *, char __user *, int); ++extern const char *page_get_link_raw(struct dentry *, struct inode *, ++ struct delayed_call *); + extern const char *page_get_link(struct dentry *, struct inode *, + struct delayed_call *); + extern void page_put_link(void *); +-- +2.39.5 + diff --git a/queue-6.13/futex-pass-in-task-to-futex_queue.patch b/queue-6.13/futex-pass-in-task-to-futex_queue.patch new file mode 100644 index 0000000000..ed1ce148fa --- /dev/null +++ b/queue-6.13/futex-pass-in-task-to-futex_queue.patch @@ -0,0 +1,148 @@ +From 3387f50fb067d000b2065bf5307b022b9c02a4d2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 15 Jan 2025 09:05:15 -0700 +Subject: futex: Pass in task to futex_queue() + +From: Jens Axboe + +[ Upstream commit 5e0e02f0d7e52cfc8b1adfc778dd02181d8b47b4 ] + +futex_queue() -> __futex_queue() uses 'current' as the task to store in +the struct futex_q->task field. This is fine for synchronous usage of +the futex infrastructure, but it's not always correct when used by +io_uring where the task doing the initial futex_queue() might not be +available later on. This doesn't lead to any issues currently, as the +io_uring side doesn't support PI futexes, but it does leave a +potentially dangling pointer which is never a good idea. + +Have futex_queue() take a task_struct argument, and have the regular +callers pass in 'current' for that. Meanwhile io_uring can just pass in +NULL, as the task should never be used off that path. In theory +req->tctx->task could be used here, but there's no point populating it +with a task field that will never be used anyway. + +Reported-by: Jann Horn +Signed-off-by: Jens Axboe +Signed-off-by: Thomas Gleixner +Link: https://lore.kernel.org/all/22484a23-542c-4003-b721-400688a0d055@kernel.dk +Signed-off-by: Sasha Levin +--- + io_uring/futex.c | 2 +- + kernel/futex/core.c | 5 +++-- + kernel/futex/futex.h | 11 ++++++++--- + kernel/futex/pi.c | 2 +- + kernel/futex/waitwake.c | 4 ++-- + 5 files changed, 15 insertions(+), 9 deletions(-) + +diff --git a/io_uring/futex.c b/io_uring/futex.c +index e29662f039e1a..f108da4ff863c 100644 +--- a/io_uring/futex.c ++++ b/io_uring/futex.c +@@ -349,7 +349,7 @@ int io_futex_wait(struct io_kiocb *req, unsigned int issue_flags) + hlist_add_head(&req->hash_node, &ctx->futex_list); + io_ring_submit_unlock(ctx, issue_flags); + +- futex_queue(&ifd->q, hb); ++ futex_queue(&ifd->q, hb, NULL); + return IOU_ISSUE_SKIP_COMPLETE; + } + +diff --git a/kernel/futex/core.c b/kernel/futex/core.c +index ebdd76b4ecbba..3db8567f5a44e 100644 +--- a/kernel/futex/core.c ++++ b/kernel/futex/core.c +@@ -532,7 +532,8 @@ void futex_q_unlock(struct futex_hash_bucket *hb) + futex_hb_waiters_dec(hb); + } + +-void __futex_queue(struct futex_q *q, struct futex_hash_bucket *hb) ++void __futex_queue(struct futex_q *q, struct futex_hash_bucket *hb, ++ struct task_struct *task) + { + int prio; + +@@ -548,7 +549,7 @@ void __futex_queue(struct futex_q *q, struct futex_hash_bucket *hb) + + plist_node_init(&q->list, prio); + plist_add(&q->list, &hb->chain); +- q->task = current; ++ q->task = task; + } + + /** +diff --git a/kernel/futex/futex.h b/kernel/futex/futex.h +index 99b32e728c4ad..6b2f4c7eb720f 100644 +--- a/kernel/futex/futex.h ++++ b/kernel/futex/futex.h +@@ -285,13 +285,15 @@ static inline int futex_get_value_locked(u32 *dest, u32 __user *from) + } + + extern void __futex_unqueue(struct futex_q *q); +-extern void __futex_queue(struct futex_q *q, struct futex_hash_bucket *hb); ++extern void __futex_queue(struct futex_q *q, struct futex_hash_bucket *hb, ++ struct task_struct *task); + extern int futex_unqueue(struct futex_q *q); + + /** + * futex_queue() - Enqueue the futex_q on the futex_hash_bucket + * @q: The futex_q to enqueue + * @hb: The destination hash bucket ++ * @task: Task queueing this futex + * + * The hb->lock must be held by the caller, and is released here. A call to + * futex_queue() is typically paired with exactly one call to futex_unqueue(). The +@@ -299,11 +301,14 @@ extern int futex_unqueue(struct futex_q *q); + * or nothing if the unqueue is done as part of the wake process and the unqueue + * state is implicit in the state of woken task (see futex_wait_requeue_pi() for + * an example). ++ * ++ * Note that @task may be NULL, for async usage of futexes. + */ +-static inline void futex_queue(struct futex_q *q, struct futex_hash_bucket *hb) ++static inline void futex_queue(struct futex_q *q, struct futex_hash_bucket *hb, ++ struct task_struct *task) + __releases(&hb->lock) + { +- __futex_queue(q, hb); ++ __futex_queue(q, hb, task); + spin_unlock(&hb->lock); + } + +diff --git a/kernel/futex/pi.c b/kernel/futex/pi.c +index d62cca5ed8f4c..635c7d5d42220 100644 +--- a/kernel/futex/pi.c ++++ b/kernel/futex/pi.c +@@ -982,7 +982,7 @@ int futex_lock_pi(u32 __user *uaddr, unsigned int flags, ktime_t *time, int tryl + /* + * Only actually queue now that the atomic ops are done: + */ +- __futex_queue(&q, hb); ++ __futex_queue(&q, hb, current); + + if (trylock) { + ret = rt_mutex_futex_trylock(&q.pi_state->pi_mutex); +diff --git a/kernel/futex/waitwake.c b/kernel/futex/waitwake.c +index 3a10375d95218..a9056acb75eef 100644 +--- a/kernel/futex/waitwake.c ++++ b/kernel/futex/waitwake.c +@@ -350,7 +350,7 @@ void futex_wait_queue(struct futex_hash_bucket *hb, struct futex_q *q, + * access to the hash list and forcing another memory barrier. + */ + set_current_state(TASK_INTERRUPTIBLE|TASK_FREEZABLE); +- futex_queue(q, hb); ++ futex_queue(q, hb, current); + + /* Arm the timer */ + if (timeout) +@@ -461,7 +461,7 @@ int futex_wait_multiple_setup(struct futex_vector *vs, int count, int *woken) + * next futex. Queue each futex at this moment so hb can + * be unlocked. + */ +- futex_queue(q, hb); ++ futex_queue(q, hb, current); + continue; + } + +-- +2.39.5 + diff --git a/queue-6.13/hid-apple-fix-up-the-f6-key-on-the-omoton-kb066-keyb.patch b/queue-6.13/hid-apple-fix-up-the-f6-key-on-the-omoton-kb066-keyb.patch new file mode 100644 index 0000000000..54acfa7397 --- /dev/null +++ b/queue-6.13/hid-apple-fix-up-the-f6-key-on-the-omoton-kb066-keyb.patch @@ -0,0 +1,53 @@ +From 1d44187fddf1dba8b84c598cc3b9599ca0e7182c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Jan 2025 23:12:17 -0700 +Subject: HID: apple: fix up the F6 key on the Omoton KB066 keyboard + +From: Alex Henrie + +[ Upstream commit 819083cb6eedcc8495cbf84845877bcc741b93b3 ] + +The Omoton KB066 is an Apple A1255 keyboard clone (HID product code +05ac:022c). On both keyboards, the F6 key becomes Num Lock when the Fn +key is held. But unlike its Apple exemplar, when the Omoton's F6 key is +pressed without Fn, it sends the usage code 0xC0301 from the reserved +section of the consumer page instead of the standard F6 usage code +0x7003F from the keyboard page. The nonstandard code is translated to +KEY_UNKNOWN and becomes useless on Linux. The Omoton KB066 is a pretty +popular keyboard, judging from its 29,058 reviews on Amazon at time of +writing, so let's account for its quirk to make it more usable. + +By the way, it would be nice if we could automatically set fnmode to 0 +for Omoton keyboards because they handle the Fn key internally and the +kernel's Fn key handling creates undesirable side effects such as making +F1 and F2 always Brightness Up and Brightness Down in fnmode=1 (the +default) or always F1 and F2 in fnmode=2. Unfortunately I don't think +there's a way to identify Bluetooth keyboards more specifically than the +HID product code which is obviously inaccurate. Users of Omoton +keyboards will just have to set fnmode to 0 manually to get full Fn key +functionality. + +Signed-off-by: Alex Henrie +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-apple.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c +index 3c3f67d0bfcfe..49812a76b7edd 100644 +--- a/drivers/hid/hid-apple.c ++++ b/drivers/hid/hid-apple.c +@@ -546,6 +546,9 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, + } + } + ++ if (usage->hid == 0xc0301) /* Omoton KB066 quirk */ ++ code = KEY_F6; ++ + if (usage->code != code) { + input_event_with_scancode(input, usage->type, code, usage->hid, value); + +-- +2.39.5 + diff --git a/queue-6.13/hid-hid-apple-apple-magic-keyboard-a3203-usb-c-suppo.patch b/queue-6.13/hid-hid-apple-apple-magic-keyboard-a3203-usb-c-suppo.patch new file mode 100644 index 0000000000..2003ba629d --- /dev/null +++ b/queue-6.13/hid-hid-apple-apple-magic-keyboard-a3203-usb-c-suppo.patch @@ -0,0 +1,59 @@ +From 91f2c4249aa6f15df2e77b58d9f3e1854a34d6e2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 12 Jan 2025 13:13:14 +0900 +Subject: HID: hid-apple: Apple Magic Keyboard a3203 USB-C support + +From: Ievgen Vovk + +[ Upstream commit 2813e00dcd748cef47d2bffaa04071de93fddf00 ] + +Add Apple Magic Keyboard 2024 model (with USB-C port) device ID (0320) +to those recognized by the hid-apple driver. Keyboard is otherwise +compatible with the existing implementation for its earlier 2021 model. + +Signed-off-by: Ievgen Vovk +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-apple.c | 5 +++++ + drivers/hid/hid-ids.h | 1 + + 2 files changed, 6 insertions(+) + +diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c +index 7e1ae2a2bcc24..3c3f67d0bfcfe 100644 +--- a/drivers/hid/hid-apple.c ++++ b/drivers/hid/hid-apple.c +@@ -474,6 +474,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, + hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2015) + table = magic_keyboard_2015_fn_keys; + else if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 || ++ hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 || + hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 || + hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021) + table = apple2021_fn_keys; +@@ -1150,6 +1151,10 @@ static const struct hid_device_id apple_devices[] = { + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY }, + { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021), + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024), ++ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY }, ++ { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024), ++ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021), + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY }, + { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021), +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index 4df0bfc3c8413..c4ca7a579e3d4 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -184,6 +184,7 @@ + #define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242 + #define USB_DEVICE_ID_APPLE_IRCONTROL5 0x8243 + #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c ++#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 0x0320 + #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 0x029a + #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021 0x029f + #define USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT 0x8102 +-- +2.39.5 + diff --git a/queue-6.13/hid-hid-steam-fix-issues-with-disabling-both-gamepad.patch b/queue-6.13/hid-hid-steam-fix-issues-with-disabling-both-gamepad.patch new file mode 100644 index 0000000000..149a55f3b7 --- /dev/null +++ b/queue-6.13/hid-hid-steam-fix-issues-with-disabling-both-gamepad.patch @@ -0,0 +1,68 @@ +From e7c1fbbca3906e50418993e04b3710d67b0104ef Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 15 Jan 2025 17:28:16 -0800 +Subject: HID: hid-steam: Fix issues with disabling both gamepad mode and + lizard mode + +From: Vicki Pfau + +[ Upstream commit 05c4ede6951b5d8e083b6bb237950cac59bdeb92 ] + +When lizard mode is disabled, there were two issues: + +1. Switching between gamepad mode and desktop mode still functioned, even +though desktop mode did not. This lead to the ability to "break" gamepad mode +by holding down the Options key even while lizard mode is disabled + +2. If you were in desktop mode when lizard mode is disabled, you would +immediately enter this faulty mode. + +This patch properly disables the ability to switch between gamepad mode and the +faulty desktop mode by holding the Options key, as well as effectively removing +the faulty mode by bypassing the early returns if lizard mode is disabled. + +Reported-by: Eugeny Shcheglov +Signed-off-by: Vicki Pfau +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-steam.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c +index 03e57d8acdadf..10460b7bde1a2 100644 +--- a/drivers/hid/hid-steam.c ++++ b/drivers/hid/hid-steam.c +@@ -1051,10 +1051,10 @@ static void steam_mode_switch_cb(struct work_struct *work) + struct steam_device, mode_switch); + unsigned long flags; + bool client_opened; +- steam->gamepad_mode = !steam->gamepad_mode; + if (!lizard_mode) + return; + ++ steam->gamepad_mode = !steam->gamepad_mode; + if (steam->gamepad_mode) + steam_set_lizard_mode(steam, false); + else { +@@ -1623,7 +1623,7 @@ static void steam_do_deck_input_event(struct steam_device *steam, + schedule_delayed_work(&steam->mode_switch, 45 * HZ / 100); + } + +- if (!steam->gamepad_mode) ++ if (!steam->gamepad_mode && lizard_mode) + return; + + lpad_touched = b10 & BIT(3); +@@ -1693,7 +1693,7 @@ static void steam_do_deck_sensors_event(struct steam_device *steam, + */ + steam->sensor_timestamp_us += 4000; + +- if (!steam->gamepad_mode) ++ if (!steam->gamepad_mode && lizard_mode) + return; + + input_event(sensors, EV_MSC, MSC_TIMESTAMP, steam->sensor_timestamp_us); +-- +2.39.5 + diff --git a/queue-6.13/hid-ignore-non-functional-sensor-in-hp-5mp-camera.patch b/queue-6.13/hid-ignore-non-functional-sensor-in-hp-5mp-camera.patch new file mode 100644 index 0000000000..e6883952ad --- /dev/null +++ b/queue-6.13/hid-ignore-non-functional-sensor-in-hp-5mp-camera.patch @@ -0,0 +1,56 @@ +From 21c9e9a9b729a1bed6c0b2442bde1cdc8e624c8e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 15 Jan 2025 15:00:20 +0800 +Subject: HID: ignore non-functional sensor in HP 5MP Camera + +From: Chia-Lin Kao (AceLan) + +[ Upstream commit 363236d709e75610b628c2a4337ccbe42e454b6d ] + +The HP 5MP Camera (USB ID 0408:5473) reports a HID sensor interface that +is not actually implemented. Attempting to access this non-functional +sensor via iio_info causes system hangs as runtime PM tries to wake up +an unresponsive sensor. + + [453] hid-sensor-hub 0003:0408:5473.0003: Report latency attributes: ffffffff:ffffffff + [453] hid-sensor-hub 0003:0408:5473.0003: common attributes: 5:1, 2:1, 3:1 ffffffff:ffffffff + +Add this device to the HID ignore list since the sensor interface is +non-functional by design and should not be exposed to userspace. + +Signed-off-by: Chia-Lin Kao (AceLan) +Acked-by: Srinivas Pandruvada +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-ids.h | 1 + + drivers/hid/hid-quirks.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index d1d479ca50a21..43a6f1d243a62 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -1093,6 +1093,7 @@ + #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001 0x3001 + #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3003 0x3003 + #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008 ++#define USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473 0x5473 + + #define I2C_VENDOR_ID_RAYDIUM 0x2386 + #define I2C_PRODUCT_ID_RAYDIUM_4B33 0x4b33 +diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c +index e0bbf0c6345d6..5d7a418ccdbec 100644 +--- a/drivers/hid/hid-quirks.c ++++ b/drivers/hid/hid-quirks.c +@@ -891,6 +891,7 @@ static const struct hid_device_id hid_ignore_list[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_DPAD) }, + #endif + { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473) }, + { } + }; + +-- +2.39.5 + diff --git a/queue-6.13/hid-intel-ish-hid-fix-the-length-of-mng_sync_fw_cloc.patch b/queue-6.13/hid-intel-ish-hid-fix-the-length-of-mng_sync_fw_cloc.patch new file mode 100644 index 0000000000..b3253ef008 --- /dev/null +++ b/queue-6.13/hid-intel-ish-hid-fix-the-length-of-mng_sync_fw_cloc.patch @@ -0,0 +1,56 @@ +From 12f2abecfd89fe431f22025578ea1125e6380b09 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2025 09:29:00 +0800 +Subject: HID: intel-ish-hid: fix the length of MNG_SYNC_FW_CLOCK in doorbell + +From: Zhang Lixu + +[ Upstream commit 4b54ae69197b9f416baa0fceadff7e89075f8454 ] + +The timestamps in the Firmware log and HID sensor samples are incorrect. +They show 1970-01-01 because the current IPC driver only uses the first +8 bytes of bootup time when synchronizing time with the firmware. The +firmware converts the bootup time to UTC time, which results in the +display of 1970-01-01. + +In write_ipc_from_queue(), when sending the MNG_SYNC_FW_CLOCK message, +the clock is updated according to the definition of ipc_time_update_msg. +However, in _ish_sync_fw_clock(), the message length is specified as the +size of uint64_t when building the doorbell. As a result, the firmware +only receives the first 8 bytes of struct ipc_time_update_msg. +This patch corrects the length in the doorbell to ensure the entire +ipc_time_update_msg is sent, fixing the timestamp issue. + +Signed-off-by: Zhang Lixu +Acked-by: Srinivas Pandruvada +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/intel-ish-hid/ipc/ipc.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c +index 3cd53fc80634a..cb956a8c386cb 100644 +--- a/drivers/hid/intel-ish-hid/ipc/ipc.c ++++ b/drivers/hid/intel-ish-hid/ipc/ipc.c +@@ -578,14 +578,14 @@ static void fw_reset_work_fn(struct work_struct *work) + static void _ish_sync_fw_clock(struct ishtp_device *dev) + { + static unsigned long prev_sync; +- uint64_t usec; ++ struct ipc_time_update_msg time = {}; + + if (prev_sync && time_before(jiffies, prev_sync + 20 * HZ)) + return; + + prev_sync = jiffies; +- usec = ktime_to_us(ktime_get_boottime()); +- ipc_send_mng_msg(dev, MNG_SYNC_FW_CLOCK, &usec, sizeof(uint64_t)); ++ /* The fields of time would be updated while sending message */ ++ ipc_send_mng_msg(dev, MNG_SYNC_FW_CLOCK, &time, sizeof(time)); + } + + /** +-- +2.39.5 + diff --git a/queue-6.13/hid-intel-ish-hid-ipc-add-panther-lake-pci-device-id.patch b/queue-6.13/hid-intel-ish-hid-ipc-add-panther-lake-pci-device-id.patch new file mode 100644 index 0000000000..43059192dc --- /dev/null +++ b/queue-6.13/hid-intel-ish-hid-ipc-add-panther-lake-pci-device-id.patch @@ -0,0 +1,72 @@ +From c302a066d39562e22eff3bd0063d18c5e534b389 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2025 09:30:44 +0800 +Subject: HID: intel-ish-hid: ipc: Add Panther Lake PCI device IDs + +From: Zhang Lixu + +[ Upstream commit 18c966b62819b9d3b99eac8fb8cdc8950826e0c2 ] + +Add device IDs of Panther Lake-H and Panther Lake-P into ishtp support +list. + +Signed-off-by: Zhang Lixu +Acked-by: Srinivas Pandruvada +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/intel-ish-hid/ipc/hw-ish.h | 2 ++ + drivers/hid/intel-ish-hid/ipc/pci-ish.c | 7 +++++++ + 2 files changed, 9 insertions(+) + +diff --git a/drivers/hid/intel-ish-hid/ipc/hw-ish.h b/drivers/hid/intel-ish-hid/ipc/hw-ish.h +index cdd80c653918b..07e90d51f073c 100644 +--- a/drivers/hid/intel-ish-hid/ipc/hw-ish.h ++++ b/drivers/hid/intel-ish-hid/ipc/hw-ish.h +@@ -36,6 +36,8 @@ + #define PCI_DEVICE_ID_INTEL_ISH_ARL_H 0x7745 + #define PCI_DEVICE_ID_INTEL_ISH_ARL_S 0x7F78 + #define PCI_DEVICE_ID_INTEL_ISH_LNL_M 0xA845 ++#define PCI_DEVICE_ID_INTEL_ISH_PTL_H 0xE345 ++#define PCI_DEVICE_ID_INTEL_ISH_PTL_P 0xE445 + + #define REVISION_ID_CHT_A0 0x6 + #define REVISION_ID_CHT_Ax_SI 0x0 +diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c +index 9e2401291a2f6..ff0fc80100728 100644 +--- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c ++++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c +@@ -26,9 +26,11 @@ + enum ishtp_driver_data_index { + ISHTP_DRIVER_DATA_NONE, + ISHTP_DRIVER_DATA_LNL_M, ++ ISHTP_DRIVER_DATA_PTL, + }; + + #define ISH_FW_GEN_LNL_M "lnlm" ++#define ISH_FW_GEN_PTL "ptl" + + #define ISH_FIRMWARE_PATH(gen) "intel/ish/ish_" gen ".bin" + #define ISH_FIRMWARE_PATH_ALL "intel/ish/ish_*.bin" +@@ -37,6 +39,9 @@ static struct ishtp_driver_data ishtp_driver_data[] = { + [ISHTP_DRIVER_DATA_LNL_M] = { + .fw_generation = ISH_FW_GEN_LNL_M, + }, ++ [ISHTP_DRIVER_DATA_PTL] = { ++ .fw_generation = ISH_FW_GEN_PTL, ++ }, + }; + + static const struct pci_device_id ish_pci_tbl[] = { +@@ -63,6 +68,8 @@ static const struct pci_device_id ish_pci_tbl[] = { + {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ISH_ARL_H)}, + {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ISH_ARL_S)}, + {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ISH_LNL_M), .driver_data = ISHTP_DRIVER_DATA_LNL_M}, ++ {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ISH_PTL_H), .driver_data = ISHTP_DRIVER_DATA_PTL}, ++ {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ISH_PTL_P), .driver_data = ISHTP_DRIVER_DATA_PTL}, + {} + }; + MODULE_DEVICE_TABLE(pci, ish_pci_tbl); +-- +2.39.5 + diff --git a/queue-6.13/hid-intel-ish-hid-send-clock-sync-message-immediatel.patch b/queue-6.13/hid-intel-ish-hid-send-clock-sync-message-immediatel.patch new file mode 100644 index 0000000000..49006c724a --- /dev/null +++ b/queue-6.13/hid-intel-ish-hid-send-clock-sync-message-immediatel.patch @@ -0,0 +1,77 @@ +From 46bd8dae7cca73825ddf91d72efb3780c2b9fb9a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2025 09:29:01 +0800 +Subject: HID: intel-ish-hid: Send clock sync message immediately after reset + +From: Zhang Lixu + +[ Upstream commit 7e0d1cff12b895f44f4ddc8cf50311bc1f775201 ] + +The ISH driver performs a clock sync with the firmware once at system +startup and then every 20 seconds. If a firmware reset occurs right +after a clock sync, the driver would wait 20 seconds before performing +another clock sync with the firmware. This is particularly problematic +with the introduction of the "load firmware from host" feature, where +the driver performs a clock sync with the bootloader and then has to +wait 20 seconds before syncing with the main firmware. + +This patch clears prev_sync immediately upon receiving an IPC reset, +so that the main firmware and driver will perform a clock sync +immediately after completing the IPC handshake. + +Signed-off-by: Zhang Lixu +Acked-by: Srinivas Pandruvada +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/intel-ish-hid/ipc/ipc.c | 9 ++++++--- + drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h | 2 ++ + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c +index cb956a8c386cb..4c861119e97aa 100644 +--- a/drivers/hid/intel-ish-hid/ipc/ipc.c ++++ b/drivers/hid/intel-ish-hid/ipc/ipc.c +@@ -517,6 +517,10 @@ static int ish_fw_reset_handler(struct ishtp_device *dev) + /* ISH FW is dead */ + if (!ish_is_input_ready(dev)) + return -EPIPE; ++ ++ /* Send clock sync at once after reset */ ++ ishtp_dev->prev_sync = 0; ++ + /* + * Set HOST2ISH.ILUP. Apparently we need this BEFORE sending + * RESET_NOTIFY_ACK - FW will be checking for it +@@ -577,13 +581,12 @@ static void fw_reset_work_fn(struct work_struct *work) + */ + static void _ish_sync_fw_clock(struct ishtp_device *dev) + { +- static unsigned long prev_sync; + struct ipc_time_update_msg time = {}; + +- if (prev_sync && time_before(jiffies, prev_sync + 20 * HZ)) ++ if (dev->prev_sync && time_before(jiffies, dev->prev_sync + 20 * HZ)) + return; + +- prev_sync = jiffies; ++ dev->prev_sync = jiffies; + /* The fields of time would be updated while sending message */ + ipc_send_mng_msg(dev, MNG_SYNC_FW_CLOCK, &time, sizeof(time)); + } +diff --git a/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h b/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h +index effbb442c7277..dfc8cfd393532 100644 +--- a/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h ++++ b/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h +@@ -254,6 +254,8 @@ struct ishtp_device { + unsigned int ipc_tx_cnt; + unsigned long long ipc_tx_bytes_cnt; + ++ /* Time of the last clock sync */ ++ unsigned long prev_sync; + const struct ishtp_hw_ops *ops; + size_t mtu; + uint32_t ishtp_msg_hdr; +-- +2.39.5 + diff --git a/queue-6.13/hid-topre-fix-n-key-rollover-on-realforce-r3s-tkl-bo.patch b/queue-6.13/hid-topre-fix-n-key-rollover-on-realforce-r3s-tkl-bo.patch new file mode 100644 index 0000000000..a64685a956 --- /dev/null +++ b/queue-6.13/hid-topre-fix-n-key-rollover-on-realforce-r3s-tkl-bo.patch @@ -0,0 +1,79 @@ +From 063f4df879e168235d4794aa4c3de5eb7ff567cd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 28 Jan 2025 20:08:49 -0500 +Subject: HID: topre: Fix n-key rollover on Realforce R3S TKL boards + +From: Daniel Brackenbury + +[ Upstream commit 9271af9d846c7e49c8709b58d5853cb73c00b193 ] + +Newer model R3* Topre Realforce keyboards share an issue with their older +R2 cousins where a report descriptor fixup is needed in order for n-key +rollover to work correctly, otherwise only 6-key rollover is available. +This patch adds some new hardware IDs for the R3S 87-key keyboard and +makes amendments to the existing hid-topre driver in order to change the +correct byte in the new model. + +Signed-off-by: Daniel Brackenbury +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/Kconfig | 3 ++- + drivers/hid/hid-ids.h | 1 + + drivers/hid/hid-topre.c | 7 +++++++ + 3 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index 4d2a89d65b658..363c860835d35 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -1167,7 +1167,8 @@ config HID_TOPRE + tristate "Topre REALFORCE keyboards" + depends on HID + help +- Say Y for N-key rollover support on Topre REALFORCE R2 108/87 key keyboards. ++ Say Y for N-key rollover support on Topre REALFORCE R2 108/87 key and ++ Topre REALFORCE R3S 87 key keyboards. + + config HID_THINGM + tristate "ThingM blink(1) USB RGB LED" +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index 43a6f1d243a62..4df0bfc3c8413 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -1300,6 +1300,7 @@ + #define USB_VENDOR_ID_TOPRE 0x0853 + #define USB_DEVICE_ID_TOPRE_REALFORCE_R2_108 0x0148 + #define USB_DEVICE_ID_TOPRE_REALFORCE_R2_87 0x0146 ++#define USB_DEVICE_ID_TOPRE_REALFORCE_R3S_87 0x0313 + + #define USB_VENDOR_ID_TOPSEED 0x0766 + #define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204 +diff --git a/drivers/hid/hid-topre.c b/drivers/hid/hid-topre.c +index 848361f6225df..ccedf8721722e 100644 +--- a/drivers/hid/hid-topre.c ++++ b/drivers/hid/hid-topre.c +@@ -29,6 +29,11 @@ static const __u8 *topre_report_fixup(struct hid_device *hdev, __u8 *rdesc, + hid_info(hdev, + "fixing up Topre REALFORCE keyboard report descriptor\n"); + rdesc[72] = 0x02; ++ } else if (*rsize >= 106 && rdesc[28] == 0x29 && rdesc[29] == 0xe7 && ++ rdesc[30] == 0x81 && rdesc[31] == 0x00) { ++ hid_info(hdev, ++ "fixing up Topre REALFORCE keyboard report descriptor\n"); ++ rdesc[31] = 0x02; + } + return rdesc; + } +@@ -38,6 +43,8 @@ static const struct hid_device_id topre_id_table[] = { + USB_DEVICE_ID_TOPRE_REALFORCE_R2_108) }, + { HID_USB_DEVICE(USB_VENDOR_ID_TOPRE, + USB_DEVICE_ID_TOPRE_REALFORCE_R2_87) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_TOPRE, ++ USB_DEVICE_ID_TOPRE_REALFORCE_R3S_87) }, + { } + }; + MODULE_DEVICE_TABLE(hid, topre_id_table); +-- +2.39.5 + diff --git a/queue-6.13/hrtimers-mark-is_migration_base-with-__always_inline.patch b/queue-6.13/hrtimers-mark-is_migration_base-with-__always_inline.patch new file mode 100644 index 0000000000..98d6efce12 --- /dev/null +++ b/queue-6.13/hrtimers-mark-is_migration_base-with-__always_inline.patch @@ -0,0 +1,79 @@ +From ab8b962e806ec1338c27e62aaea3bde38abbce06 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Jan 2025 18:07:45 +0200 +Subject: hrtimers: Mark is_migration_base() with __always_inline + +From: Andy Shevchenko + +[ Upstream commit 27af31e44949fa85550176520ef7086a0d00fd7b ] + +When is_migration_base() is unused, it prevents kernel builds +with clang, `make W=1` and CONFIG_WERROR=y: + +kernel/time/hrtimer.c:156:20: error: unused function 'is_migration_base' [-Werror,-Wunused-function] + 156 | static inline bool is_migration_base(struct hrtimer_clock_base *base) + | ^~~~~~~~~~~~~~~~~ + +Fix this by marking it with __always_inline. + +[ tglx: Use __always_inline instead of __maybe_unused and move it into the + usage sites conditional ] + +Signed-off-by: Andy Shevchenko +Signed-off-by: Thomas Gleixner +Link: https://lore.kernel.org/all/20250116160745.243358-1-andriy.shevchenko@linux.intel.com +Signed-off-by: Sasha Levin +--- + kernel/time/hrtimer.c | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 36dd2f5c30da1..3e7554597be24 100644 +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -156,11 +156,6 @@ static struct hrtimer_cpu_base migration_cpu_base = { + + #define migration_base migration_cpu_base.clock_base[0] + +-static inline bool is_migration_base(struct hrtimer_clock_base *base) +-{ +- return base == &migration_base; +-} +- + /* + * We are using hashed locking: holding per_cpu(hrtimer_bases)[n].lock + * means that all timers which are tied to this base via timer->base are +@@ -312,11 +307,6 @@ switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base, + + #else /* CONFIG_SMP */ + +-static inline bool is_migration_base(struct hrtimer_clock_base *base) +-{ +- return false; +-} +- + static inline struct hrtimer_clock_base * + lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) + __acquires(&timer->base->cpu_base->lock) +@@ -1432,6 +1422,18 @@ static void hrtimer_sync_wait_running(struct hrtimer_cpu_base *cpu_base, + } + } + ++#ifdef CONFIG_SMP ++static __always_inline bool is_migration_base(struct hrtimer_clock_base *base) ++{ ++ return base == &migration_base; ++} ++#else ++static __always_inline bool is_migration_base(struct hrtimer_clock_base *base) ++{ ++ return false; ++} ++#endif ++ + /* + * This function is called on PREEMPT_RT kernels when the fast path + * deletion of a timer failed because the timer callback function was +-- +2.39.5 + diff --git a/queue-6.13/io-wq-backoff-when-retrying-worker-creation.patch b/queue-6.13/io-wq-backoff-when-retrying-worker-creation.patch new file mode 100644 index 0000000000..8ef6f52055 --- /dev/null +++ b/queue-6.13/io-wq-backoff-when-retrying-worker-creation.patch @@ -0,0 +1,193 @@ +From 060d4fa4af4945dc995bae18868d9fdaad0c7dee Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 8 Feb 2025 13:42:13 -0700 +Subject: io-wq: backoff when retrying worker creation + +From: Uday Shankar + +[ Upstream commit 13918315c5dc5a515926c8799042ea6885c2b734 ] + +When io_uring submission goes async for the first time on a given task, +we'll try to create a worker thread to handle the submission. Creating +this worker thread can fail due to various transient conditions, such as +an outstanding signal in the forking thread, so we have retry logic with +a limit of 3 retries. However, this retry logic appears to be too +aggressive/fast - we've observed a thread blowing through the retry +limit while having the same outstanding signal the whole time. Here's an +excerpt of some tracing that demonstrates the issue: + +First, signal 26 is generated for the process. It ends up getting routed +to thread 92942. + + 0) cbd-92284 /* signal_generate: sig=26 errno=0 code=-2 comm=psblkdASD pid=92934 grp=1 res=0 */ + +This causes create_io_thread in the signalled thread to fail with +ERESTARTNOINTR, and thus a retry is queued. + +13) task_th-92942 /* io_uring_queue_async_work: ring 000000007325c9ae, request 0000000080c96d8e, user_data 0x0, opcode URING_CMD, flags 0x8240001, normal queue, work 000000006e96dd3f */ +13) task_th-92942 io_wq_enqueue() { +13) task_th-92942 _raw_spin_lock(); +13) task_th-92942 io_wq_activate_free_worker(); +13) task_th-92942 _raw_spin_lock(); +13) task_th-92942 create_io_worker() { +13) task_th-92942 __kmalloc_cache_noprof(); +13) task_th-92942 __init_swait_queue_head(); +13) task_th-92942 kprobe_ftrace_handler() { +13) task_th-92942 get_kprobe(); +13) task_th-92942 aggr_pre_handler() { +13) task_th-92942 pre_handler_kretprobe(); +13) task_th-92942 /* create_enter: (create_io_thread+0x0/0x50) fn=0xffffffff8172c0e0 arg=0xffff888996bb69c0 node=-1 */ +13) task_th-92942 } /* aggr_pre_handler */ +... +13) task_th-92942 } /* copy_process */ +13) task_th-92942 } /* create_io_thread */ +13) task_th-92942 kretprobe_rethook_handler() { +13) task_th-92942 /* create_exit: (create_io_worker+0x8a/0x1a0 <- create_io_thread) arg1=0xfffffffffffffdff */ +13) task_th-92942 } /* kretprobe_rethook_handler */ +13) task_th-92942 queue_work_on() { +... + +The CPU is then handed to a kworker to process the queued retry: + +------------------------------------------ + 13) task_th-92942 => kworker-54154 +------------------------------------------ +13) kworker-54154 io_workqueue_create() { +13) kworker-54154 io_queue_worker_create() { +13) kworker-54154 task_work_add() { +13) kworker-54154 wake_up_state() { +13) kworker-54154 try_to_wake_up() { +13) kworker-54154 _raw_spin_lock_irqsave(); +13) kworker-54154 _raw_spin_unlock_irqrestore(); +13) kworker-54154 } /* try_to_wake_up */ +13) kworker-54154 } /* wake_up_state */ +13) kworker-54154 kick_process(); +13) kworker-54154 } /* task_work_add */ +13) kworker-54154 } /* io_queue_worker_create */ +13) kworker-54154 } /* io_workqueue_create */ + +And then we immediately switch back to the original task to try creating +a worker again. This fails, because the original task still hasn't +handled its signal. + +----------------------------------------- + 13) kworker-54154 => task_th-92942 +------------------------------------------ +13) task_th-92942 create_worker_cont() { +13) task_th-92942 kprobe_ftrace_handler() { +13) task_th-92942 get_kprobe(); +13) task_th-92942 aggr_pre_handler() { +13) task_th-92942 pre_handler_kretprobe(); +13) task_th-92942 /* create_enter: (create_io_thread+0x0/0x50) fn=0xffffffff8172c0e0 arg=0xffff888996bb69c0 node=-1 */ +13) task_th-92942 } /* aggr_pre_handler */ +13) task_th-92942 } /* kprobe_ftrace_handler */ +13) task_th-92942 create_io_thread() { +13) task_th-92942 copy_process() { +13) task_th-92942 task_active_pid_ns(); +13) task_th-92942 _raw_spin_lock_irq(); +13) task_th-92942 recalc_sigpending(); +13) task_th-92942 _raw_spin_lock_irq(); +13) task_th-92942 } /* copy_process */ +13) task_th-92942 } /* create_io_thread */ +13) task_th-92942 kretprobe_rethook_handler() { +13) task_th-92942 /* create_exit: (create_worker_cont+0x35/0x1b0 <- create_io_thread) arg1=0xfffffffffffffdff */ +13) task_th-92942 } /* kretprobe_rethook_handler */ +13) task_th-92942 io_worker_release(); +13) task_th-92942 queue_work_on() { +13) task_th-92942 clear_pending_if_disabled(); +13) task_th-92942 __queue_work() { +13) task_th-92942 } /* __queue_work */ +13) task_th-92942 } /* queue_work_on */ +13) task_th-92942 } /* create_worker_cont */ + +The pattern repeats another couple times until we blow through the retry +counter, at which point we give up. All outstanding work is canceled, +and the io_uring command which triggered all this is failed with +ECANCELED: + +13) task_th-92942 io_acct_cancel_pending_work() { +... +13) task_th-92942 /* io_uring_complete: ring 000000007325c9ae, req 0000000080c96d8e, user_data 0x0, result -125, cflags 0x0 extra1 0 extra2 0 */ + +Finally, the task gets around to processing its outstanding signal 26, +but it's too late. + +13) task_th-92942 /* signal_deliver: sig=26 errno=0 code=-2 sa_handler=59566a0 sa_flags=14000000 */ + +Try to address this issue by adding a small scaling delay when retrying +worker creation. This should give the forking thread time to handle its +signal in the above case. This isn't a particularly satisfying solution, +as sufficiently paradoxical scheduling would still have us hitting the +same issue, and I'm open to suggestions for something better. But this +is likely to prevent this (already rare) issue from hitting in practice. + +Signed-off-by: Uday Shankar +Link: https://lore.kernel.org/r/20250208-wq_retry-v2-1-4f6f5041d303@purestorage.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + io_uring/io-wq.c | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c +index a38f36b680604..a2d577b099308 100644 +--- a/io_uring/io-wq.c ++++ b/io_uring/io-wq.c +@@ -64,7 +64,7 @@ struct io_worker { + + union { + struct rcu_head rcu; +- struct work_struct work; ++ struct delayed_work work; + }; + }; + +@@ -770,6 +770,18 @@ static inline bool io_should_retry_thread(struct io_worker *worker, long err) + } + } + ++static void queue_create_worker_retry(struct io_worker *worker) ++{ ++ /* ++ * We only bother retrying because there's a chance that the ++ * failure to create a worker is due to some temporary condition ++ * in the forking task (e.g. outstanding signal); give the task ++ * some time to clear that condition. ++ */ ++ schedule_delayed_work(&worker->work, ++ msecs_to_jiffies(worker->init_retries * 5)); ++} ++ + static void create_worker_cont(struct callback_head *cb) + { + struct io_worker *worker; +@@ -809,12 +821,13 @@ static void create_worker_cont(struct callback_head *cb) + + /* re-create attempts grab a new worker ref, drop the existing one */ + io_worker_release(worker); +- schedule_work(&worker->work); ++ queue_create_worker_retry(worker); + } + + static void io_workqueue_create(struct work_struct *work) + { +- struct io_worker *worker = container_of(work, struct io_worker, work); ++ struct io_worker *worker = container_of(work, struct io_worker, ++ work.work); + struct io_wq_acct *acct = io_wq_get_acct(worker); + + if (!io_queue_worker_create(worker, acct, create_worker_cont)) +@@ -855,8 +868,8 @@ static bool create_io_worker(struct io_wq *wq, int index) + kfree(worker); + goto fail; + } else { +- INIT_WORK(&worker->work, io_workqueue_create); +- schedule_work(&worker->work); ++ INIT_DELAYED_WORK(&worker->work, io_workqueue_create); ++ queue_create_worker_retry(worker); + } + + return true; +-- +2.39.5 + diff --git a/queue-6.13/irqchip-riscv-ensure-ordering-of-memory-writes-and-i.patch b/queue-6.13/irqchip-riscv-ensure-ordering-of-memory-writes-and-i.patch new file mode 100644 index 0000000000..65b89e7f9f --- /dev/null +++ b/queue-6.13/irqchip-riscv-ensure-ordering-of-memory-writes-and-i.patch @@ -0,0 +1,67 @@ +From 076f67b53245c13311f5a2b0a54d436f0c7466ec Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 27 Jan 2025 17:38:46 +0800 +Subject: irqchip/riscv: Ensure ordering of memory writes and IPI writes + +From: Xu Lu + +[ Upstream commit 825c78e6a60c309a59d18d5ac5968aa79cef0bd6 ] + +RISC-V distinguishes between memory accesses and device I/O and uses FENCE +instruction to order them as viewed by other RISC-V harts and external +devices or coprocessors. The FENCE instruction can order any combination of +device input(I), device output(O), memory reads(R) and memory +writes(W). For example, 'fence w, o' is used to ensure all memory writes +from instructions preceding the FENCE instruction appear earlier in the +global memory order than device output writes from instructions after the +FENCE instruction. + +RISC-V issues IPIs by writing to the IMSIC/ACLINT MMIO registers, which is +regarded as device output operation. However, the existing implementation +of the IMSIC/ACLINT drivers issue the IPI via writel_relaxed(), which does +not guarantee the order of device output operation and preceding memory +writes. As a consequence the hart receiving the IPI might not observe the +IPI related data. + +Fix this by replacing writel_relaxed() with writel() when issuing IPIs, +which uses 'fence w, o' to ensure all previous writes made by the current +hart are visible to other harts before they receive the IPI. + +Signed-off-by: Xu Lu +Signed-off-by: Thomas Gleixner +Link: https://lore.kernel.org/all/20250127093846.98625-1-luxu.kernel@bytedance.com +Signed-off-by: Sasha Levin +--- + drivers/irqchip/irq-riscv-imsic-early.c | 2 +- + drivers/irqchip/irq-thead-c900-aclint-sswi.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/irqchip/irq-riscv-imsic-early.c b/drivers/irqchip/irq-riscv-imsic-early.c +index c5c2e6929a2f5..275df50057057 100644 +--- a/drivers/irqchip/irq-riscv-imsic-early.c ++++ b/drivers/irqchip/irq-riscv-imsic-early.c +@@ -27,7 +27,7 @@ static void imsic_ipi_send(unsigned int cpu) + { + struct imsic_local_config *local = per_cpu_ptr(imsic->global.local, cpu); + +- writel_relaxed(IMSIC_IPI_ID, local->msi_va); ++ writel(IMSIC_IPI_ID, local->msi_va); + } + + static void imsic_ipi_starting_cpu(void) +diff --git a/drivers/irqchip/irq-thead-c900-aclint-sswi.c b/drivers/irqchip/irq-thead-c900-aclint-sswi.c +index b0e366ade4271..8ff6e7a1363bd 100644 +--- a/drivers/irqchip/irq-thead-c900-aclint-sswi.c ++++ b/drivers/irqchip/irq-thead-c900-aclint-sswi.c +@@ -31,7 +31,7 @@ static DEFINE_PER_CPU(void __iomem *, sswi_cpu_regs); + + static void thead_aclint_sswi_ipi_send(unsigned int cpu) + { +- writel_relaxed(0x1, per_cpu(sswi_cpu_regs, cpu)); ++ writel(0x1, per_cpu(sswi_cpu_regs, cpu)); + } + + static void thead_aclint_sswi_ipi_clear(void) +-- +2.39.5 + diff --git a/queue-6.13/iscsi_ibft-fix-ubsan-shift-out-of-bounds-warning-in-.patch b/queue-6.13/iscsi_ibft-fix-ubsan-shift-out-of-bounds-warning-in-.patch new file mode 100644 index 0000000000..5b6d8e1fa6 --- /dev/null +++ b/queue-6.13/iscsi_ibft-fix-ubsan-shift-out-of-bounds-warning-in-.patch @@ -0,0 +1,42 @@ +From 04a13b0b2157763a1c7b2c0e1d6ce2b5bdcb233e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 14 Jan 2025 12:12:34 +0800 +Subject: iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in + ibft_attr_show_nic() + +From: Chengen Du + +[ Upstream commit 07e0d99a2f701123ad3104c0f1a1e66bce74d6e5 ] + +When performing an iSCSI boot using IPv6, iscsistart still reads the +/sys/firmware/ibft/ethernetX/subnet-mask entry. Since the IPv6 prefix +length is 64, this causes the shift exponent to become negative, +triggering a UBSAN warning. As the concept of a subnet mask does not +apply to IPv6, the value is set to ~0 to suppress the warning message. + +Signed-off-by: Chengen Du +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Sasha Levin +--- + drivers/firmware/iscsi_ibft.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c +index 6e9788324fea5..371f24569b3b2 100644 +--- a/drivers/firmware/iscsi_ibft.c ++++ b/drivers/firmware/iscsi_ibft.c +@@ -310,7 +310,10 @@ static ssize_t ibft_attr_show_nic(void *data, int type, char *buf) + str += sprintf_ipaddr(str, nic->ip_addr); + break; + case ISCSI_BOOT_ETH_SUBNET_MASK: +- val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1)); ++ if (nic->subnet_mask_prefix > 32) ++ val = cpu_to_be32(~0); ++ else ++ val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1)); + str += sprintf(str, "%pI4", &val); + break; + case ISCSI_BOOT_ETH_PREFIX_LEN: +-- +2.39.5 + diff --git a/queue-6.13/kbuild-keep-symbols-for-symbol_get-even-with-config_.patch b/queue-6.13/kbuild-keep-symbols-for-symbol_get-even-with-config_.patch new file mode 100644 index 0000000000..2919cb9766 --- /dev/null +++ b/queue-6.13/kbuild-keep-symbols-for-symbol_get-even-with-config_.patch @@ -0,0 +1,185 @@ +From 33c6e590107280be08531a6e95fe2bfed4f0bb1f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 2 Feb 2025 03:51:41 +0900 +Subject: kbuild: keep symbols for symbol_get() even with + CONFIG_TRIM_UNUSED_KSYMS + +From: Masahiro Yamada + +[ Upstream commit 4c56eb33e603c3b9eb4bd24efbfdd0283c1c37e4 ] + +Linus observed that the symbol_request(utf8_data_table) call fails when +CONFIG_UNICODE=y and CONFIG_TRIM_UNUSED_KSYMS=y. + +symbol_get() relies on the symbol data being present in the ksymtab for +symbol lookups. However, EXPORT_SYMBOL_GPL(utf8_data_table) is dropped +due to CONFIG_TRIM_UNUSED_KSYMS, as no module references it in this case. + +Probably, this has been broken since commit dbacb0ef670d ("kconfig option +for TRIM_UNUSED_KSYMS"). + +This commit addresses the issue by leveraging modpost. Symbol names +passed to symbol_get() are recorded in the special .no_trim_symbol +section, which is then parsed by modpost to forcibly keep such symbols. +The .no_trim_symbol section is discarded by the linker scripts, so there +is no impact on the size of the final vmlinux or modules. + +This commit cannot resolve the issue for direct calls to __symbol_get() +because the symbol name is not known at compile-time. + +Although symbol_get() may eventually be deprecated, this workaround +should be good enough meanwhile. + +Reported-by: Linus Torvalds +Suggested-by: Linus Torvalds +Signed-off-by: Masahiro Yamada +Signed-off-by: Sasha Levin +--- + include/asm-generic/vmlinux.lds.h | 1 + + include/linux/module.h | 5 ++++- + scripts/mod/modpost.c | 35 +++++++++++++++++++++++++++++++ + scripts/mod/modpost.h | 6 ++++++ + scripts/module.lds.S | 1 + + 5 files changed, 47 insertions(+), 1 deletion(-) + +diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h +index 337d3336e1756..0d5b186abee86 100644 +--- a/include/asm-generic/vmlinux.lds.h ++++ b/include/asm-generic/vmlinux.lds.h +@@ -1038,6 +1038,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG) + *(.discard) \ + *(.discard.*) \ + *(.export_symbol) \ ++ *(.no_trim_symbol) \ + *(.modinfo) \ + /* ld.bfd warns about .gnu.version* even when not emitted */ \ + *(.gnu.version*) \ +diff --git a/include/linux/module.h b/include/linux/module.h +index b3a6434353579..541e4357ea2f1 100644 +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -306,7 +306,10 @@ extern int modules_disabled; /* for sysctl */ + /* Get/put a kernel symbol (calls must be symmetric) */ + void *__symbol_get(const char *symbol); + void *__symbol_get_gpl(const char *symbol); +-#define symbol_get(x) ((typeof(&x))(__symbol_get(__stringify(x)))) ++#define symbol_get(x) ({ \ ++ static const char __notrim[] \ ++ __used __section(".no_trim_symbol") = __stringify(x); \ ++ (typeof(&x))(__symbol_get(__stringify(x))); }) + + /* modules using other modules: kdb wants to see this. */ + struct module_use { +diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c +index 7ea59dc4926b3..967d698e0c924 100644 +--- a/scripts/mod/modpost.c ++++ b/scripts/mod/modpost.c +@@ -503,6 +503,9 @@ static int parse_elf(struct elf_info *info, const char *filename) + info->modinfo_len = sechdrs[i].sh_size; + } else if (!strcmp(secname, ".export_symbol")) { + info->export_symbol_secndx = i; ++ } else if (!strcmp(secname, ".no_trim_symbol")) { ++ info->no_trim_symbol = (void *)hdr + sechdrs[i].sh_offset; ++ info->no_trim_symbol_len = sechdrs[i].sh_size; + } + + if (sechdrs[i].sh_type == SHT_SYMTAB) { +@@ -1562,6 +1565,14 @@ static void read_symbols(const char *modname) + /* strip trailing .o */ + mod = new_module(modname, strlen(modname) - strlen(".o")); + ++ /* save .no_trim_symbol section for later use */ ++ if (info.no_trim_symbol_len) { ++ mod->no_trim_symbol = xmalloc(info.no_trim_symbol_len); ++ memcpy(mod->no_trim_symbol, info.no_trim_symbol, ++ info.no_trim_symbol_len); ++ mod->no_trim_symbol_len = info.no_trim_symbol_len; ++ } ++ + if (!mod->is_vmlinux) { + license = get_modinfo(&info, "license"); + if (!license) +@@ -1724,6 +1735,28 @@ static void handle_white_list_exports(const char *white_list) + free(buf); + } + ++/* ++ * Keep symbols recorded in the .no_trim_symbol section. This is necessary to ++ * prevent CONFIG_TRIM_UNUSED_KSYMS from dropping EXPORT_SYMBOL because ++ * symbol_get() relies on the symbol being present in the ksymtab for lookups. ++ */ ++static void keep_no_trim_symbols(struct module *mod) ++{ ++ unsigned long size = mod->no_trim_symbol_len; ++ ++ for (char *s = mod->no_trim_symbol; s; s = next_string(s , &size)) { ++ struct symbol *sym; ++ ++ /* ++ * If find_symbol() returns NULL, this symbol is not provided ++ * by any module, and symbol_get() will fail. ++ */ ++ sym = find_symbol(s); ++ if (sym) ++ sym->used = true; ++ } ++} ++ + static void check_modname_len(struct module *mod) + { + const char *mod_name; +@@ -2195,6 +2228,8 @@ int main(int argc, char **argv) + read_symbols_from_files(files_source); + + list_for_each_entry(mod, &modules, list) { ++ keep_no_trim_symbols(mod); ++ + if (mod->dump_file || mod->is_vmlinux) + continue; + +diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h +index ffd0a52a606ef..59366f456b765 100644 +--- a/scripts/mod/modpost.h ++++ b/scripts/mod/modpost.h +@@ -111,6 +111,8 @@ struct module_alias { + * + * @dump_file: path to the .symvers file if loaded from a file + * @aliases: list head for module_aliases ++ * @no_trim_symbol: .no_trim_symbol section data ++ * @no_trim_symbol_len: length of the .no_trim_symbol section + */ + struct module { + struct list_head list; +@@ -128,6 +130,8 @@ struct module { + // Actual imported namespaces + struct list_head imported_namespaces; + struct list_head aliases; ++ char *no_trim_symbol; ++ unsigned int no_trim_symbol_len; + char name[]; + }; + +@@ -141,6 +145,8 @@ struct elf_info { + char *strtab; + char *modinfo; + unsigned int modinfo_len; ++ char *no_trim_symbol; ++ unsigned int no_trim_symbol_len; + + /* support for 32bit section numbers */ + +diff --git a/scripts/module.lds.S b/scripts/module.lds.S +index c2f80f9141d40..450f1088d5fd3 100644 +--- a/scripts/module.lds.S ++++ b/scripts/module.lds.S +@@ -16,6 +16,7 @@ SECTIONS { + *(.discard) + *(.discard.*) + *(.export_symbol) ++ *(.no_trim_symbol) + } + + __ksymtab 0 : ALIGN(8) { *(SORT(___ksymtab+*)) } +-- +2.39.5 + diff --git a/queue-6.13/loongarch-fix-kernel_page_present-for-kprange-xkpran.patch b/queue-6.13/loongarch-fix-kernel_page_present-for-kprange-xkpran.patch new file mode 100644 index 0000000000..16388843a9 --- /dev/null +++ b/queue-6.13/loongarch-fix-kernel_page_present-for-kprange-xkpran.patch @@ -0,0 +1,49 @@ +From d0fa0e90e117306817426714cd64a051dd5d45e2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 13 Feb 2025 12:02:35 +0800 +Subject: LoongArch: Fix kernel_page_present() for KPRANGE/XKPRANGE + +From: Huacai Chen + +[ Upstream commit 619b52777a4972bdb6ddf86ac54c6f68a47b51c4 ] + +Now kernel_page_present() always return true for KPRANGE/XKPRANGE +addresses, this isn't correct because hibernation (ACPI S4) use it +to distinguish whether a page is saveable. If all KPRANGE/XKPRANGE +addresses are considered as saveable, then reserved memory such as +EFI_RUNTIME_SERVICES_CODE / EFI_RUNTIME_SERVICES_DATA will also be +saved and restored. + +Fix this by returning true only if the KPRANGE/XKPRANGE address is in +memblock.memory. + +Signed-off-by: Huacai Chen +Signed-off-by: Sasha Levin +--- + arch/loongarch/mm/pageattr.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/loongarch/mm/pageattr.c b/arch/loongarch/mm/pageattr.c +index bf86782484440..99165903908a4 100644 +--- a/arch/loongarch/mm/pageattr.c ++++ b/arch/loongarch/mm/pageattr.c +@@ -3,6 +3,7 @@ + * Copyright (C) 2024 Loongson Technology Corporation Limited + */ + ++#include + #include + #include + #include +@@ -167,7 +168,7 @@ bool kernel_page_present(struct page *page) + unsigned long addr = (unsigned long)page_address(page); + + if (addr < vm_map_base) +- return true; ++ return memblock_is_memory(__pa(addr)); + + pgd = pgd_offset_k(addr); + if (pgd_none(pgdp_get(pgd))) +-- +2.39.5 + diff --git a/queue-6.13/loongarch-kvm-set-host-with-kernel-mode-when-switch-.patch b/queue-6.13/loongarch-kvm-set-host-with-kernel-mode-when-switch-.patch new file mode 100644 index 0000000000..c297f81978 --- /dev/null +++ b/queue-6.13/loongarch-kvm-set-host-with-kernel-mode-when-switch-.patch @@ -0,0 +1,43 @@ +From 58e7ca1a236a711c1565cea2962d8b0baa788d37 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 13 Feb 2025 12:02:56 +0800 +Subject: LoongArch: KVM: Set host with kernel mode when switch to VM mode + +From: Bibo Mao + +[ Upstream commit 3011b29ec5a33ec16502e687c4264d57416a8b1f ] + +PRMD register is only meaningful on the beginning stage of exception +entry, and it is overwritten with nested irq or exception. + +When CPU runs in VM mode, interrupt need be enabled on host. And the +mode for host had better be kernel mode rather than random or user mode. + +When VM is running, the running mode with top command comes from CRMD +register, and running mode should be kernel mode since kernel function +is executing with perf command. It needs be consistent with both top and +perf command. + +Signed-off-by: Bibo Mao +Signed-off-by: Huacai Chen +Signed-off-by: Sasha Levin +--- + arch/loongarch/kvm/switch.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/loongarch/kvm/switch.S b/arch/loongarch/kvm/switch.S +index 0c292f8184927..1be185e948072 100644 +--- a/arch/loongarch/kvm/switch.S ++++ b/arch/loongarch/kvm/switch.S +@@ -85,7 +85,7 @@ + * Guest CRMD comes from separate GCSR_CRMD register + */ + ori t0, zero, CSR_PRMD_PIE +- csrxchg t0, t0, LOONGARCH_CSR_PRMD ++ csrwr t0, LOONGARCH_CSR_PRMD + + /* Set PVM bit to setup ertn to guest context */ + ori t0, zero, CSR_GSTAT_PVM +-- +2.39.5 + diff --git a/queue-6.13/mptcp-safety-check-before-fallback.patch b/queue-6.13/mptcp-safety-check-before-fallback.patch new file mode 100644 index 0000000000..307226a552 --- /dev/null +++ b/queue-6.13/mptcp-safety-check-before-fallback.patch @@ -0,0 +1,41 @@ +From 22a9af407f5582d4c6e78027b4d709fbe0d5cfdd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 24 Feb 2025 19:11:52 +0100 +Subject: mptcp: safety check before fallback + +From: Matthieu Baerts (NGI0) + +[ Upstream commit db75a16813aabae3b78c06b1b99f5e314c1f55d3 ] + +Recently, some fallback have been initiated, while the connection was +not supposed to fallback. + +Add a safety check with a warning to detect when an wrong attempt to +fallback is being done. This should help detecting any future issues +quicker. + +Acked-by: Paolo Abeni +Signed-off-by: Matthieu Baerts (NGI0) +Link: https://patch.msgid.link/20250224-net-mptcp-misc-fixes-v1-3-f550f636b435@kernel.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/mptcp/protocol.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h +index b70a303e08287..7e2f70f22b05b 100644 +--- a/net/mptcp/protocol.h ++++ b/net/mptcp/protocol.h +@@ -1194,6 +1194,8 @@ static inline void __mptcp_do_fallback(struct mptcp_sock *msk) + pr_debug("TCP fallback already done (msk=%p)\n", msk); + return; + } ++ if (WARN_ON_ONCE(!READ_ONCE(msk->allow_infinite_fallback))) ++ return; + set_bit(MPTCP_FALLBACK_DONE, &msk->flags); + } + +-- +2.39.5 + diff --git a/queue-6.13/net-handle-napi_schedule-calls-from-non-interrupt.patch b/queue-6.13/net-handle-napi_schedule-calls-from-non-interrupt.patch new file mode 100644 index 0000000000..b384a801a8 --- /dev/null +++ b/queue-6.13/net-handle-napi_schedule-calls-from-non-interrupt.patch @@ -0,0 +1,109 @@ +From 633d5a6e22592944648ce8809728c0ade54df0bb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 23 Feb 2025 23:17:08 +0100 +Subject: net: Handle napi_schedule() calls from non-interrupt + +From: Frederic Weisbecker + +[ Upstream commit 77e45145e3039a0fb212556ab3f8c87f54771757 ] + +napi_schedule() is expected to be called either: + +* From an interrupt, where raised softirqs are handled on IRQ exit + +* From a softirq disabled section, where raised softirqs are handled on + the next call to local_bh_enable(). + +* From a softirq handler, where raised softirqs are handled on the next + round in do_softirq(), or further deferred to a dedicated kthread. + +Other bare tasks context may end up ignoring the raised NET_RX vector +until the next random softirq handling opportunity, which may not +happen before a while if the CPU goes idle afterwards with the tick +stopped. + +Such "misuses" have been detected on several places thanks to messages +of the kind: + + "NOHZ tick-stop error: local softirq work is pending, handler #08!!!" + +For example: + + __raise_softirq_irqoff + __napi_schedule + rtl8152_runtime_resume.isra.0 + rtl8152_resume + usb_resume_interface.isra.0 + usb_resume_both + __rpm_callback + rpm_callback + rpm_resume + __pm_runtime_resume + usb_autoresume_device + usb_remote_wakeup + hub_event + process_one_work + worker_thread + kthread + ret_from_fork + ret_from_fork_asm + +And also: + +* drivers/net/usb/r8152.c::rtl_work_func_t +* drivers/net/netdevsim/netdev.c::nsim_start_xmit + +There is a long history of issues of this kind: + + 019edd01d174 ("ath10k: sdio: Add missing BH locking around napi_schdule()") + 330068589389 ("idpf: disable local BH when scheduling napi for marker packets") + e3d5d70cb483 ("net: lan78xx: fix "softirq work is pending" error") + e55c27ed9ccf ("mt76: mt7615: add missing bh-disable around rx napi schedule") + c0182aa98570 ("mt76: mt7915: add missing bh-disable around tx napi enable/schedule") + 970be1dff26d ("mt76: disable BH around napi_schedule() calls") + 019edd01d174 ("ath10k: sdio: Add missing BH locking around napi_schdule()") + 30bfec4fec59 ("can: rx-offload: can_rx_offload_threaded_irq_finish(): add new function to be called from threaded interrupt") + e63052a5dd3c ("mlx5e: add add missing BH locking around napi_schdule()") + 83a0c6e58901 ("i40e: Invoke softirqs after napi_reschedule") + bd4ce941c8d5 ("mlx4: Invoke softirqs after napi_reschedule") + 8cf699ec849f ("mlx4: do not call napi_schedule() without care") + ec13ee80145c ("virtio_net: invoke softirqs after __napi_schedule") + +This shows that relying on the caller to arrange a proper context for +the softirqs to be handled while calling napi_schedule() is very fragile +and error prone. Also fixing them can also prove challenging if the +caller may be called from different kinds of contexts. + +Therefore fix this from napi_schedule() itself with waking up ksoftirqd +when softirqs are raised from task contexts. + +Reported-by: Paul Menzel +Reported-by: Jakub Kicinski +Reported-by: Francois Romieu +Closes: https://lore.kernel.org/lkml/354a2690-9bbf-4ccb-8769-fa94707a9340@molgen.mpg.de/ +Cc: Breno Leitao +Signed-off-by: Frederic Weisbecker +Reviewed-by: Eric Dumazet +Link: https://patch.msgid.link/20250223221708.27130-1-frederic@kernel.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/core/dev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/core/dev.c b/net/core/dev.c +index 2b09714761c62..7f755270ff1ce 100644 +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -4610,7 +4610,7 @@ static inline void ____napi_schedule(struct softnet_data *sd, + * we have to raise NET_RX_SOFTIRQ. + */ + if (!sd->in_net_rx_action) +- __raise_softirq_irqoff(NET_RX_SOFTIRQ); ++ raise_softirq_irqoff(NET_RX_SOFTIRQ); + } + + #ifdef CONFIG_RPS +-- +2.39.5 + diff --git a/queue-6.13/net-wwan-mhi_wwan_mbim-silence-sequence-number-glitc.patch b/queue-6.13/net-wwan-mhi_wwan_mbim-silence-sequence-number-glitc.patch new file mode 100644 index 0000000000..8e44a27ddb --- /dev/null +++ b/queue-6.13/net-wwan-mhi_wwan_mbim-silence-sequence-number-glitc.patch @@ -0,0 +1,61 @@ +From 9cba27448c3b0dd0b53e415936d7e0be1b048f4f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 12 Feb 2025 12:15:35 +0100 +Subject: net: wwan: mhi_wwan_mbim: Silence sequence number glitch errors + +From: Stephan Gerhold + +[ Upstream commit 0d1fac6d26aff5df21bb4ec980d9b7a11c410b96 ] + +When using the Qualcomm X55 modem on the ThinkPad X13s, the kernel log is +constantly being filled with errors related to a "sequence number glitch", +e.g.: + + [ 1903.284538] sequence number glitch prev=16 curr=0 + [ 1913.812205] sequence number glitch prev=50 curr=0 + [ 1923.698219] sequence number glitch prev=142 curr=0 + [ 2029.248276] sequence number glitch prev=1555 curr=0 + [ 2046.333059] sequence number glitch prev=70 curr=0 + [ 2076.520067] sequence number glitch prev=272 curr=0 + [ 2158.704202] sequence number glitch prev=2655 curr=0 + [ 2218.530776] sequence number glitch prev=2349 curr=0 + [ 2225.579092] sequence number glitch prev=6 curr=0 + +Internet connectivity is working fine, so this error seems harmless. It +looks like modem does not preserve the sequence number when entering low +power state; the amount of errors depends on how actively the modem is +being used. + +A similar issue has also been seen on USB-based MBIM modems [1]. However, +in cdc_ncm.c the "sequence number glitch" message is a debug message +instead of an error. Apply the same to the mhi_wwan_mbim.c driver to +silence these errors when using the modem. + +[1]: https://lists.freedesktop.org/archives/libmbim-devel/2016-November/000781.html + +Signed-off-by: Stephan Gerhold +Reviewed-by: Loic Poulain +Acked-by: Manivannan Sadhasivam +Link: https://patch.msgid.link/20250212-mhi-wwan-mbim-sequence-glitch-v1-1-503735977cbd@linaro.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/wwan/mhi_wwan_mbim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c +index d5a9360323d29..8755c5e6a65b3 100644 +--- a/drivers/net/wwan/mhi_wwan_mbim.c ++++ b/drivers/net/wwan/mhi_wwan_mbim.c +@@ -220,7 +220,7 @@ static int mbim_rx_verify_nth16(struct mhi_mbim_context *mbim, struct sk_buff *s + if (mbim->rx_seq + 1 != le16_to_cpu(nth16->wSequence) && + (mbim->rx_seq || le16_to_cpu(nth16->wSequence)) && + !(mbim->rx_seq == 0xffff && !le16_to_cpu(nth16->wSequence))) { +- net_err_ratelimited("sequence number glitch prev=%d curr=%d\n", ++ net_dbg_ratelimited("sequence number glitch prev=%d curr=%d\n", + mbim->rx_seq, le16_to_cpu(nth16->wSequence)); + } + mbim->rx_seq = le16_to_cpu(nth16->wSequence); +-- +2.39.5 + diff --git a/queue-6.13/nvme-fc-do-not-ignore-connectivity-loss-during-conne.patch b/queue-6.13/nvme-fc-do-not-ignore-connectivity-loss-during-conne.patch new file mode 100644 index 0000000000..b3d694da74 --- /dev/null +++ b/queue-6.13/nvme-fc-do-not-ignore-connectivity-loss-during-conne.patch @@ -0,0 +1,113 @@ +From e0cdcd023334a757ae78a43d2fa8909dcc72ec56 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 9 Jan 2025 14:30:49 +0100 +Subject: nvme-fc: do not ignore connectivity loss during connecting + +From: Daniel Wagner + +[ Upstream commit ee59e3820ca92a9f4307ae23dfc7229dc8b8d400 ] + +When a connectivity loss occurs while nvme_fc_create_assocation is +being executed, it's possible that the ctrl ends up stuck in the LIVE +state: + + 1) nvme nvme10: NVME-FC{10}: create association : ... + 2) nvme nvme10: NVME-FC{10}: controller connectivity lost. + Awaiting Reconnect + nvme nvme10: queue_size 128 > ctrl maxcmd 32, reducing to maxcmd + 3) nvme nvme10: Could not set queue count (880) + nvme nvme10: Failed to configure AEN (cfg 900) + 4) nvme nvme10: NVME-FC{10}: controller connect complete + 5) nvme nvme10: failed nvme_keep_alive_end_io error=4 + +A connection attempt starts 1) and the ctrl is in state CONNECTING. +Shortly after the LLDD driver detects a connection lost event and calls +nvme_fc_ctrl_connectivity_loss 2). Because we are still in CONNECTING +state, this event is ignored. + +nvme_fc_create_association continues to run in parallel and tries to +communicate with the controller and these commands will fail. Though +these errors are filtered out, e.g in 3) setting the I/O queues numbers +fails which leads to an early exit in nvme_fc_create_io_queues. Because +the number of IO queues is 0 at this point, there is nothing left in +nvme_fc_create_association which could detected the connection drop. +Thus the ctrl enters LIVE state 4). + +Eventually the keep alive handler times out 5) but because nothing is +being done, the ctrl stays in LIVE state. + +There is already the ASSOC_FAILED flag to track connectivity loss event +but this bit is set too late in the recovery code path. Move this into +the connectivity loss event handler and synchronize it with the state +change. This ensures that the ASSOC_FAILED flag is seen by +nvme_fc_create_io_queues and it does not enter the LIVE state after a +connectivity loss event. If the connectivity loss event happens after we +entered the LIVE state the normal error recovery path is executed. + +Signed-off-by: Daniel Wagner +Reviewed-by: Hannes Reinecke +Reviewed-by: Sagi Grimberg +Signed-off-by: Keith Busch +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/fc.c | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c +index a458d939ab662..a12a1474bef7b 100644 +--- a/drivers/nvme/host/fc.c ++++ b/drivers/nvme/host/fc.c +@@ -782,11 +782,19 @@ nvme_fc_abort_lsops(struct nvme_fc_rport *rport) + static void + nvme_fc_ctrl_connectivity_loss(struct nvme_fc_ctrl *ctrl) + { ++ enum nvme_ctrl_state state; ++ unsigned long flags; ++ + dev_info(ctrl->ctrl.device, + "NVME-FC{%d}: controller connectivity lost. Awaiting " + "Reconnect", ctrl->cnum); + +- switch (nvme_ctrl_state(&ctrl->ctrl)) { ++ spin_lock_irqsave(&ctrl->lock, flags); ++ set_bit(ASSOC_FAILED, &ctrl->flags); ++ state = nvme_ctrl_state(&ctrl->ctrl); ++ spin_unlock_irqrestore(&ctrl->lock, flags); ++ ++ switch (state) { + case NVME_CTRL_NEW: + case NVME_CTRL_LIVE: + /* +@@ -2546,7 +2554,6 @@ nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg) + */ + if (state == NVME_CTRL_CONNECTING) { + __nvme_fc_abort_outstanding_ios(ctrl, true); +- set_bit(ASSOC_FAILED, &ctrl->flags); + dev_warn(ctrl->ctrl.device, + "NVME-FC{%d}: transport error during (re)connect\n", + ctrl->cnum); +@@ -3171,12 +3178,18 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) + else + ret = nvme_fc_recreate_io_queues(ctrl); + } +- if (!ret && test_bit(ASSOC_FAILED, &ctrl->flags)) +- ret = -EIO; + if (ret) + goto out_term_aen_ops; + +- changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); ++ spin_lock_irqsave(&ctrl->lock, flags); ++ if (!test_bit(ASSOC_FAILED, &ctrl->flags)) ++ changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); ++ else ++ ret = -EIO; ++ spin_unlock_irqrestore(&ctrl->lock, flags); ++ ++ if (ret) ++ goto out_term_aen_ops; + + ctrl->ctrl.nr_reconnects = 0; + +-- +2.39.5 + diff --git a/queue-6.13/nvme-fc-go-straight-to-connecting-state-when-initial.patch b/queue-6.13/nvme-fc-go-straight-to-connecting-state-when-initial.patch new file mode 100644 index 0000000000..645300aa35 --- /dev/null +++ b/queue-6.13/nvme-fc-go-straight-to-connecting-state-when-initial.patch @@ -0,0 +1,43 @@ +From cbe266ff24e88a2b52dccfe8bc8e543736eda34c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 9 Jan 2025 14:30:47 +0100 +Subject: nvme-fc: go straight to connecting state when initializing + +From: Daniel Wagner + +[ Upstream commit d3d380eded7ee5fc2fc53b3b0e72365ded025c4a ] + +The initial controller initialization mimiks the reconnect loop +behavior by switching from NEW to RESETTING and then to CONNECTING. + +The transition from NEW to CONNECTING is a valid transition, so there is +no point entering the RESETTING state. TCP and RDMA also transition +directly to CONNECTING state. + +Reviewed-by: Sagi Grimberg +Reviewed-by: Hannes Reinecke +Reviewed-by: Christoph Hellwig +Signed-off-by: Daniel Wagner +Signed-off-by: Keith Busch +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/fc.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c +index 682234da2fabe..a458d939ab662 100644 +--- a/drivers/nvme/host/fc.c ++++ b/drivers/nvme/host/fc.c +@@ -3582,8 +3582,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, + list_add_tail(&ctrl->ctrl_list, &rport->ctrl_list); + spin_unlock_irqrestore(&rport->lock, flags); + +- if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_RESETTING) || +- !nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) { ++ if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) { + dev_err(ctrl->ctrl.device, + "NVME-FC{%d}: failed to init ctrl state\n", ctrl->cnum); + goto fail_ctrl; +-- +2.39.5 + diff --git a/queue-6.13/nvme-only-allow-entering-live-from-connecting-state.patch b/queue-6.13/nvme-only-allow-entering-live-from-connecting-state.patch new file mode 100644 index 0000000000..dfdba5f930 --- /dev/null +++ b/queue-6.13/nvme-only-allow-entering-live-from-connecting-state.patch @@ -0,0 +1,38 @@ +From 9a356021fbe17e58019f9dd0e9487e14780d35df Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 14 Feb 2025 09:02:03 +0100 +Subject: nvme: only allow entering LIVE from CONNECTING state + +From: Daniel Wagner + +[ Upstream commit d2fe192348f93fe3a0cb1e33e4aba58e646397f4 ] + +The fabric transports and also the PCI transport are not entering the +LIVE state from NEW or RESETTING. This makes the state machine more +restrictive and allows to catch not supported state transitions, e.g. +directly switching from RESETTING to LIVE. + +Reviewed-by: Sagi Grimberg +Signed-off-by: Daniel Wagner +Signed-off-by: Keith Busch +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/core.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c +index 46e04b30f6425..cf0e7c6d5502b 100644 +--- a/drivers/nvme/host/core.c ++++ b/drivers/nvme/host/core.c +@@ -564,8 +564,6 @@ bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl, + switch (new_state) { + case NVME_CTRL_LIVE: + switch (old_state) { +- case NVME_CTRL_NEW: +- case NVME_CTRL_RESETTING: + case NVME_CTRL_CONNECTING: + changed = true; + fallthrough; +-- +2.39.5 + diff --git a/queue-6.13/nvme-pci-quirk-acer-fa100-for-non-uniqueue-identifie.patch b/queue-6.13/nvme-pci-quirk-acer-fa100-for-non-uniqueue-identifie.patch new file mode 100644 index 0000000000..f8235a0409 --- /dev/null +++ b/queue-6.13/nvme-pci-quirk-acer-fa100-for-non-uniqueue-identifie.patch @@ -0,0 +1,86 @@ +From 770f2e49a3468ae14769a9e63ce989c46c5ad14d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 18 Feb 2025 08:59:29 -0500 +Subject: nvme-pci: quirk Acer FA100 for non-uniqueue identifiers + +From: Christopher Lentocha + +[ Upstream commit fcd875445866a5219cf2be3101e276b21fc843f3 ] + +In order for two Acer FA100 SSDs to work in one PC (in the case of +myself, a Lenovo Legion T5 28IMB05), and not show one drive and not +the other, and sometimes mix up what drive shows up (randomly), these +two lines of code need to be added, and then both of the SSDs will +show up and not conflict when booting off of one of them. If you boot +up your computer with both SSDs installed without this patch, you may +also randomly get into a kernel panic (if the initrd is not set up) or +stuck in the initrd "/init" process, it is set up, however, if you do +apply this patch, there should not be problems with booting or seeing +both contents of the drive. Tested with the btrfs filesystem with a +RAID configuration of having the root drive '/' combined to make two +256GB Acer FA100 SSDs become 512GB in total storage. + +Kernel Logs with patch applied (`dmesg -t | grep -i nvm`): + +``` +... +nvme 0000:04:00.0: platform quirk: setting simple suspend +nvme nvme0: pci function 0000:04:00.0 +nvme 0000:05:00.0: platform quirk: setting simple suspend +nvme nvme1: pci function 0000:05:00.0 +nvme nvme1: missing or invalid SUBNQN field. +nvme nvme1: allocated 64 MiB host memory buffer. +nvme nvme0: missing or invalid SUBNQN field. +nvme nvme0: allocated 64 MiB host memory buffer. +nvme nvme1: 8/0/0 default/read/poll queues +nvme nvme1: Ignoring bogus Namespace Identifiers +nvme nvme0: 8/0/0 default/read/poll queues +nvme nvme0: Ignoring bogus Namespace Identifiers +nvme0n1: p1 p2 +... +``` + +Kernel Logs with patch not applied (`dmesg -t | grep -i nvm`): + +``` +... +nvme 0000:04:00.0: platform quirk: setting simple suspend +nvme nvme0: pci function 0000:04:00.0 +nvme 0000:05:00.0: platform quirk: setting simple suspend +nvme nvme1: pci function 0000:05:00.0 +nvme nvme0: missing or invalid SUBNQN field. +nvme nvme1: missing or invalid SUBNQN field. +nvme nvme0: allocated 64 MiB host memory buffer. +nvme nvme1: allocated 64 MiB host memory buffer. +nvme nvme0: 8/0/0 default/read/poll queues +nvme nvme1: 8/0/0 default/read/poll queues +nvme nvme1: globally duplicate IDs for nsid 1 +nvme nvme1: VID:DID 1dbe:5216 model:Acer SSD FA100 256GB firmware:1.Z.J.2X +nvme0n1: p1 p2 +... +``` + +Signed-off-by: Christopher Lentocha +Reviewed-by: Christoph Hellwig +Signed-off-by: Keith Busch +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/pci.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c +index 99c2983dbe6c8..d2eeba15c73b3 100644 +--- a/drivers/nvme/host/pci.c ++++ b/drivers/nvme/host/pci.c +@@ -3715,6 +3715,8 @@ static const struct pci_device_id nvme_id_table[] = { + .driver_data = NVME_QUIRK_BOGUS_NID, }, + { PCI_DEVICE(0x1cc1, 0x5350), /* ADATA XPG GAMMIX S50 */ + .driver_data = NVME_QUIRK_BOGUS_NID, }, ++ { PCI_DEVICE(0x1dbe, 0x5216), /* Acer/INNOGRIT FA100/5216 NVMe SSD */ ++ .driver_data = NVME_QUIRK_BOGUS_NID, }, + { PCI_DEVICE(0x1dbe, 0x5236), /* ADATA XPG GAMMIX S70 */ + .driver_data = NVME_QUIRK_BOGUS_NID, }, + { PCI_DEVICE(0x1e49, 0x0021), /* ZHITAI TiPro5000 NVMe SSD */ +-- +2.39.5 + diff --git a/queue-6.13/nvmet-rdma-recheck-queue-state-is-live-in-state-lock.patch b/queue-6.13/nvmet-rdma-recheck-queue-state-is-live-in-state-lock.patch new file mode 100644 index 0000000000..19ce44bc88 --- /dev/null +++ b/queue-6.13/nvmet-rdma-recheck-queue-state-is-live-in-state-lock.patch @@ -0,0 +1,79 @@ +From bb89c4b09f3d9902d815bd74df44a4e6d06c37fc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 16 Feb 2025 20:49:56 +0800 +Subject: nvmet-rdma: recheck queue state is LIVE in state lock in recv done + +From: Ruozhu Li + +[ Upstream commit 3988ac1c67e6e84d2feb987d7b36d5791174b3da ] + +The queue state checking in nvmet_rdma_recv_done is not in queue state +lock.Queue state can transfer to LIVE in cm establish handler between +state checking and state lock here, cause a silent drop of nvme connect +cmd. +Recheck queue state whether in LIVE state in state lock to prevent this +issue. + +Signed-off-by: Ruozhu Li +Reviewed-by: Sagi Grimberg +Signed-off-by: Keith Busch +Signed-off-by: Sasha Levin +--- + drivers/nvme/target/rdma.c | 33 +++++++++++++++++++++++---------- + 1 file changed, 23 insertions(+), 10 deletions(-) + +diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c +index 1afd93026f9bf..2a4536ef61848 100644 +--- a/drivers/nvme/target/rdma.c ++++ b/drivers/nvme/target/rdma.c +@@ -996,6 +996,27 @@ static void nvmet_rdma_handle_command(struct nvmet_rdma_queue *queue, + nvmet_req_complete(&cmd->req, status); + } + ++static bool nvmet_rdma_recv_not_live(struct nvmet_rdma_queue *queue, ++ struct nvmet_rdma_rsp *rsp) ++{ ++ unsigned long flags; ++ bool ret = true; ++ ++ spin_lock_irqsave(&queue->state_lock, flags); ++ /* ++ * recheck queue state is not live to prevent a race condition ++ * with RDMA_CM_EVENT_ESTABLISHED handler. ++ */ ++ if (queue->state == NVMET_RDMA_Q_LIVE) ++ ret = false; ++ else if (queue->state == NVMET_RDMA_Q_CONNECTING) ++ list_add_tail(&rsp->wait_list, &queue->rsp_wait_list); ++ else ++ nvmet_rdma_put_rsp(rsp); ++ spin_unlock_irqrestore(&queue->state_lock, flags); ++ return ret; ++} ++ + static void nvmet_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc) + { + struct nvmet_rdma_cmd *cmd = +@@ -1038,17 +1059,9 @@ static void nvmet_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc) + rsp->n_rdma = 0; + rsp->invalidate_rkey = 0; + +- if (unlikely(queue->state != NVMET_RDMA_Q_LIVE)) { +- unsigned long flags; +- +- spin_lock_irqsave(&queue->state_lock, flags); +- if (queue->state == NVMET_RDMA_Q_CONNECTING) +- list_add_tail(&rsp->wait_list, &queue->rsp_wait_list); +- else +- nvmet_rdma_put_rsp(rsp); +- spin_unlock_irqrestore(&queue->state_lock, flags); ++ if (unlikely(queue->state != NVMET_RDMA_Q_LIVE) && ++ nvmet_rdma_recv_not_live(queue, rsp)) + return; +- } + + nvmet_rdma_handle_command(queue, rsp); + } +-- +2.39.5 + diff --git a/queue-6.13/objtool-ignore-dangling-jump-table-entries.patch b/queue-6.13/objtool-ignore-dangling-jump-table-entries.patch new file mode 100644 index 0000000000..31d33ce40b --- /dev/null +++ b/queue-6.13/objtool-ignore-dangling-jump-table-entries.patch @@ -0,0 +1,52 @@ +From 73f09b49a2ee0a5ede288fe8665d24e9aae5a58b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 14 Jan 2025 13:57:58 -0800 +Subject: objtool: Ignore dangling jump table entries + +From: Josh Poimboeuf + +[ Upstream commit 3724062ca2b1364f02cf44dbea1a552227844ad1 ] + +Clang sometimes leaves dangling unused jump table entries which point to +the end of the function. Ignore them. + +Closes: https://lore.kernel.org/20250113235835.vqgvb7cdspksy5dn@jpoimboe +Reported-by: Klaus Kusche +Signed-off-by: Josh Poimboeuf +Signed-off-by: Peter Zijlstra (Intel) +Link: https://lkml.kernel.org/r/ee25c0b7e80113e950bd1d4c208b671d35774ff4.1736891751.git.jpoimboe@kernel.org +Signed-off-by: Sasha Levin +--- + tools/objtool/check.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/tools/objtool/check.c b/tools/objtool/check.c +index 6691bd106e4b6..6f3f408d0a019 100644 +--- a/tools/objtool/check.c ++++ b/tools/objtool/check.c +@@ -2061,6 +2061,14 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn, + reloc_addend(reloc) == pfunc->offset) + break; + ++ /* ++ * Clang sometimes leaves dangling unused jump table entries ++ * which point to the end of the function. Ignore them. ++ */ ++ if (reloc->sym->sec == pfunc->sec && ++ reloc_addend(reloc) == pfunc->offset + pfunc->len) ++ goto next; ++ + dest_insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc)); + if (!dest_insn) + break; +@@ -2078,6 +2086,7 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn, + alt->insn = dest_insn; + alt->next = insn->alts; + insn->alts = alt; ++next: + prev_offset = reloc_offset(reloc); + } + +-- +2.39.5 + diff --git a/queue-6.13/pci-pci_ids-add-intel_hda_ptl_h.patch b/queue-6.13/pci-pci_ids-add-intel_hda_ptl_h.patch new file mode 100644 index 0000000000..10ca6ff5ce --- /dev/null +++ b/queue-6.13/pci-pci_ids-add-intel_hda_ptl_h.patch @@ -0,0 +1,38 @@ +From 9ab75a28808b2e05c11749fe4c5bdd102e7ab2fb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 10 Feb 2025 10:17:27 +0200 +Subject: PCI: pci_ids: add INTEL_HDA_PTL_H + +From: Pierre-Louis Bossart + +[ Upstream commit a1f7b7ff0e10ae574d388131596390157222f986 ] + +Add Intel PTL-H audio Device ID. + +Signed-off-by: Pierre-Louis Bossart +Signed-off-by: Peter Ujfalusi +Reviewed-by: Kai Vehmanen +Reviewed-by: Bard Liao +Acked-by: Bjorn Helgaas +Signed-off-by: Takashi Iwai +Link: https://patch.msgid.link/20250210081730.22916-2-peter.ujfalusi@linux.intel.com +Signed-off-by: Sasha Levin +--- + include/linux/pci_ids.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h +index de5deb1a0118f..1a2594a38199f 100644 +--- a/include/linux/pci_ids.h ++++ b/include/linux/pci_ids.h +@@ -3134,6 +3134,7 @@ + #define PCI_DEVICE_ID_INTEL_HDA_LNL_P 0xa828 + #define PCI_DEVICE_ID_INTEL_S21152BB 0xb152 + #define PCI_DEVICE_ID_INTEL_HDA_BMG 0xe2f7 ++#define PCI_DEVICE_ID_INTEL_HDA_PTL_H 0xe328 + #define PCI_DEVICE_ID_INTEL_HDA_PTL 0xe428 + #define PCI_DEVICE_ID_INTEL_HDA_CML_R 0xf0c8 + #define PCI_DEVICE_ID_INTEL_HDA_RKL_S 0xf1c8 +-- +2.39.5 + diff --git a/queue-6.13/perf-x86-intel-use-better-start-period-for-frequency.patch b/queue-6.13/perf-x86-intel-use-better-start-period-for-frequency.patch new file mode 100644 index 0000000000..44f7f6f516 --- /dev/null +++ b/queue-6.13/perf-x86-intel-use-better-start-period-for-frequency.patch @@ -0,0 +1,150 @@ +From f6659de95c559d8d381fd5612c4f36c5e7fa6880 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Jan 2025 07:19:13 -0800 +Subject: perf/x86/intel: Use better start period for frequency mode + +From: Kan Liang + +[ Upstream commit a26b24b2e21f6222635a95426b9ef9eec63d69b1 ] + +Freqency mode is the current default mode of Linux perf. A period of 1 is +used as a starting period. The period is auto-adjusted on each tick or an +overflow, to meet the frequency target. + +The start period of 1 is too low and may trigger some issues: + +- Many HWs do not support period 1 well. + https://lore.kernel.org/lkml/875xs2oh69.ffs@tglx/ + +- For an event that occurs frequently, period 1 is too far away from the + real period. Lots of samples are generated at the beginning. + The distribution of samples may not be even. + +- A low starting period for frequently occurring events also challenges + virtualization, which has a longer path to handle a PMI. + +The limit_period value only checks the minimum acceptable value for HW. +It cannot be used to set the start period, because some events may +need a very low period. The limit_period cannot be set too high. It +doesn't help with the events that occur frequently. + +It's hard to find a universal starting period for all events. The idea +implemented by this patch is to only give an estimate for the popular +HW and HW cache events. For the rest of the events, start from the lowest +possible recommended value. + +Signed-off-by: Kan Liang +Signed-off-by: Ingo Molnar +Cc: Peter Zijlstra +Link: https://lore.kernel.org/r/20250117151913.3043942-3-kan.liang@linux.intel.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/intel/core.c | 85 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 85 insertions(+) + +diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c +index 2bba1d934efb0..6651360d6a525 100644 +--- a/arch/x86/events/intel/core.c ++++ b/arch/x86/events/intel/core.c +@@ -3949,6 +3949,85 @@ static inline bool intel_pmu_has_cap(struct perf_event *event, int idx) + return test_bit(idx, (unsigned long *)&intel_cap->capabilities); + } + ++static u64 intel_pmu_freq_start_period(struct perf_event *event) ++{ ++ int type = event->attr.type; ++ u64 config, factor; ++ s64 start; ++ ++ /* ++ * The 127 is the lowest possible recommended SAV (sample after value) ++ * for a 4000 freq (default freq), according to the event list JSON file. ++ * Also, assume the workload is idle 50% time. ++ */ ++ factor = 64 * 4000; ++ if (type != PERF_TYPE_HARDWARE && type != PERF_TYPE_HW_CACHE) ++ goto end; ++ ++ /* ++ * The estimation of the start period in the freq mode is ++ * based on the below assumption. ++ * ++ * For a cycles or an instructions event, 1GHZ of the ++ * underlying platform, 1 IPC. The workload is idle 50% time. ++ * The start period = 1,000,000,000 * 1 / freq / 2. ++ * = 500,000,000 / freq ++ * ++ * Usually, the branch-related events occur less than the ++ * instructions event. According to the Intel event list JSON ++ * file, the SAV (sample after value) of a branch-related event ++ * is usually 1/4 of an instruction event. ++ * The start period of branch-related events = 125,000,000 / freq. ++ * ++ * The cache-related events occurs even less. The SAV is usually ++ * 1/20 of an instruction event. ++ * The start period of cache-related events = 25,000,000 / freq. ++ */ ++ config = event->attr.config & PERF_HW_EVENT_MASK; ++ if (type == PERF_TYPE_HARDWARE) { ++ switch (config) { ++ case PERF_COUNT_HW_CPU_CYCLES: ++ case PERF_COUNT_HW_INSTRUCTIONS: ++ case PERF_COUNT_HW_BUS_CYCLES: ++ case PERF_COUNT_HW_STALLED_CYCLES_FRONTEND: ++ case PERF_COUNT_HW_STALLED_CYCLES_BACKEND: ++ case PERF_COUNT_HW_REF_CPU_CYCLES: ++ factor = 500000000; ++ break; ++ case PERF_COUNT_HW_BRANCH_INSTRUCTIONS: ++ case PERF_COUNT_HW_BRANCH_MISSES: ++ factor = 125000000; ++ break; ++ case PERF_COUNT_HW_CACHE_REFERENCES: ++ case PERF_COUNT_HW_CACHE_MISSES: ++ factor = 25000000; ++ break; ++ default: ++ goto end; ++ } ++ } ++ ++ if (type == PERF_TYPE_HW_CACHE) ++ factor = 25000000; ++end: ++ /* ++ * Usually, a prime or a number with less factors (close to prime) ++ * is chosen as an SAV, which makes it less likely that the sampling ++ * period synchronizes with some periodic event in the workload. ++ * Minus 1 to make it at least avoiding values near power of twos ++ * for the default freq. ++ */ ++ start = DIV_ROUND_UP_ULL(factor, event->attr.sample_freq) - 1; ++ ++ if (start > x86_pmu.max_period) ++ start = x86_pmu.max_period; ++ ++ if (x86_pmu.limit_period) ++ x86_pmu.limit_period(event, &start); ++ ++ return start; ++} ++ + static int intel_pmu_hw_config(struct perf_event *event) + { + int ret = x86_pmu_hw_config(event); +@@ -3960,6 +4039,12 @@ static int intel_pmu_hw_config(struct perf_event *event) + if (ret) + return ret; + ++ if (event->attr.freq && event->attr.sample_freq) { ++ event->hw.sample_period = intel_pmu_freq_start_period(event); ++ event->hw.last_period = event->hw.sample_period; ++ local64_set(&event->hw.period_left, event->hw.sample_period); ++ } ++ + if (event->attr.precise_ip) { + if ((event->attr.config & INTEL_ARCH_EVENT_MASK) == INTEL_FIXED_VLBR_EVENT) + return -EINVAL; +-- +2.39.5 + diff --git a/queue-6.13/perf-x86-rapl-add-support-for-intel-arrow-lake-u.patch b/queue-6.13/perf-x86-rapl-add-support-for-intel-arrow-lake-u.patch new file mode 100644 index 0000000000..7c16678464 --- /dev/null +++ b/queue-6.13/perf-x86-rapl-add-support-for-intel-arrow-lake-u.patch @@ -0,0 +1,53 @@ +From adaecb8e5b4f2359a7e8c081251463e1db145f93 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 24 Dec 2024 22:55:16 +0800 +Subject: perf/x86/rapl: Add support for Intel Arrow Lake U + +From: Aaron Ma + +[ Upstream commit 68a9b0e313302451468c0b0eda53c383fa51a8f4 ] + +Add Arrow Lake U model for RAPL: + + $ ls -1 /sys/devices/power/events/ + energy-cores + energy-cores.scale + energy-cores.unit + energy-gpu + energy-gpu.scale + energy-gpu.unit + energy-pkg + energy-pkg.scale + energy-pkg.unit + energy-psys + energy-psys.scale + energy-psys.unit + +The same output as ArrowLake: + + $ perf stat -a -I 1000 --per-socket -e power/energy-pkg/ + +Signed-off-by: Aaron Ma +Signed-off-by: Ingo Molnar +Acked-by: Zhang Rui +Link: https://lore.kernel.org/r/20241224145516.349028-1-aaron.ma@canonical.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/rapl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c +index a8defc813c369..7e493963d0576 100644 +--- a/arch/x86/events/rapl.c ++++ b/arch/x86/events/rapl.c +@@ -796,6 +796,7 @@ static const struct x86_cpu_id rapl_model_match[] __initconst = { + X86_MATCH_VFM(INTEL_METEORLAKE_L, &model_skl), + X86_MATCH_VFM(INTEL_ARROWLAKE_H, &model_skl), + X86_MATCH_VFM(INTEL_ARROWLAKE, &model_skl), ++ X86_MATCH_VFM(INTEL_ARROWLAKE_U, &model_skl), + X86_MATCH_VFM(INTEL_LUNARLAKE_M, &model_skl), + {}, + }; +-- +2.39.5 + diff --git a/queue-6.13/phy-ti-gmii-sel-do-not-use-syscon-helper-to-build-re.patch b/queue-6.13/phy-ti-gmii-sel-do-not-use-syscon-helper-to-build-re.patch new file mode 100644 index 0000000000..56aff50277 --- /dev/null +++ b/queue-6.13/phy-ti-gmii-sel-do-not-use-syscon-helper-to-build-re.patch @@ -0,0 +1,65 @@ +From 4518f0d035ab90000adfc29cb0ebd2b55612cb1e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2025 12:22:34 -0600 +Subject: phy: ti: gmii-sel: Do not use syscon helper to build regmap + +From: Andrew Davis + +[ Upstream commit 5ab90f40121a9f6a9b368274cd92d0f435dc7cfa ] + +The syscon helper device_node_to_regmap() is used to fetch a regmap +registered to a device node. It also currently creates this regmap +if the node did not already have a regmap associated with it. This +should only be used on "syscon" nodes. This driver is not such a +device and instead uses device_node_to_regmap() on its own node as +a hacky way to create a regmap for itself. + +This will not work going forward and so we should create our regmap +the normal way by defining our regmap_config, fetching our memory +resource, then using the normal regmap_init_mmio() function. + +Signed-off-by: Andrew Davis +Tested-by: Nishanth Menon +Link: https://lore.kernel.org/r/20250123182234.597665-1-afd@ti.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/phy/ti/phy-gmii-sel.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c +index e0ca59ae31531..ff5d5e29629fa 100644 +--- a/drivers/phy/ti/phy-gmii-sel.c ++++ b/drivers/phy/ti/phy-gmii-sel.c +@@ -424,6 +424,12 @@ static int phy_gmii_sel_init_ports(struct phy_gmii_sel_priv *priv) + return 0; + } + ++static const struct regmap_config phy_gmii_sel_regmap_cfg = { ++ .reg_bits = 32, ++ .val_bits = 32, ++ .reg_stride = 4, ++}; ++ + static int phy_gmii_sel_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; +@@ -468,7 +474,14 @@ static int phy_gmii_sel_probe(struct platform_device *pdev) + + priv->regmap = syscon_node_to_regmap(node->parent); + if (IS_ERR(priv->regmap)) { +- priv->regmap = device_node_to_regmap(node); ++ void __iomem *base; ++ ++ base = devm_platform_ioremap_resource(pdev, 0); ++ if (IS_ERR(base)) ++ return dev_err_probe(dev, PTR_ERR(base), ++ "failed to get base memory resource\n"); ++ ++ priv->regmap = regmap_init_mmio(dev, base, &phy_gmii_sel_regmap_cfg); + if (IS_ERR(priv->regmap)) + return dev_err_probe(dev, PTR_ERR(priv->regmap), + "Failed to get syscon\n"); +-- +2.39.5 + diff --git a/queue-6.13/platform-x86-int3472-call-reset-gpio-enable-for-int3.patch b/queue-6.13/platform-x86-int3472-call-reset-gpio-enable-for-int3.patch new file mode 100644 index 0000000000..75b7307473 --- /dev/null +++ b/queue-6.13/platform-x86-int3472-call-reset-gpio-enable-for-int3.patch @@ -0,0 +1,110 @@ +From 8823b95a05671c604fe30e2d4d343c6e5c972a18 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 11 Feb 2025 09:28:40 +0200 +Subject: platform/x86: int3472: Call "reset" GPIO "enable" for INT347E +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Sakari Ailus + +[ Upstream commit 569617dbbd06286fb73f3f1c2ac91e51d863c7de ] + +The DT bindings for ov7251 specify "enable" GPIO (xshutdown in +documentation) but the int3472 indiscriminately provides this as a "reset" +GPIO to sensor drivers. Take this into account by assigning it as "enable" +with active high polarity for INT347E devices, i.e. ov7251. "reset" with +active low polarity remains the default GPIO name for other devices. + +Signed-off-by: Sakari Ailus +Reviewed-by: Hans de Goede +Reviewed-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20250211072841.7713-3-sakari.ailus@linux.intel.com +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/intel/int3472/discrete.c | 52 +++++++++++++++++-- + 1 file changed, 48 insertions(+), 4 deletions(-) + +diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c +index 8205993d3b5c4..a80c981caa340 100644 +--- a/drivers/platform/x86/intel/int3472/discrete.c ++++ b/drivers/platform/x86/intel/int3472/discrete.c +@@ -2,6 +2,7 @@ + /* Author: Dan Scally */ + + #include ++#include + #include + #include + #include +@@ -122,10 +123,53 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472, + return desc; + } + +-static void int3472_get_func_and_polarity(u8 type, const char **func, +- unsigned long *gpio_flags) ++/** ++ * struct int3472_gpio_map - Map GPIOs to whatever is expected by the ++ * sensor driver (as in DT bindings) ++ * @hid: The ACPI HID of the device without the instance number e.g. INT347E ++ * @type_from: The GPIO type from ACPI ?SDT ++ * @type_to: The assigned GPIO type, typically same as @type_from ++ * @func: The function, e.g. "enable" ++ * @polarity_low: GPIO_ACTIVE_LOW true if the @polarity_low is true, ++ * GPIO_ACTIVE_HIGH otherwise ++ */ ++struct int3472_gpio_map { ++ const char *hid; ++ u8 type_from; ++ u8 type_to; ++ bool polarity_low; ++ const char *func; ++}; ++ ++static const struct int3472_gpio_map int3472_gpio_map[] = { ++ { "INT347E", INT3472_GPIO_TYPE_RESET, INT3472_GPIO_TYPE_RESET, false, "enable" }, ++}; ++ ++static void int3472_get_func_and_polarity(struct acpi_device *adev, u8 *type, ++ const char **func, unsigned long *gpio_flags) + { +- switch (type) { ++ unsigned int i; ++ ++ for (i = 0; i < ARRAY_SIZE(int3472_gpio_map); i++) { ++ /* ++ * Map the firmware-provided GPIO to whatever a driver expects ++ * (as in DT bindings). First check if the type matches with the ++ * GPIO map, then further check that the device _HID matches. ++ */ ++ if (*type != int3472_gpio_map[i].type_from) ++ continue; ++ ++ if (!acpi_dev_hid_uid_match(adev, int3472_gpio_map[i].hid, NULL)) ++ continue; ++ ++ *type = int3472_gpio_map[i].type_to; ++ *gpio_flags = int3472_gpio_map[i].polarity_low ? ++ GPIO_ACTIVE_LOW : GPIO_ACTIVE_HIGH; ++ *func = int3472_gpio_map[i].func; ++ return; ++ } ++ ++ switch (*type) { + case INT3472_GPIO_TYPE_RESET: + *func = "reset"; + *gpio_flags = GPIO_ACTIVE_LOW; +@@ -218,7 +262,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, + + type = FIELD_GET(INT3472_GPIO_DSM_TYPE, obj->integer.value); + +- int3472_get_func_and_polarity(type, &func, &gpio_flags); ++ int3472_get_func_and_polarity(int3472->sensor, &type, &func, &gpio_flags); + + pin = FIELD_GET(INT3472_GPIO_DSM_PIN, obj->integer.value); + if (pin != agpio->pin_table[0]) +-- +2.39.5 + diff --git a/queue-6.13/platform-x86-int3472-use-correct-type-for-polarity-c.patch b/queue-6.13/platform-x86-int3472-use-correct-type-for-polarity-c.patch new file mode 100644 index 0000000000..811c1844a9 --- /dev/null +++ b/queue-6.13/platform-x86-int3472-use-correct-type-for-polarity-c.patch @@ -0,0 +1,176 @@ +From 5821e28aac0332b140988c33abfff118daf9cee2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 11 Feb 2025 09:28:39 +0200 +Subject: platform/x86: int3472: Use correct type for "polarity", call it + gpio_flags +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Sakari Ailus + +[ Upstream commit fc22b06fbd2afefa1eddff69a6fd30c539cef577 ] + +Struct gpiod_lookup flags field's type is unsigned long. Thus use unsigned +long for values to be assigned to that field. Similarly, also call the +field gpio_flags which it really is. + +Signed-off-by: Sakari Ailus +Reviewed-by: Hans de Goede +Reviewed-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20250211072841.7713-2-sakari.ailus@linux.intel.com +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/intel/int3472/discrete.c | 39 ++++++++++--------- + 1 file changed, 20 insertions(+), 19 deletions(-) + +diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c +index 09fff213b0911..8205993d3b5c4 100644 +--- a/drivers/platform/x86/intel/int3472/discrete.c ++++ b/drivers/platform/x86/intel/int3472/discrete.c +@@ -55,7 +55,7 @@ static void skl_int3472_log_sensor_module_name(struct int3472_discrete_device *i + + static int skl_int3472_fill_gpiod_lookup(struct gpiod_lookup *table_entry, + struct acpi_resource_gpio *agpio, +- const char *func, u32 polarity) ++ const char *func, unsigned long gpio_flags) + { + char *path = agpio->resource_source.string_ptr; + struct acpi_device *adev; +@@ -70,14 +70,14 @@ static int skl_int3472_fill_gpiod_lookup(struct gpiod_lookup *table_entry, + if (!adev) + return -ENODEV; + +- *table_entry = GPIO_LOOKUP(acpi_dev_name(adev), agpio->pin_table[0], func, polarity); ++ *table_entry = GPIO_LOOKUP(acpi_dev_name(adev), agpio->pin_table[0], func, gpio_flags); + + return 0; + } + + static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int3472, + struct acpi_resource_gpio *agpio, +- const char *func, u32 polarity) ++ const char *func, unsigned long gpio_flags) + { + int ret; + +@@ -87,7 +87,7 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347 + } + + ret = skl_int3472_fill_gpiod_lookup(&int3472->gpios.table[int3472->n_sensor_gpios], +- agpio, func, polarity); ++ agpio, func, gpio_flags); + if (ret) + return ret; + +@@ -100,7 +100,7 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347 + static struct gpio_desc * + skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472, + struct acpi_resource_gpio *agpio, +- const char *func, u32 polarity) ++ const char *func, unsigned long gpio_flags) + { + struct gpio_desc *desc; + int ret; +@@ -111,7 +111,7 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472, + return ERR_PTR(-ENOMEM); + + lookup->dev_id = dev_name(int3472->dev); +- ret = skl_int3472_fill_gpiod_lookup(&lookup->table[0], agpio, func, polarity); ++ ret = skl_int3472_fill_gpiod_lookup(&lookup->table[0], agpio, func, gpio_flags); + if (ret) + return ERR_PTR(ret); + +@@ -122,32 +122,33 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472, + return desc; + } + +-static void int3472_get_func_and_polarity(u8 type, const char **func, u32 *polarity) ++static void int3472_get_func_and_polarity(u8 type, const char **func, ++ unsigned long *gpio_flags) + { + switch (type) { + case INT3472_GPIO_TYPE_RESET: + *func = "reset"; +- *polarity = GPIO_ACTIVE_LOW; ++ *gpio_flags = GPIO_ACTIVE_LOW; + break; + case INT3472_GPIO_TYPE_POWERDOWN: + *func = "powerdown"; +- *polarity = GPIO_ACTIVE_LOW; ++ *gpio_flags = GPIO_ACTIVE_LOW; + break; + case INT3472_GPIO_TYPE_CLK_ENABLE: + *func = "clk-enable"; +- *polarity = GPIO_ACTIVE_HIGH; ++ *gpio_flags = GPIO_ACTIVE_HIGH; + break; + case INT3472_GPIO_TYPE_PRIVACY_LED: + *func = "privacy-led"; +- *polarity = GPIO_ACTIVE_HIGH; ++ *gpio_flags = GPIO_ACTIVE_HIGH; + break; + case INT3472_GPIO_TYPE_POWER_ENABLE: + *func = "power-enable"; +- *polarity = GPIO_ACTIVE_HIGH; ++ *gpio_flags = GPIO_ACTIVE_HIGH; + break; + default: + *func = "unknown"; +- *polarity = GPIO_ACTIVE_HIGH; ++ *gpio_flags = GPIO_ACTIVE_HIGH; + break; + } + } +@@ -194,7 +195,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, + struct gpio_desc *gpio; + const char *err_msg; + const char *func; +- u32 polarity; ++ unsigned long gpio_flags; + int ret; + + if (!acpi_gpio_get_io_resource(ares, &agpio)) +@@ -217,7 +218,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, + + type = FIELD_GET(INT3472_GPIO_DSM_TYPE, obj->integer.value); + +- int3472_get_func_and_polarity(type, &func, &polarity); ++ int3472_get_func_and_polarity(type, &func, &gpio_flags); + + pin = FIELD_GET(INT3472_GPIO_DSM_PIN, obj->integer.value); + if (pin != agpio->pin_table[0]) +@@ -227,16 +228,16 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, + + active_value = FIELD_GET(INT3472_GPIO_DSM_SENSOR_ON_VAL, obj->integer.value); + if (!active_value) +- polarity ^= GPIO_ACTIVE_LOW; ++ gpio_flags ^= GPIO_ACTIVE_LOW; + + dev_dbg(int3472->dev, "%s %s pin %d active-%s\n", func, + agpio->resource_source.string_ptr, agpio->pin_table[0], +- str_high_low(polarity == GPIO_ACTIVE_HIGH)); ++ str_high_low(gpio_flags == GPIO_ACTIVE_HIGH)); + + switch (type) { + case INT3472_GPIO_TYPE_RESET: + case INT3472_GPIO_TYPE_POWERDOWN: +- ret = skl_int3472_map_gpio_to_sensor(int3472, agpio, func, polarity); ++ ret = skl_int3472_map_gpio_to_sensor(int3472, agpio, func, gpio_flags); + if (ret) + err_msg = "Failed to map GPIO pin to sensor\n"; + +@@ -244,7 +245,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, + case INT3472_GPIO_TYPE_CLK_ENABLE: + case INT3472_GPIO_TYPE_PRIVACY_LED: + case INT3472_GPIO_TYPE_POWER_ENABLE: +- gpio = skl_int3472_gpiod_get_from_temp_lookup(int3472, agpio, func, polarity); ++ gpio = skl_int3472_gpiod_get_from_temp_lookup(int3472, agpio, func, gpio_flags); + if (IS_ERR(gpio)) { + ret = PTR_ERR(gpio); + err_msg = "Failed to get GPIO\n"; +-- +2.39.5 + diff --git a/queue-6.13/platform-x86-intel-pmc-fix-ltr-decode-in-pmc_core_lt.patch b/queue-6.13/platform-x86-intel-pmc-fix-ltr-decode-in-pmc_core_lt.patch new file mode 100644 index 0000000000..b1f19afc3c --- /dev/null +++ b/queue-6.13/platform-x86-intel-pmc-fix-ltr-decode-in-pmc_core_lt.patch @@ -0,0 +1,47 @@ +From c764fb1fdd8f6ad5ab6134c7155e6252d6c331f9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 24 Jan 2025 01:07:39 +0300 +Subject: platform/x86/intel: pmc: fix ltr decode in pmc_core_ltr_show() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Dmitry Kandybka + +[ Upstream commit 583ef25bb2a094813351a727ddec38b35a15b9f8 ] + +In pmc_core_ltr_show(), promote 'val' to 'u64' to avoid possible integer +overflow. Values (10 bit) are multiplied by the scale, the result of +expression is in a range from 1 to 34,326,183,936 which is bigger then +UINT32_MAX. Compile tested only. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Signed-off-by: Dmitry Kandybka +Reviewed-by: Rajneesh Bhardwaj +Reviewed-by: Ilpo Järvinen +Link: https://lore.kernel.org/r/20250123220739.68087-1-d.kandybka@gmail.com +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/intel/pmc/core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c +index 3e7f99ac8c941..c5dae640a0b2b 100644 +--- a/drivers/platform/x86/intel/pmc/core.c ++++ b/drivers/platform/x86/intel/pmc/core.c +@@ -625,8 +625,8 @@ static u32 convert_ltr_scale(u32 val) + static int pmc_core_ltr_show(struct seq_file *s, void *unused) + { + struct pmc_dev *pmcdev = s->private; +- u64 decoded_snoop_ltr, decoded_non_snoop_ltr; +- u32 ltr_raw_data, scale, val; ++ u64 decoded_snoop_ltr, decoded_non_snoop_ltr, val; ++ u32 ltr_raw_data, scale; + u16 snoop_ltr, nonsnoop_ltr; + unsigned int i, index, ltr_index = 0; + +-- +2.39.5 + diff --git a/queue-6.13/platform-x86-thinkpad_acpi-fix-invalid-fan-speed-on-.patch b/queue-6.13/platform-x86-thinkpad_acpi-fix-invalid-fan-speed-on-.patch new file mode 100644 index 0000000000..6810df6fd3 --- /dev/null +++ b/queue-6.13/platform-x86-thinkpad_acpi-fix-invalid-fan-speed-on-.patch @@ -0,0 +1,106 @@ +From 2f1059f505b683121789743bd3c94edc629cfd7d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 3 Feb 2025 16:33:15 +0000 +Subject: platform/x86: thinkpad_acpi: Fix invalid fan speed on ThinkPad X120e +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Sybil Isabel Dorsett + +[ Upstream commit 1046cac109225eda0973b898e053aeb3d6c10e1d ] + +On ThinkPad X120e, fan speed is reported in ticks per revolution +rather than RPM. + +Recalculate the fan speed value reported for ThinkPad X120e +to RPM based on a 22.5 kHz clock. + +Based on the information on +https://www.thinkwiki.org/wiki/How_to_control_fan_speed, +the same problem is highly likely to be relevant to at least Edge11, +but Edge11 is not addressed in this patch. + +Signed-off-by: Sybil Isabel Dorsett +Reviewed-by: Ilpo Järvinen +Link: https://lore.kernel.org/r/20250203163255.5525-1-sybdorsett@proton.me +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/thinkpad_acpi.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index 84dcd7da7319e..21fecdf35cd0d 100644 +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -7883,6 +7883,7 @@ static struct ibm_struct volume_driver_data = { + + #define FAN_NS_CTRL_STATUS BIT(2) /* Bit which determines control is enabled or not */ + #define FAN_NS_CTRL BIT(4) /* Bit which determines control is by host or EC */ ++#define FAN_CLOCK_TPM (22500*60) /* Ticks per minute for a 22.5 kHz clock */ + + enum { /* Fan control constants */ + fan_status_offset = 0x2f, /* EC register 0x2f */ +@@ -7938,6 +7939,7 @@ static int fan_watchdog_maxinterval; + + static bool fan_with_ns_addr; + static bool ecfw_with_fan_dec_rpm; ++static bool fan_speed_in_tpr; + + static struct mutex fan_mutex; + +@@ -8140,8 +8142,11 @@ static int fan_get_speed(unsigned int *speed) + !acpi_ec_read(fan_rpm_offset + 1, &hi))) + return -EIO; + +- if (likely(speed)) ++ if (likely(speed)) { + *speed = (hi << 8) | lo; ++ if (fan_speed_in_tpr && *speed != 0) ++ *speed = FAN_CLOCK_TPM / *speed; ++ } + break; + case TPACPI_FAN_RD_TPEC_NS: + if (!acpi_ec_read(fan_rpm_status_ns, &lo)) +@@ -8174,8 +8179,11 @@ static int fan2_get_speed(unsigned int *speed) + if (rc) + return -EIO; + +- if (likely(speed)) ++ if (likely(speed)) { + *speed = (hi << 8) | lo; ++ if (fan_speed_in_tpr && *speed != 0) ++ *speed = FAN_CLOCK_TPM / *speed; ++ } + break; + + case TPACPI_FAN_RD_TPEC_NS: +@@ -8786,6 +8794,7 @@ static const struct attribute_group fan_driver_attr_group = { + #define TPACPI_FAN_NOFAN 0x0008 /* no fan available */ + #define TPACPI_FAN_NS 0x0010 /* For EC with non-Standard register addresses */ + #define TPACPI_FAN_DECRPM 0x0020 /* For ECFW's with RPM in register as decimal */ ++#define TPACPI_FAN_TPR 0x0040 /* Fan speed is in Ticks Per Revolution */ + + static const struct tpacpi_quirk fan_quirk_table[] __initconst = { + TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1), +@@ -8815,6 +8824,7 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = { + TPACPI_Q_LNV3('R', '0', 'V', TPACPI_FAN_NS), /* 11e Gen5 KL-Y */ + TPACPI_Q_LNV3('N', '1', 'O', TPACPI_FAN_NOFAN), /* X1 Tablet (2nd gen) */ + TPACPI_Q_LNV3('R', '0', 'Q', TPACPI_FAN_DECRPM),/* L480 */ ++ TPACPI_Q_LNV('8', 'F', TPACPI_FAN_TPR), /* ThinkPad x120e */ + }; + + static int __init fan_init(struct ibm_init_struct *iibm) +@@ -8885,6 +8895,8 @@ static int __init fan_init(struct ibm_init_struct *iibm) + + if (quirks & TPACPI_FAN_Q1) + fan_quirk1_setup(); ++ if (quirks & TPACPI_FAN_TPR) ++ fan_speed_in_tpr = true; + /* Try and probe the 2nd fan */ + tp_features.second_fan = 1; /* needed for get_speed to work */ + res = fan2_get_speed(&speed); +-- +2.39.5 + diff --git a/queue-6.13/platform-x86-thinkpad_acpi-support-for-v9-dytc-platf.patch b/queue-6.13/platform-x86-thinkpad_acpi-support-for-v9-dytc-platf.patch new file mode 100644 index 0000000000..47601c1b6d --- /dev/null +++ b/queue-6.13/platform-x86-thinkpad_acpi-support-for-v9-dytc-platf.patch @@ -0,0 +1,122 @@ +From 7d90b9105248cfe5b978441a5b38e2f507220fbf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 6 Feb 2025 14:39:41 -0500 +Subject: platform/x86: thinkpad_acpi: Support for V9 DYTC platform profiles +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Mark Pearson + +[ Upstream commit 9cff907cbf8c7fb5345918dbcc7b74a01656f34f ] + +Newer Thinkpad AMD platforms are using V9 DYTC and this changes the +profiles used for PSC mode. Add support for this update. +Tested on P14s G5 AMD + +Signed-off-by: Mark Pearson +Link: https://lore.kernel.org/r/20250206193953.58365-1-mpearson-lenovo@squebb.ca +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/thinkpad_acpi.c | 34 ++++++++++++++++++---------- + 1 file changed, 22 insertions(+), 12 deletions(-) + +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index 21fecdf35cd0d..a3c73abb00f21 100644 +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -10330,6 +10330,10 @@ static struct ibm_struct proxsensor_driver_data = { + #define DYTC_MODE_PSC_BALANCE 5 /* Default mode aka balanced */ + #define DYTC_MODE_PSC_PERFORM 7 /* High power mode aka performance */ + ++#define DYTC_MODE_PSCV9_LOWPOWER 1 /* Low power mode */ ++#define DYTC_MODE_PSCV9_BALANCE 3 /* Default mode aka balanced */ ++#define DYTC_MODE_PSCV9_PERFORM 4 /* High power mode aka performance */ ++ + #define DYTC_ERR_MASK 0xF /* Bits 0-3 in cmd result are the error result */ + #define DYTC_ERR_SUCCESS 1 /* CMD completed successful */ + +@@ -10350,6 +10354,10 @@ static int dytc_capabilities; + static bool dytc_mmc_get_available; + static int profile_force; + ++static int platform_psc_profile_lowpower = DYTC_MODE_PSC_LOWPOWER; ++static int platform_psc_profile_balanced = DYTC_MODE_PSC_BALANCE; ++static int platform_psc_profile_performance = DYTC_MODE_PSC_PERFORM; ++ + static int convert_dytc_to_profile(int funcmode, int dytcmode, + enum platform_profile_option *profile) + { +@@ -10371,19 +10379,15 @@ static int convert_dytc_to_profile(int funcmode, int dytcmode, + } + return 0; + case DYTC_FUNCTION_PSC: +- switch (dytcmode) { +- case DYTC_MODE_PSC_LOWPOWER: ++ if (dytcmode == platform_psc_profile_lowpower) + *profile = PLATFORM_PROFILE_LOW_POWER; +- break; +- case DYTC_MODE_PSC_BALANCE: ++ else if (dytcmode == platform_psc_profile_balanced) + *profile = PLATFORM_PROFILE_BALANCED; +- break; +- case DYTC_MODE_PSC_PERFORM: ++ else if (dytcmode == platform_psc_profile_performance) + *profile = PLATFORM_PROFILE_PERFORMANCE; +- break; +- default: /* Unknown mode */ ++ else + return -EINVAL; +- } ++ + return 0; + case DYTC_FUNCTION_AMT: + /* For now return balanced. It's the closest we have to 'auto' */ +@@ -10404,19 +10408,19 @@ static int convert_profile_to_dytc(enum platform_profile_option profile, int *pe + if (dytc_capabilities & BIT(DYTC_FC_MMC)) + *perfmode = DYTC_MODE_MMC_LOWPOWER; + else if (dytc_capabilities & BIT(DYTC_FC_PSC)) +- *perfmode = DYTC_MODE_PSC_LOWPOWER; ++ *perfmode = platform_psc_profile_lowpower; + break; + case PLATFORM_PROFILE_BALANCED: + if (dytc_capabilities & BIT(DYTC_FC_MMC)) + *perfmode = DYTC_MODE_MMC_BALANCE; + else if (dytc_capabilities & BIT(DYTC_FC_PSC)) +- *perfmode = DYTC_MODE_PSC_BALANCE; ++ *perfmode = platform_psc_profile_balanced; + break; + case PLATFORM_PROFILE_PERFORMANCE: + if (dytc_capabilities & BIT(DYTC_FC_MMC)) + *perfmode = DYTC_MODE_MMC_PERFORM; + else if (dytc_capabilities & BIT(DYTC_FC_PSC)) +- *perfmode = DYTC_MODE_PSC_PERFORM; ++ *perfmode = platform_psc_profile_performance; + break; + default: /* Unknown profile */ + return -EOPNOTSUPP; +@@ -10605,6 +10609,7 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) + if (output & BIT(DYTC_QUERY_ENABLE_BIT)) + dytc_version = (output >> DYTC_QUERY_REV_BIT) & 0xF; + ++ dbg_printk(TPACPI_DBG_INIT, "DYTC version %d\n", dytc_version); + /* Check DYTC is enabled and supports mode setting */ + if (dytc_version < 5) + return -ENODEV; +@@ -10643,6 +10648,11 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) + } + } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */ + pr_debug("PSC is supported\n"); ++ if (dytc_version >= 9) { /* update profiles for DYTC 9 and up */ ++ platform_psc_profile_lowpower = DYTC_MODE_PSCV9_LOWPOWER; ++ platform_psc_profile_balanced = DYTC_MODE_PSCV9_BALANCE; ++ platform_psc_profile_performance = DYTC_MODE_PSCV9_PERFORM; ++ } + } else { + dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n"); + return -ENODEV; +-- +2.39.5 + diff --git a/queue-6.13/powercap-call-put_device-on-an-error-path-in-powerca.patch b/queue-6.13/powercap-call-put_device-on-an-error-path-in-powerca.patch new file mode 100644 index 0000000000..1c9d6bcae2 --- /dev/null +++ b/queue-6.13/powercap-call-put_device-on-an-error-path-in-powerca.patch @@ -0,0 +1,46 @@ +From 0d89a5a8e4c3b1e4e646778e818962af37224d73 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 10 Jan 2025 10:05:54 +0900 +Subject: powercap: call put_device() on an error path in + powercap_register_control_type() + +From: Joe Hattori + +[ Upstream commit 93c66fbc280747ea700bd6199633d661e3c819b3 ] + +powercap_register_control_type() calls device_register(), but does not +release the refcount of the device when it fails. + +Call put_device() before returning an error to balance the refcount. + +Since the kfree(control_type) will be done by powercap_release(), remove +the lines in powercap_register_control_type() before returning the error. + +This bug was found by an experimental verifier that I am developing. + +Signed-off-by: Joe Hattori +Link: https://patch.msgid.link/20250110010554.1583411-1-joe@pf.is.s.u-tokyo.ac.jp +[ rjw: Changelog edits ] +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + drivers/powercap/powercap_sys.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c +index 52c32dcbf7d84..4112a00973382 100644 +--- a/drivers/powercap/powercap_sys.c ++++ b/drivers/powercap/powercap_sys.c +@@ -627,8 +627,7 @@ struct powercap_control_type *powercap_register_control_type( + dev_set_name(&control_type->dev, "%s", name); + result = device_register(&control_type->dev); + if (result) { +- if (control_type->allocated) +- kfree(control_type); ++ put_device(&control_type->dev); + return ERR_PTR(result); + } + idr_init(&control_type->idr); +-- +2.39.5 + diff --git a/queue-6.13/s390-cio-fix-chpid-configure-attribute-caching.patch b/queue-6.13/s390-cio-fix-chpid-configure-attribute-caching.patch new file mode 100644 index 0000000000..75d8796cf8 --- /dev/null +++ b/queue-6.13/s390-cio-fix-chpid-configure-attribute-caching.patch @@ -0,0 +1,60 @@ +From 08daf6bd778415e8b61a8d7c8bf48ed0654bf3b7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 31 Jan 2025 12:02:55 +0100 +Subject: s390/cio: Fix CHPID "configure" attribute caching + +From: Peter Oberparleiter + +[ Upstream commit 32ae4a2992529e2c7934e422035fad1d9b0f1fb5 ] + +In some environments, the SCLP firmware interface used to query a +CHPID's configured state is not supported. On these environments, +rapidly reading the corresponding sysfs attribute produces inconsistent +results: + + $ cat /sys/devices/css0/chp0.00/configure + cat: /sys/devices/css0/chp0.00/configure: Operation not supported + $ cat /sys/devices/css0/chp0.00/configure + 3 + +This occurs for example when Linux is run as a KVM guest. The +inconsistency is a result of CIO using cached results for generating +the value of the "configure" attribute while failing to handle the +situation where no data was returned by SCLP. + +Fix this by not updating the cache-expiration timestamp when SCLP +returns no data. With the fix applied, the system response is +consistent: + + $ cat /sys/devices/css0/chp0.00/configure + cat: /sys/devices/css0/chp0.00/configure: Operation not supported + $ cat /sys/devices/css0/chp0.00/configure + cat: /sys/devices/css0/chp0.00/configure: Operation not supported + +Reviewed-by: Vineeth Vijayan +Reviewed-by: Eric Farman +Tested-by: Eric Farman +Signed-off-by: Peter Oberparleiter +Signed-off-by: Vasily Gorbik +Signed-off-by: Sasha Levin +--- + drivers/s390/cio/chp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c +index cba2d048a96b3..7855d88a49d85 100644 +--- a/drivers/s390/cio/chp.c ++++ b/drivers/s390/cio/chp.c +@@ -695,7 +695,8 @@ static int info_update(void) + if (time_after(jiffies, chp_info_expires)) { + /* Data is too old, update. */ + rc = sclp_chp_read_info(&chp_info); +- chp_info_expires = jiffies + CHP_INFO_UPDATE_INTERVAL ; ++ if (!rc) ++ chp_info_expires = jiffies + CHP_INFO_UPDATE_INTERVAL; + } + mutex_unlock(&info_lock); + +-- +2.39.5 + diff --git a/queue-6.13/sched-clarify-wake_up_q-s-write-to-task-wake_q.next.patch b/queue-6.13/sched-clarify-wake_up_q-s-write-to-task-wake_q.next.patch new file mode 100644 index 0000000000..1d2614fb87 --- /dev/null +++ b/queue-6.13/sched-clarify-wake_up_q-s-write-to-task-wake_q.next.patch @@ -0,0 +1,41 @@ +From 8f693ba9f1c5c99d75a774455f8fc6575d4b47a9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Jan 2025 20:53:03 +0100 +Subject: sched: Clarify wake_up_q()'s write to task->wake_q.next + +From: Jann Horn + +[ Upstream commit bcc6244e13b4d4903511a1ea84368abf925031c0 ] + +Clarify that wake_up_q() does an atomic write to task->wake_q.next, after +which a concurrent __wake_q_add() can immediately overwrite +task->wake_q.next again. + +Signed-off-by: Jann Horn +Signed-off-by: Peter Zijlstra (Intel) +Link: https://lkml.kernel.org/r/20250129-sched-wakeup-prettier-v1-1-2f51f5f663fa@google.com +Signed-off-by: Sasha Levin +--- + kernel/sched/core.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 86cb6db081680..4b5878b2fdd02 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -1057,9 +1057,10 @@ void wake_up_q(struct wake_q_head *head) + struct task_struct *task; + + task = container_of(node, struct task_struct, wake_q); +- /* Task can safely be re-inserted now: */ + node = node->next; +- task->wake_q.next = NULL; ++ /* pairs with cmpxchg_relaxed() in __wake_q_add() */ ++ WRITE_ONCE(task->wake_q.next, NULL); ++ /* Task can safely be re-inserted now. */ + + /* + * wake_up_process() executes a full barrier, which pairs with +-- +2.39.5 + diff --git a/queue-6.13/sched-debug-provide-slice-length-for-fair-tasks.patch b/queue-6.13/sched-debug-provide-slice-length-for-fair-tasks.patch new file mode 100644 index 0000000000..014e81eff4 --- /dev/null +++ b/queue-6.13/sched-debug-provide-slice-length-for-fair-tasks.patch @@ -0,0 +1,44 @@ +From 213a964105ed146953a7ddc8277aeef92320224c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Jan 2025 17:59:44 +0000 +Subject: sched/debug: Provide slice length for fair tasks + +From: Christian Loehle + +[ Upstream commit 9065ce69754dece78606c8bbb3821449272e56bf ] + +Since commit: + + 857b158dc5e8 ("sched/eevdf: Use sched_attr::sched_runtime to set request/slice suggestion") + +... we have the userspace per-task tunable slice length, which is +a key parameter that is otherwise difficult to obtain, so provide +it in /proc/$PID/sched. + +[ mingo: Clarified the changelog. ] + +Signed-off-by: Christian Loehle +Signed-off-by: Ingo Molnar +Cc: Peter Zijlstra +Link: https://lore.kernel.org/r/453349b1-1637-42f5-a7b2-2385392b5956@arm.com +Signed-off-by: Sasha Levin +--- + kernel/sched/debug.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c +index a1be00a988bf6..5b32d3cc393bf 100644 +--- a/kernel/sched/debug.c ++++ b/kernel/sched/debug.c +@@ -1265,6 +1265,8 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, + if (task_has_dl_policy(p)) { + P(dl.runtime); + P(dl.deadline); ++ } else if (fair_policy(p->policy)) { ++ P(se.slice); + } + #ifdef CONFIG_SCHED_CLASS_EXT + __PS("ext.enabled", task_on_scx(p)); +-- +2.39.5 + diff --git a/queue-6.13/sched_ext-selftests-dsp_local_on-fix-sporadic-failur.patch b/queue-6.13/sched_ext-selftests-dsp_local_on-fix-sporadic-failur.patch new file mode 100644 index 0000000000..47d63a870e --- /dev/null +++ b/queue-6.13/sched_ext-selftests-dsp_local_on-fix-sporadic-failur.patch @@ -0,0 +1,46 @@ +From cd930169bbbe58e2ba5dec938428012b4372a46f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 24 Jan 2025 10:48:25 -1000 +Subject: sched_ext: selftests/dsp_local_on: Fix sporadic failures + +From: Tejun Heo + +[ Upstream commit e9fe182772dcb2630964724fd93e9c90b68ea0fd ] + +dsp_local_on has several incorrect assumptions, one of which is that +p->nr_cpus_allowed always tracks p->cpus_ptr. This is not true when a task +is scheduled out while migration is disabled - p->cpus_ptr is temporarily +overridden to the previous CPU while p->nr_cpus_allowed remains unchanged. + +This led to sporadic test faliures when dsp_local_on_dispatch() tries to put +a migration disabled task to a different CPU. Fix it by keeping the previous +CPU when migration is disabled. + +There are SCX schedulers that make use of p->nr_cpus_allowed. They should +also implement explicit handling for p->migration_disabled. + +Signed-off-by: Tejun Heo +Reported-by: Ihor Solodrai +Cc: Andrea Righi +Cc: Changwoo Min +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/sched_ext/dsp_local_on.bpf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/testing/selftests/sched_ext/dsp_local_on.bpf.c b/tools/testing/selftests/sched_ext/dsp_local_on.bpf.c +index fbda6bf546712..758b479bd1ee1 100644 +--- a/tools/testing/selftests/sched_ext/dsp_local_on.bpf.c ++++ b/tools/testing/selftests/sched_ext/dsp_local_on.bpf.c +@@ -43,7 +43,7 @@ void BPF_STRUCT_OPS(dsp_local_on_dispatch, s32 cpu, struct task_struct *prev) + if (!p) + return; + +- if (p->nr_cpus_allowed == nr_cpus) ++ if (p->nr_cpus_allowed == nr_cpus && !p->migration_disabled) + target = bpf_get_prandom_u32() % nr_cpus; + else + target = scx_bpf_task_cpu(p); +-- +2.39.5 + diff --git a/queue-6.13/scsi-core-use-gfp_noio-to-avoid-circular-locking-dep.patch b/queue-6.13/scsi-core-use-gfp_noio-to-avoid-circular-locking-dep.patch new file mode 100644 index 0000000000..20c0cb9b58 --- /dev/null +++ b/queue-6.13/scsi-core-use-gfp_noio-to-avoid-circular-locking-dep.patch @@ -0,0 +1,59 @@ +From ec79873ee24fe4c914d2844285f3e851aa5c003d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 28 Jan 2025 16:35:39 -0500 +Subject: scsi: core: Use GFP_NOIO to avoid circular locking dependency +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rik van Riel + +[ Upstream commit 5363ee9d110e139584c2d92a0b640bc210588506 ] + +Filesystems can write to disk from page reclaim with __GFP_FS +set. Marc found a case where scsi_realloc_sdev_budget_map() ends up in +page reclaim with GFP_KERNEL, where it could try to take filesystem +locks again, leading to a deadlock. + +WARNING: possible circular locking dependency detected +6.13.0 #1 Not tainted +------------------------------------------------------ +kswapd0/70 is trying to acquire lock: +ffff8881025d5d78 (&q->q_usage_counter(io)){++++}-{0:0}, at: blk_mq_submit_bio+0x461/0x6e0 + +but task is already holding lock: +ffffffff81ef5f40 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x9f/0x760 + +The full lockdep splat can be found in Marc's report: + +https://lkml.org/lkml/2025/1/24/1101 + +Avoid the potential deadlock by doing the allocation with GFP_NOIO, which +prevents both filesystem and block layer recursion. + +Reported-by: Marc Aurèle La France +Signed-off-by: Rik van Riel +Link: https://lore.kernel.org/r/20250129104525.0ae8421e@fangorn +Reviewed-by: Christoph Hellwig +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/scsi_scan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c +index 042329b74c6e6..fe08af4dcb67c 100644 +--- a/drivers/scsi/scsi_scan.c ++++ b/drivers/scsi/scsi_scan.c +@@ -245,7 +245,7 @@ static int scsi_realloc_sdev_budget_map(struct scsi_device *sdev, + } + ret = sbitmap_init_node(&sdev->budget_map, + scsi_device_max_queue_depth(sdev), +- new_shift, GFP_KERNEL, ++ new_shift, GFP_NOIO, + sdev->request_queue->node, false, true); + if (!ret) + sbitmap_resize(&sdev->budget_map, depth); +-- +2.39.5 + diff --git a/queue-6.13/scsi-qla1280-fix-kernel-oops-when-debug-level-2.patch b/queue-6.13/scsi-qla1280-fix-kernel-oops-when-debug-level-2.patch new file mode 100644 index 0000000000..3ffbcba031 --- /dev/null +++ b/queue-6.13/scsi-qla1280-fix-kernel-oops-when-debug-level-2.patch @@ -0,0 +1,38 @@ +From 9029c38056afcaf0f51b5881d3edd9318aa45d31 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 25 Jan 2025 10:49:22 +0100 +Subject: scsi: qla1280: Fix kernel oops when debug level > 2 + +From: Magnus Lindholm + +[ Upstream commit 5233e3235dec3065ccc632729675575dbe3c6b8a ] + +A null dereference or oops exception will eventually occur when qla1280.c +driver is compiled with DEBUG_QLA1280 enabled and ql_debug_level > 2. I +think its clear from the code that the intention here is sg_dma_len(s) not +length of sg_next(s) when printing the debug info. + +Signed-off-by: Magnus Lindholm +Link: https://lore.kernel.org/r/20250125095033.26188-1-linmag7@gmail.com +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla1280.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c +index 8958547ac111a..fed07b1460702 100644 +--- a/drivers/scsi/qla1280.c ++++ b/drivers/scsi/qla1280.c +@@ -2867,7 +2867,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) + dprintk(3, "S/G Segment phys_addr=%x %x, len=0x%x\n", + cpu_to_le32(upper_32_bits(dma_handle)), + cpu_to_le32(lower_32_bits(dma_handle)), +- cpu_to_le32(sg_dma_len(sg_next(s)))); ++ cpu_to_le32(sg_dma_len(s))); + remseg--; + } + dprintk(5, "qla1280_64bit_start_scsi: Scatter/gather " +-- +2.39.5 + diff --git a/queue-6.13/scsi-ufs-core-fix-error-return-with-query-response.patch b/queue-6.13/scsi-ufs-core-fix-error-return-with-query-response.patch new file mode 100644 index 0000000000..30ae2402c2 --- /dev/null +++ b/queue-6.13/scsi-ufs-core-fix-error-return-with-query-response.patch @@ -0,0 +1,44 @@ +From 1d4bdf38b51696d4fd928564e0f6eaedbbd69b8f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 18 Jan 2025 11:38:08 +0900 +Subject: scsi: ufs: core: Fix error return with query response + +From: Seunghui Lee + +[ Upstream commit 1a78a56ea65252bb089e0daace989167227f2d31 ] + +There is currently no mechanism to return error from query responses. +Return the error and print the corresponding error message with it. + +Signed-off-by: Seunghui Lee +Link: https://lore.kernel.org/r/20250118023808.24726-1-sh043.lee@samsung.com +Reviewed-by: Bean Huo +Reviewed-by: Bart Van Assche +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/ufs/core/ufshcd.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c +index a5bb6ea96460c..96cb294e2ec30 100644 +--- a/drivers/ufs/core/ufshcd.c ++++ b/drivers/ufs/core/ufshcd.c +@@ -3119,8 +3119,13 @@ ufshcd_dev_cmd_completion(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) + case UPIU_TRANSACTION_QUERY_RSP: { + u8 response = lrbp->ucd_rsp_ptr->header.response; + +- if (response == 0) ++ if (response == 0) { + err = ufshcd_copy_query_response(hba, lrbp); ++ } else { ++ err = -EINVAL; ++ dev_err(hba->dev, "%s: unexpected response in Query RSP: %x\n", ++ __func__, response); ++ } + break; + } + case UPIU_TRANSACTION_REJECT_UPIU: +-- +2.39.5 + diff --git a/queue-6.13/sctp-fix-undefined-behavior-in-left-shift-operation.patch b/queue-6.13/sctp-fix-undefined-behavior-in-left-shift-operation.patch new file mode 100644 index 0000000000..5986f45757 --- /dev/null +++ b/queue-6.13/sctp-fix-undefined-behavior-in-left-shift-operation.patch @@ -0,0 +1,43 @@ +From 88bb6ad49d28f966df85fb524b782b347e89ff07 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 18 Feb 2025 16:12:16 +0800 +Subject: sctp: Fix undefined behavior in left shift operation + +From: Yu-Chun Lin + +[ Upstream commit 606572eb22c1786a3957d24307f5760bb058ca19 ] + +According to the C11 standard (ISO/IEC 9899:2011, 6.5.7): +"If E1 has a signed type and E1 x 2^E2 is not representable in the result +type, the behavior is undefined." + +Shifting 1 << 31 causes signed integer overflow, which leads to undefined +behavior. + +Fix this by explicitly using '1U << 31' to ensure the shift operates on +an unsigned type, avoiding undefined behavior. + +Signed-off-by: Yu-Chun Lin +Link: https://patch.msgid.link/20250218081217.3468369-1-eleanor15x@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/sctp/stream.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/sctp/stream.c b/net/sctp/stream.c +index c241cc552e8d5..bfcff6d6a4386 100644 +--- a/net/sctp/stream.c ++++ b/net/sctp/stream.c +@@ -735,7 +735,7 @@ struct sctp_chunk *sctp_process_strreset_tsnreq( + * value SHOULD be the smallest TSN not acknowledged by the + * receiver of the request plus 2^31. + */ +- init_tsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + (1 << 31); ++ init_tsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + (1U << 31); + sctp_tsnmap_init(&asoc->peer.tsn_map, SCTP_TSN_MAP_INITIAL, + init_tsn, GFP_ATOMIC); + +-- +2.39.5 + diff --git a/queue-6.13/selftests-always-check-mask-returned-by-statmount-2.patch b/queue-6.13/selftests-always-check-mask-returned-by-statmount-2.patch new file mode 100644 index 0000000000..dd7f07ff91 --- /dev/null +++ b/queue-6.13/selftests-always-check-mask-returned-by-statmount-2.patch @@ -0,0 +1,88 @@ +From 7d76b5c66879d8233cc03bef549dbff800b603c7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Jan 2025 17:06:41 +0100 +Subject: selftests: always check mask returned by statmount(2) + +From: Miklos Szeredi + +[ Upstream commit 2cc02059fbc79306b53a44b1f1a4444aa3c76598 ] + +STATMOUNT_MNT_OPTS can actually be missing if there are no options. This +is a change of behavior since 75ead69a7173 ("fs: don't let statmount return +empty strings"). + +The other checks shouldn't actually trigger, but add them for correctness +and for easier debugging if the test fails. + +Signed-off-by: Miklos Szeredi +Link: https://lore.kernel.org/r/20250129160641.35485-1-mszeredi@redhat.com +Signed-off-by: Christian Brauner +Signed-off-by: Sasha Levin +--- + .../filesystems/statmount/statmount_test.c | 22 ++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/tools/testing/selftests/filesystems/statmount/statmount_test.c b/tools/testing/selftests/filesystems/statmount/statmount_test.c +index 8eb6aa606a0d5..46d289611ce86 100644 +--- a/tools/testing/selftests/filesystems/statmount/statmount_test.c ++++ b/tools/testing/selftests/filesystems/statmount/statmount_test.c +@@ -383,6 +383,10 @@ static void test_statmount_mnt_point(void) + return; + } + ++ if (!(sm->mask & STATMOUNT_MNT_POINT)) { ++ ksft_test_result_fail("missing STATMOUNT_MNT_POINT in mask\n"); ++ return; ++ } + if (strcmp(sm->str + sm->mnt_point, "/") != 0) { + ksft_test_result_fail("unexpected mount point: '%s' != '/'\n", + sm->str + sm->mnt_point); +@@ -408,6 +412,10 @@ static void test_statmount_mnt_root(void) + strerror(errno)); + return; + } ++ if (!(sm->mask & STATMOUNT_MNT_ROOT)) { ++ ksft_test_result_fail("missing STATMOUNT_MNT_ROOT in mask\n"); ++ return; ++ } + mnt_root = sm->str + sm->mnt_root; + last_root = strrchr(mnt_root, '/'); + if (last_root) +@@ -437,6 +445,10 @@ static void test_statmount_fs_type(void) + strerror(errno)); + return; + } ++ if (!(sm->mask & STATMOUNT_FS_TYPE)) { ++ ksft_test_result_fail("missing STATMOUNT_FS_TYPE in mask\n"); ++ return; ++ } + fs_type = sm->str + sm->fs_type; + for (s = known_fs; s != NULL; s++) { + if (strcmp(fs_type, *s) == 0) +@@ -464,6 +476,11 @@ static void test_statmount_mnt_opts(void) + return; + } + ++ if (!(sm->mask & STATMOUNT_MNT_BASIC)) { ++ ksft_test_result_fail("missing STATMOUNT_MNT_BASIC in mask\n"); ++ return; ++ } ++ + while (getline(&line, &len, f_mountinfo) != -1) { + int i; + char *p, *p2; +@@ -514,7 +531,10 @@ static void test_statmount_mnt_opts(void) + if (p2) + *p2 = '\0'; + +- statmount_opts = sm->str + sm->mnt_opts; ++ if (sm->mask & STATMOUNT_MNT_OPTS) ++ statmount_opts = sm->str + sm->mnt_opts; ++ else ++ statmount_opts = ""; + if (strcmp(statmount_opts, p) != 0) + ksft_test_result_fail( + "unexpected mount options: '%s' != '%s'\n", +-- +2.39.5 + diff --git a/queue-6.13/selftests-bpf-adjust-data-size-to-have-eth_hlen.patch b/queue-6.13/selftests-bpf-adjust-data-size-to-have-eth_hlen.patch new file mode 100644 index 0000000000..3e46f8945b --- /dev/null +++ b/queue-6.13/selftests-bpf-adjust-data-size-to-have-eth_hlen.patch @@ -0,0 +1,84 @@ +From 1dc42b1c2aef3672698ece67316be066ace39938 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2025 00:06:43 +0900 +Subject: selftests/bpf: Adjust data size to have ETH_HLEN + +From: Shigeru Yoshida + +[ Upstream commit c7f2188d68c114095660a950b7e880a1e5a71c8f ] + +The function bpf_test_init() now returns an error if user_size +(.data_size_in) is less than ETH_HLEN, causing the tests to +fail. Adjust the data size to ensure it meets the requirement of +ETH_HLEN. + +Signed-off-by: Shigeru Yoshida +Signed-off-by: Martin KaFai Lau +Link: https://patch.msgid.link/20250121150643.671650-2-syoshida@redhat.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + .../testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c | 4 ++-- + .../testing/selftests/bpf/prog_tests/xdp_devmap_attach.c | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c b/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c +index c7f74f068e788..df27535995af8 100644 +--- a/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c ++++ b/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c +@@ -52,10 +52,10 @@ static void test_xdp_with_cpumap_helpers(void) + ASSERT_EQ(info.id, val.bpf_prog.id, "Match program id to cpumap entry prog_id"); + + /* send a packet to trigger any potential bugs in there */ +- char data[10] = {}; ++ char data[ETH_HLEN] = {}; + DECLARE_LIBBPF_OPTS(bpf_test_run_opts, opts, + .data_in = &data, +- .data_size_in = 10, ++ .data_size_in = sizeof(data), + .flags = BPF_F_TEST_XDP_LIVE_FRAMES, + .repeat = 1, + ); +diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c b/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c +index 27ffed17d4be3..461ab18705d5c 100644 +--- a/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c ++++ b/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c +@@ -23,7 +23,7 @@ static void test_xdp_with_devmap_helpers(void) + __u32 len = sizeof(info); + int err, dm_fd, dm_fd_redir, map_fd; + struct nstoken *nstoken = NULL; +- char data[10] = {}; ++ char data[ETH_HLEN] = {}; + __u32 idx = 0; + + SYS(out_close, "ip netns add %s", TEST_NS); +@@ -58,7 +58,7 @@ static void test_xdp_with_devmap_helpers(void) + /* send a packet to trigger any potential bugs in there */ + DECLARE_LIBBPF_OPTS(bpf_test_run_opts, opts, + .data_in = &data, +- .data_size_in = 10, ++ .data_size_in = sizeof(data), + .flags = BPF_F_TEST_XDP_LIVE_FRAMES, + .repeat = 1, + ); +@@ -158,7 +158,7 @@ static void test_xdp_with_devmap_helpers_veth(void) + struct nstoken *nstoken = NULL; + __u32 len = sizeof(info); + int err, dm_fd, dm_fd_redir, map_fd, ifindex_dst; +- char data[10] = {}; ++ char data[ETH_HLEN] = {}; + __u32 idx = 0; + + SYS(out_close, "ip netns add %s", TEST_NS); +@@ -208,7 +208,7 @@ static void test_xdp_with_devmap_helpers_veth(void) + /* send a packet to trigger any potential bugs in there */ + DECLARE_LIBBPF_OPTS(bpf_test_run_opts, opts, + .data_in = &data, +- .data_size_in = 10, ++ .data_size_in = sizeof(data), + .flags = BPF_F_TEST_XDP_LIVE_FRAMES, + .repeat = 1, + ); +-- +2.39.5 + diff --git a/queue-6.13/selftests-bpf-fix-invalid-flag-of-recv.patch b/queue-6.13/selftests-bpf-fix-invalid-flag-of-recv.patch new file mode 100644 index 0000000000..2d6635908d --- /dev/null +++ b/queue-6.13/selftests-bpf-fix-invalid-flag-of-recv.patch @@ -0,0 +1,49 @@ +From 6df92b300b09c7e3c1bfdbdcbc92a735e87451d2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2025 18:09:16 +0800 +Subject: selftests/bpf: Fix invalid flag of recv() + +From: Jiayuan Chen + +[ Upstream commit a0c11149509aa905aeec10cf9998091443472b0b ] + +SOCK_NONBLOCK flag is only effective during socket creation, not during +recv. Use MSG_DONTWAIT instead. + +Signed-off-by: Jiayuan Chen +Signed-off-by: Martin KaFai Lau +Acked-by: Jakub Sitnicki +Acked-by: John Fastabend +Link: https://patch.msgid.link/20250122100917.49845-5-mrpre@163.com +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c +index 884ad87783d59..0c51b7288978e 100644 +--- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c ++++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c +@@ -522,8 +522,8 @@ static void test_sockmap_skb_verdict_shutdown(void) + if (!ASSERT_EQ(err, 1, "epoll_wait(fd)")) + goto out_close; + +- n = recv(c1, &b, 1, SOCK_NONBLOCK); +- ASSERT_EQ(n, 0, "recv_timeout(fin)"); ++ n = recv(c1, &b, 1, MSG_DONTWAIT); ++ ASSERT_EQ(n, 0, "recv(fin)"); + out_close: + close(c1); + close(p1); +@@ -628,7 +628,7 @@ static void test_sockmap_skb_verdict_fionread(bool pass_prog) + ASSERT_EQ(avail, expected, "ioctl(FIONREAD)"); + /* On DROP test there will be no data to read */ + if (pass_prog) { +- recvd = recv_timeout(c1, &buf, sizeof(buf), SOCK_NONBLOCK, IO_TIMEOUT_SEC); ++ recvd = recv_timeout(c1, &buf, sizeof(buf), MSG_DONTWAIT, IO_TIMEOUT_SEC); + ASSERT_EQ(recvd, sizeof(buf), "recv_timeout(c0)"); + } + +-- +2.39.5 + diff --git a/queue-6.13/selftests-cgroup-use-bash-in-test_cpuset_v1_hp.sh.patch b/queue-6.13/selftests-cgroup-use-bash-in-test_cpuset_v1_hp.sh.patch new file mode 100644 index 0000000000..960999b74d --- /dev/null +++ b/queue-6.13/selftests-cgroup-use-bash-in-test_cpuset_v1_hp.sh.patch @@ -0,0 +1,34 @@ +From d1cf0e83f634ca63e16c2579e178a02540917409 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Feb 2025 00:59:53 +0530 +Subject: selftests/cgroup: use bash in test_cpuset_v1_hp.sh + +From: Bharadwaj Raju + +[ Upstream commit fd079124112c6e11c1bca2e7c71470a2d60bc363 ] + +The script uses non-POSIX features like `[[` for conditionals and hence +does not work when run with a POSIX /bin/sh. + +Change the shebang to /bin/bash instead, like the other tests in cgroup. + +Signed-off-by: Bharadwaj Raju +Signed-off-by: Tejun Heo +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh b/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh +index 3f45512fb512e..7406c24be1ac9 100755 +--- a/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh ++++ b/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + # SPDX-License-Identifier: GPL-2.0 + # + # Test the special cpuset v1 hotplug case where a cpuset become empty of +-- +2.39.5 + diff --git a/queue-6.13/series b/queue-6.13/series index d3e318cf5a..cf5c2c15d9 100644 --- a/queue-6.13/series +++ b/queue-6.13/series @@ -61,3 +61,97 @@ net-mlx5-fix-incorrect-irq-pool-usage-when-releasing.patch net-mlx5-lag-check-shared-fdb-before-creating-multip.patch net-mlx5-bridge-fix-the-crash-caused-by-lag-state-ch.patch net-mlx5e-prevent-bridge-link-show-failure-for-non-e.patch +nvme-fc-go-straight-to-connecting-state-when-initial.patch +nvme-fc-do-not-ignore-connectivity-loss-during-conne.patch +hrtimers-mark-is_migration_base-with-__always_inline.patch +powercap-call-put_device-on-an-error-path-in-powerca.patch +btrfs-avoid-starting-new-transaction-when-cleaning-q.patch +futex-pass-in-task-to-futex_queue.patch +irqchip-riscv-ensure-ordering-of-memory-writes-and-i.patch +iscsi_ibft-fix-ubsan-shift-out-of-bounds-warning-in-.patch +sched-debug-provide-slice-length-for-fair-tasks.patch +platform-x86-intel-pmc-fix-ltr-decode-in-pmc_core_lt.patch +drm-amd-display-fix-out-of-bound-accesses.patch +scsi-core-use-gfp_noio-to-avoid-circular-locking-dep.patch +scsi-ufs-core-fix-error-return-with-query-response.patch +scsi-qla1280-fix-kernel-oops-when-debug-level-2.patch +kbuild-keep-symbols-for-symbol_get-even-with-config_.patch +acpi-resource-irq-override-for-eluktronics-mech-17.patch +smb-client-fix-noisy-when-tree-connecting-to-dfs-int.patch +alpha-elf-fix-misc-setarch-test-of-util-linux-by-rem.patch +vboxsf-fix-building-with-gcc-15.patch +selftests-always-check-mask-returned-by-statmount-2.patch +sched_ext-selftests-dsp_local_on-fix-sporadic-failur.patch +hid-intel-ish-hid-fix-the-length-of-mng_sync_fw_cloc.patch +hid-intel-ish-hid-send-clock-sync-message-immediatel.patch +hid-ignore-non-functional-sensor-in-hp-5mp-camera.patch +hid-hid-steam-fix-issues-with-disabling-both-gamepad.patch +usb-phy-generic-use-proper-helper-for-property-detec.patch +hid-intel-ish-hid-ipc-add-panther-lake-pci-device-id.patch +hid-topre-fix-n-key-rollover-on-realforce-r3s-tkl-bo.patch +selftests-cgroup-use-bash-in-test_cpuset_v1_hp.sh.patch +hid-hid-apple-apple-magic-keyboard-a3203-usb-c-suppo.patch +hid-apple-fix-up-the-f6-key-on-the-omoton-kb066-keyb.patch +btrfs-fix-two-misuses-of-folio_shift.patch +objtool-ignore-dangling-jump-table-entries.patch +sched-clarify-wake_up_q-s-write-to-task-wake_q.next.patch +platform-x86-thinkpad_acpi-fix-invalid-fan-speed-on-.patch +platform-x86-thinkpad_acpi-support-for-v9-dytc-platf.patch +platform-x86-int3472-use-correct-type-for-polarity-c.patch +platform-x86-int3472-call-reset-gpio-enable-for-int3.patch +s390-cio-fix-chpid-configure-attribute-caching.patch +thermal-cpufreq_cooling-remove-structure-member-docu.patch +loongarch-fix-kernel_page_present-for-kprange-xkpran.patch +loongarch-kvm-set-host-with-kernel-mode-when-switch-.patch +arm64-amu-delay-allocating-cpumask-for-amu-fie-suppo.patch +xen-swiotlb-mark-xen_swiotlb_fixup-__init.patch +bluetooth-l2cap-fix-slab-use-after-free-read-in-l2ca.patch +drm-tests-hdmi-remove-redundant-assignments.patch +drm-tests-hdmi-reorder-drm-entities-variables-assign.patch +drm-tests-hdmi-fix-recursive-locking.patch +selftests-bpf-adjust-data-size-to-have-eth_hlen.patch +selftests-bpf-fix-invalid-flag-of-recv.patch +asoc-intel-sof_sdw-add-lookup-of-quirk-using-pci-sub.patch +asoc-intel-sof_sdw-add-quirk-for-asus-zenbook-s14.patch +asoc-intel-sof_sdw-add-support-for-fatcat-board-with.patch +asoc-intel-soc-acpi-intel-mtl-match-declare-adr-as-u.patch +asoc-simple-card-utils.c-add-missing-dlc-of_node.patch +alsa-hda-realtek-limit-mic-boost-on-positivo-arn50.patch +asoc-rsnd-indicate-unsupported-clock-rate.patch +asoc-rsnd-don-t-indicate-warning-on-rsnd_kctrl_accep.patch +asoc-rsnd-adjust-convert-rate-limitation.patch +asoc-arizona-madera-use-fsleep-in-up-down-dapm-event.patch +asoc-sof-intel-hda-add-softdep-pre-to-snd-hda-codec-.patch +pci-pci_ids-add-intel_hda_ptl_h.patch +alsa-hda-intel-dsp-config-add-ptl-h-support.patch +asoc-sof-intel-pci-ptl-add-support-for-ptl-h.patch +alsa-hda-hda-intel-add-panther-lake-h-support.patch +asoc-sof-amd-add-post_fw_run_delay-acp-quirk.patch +asoc-sof-amd-handle-ipc-replies-before-fw_boot_compl.patch +net-wwan-mhi_wwan_mbim-silence-sequence-number-glitc.patch +io-wq-backoff-when-retrying-worker-creation.patch +nvme-pci-quirk-acer-fa100-for-non-uniqueue-identifie.patch +nvmet-rdma-recheck-queue-state-is-live-in-state-lock.patch +apple-nvme-release-power-domains-when-probe-fails.patch +drm-xe-make-guc-binaries-dump-consistent-with-other-.patch +cifs-throw-eopnotsupp-error-on-unsupported-reparse-p.patch +cifs-treat-unhandled-directory-name-surrogate-repars.patch +sctp-fix-undefined-behavior-in-left-shift-operation.patch +nvme-only-allow-entering-live-from-connecting-state.patch +phy-ti-gmii-sel-do-not-use-syscon-helper-to-build-re.patch +asoc-tas2770-fix-volume-scale.patch +asoc-tas2764-fix-power-control-mask.patch +asoc-tas2764-set-the-sdout-polarity-correctly.patch +fuse-don-t-truncate-cached-mutated-symlink.patch +asoc-dapm-graph-set-fill-colour-of-turned-on-nodes.patch +asoc-sof-intel-don-t-check-number-of-sdw-links-when-.patch +drm-vkms-round-fixp2int-conversion-in-lerp_u16.patch +perf-x86-intel-use-better-start-period-for-frequency.patch +x86-of-don-t-use-dtb-for-smp-setup-if-acpi-is-enable.patch +x86-irq-define-trace-events-conditionally.patch +perf-x86-rapl-add-support-for-intel-arrow-lake-u.patch +mptcp-safety-check-before-fallback.patch +drm-nouveau-do-not-override-forced-connector-status.patch +net-handle-napi_schedule-calls-from-non-interrupt.patch +block-fix-kmem_cache-of-name-bio-108-already-exists.patch +vhost-return-task-creation-error-instead-of-null.patch diff --git a/queue-6.13/smb-client-fix-noisy-when-tree-connecting-to-dfs-int.patch b/queue-6.13/smb-client-fix-noisy-when-tree-connecting-to-dfs-int.patch new file mode 100644 index 0000000000..b56acb8ed6 --- /dev/null +++ b/queue-6.13/smb-client-fix-noisy-when-tree-connecting-to-dfs-int.patch @@ -0,0 +1,44 @@ +From fc1507fab31576cf2eb1236d2deeee1e515b710a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Feb 2025 13:22:11 -0300 +Subject: smb: client: fix noisy when tree connecting to DFS interlink targets + +From: Paulo Alcantara + +[ Upstream commit 773dc23ff81838b6f74d7fabba5a441cc6a93982 ] + +When the client attempts to tree connect to a domain-based DFS +namespace from a DFS interlink target, the server will return +STATUS_BAD_NETWORK_NAME and the following will appear on dmesg: + + CIFS: VFS: BAD_NETWORK_NAME: \\dom\dfs + +Since a DFS share might contain several DFS interlinks and they expire +after 10 minutes, the above message might end up being flooded on +dmesg when mounting or accessing them. + +Print this only once per share. + +Signed-off-by: Paulo Alcantara (Red Hat) +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/smb/client/smb2pdu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c +index 10eca164c8386..f1f55fbd0eeab 100644 +--- a/fs/smb/client/smb2pdu.c ++++ b/fs/smb/client/smb2pdu.c +@@ -2169,7 +2169,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, + + tcon_error_exit: + if (rsp && rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) +- cifs_tcon_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree); ++ cifs_dbg(VFS | ONCE, "BAD_NETWORK_NAME: %s\n", tree); + goto tcon_exit; + } + +-- +2.39.5 + diff --git a/queue-6.13/thermal-cpufreq_cooling-remove-structure-member-docu.patch b/queue-6.13/thermal-cpufreq_cooling-remove-structure-member-docu.patch new file mode 100644 index 0000000000..fd0d03923f --- /dev/null +++ b/queue-6.13/thermal-cpufreq_cooling-remove-structure-member-docu.patch @@ -0,0 +1,41 @@ +From ee50bb0c5e8c9fb182428f142125496488272cb3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 11 Feb 2025 09:47:11 +0100 +Subject: thermal/cpufreq_cooling: Remove structure member documentation + +From: Daniel Lezcano + +[ Upstream commit a6768c4f92e152265590371975d44c071a5279c7 ] + +The structure member documentation refers to a member which does not +exist any more. Remove it. + +Link: https://lore.kernel.org/all/202501220046.h3PMBCti-lkp@intel.com/ +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202501220046.h3PMBCti-lkp@intel.com/ +Signed-off-by: Daniel Lezcano +Acked-by: Viresh Kumar +Link: https://patch.msgid.link/20250211084712.2746705-1-daniel.lezcano@linaro.org +[ rjw: Minor changelog edits ] +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + drivers/thermal/cpufreq_cooling.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c +index 280071be30b15..6b7ab1814c12d 100644 +--- a/drivers/thermal/cpufreq_cooling.c ++++ b/drivers/thermal/cpufreq_cooling.c +@@ -57,8 +57,6 @@ struct time_in_idle { + * @max_level: maximum cooling level. One less than total number of valid + * cpufreq frequencies. + * @em: Reference on the Energy Model of the device +- * @cdev: thermal_cooling_device pointer to keep track of the +- * registered cooling device. + * @policy: cpufreq policy. + * @cooling_ops: cpufreq callbacks to thermal cooling device ops + * @idle_time: idle time stats +-- +2.39.5 + diff --git a/queue-6.13/usb-phy-generic-use-proper-helper-for-property-detec.patch b/queue-6.13/usb-phy-generic-use-proper-helper-for-property-detec.patch new file mode 100644 index 0000000000..7ad3b26b3f --- /dev/null +++ b/queue-6.13/usb-phy-generic-use-proper-helper-for-property-detec.patch @@ -0,0 +1,38 @@ +From d332740c86b1f003521d180680d3e49e4041dc0f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Jan 2025 15:42:51 +0100 +Subject: usb: phy: generic: Use proper helper for property detection + +From: Alexander Stein + +[ Upstream commit 309005e448c1f3e4b81e4416406991b7c3339c1d ] + +Since commit c141ecc3cecd7 ("of: Warn when of_property_read_bool() is +used on non-boolean properties") a warning is raised if this function +is used for property detection. of_property_present() is the correct +helper for this. + +Signed-off-by: Alexander Stein +Link: https://lore.kernel.org/r/20250120144251.580981-1-alexander.stein@ew.tq-group.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/phy/phy-generic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c +index 6c3ececf91375..8423be59ec0ff 100644 +--- a/drivers/usb/phy/phy-generic.c ++++ b/drivers/usb/phy/phy-generic.c +@@ -212,7 +212,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop) + if (of_property_read_u32(node, "clock-frequency", &clk_rate)) + clk_rate = 0; + +- needs_clk = of_property_read_bool(node, "clocks"); ++ needs_clk = of_property_present(node, "clocks"); + } + nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset", + GPIOD_ASIS); +-- +2.39.5 + diff --git a/queue-6.13/vboxsf-fix-building-with-gcc-15.patch b/queue-6.13/vboxsf-fix-building-with-gcc-15.patch new file mode 100644 index 0000000000..9fc6b30eca --- /dev/null +++ b/queue-6.13/vboxsf-fix-building-with-gcc-15.patch @@ -0,0 +1,51 @@ +From 7adfa01a9be228d69f7a8b9786e19b5a5b4cc815 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 21 Jan 2025 21:56:48 +0530 +Subject: vboxsf: fix building with GCC 15 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Brahmajit Das + +[ Upstream commit 4e7487245abcbc5a1a1aea54e4d3b33c53804bda ] + +Building with GCC 15 results in build error +fs/vboxsf/super.c:24:54: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization] + 24 | static const unsigned char VBSF_MOUNT_SIGNATURE[4] = "\000\377\376\375"; + | ^~~~~~~~~~~~~~~~~~ +cc1: all warnings being treated as errors + +Due to GCC having enabled -Werror=unterminated-string-initialization[0] +by default. Separately initializing each array element of +VBSF_MOUNT_SIGNATURE to ensure NUL termination, thus satisfying GCC 15 +and fixing the build error. + +[0]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-unterminated-string-initialization + +Signed-off-by: Brahmajit Das +Link: https://lore.kernel.org/r/20250121162648.1408743-1-brahmajit.xyz@gmail.com +Reviewed-by: Hans de Goede +Signed-off-by: Christian Brauner +Signed-off-by: Sasha Levin +--- + fs/vboxsf/super.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c +index e95b8a48d8a02..1d94bb7841081 100644 +--- a/fs/vboxsf/super.c ++++ b/fs/vboxsf/super.c +@@ -21,7 +21,8 @@ + + #define VBOXSF_SUPER_MAGIC 0x786f4256 /* 'VBox' little endian */ + +-static const unsigned char VBSF_MOUNT_SIGNATURE[4] = "\000\377\376\375"; ++static const unsigned char VBSF_MOUNT_SIGNATURE[4] = { '\000', '\377', '\376', ++ '\375' }; + + static int follow_symlinks; + module_param(follow_symlinks, int, 0444); +-- +2.39.5 + diff --git a/queue-6.13/vhost-return-task-creation-error-instead-of-null.patch b/queue-6.13/vhost-return-task-creation-error-instead-of-null.patch new file mode 100644 index 0000000000..3459953043 --- /dev/null +++ b/queue-6.13/vhost-return-task-creation-error-instead-of-null.patch @@ -0,0 +1,75 @@ +From 80d002cc91cd09ab02a659cf3683d1a8cda2c6bd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 27 Feb 2025 15:06:30 -0800 +Subject: vhost: return task creation error instead of NULL + +From: Keith Busch + +[ Upstream commit cb380909ae3b1ebf14d6a455a4f92d7916d790cb ] + +Lets callers distinguish why the vhost task creation failed. No one +currently cares why it failed, so no real runtime change from this +patch, but that will not be the case for long. + +Signed-off-by: Keith Busch +Message-ID: <20250227230631.303431-2-kbusch@meta.com> +Reviewed-by: Mike Christie +Signed-off-by: Paolo Bonzini +Signed-off-by: Sasha Levin +--- + arch/x86/kvm/mmu/mmu.c | 2 +- + drivers/vhost/vhost.c | 2 +- + kernel/vhost_task.c | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c +index e102505735a7b..0e6bf24093f75 100644 +--- a/arch/x86/kvm/mmu/mmu.c ++++ b/arch/x86/kvm/mmu/mmu.c +@@ -7435,7 +7435,7 @@ static void kvm_mmu_start_lpage_recovery(struct once *once) + kvm_nx_huge_page_recovery_worker_kill, + kvm, "kvm-nx-lpage-recovery"); + +- if (!nx_thread) ++ if (IS_ERR(nx_thread)) + return; + + vhost_task_start(nx_thread); +diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c +index 9ac25d08f473e..63612faeab727 100644 +--- a/drivers/vhost/vhost.c ++++ b/drivers/vhost/vhost.c +@@ -666,7 +666,7 @@ static struct vhost_worker *vhost_worker_create(struct vhost_dev *dev) + + vtsk = vhost_task_create(vhost_run_work_list, vhost_worker_killed, + worker, name); +- if (!vtsk) ++ if (IS_ERR(vtsk)) + goto free_worker; + + mutex_init(&worker->mutex); +diff --git a/kernel/vhost_task.c b/kernel/vhost_task.c +index 8800f5acc0071..2ef2e1b800916 100644 +--- a/kernel/vhost_task.c ++++ b/kernel/vhost_task.c +@@ -133,7 +133,7 @@ struct vhost_task *vhost_task_create(bool (*fn)(void *), + + vtsk = kzalloc(sizeof(*vtsk), GFP_KERNEL); + if (!vtsk) +- return NULL; ++ return ERR_PTR(-ENOMEM); + init_completion(&vtsk->exited); + mutex_init(&vtsk->exit_mutex); + vtsk->data = arg; +@@ -145,7 +145,7 @@ struct vhost_task *vhost_task_create(bool (*fn)(void *), + tsk = copy_process(NULL, 0, NUMA_NO_NODE, &args); + if (IS_ERR(tsk)) { + kfree(vtsk); +- return NULL; ++ return ERR_PTR(PTR_ERR(tsk)); + } + + vtsk->task = tsk; +-- +2.39.5 + diff --git a/queue-6.13/x86-irq-define-trace-events-conditionally.patch b/queue-6.13/x86-irq-define-trace-events-conditionally.patch new file mode 100644 index 0000000000..a9c5328fad --- /dev/null +++ b/queue-6.13/x86-irq-define-trace-events-conditionally.patch @@ -0,0 +1,48 @@ +From add88284e8a319b86e5aab9154c032273a8457f9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 25 Feb 2025 22:32:33 +0100 +Subject: x86/irq: Define trace events conditionally + +From: Arnd Bergmann + +[ Upstream commit 9de7695925d5d2d2085681ba935857246eb2817d ] + +When both of X86_LOCAL_APIC and X86_THERMAL_VECTOR are disabled, +the irq tracing produces a W=1 build warning for the tracing +definitions: + + In file included from include/trace/trace_events.h:27, + from include/trace/define_trace.h:113, + from arch/x86/include/asm/trace/irq_vectors.h:383, + from arch/x86/kernel/irq.c:29: + include/trace/stages/init.h:2:23: error: 'str__irq_vectors__trace_system_name' defined but not used [-Werror=unused-const-variable=] + +Make the tracepoints conditional on the same symbosl that guard +their usage. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Ingo Molnar +Link: https://lore.kernel.org/r/20250225213236.3141752-1-arnd@kernel.org +Signed-off-by: Sasha Levin +--- + arch/x86/kernel/irq.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c +index 385e3a5fc3045..feca4f20b06aa 100644 +--- a/arch/x86/kernel/irq.c ++++ b/arch/x86/kernel/irq.c +@@ -25,8 +25,10 @@ + #include + #include + ++#if defined(CONFIG_X86_LOCAL_APIC) || defined(CONFIG_X86_THERMAL_VECTOR) + #define CREATE_TRACE_POINTS + #include ++#endif + + DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); + EXPORT_PER_CPU_SYMBOL(irq_stat); +-- +2.39.5 + diff --git a/queue-6.13/x86-of-don-t-use-dtb-for-smp-setup-if-acpi-is-enable.patch b/queue-6.13/x86-of-don-t-use-dtb-for-smp-setup-if-acpi-is-enable.patch new file mode 100644 index 0000000000..95b7ab4f7e --- /dev/null +++ b/queue-6.13/x86-of-don-t-use-dtb-for-smp-setup-if-acpi-is-enable.patch @@ -0,0 +1,55 @@ +From a1492e0cff73f8111b667191b4656d9ecb600007 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 5 Jan 2025 17:27:40 +0000 +Subject: x86/of: Don't use DTB for SMP setup if ACPI is enabled + +From: Dmytro Maluka + +[ Upstream commit 96f41f644c4885761b0d117fc36dc5dcf92e15ec ] + +There are cases when it is useful to use both ACPI and DTB provided by +the bootloader, however in such cases we should make sure to prevent +conflicts between the two. Namely, don't try to use DTB for SMP setup +if ACPI is enabled. + +Precisely, this prevents at least: + +- incorrectly calling register_lapic_address(APIC_DEFAULT_PHYS_BASE) + after the LAPIC was already successfully enumerated via ACPI, causing + noisy kernel warnings and probably potential real issues as well + +- failed IOAPIC setup in the case when IOAPIC is enumerated via mptable + instead of ACPI (e.g. with acpi=noirq), due to + mpparse_parse_smp_config() overridden by x86_dtb_parse_smp_config() + +Signed-off-by: Dmytro Maluka +Signed-off-by: Ingo Molnar +Link: https://lore.kernel.org/r/20250105172741.3476758-2-dmaluka@chromium.org +Signed-off-by: Sasha Levin +--- + arch/x86/kernel/devicetree.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c +index 59d23cdf4ed0f..dd8748c45529a 100644 +--- a/arch/x86/kernel/devicetree.c ++++ b/arch/x86/kernel/devicetree.c +@@ -2,6 +2,7 @@ + /* + * Architecture specific OF callbacks. + */ ++#include + #include + #include + #include +@@ -313,6 +314,6 @@ void __init x86_flattree_get_config(void) + if (initial_dtb) + early_memunmap(dt, map_len); + #endif +- if (of_have_populated_dt()) ++ if (acpi_disabled && of_have_populated_dt()) + x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config; + } +-- +2.39.5 + diff --git a/queue-6.13/xen-swiotlb-mark-xen_swiotlb_fixup-__init.patch b/queue-6.13/xen-swiotlb-mark-xen_swiotlb_fixup-__init.patch new file mode 100644 index 0000000000..5f990d1195 --- /dev/null +++ b/queue-6.13/xen-swiotlb-mark-xen_swiotlb_fixup-__init.patch @@ -0,0 +1,37 @@ +From 48c708bf35fccfd2cdb7c8b41b566fa980ba9b1e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 12 Feb 2025 16:14:38 +0100 +Subject: Xen/swiotlb: mark xen_swiotlb_fixup() __init + +From: Jan Beulich + +[ Upstream commit 75ad02318af2e4ae669e26a79f001bd5e1f97472 ] + +It's sole user (pci_xen_swiotlb_init()) is __init, too. + +Signed-off-by: Jan Beulich +Reviewed-by: Stefano Stabellini + +Message-ID: +Signed-off-by: Juergen Gross +Signed-off-by: Sasha Levin +--- + drivers/xen/swiotlb-xen.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c +index 26c62e0d34e98..1f65795cf5d7a 100644 +--- a/drivers/xen/swiotlb-xen.c ++++ b/drivers/xen/swiotlb-xen.c +@@ -113,7 +113,7 @@ static struct io_tlb_pool *xen_swiotlb_find_pool(struct device *dev, + } + + #ifdef CONFIG_X86 +-int xen_swiotlb_fixup(void *buf, unsigned long nslabs) ++int __init xen_swiotlb_fixup(void *buf, unsigned long nslabs) + { + int rc; + unsigned int order = get_order(IO_TLB_SEGSIZE << IO_TLB_SHIFT); +-- +2.39.5 +