From: Sasha Levin Date: Sat, 23 Nov 2024 10:44:05 +0000 (-0500) Subject: Fixes for 6.11 X-Git-Tag: v4.19.325~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e598c2533f116b4280195f76b0a13ac3faaeebf8;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 6.11 Signed-off-by: Sasha Levin --- diff --git a/queue-6.11/alsa-hda-realtek-add-subwoofer-quirk-for-infinix-zer.patch b/queue-6.11/alsa-hda-realtek-add-subwoofer-quirk-for-infinix-zer.patch new file mode 100644 index 00000000000..34b8e5b535c --- /dev/null +++ b/queue-6.11/alsa-hda-realtek-add-subwoofer-quirk-for-infinix-zer.patch @@ -0,0 +1,67 @@ +From 2e39b17fcfc80f47e473569c174a6543117cf6bf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 28 Oct 2024 15:55:16 +0000 +Subject: ALSA: hda/realtek: Add subwoofer quirk for Infinix ZERO BOOK 13 + +From: Piyush Raj Chouhan + +[ Upstream commit ef5fbdf732a158ec27eeba69d8be851351f29f73 ] + +Infinix ZERO BOOK 13 has a 2+2 speaker system which isn't probed correctly. +This patch adds a quirk with the proper pin connections. +Also The mic in this laptop suffers too high gain resulting in mostly +fan noise being recorded, +This patch Also limit mic boost. + +HW Probe for device; https://linux-hardware.org/?probe=a2e892c47b + +Test: All 4 speaker works, Mic has low noise. + +Signed-off-by: Piyush Raj Chouhan +Link: https://patch.msgid.link/20241028155516.15552-1-piyuschouhan1598@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/patch_realtek.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 833635aaee1d0..149079afa7969 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -7544,6 +7544,7 @@ enum { + ALC290_FIXUP_SUBWOOFER_HSJACK, + ALC269_FIXUP_THINKPAD_ACPI, + ALC269_FIXUP_DMIC_THINKPAD_ACPI, ++ ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13, + ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO, + ALC255_FIXUP_ACER_MIC_NO_PRESENCE, + ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, +@@ -7992,6 +7993,16 @@ static const struct hda_fixup alc269_fixups[] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc269_fixup_pincfg_U7x7_headset_mic, + }, ++ [ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13] = { ++ .type = HDA_FIXUP_PINS, ++ .v.pins = (const struct hda_pintbl[]) { ++ { 0x14, 0x90170151 }, /* use as internal speaker (LFE) */ ++ { 0x1b, 0x90170152 }, /* use as internal speaker (back) */ ++ { } ++ }, ++ .chained = true, ++ .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST ++ }, + [ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { +@@ -11015,6 +11026,7 @@ static const struct snd_pci_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(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), + SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME), + SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), +-- +2.43.0 + diff --git a/queue-6.11/alsa-usb-audio-fix-yamaha-p-125-quirk-entry.patch b/queue-6.11/alsa-usb-audio-fix-yamaha-p-125-quirk-entry.patch new file mode 100644 index 00000000000..1cb7df6892e --- /dev/null +++ b/queue-6.11/alsa-usb-audio-fix-yamaha-p-125-quirk-entry.patch @@ -0,0 +1,56 @@ +From b81eb33bc37003229e9a00f8c3bcc60e92539a07 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 11 Nov 2024 11:45:21 -0500 +Subject: ALSA: usb-audio: Fix Yamaha P-125 Quirk Entry + +From: Eryk Zagorski + +[ Upstream commit 6f891ca15b017707840c9e7f5afd9fc6cfd7d8b1 ] + +This patch switches the P-125 quirk entry to use a composite quirk as the +P-125 supplies both MIDI and Audio like many of the other Yamaha +keyboards + +Signed-off-by: Eryk Zagorski +Link: https://patch.msgid.link/20241111164520.9079-2-erykzagorski@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/usb/quirks-table.h | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h +index 24c981c9b2405..199d0603cf8e5 100644 +--- a/sound/usb/quirks-table.h ++++ b/sound/usb/quirks-table.h +@@ -324,7 +324,6 @@ YAMAHA_DEVICE(0x105a, NULL), + YAMAHA_DEVICE(0x105b, NULL), + YAMAHA_DEVICE(0x105c, NULL), + YAMAHA_DEVICE(0x105d, NULL), +-YAMAHA_DEVICE(0x1718, "P-125"), + { + USB_DEVICE(0x0499, 0x1503), + QUIRK_DRIVER_INFO { +@@ -391,6 +390,19 @@ YAMAHA_DEVICE(0x1718, "P-125"), + } + } + }, ++{ ++ USB_DEVICE(0x0499, 0x1718), ++ QUIRK_DRIVER_INFO { ++ /* .vendor_name = "Yamaha", */ ++ /* .product_name = "P-125", */ ++ QUIRK_DATA_COMPOSITE { ++ { QUIRK_DATA_STANDARD_AUDIO(1) }, ++ { QUIRK_DATA_STANDARD_AUDIO(2) }, ++ { QUIRK_DATA_MIDI_YAMAHA(3) }, ++ QUIRK_COMPOSITE_END ++ } ++ } ++}, + YAMAHA_DEVICE(0x2000, "DGP-7"), + YAMAHA_DEVICE(0x2001, "DGP-5"), + YAMAHA_DEVICE(0x2002, NULL), +-- +2.43.0 + diff --git a/queue-6.11/arm-9420-1-smp-fix-smp-for-xip-kernels.patch b/queue-6.11/arm-9420-1-smp-fix-smp-for-xip-kernels.patch new file mode 100644 index 00000000000..4bdae1966e8 --- /dev/null +++ b/queue-6.11/arm-9420-1-smp-fix-smp-for-xip-kernels.patch @@ -0,0 +1,84 @@ +From 599a13a540d55f0866256bc9203cdae9d80f30c9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Sep 2024 06:57:53 +0100 +Subject: ARM: 9420/1: smp: Fix SMP for xip kernels + +From: Harith G + +[ Upstream commit 9e9b0cf9319b4db143014477b0bc4b39894248f1 ] + +Fix the physical address calculation of the following to get smp working +on xip kernels. +- secondary_data needed for secondary cpu bootup. +- secondary_startup address passed through psci. +- identity mapped code region needed for enabling mmu for secondary cpus. + +Signed-off-by: Harith George +Reviewed-by: Linus Walleij +Signed-off-by: Russell King (Oracle) +Signed-off-by: Sasha Levin +--- + arch/arm/kernel/head.S | 4 ++++ + arch/arm/kernel/psci_smp.c | 7 +++++++ + arch/arm/mm/idmap.c | 7 +++++++ + 3 files changed, 18 insertions(+) + +diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S +index 28873cda464f5..f22c50d4bd417 100644 +--- a/arch/arm/kernel/head.S ++++ b/arch/arm/kernel/head.S +@@ -411,7 +411,11 @@ ENTRY(secondary_startup) + /* + * Use the page tables supplied from __cpu_up. + */ ++#ifdef CONFIG_XIP_KERNEL ++ ldr r3, =(secondary_data + PLAT_PHYS_OFFSET - PAGE_OFFSET) ++#else + adr_l r3, secondary_data ++#endif + mov_l r12, __secondary_switched + ldrd r4, r5, [r3, #0] @ get secondary_data.pgdir + ARM_BE8(eor r4, r4, r5) @ Swap r5 and r4 in BE: +diff --git a/arch/arm/kernel/psci_smp.c b/arch/arm/kernel/psci_smp.c +index d4392e1774848..3bb0c4dcfc5c9 100644 +--- a/arch/arm/kernel/psci_smp.c ++++ b/arch/arm/kernel/psci_smp.c +@@ -45,8 +45,15 @@ extern void secondary_startup(void); + static int psci_boot_secondary(unsigned int cpu, struct task_struct *idle) + { + if (psci_ops.cpu_on) ++#ifdef CONFIG_XIP_KERNEL ++ return psci_ops.cpu_on(cpu_logical_map(cpu), ++ ((phys_addr_t)(&secondary_startup) ++ - XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR) ++ + CONFIG_XIP_PHYS_ADDR)); ++#else + return psci_ops.cpu_on(cpu_logical_map(cpu), + virt_to_idmap(&secondary_startup)); ++#endif + return -ENODEV; + } + +diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c +index 448e57c6f6534..4a833e89782aa 100644 +--- a/arch/arm/mm/idmap.c ++++ b/arch/arm/mm/idmap.c +@@ -84,8 +84,15 @@ static void identity_mapping_add(pgd_t *pgd, const char *text_start, + unsigned long addr, end; + unsigned long next; + ++#ifdef CONFIG_XIP_KERNEL ++ addr = (phys_addr_t)(text_start) - XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR) ++ + CONFIG_XIP_PHYS_ADDR; ++ end = (phys_addr_t)(text_end) - XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR) ++ + CONFIG_XIP_PHYS_ADDR; ++#else + addr = virt_to_idmap(text_start); + end = virt_to_idmap(text_end); ++#endif + pr_info("Setting up static identity map for 0x%lx - 0x%lx\n", addr, end); + + prot |= PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AF; +-- +2.43.0 + diff --git a/queue-6.11/arm-9434-1-cfi-fix-compilation-corner-case.patch b/queue-6.11/arm-9434-1-cfi-fix-compilation-corner-case.patch new file mode 100644 index 00000000000..df6e58d1e3f --- /dev/null +++ b/queue-6.11/arm-9434-1-cfi-fix-compilation-corner-case.patch @@ -0,0 +1,61 @@ +From df95e936756de1af86649eb568f549ba38b52a37 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 11 Nov 2024 00:17:03 +0100 +Subject: ARM: 9434/1: cfi: Fix compilation corner case + +From: Linus Walleij + +[ Upstream commit 4aea16b7cfb76bd3361858ceee6893ef5c9b5570 ] + +When enabling expert mode CONFIG_EXPERT and using that power +user mode to disable the branch prediction hardening +!CONFIG_HARDEN_BRANCH_PREDICTOR, the assembly linker +in CLANG notices that some assembly in proc-v7.S does +not have corresponding C call sites, i.e. the prototypes +in proc-v7-bugs.c are enclosed in ifdef +CONFIG_HARDEN_BRANCH_PREDICTOR so this assembly: + +SYM_TYPED_FUNC_START(cpu_v7_smc_switch_mm) +SYM_TYPED_FUNC_START(cpu_v7_hvc_switch_mm) + +Results in: + +ld.lld: error: undefined symbol: __kcfi_typeid_cpu_v7_smc_switch_mm +>>> referenced by proc-v7.S:94 (.../arch/arm/mm/proc-v7.S:94) +>>> arch/arm/mm/proc-v7.o:(.text+0x108) in archive vmlinux.a + +ld.lld: error: undefined symbol: __kcfi_typeid_cpu_v7_hvc_switch_mm +>>> referenced by proc-v7.S:105 (.../arch/arm/mm/proc-v7.S:105) +>>> arch/arm/mm/proc-v7.o:(.text+0x124) in archive vmlinux.a + +Fix this by adding an additional requirement that +CONFIG_HARDEN_BRANCH_PREDICTOR has to be enabled to compile +these assembly calls. + +Closes: https://lore.kernel.org/oe-kbuild-all/202411041456.ZsoEiD7T-lkp@intel.com/ + +Reported-by: kernel test robot +Reviewed-by: Nathan Chancellor +Signed-off-by: Linus Walleij +Signed-off-by: Russell King (Oracle) +Signed-off-by: Sasha Levin +--- + arch/arm/mm/proc-v7.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S +index 5fb9a6aecb001..2cd9333426794 100644 +--- a/arch/arm/mm/proc-v7.S ++++ b/arch/arm/mm/proc-v7.S +@@ -94,7 +94,7 @@ SYM_TYPED_FUNC_START(cpu_v7_dcache_clean_area) + ret lr + SYM_FUNC_END(cpu_v7_dcache_clean_area) + +-#ifdef CONFIG_ARM_PSCI ++#if defined(CONFIG_ARM_PSCI) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR) + .arch_extension sec + SYM_TYPED_FUNC_START(cpu_v7_smc_switch_mm) + stmfd sp!, {r0 - r3} +-- +2.43.0 + diff --git a/queue-6.11/asoc-amd-yc-support-dmic-on-another-model-of-lenovo-.patch b/queue-6.11/asoc-amd-yc-support-dmic-on-another-model-of-lenovo-.patch new file mode 100644 index 00000000000..08d1822b3ed --- /dev/null +++ b/queue-6.11/asoc-amd-yc-support-dmic-on-another-model-of-lenovo-.patch @@ -0,0 +1,42 @@ +From 38ea7c7a77a1de07b51c0bb974d927af94160a22 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Nov 2024 10:40:20 +0100 +Subject: ASoC: amd: yc: Support dmic on another model of Lenovo Thinkpad E14 + Gen 6 + +From: Markus Petri + +[ Upstream commit 8c21e40e1e481f7fef6e570089e317068b972c45 ] + +Another model of Thinkpad E14 Gen 6 (21M4) +needs a quirk entry for the dmic to be detected. + +Signed-off-by: Markus Petri +Link: https://patch.msgid.link/20241107094020.1050935-1-mp@localhost +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c +index dc476bfb6da40..2436e8deb2be4 100644 +--- a/sound/soc/amd/yc/acp6x-mach.c ++++ b/sound/soc/amd/yc/acp6x-mach.c +@@ -227,6 +227,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { + DMI_MATCH(DMI_PRODUCT_NAME, "21M3"), + } + }, ++ { ++ .driver_data = &acp6x_card, ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "21M4"), ++ } ++ }, + { + .driver_data = &acp6x_card, + .matches = { +-- +2.43.0 + diff --git a/queue-6.11/asoc-audio-graph-card2-purge-absent-supplies-for-dev.patch b/queue-6.11/asoc-audio-graph-card2-purge-absent-supplies-for-dev.patch new file mode 100644 index 00000000000..dbec33452ba --- /dev/null +++ b/queue-6.11/asoc-audio-graph-card2-purge-absent-supplies-for-dev.patch @@ -0,0 +1,54 @@ +From 25b31d85d481836124fa12673c6331c98e35c685 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Nov 2024 12:37:15 +1100 +Subject: ASoC: audio-graph-card2: Purge absent supplies for device tree nodes + +From: John Watts + +[ Upstream commit f8da001ae7af0abd9f6250c02c01a1121074ca60 ] + +The audio graph card doesn't mark its subnodes such as multi {}, dpcm {} +and c2c {} as not requiring any suppliers. This causes a hang as Linux +waits for these phantom suppliers to show up on boot. +Make it clear these nodes have no suppliers. + +Example error message: +[ 15.208558] platform 2034000.i2s: deferred probe pending: platform: wait for supplier /sound/multi +[ 15.208584] platform sound: deferred probe pending: asoc-audio-graph-card2: parse error + +Signed-off-by: John Watts +Acked-by: Kuninori Morimoto +Link: https://patch.msgid.link/20241108-graph_dt_fix-v1-1-173e2f9603d6@jookia.org +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/generic/audio-graph-card2.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c +index 56f7f946882e8..68f1da6931af2 100644 +--- a/sound/soc/generic/audio-graph-card2.c ++++ b/sound/soc/generic/audio-graph-card2.c +@@ -270,16 +270,19 @@ static enum graph_type __graph_get_type(struct device_node *lnk) + + if (of_node_name_eq(np, GRAPH_NODENAME_MULTI)) { + ret = GRAPH_MULTI; ++ fw_devlink_purge_absent_suppliers(&np->fwnode); + goto out_put; + } + + if (of_node_name_eq(np, GRAPH_NODENAME_DPCM)) { + ret = GRAPH_DPCM; ++ fw_devlink_purge_absent_suppliers(&np->fwnode); + goto out_put; + } + + if (of_node_name_eq(np, GRAPH_NODENAME_C2C)) { + ret = GRAPH_C2C; ++ fw_devlink_purge_absent_suppliers(&np->fwnode); + goto out_put; + } + +-- +2.43.0 + diff --git a/queue-6.11/asoc-codecs-rt5640-always-disable-irqs-from-rt5640_c.patch b/queue-6.11/asoc-codecs-rt5640-always-disable-irqs-from-rt5640_c.patch new file mode 100644 index 00000000000..0afa9baa2a6 --- /dev/null +++ b/queue-6.11/asoc-codecs-rt5640-always-disable-irqs-from-rt5640_c.patch @@ -0,0 +1,104 @@ +From b88330ae10b39706074ff75949873ef5fd03f25b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 24 Oct 2024 23:56:12 +0200 +Subject: ASoC: codecs: rt5640: Always disable IRQs from rt5640_cancel_work() + +From: Hans de Goede + +[ Upstream commit 032532f91a1d06d0750f16c49a9698ef5374a68f ] + +Disable IRQs from rt5640_cancel_work(), this fixes a crash caused by +the IRQ never getting freed when the driver is unbound from the i2c_client +with jack-detection active: + +[ 193.138780] rt5640 i2c-rt5640: ASoC: unknown pin LDO2 +[ 193.138830] rt5640 i2c-rt5640: ASoC: unknown pin MICBIAS1 +[ 193.671218] BUG: kernel NULL pointer dereference, address: 0000000000000078 +[ 193.671239] #PF: supervisor read access in kernel mode +[ 193.671248] #PF: error_code(0x0000) - not-present page +... +[ 193.671531] ? asm_exc_page_fault+0x22/0x30 +[ 193.671551] ? rt5640_jack_inserted+0x10/0x80 [snd_soc_rt5640] +[ 193.671574] rt5640_detect_headset+0x93/0x130 [snd_soc_rt5640] +[ 193.671596] rt5640_jack_work+0x93/0x355 [snd_soc_rt5640] + +Signed-off-by: Hans de Goede +Link: https://patch.msgid.link/20241024215612.92147-1-hdegoede@redhat.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/rt5640.c | 27 +++++++++++++++------------ + 1 file changed, 15 insertions(+), 12 deletions(-) + +diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c +index 16f3425a3e35c..855139348edb4 100644 +--- a/sound/soc/codecs/rt5640.c ++++ b/sound/soc/codecs/rt5640.c +@@ -2419,10 +2419,20 @@ static irqreturn_t rt5640_jd_gpio_irq(int irq, void *data) + return IRQ_HANDLED; + } + +-static void rt5640_cancel_work(void *data) ++static void rt5640_disable_irq_and_cancel_work(void *data) + { + struct rt5640_priv *rt5640 = data; + ++ if (rt5640->jd_gpio_irq_requested) { ++ free_irq(rt5640->jd_gpio_irq, rt5640); ++ rt5640->jd_gpio_irq_requested = false; ++ } ++ ++ if (rt5640->irq_requested) { ++ free_irq(rt5640->irq, rt5640); ++ rt5640->irq_requested = false; ++ } ++ + cancel_delayed_work_sync(&rt5640->jack_work); + cancel_delayed_work_sync(&rt5640->bp_work); + } +@@ -2463,13 +2473,7 @@ static void rt5640_disable_jack_detect(struct snd_soc_component *component) + if (!rt5640->jack) + return; + +- if (rt5640->jd_gpio_irq_requested) +- free_irq(rt5640->jd_gpio_irq, rt5640); +- +- if (rt5640->irq_requested) +- free_irq(rt5640->irq, rt5640); +- +- rt5640_cancel_work(rt5640); ++ rt5640_disable_irq_and_cancel_work(rt5640); + + if (rt5640->jack->status & SND_JACK_MICROPHONE) { + rt5640_disable_micbias1_ovcd_irq(component); +@@ -2477,8 +2481,6 @@ static void rt5640_disable_jack_detect(struct snd_soc_component *component) + snd_soc_jack_report(rt5640->jack, 0, SND_JACK_BTN_0); + } + +- rt5640->jd_gpio_irq_requested = false; +- rt5640->irq_requested = false; + rt5640->jd_gpio = NULL; + rt5640->jack = NULL; + } +@@ -2798,7 +2800,8 @@ static int rt5640_suspend(struct snd_soc_component *component) + if (rt5640->jack) { + /* disable jack interrupts during system suspend */ + disable_irq(rt5640->irq); +- rt5640_cancel_work(rt5640); ++ cancel_delayed_work_sync(&rt5640->jack_work); ++ cancel_delayed_work_sync(&rt5640->bp_work); + } + + snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); +@@ -3032,7 +3035,7 @@ static int rt5640_i2c_probe(struct i2c_client *i2c) + INIT_DELAYED_WORK(&rt5640->jack_work, rt5640_jack_work); + + /* Make sure work is stopped on probe-error / remove */ +- ret = devm_add_action_or_reset(&i2c->dev, rt5640_cancel_work, rt5640); ++ ret = devm_add_action_or_reset(&i2c->dev, rt5640_disable_irq_and_cancel_work, rt5640); + if (ret) + return ret; + +-- +2.43.0 + diff --git a/queue-6.11/asoc-codecs-wcd937x-add-missing-lo-switch-control.patch b/queue-6.11/asoc-codecs-wcd937x-add-missing-lo-switch-control.patch new file mode 100644 index 00000000000..bc192b4642f --- /dev/null +++ b/queue-6.11/asoc-codecs-wcd937x-add-missing-lo-switch-control.patch @@ -0,0 +1,44 @@ +From a31007b4bc1411cbf31b5dc951451b8d3ee1d2e4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 22 Oct 2024 04:31:30 +0100 +Subject: ASoC: codecs: wcd937x: add missing LO Switch control + +From: Alexey Klimov + +[ Upstream commit 041db4bbe04e8e0b48350b3bbbd9a799794d5c1e ] + +The wcd937x supports also AUX input but the control that sets correct +soundwire port for this is missing. This control is required for audio +playback, for instance, on qrb4210 RB2 board as well as on other +SoCs. + +Reported-by: Adam Skladowski +Reported-by: Prasad Kumpatla +Suggested-by: Adam Skladowski +Suggested-by: Prasad Kumpatla +Cc: Srinivas Kandagatla +Cc: Mohammad Rafi Shaik +Signed-off-by: Alexey Klimov +Link: https://patch.msgid.link/20241022033132.787416-2-alexey.klimov@linaro.org +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wcd937x.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/codecs/wcd937x.c b/sound/soc/codecs/wcd937x.c +index af296b77a723a..63b25c321a03d 100644 +--- a/sound/soc/codecs/wcd937x.c ++++ b/sound/soc/codecs/wcd937x.c +@@ -2049,6 +2049,8 @@ static const struct snd_kcontrol_new wcd937x_snd_controls[] = { + wcd937x_get_swr_port, wcd937x_set_swr_port), + SOC_SINGLE_EXT("HPHR Switch", WCD937X_HPH_R, 0, 1, 0, + wcd937x_get_swr_port, wcd937x_set_swr_port), ++ SOC_SINGLE_EXT("LO Switch", WCD937X_LO, 0, 1, 0, ++ wcd937x_get_swr_port, wcd937x_set_swr_port), + + SOC_SINGLE_EXT("ADC1 Switch", WCD937X_ADC1, 1, 1, 0, + wcd937x_get_swr_port, wcd937x_set_swr_port), +-- +2.43.0 + diff --git a/queue-6.11/asoc-codecs-wcd937x-relax-the-aux-pdm-watchdog.patch b/queue-6.11/asoc-codecs-wcd937x-relax-the-aux-pdm-watchdog.patch new file mode 100644 index 00000000000..1353c819f3c --- /dev/null +++ b/queue-6.11/asoc-codecs-wcd937x-relax-the-aux-pdm-watchdog.patch @@ -0,0 +1,107 @@ +From 2787a1d652f65a3c7d1836aedf29116fa42ad557 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 22 Oct 2024 04:31:31 +0100 +Subject: ASoC: codecs: wcd937x: relax the AUX PDM watchdog + +From: Alexey Klimov + +[ Upstream commit 107a5c853eef5336a9846e7dd2f9184b6e3c07c7 ] + +On a system with wcd937x, rxmacro and Qualcomm audio DSP, which is pretty +common set of devices on Qualcomm platforms, and due to the order of how +DAPM widgets are powered on (they are sorted), there is a small time window +when wcd937x chip is online and expects the flow of incoming data but +rxmacro is not yet online. When wcd937x is programmed to receive data +via AUX port then its AUX PDM watchdog is enabled in +wcd937x_codec_enable_aux_pa(). If due to some reasons the rxmacro and +soundwire machinery are delayed to start streaming data, then there is +a chance for this AUX PDM watchdog to reset the wcd937x codec. Such event +is not logged as a message and only wcd937x IRQ counter is increased +however there could be a lot of other reasons for that IRQ. +There is a similar opportunity for such delay during DAPM widgets power +down sequence. + +If wcd937x codec reset happens on the start of the playback, then there +will be no sound and if such reset happens at the end of a playback then +it may generate additional clicks and pops noises. + +On qrb4210 RB2 board without any debugging bits the wcd937x resets are +sometimes observed at the end of a playback though not always. +With some debugging messages or with some tracing enabled the AUX PDM +watchdog resets the wcd937x codec at the start of a playback and there +is no sound output at all. + +In this patch: + - TIMEOUT_SEL bit in PDM_WD_CTL2 register is set to increase the watchdog +reset delay to 100ms which eliminates the AUX PDM watchdog IRQs on +qrb4210 RB2 board completely and decreases the number of unwanted clicks +noises; + + - HOLD_OFF bit postpones triggering such watchdog IRQ till wcd937x codec +reset which usually happens at the end of a playback. This allows to +actually output some sound in case of debugging. + +Cc: Adam Skladowski +Cc: Mohammad Rafi Shaik +Cc: Prasad Kumpatla +Cc: Srinivas Kandagatla +Signed-off-by: Alexey Klimov +Link: https://patch.msgid.link/20241022033132.787416-3-alexey.klimov@linaro.org +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wcd937x.c | 10 ++++++++-- + sound/soc/codecs/wcd937x.h | 4 ++++ + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/codecs/wcd937x.c b/sound/soc/codecs/wcd937x.c +index 63b25c321a03d..3c1224d8f2dff 100644 +--- a/sound/soc/codecs/wcd937x.c ++++ b/sound/soc/codecs/wcd937x.c +@@ -715,12 +715,17 @@ static int wcd937x_codec_enable_aux_pa(struct snd_soc_dapm_widget *w, + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); + int hph_mode = wcd937x->hph_mode; ++ u8 val; + + switch (event) { + case SND_SOC_DAPM_PRE_PMU: ++ val = WCD937X_DIGITAL_PDM_WD_CTL2_EN | ++ WCD937X_DIGITAL_PDM_WD_CTL2_TIMEOUT_SEL | ++ WCD937X_DIGITAL_PDM_WD_CTL2_HOLD_OFF; + snd_soc_component_update_bits(component, + WCD937X_DIGITAL_PDM_WD_CTL2, +- BIT(0), BIT(0)); ++ WCD937X_DIGITAL_PDM_WD_CTL2_MASK, ++ val); + break; + case SND_SOC_DAPM_POST_PMU: + usleep_range(1000, 1010); +@@ -741,7 +746,8 @@ static int wcd937x_codec_enable_aux_pa(struct snd_soc_dapm_widget *w, + hph_mode); + snd_soc_component_update_bits(component, + WCD937X_DIGITAL_PDM_WD_CTL2, +- BIT(0), 0x00); ++ WCD937X_DIGITAL_PDM_WD_CTL2_MASK, ++ 0x00); + break; + } + +diff --git a/sound/soc/codecs/wcd937x.h b/sound/soc/codecs/wcd937x.h +index 37bff16e88ddd..a2bd47a93e507 100644 +--- a/sound/soc/codecs/wcd937x.h ++++ b/sound/soc/codecs/wcd937x.h +@@ -391,6 +391,10 @@ + #define WCD937X_DIGITAL_PDM_WD_CTL0 0x3465 + #define WCD937X_DIGITAL_PDM_WD_CTL1 0x3466 + #define WCD937X_DIGITAL_PDM_WD_CTL2 0x3467 ++#define WCD937X_DIGITAL_PDM_WD_CTL2_HOLD_OFF BIT(2) ++#define WCD937X_DIGITAL_PDM_WD_CTL2_TIMEOUT_SEL BIT(1) ++#define WCD937X_DIGITAL_PDM_WD_CTL2_EN BIT(0) ++#define WCD937X_DIGITAL_PDM_WD_CTL2_MASK GENMASK(2, 0) + #define WCD937X_DIGITAL_INTR_MODE 0x346A + #define WCD937X_DIGITAL_INTR_MASK_0 0x346B + #define WCD937X_DIGITAL_INTR_MASK_1 0x346C +-- +2.43.0 + diff --git a/queue-6.11/asoc-intel-bytcr_rt5640-add-dmi-quirk-for-vexia-edu-.patch b/queue-6.11/asoc-intel-bytcr_rt5640-add-dmi-quirk-for-vexia-edu-.patch new file mode 100644 index 00000000000..5adb7feff18 --- /dev/null +++ b/queue-6.11/asoc-intel-bytcr_rt5640-add-dmi-quirk-for-vexia-edu-.patch @@ -0,0 +1,53 @@ +From 85fcbc0a489a5e6319b616d045da29011329e08e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 24 Oct 2024 23:16:15 +0200 +Subject: ASoC: Intel: bytcr_rt5640: Add DMI quirk for Vexia Edu Atla 10 tablet + +From: Hans de Goede + +[ Upstream commit 0107f28f135231da22a9ad5756bb16bd5cada4d5 ] + +The Vexia Edu Atla 10 tablet mostly uses the BYTCR tablet defaults, +but as happens on more models it is using IN1 instead of IN3 for +its internal mic and JD_SRC_JD2_IN4N instead of JD_SRC_JD1_IN4P +for jack-detection. + +Add a DMI quirk for this to fix the internal-mic and jack-detection. + +Signed-off-by: Hans de Goede +Link: https://patch.msgid.link/20241024211615.79518-2-hdegoede@redhat.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/boards/bytcr_rt5640.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c +index ba4293ae7c24f..2e786836588fb 100644 +--- a/sound/soc/intel/boards/bytcr_rt5640.c ++++ b/sound/soc/intel/boards/bytcr_rt5640.c +@@ -1132,6 +1132,21 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { + BYT_RT5640_SSP0_AIF2 | + BYT_RT5640_MCLK_EN), + }, ++ { /* Vexia Edu Atla 10 tablet */ ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), ++ DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"), ++ /* Above strings are too generic, also match on BIOS date */ ++ DMI_MATCH(DMI_BIOS_DATE, "08/25/2014"), ++ }, ++ .driver_data = (void *)(BYT_RT5640_IN1_MAP | ++ BYT_RT5640_JD_SRC_JD2_IN4N | ++ BYT_RT5640_OVCD_TH_2000UA | ++ BYT_RT5640_OVCD_SF_0P75 | ++ BYT_RT5640_DIFF_MIC | ++ BYT_RT5640_SSP0_AIF2 | ++ BYT_RT5640_MCLK_EN), ++ }, + { /* Voyo Winpad A15 */ + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), +-- +2.43.0 + diff --git a/queue-6.11/asoc-intel-bytcr_rt5640-add-support-for-non-acpi-ins.patch b/queue-6.11/asoc-intel-bytcr_rt5640-add-support-for-non-acpi-ins.patch new file mode 100644 index 00000000000..d2229eb1010 --- /dev/null +++ b/queue-6.11/asoc-intel-bytcr_rt5640-add-support-for-non-acpi-ins.patch @@ -0,0 +1,93 @@ +From 42a99548e8afb575331ded032692ed7bfb79f575 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 24 Oct 2024 23:16:14 +0200 +Subject: ASoC: Intel: bytcr_rt5640: Add support for non ACPI instantiated + codec +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Hans de Goede + +[ Upstream commit d48696b915527b5bcdd207a299aec03fb037eb17 ] + +On some x86 Bay Trail tablets which shipped with Android as factory OS, +the DSDT is so broken that the codec needs to be manually instantatiated +by the special x86-android-tablets.ko "fixup" driver for cases like this. + +This means that the codec-dev cannot be retrieved through its ACPI fwnode, +add support to the bytcr_rt5640 machine driver for such manually +instantiated rt5640 i2c_clients. + +An example of a tablet which needs this is the Vexia EDU ATLA 10 tablet, +which has been distributed to schools in the Spanish Andalucía region. + +Signed-off-by: Hans de Goede +Link: https://patch.msgid.link/20241024211615.79518-1-hdegoede@redhat.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/boards/bytcr_rt5640.c | 33 ++++++++++++++++++++++++--- + 1 file changed, 30 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c +index 4479825c08b5e..ba4293ae7c24f 100644 +--- a/sound/soc/intel/boards/bytcr_rt5640.c ++++ b/sound/soc/intel/boards/bytcr_rt5640.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -32,6 +33,8 @@ + #include "../atom/sst-atom-controls.h" + #include "../common/soc-intel-quirks.h" + ++#define BYT_RT5640_FALLBACK_CODEC_DEV_NAME "i2c-rt5640" ++ + enum { + BYT_RT5640_DMIC1_MAP, + BYT_RT5640_DMIC2_MAP, +@@ -1698,9 +1701,33 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) + + codec_dev = acpi_get_first_physical_node(adev); + acpi_dev_put(adev); +- if (!codec_dev) +- return -EPROBE_DEFER; +- priv->codec_dev = get_device(codec_dev); ++ ++ if (codec_dev) { ++ priv->codec_dev = get_device(codec_dev); ++ } else { ++ /* ++ * Special case for Android tablets where the codec i2c_client ++ * has been manually instantiated by x86_android_tablets.ko due ++ * to a broken DSDT. ++ */ ++ codec_dev = bus_find_device_by_name(&i2c_bus_type, NULL, ++ BYT_RT5640_FALLBACK_CODEC_DEV_NAME); ++ if (!codec_dev) ++ return -EPROBE_DEFER; ++ ++ if (!i2c_verify_client(codec_dev)) { ++ dev_err(dev, "Error '%s' is not an i2c_client\n", ++ BYT_RT5640_FALLBACK_CODEC_DEV_NAME); ++ put_device(codec_dev); ++ } ++ ++ /* fixup codec name */ ++ strscpy(byt_rt5640_codec_name, BYT_RT5640_FALLBACK_CODEC_DEV_NAME, ++ sizeof(byt_rt5640_codec_name)); ++ ++ /* bus_find_device() returns a reference no need to get() */ ++ priv->codec_dev = codec_dev; ++ } + + /* + * swap SSP0 if bytcr is detected +-- +2.43.0 + diff --git a/queue-6.11/asoc-intel-sst-support-lpe0f28-acpi-hid.patch b/queue-6.11/asoc-intel-sst-support-lpe0f28-acpi-hid.patch new file mode 100644 index 00000000000..9c00c76cf71 --- /dev/null +++ b/queue-6.11/asoc-intel-sst-support-lpe0f28-acpi-hid.patch @@ -0,0 +1,146 @@ +From 4e459a6542fd1ff2395cca3ab1c86bc656b62608 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 25 Oct 2024 11:02:21 +0200 +Subject: ASoC: Intel: sst: Support LPE0F28 ACPI HID +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Hans de Goede + +[ Upstream commit 6668610b4d8ce9a3ee3ed61a9471f62fb5f05bf9 ] + +Some old Bay Trail tablets which shipped with Android as factory OS +have the SST/LPE audio engine described by an ACPI device with a +HID (Hardware-ID) of LPE0F28 instead of 80860F28. + +Add support for this. Note this uses a new sst_res_info for just +the LPE0F28 case because it has a different layout for the IO-mem ACPI +resources then the 80860F28. + +An example of a tablet which needs this is the Vexia EDU ATLA 10 tablet, +which has been distributed to schools in the Spanish Andalucía region. + +Signed-off-by: Hans de Goede +Link: https://patch.msgid.link/20241025090221.52198-1-hdegoede@redhat.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/hda/intel-dsp-config.c | 4 ++ + sound/soc/intel/atom/sst/sst_acpi.c | 64 +++++++++++++++++++++++++---- + 2 files changed, 59 insertions(+), 9 deletions(-) + +diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c +index 913880b090657..ee4157992f6bf 100644 +--- a/sound/hda/intel-dsp-config.c ++++ b/sound/hda/intel-dsp-config.c +@@ -732,6 +732,10 @@ static const struct config_entry acpi_config_table[] = { + #if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) || \ + IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) + /* BayTrail */ ++ { ++ .flags = FLAG_SST_OR_SOF_BYT, ++ .acpi_hid = "LPE0F28", ++ }, + { + .flags = FLAG_SST_OR_SOF_BYT, + .acpi_hid = "80860F28", +diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c +index 29d44c989e5fc..1f9bb1b84949d 100644 +--- a/sound/soc/intel/atom/sst/sst_acpi.c ++++ b/sound/soc/intel/atom/sst/sst_acpi.c +@@ -125,6 +125,28 @@ static const struct sst_res_info bytcr_res_info = { + .acpi_ipc_irq_index = 0 + }; + ++/* For "LPE0F28" ACPI device found on some Android factory OS models */ ++static const struct sst_res_info lpe8086_res_info = { ++ .shim_offset = 0x140000, ++ .shim_size = 0x000100, ++ .shim_phy_addr = SST_BYT_SHIM_PHY_ADDR, ++ .ssp0_offset = 0xa0000, ++ .ssp0_size = 0x1000, ++ .dma0_offset = 0x98000, ++ .dma0_size = 0x4000, ++ .dma1_offset = 0x9c000, ++ .dma1_size = 0x4000, ++ .iram_offset = 0x0c0000, ++ .iram_size = 0x14000, ++ .dram_offset = 0x100000, ++ .dram_size = 0x28000, ++ .mbox_offset = 0x144000, ++ .mbox_size = 0x1000, ++ .acpi_lpe_res_index = 1, ++ .acpi_ddr_index = 0, ++ .acpi_ipc_irq_index = 0 ++}; ++ + static struct sst_platform_info byt_rvp_platform_data = { + .probe_data = &byt_fwparse_info, + .ipc_info = &byt_ipc_info, +@@ -268,10 +290,38 @@ static int sst_acpi_probe(struct platform_device *pdev) + mach->pdata = &chv_platform_data; + pdata = mach->pdata; + +- ret = kstrtouint(id->id, 16, &dev_id); +- if (ret < 0) { +- dev_err(dev, "Unique device id conversion error: %d\n", ret); +- return ret; ++ if (!strcmp(id->id, "LPE0F28")) { ++ struct resource *rsrc; ++ ++ /* Use regular BYT SST PCI VID:PID */ ++ dev_id = 0x80860F28; ++ byt_rvp_platform_data.res_info = &lpe8086_res_info; ++ ++ /* ++ * The "LPE0F28" ACPI device has separate IO-mem resources for: ++ * DDR, SHIM, MBOX, IRAM, DRAM, CFG ++ * None of which covers the entire LPE base address range. ++ * lpe8086_res_info.acpi_lpe_res_index points to the SHIM. ++ * Patch this to cover the entire base address range as expected ++ * by sst_platform_get_resources(). ++ */ ++ rsrc = platform_get_resource(pdev, IORESOURCE_MEM, ++ pdata->res_info->acpi_lpe_res_index); ++ if (!rsrc) { ++ dev_err(ctx->dev, "Invalid SHIM base\n"); ++ return -EIO; ++ } ++ rsrc->start -= pdata->res_info->shim_offset; ++ rsrc->end = rsrc->start + 0x200000 - 1; ++ } else { ++ ret = kstrtouint(id->id, 16, &dev_id); ++ if (ret < 0) { ++ dev_err(dev, "Unique device id conversion error: %d\n", ret); ++ return ret; ++ } ++ ++ if (soc_intel_is_byt_cr(pdev)) ++ byt_rvp_platform_data.res_info = &bytcr_res_info; + } + + dev_dbg(dev, "ACPI device id: %x\n", dev_id); +@@ -280,11 +330,6 @@ static int sst_acpi_probe(struct platform_device *pdev) + if (ret < 0) + return ret; + +- if (soc_intel_is_byt_cr(pdev)) { +- /* override resource info */ +- byt_rvp_platform_data.res_info = &bytcr_res_info; +- } +- + /* update machine parameters */ + mach->mach_params.acpi_ipc_irq_index = + pdata->res_info->acpi_ipc_irq_index; +@@ -344,6 +389,7 @@ static void sst_acpi_remove(struct platform_device *pdev) + } + + static const struct acpi_device_id sst_acpi_ids[] = { ++ { "LPE0F28", (unsigned long)&snd_soc_acpi_intel_baytrail_machines}, + { "80860F28", (unsigned long)&snd_soc_acpi_intel_baytrail_machines}, + { "808622A8", (unsigned long)&snd_soc_acpi_intel_cherrytrail_machines}, + { }, +-- +2.43.0 + diff --git a/queue-6.11/asoc-max9768-fix-event-generation-for-playback-mute.patch b/queue-6.11/asoc-max9768-fix-event-generation-for-playback-mute.patch new file mode 100644 index 00000000000..bd35fb9c76d --- /dev/null +++ b/queue-6.11/asoc-max9768-fix-event-generation-for-playback-mute.patch @@ -0,0 +1,49 @@ +From b4346b2960126bc34e63420858dc44f33f93bfe3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 12 Nov 2024 13:09:50 +0000 +Subject: ASoC: max9768: Fix event generation for playback mute + +From: Mark Brown + +[ Upstream commit 2ae6da569e34e1d26c5275442d17ffd75fd343b3 ] + +The max9768 has a custom control for playback mute which unconditionally +returns 0 from the put() operation, rather than returning 1 on change to +ensure notifications are generated to userspace. Check to see if the value +has changed and return appropriately. + +Signed-off-by: Mark Brown +Link: https://patch.msgid.link/20241112-asoc-max9768-event-v1-1-ba5d50599787@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/max9768.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/codecs/max9768.c b/sound/soc/codecs/max9768.c +index e4793a5d179ef..8af3c7e5317fb 100644 +--- a/sound/soc/codecs/max9768.c ++++ b/sound/soc/codecs/max9768.c +@@ -54,10 +54,17 @@ static int max9768_set_gpio(struct snd_kcontrol *kcontrol, + { + struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol); + struct max9768 *max9768 = snd_soc_component_get_drvdata(c); ++ bool val = !ucontrol->value.integer.value[0]; ++ int ret; + +- gpiod_set_value_cansleep(max9768->mute, !ucontrol->value.integer.value[0]); ++ if (val != gpiod_get_value_cansleep(max9768->mute)) ++ ret = 1; ++ else ++ ret = 0; + +- return 0; ++ gpiod_set_value_cansleep(max9768->mute, val); ++ ++ return ret; + } + + static const DECLARE_TLV_DB_RANGE(volume_tlv, +-- +2.43.0 + diff --git a/queue-6.11/asoc-stm-prevent-potential-division-by-zero-in-stm32.patch b/queue-6.11/asoc-stm-prevent-potential-division-by-zero-in-stm32.patch new file mode 100644 index 00000000000..62ead7427b9 --- /dev/null +++ b/queue-6.11/asoc-stm-prevent-potential-division-by-zero-in-stm32.patch @@ -0,0 +1,40 @@ +From 48561fbf0063f2c5d15a79f174b53d7a7c3a711a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Nov 2024 09:46:54 +0800 +Subject: ASoC: stm: Prevent potential division by zero in + stm32_sai_mclk_round_rate() + +From: Luo Yifan + +[ Upstream commit 63c1c87993e0e5bb11bced3d8224446a2bc62338 ] + +This patch checks if div is less than or equal to zero (div <= 0). If +div is zero or negative, the function returns -EINVAL, ensuring the +division operation (*prate / div) is safe to perform. + +Signed-off-by: Luo Yifan +Link: https://patch.msgid.link/20241106014654.206860-1-luoyifan@cmss.chinamobile.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/stm/stm32_sai_sub.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c +index ad2492efb1cdc..19307812ec765 100644 +--- a/sound/soc/stm/stm32_sai_sub.c ++++ b/sound/soc/stm/stm32_sai_sub.c +@@ -378,8 +378,8 @@ static long stm32_sai_mclk_round_rate(struct clk_hw *hw, unsigned long rate, + int div; + + div = stm32_sai_get_clk_div(sai, *prate, rate); +- if (div < 0) +- return div; ++ if (div <= 0) ++ return -EINVAL; + + mclk->freq = *prate / div; + +-- +2.43.0 + diff --git a/queue-6.11/asoc-stm-prevent-potential-division-by-zero-in-stm32.patch-5750 b/queue-6.11/asoc-stm-prevent-potential-division-by-zero-in-stm32.patch-5750 new file mode 100644 index 00000000000..40eceacf124 --- /dev/null +++ b/queue-6.11/asoc-stm-prevent-potential-division-by-zero-in-stm32.patch-5750 @@ -0,0 +1,39 @@ +From 645c4608a9ce1cb290bd6e18d5d7b9f25c5e317c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Nov 2024 09:59:36 +0800 +Subject: ASoC: stm: Prevent potential division by zero in + stm32_sai_get_clk_div() + +From: Luo Yifan + +[ Upstream commit 23569c8b314925bdb70dd1a7b63cfe6100868315 ] + +This patch checks if div is less than or equal to zero (div <= 0). If +div is zero or negative, the function returns -EINVAL, ensuring the +division operation is safe to perform. + +Signed-off-by: Luo Yifan +Reviewed-by: Olivier Moysan +Link: https://patch.msgid.link/20241107015936.211902-1-luoyifan@cmss.chinamobile.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/stm/stm32_sai_sub.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c +index 19307812ec765..64f52c75e2aa8 100644 +--- a/sound/soc/stm/stm32_sai_sub.c ++++ b/sound/soc/stm/stm32_sai_sub.c +@@ -317,7 +317,7 @@ static int stm32_sai_get_clk_div(struct stm32_sai_sub_data *sai, + int div; + + div = DIV_ROUND_CLOSEST(input_rate, output_rate); +- if (div > SAI_XCR1_MCKDIV_MAX(version)) { ++ if (div > SAI_XCR1_MCKDIV_MAX(version) || div <= 0) { + dev_err(&sai->pdev->dev, "Divider %d out of range\n", div); + return -EINVAL; + } +-- +2.43.0 + diff --git a/queue-6.11/asoc-tas2781-add-new-driver-version-for-tas2563-tas2.patch b/queue-6.11/asoc-tas2781-add-new-driver-version-for-tas2563-tas2.patch new file mode 100644 index 00000000000..1154425dce2 --- /dev/null +++ b/queue-6.11/asoc-tas2781-add-new-driver-version-for-tas2563-tas2.patch @@ -0,0 +1,34 @@ +From fd8bf1b4e69ea621ca7ca8bfbf47cfa6dfe8065e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 4 Nov 2024 18:00:55 +0800 +Subject: ASoC: tas2781: Add new driver version for tas2563 & tas2781 qfn chip + +From: Shenghao Ding + +[ Upstream commit fe09de2db2365eed8b44b572cff7d421eaf1754a ] + +Add new driver version to support tas2563 & tas2781 qfn chip + +Signed-off-by: Shenghao Ding +Link: https://patch.msgid.link/20241104100055.48-1-shenghao-ding@ti.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/tas2781-fmwlib.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/codecs/tas2781-fmwlib.c b/sound/soc/codecs/tas2781-fmwlib.c +index f3a7605f07104..6474cc551d551 100644 +--- a/sound/soc/codecs/tas2781-fmwlib.c ++++ b/sound/soc/codecs/tas2781-fmwlib.c +@@ -1992,6 +1992,7 @@ static int tasdevice_dspfw_ready(const struct firmware *fmw, + break; + case 0x202: + case 0x400: ++ case 0x401: + tas_priv->fw_parse_variable_header = + fw_parse_variable_header_git; + tas_priv->fw_parse_program_data = +-- +2.43.0 + diff --git a/queue-6.11/bpf-fix-filed-access-without-lock.patch b/queue-6.11/bpf-fix-filed-access-without-lock.patch new file mode 100644 index 00000000000..eb658bc1303 --- /dev/null +++ b/queue-6.11/bpf-fix-filed-access-without-lock.patch @@ -0,0 +1,64 @@ +From d1544aa48a318cbfa0b3f03c128857a9aa0d82b1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 28 Oct 2024 14:52:26 +0800 +Subject: bpf: fix filed access without lock + +From: Jiayuan Chen + +[ Upstream commit a32aee8f0d987a7cba7fcc28002553361a392048 ] + +The tcp_bpf_recvmsg_parser() function, running in user context, +retrieves seq_copied from tcp_sk without holding the socket lock, and +stores it in a local variable seq. However, the softirq context can +modify tcp_sk->seq_copied concurrently, for example, n tcp_read_sock(). + +As a result, the seq value is stale when it is assigned back to +tcp_sk->copied_seq at the end of tcp_bpf_recvmsg_parser(), leading to +incorrect behavior. + +Due to concurrency, the copied_seq field in tcp_bpf_recvmsg_parser() +might be set to an incorrect value (less than the actual copied_seq) at +the end of function: 'WRITE_ONCE(tcp->copied_seq, seq)'. This causes the +'offset' to be negative in tcp_read_sock()->tcp_recv_skb() when +processing new incoming packets (sk->copied_seq - skb->seq becomes less +than 0), and all subsequent packets will be dropped. + +Signed-off-by: Jiayuan Chen +Link: https://lore.kernel.org/r/20241028065226.35568-1-mrpre@163.com +Signed-off-by: Martin KaFai Lau +Signed-off-by: Sasha Levin +--- + net/ipv4/tcp_bpf.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c +index fe6178715ba05..915286c3615a2 100644 +--- a/net/ipv4/tcp_bpf.c ++++ b/net/ipv4/tcp_bpf.c +@@ -221,11 +221,11 @@ static int tcp_bpf_recvmsg_parser(struct sock *sk, + int flags, + int *addr_len) + { +- struct tcp_sock *tcp = tcp_sk(sk); + int peek = flags & MSG_PEEK; +- u32 seq = tcp->copied_seq; + struct sk_psock *psock; ++ struct tcp_sock *tcp; + int copied = 0; ++ u32 seq; + + if (unlikely(flags & MSG_ERRQUEUE)) + return inet_recv_error(sk, msg, len, addr_len); +@@ -238,7 +238,8 @@ static int tcp_bpf_recvmsg_parser(struct sock *sk, + return tcp_recvmsg(sk, msg, len, flags, addr_len); + + lock_sock(sk); +- ++ tcp = tcp_sk(sk); ++ seq = tcp->copied_seq; + /* We may have received data on the sk_receive_queue pre-accept and + * then we can not use read_skb in this context because we haven't + * assigned a sk_socket yet so have no link to the ops. The work-around +-- +2.43.0 + diff --git a/queue-6.11/can-j1939-fix-error-in-j1939-documentation.patch b/queue-6.11/can-j1939-fix-error-in-j1939-documentation.patch new file mode 100644 index 00000000000..8fce08285d1 --- /dev/null +++ b/queue-6.11/can-j1939-fix-error-in-j1939-documentation.patch @@ -0,0 +1,40 @@ +From 1ce8efd6d9320fae13df2b8fe41ca5d51b5e45a8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 23 Oct 2024 16:52:57 +0200 +Subject: can: j1939: fix error in J1939 documentation. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alexander Hölzl + +[ Upstream commit b6ec62e01aa4229bc9d3861d1073806767ea7838 ] + +The description of PDU1 format usage mistakenly referred to PDU2 format. + +Signed-off-by: Alexander Hölzl +Acked-by: Oleksij Rempel +Acked-by: Vincent Mailhol +Link: https://patch.msgid.link/20241023145257.82709-1-alexander.hoelzl@gmx.net +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Sasha Levin +--- + Documentation/networking/j1939.rst | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Documentation/networking/j1939.rst b/Documentation/networking/j1939.rst +index e4bd7aa1f5aa9..544bad175aae2 100644 +--- a/Documentation/networking/j1939.rst ++++ b/Documentation/networking/j1939.rst +@@ -121,7 +121,7 @@ format, the Group Extension is set in the PS-field. + + On the other hand, when using PDU1 format, the PS-field contains a so-called + Destination Address, which is _not_ part of the PGN. When communicating a PGN +-from user space to kernel (or vice versa) and PDU2 format is used, the PS-field ++from user space to kernel (or vice versa) and PDU1 format is used, the PS-field + of the PGN shall be set to zero. The Destination Address shall be set + elsewhere. + +-- +2.43.0 + diff --git a/queue-6.11/drm-panel-orientation-quirks-make-lenovo-yoga-tab-3-.patch b/queue-6.11/drm-panel-orientation-quirks-make-lenovo-yoga-tab-3-.patch new file mode 100644 index 00000000000..5adaa9a51f6 --- /dev/null +++ b/queue-6.11/drm-panel-orientation-quirks-make-lenovo-yoga-tab-3-.patch @@ -0,0 +1,42 @@ +From 997742d5f1f2b38f7d5e04258157c4108633c952 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Aug 2024 15:21:31 +0200 +Subject: drm: panel-orientation-quirks: Make Lenovo Yoga Tab 3 X90F DMI match + less strict + +From: Hans de Goede + +[ Upstream commit 052ef642bd6c108a24f375f9ad174b97b425a50b ] + +There are 2G and 4G RAM versions of the Lenovo Yoga Tab 3 X90F and it +turns out that the 2G version has a DMI product name of +"CHERRYVIEW D1 PLATFORM" where as the 4G version has +"CHERRYVIEW C0 PLATFORM". The sys-vendor + product-version check are +unique enough that the product-name check is not necessary. + +Drop the product-name check so that the existing DMI match for the 4G +RAM version also matches the 2G RAM version. + +Signed-off-by: Hans de Goede +Acked-by: Jani Nikula +Link: https://patchwork.freedesktop.org/patch/msgid/20240825132131.6643-1-hdegoede@redhat.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/drm_panel_orientation_quirks.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c +index 0830cae9a4d0f..2d84d7ea1ab7a 100644 +--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c ++++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c +@@ -403,7 +403,6 @@ static const struct dmi_system_id orientation_data[] = { + }, { /* Lenovo Yoga Tab 3 X90F */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"), + }, + .driver_data = (void *)&lcd1600x2560_rightside_up, +-- +2.43.0 + diff --git a/queue-6.11/firmware-arm_scmi-reject-clear-channel-request-on-a2.patch b/queue-6.11/firmware-arm_scmi-reject-clear-channel-request-on-a2.patch new file mode 100644 index 00000000000..6606889f02a --- /dev/null +++ b/queue-6.11/firmware-arm_scmi-reject-clear-channel-request-on-a2.patch @@ -0,0 +1,73 @@ +From 4ef08650bf5ac8db2395c00a2dc6e6bd4ceeb702 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 21 Oct 2024 18:15:44 +0100 +Subject: firmware: arm_scmi: Reject clear channel request on A2P + +From: Cristian Marussi + +[ Upstream commit a0a18e91eb3a6ef75a6de69dc00f206b913e3848 ] + +The clear channel transport operation is supposed to be called exclusively +on the P2A channel from the agent, since it relinquishes the ownership of +the channel to the platform, after this latter has initiated some sort of +P2A communication. + +Make sure that, if it is ever called on a A2P, is logged and ignored. + +Signed-off-by: Cristian Marussi +Reviewed-by: Florian Fainelli +Message-Id: <20241021171544.2579551-1-cristian.marussi@arm.com> +Signed-off-by: Sudeep Holla +Signed-off-by: Sasha Levin +--- + drivers/firmware/arm_scmi/common.h | 2 ++ + drivers/firmware/arm_scmi/driver.c | 6 ++++++ + 2 files changed, 8 insertions(+) + +diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h +index 4b8c5250cdb57..cd30499b2555f 100644 +--- a/drivers/firmware/arm_scmi/common.h ++++ b/drivers/firmware/arm_scmi/common.h +@@ -163,6 +163,7 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id); + * used to initialize this channel + * @dev: Reference to device in the SCMI hierarchy corresponding to this + * channel ++ * @is_p2a: A flag to identify a channel as P2A (RX) + * @rx_timeout_ms: The configured RX timeout in milliseconds. + * @handle: Pointer to SCMI entity handle + * @no_completion_irq: Flag to indicate that this channel has no completion +@@ -174,6 +175,7 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id); + struct scmi_chan_info { + int id; + struct device *dev; ++ bool is_p2a; + unsigned int rx_timeout_ms; + struct scmi_handle *handle; + bool no_completion_irq; +diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c +index dc09f2d755f41..80b44bd1a3f3e 100644 +--- a/drivers/firmware/arm_scmi/driver.c ++++ b/drivers/firmware/arm_scmi/driver.c +@@ -1034,6 +1034,11 @@ static inline void scmi_xfer_command_release(struct scmi_info *info, + static inline void scmi_clear_channel(struct scmi_info *info, + struct scmi_chan_info *cinfo) + { ++ if (!cinfo->is_p2a) { ++ dev_warn(cinfo->dev, "Invalid clear on A2P channel !\n"); ++ return; ++ } ++ + if (info->desc->ops->clear_channel) + info->desc->ops->clear_channel(cinfo); + } +@@ -2614,6 +2619,7 @@ static int scmi_chan_setup(struct scmi_info *info, struct device_node *of_node, + if (!cinfo) + return -ENOMEM; + ++ cinfo->is_p2a = !tx; + cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms; + + /* Create a unique name for this transport device */ +-- +2.43.0 + diff --git a/queue-6.11/integrity-use-static_assert-to-check-struct-sizes.patch b/queue-6.11/integrity-use-static_assert-to-check-struct-sizes.patch new file mode 100644 index 00000000000..28f840a8573 --- /dev/null +++ b/queue-6.11/integrity-use-static_assert-to-check-struct-sizes.patch @@ -0,0 +1,53 @@ +From b834e782f2ef82fe57456805bb99798937e30fa7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Aug 2024 16:04:59 -0600 +Subject: integrity: Use static_assert() to check struct sizes + +From: Gustavo A. R. Silva + +[ Upstream commit 08ae3e5f5fc8edb9bd0c7ef9696ff29ef18b26ef ] + +Commit 38aa3f5ac6d2 ("integrity: Avoid -Wflex-array-member-not-at-end +warnings") introduced tagged `struct evm_ima_xattr_data_hdr` and +`struct ima_digest_data_hdr`. We want to ensure that when new members +need to be added to the flexible structures, they are always included +within these tagged structs. + +So, we use `static_assert()` to ensure that the memory layout for +both the flexible structure and the tagged struct is the same after +any changes. + +Signed-off-by: Gustavo A. R. Silva +Tested-by: Roberto Sassu +Reviewed-by: Roberto Sassu +Signed-off-by: Mimi Zohar +Signed-off-by: Sasha Levin +--- + security/integrity/integrity.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h +index 660f76cb69d37..c2c2da6911233 100644 +--- a/security/integrity/integrity.h ++++ b/security/integrity/integrity.h +@@ -37,6 +37,8 @@ struct evm_ima_xattr_data { + ); + u8 data[]; + } __packed; ++static_assert(offsetof(struct evm_ima_xattr_data, data) == sizeof(struct evm_ima_xattr_data_hdr), ++ "struct member likely outside of __struct_group()"); + + /* Only used in the EVM HMAC code. */ + struct evm_xattr { +@@ -65,6 +67,8 @@ struct ima_digest_data { + ); + u8 digest[]; + } __packed; ++static_assert(offsetof(struct ima_digest_data, digest) == sizeof(struct ima_digest_data_hdr), ++ "struct member likely outside of __struct_group()"); + + /* + * Instead of wrapping the ima_digest_data struct inside a local structure +-- +2.43.0 + diff --git a/queue-6.11/ipmr-fix-access-to-mfc_cache_list-without-lock-held.patch b/queue-6.11/ipmr-fix-access-to-mfc_cache_list-without-lock-held.patch new file mode 100644 index 00000000000..73b332c3911 --- /dev/null +++ b/queue-6.11/ipmr-fix-access-to-mfc_cache_list-without-lock-held.patch @@ -0,0 +1,76 @@ +From 9ce9ccc5d7cda0a9dd4d08f716c78b8683457e1f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Nov 2024 06:08:36 -0800 +Subject: ipmr: Fix access to mfc_cache_list without lock held + +From: Breno Leitao + +[ Upstream commit e28acc9c1ccfcb24c08e020828f69d0a915b06ae ] + +Accessing `mr_table->mfc_cache_list` is protected by an RCU lock. In the +following code flow, the RCU read lock is not held, causing the +following error when `RCU_PROVE` is not held. The same problem might +show up in the IPv6 code path. + + 6.12.0-rc5-kbuilder-01145-gbac17284bdcb #33 Tainted: G E N + ----------------------------- + net/ipv4/ipmr_base.c:313 RCU-list traversed in non-reader section!! + + rcu_scheduler_active = 2, debug_locks = 1 + 2 locks held by RetransmitAggre/3519: + #0: ffff88816188c6c0 (nlk_cb_mutex-ROUTE){+.+.}-{3:3}, at: __netlink_dump_start+0x8a/0x290 + #1: ffffffff83fcf7a8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_dumpit+0x6b/0x90 + + stack backtrace: + lockdep_rcu_suspicious + mr_table_dump + ipmr_rtm_dumproute + rtnl_dump_all + rtnl_dumpit + netlink_dump + __netlink_dump_start + rtnetlink_rcv_msg + netlink_rcv_skb + netlink_unicast + netlink_sendmsg + +This is not a problem per see, since the RTNL lock is held here, so, it +is safe to iterate in the list without the RCU read lock, as suggested +by Eric. + +To alleviate the concern, modify the code to use +list_for_each_entry_rcu() with the RTNL-held argument. + +The annotation will raise an error only if RTNL or RCU read lock are +missing during iteration, signaling a legitimate problem, otherwise it +will avoid this false positive. + +This will solve the IPv6 case as well, since ip6mr_rtm_dumproute() calls +this function as well. + +Signed-off-by: Breno Leitao +Reviewed-by: David Ahern +Link: https://patch.msgid.link/20241108-ipmr_rcu-v2-1-c718998e209b@debian.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/ipv4/ipmr_base.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/ipv4/ipmr_base.c b/net/ipv4/ipmr_base.c +index 271dc03fc6dbd..f0af12a2f70bc 100644 +--- a/net/ipv4/ipmr_base.c ++++ b/net/ipv4/ipmr_base.c +@@ -310,7 +310,8 @@ int mr_table_dump(struct mr_table *mrt, struct sk_buff *skb, + if (filter->filter_set) + flags |= NLM_F_DUMP_FILTERED; + +- list_for_each_entry_rcu(mfc, &mrt->mfc_cache_list, list) { ++ list_for_each_entry_rcu(mfc, &mrt->mfc_cache_list, list, ++ lockdep_rtnl_is_held()) { + if (e < s_e) + goto next_entry; + if (filter->dev && +-- +2.43.0 + diff --git a/queue-6.11/loongarch-define-a-default-value-for-vm_data_default.patch b/queue-6.11/loongarch-define-a-default-value-for-vm_data_default.patch new file mode 100644 index 00000000000..1a67319ccbe --- /dev/null +++ b/queue-6.11/loongarch-define-a-default-value-for-vm_data_default.patch @@ -0,0 +1,42 @@ +From dbc1a55047cf28464f8365cb375177928fc157d8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 12 Nov 2024 16:35:39 +0800 +Subject: LoongArch: Define a default value for VM_DATA_DEFAULT_FLAGS + +From: Yuli Wang + +[ Upstream commit c859900a841b0a6cd9a73d16426465e44cdde29c ] + +This is a trivial cleanup, commit c62da0c35d58518d ("mm/vma: define a +default value for VM_DATA_DEFAULT_FLAGS") has unified default values of +VM_DATA_DEFAULT_FLAGS across different platforms. + +Apply the same consistency to LoongArch. + +Suggested-by: Wentao Guan +Signed-off-by: Yuli Wang +Signed-off-by: Huacai Chen +Signed-off-by: Sasha Levin +--- + arch/loongarch/include/asm/page.h | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/arch/loongarch/include/asm/page.h b/arch/loongarch/include/asm/page.h +index e85df33f11c77..8f21567a3188b 100644 +--- a/arch/loongarch/include/asm/page.h ++++ b/arch/loongarch/include/asm/page.h +@@ -113,10 +113,7 @@ struct page *tlb_virt_to_page(unsigned long kaddr); + extern int __virt_addr_valid(volatile void *kaddr); + #define virt_addr_valid(kaddr) __virt_addr_valid((volatile void *)(kaddr)) + +-#define VM_DATA_DEFAULT_FLAGS \ +- (VM_READ | VM_WRITE | \ +- ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \ +- VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) ++#define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_TSK_EXEC + + #include + #include +-- +2.43.0 + diff --git a/queue-6.11/loongarch-for-all-possible-cpus-setup-logical-physic.patch b/queue-6.11/loongarch-for-all-possible-cpus-setup-logical-physic.patch new file mode 100644 index 00000000000..52e7aabea5d --- /dev/null +++ b/queue-6.11/loongarch-for-all-possible-cpus-setup-logical-physic.patch @@ -0,0 +1,212 @@ +From 5d6be44e4c59f7d624efdba98ff0472278f43bb6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 12 Nov 2024 16:35:36 +0800 +Subject: LoongArch: For all possible CPUs setup logical-physical CPU mapping + +From: Huacai Chen + +[ Upstream commit a6654a40a852a4ca18aacced4cf5ca87997818d7 ] + +In order to support ACPI-based physical CPU hotplug, we suppose for all +"possible" CPUs cpu_logical_map() can work. Because some drivers want to +use cpu_logical_map() for all "possible" CPUs, while currently we only +setup logical-physical mapping for "present" CPUs. This lack of mapping +also causes cpu_to_node() cannot work for hot-added CPUs. + +All "possible" CPUs are listed in MADT, and the "present" subset is +marked as ACPI_MADT_ENABLED. To setup logical-physical CPU mapping for +all possible CPUs and keep present CPUs continuous in cpu_present_mask, +we parse MADT twice. The first pass handles CPUs with ACPI_MADT_ENABLED +and the second pass handles CPUs without ACPI_MADT_ENABLED. + +The global flag (cpu_enumerated) is removed because acpi_map_cpu() calls +cpu_number_map() rather than set_processor_mask() now. + +Reported-by: Bibo Mao +Signed-off-by: Huacai Chen +Signed-off-by: Sasha Levin +--- + arch/loongarch/kernel/acpi.c | 81 +++++++++++++++++++++++------------- + arch/loongarch/kernel/smp.c | 3 +- + 2 files changed, 55 insertions(+), 29 deletions(-) + +diff --git a/arch/loongarch/kernel/acpi.c b/arch/loongarch/kernel/acpi.c +index 929a497c987e8..de9e34414e614 100644 +--- a/arch/loongarch/kernel/acpi.c ++++ b/arch/loongarch/kernel/acpi.c +@@ -57,48 +57,48 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) + return ioremap_cache(phys, size); + } + +-static int cpu_enumerated = 0; +- + #ifdef CONFIG_SMP +-static int set_processor_mask(u32 id, u32 flags) ++static int set_processor_mask(u32 id, u32 pass) + { +- int nr_cpus; +- int cpu, cpuid = id; +- +- if (!cpu_enumerated) +- nr_cpus = NR_CPUS; +- else +- nr_cpus = nr_cpu_ids; ++ int cpu = -1, cpuid = id; + +- if (num_processors >= nr_cpus) { ++ if (num_processors >= NR_CPUS) { + pr_warn(PREFIX "nr_cpus limit of %i reached." +- " processor 0x%x ignored.\n", nr_cpus, cpuid); ++ " processor 0x%x ignored.\n", NR_CPUS, cpuid); + + return -ENODEV; + + } ++ + if (cpuid == loongson_sysconf.boot_cpu_id) + cpu = 0; +- else +- cpu = find_first_zero_bit(cpumask_bits(cpu_present_mask), NR_CPUS); +- +- if (!cpu_enumerated) +- set_cpu_possible(cpu, true); + +- if (flags & ACPI_MADT_ENABLED) { ++ switch (pass) { ++ case 1: /* Pass 1 handle enabled processors */ ++ if (cpu < 0) ++ cpu = find_first_zero_bit(cpumask_bits(cpu_present_mask), NR_CPUS); + num_processors++; + set_cpu_present(cpu, true); +- __cpu_number_map[cpuid] = cpu; +- __cpu_logical_map[cpu] = cpuid; +- } else ++ break; ++ case 2: /* Pass 2 handle disabled processors */ ++ if (cpu < 0) ++ cpu = find_first_zero_bit(cpumask_bits(cpu_possible_mask), NR_CPUS); + disabled_cpus++; ++ break; ++ default: ++ return cpu; ++ } ++ ++ set_cpu_possible(cpu, true); ++ __cpu_number_map[cpuid] = cpu; ++ __cpu_logical_map[cpu] = cpuid; + + return cpu; + } + #endif + + static int __init +-acpi_parse_processor(union acpi_subtable_headers *header, const unsigned long end) ++acpi_parse_p1_processor(union acpi_subtable_headers *header, const unsigned long end) + { + struct acpi_madt_core_pic *processor = NULL; + +@@ -109,12 +109,29 @@ acpi_parse_processor(union acpi_subtable_headers *header, const unsigned long en + acpi_table_print_madt_entry(&header->common); + #ifdef CONFIG_SMP + acpi_core_pic[processor->core_id] = *processor; +- set_processor_mask(processor->core_id, processor->flags); ++ if (processor->flags & ACPI_MADT_ENABLED) ++ set_processor_mask(processor->core_id, 1); + #endif + + return 0; + } + ++static int __init ++acpi_parse_p2_processor(union acpi_subtable_headers *header, const unsigned long end) ++{ ++ struct acpi_madt_core_pic *processor = NULL; ++ ++ processor = (struct acpi_madt_core_pic *)header; ++ if (BAD_MADT_ENTRY(processor, end)) ++ return -EINVAL; ++ ++#ifdef CONFIG_SMP ++ if (!(processor->flags & ACPI_MADT_ENABLED)) ++ set_processor_mask(processor->core_id, 2); ++#endif ++ ++ return 0; ++} + static int __init + acpi_parse_eio_master(union acpi_subtable_headers *header, const unsigned long end) + { +@@ -142,12 +159,14 @@ static void __init acpi_process_madt(void) + } + #endif + acpi_table_parse_madt(ACPI_MADT_TYPE_CORE_PIC, +- acpi_parse_processor, MAX_CORE_PIC); ++ acpi_parse_p1_processor, MAX_CORE_PIC); ++ ++ acpi_table_parse_madt(ACPI_MADT_TYPE_CORE_PIC, ++ acpi_parse_p2_processor, MAX_CORE_PIC); + + acpi_table_parse_madt(ACPI_MADT_TYPE_EIO_PIC, + acpi_parse_eio_master, MAX_IO_PICS); + +- cpu_enumerated = 1; + loongson_sysconf.nr_cpus = num_processors; + } + +@@ -306,6 +325,10 @@ static int __ref acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) + int nid; + + nid = acpi_get_node(handle); ++ ++ if (nid != NUMA_NO_NODE) ++ nid = early_cpu_to_node(cpu); ++ + if (nid != NUMA_NO_NODE) { + set_cpuid_to_node(physid, nid); + node_set(nid, numa_nodes_parsed); +@@ -320,12 +343,14 @@ int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 acpi_id, int *pcpu + { + int cpu; + +- cpu = set_processor_mask(physid, ACPI_MADT_ENABLED); +- if (cpu < 0) { ++ cpu = cpu_number_map(physid); ++ if (cpu < 0 || cpu >= nr_cpu_ids) { + pr_info(PREFIX "Unable to map lapic to logical cpu number\n"); +- return cpu; ++ return -ERANGE; + } + ++ num_processors++; ++ set_cpu_present(cpu, true); + acpi_map_cpu2node(handle, cpu, physid); + + *pcpu = cpu; +diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c +index b1329fe01fae9..5a8cb31a4e6b7 100644 +--- a/arch/loongarch/kernel/smp.c ++++ b/arch/loongarch/kernel/smp.c +@@ -325,11 +325,11 @@ void __init loongson_prepare_cpus(unsigned int max_cpus) + int i = 0; + + parse_acpi_topology(); ++ cpu_data[0].global_id = cpu_logical_map(0); + + for (i = 0; i < loongson_sysconf.nr_cpus; i++) { + set_cpu_present(i, true); + csr_mail_send(0, __cpu_logical_map[i], 0); +- cpu_data[i].global_id = __cpu_logical_map[i]; + } + + per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; +@@ -374,6 +374,7 @@ void loongson_init_secondary(void) + cpu_logical_map(cpu) / loongson_sysconf.cores_per_package; + cpu_data[cpu].core = pptt_enabled ? cpu_data[cpu].core : + cpu_logical_map(cpu) % loongson_sysconf.cores_per_package; ++ cpu_data[cpu].global_id = cpu_logical_map(cpu); + } + + void loongson_smp_finish(void) +-- +2.43.0 + diff --git a/queue-6.11/mac80211-fix-user-power-when-emulating-chanctx.patch b/queue-6.11/mac80211-fix-user-power-when-emulating-chanctx.patch new file mode 100644 index 00000000000..79a84bf369a --- /dev/null +++ b/queue-6.11/mac80211-fix-user-power-when-emulating-chanctx.patch @@ -0,0 +1,37 @@ +From 3258daa8cb04bd4442e1cf6076a9f097f8b65d3d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 10 Oct 2024 13:39:54 -0700 +Subject: mac80211: fix user-power when emulating chanctx + +From: Ben Greear + +[ Upstream commit 9b15c6cf8d2e82c8427cd06f535d8de93b5b995c ] + +ieee80211_calc_hw_conf_chan was ignoring the configured +user_txpower. If it is set, use it to potentially decrease +txpower as requested. + +Signed-off-by: Ben Greear +Link: https://patch.msgid.link/20241010203954.1219686-1-greearb@candelatech.com +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/main.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/mac80211/main.c b/net/mac80211/main.c +index a3104b6ea6f0b..9ce942f3a4a4e 100644 +--- a/net/mac80211/main.c ++++ b/net/mac80211/main.c +@@ -167,6 +167,8 @@ static u32 ieee80211_calc_hw_conf_chan(struct ieee80211_local *local, + } + + power = ieee80211_chandef_max_power(&chandef); ++ if (local->user_power_level != IEEE80211_UNSET_POWER_LEVEL) ++ power = min(local->user_power_level, power); + + rcu_read_lock(); + list_for_each_entry_rcu(sdata, &local->interfaces, list) { +-- +2.43.0 + diff --git a/queue-6.11/net-usb-qmi_wwan-add-quectel-rg650v.patch b/queue-6.11/net-usb-qmi_wwan-add-quectel-rg650v.patch new file mode 100644 index 00000000000..70fb00973ee --- /dev/null +++ b/queue-6.11/net-usb-qmi_wwan-add-quectel-rg650v.patch @@ -0,0 +1,65 @@ +From a9d49a85edf9646eaaab7c21575a225f195d49d3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 24 Oct 2024 17:11:13 +0200 +Subject: net: usb: qmi_wwan: add Quectel RG650V +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Benoît Monin + +[ Upstream commit 6b3f18a76be6bbd237c7594cf0bf2912b68084fe ] + +Add support for Quectel RG650V which is based on Qualcomm SDX65 chip. +The composition is DIAG / NMEA / AT / AT / QMI. + +T: Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 4 Spd=5000 MxCh= 0 +D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 +P: Vendor=2c7c ProdID=0122 Rev=05.15 +S: Manufacturer=Quectel +S: Product=RG650V-EU +S: SerialNumber=xxxxxxx +C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA +I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option +E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=9ms +I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=85(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=9ms +I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan +E: Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=87(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=88(I) Atr=03(Int.) MxPS= 8 Ivl=9ms + +Signed-off-by: Benoît Monin +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/20241024151113.53203-1-benoit.monin@gmx.fr +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/usb/qmi_wwan.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index f137c82f1c0f7..0c011d8f5d4db 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -1076,6 +1076,7 @@ static const struct usb_device_id products[] = { + USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7), + .driver_info = (unsigned long)&qmi_wwan_info, + }, ++ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0122)}, /* Quectel RG650V */ + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ +-- +2.43.0 + diff --git a/queue-6.11/platform-x86-dell-smbios-base-extends-support-to-ali.patch b/queue-6.11/platform-x86-dell-smbios-base-extends-support-to-ali.patch new file mode 100644 index 00000000000..884848c59da --- /dev/null +++ b/queue-6.11/platform-x86-dell-smbios-base-extends-support-to-ali.patch @@ -0,0 +1,51 @@ +From 6997b829174388ab9156f5ae1fa072ecdf971cbc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 31 Oct 2024 12:40:24 -0300 +Subject: platform/x86: dell-smbios-base: Extends support to Alienware products +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Kurt Borja + +[ Upstream commit a36b8b84ac4327b90ef5a22bc97cc96a92073330 ] + +Fixes the following error: + +dell_smbios: Unable to run on non-Dell system + +Which is triggered after dell-wmi driver fails to initialize on +Alienware systems, as it depends on dell-smbios. + +This effectively extends dell-wmi, dell-smbios and dcdbas support to +Alienware devices, that might share some features of the SMBIOS intereface +calling interface with other Dell products. + +Tested on an Alienware X15 R1. + +Signed-off-by: Kurt Borja +Reviewed-by: Mario Limonciello +Acked-by: Pali Rohár +Link: https://lore.kernel.org/r/20241031154023.6149-2-kuurtb@gmail.com +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/dell/dell-smbios-base.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/platform/x86/dell/dell-smbios-base.c b/drivers/platform/x86/dell/dell-smbios-base.c +index 73e41eb69cb57..01c72b91a50d4 100644 +--- a/drivers/platform/x86/dell/dell-smbios-base.c ++++ b/drivers/platform/x86/dell/dell-smbios-base.c +@@ -576,6 +576,7 @@ static int __init dell_smbios_init(void) + int ret, wmi, smm; + + if (!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL) && ++ !dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Alienware", NULL) && + !dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "www.dell.com", NULL)) { + pr_err("Unable to run on non-Dell system\n"); + return -ENODEV; +-- +2.43.0 + diff --git a/queue-6.11/platform-x86-dell-wmi-base-handle-meta-key-lock-unlo.patch b/queue-6.11/platform-x86-dell-wmi-base-handle-meta-key-lock-unlo.patch new file mode 100644 index 00000000000..1afd73e4670 --- /dev/null +++ b/queue-6.11/platform-x86-dell-wmi-base-handle-meta-key-lock-unlo.patch @@ -0,0 +1,52 @@ +From 27d6b5dc3860b37f2560bee9dfa71710d89ffd11 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 31 Oct 2024 12:44:42 -0300 +Subject: platform/x86: dell-wmi-base: Handle META key Lock/Unlock events +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Kurt Borja + +[ Upstream commit ec61f0bb4feec3345626a2b93b970b6719743997 ] + +Some Alienware devices have a key that locks/unlocks the Meta key. This +key triggers a WMI event that should be ignored by the kernel, as it's +handled by internally the firmware. + +There is no known way of changing this default behavior. The firmware +would lock/unlock the Meta key, regardless of how the event is handled. + +Tested on an Alienware x15 R1. + +Signed-off-by: Kurt Borja +Reviewed-by: Mario Limonciello +Acked-by: Pali Rohár +Link: https://lore.kernel.org/r/20241031154441.6663-2-kuurtb@gmail.com +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/dell/dell-wmi-base.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c +index 24fd7ffadda95..841a5414d28a6 100644 +--- a/drivers/platform/x86/dell/dell-wmi-base.c ++++ b/drivers/platform/x86/dell/dell-wmi-base.c +@@ -80,6 +80,12 @@ static const struct dmi_system_id dell_wmi_smbios_list[] __initconst = { + static const struct key_entry dell_wmi_keymap_type_0000[] = { + { KE_IGNORE, 0x003a, { KEY_CAPSLOCK } }, + ++ /* Meta key lock */ ++ { KE_IGNORE, 0xe000, { KEY_RIGHTMETA } }, ++ ++ /* Meta key unlock */ ++ { KE_IGNORE, 0xe001, { KEY_RIGHTMETA } }, ++ + /* Key code is followed by brightness level */ + { KE_KEY, 0xe005, { KEY_BRIGHTNESSDOWN } }, + { KE_KEY, 0xe006, { KEY_BRIGHTNESSUP } }, +-- +2.43.0 + diff --git a/queue-6.11/platform-x86-ideapad-laptop-add-missing-ideapad-pro-.patch b/queue-6.11/platform-x86-ideapad-laptop-add-missing-ideapad-pro-.patch new file mode 100644 index 00000000000..63da336781a --- /dev/null +++ b/queue-6.11/platform-x86-ideapad-laptop-add-missing-ideapad-pro-.patch @@ -0,0 +1,42 @@ +From a43b3d9cdfae3af19dd2e0ba2a16f9cbd808f0e9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 2 Nov 2024 18:31:16 +0000 +Subject: platform/x86: ideapad-laptop: add missing Ideapad Pro 5 fn keys + +From: Renato Caldas + +[ Upstream commit 36e66be874a7ea9d28fb9757629899a8449b8748 ] + +The scancodes for the Mic Mute and Airplane keys on the Ideapad Pro 5 +(14AHP9 at least, probably the other variants too) are different and +were not being picked up by the driver. This adds them to the keymap. + +Apart from what is already supported, the remaining fn keys are +unfortunately producing windows-specific key-combos. + +Signed-off-by: Renato Caldas +Link: https://lore.kernel.org/r/20241102183116.30142-1-renato@calgera.com +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/ideapad-laptop.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c +index b58df617d4fda..2fde38f506508 100644 +--- a/drivers/platform/x86/ideapad-laptop.c ++++ b/drivers/platform/x86/ideapad-laptop.c +@@ -1159,6 +1159,9 @@ static const struct key_entry ideapad_keymap[] = { + { KE_KEY, 0x27 | IDEAPAD_WMI_KEY, { KEY_HELP } }, + /* Refresh Rate Toggle */ + { KE_KEY, 0x0a | IDEAPAD_WMI_KEY, { KEY_REFRESH_RATE_TOGGLE } }, ++ /* Specific to some newer models */ ++ { KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } }, ++ { KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } }, + + { KE_END }, + }; +-- +2.43.0 + diff --git a/queue-6.11/platform-x86-thinkpad_acpi-fix-for-thinkpad-s-with-e.patch b/queue-6.11/platform-x86-thinkpad_acpi-fix-for-thinkpad-s-with-e.patch new file mode 100644 index 00000000000..add9ebe6883 --- /dev/null +++ b/queue-6.11/platform-x86-thinkpad_acpi-fix-for-thinkpad-s-with-e.patch @@ -0,0 +1,111 @@ +From fd26b84afd63212b174b55716a1df42437ded121 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Nov 2024 08:55:05 +0900 +Subject: platform/x86: thinkpad_acpi: Fix for ThinkPad's with ECFW showing + incorrect fan speed + +From: Vishnu Sankar + +[ Upstream commit 1be765b292577c752e0b87bf8c0e92aff6699d8e ] + +Fix for Thinkpad's with ECFW showing incorrect fan speed. Some models use +decimal instead of hexadecimal for the speed stored in the EC registers. +For example the rpm register will have 0x4200 instead of 0x1068, here +the actual RPM is "4200" in decimal. + +Add a quirk to handle this. + +Signed-off-by: Vishnu Sankar +Suggested-by: Mark Pearson +Link: https://lore.kernel.org/r/20241105235505.8493-1-vishnuocv@gmail.com +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/thinkpad_acpi.c | 28 +++++++++++++++++++++++++--- + 1 file changed, 25 insertions(+), 3 deletions(-) + +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c +index f269ca1ff7718..10e04424885eb 100644 +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -7912,6 +7912,7 @@ static u8 fan_control_resume_level; + static int fan_watchdog_maxinterval; + + static bool fan_with_ns_addr; ++static bool ecfw_with_fan_dec_rpm; + + static struct mutex fan_mutex; + +@@ -8554,7 +8555,11 @@ static ssize_t fan_fan1_input_show(struct device *dev, + if (res < 0) + return res; + +- return sysfs_emit(buf, "%u\n", speed); ++ /* Check for fan speeds displayed in hexadecimal */ ++ if (!ecfw_with_fan_dec_rpm) ++ return sysfs_emit(buf, "%u\n", speed); ++ else ++ return sysfs_emit(buf, "%x\n", speed); + } + + static DEVICE_ATTR(fan1_input, S_IRUGO, fan_fan1_input_show, NULL); +@@ -8571,7 +8576,11 @@ static ssize_t fan_fan2_input_show(struct device *dev, + if (res < 0) + return res; + +- return sysfs_emit(buf, "%u\n", speed); ++ /* Check for fan speeds displayed in hexadecimal */ ++ if (!ecfw_with_fan_dec_rpm) ++ return sysfs_emit(buf, "%u\n", speed); ++ else ++ return sysfs_emit(buf, "%x\n", speed); + } + + static DEVICE_ATTR(fan2_input, S_IRUGO, fan_fan2_input_show, NULL); +@@ -8647,6 +8656,7 @@ static const struct attribute_group fan_driver_attr_group = { + #define TPACPI_FAN_2CTL 0x0004 /* selects fan2 control */ + #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 */ + + static const struct tpacpi_quirk fan_quirk_table[] __initconst = { + TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1), +@@ -8675,6 +8685,7 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = { + TPACPI_Q_LNV3('R', '1', 'D', TPACPI_FAN_NS), /* 11e Gen5 GL-R */ + 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 */ + }; + + static int __init fan_init(struct ibm_init_struct *iibm) +@@ -8715,6 +8726,13 @@ static int __init fan_init(struct ibm_init_struct *iibm) + tp_features.fan_ctrl_status_undef = 1; + } + ++ /* Check for the EC/BIOS with RPM reported in decimal*/ ++ if (quirks & TPACPI_FAN_DECRPM) { ++ pr_info("ECFW with fan RPM as decimal in EC register\n"); ++ ecfw_with_fan_dec_rpm = 1; ++ tp_features.fan_ctrl_status_undef = 1; ++ } ++ + if (gfan_handle) { + /* 570, 600e/x, 770e, 770x */ + fan_status_access_mode = TPACPI_FAN_RD_ACPI_GFAN; +@@ -8926,7 +8944,11 @@ static int fan_read(struct seq_file *m) + if (rc < 0) + return rc; + +- seq_printf(m, "speed:\t\t%d\n", speed); ++ /* Check for fan speeds displayed in hexadecimal */ ++ if (!ecfw_with_fan_dec_rpm) ++ seq_printf(m, "speed:\t\t%d\n", speed); ++ else ++ seq_printf(m, "speed:\t\t%x\n", speed); + + if (fan_status_access_mode == TPACPI_FAN_RD_TPEC_NS) { + /* +-- +2.43.0 + diff --git a/queue-6.11/proc-softirqs-replace-seq_printf-with-seq_put_decima.patch b/queue-6.11/proc-softirqs-replace-seq_printf-with-seq_put_decima.patch new file mode 100644 index 00000000000..c710f706658 --- /dev/null +++ b/queue-6.11/proc-softirqs-replace-seq_printf-with-seq_put_decima.patch @@ -0,0 +1,39 @@ +From a180058203c2331536839451a5273ba5889334ed Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Nov 2024 10:12:28 +0800 +Subject: proc/softirqs: replace seq_printf with seq_put_decimal_ull_width + +From: David Wang <00107082@163.com> + +[ Upstream commit 84b9749a3a704dcc824a88aa8267247c801d51e4 ] + +seq_printf is costy, on a system with n CPUs, reading /proc/softirqs +would yield 10*n decimal values, and the extra cost parsing format string +grows linearly with number of cpus. Replace seq_printf with +seq_put_decimal_ull_width have significant performance improvement. +On an 8CPUs system, reading /proc/softirqs show ~40% performance +gain with this patch. + +Signed-off-by: David Wang <00107082@163.com> +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + fs/proc/softirqs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/proc/softirqs.c b/fs/proc/softirqs.c +index f4616083faef3..04bb29721419b 100644 +--- a/fs/proc/softirqs.c ++++ b/fs/proc/softirqs.c +@@ -20,7 +20,7 @@ static int show_softirqs(struct seq_file *p, void *v) + for (i = 0; i < NR_SOFTIRQS; i++) { + seq_printf(p, "%12s:", softirq_to_name[i]); + for_each_possible_cpu(j) +- seq_printf(p, " %10u", kstat_softirqs_cpu(i, j)); ++ seq_put_decimal_ull_width(p, " ", kstat_softirqs_cpu(i, j), 10); + seq_putc(p, '\n'); + } + return 0; +-- +2.43.0 + diff --git a/queue-6.11/regulator-rk808-add-apply_bit-for-buck3-on-rk809.patch b/queue-6.11/regulator-rk808-add-apply_bit-for-buck3-on-rk809.patch new file mode 100644 index 00000000000..912f1c1f37d --- /dev/null +++ b/queue-6.11/regulator-rk808-add-apply_bit-for-buck3-on-rk809.patch @@ -0,0 +1,43 @@ +From cec648e3830fda5b93bfe0536dcaa87cc356e96b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 17 Oct 2024 21:37:28 +0300 +Subject: regulator: rk808: Add apply_bit for BUCK3 on RK809 + +From: Mikhail Rudenko + +[ Upstream commit 5e53e4a66bc7430dd2d11c18a86410e3a38d2940 ] + +Currently, RK809's BUCK3 regulator is modelled in the driver as a +configurable regulator with 0.5-2.4V voltage range. But the voltage +setting is not actually applied, because when bit 6 of +PMIC_POWER_CONFIG register is set to 0 (default), BUCK3 output voltage +is determined by the external feedback resistor. Fix this, by setting +bit 6 when voltage selection is set. Existing users which do not +specify voltage constraints in their device trees will not be affected +by this change, since no voltage setting is applied in those cases, +and bit 6 is not enabled. + +Signed-off-by: Mikhail Rudenko +Link: https://patch.msgid.link/20241017-rk809-dcdc3-v1-1-e3c3de92f39c@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/regulator/rk808-regulator.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c +index 14b60abd6afc6..01a8d04879184 100644 +--- a/drivers/regulator/rk808-regulator.c ++++ b/drivers/regulator/rk808-regulator.c +@@ -1379,6 +1379,8 @@ static const struct regulator_desc rk809_reg[] = { + .n_linear_ranges = ARRAY_SIZE(rk817_buck1_voltage_ranges), + .vsel_reg = RK817_BUCK3_ON_VSEL_REG, + .vsel_mask = RK817_BUCK_VSEL_MASK, ++ .apply_reg = RK817_POWER_CONFIG, ++ .apply_bit = RK817_BUCK3_FB_RES_INTER, + .enable_reg = RK817_POWER_EN_REG(0), + .enable_mask = ENABLE_MASK(RK817_ID_DCDC3), + .enable_val = ENABLE_MASK(RK817_ID_DCDC3), +-- +2.43.0 + diff --git a/queue-6.11/selftests-watchdog-test-fix-system-accidentally-rese.patch b/queue-6.11/selftests-watchdog-test-fix-system-accidentally-rese.patch new file mode 100644 index 00000000000..211408ddfe0 --- /dev/null +++ b/queue-6.11/selftests-watchdog-test-fix-system-accidentally-rese.patch @@ -0,0 +1,58 @@ +From acec0bd653f6ef955fd679ec98909dcddbf4145a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 29 Oct 2024 11:13:24 +0800 +Subject: selftests/watchdog-test: Fix system accidentally reset after + watchdog-test + +From: Li Zhijian + +[ Upstream commit dc1308bee1ed03b4d698d77c8bd670d399dcd04d ] + +When running watchdog-test with 'make run_tests', the watchdog-test will +be terminated by a timeout signal(SIGTERM) due to the test timemout. + +And then, a system reboot would happen due to watchdog not stop. see +the dmesg as below: +``` +[ 1367.185172] watchdog: watchdog0: watchdog did not stop! +``` + +Fix it by registering more signals(including SIGTERM) in watchdog-test, +where its signal handler will stop the watchdog. + +After that + # timeout 1 ./watchdog-test + Watchdog Ticking Away! + . + Stopping watchdog ticks... + +Link: https://lore.kernel.org/all/20241029031324.482800-1-lizhijian@fujitsu.com/ +Signed-off-by: Li Zhijian +Reviewed-by: Shuah Khan +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/watchdog/watchdog-test.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c +index bc71cbca0dde7..a1f506ba55786 100644 +--- a/tools/testing/selftests/watchdog/watchdog-test.c ++++ b/tools/testing/selftests/watchdog/watchdog-test.c +@@ -334,7 +334,13 @@ int main(int argc, char *argv[]) + + printf("Watchdog Ticking Away!\n"); + ++ /* ++ * Register the signals ++ */ + signal(SIGINT, term); ++ signal(SIGTERM, term); ++ signal(SIGKILL, term); ++ signal(SIGQUIT, term); + + while (1) { + keep_alive(); +-- +2.43.0 + diff --git a/queue-6.11/series b/queue-6.11/series new file mode 100644 index 00000000000..1158fc61c8d --- /dev/null +++ b/queue-6.11/series @@ -0,0 +1,45 @@ +wifi-mac80211-fix-setting-txpower-with-emulate_chanc.patch +wifi-cfg80211-add-wiphy_delayed_work_pending.patch +wifi-mac80211-convert-color-collision-detection-to-w.patch +wifi-radiotap-avoid-wflex-array-member-not-at-end-wa.patch +spi-stm32-fix-missing-device-mode-capability-in-stm3.patch +asoc-codecs-rt5640-always-disable-irqs-from-rt5640_c.patch +asoc-intel-bytcr_rt5640-add-support-for-non-acpi-ins.patch +asoc-intel-bytcr_rt5640-add-dmi-quirk-for-vexia-edu-.patch +asoc-intel-sst-support-lpe0f28-acpi-hid.patch +wifi-iwlwifi-mvm-use-the-sync-timepoint-api-in-suspe.patch +wifi-iwlwifi-mvm-sar-table-alignment.patch +mac80211-fix-user-power-when-emulating-chanctx.patch +usb-add-support-for-new-usb-device-id-0x17ef-0x3098-.patch +usb-typec-use-cleanup-facility-for-altmodes_node.patch +selftests-watchdog-test-fix-system-accidentally-rese.patch +alsa-hda-realtek-add-subwoofer-quirk-for-infinix-zer.patch +asoc-codecs-wcd937x-add-missing-lo-switch-control.patch +asoc-codecs-wcd937x-relax-the-aux-pdm-watchdog.patch +x86-amd_nb-fix-compile-testing-without-config_amd_nb.patch +bpf-fix-filed-access-without-lock.patch +net-usb-qmi_wwan-add-quectel-rg650v.patch +soc-qcom-add-check-devm_kasprintf-returned-value.patch +firmware-arm_scmi-reject-clear-channel-request-on-a2.patch +regulator-rk808-add-apply_bit-for-buck3-on-rk809.patch +platform-x86-dell-smbios-base-extends-support-to-ali.patch +platform-x86-dell-wmi-base-handle-meta-key-lock-unlo.patch +platform-x86-ideapad-laptop-add-missing-ideapad-pro-.patch +asoc-tas2781-add-new-driver-version-for-tas2563-tas2.patch +tools-lib-thermal-remove-the-thermal.h-soft-link-whe.patch +can-j1939-fix-error-in-j1939-documentation.patch +platform-x86-thinkpad_acpi-fix-for-thinkpad-s-with-e.patch +asoc-amd-yc-support-dmic-on-another-model-of-lenovo-.patch +asoc-stm-prevent-potential-division-by-zero-in-stm32.patch +asoc-stm-prevent-potential-division-by-zero-in-stm32.patch-5750 +drm-panel-orientation-quirks-make-lenovo-yoga-tab-3-.patch +proc-softirqs-replace-seq_printf-with-seq_put_decima.patch +integrity-use-static_assert-to-check-struct-sizes.patch +asoc-audio-graph-card2-purge-absent-supplies-for-dev.patch +loongarch-for-all-possible-cpus-setup-logical-physic.patch +loongarch-define-a-default-value-for-vm_data_default.patch +asoc-max9768-fix-event-generation-for-playback-mute.patch +alsa-usb-audio-fix-yamaha-p-125-quirk-entry.patch +arm-9420-1-smp-fix-smp-for-xip-kernels.patch +arm-9434-1-cfi-fix-compilation-corner-case.patch +ipmr-fix-access-to-mfc_cache_list-without-lock-held.patch diff --git a/queue-6.11/soc-qcom-add-check-devm_kasprintf-returned-value.patch b/queue-6.11/soc-qcom-add-check-devm_kasprintf-returned-value.patch new file mode 100644 index 00000000000..dddc4bf13dc --- /dev/null +++ b/queue-6.11/soc-qcom-add-check-devm_kasprintf-returned-value.patch @@ -0,0 +1,45 @@ +From 03c85c8a8ac234e77ee9d08235c63572d67d52de Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 29 Sep 2024 15:23:49 +0800 +Subject: soc: qcom: Add check devm_kasprintf() returned value + +From: Charles Han + +[ Upstream commit e694d2b5c58ba2d1e995d068707c8d966e7f5f2a ] + +devm_kasprintf() can return a NULL pointer on failure but this +returned value in qcom_socinfo_probe() is not checked. + +Signed-off-by: Charles Han +Link: https://lore.kernel.org/r/20240929072349.202520-1-hanchunchao@inspur.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + drivers/soc/qcom/socinfo.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c +index d7359a235e3cf..1d5a69eda26e5 100644 +--- a/drivers/soc/qcom/socinfo.c ++++ b/drivers/soc/qcom/socinfo.c +@@ -782,10 +782,16 @@ static int qcom_socinfo_probe(struct platform_device *pdev) + qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u", + SOCINFO_MAJOR(le32_to_cpu(info->ver)), + SOCINFO_MINOR(le32_to_cpu(info->ver))); +- if (offsetof(struct socinfo, serial_num) <= item_size) ++ if (!qs->attr.soc_id || qs->attr.revision) ++ return -ENOMEM; ++ ++ if (offsetof(struct socinfo, serial_num) <= item_size) { + qs->attr.serial_number = devm_kasprintf(&pdev->dev, GFP_KERNEL, + "%u", + le32_to_cpu(info->serial_num)); ++ if (!qs->attr.serial_number) ++ return -ENOMEM; ++ } + + qs->soc_dev = soc_device_register(&qs->attr); + if (IS_ERR(qs->soc_dev)) +-- +2.43.0 + diff --git a/queue-6.11/spi-stm32-fix-missing-device-mode-capability-in-stm3.patch b/queue-6.11/spi-stm32-fix-missing-device-mode-capability-in-stm3.patch new file mode 100644 index 00000000000..20ccabc333e --- /dev/null +++ b/queue-6.11/spi-stm32-fix-missing-device-mode-capability-in-stm3.patch @@ -0,0 +1,36 @@ +From 6b9787a646dbecd5dad5e6fe4cf67db5d2660b39 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 9 Oct 2024 18:15:52 +0200 +Subject: spi: stm32: fix missing device mode capability in stm32mp25 + +From: Alain Volmat + +[ Upstream commit b5a468199b995bd8ee3c26f169a416a181210c9e ] + +The STM32MP25 SOC has capability to behave in device mode however +missing .has_device_mode within its stm32mp25_spi_cfg structure leads +to not being able to enable the device mode. + +Signed-off-by: Alain Volmat +Link: https://patch.msgid.link/20241009-spi-mp25-device-fix-v1-1-8e5ca7db7838@foss.st.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-stm32.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c +index 4c4ff074e3f6f..fc72a89fb3a7b 100644 +--- a/drivers/spi/spi-stm32.c ++++ b/drivers/spi/spi-stm32.c +@@ -2044,6 +2044,7 @@ static const struct stm32_spi_cfg stm32mp25_spi_cfg = { + .baud_rate_div_max = STM32H7_SPI_MBR_DIV_MAX, + .has_fifo = true, + .prevent_dma_burst = true, ++ .has_device_mode = true, + }; + + static const struct of_device_id stm32_spi_of_match[] = { +-- +2.43.0 + diff --git a/queue-6.11/tools-lib-thermal-remove-the-thermal.h-soft-link-whe.patch b/queue-6.11/tools-lib-thermal-remove-the-thermal.h-soft-link-whe.patch new file mode 100644 index 00000000000..d5af01789b0 --- /dev/null +++ b/queue-6.11/tools-lib-thermal-remove-the-thermal.h-soft-link-whe.patch @@ -0,0 +1,39 @@ +From e6d29035ee8ac3a0475cfa7f6ebebf6b8e2eb9a1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 12 Sep 2024 12:50:31 +0800 +Subject: tools/lib/thermal: Remove the thermal.h soft link when doing make + clean + +From: zhang jiao + +[ Upstream commit c5426dcc5a3a064bbd2de383e29035a14fe933e0 ] + +Run "make -C tools thermal" can create a soft link for thermal.h in +tools/include/uapi/linux. Just rm it when make clean. + +Signed-off-by: zhang jiao +Link: https://lore.kernel.org/r/20240912045031.18426-1-zhangjiao2@cmss.chinamobile.com +Signed-off-by: Daniel Lezcano +Signed-off-by: Sasha Levin +--- + tools/lib/thermal/Makefile | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tools/lib/thermal/Makefile b/tools/lib/thermal/Makefile +index 2d0d255fd0e1c..8890fd57b110c 100644 +--- a/tools/lib/thermal/Makefile ++++ b/tools/lib/thermal/Makefile +@@ -121,7 +121,9 @@ all: fixdep + + clean: + $(call QUIET_CLEAN, libthermal) $(RM) $(LIBTHERMAL_A) \ +- *.o *~ *.a *.so *.so.$(VERSION) *.so.$(LIBTHERMAL_VERSION) .*.d .*.cmd LIBTHERMAL-CFLAGS $(LIBTHERMAL_PC) ++ *.o *~ *.a *.so *.so.$(VERSION) *.so.$(LIBTHERMAL_VERSION) \ ++ .*.d .*.cmd LIBTHERMAL-CFLAGS $(LIBTHERMAL_PC) \ ++ $(srctree)/tools/$(THERMAL_UAPI) + + $(LIBTHERMAL_PC): + $(QUIET_GEN)sed -e "s|@PREFIX@|$(prefix)|" \ +-- +2.43.0 + diff --git a/queue-6.11/usb-add-support-for-new-usb-device-id-0x17ef-0x3098-.patch b/queue-6.11/usb-add-support-for-new-usb-device-id-0x17ef-0x3098-.patch new file mode 100644 index 00000000000..b7b41c7440b --- /dev/null +++ b/queue-6.11/usb-add-support-for-new-usb-device-id-0x17ef-0x3098-.patch @@ -0,0 +1,41 @@ +From 380aa4b5a4d4ec02c1eaec757abcdbfb06d74896 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 20 Oct 2024 18:41:28 +0100 +Subject: usb: add support for new USB device ID 0x17EF:0x3098 for the r8152 + driver +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Benjamin Große + +[ Upstream commit 94c11e852955b2eef5c4f0b36cfeae7dcf11a759 ] + +This patch adds support for another Lenovo Mini dock 0x17EF:0x3098 to the +r8152 driver. The device has been tested on NixOS, hotplugging and sleep +included. + +Signed-off-by: Benjamin Große +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/20241020174128.160898-1-ste3ls@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/usb/r8152.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c +index a5612c799f5ef..468c739740463 100644 +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -10069,6 +10069,7 @@ static const struct usb_device_id rtl8152_table[] = { + { USB_DEVICE(VENDOR_ID_LENOVO, 0x3062) }, + { USB_DEVICE(VENDOR_ID_LENOVO, 0x3069) }, + { USB_DEVICE(VENDOR_ID_LENOVO, 0x3082) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3098) }, + { USB_DEVICE(VENDOR_ID_LENOVO, 0x7205) }, + { USB_DEVICE(VENDOR_ID_LENOVO, 0x720c) }, + { USB_DEVICE(VENDOR_ID_LENOVO, 0x7214) }, +-- +2.43.0 + diff --git a/queue-6.11/usb-typec-use-cleanup-facility-for-altmodes_node.patch b/queue-6.11/usb-typec-use-cleanup-facility-for-altmodes_node.patch new file mode 100644 index 00000000000..3fabb505ba1 --- /dev/null +++ b/queue-6.11/usb-typec-use-cleanup-facility-for-altmodes_node.patch @@ -0,0 +1,50 @@ +From 94717ca26cb63e6a367e44da59b061c90c0f228b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 21 Oct 2024 22:45:30 +0200 +Subject: usb: typec: use cleanup facility for 'altmodes_node' + +From: Javier Carrasco + +[ Upstream commit 1ab0b9ae587373f9f800b6fda01b8faf02b3530b ] + +Use the __free() macro for 'altmodes_node' to automatically release the +node when it goes out of scope, removing the need for explicit calls to +fwnode_handle_put(). + +Suggested-by: Heikki Krogerus +Signed-off-by: Javier Carrasco +Reviewed-by: Heikki Krogerus +Link: https://lore.kernel.org/r/20241021-typec-class-fwnode_handle_put-v2-2-3281225d3d27@gmail.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/typec/class.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c +index 1eb240604cf6f..145e12e13aef9 100644 +--- a/drivers/usb/typec/class.c ++++ b/drivers/usb/typec/class.c +@@ -2293,7 +2293,7 @@ void typec_port_register_altmodes(struct typec_port *port, + const struct typec_altmode_ops *ops, void *drvdata, + struct typec_altmode **altmodes, size_t n) + { +- struct fwnode_handle *altmodes_node, *child; ++ struct fwnode_handle *child; + struct typec_altmode_desc desc; + struct typec_altmode *alt; + size_t index = 0; +@@ -2301,7 +2301,9 @@ void typec_port_register_altmodes(struct typec_port *port, + u32 vdo; + int ret; + +- altmodes_node = device_get_named_child_node(&port->dev, "altmodes"); ++ struct fwnode_handle *altmodes_node __free(fwnode_handle) = ++ device_get_named_child_node(&port->dev, "altmodes"); ++ + if (!altmodes_node) + return; /* No altmodes specified */ + +-- +2.43.0 + diff --git a/queue-6.11/wifi-cfg80211-add-wiphy_delayed_work_pending.patch b/queue-6.11/wifi-cfg80211-add-wiphy_delayed_work_pending.patch new file mode 100644 index 00000000000..a83006d31a5 --- /dev/null +++ b/queue-6.11/wifi-cfg80211-add-wiphy_delayed_work_pending.patch @@ -0,0 +1,99 @@ +From 36924fe0511098cbca6d5aaaec65648a9be10998 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 24 Sep 2024 21:28:04 +0200 +Subject: wifi: cfg80211: Add wiphy_delayed_work_pending() + +From: Remi Pommarel + +[ Upstream commit 68d0021fe7231eec0fb84cd110cf62a6e782b72d ] + +Add wiphy_delayed_work_pending() to check if any delayed work timer is +pending, that can be used to be sure that wiphy_delayed_work_queue() +won't postpone an already pending delayed work. + +Signed-off-by: Remi Pommarel +Link: https://patch.msgid.link/20240924192805.13859-2-repk@triplefau.lt +[fix return value kernel-doc] +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + include/net/cfg80211.h | 44 ++++++++++++++++++++++++++++++++++++++++++ + net/wireless/core.c | 7 +++++++ + 2 files changed, 51 insertions(+) + +diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h +index 192d72c8b4654..702653448d2fc 100644 +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -6129,6 +6129,50 @@ void wiphy_delayed_work_cancel(struct wiphy *wiphy, + void wiphy_delayed_work_flush(struct wiphy *wiphy, + struct wiphy_delayed_work *dwork); + ++/** ++ * wiphy_delayed_work_pending - Find out whether a wiphy delayable ++ * work item is currently pending. ++ * ++ * @wiphy: the wiphy, for debug purposes ++ * @dwork: the delayed work in question ++ * ++ * Return: true if timer is pending, false otherwise ++ * ++ * How wiphy_delayed_work_queue() works is by setting a timer which ++ * when it expires calls wiphy_work_queue() to queue the wiphy work. ++ * Because wiphy_delayed_work_queue() uses mod_timer(), if it is ++ * called twice and the second call happens before the first call ++ * deadline, the work will rescheduled for the second deadline and ++ * won't run before that. ++ * ++ * wiphy_delayed_work_pending() can be used to detect if calling ++ * wiphy_work_delayed_work_queue() would start a new work schedule ++ * or delayed a previous one. As seen below it cannot be used to ++ * detect precisely if the work has finished to execute nor if it ++ * is currently executing. ++ * ++ * CPU0 CPU1 ++ * wiphy_delayed_work_queue(wk) ++ * mod_timer(wk->timer) ++ * wiphy_delayed_work_pending(wk) -> true ++ * ++ * [...] ++ * expire_timers(wk->timer) ++ * detach_timer(wk->timer) ++ * wiphy_delayed_work_pending(wk) -> false ++ * wk->timer->function() | ++ * wiphy_work_queue(wk) | delayed work pending ++ * list_add_tail() | returns false but ++ * queue_work(cfg80211_wiphy_work) | wk->func() has not ++ * | been run yet ++ * [...] | ++ * cfg80211_wiphy_work() | ++ * wk->func() V ++ * ++ */ ++bool wiphy_delayed_work_pending(struct wiphy *wiphy, ++ struct wiphy_delayed_work *dwork); ++ + /** + * enum ieee80211_ap_reg_power - regulatory power for an Access Point + * +diff --git a/net/wireless/core.c b/net/wireless/core.c +index c9ebf9449fcc3..b2b512923ecee 100644 +--- a/net/wireless/core.c ++++ b/net/wireless/core.c +@@ -1705,6 +1705,13 @@ void wiphy_delayed_work_flush(struct wiphy *wiphy, + } + EXPORT_SYMBOL_GPL(wiphy_delayed_work_flush); + ++bool wiphy_delayed_work_pending(struct wiphy *wiphy, ++ struct wiphy_delayed_work *dwork) ++{ ++ return timer_pending(&dwork->timer); ++} ++EXPORT_SYMBOL_GPL(wiphy_delayed_work_pending); ++ + static int __init cfg80211_init(void) + { + int err; +-- +2.43.0 + diff --git a/queue-6.11/wifi-iwlwifi-mvm-sar-table-alignment.patch b/queue-6.11/wifi-iwlwifi-mvm-sar-table-alignment.patch new file mode 100644 index 00000000000..3d9c8ebc302 --- /dev/null +++ b/queue-6.11/wifi-iwlwifi-mvm-sar-table-alignment.patch @@ -0,0 +1,191 @@ +From 17d6e77eef52ada0605e23050cbec76fa4d9271b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 10 Oct 2024 14:05:04 +0300 +Subject: wifi: iwlwifi: mvm: SAR table alignment + +From: Anjaneyulu + +[ Upstream commit 32d95ab330069f9c551b8e99770bb4e799730b55 ] + +SAR table format in ACPI and local data base are different, +So modified code to read data properly. + +Signed-off-by: Anjaneyulu +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20241010140328.f077aced4dee.I4dc618f12d01f7ad19f9f8881f6e09eea77e9a14@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 96 ++++++++++++-------- + 1 file changed, 58 insertions(+), 38 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +index a7cea0a55b35a..0bc32291815e1 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c ++++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +@@ -429,38 +429,28 @@ int iwl_acpi_get_eckv(struct iwl_fw_runtime *fwrt, u32 *extl_clk) + return ret; + } + +-static int iwl_acpi_sar_set_profile(union acpi_object *table, +- struct iwl_sar_profile *profile, +- bool enabled, u8 num_chains, +- u8 num_sub_bands) ++static int ++iwl_acpi_parse_chains_table(union acpi_object *table, ++ struct iwl_sar_profile_chain *chains, ++ u8 num_chains, u8 num_sub_bands) + { +- int i, j, idx = 0; +- +- /* +- * The table from ACPI is flat, but we store it in a +- * structured array. +- */ +- for (i = 0; i < BIOS_SAR_MAX_CHAINS_PER_PROFILE; i++) { +- for (j = 0; j < BIOS_SAR_MAX_SUB_BANDS_NUM; j++) { ++ for (u8 chain = 0; chain < num_chains; chain++) { ++ for (u8 subband = 0; subband < BIOS_SAR_MAX_SUB_BANDS_NUM; ++ subband++) { + /* if we don't have the values, use the default */ +- if (i >= num_chains || j >= num_sub_bands) { +- profile->chains[i].subbands[j] = 0; ++ if (subband >= num_sub_bands) { ++ chains[chain].subbands[subband] = 0; ++ } else if (table->type != ACPI_TYPE_INTEGER || ++ table->integer.value > U8_MAX) { ++ return -EINVAL; + } else { +- if (table[idx].type != ACPI_TYPE_INTEGER || +- table[idx].integer.value > U8_MAX) +- return -EINVAL; +- +- profile->chains[i].subbands[j] = +- table[idx].integer.value; +- +- idx++; ++ chains[chain].subbands[subband] = ++ table->integer.value; ++ table++; + } + } + } + +- /* Only if all values were valid can the profile be enabled */ +- profile->enabled = enabled; +- + return 0; + } + +@@ -543,9 +533,11 @@ int iwl_acpi_get_wrds_table(struct iwl_fw_runtime *fwrt) + /* The profile from WRDS is officially profile 1, but goes + * into sar_profiles[0] (because we don't have a profile 0). + */ +- ret = iwl_acpi_sar_set_profile(table, &fwrt->sar_profiles[0], +- flags & IWL_SAR_ENABLE_MSK, +- num_chains, num_sub_bands); ++ ret = iwl_acpi_parse_chains_table(table, fwrt->sar_profiles[0].chains, ++ num_chains, num_sub_bands); ++ if (!ret && flags & IWL_SAR_ENABLE_MSK) ++ fwrt->sar_profiles[0].enabled = true; ++ + out_free: + kfree(data); + return ret; +@@ -557,7 +549,7 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) + bool enabled; + int i, n_profiles, tbl_rev, pos; + int ret = 0; +- u8 num_chains, num_sub_bands; ++ u8 num_sub_bands; + + data = iwl_acpi_get_object(fwrt->dev, ACPI_EWRD_METHOD); + if (IS_ERR(data)) +@@ -573,7 +565,6 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) + goto out_free; + } + +- num_chains = ACPI_SAR_NUM_CHAINS_REV2; + num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV2; + + goto read_table; +@@ -589,7 +580,6 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) + goto out_free; + } + +- num_chains = ACPI_SAR_NUM_CHAINS_REV1; + num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV1; + + goto read_table; +@@ -605,7 +595,6 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) + goto out_free; + } + +- num_chains = ACPI_SAR_NUM_CHAINS_REV0; + num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV0; + + goto read_table; +@@ -637,23 +626,54 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) + /* the tables start at element 3 */ + pos = 3; + ++ BUILD_BUG_ON(ACPI_SAR_NUM_CHAINS_REV0 != ACPI_SAR_NUM_CHAINS_REV1); ++ BUILD_BUG_ON(ACPI_SAR_NUM_CHAINS_REV2 != 2 * ACPI_SAR_NUM_CHAINS_REV0); ++ ++ /* parse non-cdb chains for all profiles */ + for (i = 0; i < n_profiles; i++) { + union acpi_object *table = &wifi_pkg->package.elements[pos]; ++ + /* The EWRD profiles officially go from 2 to 4, but we + * save them in sar_profiles[1-3] (because we don't + * have profile 0). So in the array we start from 1. + */ +- ret = iwl_acpi_sar_set_profile(table, +- &fwrt->sar_profiles[i + 1], +- enabled, num_chains, +- num_sub_bands); ++ ret = iwl_acpi_parse_chains_table(table, ++ fwrt->sar_profiles[i + 1].chains, ++ ACPI_SAR_NUM_CHAINS_REV0, ++ num_sub_bands); + if (ret < 0) +- break; ++ goto out_free; + + /* go to the next table */ +- pos += num_chains * num_sub_bands; ++ pos += ACPI_SAR_NUM_CHAINS_REV0 * num_sub_bands; + } + ++ /* non-cdb table revisions */ ++ if (tbl_rev < 2) ++ goto set_enabled; ++ ++ /* parse cdb chains for all profiles */ ++ for (i = 0; i < n_profiles; i++) { ++ struct iwl_sar_profile_chain *chains; ++ union acpi_object *table; ++ ++ table = &wifi_pkg->package.elements[pos]; ++ chains = &fwrt->sar_profiles[i + 1].chains[ACPI_SAR_NUM_CHAINS_REV0]; ++ ret = iwl_acpi_parse_chains_table(table, ++ chains, ++ ACPI_SAR_NUM_CHAINS_REV0, ++ num_sub_bands); ++ if (ret < 0) ++ goto out_free; ++ ++ /* go to the next table */ ++ pos += ACPI_SAR_NUM_CHAINS_REV0 * num_sub_bands; ++ } ++ ++set_enabled: ++ for (i = 0; i < n_profiles; i++) ++ fwrt->sar_profiles[i + 1].enabled = enabled; ++ + out_free: + kfree(data); + return ret; +-- +2.43.0 + diff --git a/queue-6.11/wifi-iwlwifi-mvm-use-the-sync-timepoint-api-in-suspe.patch b/queue-6.11/wifi-iwlwifi-mvm-use-the-sync-timepoint-api-in-suspe.patch new file mode 100644 index 00000000000..248ef0583e0 --- /dev/null +++ b/queue-6.11/wifi-iwlwifi-mvm-use-the-sync-timepoint-api-in-suspe.patch @@ -0,0 +1,64 @@ +From d034c264e404866d4e94a2235d46addcce2cc319 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 10 Oct 2024 14:05:03 +0300 +Subject: wifi: iwlwifi: mvm: Use the sync timepoint API in suspend + +From: Daniel Gabay + +[ Upstream commit 9715246ca0bfc9feaec1b4ff5b3d38de65a7025d ] + +When starting the suspend flow, HOST_D3_START triggers an _async_ +firmware dump collection for debugging purposes. The async worker +may race with suspend flow and fail to get NIC access, resulting in +the following warning: +"Timeout waiting for hardware access (CSR_GP_CNTRL 0xffffffff)" + +Fix this by switching to the sync version to ensure the dump +completes before proceeding with the suspend flow, avoiding +potential race issues. + +Signed-off-by: Daniel Gabay +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20241010140328.9aae318cd593.I4b322009f39489c0b1d8893495c887870f73ed9c@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/fw/init.c | 4 +++- + drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 2 ++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/init.c b/drivers/net/wireless/intel/iwlwifi/fw/init.c +index d8b083be5b6b5..de87e0e3e0725 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/init.c ++++ b/drivers/net/wireless/intel/iwlwifi/fw/init.c +@@ -39,10 +39,12 @@ void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, + } + IWL_EXPORT_SYMBOL(iwl_fw_runtime_init); + ++/* Assumes the appropriate lock is held by the caller */ + void iwl_fw_runtime_suspend(struct iwl_fw_runtime *fwrt) + { + iwl_fw_suspend_timestamp(fwrt); +- iwl_dbg_tlv_time_point(fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_START, NULL); ++ iwl_dbg_tlv_time_point_sync(fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_START, ++ NULL); + } + IWL_EXPORT_SYMBOL(iwl_fw_runtime_suspend); + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +index 99a541d442bb1..f4f87edb86e5c 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +@@ -1398,7 +1398,9 @@ int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) + + iwl_mvm_pause_tcm(mvm, true); + ++ mutex_lock(&mvm->mutex); + iwl_fw_runtime_suspend(&mvm->fwrt); ++ mutex_unlock(&mvm->mutex); + + return __iwl_mvm_suspend(hw, wowlan, false); + } +-- +2.43.0 + diff --git a/queue-6.11/wifi-mac80211-convert-color-collision-detection-to-w.patch b/queue-6.11/wifi-mac80211-convert-color-collision-detection-to-w.patch new file mode 100644 index 00000000000..e059bf0a181 --- /dev/null +++ b/queue-6.11/wifi-mac80211-convert-color-collision-detection-to-w.patch @@ -0,0 +1,166 @@ +From b06895fa6dc4491bb3809586a9d55f2c06355671 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 24 Sep 2024 21:28:05 +0200 +Subject: wifi: mac80211: Convert color collision detection to wiphy work + +From: Remi Pommarel + +[ Upstream commit 4cc6f3e5e5765abad9c091989970d67d8c1d2204 ] + +Call to ieee80211_color_collision_detection_work() needs wiphy lock to +be held (see lockdep assert in cfg80211_bss_color_notify()). Not locking +wiphy causes the following lockdep error: + + WARNING: CPU: 2 PID: 42 at net/wireless/nl80211.c:19505 cfg80211_bss_color_notify+0x1a4/0x25c + Modules linked in: + CPU: 2 PID: 42 Comm: kworker/u8:3 Tainted: G W 6.4.0-02327-g36c6cb260481 #1048 + Hardware name: + Workqueue: phy1 ieee80211_color_collision_detection_work + pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) + pc : cfg80211_bss_color_notify+0x1a4/0x25c + lr : cfg80211_bss_color_notify+0x1a0/0x25c + sp : ffff000002947d00 + x29: ffff000002947d00 x28: ffff800008e1a000 x27: ffff000002bd4705 + x26: ffff00000d034000 x25: ffff80000903cf40 x24: 0000000000000000 + x23: ffff00000cb70720 x22: 0000000000800000 x21: ffff800008dfb008 + x20: 000000000000008d x19: ffff00000d035fa8 x18: 0000000000000010 + x17: 0000000000000001 x16: 000003564b1ce96a x15: 000d69696d057970 + x14: 000000000000003b x13: 0000000000000001 x12: 0000000000040000 + x11: 0000000000000001 x10: ffff80000978f9c0 x9 : ffff0000028d3174 + x8 : ffff800008e30000 x7 : 0000000000000000 x6 : 0000000000000028 + x5 : 000000000002f498 x4 : ffff00000d034a80 x3 : 0000000000800000 + x2 : ffff800016143000 x1 : 0000000000000000 x0 : 0000000000000000 + Call trace: + cfg80211_bss_color_notify+0x1a4/0x25c + ieee80211_color_collision_detection_work+0x20/0x118 + process_one_work+0x294/0x554 + worker_thread+0x70/0x440 + kthread+0xf4/0xf8 + ret_from_fork+0x10/0x20 + irq event stamp: 77372 + hardirqs last enabled at (77371): [] _raw_spin_unlock_irq+0x2c/0x4c + hardirqs last disabled at (77372): [] el1_dbg+0x20/0x48 + softirqs last enabled at (77350): [] batadv_send_outstanding_bcast_packet+0xb8/0x120 + softirqs last disabled at (77348): [] batadv_send_outstanding_bcast_packet+0x80/0x120 + +The wiphy lock cannot be taken directly from color collision detection +delayed work (ieee80211_color_collision_detection_work()) because this +work is cancel_delayed_work_sync() under this wiphy lock causing a +potential deadlock( see [0] for details). + +To fix that ieee80211_color_collision_detection_work() could be +converted to a wiphy work and cancel_delayed_work_sync() can be simply +replaced by wiphy_delayed_work_cancel() serving the same purpose under +wiphy lock. + +This could potentially fix [1]. + +[0]: https://lore.kernel.org/linux-wireless/D4A40Q44OAY2.W3SIF6UEPBUN@freebox.fr/ +[1]: https://lore.kernel.org/lkml/000000000000612f290618eee3e5@google.com/ + +Reported-by: Nicolas Escande +Signed-off-by: Remi Pommarel +Link: https://patch.msgid.link/20240924192805.13859-3-repk@triplefau.lt +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/cfg.c | 17 +++++++++-------- + net/mac80211/ieee80211_i.h | 5 +++-- + net/mac80211/link.c | 7 ++++--- + 3 files changed, 16 insertions(+), 13 deletions(-) + +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c +index 6e35425fbff12..fe11700c3c18a 100644 +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -4825,12 +4825,12 @@ void ieee80211_color_change_finalize_work(struct wiphy *wiphy, + ieee80211_color_change_finalize(link); + } + +-void ieee80211_color_collision_detection_work(struct work_struct *work) ++void ieee80211_color_collision_detection_work(struct wiphy *wiphy, ++ struct wiphy_work *work) + { +- struct delayed_work *delayed_work = to_delayed_work(work); + struct ieee80211_link_data *link = +- container_of(delayed_work, struct ieee80211_link_data, +- color_collision_detect_work); ++ container_of(work, struct ieee80211_link_data, ++ color_collision_detect_work.work); + struct ieee80211_sub_if_data *sdata = link->sdata; + + cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap, +@@ -4883,7 +4883,8 @@ ieee80211_obss_color_collision_notify(struct ieee80211_vif *vif, + return; + } + +- if (delayed_work_pending(&link->color_collision_detect_work)) { ++ if (wiphy_delayed_work_pending(sdata->local->hw.wiphy, ++ &link->color_collision_detect_work)) { + rcu_read_unlock(); + return; + } +@@ -4892,9 +4893,9 @@ ieee80211_obss_color_collision_notify(struct ieee80211_vif *vif, + /* queue the color collision detection event every 500 ms in order to + * avoid sending too much netlink messages to userspace. + */ +- ieee80211_queue_delayed_work(&sdata->local->hw, +- &link->color_collision_detect_work, +- msecs_to_jiffies(500)); ++ wiphy_delayed_work_queue(sdata->local->hw.wiphy, ++ &link->color_collision_detect_work, ++ msecs_to_jiffies(500)); + + rcu_read_unlock(); + } +diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h +index a3485e4c6132f..8650b3e8f1a9f 100644 +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -1051,7 +1051,7 @@ struct ieee80211_link_data { + } csa; + + struct wiphy_work color_change_finalize_work; +- struct delayed_work color_collision_detect_work; ++ struct wiphy_delayed_work color_collision_detect_work; + u64 color_bitmap; + + /* context reservation -- protected with wiphy mutex */ +@@ -2004,7 +2004,8 @@ int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, + /* color change handling */ + void ieee80211_color_change_finalize_work(struct wiphy *wiphy, + struct wiphy_work *work); +-void ieee80211_color_collision_detection_work(struct work_struct *work); ++void ieee80211_color_collision_detection_work(struct wiphy *wiphy, ++ struct wiphy_work *work); + + /* interface handling */ + #define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \ +diff --git a/net/mac80211/link.c b/net/mac80211/link.c +index 1a211b8d40573..67f65ff79a711 100644 +--- a/net/mac80211/link.c ++++ b/net/mac80211/link.c +@@ -41,8 +41,8 @@ void ieee80211_link_init(struct ieee80211_sub_if_data *sdata, + ieee80211_csa_finalize_work); + wiphy_work_init(&link->color_change_finalize_work, + ieee80211_color_change_finalize_work); +- INIT_DELAYED_WORK(&link->color_collision_detect_work, +- ieee80211_color_collision_detection_work); ++ wiphy_delayed_work_init(&link->color_collision_detect_work, ++ ieee80211_color_collision_detection_work); + INIT_LIST_HEAD(&link->assigned_chanctx_list); + INIT_LIST_HEAD(&link->reserved_chanctx_list); + +@@ -70,7 +70,8 @@ void ieee80211_link_stop(struct ieee80211_link_data *link) + if (link->sdata->vif.type == NL80211_IFTYPE_STATION) + ieee80211_mgd_stop_link(link); + +- cancel_delayed_work_sync(&link->color_collision_detect_work); ++ wiphy_delayed_work_cancel(link->sdata->local->hw.wiphy, ++ &link->color_collision_detect_work); + wiphy_work_cancel(link->sdata->local->hw.wiphy, + &link->color_change_finalize_work); + wiphy_work_cancel(link->sdata->local->hw.wiphy, +-- +2.43.0 + diff --git a/queue-6.11/wifi-mac80211-fix-setting-txpower-with-emulate_chanc.patch b/queue-6.11/wifi-mac80211-fix-setting-txpower-with-emulate_chanc.patch new file mode 100644 index 00000000000..d2b9ed87ef8 --- /dev/null +++ b/queue-6.11/wifi-mac80211-fix-setting-txpower-with-emulate_chanc.patch @@ -0,0 +1,46 @@ +From aee12a191a708cfcfe2573fa79aac46d996086d7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 23 Sep 2024 18:13:25 -0700 +Subject: wifi: mac80211: Fix setting txpower with emulate_chanctx + +From: Ben Greear + +[ Upstream commit 8dd0498983eef524a8d104eb8abb32ec4c595bec ] + +Propagate hw conf into the driver when txpower changes +and driver is emulating channel contexts. + +Signed-off-by: Ben Greear +Link: https://patch.msgid.link/20240924011325.1509103-1-greearb@candelatech.com +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/cfg.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c +index f2b5c18417ef7..6e35425fbff12 100644 +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -3046,6 +3046,7 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy, + enum nl80211_tx_power_setting txp_type = type; + bool update_txp_type = false; + bool has_monitor = false; ++ int old_power = local->user_power_level; + + lockdep_assert_wiphy(local->hw.wiphy); + +@@ -3128,6 +3129,10 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy, + } + } + ++ if (local->emulate_chanctx && ++ (old_power != local->user_power_level)) ++ ieee80211_hw_conf_chan(local); ++ + return 0; + } + +-- +2.43.0 + diff --git a/queue-6.11/wifi-radiotap-avoid-wflex-array-member-not-at-end-wa.patch b/queue-6.11/wifi-radiotap-avoid-wflex-array-member-not-at-end-wa.patch new file mode 100644 index 00000000000..856a16ee311 --- /dev/null +++ b/queue-6.11/wifi-radiotap-avoid-wflex-array-member-not-at-end-wa.patch @@ -0,0 +1,227 @@ +From 13818b4ec10abbbed6f04da8ba3e743b0b74fac8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 4 Oct 2024 14:14:44 -0600 +Subject: wifi: radiotap: Avoid -Wflex-array-member-not-at-end warnings + +From: Gustavo A. R. Silva + +[ Upstream commit 57be3d3562ca4aa62b8047bc681028cc402af8ce ] + +-Wflex-array-member-not-at-end was introduced in GCC-14, and we are +getting ready to enable it, globally. + +So, in order to avoid ending up with a flexible-array member in the +middle of multiple other structs, we use the `__struct_group()` +helper to create a new tagged `struct ieee80211_radiotap_header_fixed`. +This structure groups together all the members of the flexible +`struct ieee80211_radiotap_header` except the flexible array. + +As a result, the array is effectively separated from the rest of the +members without modifying the memory layout of the flexible structure. +We then change the type of the middle struct members currently causing +trouble from `struct ieee80211_radiotap_header` to `struct +ieee80211_radiotap_header_fixed`. + +We also want to ensure that in case new members need to be added to the +flexible structure, they are always included within the newly created +tagged struct. For this, we use `static_assert()`. This ensures that the +memory layout for both the flexible structure and the new tagged struct +is the same after any changes. + +This approach avoids having to implement `struct ieee80211_radiotap_header_fixed` +as a completely separate structure, thus preventing having to maintain +two independent but basically identical structures, closing the door +to potential bugs in the future. + +So, with these changes, fix the following warnings: +drivers/net/wireless/ath/wil6210/txrx.c:309:50: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] +drivers/net/wireless/intel/ipw2x00/ipw2100.c:2521:50: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] +drivers/net/wireless/intel/ipw2x00/ipw2200.h:1146:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] +drivers/net/wireless/intel/ipw2x00/libipw.h:595:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] +drivers/net/wireless/marvell/libertas/radiotap.h:34:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] +drivers/net/wireless/marvell/libertas/radiotap.h:5:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] +drivers/net/wireless/microchip/wilc1000/mon.c:10:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] +drivers/net/wireless/microchip/wilc1000/mon.c:15:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] +drivers/net/wireless/virtual/mac80211_hwsim.c:758:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] +drivers/net/wireless/virtual/mac80211_hwsim.c:767:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] + +Signed-off-by: Gustavo A. R. Silva +Link: https://patch.msgid.link/ZwBMtBZKcrzwU7l4@kspp +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/ath/wil6210/txrx.c | 2 +- + drivers/net/wireless/intel/ipw2x00/ipw2100.c | 2 +- + drivers/net/wireless/intel/ipw2x00/ipw2200.h | 2 +- + .../net/wireless/marvell/libertas/radiotap.h | 4 +- + drivers/net/wireless/microchip/wilc1000/mon.c | 4 +- + drivers/net/wireless/virtual/mac80211_hwsim.c | 4 +- + include/net/ieee80211_radiotap.h | 43 +++++++++++-------- + 7 files changed, 33 insertions(+), 28 deletions(-) + +diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c +index f29ac6de71399..19702b6f09c32 100644 +--- a/drivers/net/wireless/ath/wil6210/txrx.c ++++ b/drivers/net/wireless/ath/wil6210/txrx.c +@@ -306,7 +306,7 @@ static void wil_rx_add_radiotap_header(struct wil6210_priv *wil, + struct sk_buff *skb) + { + struct wil6210_rtap { +- struct ieee80211_radiotap_header rthdr; ++ struct ieee80211_radiotap_header_fixed rthdr; + /* fields should be in the order of bits in rthdr.it_present */ + /* flags */ + u8 flags; +diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c +index b6636002c7d22..fe75941c584d1 100644 +--- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c ++++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c +@@ -2518,7 +2518,7 @@ static void isr_rx_monitor(struct ipw2100_priv *priv, int i, + * to build this manually element by element, we can write it much + * more efficiently than we can parse it. ORDER MATTERS HERE */ + struct ipw_rt_hdr { +- struct ieee80211_radiotap_header rt_hdr; ++ struct ieee80211_radiotap_header_fixed rt_hdr; + s8 rt_dbmsignal; /* signal in dbM, kluged to signed */ + } *ipw_rt; + +diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.h b/drivers/net/wireless/intel/ipw2x00/ipw2200.h +index 8ebf09121e173..226286cb7eb82 100644 +--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.h ++++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.h +@@ -1143,7 +1143,7 @@ struct ipw_prom_priv { + * structure is provided regardless of any bits unset. + */ + struct ipw_rt_hdr { +- struct ieee80211_radiotap_header rt_hdr; ++ struct ieee80211_radiotap_header_fixed rt_hdr; + u64 rt_tsf; /* TSF */ /* XXX */ + u8 rt_flags; /* radiotap packet flags */ + u8 rt_rate; /* rate in 500kb/s */ +diff --git a/drivers/net/wireless/marvell/libertas/radiotap.h b/drivers/net/wireless/marvell/libertas/radiotap.h +index 1ed5608d353ff..d543bfe739dcb 100644 +--- a/drivers/net/wireless/marvell/libertas/radiotap.h ++++ b/drivers/net/wireless/marvell/libertas/radiotap.h +@@ -2,7 +2,7 @@ + #include + + struct tx_radiotap_hdr { +- struct ieee80211_radiotap_header hdr; ++ struct ieee80211_radiotap_header_fixed hdr; + u8 rate; + u8 txpower; + u8 rts_retries; +@@ -31,7 +31,7 @@ struct tx_radiotap_hdr { + #define IEEE80211_FC_DSTODS 0x0300 + + struct rx_radiotap_hdr { +- struct ieee80211_radiotap_header hdr; ++ struct ieee80211_radiotap_header_fixed hdr; + u8 flags; + u8 rate; + u8 antsignal; +diff --git a/drivers/net/wireless/microchip/wilc1000/mon.c b/drivers/net/wireless/microchip/wilc1000/mon.c +index 03b7229a0ff5a..c3d27aaec2974 100644 +--- a/drivers/net/wireless/microchip/wilc1000/mon.c ++++ b/drivers/net/wireless/microchip/wilc1000/mon.c +@@ -7,12 +7,12 @@ + #include "cfg80211.h" + + struct wilc_wfi_radiotap_hdr { +- struct ieee80211_radiotap_header hdr; ++ struct ieee80211_radiotap_header_fixed hdr; + u8 rate; + } __packed; + + struct wilc_wfi_radiotap_cb_hdr { +- struct ieee80211_radiotap_header hdr; ++ struct ieee80211_radiotap_header_fixed hdr; + u8 rate; + u8 dump; + u16 tx_flags; +diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c +index 5fe9e4e261429..52468e16c3df6 100644 +--- a/drivers/net/wireless/virtual/mac80211_hwsim.c ++++ b/drivers/net/wireless/virtual/mac80211_hwsim.c +@@ -763,7 +763,7 @@ static const struct rhashtable_params hwsim_rht_params = { + }; + + struct hwsim_radiotap_hdr { +- struct ieee80211_radiotap_header hdr; ++ struct ieee80211_radiotap_header_fixed hdr; + __le64 rt_tsft; + u8 rt_flags; + u8 rt_rate; +@@ -772,7 +772,7 @@ struct hwsim_radiotap_hdr { + } __packed; + + struct hwsim_radiotap_ack_hdr { +- struct ieee80211_radiotap_header hdr; ++ struct ieee80211_radiotap_header_fixed hdr; + u8 rt_flags; + u8 pad; + __le16 rt_channel; +diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h +index 91762faecc13d..1458d3695005a 100644 +--- a/include/net/ieee80211_radiotap.h ++++ b/include/net/ieee80211_radiotap.h +@@ -24,25 +24,27 @@ + * struct ieee80211_radiotap_header - base radiotap header + */ + struct ieee80211_radiotap_header { +- /** +- * @it_version: radiotap version, always 0 +- */ +- uint8_t it_version; +- +- /** +- * @it_pad: padding (or alignment) +- */ +- uint8_t it_pad; +- +- /** +- * @it_len: overall radiotap header length +- */ +- __le16 it_len; +- +- /** +- * @it_present: (first) present word +- */ +- __le32 it_present; ++ __struct_group(ieee80211_radiotap_header_fixed, hdr, __packed, ++ /** ++ * @it_version: radiotap version, always 0 ++ */ ++ uint8_t it_version; ++ ++ /** ++ * @it_pad: padding (or alignment) ++ */ ++ uint8_t it_pad; ++ ++ /** ++ * @it_len: overall radiotap header length ++ */ ++ __le16 it_len; ++ ++ /** ++ * @it_present: (first) present word ++ */ ++ __le32 it_present; ++ ); + + /** + * @it_optional: all remaining presence bitmaps +@@ -50,6 +52,9 @@ struct ieee80211_radiotap_header { + __le32 it_optional[]; + } __packed; + ++static_assert(offsetof(struct ieee80211_radiotap_header, it_optional) == sizeof(struct ieee80211_radiotap_header_fixed), ++ "struct member likely outside of __struct_group()"); ++ + /* version is always 0 */ + #define PKTHDR_RADIOTAP_VERSION 0 + +-- +2.43.0 + diff --git a/queue-6.11/x86-amd_nb-fix-compile-testing-without-config_amd_nb.patch b/queue-6.11/x86-amd_nb-fix-compile-testing-without-config_amd_nb.patch new file mode 100644 index 00000000000..db5bc11a0b9 --- /dev/null +++ b/queue-6.11/x86-amd_nb-fix-compile-testing-without-config_amd_nb.patch @@ -0,0 +1,53 @@ +From f3a0f276bba686c13fc08493dc9fbbc73e14f542 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 29 Oct 2024 09:23:20 +0000 +Subject: x86/amd_nb: Fix compile-testing without CONFIG_AMD_NB +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Arnd Bergmann + +[ Upstream commit fce9642c765a18abd1db0339a7d832c29b68456a ] + +node_to_amd_nb() is defined to NULL in non-AMD configs: + + drivers/platform/x86/amd/hsmp/plat.c: In function 'init_platform_device': + drivers/platform/x86/amd/hsmp/plat.c:165:68: error: dereferencing 'void *' pointer [-Werror] + 165 | sock->root = node_to_amd_nb(i)->root; + | ^~ + drivers/platform/x86/amd/hsmp/plat.c:165:68: error: request for member 'root' in something not a structure or union + +Users of the interface who also allow COMPILE_TEST will cause the above build +error so provide an inline stub to fix that. + + [ bp: Massage commit message. ] + +Signed-off-by: Arnd Bergmann +Signed-off-by: Borislav Petkov (AMD) +Reviewed-by: Ilpo Järvinen +Link: https://lore.kernel.org/r/20241029092329.3857004-1-arnd@kernel.org +Signed-off-by: Sasha Levin +--- + arch/x86/include/asm/amd_nb.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h +index 6f3b6aef47ba9..d0caac26533f2 100644 +--- a/arch/x86/include/asm/amd_nb.h ++++ b/arch/x86/include/asm/amd_nb.h +@@ -116,7 +116,10 @@ static inline bool amd_gart_present(void) + + #define amd_nb_num(x) 0 + #define amd_nb_has_feature(x) false +-#define node_to_amd_nb(x) NULL ++static inline struct amd_northbridge *node_to_amd_nb(int node) ++{ ++ return NULL; ++} + #define amd_gart_present(x) false + + #endif +-- +2.43.0 +