diff -u linux-aws-6.5-6.5.0/Documentation/admin-guide/kernel-parameters.txt linux-aws-6.5-6.5.0/Documentation/admin-guide/kernel-parameters.txt --- linux-aws-6.5-6.5.0/Documentation/admin-guide/kernel-parameters.txt +++ linux-aws-6.5-6.5.0/Documentation/admin-guide/kernel-parameters.txt @@ -2942,6 +2942,10 @@ locktorture.torture_type= [KNL] Specify the locking implementation to test. + locktorture.writer_fifo= [KNL] + Run the write-side locktorture kthreads at + sched_set_fifo() real-time priority. + locktorture.verbose= [KNL] Enable additional printk() statements. @@ -5791,6 +5795,13 @@ This feature may be more efficiently disabled using the csdlock_debug- kernel parameter. + smp.panic_on_ipistall= [KNL] + If a csd_lock_timeout extends for more than + the specified number of milliseconds, panic the + system. By default, let CSD-lock acquisition + take as long as they take. Specifying 300,000 + for this value provides a 5-minute timeout. + smsc-ircc2.nopnp [HW] Don't use PNP to discover SMC devices smsc-ircc2.ircc_cfg= [HW] Device configuration I/O port smsc-ircc2.ircc_sir= [HW] SIR base I/O port diff -u linux-aws-6.5-6.5.0/Makefile linux-aws-6.5-6.5.0/Makefile --- linux-aws-6.5-6.5.0/Makefile +++ linux-aws-6.5-6.5.0/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 5 -SUBLEVEL = 8 +SUBLEVEL = 13 EXTRAVERSION = NAME = Hurr durr I'ma ninja sloth @@ -1600,7 +1600,7 @@ # Directories & files removed with 'make clean' CLEAN_FILES += include/ksym vmlinux.symvers modules-only.symvers \ modules.builtin modules.builtin.modinfo modules.nsdeps \ - compile_commands.json .thinlto-cache rust/test rust/doc \ + compile_commands.json .thinlto-cache rust/test \ rust-project.json .vmlinux.objs .vmlinux.export.c # Directories & files removed with 'make mrproper' diff -u linux-aws-6.5-6.5.0/arch/arm/boot/dts/ti/omap/motorola-mapphone-common.dtsi linux-aws-6.5-6.5.0/arch/arm/boot/dts/ti/omap/motorola-mapphone-common.dtsi --- linux-aws-6.5-6.5.0/arch/arm/boot/dts/ti/omap/motorola-mapphone-common.dtsi +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/ti/omap/motorola-mapphone-common.dtsi @@ -640,6 +640,7 @@ &uart3 { interrupts-extended = <&wakeupgen GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH &omap4_pmx_core 0x17c>; + overrun-throttle-ms = <500>; }; &uart4 { diff -u linux-aws-6.5-6.5.0/arch/arm64/Kconfig linux-aws-6.5-6.5.0/arch/arm64/Kconfig --- linux-aws-6.5-6.5.0/arch/arm64/Kconfig +++ linux-aws-6.5-6.5.0/arch/arm64/Kconfig @@ -1369,6 +1369,8 @@ config CPU_BIG_ENDIAN bool "Build big-endian kernel" depends on !LD_IS_LLD || LLD_VERSION >= 130000 + # https://github.com/llvm/llvm-project/commit/1379b150991f70a5782e9a143c2ba5308da1161c + depends on AS_IS_GNU || AS_VERSION >= 150000 help Say Y if you plan on running a kernel with a big-endian userspace. diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mp-debix-model-a.dts linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mp-debix-model-a.dts --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mp-debix-model-a.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mp-debix-model-a.dts @@ -285,7 +285,6 @@ usb_hub_2_x: hub@1 { compatible = "usbbda,5411"; reg = <1>; - reset-gpios = <&gpio4 25 GPIO_ACTIVE_LOW>; vdd-supply = <®_usb_hub>; peer-hub = <&usb_hub_3_x>; }; @@ -294,7 +293,6 @@ usb_hub_3_x: hub@2 { compatible = "usbbda,411"; reg = <2>; - reset-gpios = <&gpio4 25 GPIO_ACTIVE_LOW>; vdd-supply = <®_usb_hub>; peer-hub = <&usb_hub_2_x>; }; @@ -444,7 +442,6 @@ pinctrl_usb1: usb1grp { fsl,pins = < MX8MP_IOMUXC_GPIO1_IO14__USB2_OTG_PWR 0x10 - MX8MP_IOMUXC_SAI2_TXC__GPIO4_IO25 0x19 >; }; diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mp.dtsi linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mp.dtsi --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mp.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mp.dtsi @@ -2034,6 +2034,7 @@ phys = <&usb3_phy0>, <&usb3_phy0>; phy-names = "usb2-phy", "usb3-phy"; snps,gfladj-refclk-lpm-sel-quirk; + snps,parkmode-disable-ss-quirk; }; }; @@ -2076,6 +2077,7 @@ phys = <&usb3_phy1>, <&usb3_phy1>; phy-names = "usb2-phy", "usb3-phy"; snps,gfladj-refclk-lpm-sel-quirk; + snps,parkmode-disable-ss-quirk; }; }; diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt7986a.dtsi linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt7986a.dtsi --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -374,6 +374,10 @@ reg = <0 0x11230000 0 0x1000>, <0 0x11c20000 0 0x1000>; interrupts = ; + assigned-clocks = <&topckgen CLK_TOP_EMMC_416M_SEL>, + <&topckgen CLK_TOP_EMMC_250M_SEL>; + assigned-clock-parents = <&apmixedsys CLK_APMIXED_MPLL>, + <&topckgen CLK_TOP_NET1PLL_D5_D2>; clocks = <&topckgen CLK_TOP_EMMC_416M_SEL>, <&infracfg CLK_INFRA_MSDC_HCK_CK>, <&infracfg CLK_INFRA_MSDC_CK>, @@ -610,22 +614,34 @@ thermal-sensors = <&thermal 0>; trips { + cpu_trip_crit: crit { + temperature = <125000>; + hysteresis = <2000>; + type = "critical"; + }; + + cpu_trip_hot: hot { + temperature = <120000>; + hysteresis = <2000>; + type = "hot"; + }; + cpu_trip_active_high: active-high { temperature = <115000>; hysteresis = <2000>; type = "active"; }; - cpu_trip_active_low: active-low { + cpu_trip_active_med: active-med { temperature = <85000>; hysteresis = <2000>; type = "active"; }; - cpu_trip_passive: passive { - temperature = <40000>; + cpu_trip_active_low: active-low { + temperature = <60000>; hysteresis = <2000>; - type = "passive"; + type = "active"; }; }; }; diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8195.dtsi linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8195.dtsi --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -627,6 +627,8 @@ power-domain@MT8195_POWER_DOMAIN_VENC_CORE1 { reg = ; + clocks = <&vencsys_core1 CLK_VENC_CORE1_LARB>; + clock-names = "venc1-larb"; mediatek,infracfg = <&infracfg_ao>; #power-domain-cells = <0>; }; @@ -689,6 +691,8 @@ power-domain@MT8195_POWER_DOMAIN_VENC { reg = ; + clocks = <&vencsys CLK_VENC_LARB>; + clock-names = "venc0-larb"; mediatek,infracfg = <&infracfg_ao>; #power-domain-cells = <0>; }; @@ -2665,7 +2669,7 @@ reg = <0 0x1b010000 0 0x1000>; mediatek,larb-id = <20>; mediatek,smi = <&smi_common_vpp>; - clocks = <&vencsys_core1 CLK_VENC_CORE1_LARB>, + clocks = <&vencsys_core1 CLK_VENC_CORE1_VENC>, <&vencsys_core1 CLK_VENC_CORE1_GALS>, <&vppsys0 CLK_VPP0_GALS_VDO0_VDO1_VENCSYS_CORE1>; clock-names = "apb", "smi", "gals"; @@ -2958,7 +2962,7 @@ clock-names = "merge","merge_async"; power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>; mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0xc000 0x1000>; - mediatek,merge-mute = <1>; + mediatek,merge-mute; resets = <&vdosys1 MT8195_VDOSYS1_SW0_RST_B_MERGE0_DL_ASYNC>; }; @@ -2971,7 +2975,7 @@ clock-names = "merge","merge_async"; power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>; mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0xd000 0x1000>; - mediatek,merge-mute = <1>; + mediatek,merge-mute; resets = <&vdosys1 MT8195_VDOSYS1_SW0_RST_B_MERGE1_DL_ASYNC>; }; @@ -2984,7 +2988,7 @@ clock-names = "merge","merge_async"; power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>; mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0xe000 0x1000>; - mediatek,merge-mute = <1>; + mediatek,merge-mute; resets = <&vdosys1 MT8195_VDOSYS1_SW0_RST_B_MERGE2_DL_ASYNC>; }; @@ -2997,7 +3001,7 @@ clock-names = "merge","merge_async"; power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>; mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0xf000 0x1000>; - mediatek,merge-mute = <1>; + mediatek,merge-mute; resets = <&vdosys1 MT8195_VDOSYS1_SW0_RST_B_MERGE3_DL_ASYNC>; }; @@ -3010,7 +3014,7 @@ clock-names = "merge","merge_async"; power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>; mediatek,gce-client-reg = <&gce0 SUBSYS_1c11XXXX 0x0000 0x1000>; - mediatek,merge-fifo-en = <1>; + mediatek,merge-fifo-en; resets = <&vdosys1 MT8195_VDOSYS1_SW0_RST_B_MERGE4_DL_ASYNC>; }; diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/nvidia/tegra234.dtsi linux-aws-6.5-6.5.0/arch/arm64/boot/dts/nvidia/tegra234.dtsi --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/nvidia/tegra234.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/nvidia/tegra234.dtsi @@ -43,12 +43,12 @@ , , , - , - , - , - , - , - ; + , + , + , + , + , + ; status = "okay"; }; diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/apq8016-sbc.dts linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/apq8016-sbc.dts --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/apq8016-sbc.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/apq8016-sbc.dts @@ -198,6 +198,9 @@ pd-gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>; avdd-supply = <&pm8916_l6>; + a2vdd-supply = <&pm8916_l6>; + dvdd-supply = <&pm8916_l6>; + pvdd-supply = <&pm8916_l6>; v1p2-supply = <&pm8916_l6>; v3p3-supply = <&pm8916_l17>; diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/apq8096-db820c.dts linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/apq8096-db820c.dts --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/apq8096-db820c.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/apq8096-db820c.dts @@ -62,25 +62,23 @@ stdout-path = "serial0:115200n8"; }; - clocks { - divclk4: divclk4 { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <32768>; - clock-output-names = "divclk4"; + div1_mclk: divclk1 { + compatible = "gpio-gate-clock"; + pinctrl-0 = <&audio_mclk>; + pinctrl-names = "default"; + clocks = <&rpmcc RPM_SMD_DIV_CLK1>; + #clock-cells = <0>; + enable-gpios = <&pm8994_gpios 15 0>; + }; - pinctrl-names = "default"; - pinctrl-0 = <&divclk4_pin_a>; - }; + divclk4: divclk4 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "divclk4"; - div1_mclk: divclk1 { - compatible = "gpio-gate-clock"; - pinctrl-0 = <&audio_mclk>; - pinctrl-names = "default"; - clocks = <&rpmcc RPM_SMD_DIV_CLK1>; - #clock-cells = <0>; - enable-gpios = <&pm8994_gpios 15 0>; - }; + pinctrl-names = "default"; + pinctrl-0 = <&divclk4_pin_a>; }; gpio-keys { diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/ipq8074.dtsi linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/ipq8074.dtsi --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/ipq8074.dtsi @@ -101,7 +101,7 @@ reg = <0x0 0x4ab00000 0x0 0x100000>; no-map; - hwlocks = <&tcsr_mutex 0>; + hwlocks = <&tcsr_mutex 3>; }; memory@4ac00000 { diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8939.dtsi linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8939.dtsi --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8939.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8939.dtsi @@ -1449,7 +1449,7 @@ apps_iommu: iommu@1ef0000 { compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1"; reg = <0x01ef0000 0x3000>; - ranges = <0 0x01e20000 0x40000>; + ranges = <0 0x01e20000 0x20000>; clocks = <&gcc GCC_SMMU_CFG_CLK>, <&gcc GCC_APSS_TCU_CLK>; clock-names = "iface", "bus"; diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts @@ -20,16 +20,14 @@ qcom,pmic-id = <0x20009 0x2000a 0x00 0x00>; qcom,board-id = <31 0>; - clocks { - divclk2_haptics: divclk2 { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <32768>; - clock-output-names = "divclk2"; + divclk2_haptics: divclk2 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "divclk2"; - pinctrl-names = "default"; - pinctrl-0 = <&divclk2_pin_a>; - }; + pinctrl-names = "default"; + pinctrl-0 = <&divclk2_pin_a>; }; }; diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sc7280.dtsi linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sc7280.dtsi --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -649,18 +649,6 @@ }; }; - eud_typec: connector { - compatible = "usb-c-connector"; - - ports { - port@0 { - con_eud: endpoint { - remote-endpoint = <&eud_con>; - }; - }; - }; - }; - memory@80000000 { device_type = "memory"; /* We expect the bootloader to fill in the size */ @@ -869,7 +857,8 @@ clocks = <&rpmhcc RPMH_CXO_CLK>, <&rpmhcc RPMH_CXO_CLK_A>, <&sleep_clk>, <0>, <&pcie1_lane>, - <0>, <0>, <0>, <0>; + <0>, <0>, <0>, + <&usb_1_ssphy>; clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk", "pcie_0_pipe_clk", "pcie_1_pipe_clk", "ufs_phy_rx_symbol_0_clk", "ufs_phy_rx_symbol_1_clk", @@ -3624,6 +3613,8 @@ <0 0x88e2000 0 0x1000>; interrupts-extended = <&pdc 11 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + ports { #address-cells = <1>; #size-cells = <0>; @@ -3634,13 +3625,6 @@ remote-endpoint = <&usb2_role_switch>; }; }; - - port@1 { - reg = <1>; - eud_con: endpoint { - remote-endpoint = <&con_eud>; - }; - }; }; }; @@ -5363,6 +5347,14 @@ reg = <0 0x18591000 0 0x1000>, <0 0x18592000 0 0x1000>, <0 0x18593000 0 0x1000>; + + interrupts = , + , + ; + interrupt-names = "dcvsh-irq-0", + "dcvsh-irq-1", + "dcvsh-irq-2"; + clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GCC_GPLL0>; clock-names = "xo", "alternate"; #freq-domain-cells = <1>; diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sm8150.dtsi linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sm8150.dtsi --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sm8150.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sm8150.dtsi @@ -1893,8 +1893,12 @@ ranges; clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>, <&gcc GCC_PCIE_0_CFG_AHB_CLK>, + <&gcc GCC_PCIE_0_CLKREF_CLK>, <&gcc GCC_PCIE0_PHY_REFGEN_CLK>; - clock-names = "aux", "cfg_ahb", "refgen"; + clock-names = "aux", + "cfg_ahb", + "ref", + "refgen"; resets = <&gcc GCC_PCIE_0_PHY_BCR>; reset-names = "phy"; @@ -1991,8 +1995,12 @@ ranges; clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>, <&gcc GCC_PCIE_1_CFG_AHB_CLK>, + <&gcc GCC_PCIE_1_CLKREF_CLK>, <&gcc GCC_PCIE1_PHY_REFGEN_CLK>; - clock-names = "aux", "cfg_ahb", "refgen"; + clock-names = "aux", + "cfg_ahb", + "ref", + "refgen"; resets = <&gcc GCC_PCIE_1_PHY_BCR>; reset-names = "phy"; diff -u linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sm8350.dtsi linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sm8350.dtsi --- linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sm8350.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sm8350.dtsi @@ -2939,7 +2939,7 @@ }; qup_uart18_default: qup-uart18-default-state { - pins = "gpio58", "gpio59"; + pins = "gpio68", "gpio69"; function = "qup18"; drive-strength = <2>; bias-disable; diff -u linux-aws-6.5-6.5.0/arch/arm64/include/asm/cputype.h linux-aws-6.5-6.5.0/arch/arm64/include/asm/cputype.h --- linux-aws-6.5-6.5.0/arch/arm64/include/asm/cputype.h +++ linux-aws-6.5-6.5.0/arch/arm64/include/asm/cputype.h @@ -86,7 +86,8 @@ #define ARM_CPU_PART_NEOVERSE_N2 0xD49 #define ARM_CPU_PART_CORTEX_A78C 0xD4B -#define APM_CPU_PART_POTENZA 0x000 +#define APM_CPU_PART_XGENE 0x000 +#define APM_CPU_VAR_POTENZA 0x00 #define CAVIUM_CPU_PART_THUNDERX 0x0A1 #define CAVIUM_CPU_PART_THUNDERX_81XX 0x0A2 diff -u linux-aws-6.5-6.5.0/arch/arm64/kernel/module-plts.c linux-aws-6.5-6.5.0/arch/arm64/kernel/module-plts.c --- linux-aws-6.5-6.5.0/arch/arm64/kernel/module-plts.c +++ linux-aws-6.5-6.5.0/arch/arm64/kernel/module-plts.c @@ -167,9 +167,6 @@ switch (ELF64_R_TYPE(rela[i].r_info)) { case R_AARCH64_JUMP26: case R_AARCH64_CALL26: - if (!IS_ENABLED(CONFIG_RANDOMIZE_BASE)) - break; - /* * We only have to consider branch targets that resolve * to symbols that are defined in a different section. @@ -269,9 +266,6 @@ { int i = 0, j = numrels - 1; - if (!IS_ENABLED(CONFIG_RANDOMIZE_BASE)) - return 0; - while (i < j) { if (branch_rela_needs_plt(syms, &rela[i], dstidx)) i++; diff -u linux-aws-6.5-6.5.0/arch/mips/kernel/process.c linux-aws-6.5-6.5.0/arch/mips/kernel/process.c --- linux-aws-6.5-6.5.0/arch/mips/kernel/process.c +++ linux-aws-6.5-6.5.0/arch/mips/kernel/process.c @@ -121,6 +121,19 @@ /* Put the stack after the struct pt_regs. */ childksp = (unsigned long) childregs; p->thread.cp0_status = (read_c0_status() & ~(ST0_CU2|ST0_CU1)) | ST0_KERNEL_CUMASK; + + /* + * New tasks lose permission to use the fpu. This accelerates context + * switching for most programs since they don't use the fpu. + */ + clear_tsk_thread_flag(p, TIF_USEDFPU); + clear_tsk_thread_flag(p, TIF_USEDMSA); + clear_tsk_thread_flag(p, TIF_MSA_CTX_LIVE); + +#ifdef CONFIG_MIPS_MT_FPAFF + clear_tsk_thread_flag(p, TIF_FPUBOUND); +#endif /* CONFIG_MIPS_MT_FPAFF */ + if (unlikely(args->fn)) { /* kernel thread */ unsigned long status = p->thread.cp0_status; @@ -149,20 +162,8 @@ p->thread.reg29 = (unsigned long) childregs; p->thread.reg31 = (unsigned long) ret_from_fork; - /* - * New tasks lose permission to use the fpu. This accelerates context - * switching for most programs since they don't use the fpu. - */ childregs->cp0_status &= ~(ST0_CU2|ST0_CU1); - clear_tsk_thread_flag(p, TIF_USEDFPU); - clear_tsk_thread_flag(p, TIF_USEDMSA); - clear_tsk_thread_flag(p, TIF_MSA_CTX_LIVE); - -#ifdef CONFIG_MIPS_MT_FPAFF - clear_tsk_thread_flag(p, TIF_FPUBOUND); -#endif /* CONFIG_MIPS_MT_FPAFF */ - #ifdef CONFIG_MIPS_FP_SUPPORT atomic_set(&p->thread.bd_emu_frame, BD_EMUFRAME_NONE); #endif diff -u linux-aws-6.5-6.5.0/arch/parisc/include/asm/ldcw.h linux-aws-6.5-6.5.0/arch/parisc/include/asm/ldcw.h --- linux-aws-6.5-6.5.0/arch/parisc/include/asm/ldcw.h +++ linux-aws-6.5-6.5.0/arch/parisc/include/asm/ldcw.h @@ -55,7 +55,7 @@ }) #ifdef CONFIG_SMP -# define __lock_aligned __section(".data..lock_aligned") +# define __lock_aligned __section(".data..lock_aligned") __aligned(16) #endif #endif /* __PARISC_LDCW_H */ diff -u linux-aws-6.5-6.5.0/arch/powerpc/kernel/setup-common.c linux-aws-6.5-6.5.0/arch/powerpc/kernel/setup-common.c --- linux-aws-6.5-6.5.0/arch/powerpc/kernel/setup-common.c +++ linux-aws-6.5-6.5.0/arch/powerpc/kernel/setup-common.c @@ -960,6 +960,8 @@ /* Parse memory topology */ mem_topology_setup(); + /* Set max_mapnr before paging_init() */ + set_max_mapnr(max_pfn); /* * Release secondary cpus out of their spinloops at 0x60 now that diff -u linux-aws-6.5-6.5.0/arch/powerpc/kernel/traps.c linux-aws-6.5-6.5.0/arch/powerpc/kernel/traps.c --- linux-aws-6.5-6.5.0/arch/powerpc/kernel/traps.c +++ linux-aws-6.5-6.5.0/arch/powerpc/kernel/traps.c @@ -1164,6 +1164,7 @@ __single_step_exception(regs); } +#ifdef CONFIG_PPC_FPU_REGS static inline int __parse_fpscr(unsigned long fpscr) { int ret = FPE_FLTUNK; @@ -1190,6 +1191,7 @@ return ret; } +#endif static void parse_fpe(struct pt_regs *regs) { diff -u linux-aws-6.5-6.5.0/arch/powerpc/platforms/pseries/lpar.c linux-aws-6.5-6.5.0/arch/powerpc/platforms/pseries/lpar.c --- linux-aws-6.5-6.5.0/arch/powerpc/platforms/pseries/lpar.c +++ linux-aws-6.5-6.5.0/arch/powerpc/platforms/pseries/lpar.c @@ -525,8 +525,10 @@ if (cmd) { rc = init_cpu_associativity(); - if (rc) + if (rc) { + destroy_cpu_associativity(); goto out; + } for_each_possible_cpu(cpu) { disp = per_cpu_ptr(&vcpu_disp_data, cpu); diff -u linux-aws-6.5-6.5.0/arch/riscv/kernel/traps.c linux-aws-6.5-6.5.0/arch/riscv/kernel/traps.c --- linux-aws-6.5-6.5.0/arch/riscv/kernel/traps.c +++ linux-aws-6.5-6.5.0/arch/riscv/kernel/traps.c @@ -408,48 +408,14 @@ #endif /* CONFIG_GENERIC_BUG */ #ifdef CONFIG_VMAP_STACK -/* - * Extra stack space that allows us to provide panic messages when the kernel - * has overflowed its stack. - */ -static DEFINE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], +DEFINE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], overflow_stack)__aligned(16); -/* - * A temporary stack for use by handle_kernel_stack_overflow. This is used so - * we can call into C code to get the per-hart overflow stack. Usage of this - * stack must be protected by spin_shadow_stack. - */ -long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE/sizeof(long)] __aligned(16); - -/* - * A pseudo spinlock to protect the shadow stack from being used by multiple - * harts concurrently. This isn't a real spinlock because the lock side must - * be taken without a valid stack and only a single register, it's only taken - * while in the process of panicing anyway so the performance and error - * checking a proper spinlock gives us doesn't matter. - */ -unsigned long spin_shadow_stack; - -asmlinkage unsigned long get_overflow_stack(void) -{ - return (unsigned long)this_cpu_ptr(overflow_stack) + - OVERFLOW_STACK_SIZE; -} asmlinkage void handle_bad_stack(struct pt_regs *regs) { unsigned long tsk_stk = (unsigned long)current->stack; unsigned long ovf_stk = (unsigned long)this_cpu_ptr(overflow_stack); - /* - * We're done with the shadow stack by this point, as we're on the - * overflow stack. Tell any other concurrent overflowing harts that - * they can proceed with panicing by releasing the pseudo-spinlock. - * - * This pairs with an amoswap.aq in handle_kernel_stack_overflow. - */ - smp_store_release(&spin_shadow_stack, 0); - console_verbose(); pr_emerg("Insufficient stack space to handle exception!\n"); diff -u linux-aws-6.5-6.5.0/arch/s390/kernel/ipl.c linux-aws-6.5-6.5.0/arch/s390/kernel/ipl.c --- linux-aws-6.5-6.5.0/arch/s390/kernel/ipl.c +++ linux-aws-6.5-6.5.0/arch/s390/kernel/ipl.c @@ -680,6 +680,7 @@ &ipl_ccw_attr_group_lpar); break; case IPL_TYPE_ECKD: + case IPL_TYPE_ECKD_DUMP: rc = sysfs_create_group(&ipl_kset->kobj, &ipl_eckd_attr_group); break; case IPL_TYPE_FCP: diff -u linux-aws-6.5-6.5.0/arch/x86/include/asm/kvm_host.h linux-aws-6.5-6.5.0/arch/x86/include/asm/kvm_host.h --- linux-aws-6.5-6.5.0/arch/x86/include/asm/kvm_host.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/kvm_host.h @@ -1690,6 +1690,7 @@ int (*pi_update_irte)(struct kvm *kvm, unsigned int host_irq, uint32_t guest_irq, bool set); void (*pi_start_assignment)(struct kvm *kvm); + void (*apicv_pre_state_restore)(struct kvm_vcpu *vcpu); void (*apicv_post_state_restore)(struct kvm_vcpu *vcpu); bool (*dy_apicv_has_pending_interrupt)(struct kvm_vcpu *vcpu); diff -u linux-aws-6.5-6.5.0/arch/x86/include/asm/msr-index.h linux-aws-6.5-6.5.0/arch/x86/include/asm/msr-index.h --- linux-aws-6.5-6.5.0/arch/x86/include/asm/msr-index.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/msr-index.h @@ -553,6 +553,7 @@ #define MSR_AMD64_CPUID_FN_1 0xc0011004 #define MSR_AMD64_LS_CFG 0xc0011020 #define MSR_AMD64_DC_CFG 0xc0011022 +#define MSR_AMD64_TW_CFG 0xc0011023 #define MSR_AMD64_DE_CFG 0xc0011029 #define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1 diff -u linux-aws-6.5-6.5.0/arch/x86/kernel/amd_nb.c linux-aws-6.5-6.5.0/arch/x86/kernel/amd_nb.c --- linux-aws-6.5-6.5.0/arch/x86/kernel/amd_nb.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/amd_nb.c @@ -112,6 +112,9 @@ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M60H_DF_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F4) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M78H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M00H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_MI200_DF_F4) }, diff -u linux-aws-6.5-6.5.0/arch/x86/kernel/cpu/amd.c linux-aws-6.5-6.5.0/arch/x86/kernel/cpu/amd.c --- linux-aws-6.5-6.5.0/arch/x86/kernel/cpu/amd.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/cpu/amd.c @@ -1315,6 +1315,9 @@ void amd_check_microcode(void) { + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) + return; + on_each_cpu(zenbleed_check_cpu, NULL, 1); } diff -u linux-aws-6.5-6.5.0/arch/x86/kernel/cpu/bugs.c linux-aws-6.5-6.5.0/arch/x86/kernel/cpu/bugs.c --- linux-aws-6.5-6.5.0/arch/x86/kernel/cpu/bugs.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/cpu/bugs.c @@ -2353,6 +2353,8 @@ enum srso_mitigation { SRSO_MITIGATION_NONE, + SRSO_MITIGATION_UCODE_NEEDED, + SRSO_MITIGATION_SAFE_RET_UCODE_NEEDED, SRSO_MITIGATION_MICROCODE, SRSO_MITIGATION_SAFE_RET, SRSO_MITIGATION_IBPB, @@ -2368,11 +2370,13 @@ }; static const char * const srso_strings[] = { - [SRSO_MITIGATION_NONE] = "Vulnerable", - [SRSO_MITIGATION_MICROCODE] = "Mitigation: microcode", - [SRSO_MITIGATION_SAFE_RET] = "Mitigation: safe RET", - [SRSO_MITIGATION_IBPB] = "Mitigation: IBPB", - [SRSO_MITIGATION_IBPB_ON_VMEXIT] = "Mitigation: IBPB on VMEXIT only" + [SRSO_MITIGATION_NONE] = "Vulnerable", + [SRSO_MITIGATION_UCODE_NEEDED] = "Vulnerable: No microcode", + [SRSO_MITIGATION_SAFE_RET_UCODE_NEEDED] = "Vulnerable: Safe RET, no microcode", + [SRSO_MITIGATION_MICROCODE] = "Vulnerable: Microcode, no safe RET", + [SRSO_MITIGATION_SAFE_RET] = "Mitigation: Safe RET", + [SRSO_MITIGATION_IBPB] = "Mitigation: IBPB", + [SRSO_MITIGATION_IBPB_ON_VMEXIT] = "Mitigation: IBPB on VMEXIT only" }; static enum srso_mitigation srso_mitigation __ro_after_init = SRSO_MITIGATION_NONE; @@ -2409,10 +2413,7 @@ if (!boot_cpu_has_bug(X86_BUG_SRSO) || cpu_mitigations_off()) goto pred_cmd; - if (!has_microcode) { - pr_warn("IBPB-extending microcode not applied!\n"); - pr_warn(SRSO_NOTICE); - } else { + if (has_microcode) { /* * Zen1/2 with SMT off aren't vulnerable after the right * IBPB microcode has been applied. @@ -2425,10 +2426,15 @@ if (retbleed_mitigation == RETBLEED_MITIGATION_IBPB) { if (has_microcode) { - pr_err("Retbleed IBPB mitigation enabled, using same for SRSO\n"); srso_mitigation = SRSO_MITIGATION_IBPB; - goto pred_cmd; + goto out; } + } else { + pr_warn("IBPB-extending microcode not applied!\n"); + pr_warn(SRSO_NOTICE); + + /* may be overwritten by SRSO_CMD_SAFE_RET below */ + srso_mitigation = SRSO_MITIGATION_UCODE_NEEDED; } switch (srso_cmd) { @@ -2458,7 +2464,10 @@ setup_force_cpu_cap(X86_FEATURE_SRSO); x86_return_thunk = srso_return_thunk; } - srso_mitigation = SRSO_MITIGATION_SAFE_RET; + if (has_microcode) + srso_mitigation = SRSO_MITIGATION_SAFE_RET; + else + srso_mitigation = SRSO_MITIGATION_SAFE_RET_UCODE_NEEDED; } else { pr_err("WARNING: kernel not compiled with CPU_SRSO.\n"); goto pred_cmd; @@ -2493,10 +2502,11 @@ break; } - pr_info("%s%s\n", srso_strings[srso_mitigation], (has_microcode ? "" : ", no microcode")); +out: + pr_info("%s\n", srso_strings[srso_mitigation]); pred_cmd: - if ((boot_cpu_has(X86_FEATURE_SRSO_NO) || srso_cmd == SRSO_CMD_OFF) && + if ((!boot_cpu_has_bug(X86_BUG_SRSO) || srso_cmd == SRSO_CMD_OFF) && boot_cpu_has(X86_FEATURE_SBPB)) x86_pred_cmd = PRED_CMD_SBPB; } @@ -2704,9 +2714,7 @@ if (boot_cpu_has(X86_FEATURE_SRSO_NO)) return sysfs_emit(buf, "Mitigation: SMT disabled\n"); - return sysfs_emit(buf, "%s%s\n", - srso_strings[srso_mitigation], - boot_cpu_has(X86_FEATURE_IBPB_BRTYPE) ? "" : ", no microcode"); + return sysfs_emit(buf, "%s\n", srso_strings[srso_mitigation]); } static ssize_t gds_show_state(char *buf) diff -u linux-aws-6.5-6.5.0/arch/x86/kernel/sev.c linux-aws-6.5-6.5.0/arch/x86/kernel/sev.c --- linux-aws-6.5-6.5.0/arch/x86/kernel/sev.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/sev.c @@ -1234,10 +1234,6 @@ if (!cc_platform_has(CC_ATTR_GUEST_STATE_ENCRYPT)) return; - /* First make sure the hypervisor talks a supported protocol. */ - if (!sev_es_negotiate_protocol()) - sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SEV_ES_GEN_REQ); - /* * Check whether the runtime #VC exception handler is active. It uses * the per-CPU GHCB page which is set up by sev_es_init_vc_handling(). @@ -1255,6 +1251,13 @@ } /* + * Make sure the hypervisor talks a supported protocol. + * This gets called only in the BSP boot phase. + */ + if (!sev_es_negotiate_protocol()) + sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SEV_ES_GEN_REQ); + + /* * Clear the boot_ghcb. The first exception comes in before the bss * section is cleared. */ diff -u linux-aws-6.5-6.5.0/arch/x86/kvm/svm/avic.c linux-aws-6.5-6.5.0/arch/x86/kvm/svm/avic.c --- linux-aws-6.5-6.5.0/arch/x86/kvm/svm/avic.c +++ linux-aws-6.5-6.5.0/arch/x86/kvm/svm/avic.c @@ -529,8 +529,11 @@ case AVIC_IPI_FAILURE_INVALID_BACKING_PAGE: WARN_ONCE(1, "Invalid backing page\n"); break; + case AVIC_IPI_FAILURE_INVALID_IPI_VECTOR: + /* Invalid IPI with vector < 16 */ + break; default: - pr_err("Unknown IPI interception\n"); + vcpu_unimpl(vcpu, "Unknown avic incomplete IPI interception\n"); } return 1; diff -u linux-aws-6.5-6.5.0/arch/x86/kvm/svm/nested.c linux-aws-6.5-6.5.0/arch/x86/kvm/svm/nested.c --- linux-aws-6.5-6.5.0/arch/x86/kvm/svm/nested.c +++ linux-aws-6.5-6.5.0/arch/x86/kvm/svm/nested.c @@ -1243,6 +1243,9 @@ nested_svm_uninit_mmu_context(vcpu); vmcb_mark_all_dirty(svm->vmcb); + + if (kvm_apicv_activated(vcpu->kvm)) + kvm_make_request(KVM_REQ_APICV_UPDATE, vcpu); } kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu); diff -u linux-aws-6.5-6.5.0/arch/x86/kvm/svm/svm.c linux-aws-6.5-6.5.0/arch/x86/kvm/svm/svm.c --- linux-aws-6.5-6.5.0/arch/x86/kvm/svm/svm.c +++ linux-aws-6.5-6.5.0/arch/x86/kvm/svm/svm.c @@ -1809,15 +1809,17 @@ bool old_paging = is_paging(vcpu); #ifdef CONFIG_X86_64 - if (vcpu->arch.efer & EFER_LME && !vcpu->arch.guest_state_protected) { + if (vcpu->arch.efer & EFER_LME) { if (!is_paging(vcpu) && (cr0 & X86_CR0_PG)) { vcpu->arch.efer |= EFER_LMA; - svm->vmcb->save.efer |= EFER_LMA | EFER_LME; + if (!vcpu->arch.guest_state_protected) + svm->vmcb->save.efer |= EFER_LMA | EFER_LME; } if (is_paging(vcpu) && !(cr0 & X86_CR0_PG)) { vcpu->arch.efer &= ~EFER_LMA; - svm->vmcb->save.efer &= ~(EFER_LMA | EFER_LME); + if (!vcpu->arch.guest_state_protected) + svm->vmcb->save.efer &= ~(EFER_LMA | EFER_LME); } } #endif diff -u linux-aws-6.5-6.5.0/arch/x86/kvm/vmx/vmx.c linux-aws-6.5-6.5.0/arch/x86/kvm/vmx/vmx.c --- linux-aws-6.5-6.5.0/arch/x86/kvm/vmx/vmx.c +++ linux-aws-6.5-6.5.0/arch/x86/kvm/vmx/vmx.c @@ -6909,7 +6909,7 @@ vmcs_write64(EOI_EXIT_BITMAP3, eoi_exit_bitmap[3]); } -static void vmx_apicv_post_state_restore(struct kvm_vcpu *vcpu) +static void vmx_apicv_pre_state_restore(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); @@ -8275,7 +8275,7 @@ .set_apic_access_page_addr = vmx_set_apic_access_page_addr, .refresh_apicv_exec_ctrl = vmx_refresh_apicv_exec_ctrl, .load_eoi_exitmap = vmx_load_eoi_exitmap, - .apicv_post_state_restore = vmx_apicv_post_state_restore, + .apicv_pre_state_restore = vmx_apicv_pre_state_restore, .required_apicv_inhibits = VMX_REQUIRED_APICV_INHIBITS, .hwapic_irr_update = vmx_hwapic_irr_update, .hwapic_isr_update = vmx_hwapic_isr_update, diff -u linux-aws-6.5-6.5.0/arch/x86/kvm/x86.c linux-aws-6.5-6.5.0/arch/x86/kvm/x86.c --- linux-aws-6.5-6.5.0/arch/x86/kvm/x86.c +++ linux-aws-6.5-6.5.0/arch/x86/kvm/x86.c @@ -3643,6 +3643,7 @@ case MSR_AMD64_PATCH_LOADER: case MSR_AMD64_BU_CFG2: case MSR_AMD64_DC_CFG: + case MSR_AMD64_TW_CFG: case MSR_F15H_EX_CFG: break; @@ -4067,6 +4068,7 @@ case MSR_AMD64_BU_CFG2: case MSR_IA32_PERF_CTL: case MSR_AMD64_DC_CFG: + case MSR_AMD64_TW_CFG: case MSR_F15H_EX_CFG: /* * Intel Sandy Bridge CPUs must support the RAPL (running average power @@ -5385,26 +5387,37 @@ return 0; } -static void kvm_vcpu_ioctl_x86_get_xsave(struct kvm_vcpu *vcpu, - struct kvm_xsave *guest_xsave) -{ - if (fpstate_is_confidential(&vcpu->arch.guest_fpu)) - return; - - fpu_copy_guest_fpstate_to_uabi(&vcpu->arch.guest_fpu, - guest_xsave->region, - sizeof(guest_xsave->region), - vcpu->arch.pkru); -} static void kvm_vcpu_ioctl_x86_get_xsave2(struct kvm_vcpu *vcpu, u8 *state, unsigned int size) { + /* + * Only copy state for features that are enabled for the guest. The + * state itself isn't problematic, but setting bits in the header for + * features that are supported in *this* host but not exposed to the + * guest can result in KVM_SET_XSAVE failing when live migrating to a + * compatible host without the features that are NOT exposed to the + * guest. + * + * FP+SSE can always be saved/restored via KVM_{G,S}ET_XSAVE, even if + * XSAVE/XCRO are not exposed to the guest, and even if XSAVE isn't + * supported by the host. + */ + u64 supported_xcr0 = vcpu->arch.guest_supported_xcr0 | + XFEATURE_MASK_FPSSE; + if (fpstate_is_confidential(&vcpu->arch.guest_fpu)) return; - fpu_copy_guest_fpstate_to_uabi(&vcpu->arch.guest_fpu, - state, size, vcpu->arch.pkru); + fpu_copy_guest_fpstate_to_uabi(&vcpu->arch.guest_fpu, state, size, + supported_xcr0, vcpu->arch.pkru); +} + +static void kvm_vcpu_ioctl_x86_get_xsave(struct kvm_vcpu *vcpu, + struct kvm_xsave *guest_xsave) +{ + return kvm_vcpu_ioctl_x86_get_xsave2(vcpu, (void *)guest_xsave->region, + sizeof(guest_xsave->region)); } static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu, diff -u linux-aws-6.5-6.5.0/arch/x86/mm/mem_encrypt_amd.c linux-aws-6.5-6.5.0/arch/x86/mm/mem_encrypt_amd.c --- linux-aws-6.5-6.5.0/arch/x86/mm/mem_encrypt_amd.c +++ linux-aws-6.5-6.5.0/arch/x86/mm/mem_encrypt_amd.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "mm_internal.h" @@ -504,6 +505,16 @@ x86_platform.guest.enc_cache_flush_required = amd_enc_cache_flush_required; /* + * The VMM is capable of injecting interrupt 0x80 and triggering the + * compatibility syscall path. + * + * By default, the 32-bit emulation is disabled in order to ensure + * the safety of the VM. + */ + if (sev_status & MSR_AMD64_SEV_ENABLED) + ia32_disable(); + + /* * AMD-SEV-ES intercepts the RDMSR to read the X2APIC ID in the * parallel bringup low level code. That raises #VC which cannot be * handled there. diff -u linux-aws-6.5-6.5.0/arch/x86/xen/enlighten_hvm.c linux-aws-6.5-6.5.0/arch/x86/xen/enlighten_hvm.c --- linux-aws-6.5-6.5.0/arch/x86/xen/enlighten_hvm.c +++ linux-aws-6.5-6.5.0/arch/x86/xen/enlighten_hvm.c @@ -143,7 +143,7 @@ inc_irq_stat(irq_hv_callback_count); - xen_hvm_evtchn_do_upcall(); + xen_evtchn_do_upcall(); set_irq_regs(old_regs); } diff -u linux-aws-6.5-6.5.0/arch/x86/xen/xen-ops.h linux-aws-6.5-6.5.0/arch/x86/xen/xen-ops.h --- linux-aws-6.5-6.5.0/arch/x86/xen/xen-ops.h +++ linux-aws-6.5-6.5.0/arch/x86/xen/xen-ops.h @@ -21,7 +21,7 @@ struct trap_info; void xen_copy_trap_info(struct trap_info *traps); -DECLARE_PER_CPU(struct vcpu_info, xen_vcpu_info); +DECLARE_PER_CPU_ALIGNED(struct vcpu_info, xen_vcpu_info); DECLARE_PER_CPU(unsigned long, xen_cr3); DECLARE_PER_CPU(unsigned long, xen_current_cr3); diff -u linux-aws-6.5-6.5.0/block/blk-mq.c linux-aws-6.5-6.5.0/block/blk-mq.c --- linux-aws-6.5-6.5.0/block/blk-mq.c +++ linux-aws-6.5-6.5.0/block/blk-mq.c @@ -2874,11 +2874,8 @@ }; struct request *rq; - if (unlikely(bio_queue_enter(bio))) - return NULL; - if (blk_mq_attempt_bio_merge(q, bio, nsegs)) - goto queue_exit; + return NULL; rq_qos_throttle(q, bio); @@ -2894,35 +2891,23 @@ rq_qos_cleanup(q, bio); if (bio->bi_opf & REQ_NOWAIT) bio_wouldblock_error(bio); -queue_exit: - blk_queue_exit(q); return NULL; } -static inline struct request *blk_mq_get_cached_request(struct request_queue *q, - struct blk_plug *plug, struct bio **bio, unsigned int nsegs) +/* return true if this @rq can be used for @bio */ +static bool blk_mq_can_use_cached_rq(struct request *rq, struct blk_plug *plug, + struct bio *bio) { - struct request *rq; - enum hctx_type type, hctx_type; - - if (!plug) - return NULL; - rq = rq_list_peek(&plug->cached_rq); - if (!rq || rq->q != q) - return NULL; + enum hctx_type type = blk_mq_get_hctx_type(bio->bi_opf); + enum hctx_type hctx_type = rq->mq_hctx->type; - if (blk_mq_attempt_bio_merge(q, *bio, nsegs)) { - *bio = NULL; - return NULL; - } + WARN_ON_ONCE(rq_list_peek(&plug->cached_rq) != rq); - type = blk_mq_get_hctx_type((*bio)->bi_opf); - hctx_type = rq->mq_hctx->type; if (type != hctx_type && !(type == HCTX_TYPE_READ && hctx_type == HCTX_TYPE_DEFAULT)) - return NULL; - if (op_is_flush(rq->cmd_flags) != op_is_flush((*bio)->bi_opf)) - return NULL; + return false; + if (op_is_flush(rq->cmd_flags) != op_is_flush(bio->bi_opf)) + return false; /* * If any qos ->throttle() end up blocking, we will have flushed the @@ -2930,12 +2915,12 @@ * before we throttle. */ plug->cached_rq = rq_list_next(rq); - rq_qos_throttle(q, *bio); + rq_qos_throttle(rq->q, bio); blk_mq_rq_time_init(rq, 0); - rq->cmd_flags = (*bio)->bi_opf; + rq->cmd_flags = bio->bi_opf; INIT_LIST_HEAD(&rq->queuelist); - return rq; + return true; } static void bio_set_ioprio(struct bio *bio) @@ -2965,7 +2950,7 @@ struct blk_plug *plug = blk_mq_plug(bio); const int is_sync = op_is_sync(bio->bi_opf); struct blk_mq_hw_ctx *hctx; - struct request *rq; + struct request *rq = NULL; unsigned int nr_segs = 1; blk_status_t ret; @@ -2976,20 +2961,36 @@ return; } - if (!bio_integrity_prep(bio)) - return; - bio_set_ioprio(bio); - rq = blk_mq_get_cached_request(q, plug, &bio, nr_segs); - if (!rq) { - if (!bio) + if (plug) { + rq = rq_list_peek(&plug->cached_rq); + if (rq && rq->q != q) + rq = NULL; + } + if (rq) { + if (!bio_integrity_prep(bio)) return; - rq = blk_mq_get_new_requests(q, plug, bio, nr_segs); - if (unlikely(!rq)) + if (blk_mq_attempt_bio_merge(q, bio, nr_segs)) return; + if (blk_mq_can_use_cached_rq(rq, plug, bio)) + goto done; + percpu_ref_get(&q->q_usage_counter); + } else { + if (unlikely(bio_queue_enter(bio))) + return; + if (!bio_integrity_prep(bio)) + goto fail; + } + + rq = blk_mq_get_new_requests(q, plug, bio, nr_segs); + if (unlikely(!rq)) { +fail: + blk_queue_exit(q); + return; } +done: trace_block_getrq(bio); rq_qos_track(q, rq, bio); diff -u linux-aws-6.5-6.5.0/block/blk-throttle.c linux-aws-6.5-6.5.0/block/blk-throttle.c --- linux-aws-6.5-6.5.0/block/blk-throttle.c +++ linux-aws-6.5-6.5.0/block/blk-throttle.c @@ -723,6 +723,12 @@ static u64 calculate_bytes_allowed(u64 bps_limit, unsigned long jiffy_elapsed) { + /* + * Can result be wider than 64 bits? + * We check against 62, not 64, due to ilog2 truncation. + */ + if (ilog2(bps_limit) + ilog2(jiffy_elapsed) - ilog2(HZ) > 62) + return U64_MAX; return mul_u64_u64_div_u64(bps_limit, (u64)jiffy_elapsed, (u64)HZ); } diff -u linux-aws-6.5-6.5.0/crypto/asymmetric_keys/x509_public_key.c linux-aws-6.5-6.5.0/crypto/asymmetric_keys/x509_public_key.c --- linux-aws-6.5-6.5.0/crypto/asymmetric_keys/x509_public_key.c +++ linux-aws-6.5-6.5.0/crypto/asymmetric_keys/x509_public_key.c @@ -262,15 +262,9 @@ /* * Module stuff */ -extern int __init certs_selftest(void); static int __init x509_key_init(void) { - int ret; - - ret = register_asymmetric_key_parser(&x509_key_parser); - if (ret < 0) - return ret; - return fips_signature_selftest(); + return register_asymmetric_key_parser(&x509_key_parser); } static void __exit x509_key_exit(void) diff -u linux-aws-6.5-6.5.0/debian.aws-6.5/abi/abiname linux-aws-6.5-6.5.0/debian.aws-6.5/abi/abiname --- linux-aws-6.5-6.5.0/debian.aws-6.5/abi/abiname +++ linux-aws-6.5-6.5.0/debian.aws-6.5/abi/abiname @@ -1 +1 @@ -1013 +1014 diff -u linux-aws-6.5-6.5.0/debian.aws-6.5/abi/amd64/aws linux-aws-6.5-6.5.0/debian.aws-6.5/abi/amd64/aws --- linux-aws-6.5-6.5.0/debian.aws-6.5/abi/amd64/aws +++ linux-aws-6.5-6.5.0/debian.aws-6.5/abi/amd64/aws @@ -5972,6 +5972,7 @@ EXPORT_SYMBOL vmlinux 0x0938c131 __invalidate_device EXPORT_SYMBOL vmlinux 0x094ab2bb jbd2_journal_set_features EXPORT_SYMBOL vmlinux 0x094ac47a ip_route_input_noref +EXPORT_SYMBOL vmlinux 0x094e9788 wake_up_process EXPORT_SYMBOL vmlinux 0x0966e107 __x86_indirect_call_thunk_r9 EXPORT_SYMBOL vmlinux 0x096cd61c config_item_get EXPORT_SYMBOL vmlinux 0x09769037 dmt_modes @@ -6249,6 +6250,7 @@ EXPORT_SYMBOL vmlinux 0x15f6b9bf __inode_add_bytes EXPORT_SYMBOL vmlinux 0x15f90688 slhc_init EXPORT_SYMBOL vmlinux 0x15f9efcb flow_rule_match_enc_ipv4_addrs +EXPORT_SYMBOL vmlinux 0x160c1764 can_nice EXPORT_SYMBOL vmlinux 0x1618c678 netif_set_real_num_queues EXPORT_SYMBOL vmlinux 0x161fb4b8 __skb_vlan_pop EXPORT_SYMBOL vmlinux 0x1625040f seg6_push_hmac @@ -7156,6 +7158,7 @@ EXPORT_SYMBOL vmlinux 0x3f2360fc devm_ioremap EXPORT_SYMBOL vmlinux 0x3f2b6fab copy_splice_read EXPORT_SYMBOL vmlinux 0x3f2c0cf7 pci_save_state +EXPORT_SYMBOL vmlinux 0x3f308f39 set_user_nice EXPORT_SYMBOL vmlinux 0x3f34644d zstd_dstream_workspace_bound EXPORT_SYMBOL vmlinux 0x3f4547a7 put_unused_fd EXPORT_SYMBOL vmlinux 0x3f4bd846 gen_pool_first_fit_order_align @@ -7350,7 +7353,6 @@ EXPORT_SYMBOL vmlinux 0x47c0c7e2 mr_mfc_find_any EXPORT_SYMBOL vmlinux 0x47c20f8a refcount_dec_not_one EXPORT_SYMBOL vmlinux 0x47c65bfc unregister_inet6addr_validator_notifier -EXPORT_SYMBOL vmlinux 0x47c811d1 io_uring_get_socket EXPORT_SYMBOL vmlinux 0x47cda76a bdi_register EXPORT_SYMBOL vmlinux 0x47cfd825 kstrtouint_from_user EXPORT_SYMBOL vmlinux 0x47d8d301 __cond_resched_rwlock_read @@ -10095,7 +10097,6 @@ EXPORT_SYMBOL vmlinux 0xc02ee3da mipi_dsi_dcs_set_display_on EXPORT_SYMBOL vmlinux 0xc0364007 fault_in_writeable EXPORT_SYMBOL vmlinux 0xc048415c __SCK__tp_func_kfree -EXPORT_SYMBOL vmlinux 0xc05c4cf5 set_user_nice EXPORT_SYMBOL vmlinux 0xc060c3f4 page_pool_ethtool_stats_get EXPORT_SYMBOL vmlinux 0xc07110d6 phy_drivers_unregister EXPORT_SYMBOL vmlinux 0xc0763484 rfkill_blocked @@ -10599,7 +10600,6 @@ EXPORT_SYMBOL vmlinux 0xd6b8649c generic_write_checks EXPORT_SYMBOL vmlinux 0xd6ba4821 __traceiter_kmem_cache_free EXPORT_SYMBOL vmlinux 0xd6cc42ef md_integrity_add_rdev -EXPORT_SYMBOL vmlinux 0xd6cc4fc8 can_nice EXPORT_SYMBOL vmlinux 0xd6cdd763 skb_copy_expand EXPORT_SYMBOL vmlinux 0xd6eaaea1 full_name_hash EXPORT_SYMBOL vmlinux 0xd6ee688f vmalloc @@ -10848,7 +10848,6 @@ EXPORT_SYMBOL vmlinux 0xe0b13336 argv_free EXPORT_SYMBOL vmlinux 0xe0b9065b security_xfrm_policy_alloc EXPORT_SYMBOL vmlinux 0xe0bad060 genphy_c37_read_status -EXPORT_SYMBOL vmlinux 0xe0bea2db wake_up_process EXPORT_SYMBOL vmlinux 0xe0cec8cc serio_close EXPORT_SYMBOL vmlinux 0xe0e04731 sys_fillrect EXPORT_SYMBOL vmlinux 0xe0ed8d34 devm_extcon_unregister_notifier @@ -11142,6 +11141,7 @@ EXPORT_SYMBOL vmlinux 0xeec5050b iov_iter_gap_alignment EXPORT_SYMBOL vmlinux 0xeec9b6a8 skb_copy_datagram_from_iter EXPORT_SYMBOL vmlinux 0xeec9b8ff vga_get +EXPORT_SYMBOL vmlinux 0xeecdcc23 io_uring_get_socket EXPORT_SYMBOL vmlinux 0xeedb9f0d tcp_ioctl EXPORT_SYMBOL vmlinux 0xeeedcf8e pm860x_page_reg_write EXPORT_SYMBOL vmlinux 0xef0ff220 mipi_dsi_dcs_set_column_address @@ -18666,6 +18666,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x00f1a9da __tracepoint_napi_poll EXPORT_SYMBOL_GPL vmlinux 0x010b633b pci_epf_free_space EXPORT_SYMBOL_GPL vmlinux 0x011a0396 clk_hw_determine_rate_no_reparent +EXPORT_SYMBOL_GPL vmlinux 0x011cb88b __traceiter_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0x012e730e apei_exec_noop EXPORT_SYMBOL_GPL vmlinux 0x0131443f __auxiliary_driver_register EXPORT_SYMBOL_GPL vmlinux 0x01374fb2 cpufreq_disable_fast_switch @@ -18779,6 +18780,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x052b4013 register_vmcore_cb EXPORT_SYMBOL_GPL vmlinux 0x052c9aed ktime_get_real_fast_ns EXPORT_SYMBOL_GPL vmlinux 0x05300676 pci_free_p2pmem +EXPORT_SYMBOL_GPL vmlinux 0x053ab9a3 __tracepoint_ipi_send_cpu EXPORT_SYMBOL_GPL vmlinux 0x05497390 fwnode_get_named_child_node EXPORT_SYMBOL_GPL vmlinux 0x054e550b kernel_halt EXPORT_SYMBOL_GPL vmlinux 0x05545edf kstrdup_quotable_cmdline @@ -18800,6 +18802,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x0610a1a8 peernet2id_alloc EXPORT_SYMBOL_GPL vmlinux 0x061336ae blocking_notifier_chain_register_unique_prio EXPORT_SYMBOL_GPL vmlinux 0x06209f49 phy_lookup_setting +EXPORT_SYMBOL_GPL vmlinux 0x06221362 __SCK__tp_func_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0x0626da5f od_unregister_powersave_bias_handler EXPORT_SYMBOL_GPL vmlinux 0x062b89c4 ghes_unregister_report_chain EXPORT_SYMBOL_GPL vmlinux 0x063ef5a1 acpi_register_gsi @@ -18819,7 +18822,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x06cca30b ring_buffer_record_off EXPORT_SYMBOL_GPL vmlinux 0x06e36313 clk_hw_get_parent_by_index EXPORT_SYMBOL_GPL vmlinux 0x06ea80a0 disk_set_independent_access_ranges -EXPORT_SYMBOL_GPL vmlinux 0x06eebfff __traceiter_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x06f7f11d ata_sff_check_status EXPORT_SYMBOL_GPL vmlinux 0x06f86ad5 irq_domain_disconnect_hierarchy EXPORT_SYMBOL_GPL vmlinux 0x0702f1dc devm_gpiod_get_array_optional @@ -18872,7 +18874,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x08bf9c7d vcap_tc_flower_handler_ipv4_usage EXPORT_SYMBOL_GPL vmlinux 0x08c78cf7 offline_and_remove_memory EXPORT_SYMBOL_GPL vmlinux 0x08cef620 crypto_shash_setkey -EXPORT_SYMBOL_GPL vmlinux 0x08d18a14 __tracepoint_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x08d1d949 regulator_enable_regmap EXPORT_SYMBOL_GPL vmlinux 0x08db1da5 devm_request_pci_bus_resources EXPORT_SYMBOL_GPL vmlinux 0x08e2a8af securityfs_remove @@ -18915,7 +18916,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x0a8162a8 raw_v4_hashinfo EXPORT_SYMBOL_GPL vmlinux 0x0a8894f4 mas_find_range_rev EXPORT_SYMBOL_GPL vmlinux 0x0a894fdb mctrl_gpio_init -EXPORT_SYMBOL_GPL vmlinux 0x0a8acc4a __tracepoint_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x0a8e458b crypto_req_done EXPORT_SYMBOL_GPL vmlinux 0x0a942799 crypto_akcipher_sync_decrypt EXPORT_SYMBOL_GPL vmlinux 0x0a94911b dev_pm_genpd_resume @@ -19121,7 +19121,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x126b17d9 dw_pcie_find_capability EXPORT_SYMBOL_GPL vmlinux 0x126c80fb blk_set_pm_only EXPORT_SYMBOL_GPL vmlinux 0x127694cd regmap_mmio_detach_clk -EXPORT_SYMBOL_GPL vmlinux 0x12777c19 io_uring_cmd_do_in_task_lazy EXPORT_SYMBOL_GPL vmlinux 0x127c109b __SCT__tp_func_suspend_resume EXPORT_SYMBOL_GPL vmlinux 0x128a7397 clkdev_hw_create EXPORT_SYMBOL_GPL vmlinux 0x128ce550 pcie_aspm_enabled @@ -19192,7 +19191,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x150b906c regmap_bulk_write EXPORT_SYMBOL_GPL vmlinux 0x151bfca7 tpm_chip_register EXPORT_SYMBOL_GPL vmlinux 0x151ce81f __SCK__tp_func_sk_data_ready -EXPORT_SYMBOL_GPL vmlinux 0x1522d251 __tracepoint_ipi_send_cpumask EXPORT_SYMBOL_GPL vmlinux 0x152ed1b0 platform_get_resource_byname EXPORT_SYMBOL_GPL vmlinux 0x153761cf usb_wakeup_notification EXPORT_SYMBOL_GPL vmlinux 0x1537a0ee led_trigger_unregister @@ -19200,7 +19198,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x15510a89 devlink_fmsg_binary_put EXPORT_SYMBOL_GPL vmlinux 0x15654ce9 pm_clk_runtime_suspend EXPORT_SYMBOL_GPL vmlinux 0x156e8afe __SCT__tp_func_fib6_table_lookup -EXPORT_SYMBOL_GPL vmlinux 0x15746a3a set_cpus_allowed_ptr EXPORT_SYMBOL_GPL vmlinux 0x15886f48 hte_disable_ts EXPORT_SYMBOL_GPL vmlinux 0x1593945b spi_setup EXPORT_SYMBOL_GPL vmlinux 0x159e3a1c debugfs_create_u64 @@ -19209,6 +19206,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x15b9e4c5 vp_legacy_get_queue_size EXPORT_SYMBOL_GPL vmlinux 0x15bd7435 psi_memstall_leave EXPORT_SYMBOL_GPL vmlinux 0x15d05085 usb_set_interface +EXPORT_SYMBOL_GPL vmlinux 0x15e14330 __SCK__tp_func_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0x15e6f667 device_reprobe EXPORT_SYMBOL_GPL vmlinux 0x15ea2648 hwpoison_filter_flags_mask EXPORT_SYMBOL_GPL vmlinux 0x15ed4bae vcap_find_admin @@ -19405,7 +19403,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x1d7a81e7 skb_scrub_packet EXPORT_SYMBOL_GPL vmlinux 0x1d8e6759 devl_dpipe_table_register EXPORT_SYMBOL_GPL vmlinux 0x1d91d3ce of_hwspin_lock_get_id -EXPORT_SYMBOL_GPL vmlinux 0x1d92c484 __tracepoint_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x1d94a218 dmi_memdev_handle EXPORT_SYMBOL_GPL vmlinux 0x1d97e0bf fuse_file_poll EXPORT_SYMBOL_GPL vmlinux 0x1db2e852 l3mdev_link_scope_lookup @@ -19430,6 +19427,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x1e4bb8ae kill_pid_usb_asyncio EXPORT_SYMBOL_GPL vmlinux 0x1e52b3c1 generic_online_page EXPORT_SYMBOL_GPL vmlinux 0x1e53f827 stack_depot_print +EXPORT_SYMBOL_GPL vmlinux 0x1e560460 sched_setattr_nocheck EXPORT_SYMBOL_GPL vmlinux 0x1e5a5f22 sn_partition_id EXPORT_SYMBOL_GPL vmlinux 0x1e66827b i2c_add_numbered_adapter EXPORT_SYMBOL_GPL vmlinux 0x1e70176b add_disk_randomness @@ -19442,7 +19440,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x1e9c590a usb_find_common_endpoints_reverse EXPORT_SYMBOL_GPL vmlinux 0x1eb9516e round_jiffies_relative EXPORT_SYMBOL_GPL vmlinux 0x1ebf6c2a pci_power_names -EXPORT_SYMBOL_GPL vmlinux 0x1ec4b8ef __tracepoint_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0x1ed4d2eb percpu_ref_kill_and_confirm EXPORT_SYMBOL_GPL vmlinux 0x1ed87360 xen_pci_frontend EXPORT_SYMBOL_GPL vmlinux 0x1ee47e00 is_vmalloc_or_module_addr @@ -19609,7 +19606,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x2528273c metadata_dst_free_percpu EXPORT_SYMBOL_GPL vmlinux 0x25301bc6 arch_wb_cache_pmem EXPORT_SYMBOL_GPL vmlinux 0x25379e73 clk_set_min_rate -EXPORT_SYMBOL_GPL vmlinux 0x253ce1ba io_uring_cmd_done EXPORT_SYMBOL_GPL vmlinux 0x25531469 gpiod_get_index EXPORT_SYMBOL_GPL vmlinux 0x2565dac9 sysfs_unmerge_group EXPORT_SYMBOL_GPL vmlinux 0x257393ea ata_sff_exec_command @@ -19621,7 +19617,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x25ae84d7 __kthread_init_worker EXPORT_SYMBOL_GPL vmlinux 0x25b1f0b1 power_supply_get_property_from_supplier EXPORT_SYMBOL_GPL vmlinux 0x25bbfa9a security_kernel_load_data -EXPORT_SYMBOL_GPL vmlinux 0x25c0c80d __SCK__tp_func_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0x25db7e68 lp8788_write_byte EXPORT_SYMBOL_GPL vmlinux 0x25e37f82 spi_mem_poll_status EXPORT_SYMBOL_GPL vmlinux 0x25eecc4d pci_bus_add_device @@ -19733,9 +19728,11 @@ EXPORT_SYMBOL_GPL vmlinux 0x29eba37f current_is_async EXPORT_SYMBOL_GPL vmlinux 0x29f3b02a devm_hwrng_register EXPORT_SYMBOL_GPL vmlinux 0x29f6a847 platform_device_unregister +EXPORT_SYMBOL_GPL vmlinux 0x29ffcead __tracepoint_ipi_send_cpumask EXPORT_SYMBOL_GPL vmlinux 0x2a07333a nvdimm_bus_unregister EXPORT_SYMBOL_GPL vmlinux 0x2a0783dd gpiod_disable_hw_timestamp_ns EXPORT_SYMBOL_GPL vmlinux 0x2a0ef55b nvdimm_delete +EXPORT_SYMBOL_GPL vmlinux 0x2a1c7fee __tracepoint_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0x2a2e1b99 kernfs_notify EXPORT_SYMBOL_GPL vmlinux 0x2a2f04fa ip_tunnel_netlink_parms EXPORT_SYMBOL_GPL vmlinux 0x2a316472 usb_create_shared_hcd @@ -19836,7 +19833,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x2e2df7f4 irq_remapping_cap EXPORT_SYMBOL_GPL vmlinux 0x2e2fc64a crypto_register_aeads EXPORT_SYMBOL_GPL vmlinux 0x2e387fa9 phy_modify_changed -EXPORT_SYMBOL_GPL vmlinux 0x2e3c0689 __SCK__tp_func_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0x2e5d44e8 fib6_check_nexthop EXPORT_SYMBOL_GPL vmlinux 0x2e65b188 unregister_kretprobe EXPORT_SYMBOL_GPL vmlinux 0x2e6b93e8 crypto_unregister_shash @@ -19894,7 +19890,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x3046f6c2 pci_alloc_p2pmem EXPORT_SYMBOL_GPL vmlinux 0x3049ca5e gpiochip_add_pin_range EXPORT_SYMBOL_GPL vmlinux 0x304c86b5 acpi_dev_pm_attach -EXPORT_SYMBOL_GPL vmlinux 0x304df02f sched_set_normal EXPORT_SYMBOL_GPL vmlinux 0x305363ab acpi_dev_remove_driver_gpios EXPORT_SYMBOL_GPL vmlinux 0x3061cfce ring_buffer_entries_cpu EXPORT_SYMBOL_GPL vmlinux 0x306d1b10 mnt_want_write_file @@ -19924,7 +19919,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x3156bfc3 tty_buffer_unlock_exclusive EXPORT_SYMBOL_GPL vmlinux 0x3165daa3 arbitrary_virt_to_machine EXPORT_SYMBOL_GPL vmlinux 0x31706316 __SCT__tp_func_error_report_end -EXPORT_SYMBOL_GPL vmlinux 0x3176ef4c __traceiter_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0x31773ea3 __tracepoint_rpm_resume EXPORT_SYMBOL_GPL vmlinux 0x31776110 device_get_child_node_count EXPORT_SYMBOL_GPL vmlinux 0x31824c8b pci_find_ext_capability @@ -20047,6 +20041,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x355bc89a klist_next EXPORT_SYMBOL_GPL vmlinux 0x35622fea devm_regulator_unregister_notifier EXPORT_SYMBOL_GPL vmlinux 0x3565a929 utf8_data_table +EXPORT_SYMBOL_GPL vmlinux 0x3566128b __traceiter_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x35666fc5 led_blink_set_nosleep EXPORT_SYMBOL_GPL vmlinux 0x356d09a1 unregister_kprobes EXPORT_SYMBOL_GPL vmlinux 0x358ff60f twl_get_hfclk_rate @@ -20060,7 +20055,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x35e9e8b3 md_rdev_clear EXPORT_SYMBOL_GPL vmlinux 0x35f94061 pm_runtime_barrier EXPORT_SYMBOL_GPL vmlinux 0x35fd6327 led_classdev_unregister -EXPORT_SYMBOL_GPL vmlinux 0x3603985f __SCK__tp_func_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0x3610b18b __blkg_prfill_rwstat EXPORT_SYMBOL_GPL vmlinux 0x36173c1d phys_to_target_node EXPORT_SYMBOL_GPL vmlinux 0x3618322f regmap_register_patch @@ -20192,7 +20186,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x3abb891d dev_pm_opp_get_opp_table EXPORT_SYMBOL_GPL vmlinux 0x3abdc17a cper_dimm_err_location EXPORT_SYMBOL_GPL vmlinux 0x3ac11c9a pm_generic_poweroff_late -EXPORT_SYMBOL_GPL vmlinux 0x3ac1c79a __traceiter_pelt_rt_tp +EXPORT_SYMBOL_GPL vmlinux 0x3ac2e9ad io_uring_cmd_import_fixed EXPORT_SYMBOL_GPL vmlinux 0x3ac3feba rhltable_init EXPORT_SYMBOL_GPL vmlinux 0x3acdf325 twl4030_audio_enable_resource EXPORT_SYMBOL_GPL vmlinux 0x3ae42cc8 __unwind_start @@ -20262,7 +20256,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x3d388324 dpm_resume_end EXPORT_SYMBOL_GPL vmlinux 0x3d472b3c devl_rate_nodes_destroy EXPORT_SYMBOL_GPL vmlinux 0x3d510a7b rcu_jiffies_till_stall_check -EXPORT_SYMBOL_GPL vmlinux 0x3d74716a __SCK__tp_func_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x3d7669c0 devl_port_register_with_ops EXPORT_SYMBOL_GPL vmlinux 0x3d7691f5 power_supply_get_drvdata EXPORT_SYMBOL_GPL vmlinux 0x3d7cb9f7 iommu_sva_get_pasid @@ -20304,7 +20297,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x3ebc6826 phy_save_page EXPORT_SYMBOL_GPL vmlinux 0x3ec93255 hv_get_isolation_type EXPORT_SYMBOL_GPL vmlinux 0x3edb086b pse_control_put -EXPORT_SYMBOL_GPL vmlinux 0x3eec3ed7 __SCK__tp_func_ipi_send_cpumask EXPORT_SYMBOL_GPL vmlinux 0x3ef051c8 crypto_inc EXPORT_SYMBOL_GPL vmlinux 0x3efbf971 devm_regmap_field_free EXPORT_SYMBOL_GPL vmlinux 0x3f23cfb8 sysfs_file_change_owner @@ -20334,6 +20326,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x3ff2e349 hte_request_ts_ns EXPORT_SYMBOL_GPL vmlinux 0x3ff5b2f4 pci_reset_function EXPORT_SYMBOL_GPL vmlinux 0x3ffdacf3 timerqueue_iterate_next +EXPORT_SYMBOL_GPL vmlinux 0x4005be76 kick_process EXPORT_SYMBOL_GPL vmlinux 0x400a024b acpi_scan_lock_release EXPORT_SYMBOL_GPL vmlinux 0x40131b3f inet_csk_listen_stop EXPORT_SYMBOL_GPL vmlinux 0x40258c3b tty_standard_install @@ -20343,7 +20336,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x403f9529 gpio_request_one EXPORT_SYMBOL_GPL vmlinux 0x4043757f init_iova_domain EXPORT_SYMBOL_GPL vmlinux 0x404ba2b8 fib_nl_delrule -EXPORT_SYMBOL_GPL vmlinux 0x40540326 sched_show_task EXPORT_SYMBOL_GPL vmlinux 0x4061e0c6 request_firmware_direct EXPORT_SYMBOL_GPL vmlinux 0x4065d168 pm_print_active_wakeup_sources EXPORT_SYMBOL_GPL vmlinux 0x406c4cb1 hrtimer_resolution @@ -20397,9 +20389,9 @@ EXPORT_SYMBOL_GPL vmlinux 0x42041512 i2c_get_dma_safe_msg_buf EXPORT_SYMBOL_GPL vmlinux 0x42069923 ata_sff_prereset EXPORT_SYMBOL_GPL vmlinux 0x420f3d01 nvmem_unregister_notifier -EXPORT_SYMBOL_GPL vmlinux 0x42128ec3 sched_setattr_nocheck EXPORT_SYMBOL_GPL vmlinux 0x42133288 gpiochip_irqchip_add_domain EXPORT_SYMBOL_GPL vmlinux 0x4213399a devm_hte_register_chip +EXPORT_SYMBOL_GPL vmlinux 0x4220eb43 __SCK__tp_func_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x422ccae2 vchan_find_desc EXPORT_SYMBOL_GPL vmlinux 0x422e578a __SCT__tp_func_add_device_to_group EXPORT_SYMBOL_GPL vmlinux 0x42615314 root_device_unregister @@ -20466,6 +20458,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x44a50ca5 acpi_get_first_physical_node EXPORT_SYMBOL_GPL vmlinux 0x44bae227 bit_wait_timeout EXPORT_SYMBOL_GPL vmlinux 0x44c10a52 kvfree_call_rcu +EXPORT_SYMBOL_GPL vmlinux 0x44cf092c preempt_notifier_register EXPORT_SYMBOL_GPL vmlinux 0x44cf8cf0 blk_zone_cond_str EXPORT_SYMBOL_GPL vmlinux 0x44d7c0f4 da903x_unregister_notifier EXPORT_SYMBOL_GPL vmlinux 0x44e1e9aa balloon_stats @@ -20497,7 +20490,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x45b33e15 devm_regmap_field_alloc EXPORT_SYMBOL_GPL vmlinux 0x45b51296 ata_change_queue_depth EXPORT_SYMBOL_GPL vmlinux 0x45b56a31 clk_hw_rate_is_protected -EXPORT_SYMBOL_GPL vmlinux 0x45c431db __SCK__tp_func_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x45d14bdf hypercall_page EXPORT_SYMBOL_GPL vmlinux 0x45d733cd blkcg_policy_register EXPORT_SYMBOL_GPL vmlinux 0x45da2095 vp_modern_get_num_queues @@ -20832,9 +20824,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x5261a263 __SCK__tp_func_nvme_sq EXPORT_SYMBOL_GPL vmlinux 0x526322cb umd_load_blob EXPORT_SYMBOL_GPL vmlinux 0x52647db1 ct_idle_exit -EXPORT_SYMBOL_GPL vmlinux 0x526a8767 __traceiter_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x527105ef da9052_free_irq -EXPORT_SYMBOL_GPL vmlinux 0x52742e30 __tracepoint_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0x528a58e7 exportfs_encode_fh EXPORT_SYMBOL_GPL vmlinux 0x529001a9 vp_legacy_remove EXPORT_SYMBOL_GPL vmlinux 0x52913d9d sdev_evt_send_simple @@ -20844,10 +20834,10 @@ EXPORT_SYMBOL_GPL vmlinux 0x52c62de2 irq_create_fwspec_mapping EXPORT_SYMBOL_GPL vmlinux 0x52cbf381 devl_param_driverinit_value_set EXPORT_SYMBOL_GPL vmlinux 0x52d54fce devlink_info_version_stored_put -EXPORT_SYMBOL_GPL vmlinux 0x52dc3915 __SCK__tp_func_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x52eddb69 raw_v6_hashinfo EXPORT_SYMBOL_GPL vmlinux 0x52f829fb acpi_unbind_one EXPORT_SYMBOL_GPL vmlinux 0x52fd035f shash_no_setkey +EXPORT_SYMBOL_GPL vmlinux 0x5305cc5c __SCK__tp_func_ipi_send_cpu EXPORT_SYMBOL_GPL vmlinux 0x530b1b8d usb_anchor_urb EXPORT_SYMBOL_GPL vmlinux 0x530e0f8c devl_health_reporter_destroy EXPORT_SYMBOL_GPL vmlinux 0x5314d1ae crypto_find_alg @@ -20896,6 +20886,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x5513b4fd adp5520_read EXPORT_SYMBOL_GPL vmlinux 0x5532ca68 xfrm_dev_offload_ok EXPORT_SYMBOL_GPL vmlinux 0x55339365 flush_delayed_fput +EXPORT_SYMBOL_GPL vmlinux 0x5538e38d __SCK__tp_func_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x553b49a4 cpufreq_get_driver_data EXPORT_SYMBOL_GPL vmlinux 0x553c023f mddev_resume EXPORT_SYMBOL_GPL vmlinux 0x55417264 unregister_vt_notifier @@ -20952,6 +20943,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x576cd9bc __traceiter_add_device_to_group EXPORT_SYMBOL_GPL vmlinux 0x576e9ed9 usb_match_id EXPORT_SYMBOL_GPL vmlinux 0x57719632 gnttab_grant_foreign_access +EXPORT_SYMBOL_GPL vmlinux 0x5780f204 __traceiter_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x5784da03 debugfs_print_regs32 EXPORT_SYMBOL_GPL vmlinux 0x57861a5c gds_ucode_mitigated EXPORT_SYMBOL_GPL vmlinux 0x578eeb4d hugetlb_cgrp_subsys_enabled_key @@ -20985,6 +20977,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x58b3376b regulator_get_bypass_regmap EXPORT_SYMBOL_GPL vmlinux 0x58b69e32 devm_register_restart_handler EXPORT_SYMBOL_GPL vmlinux 0x58bb8223 smp_ops +EXPORT_SYMBOL_GPL vmlinux 0x58bbd339 __traceiter_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x58cb0cd9 fscrypt_ioctl_remove_key EXPORT_SYMBOL_GPL vmlinux 0x58d2201f platform_add_devices EXPORT_SYMBOL_GPL vmlinux 0x58d39285 nvme_start_freeze @@ -21281,7 +21274,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x643d2246 regmap_attach_dev EXPORT_SYMBOL_GPL vmlinux 0x6456d570 clk_register_gate EXPORT_SYMBOL_GPL vmlinux 0x645fb8da pci_epc_write_header -EXPORT_SYMBOL_GPL vmlinux 0x6472ac55 __SCK__tp_func_pelt_thermal_tp +EXPORT_SYMBOL_GPL vmlinux 0x6482d53c __tracepoint_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0x648dfc82 list_lru_add EXPORT_SYMBOL_GPL vmlinux 0x648f579f devm_kmalloc EXPORT_SYMBOL_GPL vmlinux 0x648f59a9 sfp_module_insert @@ -21368,6 +21361,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x6739a503 balloon_set_new_target EXPORT_SYMBOL_GPL vmlinux 0x67410255 devlink_linecard_nested_dl_set EXPORT_SYMBOL_GPL vmlinux 0x6741e901 blk_queue_flag_test_and_set +EXPORT_SYMBOL_GPL vmlinux 0x67461ecf set_cpus_allowed_ptr EXPORT_SYMBOL_GPL vmlinux 0x674c5bc1 nvme_auth_hmac_name EXPORT_SYMBOL_GPL vmlinux 0x6756e582 regulator_enable EXPORT_SYMBOL_GPL vmlinux 0x6759bd00 __SCT__tp_func_rpm_idle @@ -21475,12 +21469,12 @@ EXPORT_SYMBOL_GPL vmlinux 0x6b0eaa18 hv_ghcb_msr_read EXPORT_SYMBOL_GPL vmlinux 0x6b11b9d5 rt_mutex_lock_killable EXPORT_SYMBOL_GPL vmlinux 0x6b1942ad __tracepoint_ata_bmdma_status +EXPORT_SYMBOL_GPL vmlinux 0x6b2346ad __tracepoint_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x6b2b69f7 static_key_enable EXPORT_SYMBOL_GPL vmlinux 0x6b35a16b intel_scu_ipc_dev_get EXPORT_SYMBOL_GPL vmlinux 0x6b38ed35 rio_local_set_device_id EXPORT_SYMBOL_GPL vmlinux 0x6b3ae022 acpi_os_unmap_iomem EXPORT_SYMBOL_GPL vmlinux 0x6b413c9b sfp_link_down -EXPORT_SYMBOL_GPL vmlinux 0x6b6870c6 __io_uring_cmd_do_in_task EXPORT_SYMBOL_GPL vmlinux 0x6b7a4335 hyperv_cleanup EXPORT_SYMBOL_GPL vmlinux 0x6b81c38b power_supply_unreg_notifier EXPORT_SYMBOL_GPL vmlinux 0x6b82c4a3 irq_gc_mask_set_bit @@ -21517,10 +21511,10 @@ EXPORT_SYMBOL_GPL vmlinux 0x6ccfd679 devm_power_supply_register EXPORT_SYMBOL_GPL vmlinux 0x6cd0c1e5 pm_runtime_set_autosuspend_delay EXPORT_SYMBOL_GPL vmlinux 0x6ce90882 devm_kasprintf +EXPORT_SYMBOL_GPL vmlinux 0x6ceb334d __tracepoint_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x6cfab41a xen_hvm_evtchn_do_upcall EXPORT_SYMBOL_GPL vmlinux 0x6cff907c vcap_get_rule EXPORT_SYMBOL_GPL vmlinux 0x6d04891d inet_getpeer -EXPORT_SYMBOL_GPL vmlinux 0x6d0501c8 __tracepoint_ipi_send_cpu EXPORT_SYMBOL_GPL vmlinux 0x6d09843f copy_bpf_fprog_from_user EXPORT_SYMBOL_GPL vmlinux 0x6d0ae550 pinctrl_gpio_request EXPORT_SYMBOL_GPL vmlinux 0x6d14c00a io_cgrp_subsys @@ -21749,7 +21743,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x749af7ac irq_work_queue EXPORT_SYMBOL_GPL vmlinux 0x749c0d12 cgroup_attach_task_all EXPORT_SYMBOL_GPL vmlinux 0x74ac7cef __platform_create_bundle -EXPORT_SYMBOL_GPL vmlinux 0x74b5c839 preempt_notifier_unregister EXPORT_SYMBOL_GPL vmlinux 0x74b5ea68 lcm_not_zero EXPORT_SYMBOL_GPL vmlinux 0x74baf17a tracing_is_on EXPORT_SYMBOL_GPL vmlinux 0x74bf2e01 scsi_pr_type_to_block @@ -21802,6 +21795,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7696efae bpf_trace_run12 EXPORT_SYMBOL_GPL vmlinux 0x769cefb5 percpu_ref_switch_to_atomic EXPORT_SYMBOL_GPL vmlinux 0x76a31f44 __devm_regmap_init_i2c +EXPORT_SYMBOL_GPL vmlinux 0x76bb9d94 sched_show_task EXPORT_SYMBOL_GPL vmlinux 0x76bf0190 spi_split_transfers_maxsize EXPORT_SYMBOL_GPL vmlinux 0x76c1a6b6 xhci_dbg_trace EXPORT_SYMBOL_GPL vmlinux 0x76c9315f crypto_register_scomp @@ -21819,6 +21813,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x773082af pci_set_pcie_reset_state EXPORT_SYMBOL_GPL vmlinux 0x77388439 tty_port_register_device_attr EXPORT_SYMBOL_GPL vmlinux 0x77389754 srcu_batches_completed +EXPORT_SYMBOL_GPL vmlinux 0x7741856e __tracepoint_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0x77522cf6 sbitmap_get_shallow EXPORT_SYMBOL_GPL vmlinux 0x7757b51a clk_unregister EXPORT_SYMBOL_GPL vmlinux 0x775ae404 pci_stop_root_bus @@ -21867,9 +21862,9 @@ EXPORT_SYMBOL_GPL vmlinux 0x789c73d9 rcu_cpu_stall_suppress_at_boot EXPORT_SYMBOL_GPL vmlinux 0x78bab66b irq_force_affinity EXPORT_SYMBOL_GPL vmlinux 0x78be7901 dev_pm_opp_find_freq_exact -EXPORT_SYMBOL_GPL vmlinux 0x78d124a7 kick_process EXPORT_SYMBOL_GPL vmlinux 0x78ddb76b dmi_match EXPORT_SYMBOL_GPL vmlinux 0x790be0b9 usb_bus_idr +EXPORT_SYMBOL_GPL vmlinux 0x790f20f1 __traceiter_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0x79109571 regmap_check_range_table EXPORT_SYMBOL_GPL vmlinux 0x7915cee5 do_machine_check EXPORT_SYMBOL_GPL vmlinux 0x7916343c __SCT__tp_func_br_mdb_full @@ -21937,7 +21932,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x7b64cbcb sysfs_remove_mount_point EXPORT_SYMBOL_GPL vmlinux 0x7b6b30f1 devm_regulator_get_enable EXPORT_SYMBOL_GPL vmlinux 0x7b6f9536 acpi_register_wakeup_handler -EXPORT_SYMBOL_GPL vmlinux 0x7b833dc9 __SCK__tp_func_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0x7b8910f4 kfence_sample_interval EXPORT_SYMBOL_GPL vmlinux 0x7b90d1a9 bind_virq_to_irqhandler EXPORT_SYMBOL_GPL vmlinux 0x7b9793a2 get_cpu_idle_time_us @@ -21958,6 +21952,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7c2c434a __fscrypt_inode_uses_inline_crypto EXPORT_SYMBOL_GPL vmlinux 0x7c30635f pcie_reset_flr EXPORT_SYMBOL_GPL vmlinux 0x7c35a36f fuse_init_fs_context_submount +EXPORT_SYMBOL_GPL vmlinux 0x7c3b4e63 __tracepoint_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x7c3d8a4b icc_bulk_put EXPORT_SYMBOL_GPL vmlinux 0x7c60b8e6 nvme_alloc_admin_tag_set EXPORT_SYMBOL_GPL vmlinux 0x7c983a5d dmi_walk @@ -21981,7 +21976,9 @@ EXPORT_SYMBOL_GPL vmlinux 0x7d00c65b nd_synchronize EXPORT_SYMBOL_GPL vmlinux 0x7d0e1d95 hv_setup_crash_handler EXPORT_SYMBOL_GPL vmlinux 0x7d1bb1d4 tnum_strn +EXPORT_SYMBOL_GPL vmlinux 0x7d1d3688 __traceiter_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x7d1e92c4 clockevents_config_and_register +EXPORT_SYMBOL_GPL vmlinux 0x7d46f1f4 __tracepoint_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0x7d48a446 tracepoint_probe_unregister EXPORT_SYMBOL_GPL vmlinux 0x7d509d9a regulator_get_exclusive EXPORT_SYMBOL_GPL vmlinux 0x7d59dd46 pm_wq @@ -21995,6 +21992,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7db8c839 crypto_hash_alg_has_setkey EXPORT_SYMBOL_GPL vmlinux 0x7dc4ec23 rtnl_get_net_ns_capable EXPORT_SYMBOL_GPL vmlinux 0x7dce4c12 blk_update_request +EXPORT_SYMBOL_GPL vmlinux 0x7dcf5437 preempt_notifier_unregister EXPORT_SYMBOL_GPL vmlinux 0x7dd04ab8 proc_create_net_data_write EXPORT_SYMBOL_GPL vmlinux 0x7dd27153 dst_cache_set_ip6 EXPORT_SYMBOL_GPL vmlinux 0x7dd4414b of_pm_clk_add_clks @@ -22030,7 +22028,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x7e8d8619 usb_anchor_empty EXPORT_SYMBOL_GPL vmlinux 0x7ea75c24 __wake_up_locked_key_bookmark EXPORT_SYMBOL_GPL vmlinux 0x7ea79c44 rt288x_setup -EXPORT_SYMBOL_GPL vmlinux 0x7eb74b40 sched_set_fifo_low EXPORT_SYMBOL_GPL vmlinux 0x7eb808d0 add_cpu EXPORT_SYMBOL_GPL vmlinux 0x7ec298e3 xhci_find_slot_id_by_port EXPORT_SYMBOL_GPL vmlinux 0x7ec8c9f9 tty_buffer_request_room @@ -22040,6 +22037,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7ef6030e fscrypt_set_bio_crypt_ctx EXPORT_SYMBOL_GPL vmlinux 0x7f03ab34 unregister_virtio_driver EXPORT_SYMBOL_GPL vmlinux 0x7f14ef4a device_find_child_by_name +EXPORT_SYMBOL_GPL vmlinux 0x7f16bc1a __SCK__tp_func_ipi_send_cpumask EXPORT_SYMBOL_GPL vmlinux 0x7f1e56a3 irqd_cfg EXPORT_SYMBOL_GPL vmlinux 0x7f27ffd7 fib4_rule_default EXPORT_SYMBOL_GPL vmlinux 0x7f3d5828 pm_generic_suspend_late @@ -22067,6 +22065,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x800553e1 bus_unregister_notifier EXPORT_SYMBOL_GPL vmlinux 0x8006093a fsstack_copy_inode_size EXPORT_SYMBOL_GPL vmlinux 0x800f2e72 pci_epc_get_features +EXPORT_SYMBOL_GPL vmlinux 0x800f416a __traceiter_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0x80228c33 tcp_splice_eof EXPORT_SYMBOL_GPL vmlinux 0x8033d2d3 uart_set_options EXPORT_SYMBOL_GPL vmlinux 0x8046712e divider_round_rate_parent @@ -22151,6 +22150,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x832beb70 device_property_read_u16_array EXPORT_SYMBOL_GPL vmlinux 0x8335ca43 __SCT__tp_func_io_page_fault EXPORT_SYMBOL_GPL vmlinux 0x8339df73 klist_add_behind +EXPORT_SYMBOL_GPL vmlinux 0x833d2ea7 __SCK__tp_func_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0x8341f5ef kernel_read_file EXPORT_SYMBOL_GPL vmlinux 0x8343ca54 ehci_adjust_port_wakeup_flags EXPORT_SYMBOL_GPL vmlinux 0x8349a895 nvmem_device_put @@ -22210,6 +22210,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x85783065 nvme_remove_namespaces EXPORT_SYMBOL_GPL vmlinux 0x858e2628 dax_holder EXPORT_SYMBOL_GPL vmlinux 0x859708b2 unregister_net_sysctl_table +EXPORT_SYMBOL_GPL vmlinux 0x85a75ce2 sched_set_fifo EXPORT_SYMBOL_GPL vmlinux 0x85a8d0ae usb_hcd_unlink_urb_from_ep EXPORT_SYMBOL_GPL vmlinux 0x85b114a2 crypto_spawn_tfm EXPORT_SYMBOL_GPL vmlinux 0x85b15444 arch_set_max_freq_ratio @@ -22223,6 +22224,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x85eed1be iopf_queue_discard_partial EXPORT_SYMBOL_GPL vmlinux 0x85f0937d inet_csk_reqsk_queue_hash_add EXPORT_SYMBOL_GPL vmlinux 0x85f4e487 devm_gpiod_put_array +EXPORT_SYMBOL_GPL vmlinux 0x86156da4 __traceiter_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0x86161a2c hid_bpf_connect_device EXPORT_SYMBOL_GPL vmlinux 0x86169f3e amd_smn_write EXPORT_SYMBOL_GPL vmlinux 0x861a7a70 fscrypt_dummy_policies_equal @@ -22457,7 +22459,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x8e1f4638 devm_kmemdup EXPORT_SYMBOL_GPL vmlinux 0x8e2aec0c xen_remap_pfn EXPORT_SYMBOL_GPL vmlinux 0x8e3d911b arch_phys_wc_index -EXPORT_SYMBOL_GPL vmlinux 0x8e4036d1 preempt_notifier_register EXPORT_SYMBOL_GPL vmlinux 0x8e4eb451 bpf_sk_storage_diag_free EXPORT_SYMBOL_GPL vmlinux 0x8e54261e fuse_conn_init EXPORT_SYMBOL_GPL vmlinux 0x8e6b1a9e net_selftest_get_count @@ -22471,7 +22472,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x8ec1152c cpufreq_enable_fast_switch EXPORT_SYMBOL_GPL vmlinux 0x8eca3377 scsi_template_proc_dir EXPORT_SYMBOL_GPL vmlinux 0x8ed3e4c7 __tracepoint_xhci_dbg_quirks -EXPORT_SYMBOL_GPL vmlinux 0x8ee0a09f __tracepoint_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x8eee3399 dax_read_unlock EXPORT_SYMBOL_GPL vmlinux 0x8ef4473c debugfs_create_ulong EXPORT_SYMBOL_GPL vmlinux 0x8ef48ff4 device_set_wakeup_enable @@ -22588,7 +22588,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x929d5790 regcache_cache_bypass EXPORT_SYMBOL_GPL vmlinux 0x929e95cf psi_memstall_enter EXPORT_SYMBOL_GPL vmlinux 0x92b8c78b hyperv_pcpu_output_arg -EXPORT_SYMBOL_GPL vmlinux 0x92c35487 __traceiter_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0x92cf74aa vcap_admin_rule_count EXPORT_SYMBOL_GPL vmlinux 0x92d31cfb fixed_phy_add EXPORT_SYMBOL_GPL vmlinux 0x92db8f68 do_trace_rcu_torture_read @@ -22656,7 +22655,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x947bb01c pci_remove_root_bus EXPORT_SYMBOL_GPL vmlinux 0x949163d6 dev_pm_opp_set_config EXPORT_SYMBOL_GPL vmlinux 0x949b5176 devlink_region_snapshot_create -EXPORT_SYMBOL_GPL vmlinux 0x949e60bb __traceiter_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0x949f7342 __alloc_percpu EXPORT_SYMBOL_GPL vmlinux 0x949fe2c8 devm_fwnode_gpiod_get_index EXPORT_SYMBOL_GPL vmlinux 0x94bbe626 bpf_offload_dev_match @@ -22780,6 +22778,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x99414b56 kobject_rename EXPORT_SYMBOL_GPL vmlinux 0x99430ba2 acpi_get_phys_id EXPORT_SYMBOL_GPL vmlinux 0x994699ce iommu_device_claim_dma_owner +EXPORT_SYMBOL_GPL vmlinux 0x9947e60a sched_set_normal EXPORT_SYMBOL_GPL vmlinux 0x9953acdb pkcs7_verify EXPORT_SYMBOL_GPL vmlinux 0x995d1071 prof_on EXPORT_SYMBOL_GPL vmlinux 0x996754e0 fsnotify_put_group @@ -22810,12 +22809,12 @@ EXPORT_SYMBOL_GPL vmlinux 0x9a404f31 iommu_register_device_fault_handler EXPORT_SYMBOL_GPL vmlinux 0x9a4894fe devres_release_group EXPORT_SYMBOL_GPL vmlinux 0x9a4e982f crypto_register_scomps -EXPORT_SYMBOL_GPL vmlinux 0x9a53906b __traceiter_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x9a54de7c __mdiobus_modify_changed EXPORT_SYMBOL_GPL vmlinux 0x9a58dd2d trace_print_bitmask_seq EXPORT_SYMBOL_GPL vmlinux 0x9a5dce5c rhashtable_walk_start_check EXPORT_SYMBOL_GPL vmlinux 0x9a6be5a4 bus_remove_file EXPORT_SYMBOL_GPL vmlinux 0x9a7641ac __serdev_device_driver_register +EXPORT_SYMBOL_GPL vmlinux 0x9a8a01fe __SCK__tp_func_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0x9aa71c2a efi_query_variable_store EXPORT_SYMBOL_GPL vmlinux 0x9aaac699 dev_pm_opp_cpumask_remove_table EXPORT_SYMBOL_GPL vmlinux 0x9aabb2bc scsi_flush_work @@ -22877,7 +22876,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x9c9ecd5d thermal_acpi_hot_trip_temp EXPORT_SYMBOL_GPL vmlinux 0x9ca6e11f cper_mem_err_location EXPORT_SYMBOL_GPL vmlinux 0x9cc4f70a register_pm_notifier -EXPORT_SYMBOL_GPL vmlinux 0x9ccea9e1 __tracepoint_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0x9cd7551a rhashtable_walk_stop EXPORT_SYMBOL_GPL vmlinux 0x9cdd6a66 sysctl_long_vals EXPORT_SYMBOL_GPL vmlinux 0x9cde2fbe power_supply_set_property @@ -22904,7 +22902,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x9d4894c8 x2apic_mode EXPORT_SYMBOL_GPL vmlinux 0x9d521fd4 cookie_tcp_reqsk_alloc EXPORT_SYMBOL_GPL vmlinux 0x9d539284 vp_legacy_set_status -EXPORT_SYMBOL_GPL vmlinux 0x9d5eb9ce __SCK__tp_func_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x9d603d94 devm_phy_destroy EXPORT_SYMBOL_GPL vmlinux 0x9d7c1a85 __SCK__tp_func_neigh_cleanup_and_release EXPORT_SYMBOL_GPL vmlinux 0x9d7dac4b acpi_bind_one @@ -22961,7 +22958,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x9feee9d6 devm_regulator_register EXPORT_SYMBOL_GPL vmlinux 0x9ff0aa11 fwnode_get_nth_parent EXPORT_SYMBOL_GPL vmlinux 0xa01a8d9b nd_cmd_bus_desc -EXPORT_SYMBOL_GPL vmlinux 0xa0235d34 __traceiter_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0xa02991a6 power_supply_get_property EXPORT_SYMBOL_GPL vmlinux 0xa02c31ca kthread_queue_work EXPORT_SYMBOL_GPL vmlinux 0xa03d0567 hid_bpf_disconnect_device @@ -22969,7 +22965,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xa04e0bfd noop_direct_IO EXPORT_SYMBOL_GPL vmlinux 0xa04f945a cpus_read_lock EXPORT_SYMBOL_GPL vmlinux 0xa052dc4b set_capacity_and_notify -EXPORT_SYMBOL_GPL vmlinux 0xa061938a __SCK__tp_func_ipi_send_cpu EXPORT_SYMBOL_GPL vmlinux 0xa06b6795 kernel_file_open EXPORT_SYMBOL_GPL vmlinux 0xa07011fc static_dev_dax EXPORT_SYMBOL_GPL vmlinux 0xa0712324 nd_region_dev @@ -22984,7 +22979,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xa0d3456d nr_swap_pages EXPORT_SYMBOL_GPL vmlinux 0xa0d81b76 __SCT__tp_func_devlink_hwmsg EXPORT_SYMBOL_GPL vmlinux 0xa0daef9d regmap_reinit_cache -EXPORT_SYMBOL_GPL vmlinux 0xa0dff5c8 __SCK__tp_func_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0xa0e172ec __SCK__tp_func_br_fdb_add EXPORT_SYMBOL_GPL vmlinux 0xa0e1f5d8 pci_find_vsec_capability EXPORT_SYMBOL_GPL vmlinux 0xa0e671d8 __SCT__tp_func_sched_update_nr_running_tp @@ -23105,7 +23099,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xa46d4723 __SCK__tp_func_cpu_idle EXPORT_SYMBOL_GPL vmlinux 0xa47394ec dpm_for_each_dev EXPORT_SYMBOL_GPL vmlinux 0xa48196c8 kdb_poll_idx -EXPORT_SYMBOL_GPL vmlinux 0xa484526d sched_set_fifo EXPORT_SYMBOL_GPL vmlinux 0xa49836cc firmware_request_nowarn EXPORT_SYMBOL_GPL vmlinux 0xa4a4d65e gpiod_to_irq EXPORT_SYMBOL_GPL vmlinux 0xa4a7fef9 vp_legacy_probe @@ -23125,6 +23118,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xa51f7676 __traceiter_devlink_trap_report EXPORT_SYMBOL_GPL vmlinux 0xa531471e clk_save_context EXPORT_SYMBOL_GPL vmlinux 0xa54a2cba devlink_linecard_provision_clear +EXPORT_SYMBOL_GPL vmlinux 0xa54d5b64 io_uring_cmd_done EXPORT_SYMBOL_GPL vmlinux 0xa5635a44 sdio_claim_host EXPORT_SYMBOL_GPL vmlinux 0xa568743b __SCK__tp_func_rpm_idle EXPORT_SYMBOL_GPL vmlinux 0xa56e1a52 sg_free_table_chained @@ -23163,9 +23157,11 @@ EXPORT_SYMBOL_GPL vmlinux 0xa6a7925c mas_walk EXPORT_SYMBOL_GPL vmlinux 0xa6abafb6 event_triggers_post_call EXPORT_SYMBOL_GPL vmlinux 0xa6ac87b5 device_set_node +EXPORT_SYMBOL_GPL vmlinux 0xa6ada3db __SCK__tp_func_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0xa6b06f65 ata_sff_queue_work EXPORT_SYMBOL_GPL vmlinux 0xa6b21ef2 dpm_suspend_end EXPORT_SYMBOL_GPL vmlinux 0xa6b2c82d ehci_suspend +EXPORT_SYMBOL_GPL vmlinux 0xa6b69624 io_uring_cmd_sock EXPORT_SYMBOL_GPL vmlinux 0xa6b8ca6a hvc_poll EXPORT_SYMBOL_GPL vmlinux 0xa6c6d0a7 i2c_generic_scl_recovery EXPORT_SYMBOL_GPL vmlinux 0xa6c7083c platform_unregister_drivers @@ -23188,6 +23184,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xa7169985 pci_dev_run_wake EXPORT_SYMBOL_GPL vmlinux 0xa718650a nvdimm_name EXPORT_SYMBOL_GPL vmlinux 0xa7218eba irq_set_affinity +EXPORT_SYMBOL_GPL vmlinux 0xa722878d __SCK__tp_func_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0xa7241959 pkcs7_supply_detached_data EXPORT_SYMBOL_GPL vmlinux 0xa727a75c driver_set_override EXPORT_SYMBOL_GPL vmlinux 0xa7289483 ksm_madvise @@ -23256,7 +23253,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xa9543ec4 phy_select_page EXPORT_SYMBOL_GPL vmlinux 0xa95b5c77 hwmon_sanitize_name EXPORT_SYMBOL_GPL vmlinux 0xa9652572 pci_disable_ats -EXPORT_SYMBOL_GPL vmlinux 0xa96761b5 io_uring_cmd_sock EXPORT_SYMBOL_GPL vmlinux 0xa96e8b4e hv_setup_vmbus_handler EXPORT_SYMBOL_GPL vmlinux 0xa976a58f relay_late_setup_files EXPORT_SYMBOL_GPL vmlinux 0xa9850cf7 register_fprobe @@ -23312,6 +23308,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xabf03fc3 __SCT__tp_func_xhci_dbg_quirks EXPORT_SYMBOL_GPL vmlinux 0xabf9d39f sock_diag_check_cookie EXPORT_SYMBOL_GPL vmlinux 0xac05a5f2 dm_device_name +EXPORT_SYMBOL_GPL vmlinux 0xac211670 __traceiter_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0xac309c2a iommu_fwspec_free EXPORT_SYMBOL_GPL vmlinux 0xac36d1de pci_epf_destroy EXPORT_SYMBOL_GPL vmlinux 0xac4afef7 rio_map_inb_region @@ -23589,6 +23586,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xb6e6d99d clk_disable EXPORT_SYMBOL_GPL vmlinux 0xb6eabe37 register_kprobes EXPORT_SYMBOL_GPL vmlinux 0xb703761f __kthread_should_park +EXPORT_SYMBOL_GPL vmlinux 0xb7043076 __traceiter_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0xb7119e6e spi_split_transfers_maxwords EXPORT_SYMBOL_GPL vmlinux 0xb72a62bb pci_rescan_bus EXPORT_SYMBOL_GPL vmlinux 0xb7329c06 clk_set_phase @@ -23675,6 +23673,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xba83064b fsnotify_add_mark EXPORT_SYMBOL_GPL vmlinux 0xba85a176 lwtunnel_output EXPORT_SYMBOL_GPL vmlinux 0xba8a83cf gpiod_set_value +EXPORT_SYMBOL_GPL vmlinux 0xba8efb8d __tracepoint_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0xbaa1f31a of_phy_get EXPORT_SYMBOL_GPL vmlinux 0xbab9a9f0 maxim_charger_currents EXPORT_SYMBOL_GPL vmlinux 0xbad63e9a mddev_unlock @@ -23725,6 +23724,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xbc6bec66 free_percpu_irq EXPORT_SYMBOL_GPL vmlinux 0xbc7cd717 ack_all_badblocks EXPORT_SYMBOL_GPL vmlinux 0xbc92596d intel_pt_validate_cap +EXPORT_SYMBOL_GPL vmlinux 0xbc93b45d __traceiter_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0xbc95d82b srcu_notifier_chain_register EXPORT_SYMBOL_GPL vmlinux 0xbc9a6ffb xdp_do_redirect_frame EXPORT_SYMBOL_GPL vmlinux 0xbc9b8588 ehci_cf_port_reset_rwsem @@ -23810,7 +23810,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xbf1cb4fb perf_msr_probe EXPORT_SYMBOL_GPL vmlinux 0xbf2e2e71 housekeeping_enabled EXPORT_SYMBOL_GPL vmlinux 0xbf312992 __spi_register_driver -EXPORT_SYMBOL_GPL vmlinux 0xbf33c52a __tracepoint_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0xbf4513c3 devlink_linecard_activate EXPORT_SYMBOL_GPL vmlinux 0xbf4a6f91 regmap_async_complete EXPORT_SYMBOL_GPL vmlinux 0xbf556edc spi_finalize_current_transfer @@ -23833,6 +23832,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xc028a9ce blk_lld_busy EXPORT_SYMBOL_GPL vmlinux 0xc02d628c events_sysfs_show EXPORT_SYMBOL_GPL vmlinux 0xc03acf70 pci_enable_rom +EXPORT_SYMBOL_GPL vmlinux 0xc03c95cb __tracepoint_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0xc0605b58 crypto_alloc_rng EXPORT_SYMBOL_GPL vmlinux 0xc0610597 fat_get_dotdot_entry EXPORT_SYMBOL_GPL vmlinux 0xc0705d48 regulator_bulk_unregister_supply_alias @@ -23963,7 +23963,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xc47c0597 clk_hw_round_rate EXPORT_SYMBOL_GPL vmlinux 0xc4a31146 rdma_cgrp_subsys_on_dfl_key EXPORT_SYMBOL_GPL vmlinux 0xc4a72936 trusted_tpm_send -EXPORT_SYMBOL_GPL vmlinux 0xc4a843a7 __tracepoint_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0xc4a95663 isa_register_driver EXPORT_SYMBOL_GPL vmlinux 0xc4ab3333 xdp_attachment_setup EXPORT_SYMBOL_GPL vmlinux 0xc4ae4681 __fscrypt_prepare_readdir @@ -23977,7 +23976,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xc4e52bd2 sysfs_update_groups EXPORT_SYMBOL_GPL vmlinux 0xc4e83500 tty_port_install EXPORT_SYMBOL_GPL vmlinux 0xc4f0da12 ktime_get_with_offset -EXPORT_SYMBOL_GPL vmlinux 0xc4f397fd __traceiter_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0xc50dca33 __SCT__tp_func_neigh_cleanup_and_release EXPORT_SYMBOL_GPL vmlinux 0xc512626a __supported_pte_mask EXPORT_SYMBOL_GPL vmlinux 0xc51b4097 rtc_set_alarm @@ -24056,7 +24054,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xc7f069ae nf_queue_entry_get_refs EXPORT_SYMBOL_GPL vmlinux 0xc7fa4aa9 kobj_ns_drop EXPORT_SYMBOL_GPL vmlinux 0xc8126340 clear_mce_nospec -EXPORT_SYMBOL_GPL vmlinux 0xc817ec3c __tracepoint_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0xc81d9ca4 transport_class_register EXPORT_SYMBOL_GPL vmlinux 0xc82c721f klist_remove EXPORT_SYMBOL_GPL vmlinux 0xc832d98a usb_mon_register @@ -24386,7 +24383,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xd36a2dc3 ethnl_cable_test_free EXPORT_SYMBOL_GPL vmlinux 0xd3752c27 atomic_notifier_call_chain EXPORT_SYMBOL_GPL vmlinux 0xd37f8cde usb_put_phy -EXPORT_SYMBOL_GPL vmlinux 0xd3805470 __SCK__tp_func_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0xd384f695 ata_sff_data_xfer EXPORT_SYMBOL_GPL vmlinux 0xd3901d33 acpi_dev_resource_address_space EXPORT_SYMBOL_GPL vmlinux 0xd39ac140 acpi_find_child_device @@ -24411,8 +24407,10 @@ EXPORT_SYMBOL_GPL vmlinux 0xd44a5eac kgdb_register_nmi_console EXPORT_SYMBOL_GPL vmlinux 0xd45434ee admin_timeout EXPORT_SYMBOL_GPL vmlinux 0xd4601805 __traceiter_ata_tf_load +EXPORT_SYMBOL_GPL vmlinux 0xd4648ee8 __SCK__tp_func_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0xd46a7eb1 devm_clk_hw_register EXPORT_SYMBOL_GPL vmlinux 0xd46af5ef cppc_get_perf_ctrs +EXPORT_SYMBOL_GPL vmlinux 0xd46b6259 __SCK__tp_func_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0xd473d5c0 exportfs_decode_fh EXPORT_SYMBOL_GPL vmlinux 0xd480af04 sock_diag_unregister_inet_compat EXPORT_SYMBOL_GPL vmlinux 0xd4868849 receive_fd @@ -24497,7 +24495,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xd763134d perf_event_enable EXPORT_SYMBOL_GPL vmlinux 0xd7635ed2 __SCK__tp_func_xhci_dbg_quirks EXPORT_SYMBOL_GPL vmlinux 0xd768e985 regulator_has_full_constraints -EXPORT_SYMBOL_GPL vmlinux 0xd76b13f5 __tracepoint_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0xd76e23ae __inet_lookup_listener EXPORT_SYMBOL_GPL vmlinux 0xd7774c5c fsnotify_find_mark EXPORT_SYMBOL_GPL vmlinux 0xd7835e1b usb_enable_ltm @@ -24509,8 +24506,8 @@ EXPORT_SYMBOL_GPL vmlinux 0xd7aea26e kernel_read_file_from_path_initns EXPORT_SYMBOL_GPL vmlinux 0xd7b9aac4 vcap_tc_flower_handler_vlan_usage EXPORT_SYMBOL_GPL vmlinux 0xd7cea889 edac_mod_work -EXPORT_SYMBOL_GPL vmlinux 0xd7d8a172 io_uring_cmd_import_fixed EXPORT_SYMBOL_GPL vmlinux 0xd7e27bf9 dm_post_suspending +EXPORT_SYMBOL_GPL vmlinux 0xd7e31d50 yield_to EXPORT_SYMBOL_GPL vmlinux 0xd7f0aa59 __tracepoint_ata_tf_load EXPORT_SYMBOL_GPL vmlinux 0xd813d36a ipv6_recv_error EXPORT_SYMBOL_GPL vmlinux 0xd8142e63 ata_sff_tf_load @@ -24745,6 +24742,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xe04c78db __SCT__tp_func_neigh_event_send_done EXPORT_SYMBOL_GPL vmlinux 0xe059617b ethnl_cable_test_amplitude EXPORT_SYMBOL_GPL vmlinux 0xe05aabeb __skb_zcopy_downgrade_managed +EXPORT_SYMBOL_GPL vmlinux 0xe05aef78 __SCK__tp_func_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0xe05c34c5 pci_msix_can_alloc_dyn EXPORT_SYMBOL_GPL vmlinux 0xe05e2f85 nexthop_free_rcu EXPORT_SYMBOL_GPL vmlinux 0xe06cca0c xdp_build_skb_from_frame @@ -24771,6 +24769,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xe16251af usb_control_msg_recv EXPORT_SYMBOL_GPL vmlinux 0xe17fa37c ata_host_detach EXPORT_SYMBOL_GPL vmlinux 0xe188442b __SCK__tp_func_neigh_event_send_done +EXPORT_SYMBOL_GPL vmlinux 0xe19de8f9 __tracepoint_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0xe1a8d7c9 net_rwsem EXPORT_SYMBOL_GPL vmlinux 0xe1aa2d62 set_hv_tscchange_cb EXPORT_SYMBOL_GPL vmlinux 0xe1b6529a device_match_fwnode @@ -24865,6 +24864,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xe4b818c3 phy_speed_to_str EXPORT_SYMBOL_GPL vmlinux 0xe4c2c66c rtc_ktime_to_tm EXPORT_SYMBOL_GPL vmlinux 0xe4ca4935 addrconf_prefix_rcv_add_addr +EXPORT_SYMBOL_GPL vmlinux 0xe4d591d9 __io_uring_cmd_do_in_task EXPORT_SYMBOL_GPL vmlinux 0xe4d790aa sata_link_scr_lpm EXPORT_SYMBOL_GPL vmlinux 0xe4e48b12 swphy_validate_state EXPORT_SYMBOL_GPL vmlinux 0xe50388b3 devm_extcon_dev_unregister @@ -24968,7 +24968,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xe87ff8af devm_phy_get EXPORT_SYMBOL_GPL vmlinux 0xe8915620 thermal_zone_get_crit_temp EXPORT_SYMBOL_GPL vmlinux 0xe8979afb mas_prev_range -EXPORT_SYMBOL_GPL vmlinux 0xe8a680fc __traceiter_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0xe8a772bd vcap_keyset_list_add EXPORT_SYMBOL_GPL vmlinux 0xe8bc40c5 cn_netlink_send EXPORT_SYMBOL_GPL vmlinux 0xe8bdf9ca crypto_unregister_scomp @@ -25058,6 +25057,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xeb957795 serial8250_do_set_divisor EXPORT_SYMBOL_GPL vmlinux 0xeba1fdef ip6_push_pending_frames EXPORT_SYMBOL_GPL vmlinux 0xeba78298 pm_generic_thaw +EXPORT_SYMBOL_GPL vmlinux 0xebaa5125 sched_set_fifo_low EXPORT_SYMBOL_GPL vmlinux 0xebb1f830 acpi_quirk_skip_gpio_event_handlers EXPORT_SYMBOL_GPL vmlinux 0xebb99c65 max8997_read_reg EXPORT_SYMBOL_GPL vmlinux 0xebc76d08 ata_sas_slave_configure @@ -25090,7 +25090,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xed2f06b7 mptcp_pm_get_add_addr_accept_max EXPORT_SYMBOL_GPL vmlinux 0xed33a567 sdio_retune_hold_now EXPORT_SYMBOL_GPL vmlinux 0xed35fcf0 platform_device_add_data -EXPORT_SYMBOL_GPL vmlinux 0xed3967f2 yield_to EXPORT_SYMBOL_GPL vmlinux 0xed39b7b8 parse_OID EXPORT_SYMBOL_GPL vmlinux 0xed3a8052 __ip6_local_out EXPORT_SYMBOL_GPL vmlinux 0xed3df7b6 regmap_field_bulk_alloc @@ -25241,6 +25240,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xf2488142 nvmem_cell_read_variable_le_u32 EXPORT_SYMBOL_GPL vmlinux 0xf2567ce3 nfnl_ct_hook EXPORT_SYMBOL_GPL vmlinux 0xf2688b7d skb_zerocopy_iter_stream +EXPORT_SYMBOL_GPL vmlinux 0xf26ace8f io_uring_cmd_do_in_task_lazy EXPORT_SYMBOL_GPL vmlinux 0xf27589de devm_nvmem_device_put EXPORT_SYMBOL_GPL vmlinux 0xf277e37d devm_clk_register EXPORT_SYMBOL_GPL vmlinux 0xf27d0a7b gnttab_grant_foreign_access_ref @@ -25533,7 +25533,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xfd2fa3f0 __tracepoint_block_bio_remap EXPORT_SYMBOL_GPL vmlinux 0xfd538097 virtqueue_kick_prepare EXPORT_SYMBOL_GPL vmlinux 0xfd541a44 iomap_read_folio -EXPORT_SYMBOL_GPL vmlinux 0xfd588d11 __traceiter_pelt_se_tp +EXPORT_SYMBOL_GPL vmlinux 0xfd672306 __tracepoint_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0xfd6ae3fc iomap_zero_range EXPORT_SYMBOL_GPL vmlinux 0xfd7243c7 erst_disable EXPORT_SYMBOL_GPL vmlinux 0xfd756bfc devm_gpiod_unhinge diff -u linux-aws-6.5-6.5.0/debian.aws-6.5/abi/arm64/aws linux-aws-6.5-6.5.0/debian.aws-6.5/abi/arm64/aws --- linux-aws-6.5-6.5.0/debian.aws-6.5/abi/arm64/aws +++ linux-aws-6.5-6.5.0/debian.aws-6.5/abi/arm64/aws @@ -5861,7 +5861,6 @@ EXPORT_SYMBOL vmlinux 0x001a5f4d textsearch_find_continuous EXPORT_SYMBOL vmlinux 0x002fe8d5 ip_options_rcv_srr EXPORT_SYMBOL vmlinux 0x0031c7aa sock_pfree -EXPORT_SYMBOL vmlinux 0x00353019 wake_up_process EXPORT_SYMBOL vmlinux 0x004471a1 mipi_dsi_dcs_enter_sleep_mode EXPORT_SYMBOL vmlinux 0x00728b8d devm_devfreq_remove_device EXPORT_SYMBOL vmlinux 0x00834083 rproc_detach @@ -6787,7 +6786,6 @@ EXPORT_SYMBOL vmlinux 0x2b04897b trace_raw_output_prep EXPORT_SYMBOL vmlinux 0x2b1abce3 fman_has_errata_a050385 EXPORT_SYMBOL vmlinux 0x2b26e19a dev_add_offload -EXPORT_SYMBOL vmlinux 0x2b38dc38 can_nice EXPORT_SYMBOL vmlinux 0x2b593aa8 gen_pool_alloc_algo_owner EXPORT_SYMBOL vmlinux 0x2b5f6ef3 ip_fraglist_prepare EXPORT_SYMBOL vmlinux 0x2b6772ae md_reload_sb @@ -8093,7 +8091,6 @@ EXPORT_SYMBOL vmlinux 0x6402c8df sha512_block_data_order EXPORT_SYMBOL vmlinux 0x6406113f inet_confirm_addr EXPORT_SYMBOL vmlinux 0x6408505e is_nd_dax -EXPORT_SYMBOL vmlinux 0x640d7b7b io_uring_get_socket EXPORT_SYMBOL vmlinux 0x64127b67 bitmap_find_next_zero_area_off EXPORT_SYMBOL vmlinux 0x641dea7e tcp_v4_syn_recv_sock EXPORT_SYMBOL vmlinux 0x642eb5c6 xen_poll_irq_timeout @@ -8526,6 +8523,7 @@ EXPORT_SYMBOL vmlinux 0x755f4ba3 blake2s_compress_generic EXPORT_SYMBOL vmlinux 0x7577feb2 simple_transaction_read EXPORT_SYMBOL vmlinux 0x75871f5e acpi_get_next_object +EXPORT_SYMBOL vmlinux 0x758be448 io_uring_get_socket EXPORT_SYMBOL vmlinux 0x75a79120 __skb_wait_for_more_packets EXPORT_SYMBOL vmlinux 0x75a7a16d xfrm_unregister_km EXPORT_SYMBOL vmlinux 0x75b252c1 skb_vlan_untag @@ -8564,7 +8562,6 @@ EXPORT_SYMBOL vmlinux 0x770a9a0c netdev_master_upper_dev_get EXPORT_SYMBOL vmlinux 0x770f852f __register_nls EXPORT_SYMBOL vmlinux 0x77246ec0 of_pci_range_to_resource -EXPORT_SYMBOL vmlinux 0x77253692 set_user_nice EXPORT_SYMBOL vmlinux 0x773492b5 read_cache_page_gfp EXPORT_SYMBOL vmlinux 0x77358855 iomem_resource EXPORT_SYMBOL vmlinux 0x7737e348 mmc_put_card @@ -9995,6 +9992,7 @@ EXPORT_SYMBOL vmlinux 0xb7688155 ucc_slow_init EXPORT_SYMBOL vmlinux 0xb76c6fc0 simple_lookup EXPORT_SYMBOL vmlinux 0xb78debe3 LZ4_decompress_fast_usingDict +EXPORT_SYMBOL vmlinux 0xb792376d wake_up_process EXPORT_SYMBOL vmlinux 0xb7a66284 neigh_update EXPORT_SYMBOL vmlinux 0xb7b7fa6e node_states EXPORT_SYMBOL vmlinux 0xb7c0f443 sort @@ -10203,6 +10201,7 @@ EXPORT_SYMBOL vmlinux 0xc23606d9 pnp_get_resource EXPORT_SYMBOL vmlinux 0xc2419450 sys_imageblit EXPORT_SYMBOL vmlinux 0xc252e311 eth_platform_get_mac_address +EXPORT_SYMBOL vmlinux 0xc269a337 can_nice EXPORT_SYMBOL vmlinux 0xc26e9c4e xfrm_register_type EXPORT_SYMBOL vmlinux 0xc26ff0d4 seq_write EXPORT_SYMBOL vmlinux 0xc27225bc i2c_smbus_write_i2c_block_data @@ -10820,6 +10819,7 @@ EXPORT_SYMBOL vmlinux 0xde67419e sg_split EXPORT_SYMBOL vmlinux 0xde76d42e xfrm6_protocol_deregister EXPORT_SYMBOL vmlinux 0xde835aa5 unpin_user_pages_dirty_lock +EXPORT_SYMBOL vmlinux 0xde8938d0 set_user_nice EXPORT_SYMBOL vmlinux 0xde8d1ddc phy_find_first EXPORT_SYMBOL vmlinux 0xde95c9c8 tty_insert_flip_string_fixed_flag EXPORT_SYMBOL vmlinux 0xde9cdcc1 give_up_console @@ -19243,7 +19243,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x13db1eb8 k3_udma_glue_rx_cppi5_to_dma_addr EXPORT_SYMBOL_GPL vmlinux 0x13ed8784 sdev_evt_alloc EXPORT_SYMBOL_GPL vmlinux 0x13f32d89 powercap_register_control_type -EXPORT_SYMBOL_GPL vmlinux 0x13fa9f69 __traceiter_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0x13fab921 cpuidle_unregister_device EXPORT_SYMBOL_GPL vmlinux 0x1403ad09 cpufreq_add_update_util_hook EXPORT_SYMBOL_GPL vmlinux 0x141f38bf ktime_get_raw_fast_ns @@ -19386,7 +19385,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x1893d82a ata_common_sdev_groups EXPORT_SYMBOL_GPL vmlinux 0x189bb42d sdio_writesb EXPORT_SYMBOL_GPL vmlinux 0x18c7d2ca devm_of_clk_add_hw_provider -EXPORT_SYMBOL_GPL vmlinux 0x18d38126 sched_set_fifo_low EXPORT_SYMBOL_GPL vmlinux 0x18d6f8c8 fwnode_handle_get EXPORT_SYMBOL_GPL vmlinux 0x18dba289 devm_extcon_dev_free EXPORT_SYMBOL_GPL vmlinux 0x18e18664 nvme_init_ctrl @@ -19406,7 +19404,9 @@ EXPORT_SYMBOL_GPL vmlinux 0x19600596 __traceiter_block_bio_remap EXPORT_SYMBOL_GPL vmlinux 0x19726a7c ata_sff_prereset EXPORT_SYMBOL_GPL vmlinux 0x198072d6 eventfd_ctx_fileget +EXPORT_SYMBOL_GPL vmlinux 0x1983c40c __traceiter_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0x198e9225 of_get_fb_videomode +EXPORT_SYMBOL_GPL vmlinux 0x198fad8c __traceiter_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x19979aab usb_add_phy EXPORT_SYMBOL_GPL vmlinux 0x199b7dfe netdev_set_default_ethtool_ops EXPORT_SYMBOL_GPL vmlinux 0x19a304ba usb_disabled @@ -19518,7 +19518,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x1d1cf324 xenbus_alloc_evtchn EXPORT_SYMBOL_GPL vmlinux 0x1d213379 pci_msi_create_irq_domain EXPORT_SYMBOL_GPL vmlinux 0x1d222ced irq_get_irqchip_state -EXPORT_SYMBOL_GPL vmlinux 0x1d2df99d io_uring_cmd_done EXPORT_SYMBOL_GPL vmlinux 0x1d3406b2 dst_blackhole_redirect EXPORT_SYMBOL_GPL vmlinux 0x1d3b270f nvme_auth_transform_key EXPORT_SYMBOL_GPL vmlinux 0x1d50df62 ahci_platform_shutdown @@ -19874,6 +19873,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x2ad943b9 ata_bmdma_error_handler EXPORT_SYMBOL_GPL vmlinux 0x2ae11d06 phy_driver_is_genphy_10g EXPORT_SYMBOL_GPL vmlinux 0x2ae1689e zynqmp_pm_clock_getdivider +EXPORT_SYMBOL_GPL vmlinux 0x2ae25332 __traceiter_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x2ae2c162 relay_flush EXPORT_SYMBOL_GPL vmlinux 0x2afb9f6c dm_path_uevent EXPORT_SYMBOL_GPL vmlinux 0x2b00153f register_btf_kfunc_id_set @@ -19920,7 +19920,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x2c66ac85 devlink_info_serial_number_put EXPORT_SYMBOL_GPL vmlinux 0x2c71a2c1 fsstack_copy_attr_all EXPORT_SYMBOL_GPL vmlinux 0x2c723e9b fsnotify_add_mark -EXPORT_SYMBOL_GPL vmlinux 0x2c73c596 __traceiter_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x2c750eb4 cleanup_srcu_struct EXPORT_SYMBOL_GPL vmlinux 0x2c768e48 device_property_read_u16_array EXPORT_SYMBOL_GPL vmlinux 0x2c7db649 irq_dispose_mapping @@ -20038,7 +20037,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x30110a29 phy_eee_cap1_features EXPORT_SYMBOL_GPL vmlinux 0x30351294 k3_udma_glue_rx_flow_get_fdq_id EXPORT_SYMBOL_GPL vmlinux 0x3050ccb7 clk_register_divider_table -EXPORT_SYMBOL_GPL vmlinux 0x30517c66 set_cpus_allowed_ptr EXPORT_SYMBOL_GPL vmlinux 0x3053a9fd do_unregister_con_driver EXPORT_SYMBOL_GPL vmlinux 0x305a4f45 ata_sff_thaw EXPORT_SYMBOL_GPL vmlinux 0x305aedf9 rio_mport_send_doorbell @@ -20073,11 +20071,11 @@ EXPORT_SYMBOL_GPL vmlinux 0x311e0bed pse_controller_unregister EXPORT_SYMBOL_GPL vmlinux 0x31266931 con_debug_leave EXPORT_SYMBOL_GPL vmlinux 0x313255e4 da903x_unregister_notifier -EXPORT_SYMBOL_GPL vmlinux 0x31334b08 __traceiter_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0x3133d35b devm_devfreq_event_remove_edev EXPORT_SYMBOL_GPL vmlinux 0x313ea5fd ipi_send_single EXPORT_SYMBOL_GPL vmlinux 0x314465d4 regulator_get_voltage_sel_regmap EXPORT_SYMBOL_GPL vmlinux 0x3148348c switchdev_port_attr_set +EXPORT_SYMBOL_GPL vmlinux 0x314a83de yield_to EXPORT_SYMBOL_GPL vmlinux 0x314d43fa irq_domain_free_fwnode EXPORT_SYMBOL_GPL vmlinux 0x3159ecd1 relay_subbufs_consumed EXPORT_SYMBOL_GPL vmlinux 0x3164360c spi_mem_dirmap_create @@ -20341,6 +20339,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x3a5b1d70 device_show_bool EXPORT_SYMBOL_GPL vmlinux 0x3a62777d of_property_read_variable_u32_array EXPORT_SYMBOL_GPL vmlinux 0x3a644f80 serdev_device_open +EXPORT_SYMBOL_GPL vmlinux 0x3a73b15d __traceiter_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0x3a8117ec crypto_rng_reset EXPORT_SYMBOL_GPL vmlinux 0x3a85777a folio_wait_writeback_killable EXPORT_SYMBOL_GPL vmlinux 0x3a89bd8b xenbus_dev_fatal @@ -20360,6 +20359,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x3b03208d power_supply_battery_info_has_prop EXPORT_SYMBOL_GPL vmlinux 0x3b1069a5 __blk_mq_debugfs_rq_show EXPORT_SYMBOL_GPL vmlinux 0x3b2311a9 of_hte_req_count +EXPORT_SYMBOL_GPL vmlinux 0x3b28dd57 preempt_notifier_register EXPORT_SYMBOL_GPL vmlinux 0x3b3f3386 device_property_present EXPORT_SYMBOL_GPL vmlinux 0x3b4c240a display_timings_release EXPORT_SYMBOL_GPL vmlinux 0x3b66ccc4 tty_port_tty_hangup @@ -20373,6 +20373,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x3b8cb1a2 blk_execute_rq_nowait EXPORT_SYMBOL_GPL vmlinux 0x3b9a9bf2 gpiochip_add_pin_range EXPORT_SYMBOL_GPL vmlinux 0x3ba01b47 get_compat_sigset +EXPORT_SYMBOL_GPL vmlinux 0x3ba71566 __traceiter_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x3bc3fb2f ata_sff_exec_command EXPORT_SYMBOL_GPL vmlinux 0x3bdb5d28 alg_test EXPORT_SYMBOL_GPL vmlinux 0x3be200ce phy_10gbit_fec_features @@ -20455,6 +20456,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x3e44a579 evm_inode_init_security EXPORT_SYMBOL_GPL vmlinux 0x3e44b552 sk_msg_return_zero EXPORT_SYMBOL_GPL vmlinux 0x3e5dc48a scmi_protocol_register +EXPORT_SYMBOL_GPL vmlinux 0x3e6ac7b4 set_cpus_allowed_ptr EXPORT_SYMBOL_GPL vmlinux 0x3e6d9d64 __tracepoint_br_fdb_update EXPORT_SYMBOL_GPL vmlinux 0x3e7080cb mpi_read_from_buffer EXPORT_SYMBOL_GPL vmlinux 0x3e741fac blk_mq_unquiesce_tagset @@ -20563,7 +20565,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x41ec995b device_rename EXPORT_SYMBOL_GPL vmlinux 0x41ed3cec eventfd_ctx_remove_wait_queue EXPORT_SYMBOL_GPL vmlinux 0x41f3110e devm_get_free_pages -EXPORT_SYMBOL_GPL vmlinux 0x41f89b81 __traceiter_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0x42041512 i2c_get_dma_safe_msg_buf EXPORT_SYMBOL_GPL vmlinux 0x42082a5a mtk_clk_register_pllfhs EXPORT_SYMBOL_GPL vmlinux 0x420f3d01 nvmem_unregister_notifier @@ -20820,6 +20821,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x4a0e73b9 perf_report_aux_output_id EXPORT_SYMBOL_GPL vmlinux 0x4a121bc9 ata_acpi_gtm_xfermask EXPORT_SYMBOL_GPL vmlinux 0x4a17ed66 sysrq_mask +EXPORT_SYMBOL_GPL vmlinux 0x4a2e7507 sched_show_task EXPORT_SYMBOL_GPL vmlinux 0x4a3a2702 cpufreq_unregister_governor EXPORT_SYMBOL_GPL vmlinux 0x4a420d09 acpi_bus_detach_private_data EXPORT_SYMBOL_GPL vmlinux 0x4a475113 screen_glyph @@ -21051,6 +21053,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x522d99e9 make_vfsuid EXPORT_SYMBOL_GPL vmlinux 0x52332223 platform_driver_unregister EXPORT_SYMBOL_GPL vmlinux 0x523a8f36 clk_hw_forward_rate_request +EXPORT_SYMBOL_GPL vmlinux 0x523addcd io_uring_cmd_sock EXPORT_SYMBOL_GPL vmlinux 0x524027a1 clk_register_fractional_divider EXPORT_SYMBOL_GPL vmlinux 0x52431348 xenbus_transaction_start EXPORT_SYMBOL_GPL vmlinux 0x5255c253 icc_put @@ -21174,6 +21177,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x56582d8b tc3589x_block_write EXPORT_SYMBOL_GPL vmlinux 0x566ab653 skb_tstamp_tx EXPORT_SYMBOL_GPL vmlinux 0x56704a8d crypto_unregister_algs +EXPORT_SYMBOL_GPL vmlinux 0x56967ee1 io_uring_cmd_import_fixed EXPORT_SYMBOL_GPL vmlinux 0x56a15fc3 usb_wakeup_notification EXPORT_SYMBOL_GPL vmlinux 0x56ae3dad virtio_max_dma_size EXPORT_SYMBOL_GPL vmlinux 0x56b1e1b0 dev_attr_ncq_prio_supported @@ -21206,7 +21210,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x57bc4296 usb_hub_claim_port EXPORT_SYMBOL_GPL vmlinux 0x57c58e9b __tracepoint_devlink_hwerr EXPORT_SYMBOL_GPL vmlinux 0x57d4050a xhci_get_endpoint_index -EXPORT_SYMBOL_GPL vmlinux 0x57d9b64c __traceiter_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x57dc4851 mas_erase EXPORT_SYMBOL_GPL vmlinux 0x57e04bb7 power_supply_set_property EXPORT_SYMBOL_GPL vmlinux 0x57e355e7 get_device_system_crosststamp @@ -21252,7 +21255,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x597535ac nvmem_cell_read_variable_le_u64 EXPORT_SYMBOL_GPL vmlinux 0x597535bf spi_mem_get_name EXPORT_SYMBOL_GPL vmlinux 0x59779df9 hvc_poll -EXPORT_SYMBOL_GPL vmlinux 0x59825485 __traceiter_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x5986d190 kdb_printf EXPORT_SYMBOL_GPL vmlinux 0x598ffc8f blk_mq_wait_quiesce_done EXPORT_SYMBOL_GPL vmlinux 0x599d1632 kthread_flush_worker @@ -21298,6 +21300,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x5afc722e __audit_log_nfcfg EXPORT_SYMBOL_GPL vmlinux 0x5b098017 sysfs_group_change_owner EXPORT_SYMBOL_GPL vmlinux 0x5b112a7b acpi_device_fix_up_power +EXPORT_SYMBOL_GPL vmlinux 0x5b11cafb sched_set_fifo_low EXPORT_SYMBOL_GPL vmlinux 0x5b1c4097 ata_pci_remove_one EXPORT_SYMBOL_GPL vmlinux 0x5b21ceff ring_buffer_iter_peek EXPORT_SYMBOL_GPL vmlinux 0x5b30e25c vhost_task_wake @@ -21427,13 +21430,13 @@ EXPORT_SYMBOL_GPL vmlinux 0x5ee86e35 mbox_chan_received_data EXPORT_SYMBOL_GPL vmlinux 0x5ef24e5b amba_device_add EXPORT_SYMBOL_GPL vmlinux 0x5ef9a93b phylink_connect_phy +EXPORT_SYMBOL_GPL vmlinux 0x5efc8913 __traceiter_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0x5f080b24 dev_pm_opp_get_required_pstate EXPORT_SYMBOL_GPL vmlinux 0x5f23e3fa insert_resource EXPORT_SYMBOL_GPL vmlinux 0x5f28bcbb devm_pinctrl_get EXPORT_SYMBOL_GPL vmlinux 0x5f32160c dev_pm_opp_get_supplies EXPORT_SYMBOL_GPL vmlinux 0x5f384a68 x509_free_certificate EXPORT_SYMBOL_GPL vmlinux 0x5f395105 __traceiter_devlink_trap_report -EXPORT_SYMBOL_GPL vmlinux 0x5f42a8b3 kick_process EXPORT_SYMBOL_GPL vmlinux 0x5f46b1c0 sec_irq_init EXPORT_SYMBOL_GPL vmlinux 0x5f49e254 cpci_hp_register_controller EXPORT_SYMBOL_GPL vmlinux 0x5f51275e phy_modify_mmd @@ -21459,7 +21462,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x5ff24d47 spi_unregister_controller EXPORT_SYMBOL_GPL vmlinux 0x5ff47f88 udp_abort EXPORT_SYMBOL_GPL vmlinux 0x60091316 clk_notifier_register -EXPORT_SYMBOL_GPL vmlinux 0x601a0c8e __traceiter_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x6022f7d6 pm_runtime_get_if_active EXPORT_SYMBOL_GPL vmlinux 0x60306b05 device_set_wakeup_capable EXPORT_SYMBOL_GPL vmlinux 0x603d0d51 acpi_os_map_iomem @@ -21525,6 +21527,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x6207d993 direct_write_fallback EXPORT_SYMBOL_GPL vmlinux 0x620a6b7b devm_free_pages EXPORT_SYMBOL_GPL vmlinux 0x62104126 phylink_ethtool_set_wol +EXPORT_SYMBOL_GPL vmlinux 0x621154c0 sched_setattr_nocheck EXPORT_SYMBOL_GPL vmlinux 0x6217daab devm_mtk_clk_mux_notifier_register EXPORT_SYMBOL_GPL vmlinux 0x6224d282 __dma_request_channel EXPORT_SYMBOL_GPL vmlinux 0x622c7922 register_oom_notifier @@ -21750,6 +21753,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x69b1d9d0 inet_csk_update_pmtu EXPORT_SYMBOL_GPL vmlinux 0x69c8242f sk_msg_return EXPORT_SYMBOL_GPL vmlinux 0x69cf0632 mpi_fromstr +EXPORT_SYMBOL_GPL vmlinux 0x69d9e6db __io_uring_cmd_do_in_task EXPORT_SYMBOL_GPL vmlinux 0x69e47250 mtk_paris_pinctrl_probe EXPORT_SYMBOL_GPL vmlinux 0x69e4ba4b i2c_new_ancillary_device EXPORT_SYMBOL_GPL vmlinux 0x69e683de uuid_gen @@ -21826,7 +21830,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x6be3a96b hv_remove_vmbus_handler EXPORT_SYMBOL_GPL vmlinux 0x6bf32762 ipv4_update_pmtu EXPORT_SYMBOL_GPL vmlinux 0x6c0324b6 tcp_done -EXPORT_SYMBOL_GPL vmlinux 0x6c03f98b yield_to +EXPORT_SYMBOL_GPL vmlinux 0x6c17b38c __traceiter_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0x6c1f07f7 crypto_akcipher_sync_encrypt EXPORT_SYMBOL_GPL vmlinux 0x6c1f7632 xenbus_dev_cancel EXPORT_SYMBOL_GPL vmlinux 0x6c205008 mpi_print @@ -22270,7 +22274,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x7ba6d05f ata_eh_read_sense_success_ncq_log EXPORT_SYMBOL_GPL vmlinux 0x7bb045a7 __request_percpu_irq EXPORT_SYMBOL_GPL vmlinux 0x7bb3fa18 vcap_rule_add_action_bit -EXPORT_SYMBOL_GPL vmlinux 0x7bc99229 sched_set_fifo EXPORT_SYMBOL_GPL vmlinux 0x7bcc1e9e espintcp_push_skb EXPORT_SYMBOL_GPL vmlinux 0x7bce1659 smpboot_unregister_percpu_thread EXPORT_SYMBOL_GPL vmlinux 0x7be23dd1 ata_host_alloc_pinfo @@ -22372,6 +22375,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7f84f35d rcu_gp_slow_unregister EXPORT_SYMBOL_GPL vmlinux 0x7f860088 crypto_mod_get EXPORT_SYMBOL_GPL vmlinux 0x7f8839d6 i2c_acpi_get_i2c_resource +EXPORT_SYMBOL_GPL vmlinux 0x7f898b3d __traceiter_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0x7f9b1879 osc_cpc_flexible_adr_space_confirmed EXPORT_SYMBOL_GPL vmlinux 0x7f9c8d43 put_io_context EXPORT_SYMBOL_GPL vmlinux 0x7fa96509 erst_get_record_id_next @@ -22647,7 +22651,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x87fb6ec4 irq_domain_remove_sim EXPORT_SYMBOL_GPL vmlinux 0x88140ee4 regulator_set_mode EXPORT_SYMBOL_GPL vmlinux 0x88180dda edac_device_handle_ce_count -EXPORT_SYMBOL_GPL vmlinux 0x882523fa sched_setattr_nocheck EXPORT_SYMBOL_GPL vmlinux 0x882f928c devlink_trap_groups_register EXPORT_SYMBOL_GPL vmlinux 0x8835ac30 sysfs_remove_mount_point EXPORT_SYMBOL_GPL vmlinux 0x8836c5bc dw_pcie_find_capability @@ -23161,6 +23164,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x981aed9b __hvc_resize EXPORT_SYMBOL_GPL vmlinux 0x983276da phylink_disconnect_phy EXPORT_SYMBOL_GPL vmlinux 0x9833bc0c hvc_kick +EXPORT_SYMBOL_GPL vmlinux 0x98380fb9 sched_set_normal EXPORT_SYMBOL_GPL vmlinux 0x9843f501 __cookie_v4_check EXPORT_SYMBOL_GPL vmlinux 0x98478759 fuse_fill_super_common EXPORT_SYMBOL_GPL vmlinux 0x984c4cb6 icc_node_create @@ -23174,7 +23178,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x9879932b crypto_register_notifier EXPORT_SYMBOL_GPL vmlinux 0x9885a8a0 desc_to_gpio EXPORT_SYMBOL_GPL vmlinux 0x989074ff kmsg_dump_reason_str -EXPORT_SYMBOL_GPL vmlinux 0x989aa9ff sched_show_task EXPORT_SYMBOL_GPL vmlinux 0x98a74404 k3_udma_glue_rx_get_dma_device EXPORT_SYMBOL_GPL vmlinux 0x98b609d9 pm_wakeup_ws_event EXPORT_SYMBOL_GPL vmlinux 0x98bfa923 fat_build_inode @@ -23206,7 +23209,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x99bb9528 device_get_match_data EXPORT_SYMBOL_GPL vmlinux 0x99c5417c bpf_event_output EXPORT_SYMBOL_GPL vmlinux 0x99cefca8 vp_modern_get_queue_size -EXPORT_SYMBOL_GPL vmlinux 0x99e30cd1 io_uring_cmd_do_in_task_lazy EXPORT_SYMBOL_GPL vmlinux 0x99e3d817 led_init_core EXPORT_SYMBOL_GPL vmlinux 0x99e6c610 of_map_id EXPORT_SYMBOL_GPL vmlinux 0x99f018c4 nvmem_cell_read @@ -23668,6 +23670,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xa8f68484 reset_controller_unregister EXPORT_SYMBOL_GPL vmlinux 0xa8f97178 __tracepoint_ata_tf_load EXPORT_SYMBOL_GPL vmlinux 0xa90614cb ip6_datagram_send_ctl +EXPORT_SYMBOL_GPL vmlinux 0xa90fec4e preempt_notifier_unregister EXPORT_SYMBOL_GPL vmlinux 0xa90ffe0d usb_hcd_pci_shutdown EXPORT_SYMBOL_GPL vmlinux 0xa91e3dc8 syscon_regmap_lookup_by_phandle EXPORT_SYMBOL_GPL vmlinux 0xa9212587 blk_mq_alloc_sq_tag_set @@ -23724,6 +23727,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xab3a2936 regulator_irq_helper EXPORT_SYMBOL_GPL vmlinux 0xab458c83 regmap_multi_reg_write_bypassed EXPORT_SYMBOL_GPL vmlinux 0xab571d08 ip6_sk_redirect +EXPORT_SYMBOL_GPL vmlinux 0xab5f7a10 kick_process EXPORT_SYMBOL_GPL vmlinux 0xab603203 regulator_set_voltage_time EXPORT_SYMBOL_GPL vmlinux 0xab624b02 regulator_set_soft_start_regmap EXPORT_SYMBOL_GPL vmlinux 0xab6320ba devlink_resource_occ_get_unregister @@ -24045,6 +24049,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xb6a930b2 clk_divider_ops EXPORT_SYMBOL_GPL vmlinux 0xb6ab8fb2 dm_device_name EXPORT_SYMBOL_GPL vmlinux 0xb6b20c4b rio_dev_get +EXPORT_SYMBOL_GPL vmlinux 0xb6cd55c7 io_uring_cmd_do_in_task_lazy EXPORT_SYMBOL_GPL vmlinux 0xb6da74f9 wait_for_stable_page EXPORT_SYMBOL_GPL vmlinux 0xb6df084d sbitmap_queue_get_shallow EXPORT_SYMBOL_GPL vmlinux 0xb6e07626 perf_event_create_kernel_counter @@ -24217,6 +24222,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xbcd2de02 of_property_read_variable_u16_array EXPORT_SYMBOL_GPL vmlinux 0xbcdd5b99 iommu_group_set_name EXPORT_SYMBOL_GPL vmlinux 0xbced6161 __platform_driver_register +EXPORT_SYMBOL_GPL vmlinux 0xbcf05110 __traceiter_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0xbcf1f0e6 zs_create_pool EXPORT_SYMBOL_GPL vmlinux 0xbcfed14d iommu_alloc_resv_region EXPORT_SYMBOL_GPL vmlinux 0xbd04f53a user_read @@ -24567,6 +24573,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xc8b7c3bc acpi_spi_device_alloc EXPORT_SYMBOL_GPL vmlinux 0xc8bc1f92 regulator_list_voltage_table EXPORT_SYMBOL_GPL vmlinux 0xc8bef83d rz_mtu3_32bit_ch_write +EXPORT_SYMBOL_GPL vmlinux 0xc8c4f5ba sched_set_fifo EXPORT_SYMBOL_GPL vmlinux 0xc8cfe7d4 skcipher_register_instance EXPORT_SYMBOL_GPL vmlinux 0xc8d216d8 da903x_register_notifier EXPORT_SYMBOL_GPL vmlinux 0xc8d49e3a debugfs_lookup_and_remove @@ -24710,7 +24717,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xcd91b127 system_highpri_wq EXPORT_SYMBOL_GPL vmlinux 0xcd952d4c dprc_remove_devices EXPORT_SYMBOL_GPL vmlinux 0xcd974f00 rcu_all_qs -EXPORT_SYMBOL_GPL vmlinux 0xcd981978 __traceiter_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0xcd9cd2ff wakeme_after_rcu EXPORT_SYMBOL_GPL vmlinux 0xcd9d402a usb_create_hcd EXPORT_SYMBOL_GPL vmlinux 0xcda2aaba k3_udma_glue_tx_dma_to_cppi5_addr @@ -24765,6 +24771,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xcf8f1514 da903x_reads EXPORT_SYMBOL_GPL vmlinux 0xcf90a9fb devlink_dpipe_table_counter_enabled EXPORT_SYMBOL_GPL vmlinux 0xcf9e07bf spi_mem_exec_op +EXPORT_SYMBOL_GPL vmlinux 0xcfac02bd __traceiter_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0xcfb51772 sk_free_unlock_clone EXPORT_SYMBOL_GPL vmlinux 0xcfbddc35 crypto_register_alg EXPORT_SYMBOL_GPL vmlinux 0xcfbff421 relay_late_setup_files @@ -24935,7 +24942,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xd54f8d68 acpi_ec_add_query_handler EXPORT_SYMBOL_GPL vmlinux 0xd55ad93b iommu_group_get_iommudata EXPORT_SYMBOL_GPL vmlinux 0xd560f818 generic_fh_to_parent -EXPORT_SYMBOL_GPL vmlinux 0xd562bbe9 __traceiter_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0xd56433fb __devm_regmap_init_spi EXPORT_SYMBOL_GPL vmlinux 0xd567df77 inet6_csk_xmit EXPORT_SYMBOL_GPL vmlinux 0xd56cab7e rio_register_scan @@ -25309,7 +25315,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xe2ec293b sbitmap_queue_wake_up EXPORT_SYMBOL_GPL vmlinux 0xe300c86a raw_v4_match EXPORT_SYMBOL_GPL vmlinux 0xe30f94c5 device_for_each_child_reverse -EXPORT_SYMBOL_GPL vmlinux 0xe3138b80 __traceiter_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0xe32ceebb fsl_mc_portal_allocate EXPORT_SYMBOL_GPL vmlinux 0xe3452a9a tpm_chip_alloc EXPORT_SYMBOL_GPL vmlinux 0xe3538551 xfrm_dev_state_add @@ -25380,7 +25385,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xe55a54c5 clk_hw_unregister EXPORT_SYMBOL_GPL vmlinux 0xe55c279a tps6586x_irq_get_virq EXPORT_SYMBOL_GPL vmlinux 0xe5792b3a blk_rq_is_poll -EXPORT_SYMBOL_GPL vmlinux 0xe57effcb preempt_notifier_register EXPORT_SYMBOL_GPL vmlinux 0xe58100ad synth_event_trace_end EXPORT_SYMBOL_GPL vmlinux 0xe5883bd9 class_compat_unregister EXPORT_SYMBOL_GPL vmlinux 0xe58eb9d7 FSE_readNCount @@ -25571,7 +25575,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xeb4221e4 trace_clock EXPORT_SYMBOL_GPL vmlinux 0xeb497d42 watchdog_unregister_device EXPORT_SYMBOL_GPL vmlinux 0xeb4ca482 divider_round_rate_parent -EXPORT_SYMBOL_GPL vmlinux 0xeb57c1c7 io_uring_cmd_sock EXPORT_SYMBOL_GPL vmlinux 0xeb5d1f1e inet_hash_connect EXPORT_SYMBOL_GPL vmlinux 0xeb5dd0d5 kvm_vcpu_read_guest_atomic EXPORT_SYMBOL_GPL vmlinux 0xeb60de7f thermal_zone_get_crit_temp @@ -25583,7 +25586,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xeba2e75c blk_queue_max_discard_segments EXPORT_SYMBOL_GPL vmlinux 0xebac2108 devm_ti_sci_get_handle EXPORT_SYMBOL_GPL vmlinux 0xebb0faec pm_generic_thaw -EXPORT_SYMBOL_GPL vmlinux 0xebce398f __traceiter_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0xebcff795 trace_array_init_printk EXPORT_SYMBOL_GPL vmlinux 0xebd4cc11 mctrl_gpio_enable_ms EXPORT_SYMBOL_GPL vmlinux 0xebd6fc92 led_blink_set_oneshot @@ -25626,7 +25628,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xeda19ac9 powercap_register_zone EXPORT_SYMBOL_GPL vmlinux 0xeda1b213 subsys_system_register EXPORT_SYMBOL_GPL vmlinux 0xedb3fbdd trace_array_set_clr_event -EXPORT_SYMBOL_GPL vmlinux 0xedb40f86 __io_uring_cmd_do_in_task EXPORT_SYMBOL_GPL vmlinux 0xedb54964 of_reserved_mem_device_init_by_name EXPORT_SYMBOL_GPL vmlinux 0xede9a09a btree_lookup EXPORT_SYMBOL_GPL vmlinux 0xedfa3728 dev_pm_opp_put_opp_table @@ -25715,7 +25716,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xf0c79545 fscrypt_fname_encrypted_size EXPORT_SYMBOL_GPL vmlinux 0xf0ccf2d4 nvme_auth_dhgroup_kpp EXPORT_SYMBOL_GPL vmlinux 0xf0e52dc0 __tracepoint_ata_exec_command -EXPORT_SYMBOL_GPL vmlinux 0xf0ec180c preempt_notifier_unregister EXPORT_SYMBOL_GPL vmlinux 0xf0f1848e mtk_pinconf_drive_set_raw EXPORT_SYMBOL_GPL vmlinux 0xf0fb1ce1 mcore_booted EXPORT_SYMBOL_GPL vmlinux 0xf0ff89f4 vfs_listxattr @@ -25725,6 +25725,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xf12180fd imx_1443x_dram_pll EXPORT_SYMBOL_GPL vmlinux 0xf128f7a1 transport_remove_device EXPORT_SYMBOL_GPL vmlinux 0xf12f17f6 xenbus_unregister_driver +EXPORT_SYMBOL_GPL vmlinux 0xf13192b1 io_uring_cmd_done EXPORT_SYMBOL_GPL vmlinux 0xf13455c7 nvdimm_provider_data EXPORT_SYMBOL_GPL vmlinux 0xf13e69e3 dpbp_open EXPORT_SYMBOL_GPL vmlinux 0xf13f6e23 nvdimm_bus_register @@ -25821,6 +25822,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xf4af35c2 rcu_gp_is_normal EXPORT_SYMBOL_GPL vmlinux 0xf4b294ae dummy_con EXPORT_SYMBOL_GPL vmlinux 0xf4cd9f8f reset_control_bulk_release +EXPORT_SYMBOL_GPL vmlinux 0xf4df2882 __traceiter_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0xf51f76d3 i2c_client_get_device_id EXPORT_SYMBOL_GPL vmlinux 0xf52eb112 regulator_get EXPORT_SYMBOL_GPL vmlinux 0xf53db69c sock_diag_put_meminfo @@ -25882,7 +25884,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xf701fc5f virtio_reset_device EXPORT_SYMBOL_GPL vmlinux 0xf70c3a55 get_task_mm EXPORT_SYMBOL_GPL vmlinux 0xf70d8d2a spi_mem_dirmap_read -EXPORT_SYMBOL_GPL vmlinux 0xf70e5ef8 sched_set_normal EXPORT_SYMBOL_GPL vmlinux 0xf7145dc4 drop_reasons_unregister_subsys EXPORT_SYMBOL_GPL vmlinux 0xf71bd2cb regulator_desc_list_voltage_linear EXPORT_SYMBOL_GPL vmlinux 0xf729a7e8 pci_disable_ats @@ -25896,7 +25897,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xf7500f63 usb_phy_set_charger_state EXPORT_SYMBOL_GPL vmlinux 0xf766ba3f scmi_protocol_unregister EXPORT_SYMBOL_GPL vmlinux 0xf7772bde xas_init_marks -EXPORT_SYMBOL_GPL vmlinux 0xf77b6288 io_uring_cmd_import_fixed EXPORT_SYMBOL_GPL vmlinux 0xf78075a5 of_pci_range_parser_one EXPORT_SYMBOL_GPL vmlinux 0xf782fb07 percpu_ref_switch_to_atomic_sync EXPORT_SYMBOL_GPL vmlinux 0xf7866b4f bind_evtchn_to_irqhandler_lateeoi diff -u linux-aws-6.5-6.5.0/debian.aws-6.5/abi/version linux-aws-6.5-6.5.0/debian.aws-6.5/abi/version --- linux-aws-6.5-6.5.0/debian.aws-6.5/abi/version +++ linux-aws-6.5-6.5.0/debian.aws-6.5/abi/version @@ -1 +1 @@ -6.5.0-1013.13~22.04.1 +6.5.0-1014.14~22.04.1 diff -u linux-aws-6.5-6.5.0/debian.aws-6.5/changelog linux-aws-6.5-6.5.0/debian.aws-6.5/changelog --- linux-aws-6.5-6.5.0/debian.aws-6.5/changelog +++ linux-aws-6.5-6.5.0/debian.aws-6.5/changelog @@ -1,3 +1,2074 @@ +linux-aws-6.5 (6.5.0-1015.15~22.04.1) jammy; urgency=medium + + * jammy/linux-aws-6.5: 6.5.0-1015.15~22.04.1 -proposed tracker (LP: #2052020) + + * Packaging resync (LP: #1786013) + - [Packaging] update Ubuntu.md + + [ Ubuntu: 6.5.0-1015.15 ] + + * mantic/linux-aws: 6.5.0-1015.15 -proposed tracker (LP: #2052021) + * Packaging resync (LP: #1786013) + - [Packaging] update Ubuntu.md + - debian/dkms-versions -- update from kernel-versions (main/2024.02.05) + * mantic/linux: 6.5.0-25.25 -proposed tracker (LP: #2052615) + * Packaging resync (LP: #1786013) + - debian/dkms-versions -- update from kernel-versions (main/2024.02.05) + * [SRU][22.04.04]: mpi3mr driver update (LP: #2045233) + - scsi: mpi3mr: Invoke soft reset upon TSU or event ack time out + - scsi: mpi3mr: Update MPI Headers to version 3.00.28 + - scsi: mpi3mr: Add support for more than 1MB I/O + - scsi: mpi3mr: WRITE SAME implementation + - scsi: mpi3mr: Enhance handling of devices removed after controller reset + - scsi: mpi3mr: Update driver version to 8.5.0.0.0 + - scsi: mpi3mr: Split off bus_reset function from host_reset + - scsi: mpi3mr: Add support for SAS5116 PCI IDs + - scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 + - scsi: mpi3mr: Increase maximum number of PHYs to 64 from 32 + - scsi: mpi3mr: Add support for status reply descriptor + - scsi: mpi3mr: driver version upgrade to 8.5.0.0.50 + - scsi: mpi3mr: Refresh sdev queue depth after controller reset + - scsi: mpi3mr: Clean up block devices post controller reset + - scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable + State + - scsi: mpi3mr: Fetch correct device dev handle for status reply descriptor + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-1 + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-2 + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-3 + - scsi: mpi3mr: Update driver version to 8.5.1.0.0 + * The display becomes frozen after some time when a HDMI device is connected. + (LP: #2049027) + - drm/i915/dmc: Don't enable any pipe DMC events + * Audio balancing setting doesn't work with the cirrus codec (LP: #2051050) + - ALSA: hda/cs8409: Suppress vmaster control for Dolphin models + * partproke is broken on empty loopback device (LP: #2049689) + - block: Move checking GENHD_FL_NO_PART to bdev_add_partition() + * CVE-2023-51780 + - atm: Fix Use-After-Free in do_vcc_ioctl + * CVE-2023-6915 + - ida: Fix crash in ida_free when the bitmap is empty + * Update Ubuntu.md (LP: #2051176) + - [Packaging] update Ubuntu.md + * test_021_aslr_dapper_libs from ubuntu_qrt_kernel_security failed on K-5.19 / + J-OEM-6.1 / J-6.2 AMD64 (LP: #1983357) + - [Config]: set ARCH_MMAP_RND_{COMPAT_, }BITS to the maximum + * Intel E810-XXV - NETDEV WATCHDOG: (ice): transmit queue timed out + (LP: #2036239) + - ice: Add driver support for firmware changes for LAG + - ice: alter feature support check for SRIOV and LAG + * Mantic update: upstream stable patchset 2024-01-29 (LP: #2051584) + - Upstream stable to v6.1.67, v6.6.6 + - vdpa/mlx5: preserve CVQ vringh index + - hrtimers: Push pending hrtimers away from outgoing CPU earlier + - i2c: designware: Fix corrupted memory seen in the ISR + - netfilter: ipset: fix race condition between swap/destroy and kernel side + add/del/test + - zstd: Fix array-index-out-of-bounds UBSAN warning + - tg3: Move the [rt]x_dropped counters to tg3_napi + - tg3: Increment tx_dropped in tg3_tso_bug() + - kconfig: fix memory leak from range properties + - drm/amdgpu: correct chunk_ptr to a pointer to chunk. + - x86: Introduce ia32_enabled() + - x86/coco: Disable 32-bit emulation by default on TDX and SEV + - x86/entry: Convert INT 0x80 emulation to IDTENTRY + - x86/entry: Do not allow external 0x80 interrupts + - x86/tdx: Allow 32-bit emulation by default + - dt: dt-extract-compatibles: Handle cfile arguments in generator function + - dt: dt-extract-compatibles: Don't follow symlinks when walking tree + - platform/x86: asus-wmi: Move i8042 filter install to shared asus-wmi code + - of: dynamic: Fix of_reconfig_get_state_change() return value documentation + - platform/x86: wmi: Skip blocks with zero instances + - ipv6: fix potential NULL deref in fib6_add() + - octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam + - octeontx2-af: Check return value of nix_get_nixlf before using nixlf + - hv_netvsc: rndis_filter needs to select NLS + - r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE + - r8152: Add RTL8152_INACCESSIBLE checks to more loops + - r8152: Add RTL8152_INACCESSIBLE to r8156b_wait_loading_flash() + - r8152: Add RTL8152_INACCESSIBLE to r8153_pre_firmware_1() + - r8152: Add RTL8152_INACCESSIBLE to r8153_aldps_en() + - mlxbf-bootctl: correctly identify secure boot with development keys + - platform/mellanox: Add null pointer checks for devm_kasprintf() + - platform/mellanox: Check devm_hwmon_device_register_with_groups() return + value + - arcnet: restoring support for multiple Sohard Arcnet cards + - octeontx2-pf: consider both Rx and Tx packet stats for adaptive interrupt + coalescing + - net: stmmac: fix FPE events losing + - xsk: Skip polling event check for unbound socket + - octeontx2-af: fix a use-after-free in rvu_npa_register_reporters + - i40e: Fix unexpected MFS warning message + - iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero + - tcp: fix mid stream window clamp. + - ionic: fix snprintf format length warning + - ionic: Fix dim work handling in split interrupt mode + - ipv4: ip_gre: Avoid skb_pull() failure in ipgre_xmit() + - net: atlantic: Fix NULL dereference of skb pointer in + - net: hns: fix wrong head when modify the tx feature when sending packets + - net: hns: fix fake link up on xge port + - octeontx2-af: Adjust Tx credits when MCS external bypass is disabled + - octeontx2-af: Fix mcs sa cam entries size + - octeontx2-af: Fix mcs stats register address + - octeontx2-af: Add missing mcs flr handler call + - octeontx2-af: Update Tx link register range + - dt-bindings: interrupt-controller: Allow #power-domain-cells + - netfilter: nf_tables: fix 'exist' matching on bigendian arches + - netfilter: nf_tables: validate family when identifying table via handle + - netfilter: xt_owner: Fix for unsafe access of sk->sk_socket + - tcp: do not accept ACK of bytes we never sent + - bpf: sockmap, updating the sg structure should also update curr + - psample: Require 'CAP_NET_ADMIN' when joining "packets" group + - drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group + - mm/damon/sysfs: eliminate potential uninitialized variable warning + - tee: optee: Fix supplicant based device enumeration + - RDMA/hns: Fix unnecessary err return when using invalid congest control + algorithm + - RDMA/irdma: Do not modify to SQD on error + - RDMA/irdma: Add wait for suspend on SQD + - arm64: dts: rockchip: Expand reg size of vdec node for RK3328 + - arm64: dts: rockchip: Expand reg size of vdec node for RK3399 + - ASoC: fsl_sai: Fix no frame sync clock issue on i.MX8MP + - RDMA/rtrs-srv: Do not unconditionally enable irq + - RDMA/rtrs-clt: Start hb after path_up + - RDMA/rtrs-srv: Check return values while processing info request + - RDMA/rtrs-srv: Free srv_mr iu only when always_invalidate is true + - RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight + - RDMA/rtrs-clt: Fix the max_send_wr setting + - RDMA/rtrs-clt: Remove the warnings for req in_use check + - RDMA/bnxt_re: Correct module description string + - RDMA/irdma: Refactor error handling in create CQP + - RDMA/irdma: Fix UAF in irdma_sc_ccq_get_cqe_info() + - hwmon: (acpi_power_meter) Fix 4.29 MW bug + - ASoC: codecs: lpass-tx-macro: set active_decimator correct default value + - hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe() + - ASoC: wm_adsp: fix memleak in wm_adsp_buffer_populate + - RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz + - RDMA/irdma: Avoid free the non-cqp_request scratch + - drm/bridge: tc358768: select CONFIG_VIDEOMODE_HELPERS + - arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3 + - ARM: dts: imx6ul-pico: Describe the Ethernet PHY clock + - tracing: Fix a warning when allocating buffered events fails + - scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle() + - ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init + - ARM: dts: imx7: Declare timers compatible with fsl,imx6dl-gpt + - ARM: dts: imx28-xea: Pass the 'model' property + - riscv: fix misaligned access handling of C.SWSP and C.SDSP + - md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly() + - rethook: Use __rcu pointer for rethook::handler + - kprobes: consistent rcu api usage for kretprobe holder + - ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA + - nvme-pci: Add sleep quirk for Kingston drives + - io_uring: fix mutex_unlock with unreferenced ctx + - ALSA: usb-audio: Add Pioneer DJM-450 mixer controls + - ALSA: pcm: fix out-of-bounds in snd_pcm_state_names + - ALSA: hda/realtek: add new Framework laptop to quirks + - ALSA: hda/realtek: Add Framework laptop 16 to quirks + - ring-buffer: Test last update in 32bit version of __rb_time_read() + - nilfs2: fix missing error check for sb_set_blocksize call + - nilfs2: prevent WARNING in nilfs_sufile_set_segment_usage() + - cgroup_freezer: cgroup_freezing: Check if not frozen + - checkstack: fix printed address + - tracing: Always update snapshot buffer size + - tracing: Disable snapshot buffer when stopping instance tracers + - tracing: Fix incomplete locking when disabling buffered events + - tracing: Fix a possible race when disabling buffered events + - packet: Move reference count in packet_sock to atomic_long_t + - r8169: fix rtl8125b PAUSE frames blasting when suspended + - regmap: fix bogus error on regcache_sync success + - platform/surface: aggregator: fix recv_buf() return value + - hugetlb: fix null-ptr-deref in hugetlb_vma_lock_write + - mm: fix oops when filemap_map_pmd() without prealloc_pte + - powercap: DTPM: Fix missing cpufreq_cpu_put() calls + - md/raid6: use valid sector values to determine if an I/O should wait on the + reshape + - arm64: dts: mediatek: mt7622: fix memory node warning check + - arm64: dts: mediatek: mt8183-kukui-jacuzzi: fix dsi unnecessary cells + properties + - arm64: dts: mediatek: cherry: Fix interrupt cells for MT6360 on I2C7 + - arm64: dts: mediatek: mt8173-evb: Fix regulator-fixed node names + - arm64: dts: mediatek: mt8195: Fix PM suspend/resume with venc clocks + - arm64: dts: mediatek: mt8183: Fix unit address for scp reserved memory + - arm64: dts: mediatek: mt8183: Move thermal-zones to the root node + - arm64: dts: mediatek: mt8183-evb: Fix unit_address_vs_reg warning on ntc + - coresight: etm4x: Remove bogous __exit annotation for some functions + - hwtracing: hisi_ptt: Add dummy callback pmu::read() + - misc: mei: client.c: return negative error code in mei_cl_write + - misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write + - LoongArch: BPF: Don't sign extend memory load operand + - LoongArch: BPF: Don't sign extend function return value + - ring-buffer: Force absolute timestamp on discard of event + - tracing: Set actual size after ring buffer resize + - tracing: Stop current tracer when resizing buffer + - parisc: Reduce size of the bug_table on 64-bit kernel by half + - parisc: Fix asm operand number out of range build error in bug table + - arm64: dts: mediatek: add missing space before { + - arm64: dts: mt8183: kukui: Fix underscores in node names + - x86/sev: Fix kernel crash due to late update to read-only ghcb_version + - gpiolib: sysfs: Fix error handling on failed export + - drm/amd/amdgpu: Fix warnings in amdgpu/amdgpu_display.c + - drm/amdgpu: Add I2C EEPROM support on smu v13_0_6 + - usb: gadget: f_hid: fix report descriptor allocation + - serial: 8250_dw: Add ACPI ID for Granite Rapids-D UART + - parport: Add support for Brainboxes IX/UC/PX parallel cards + - cifs: Fix non-availability of dedup breaking generic/304 + - Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1" + - smb: client: fix potential NULL deref in parse_dfs_referrals() + - ARM: PL011: Fix DMA support + - serial: sc16is7xx: address RX timeout interrupt errata + - serial: 8250: 8250_omap: Clear UART_HAS_RHR_IT_DIS bit + - serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt + - serial: 8250_omap: Add earlycon support for the AM654 UART controller + - devcoredump: Send uevent once devcd is ready + - x86/CPU/AMD: Check vendor in the AMD microcode callback + - USB: gadget: core: adjust uevent timing on gadget unbind + - cifs: Fix flushing, invalidation and file size with copy_file_range() + - cifs: Fix flushing, invalidation and file size with FICLONE + - MIPS: kernel: Clear FPU states when setting up kernel threads + - KVM: s390/mm: Properly reset no-dat + - KVM: SVM: Update EFER software model on CR0 trap for SEV-ES + - MIPS: Loongson64: Reserve vgabios memory on boot + - MIPS: Loongson64: Handle more memory types passed from firmware + - MIPS: Loongson64: Enable DMA noncoherent support + - riscv: Kconfig: Add select ARM_AMBA to SOC_STARFIVE + - [Config] updateconfigs after enabling ARM_AMBA on riscv + - scsi: sd: Fix sshdr use in sd_suspend_common() + - nouveau: use an rwlock for the event lock. + - modpost: fix section mismatch message for RELA + - drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2) + - drm/amdgpu: finalizing mem_partitions at the end of GMC v9 sw_fini + - dm-crypt: start allocating with MAX_ORDER + - r8152: Hold the rtnl_lock for all of reset + - net: dsa: microchip: provide a list of valid protocols for xmit handler + - net/smc: fix missing byte order conversion in CLC handshake + - RDMA/core: Fix uninit-value access in ib_get_eth_speed() + - ARM: dts: imx6q: skov: fix ethernet clock regression + - ARM: dts: rockchip: Fix sdmmc_pwren's pinmux setting for RK3128 + - ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act + - firmware: arm_scmi: Extend perf protocol ops to get number of domains + - firmware: arm_scmi: Extend perf protocol ops to get information of a domain + - firmware: arm_scmi: Fix frequency truncation by promoting multiplier type + - firmware: arm_scmi: Simplify error path in scmi_dvfs_device_opps_add() + - RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned + - RDMA/irdma: Fix support for 64k pages + - io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring() + - io_uring/kbuf: check for buffer list readiness after NULL check + - arm64: dts: imx8-ss-lsio: Add PWM interrupts + - arm64: dts: freescale: imx8-ss-lsio: Fix #pwm-cells + - arm64: dts: imx93: correct mediamix power + - arm64: dts: imx8-apalis: set wifi regulator to always-on + - arm64: dts: rockchip: Fix eMMC Data Strobe PD on rk3588 + - scripts/gdb: fix lx-device-list-bus and lx-device-list-class + - ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA + - ALSA: hda/realtek: Apply quirk for ASUS UM3504DA + - ALSA: hda/realtek: fix speakers on XPS 9530 (2023) + - ALSA: hda/realtek: Add quirk for Lenovo Yoga Pro 7 + - lib/group_cpus.c: avoid acquiring cpu hotplug lock in group_cpus_evenly + - leds: trigger: netdev: fix RTNL handling to prevent potential deadlock + - nfp: flower: fix for take a mutex lock in soft irq context and rcu lock + - workqueue: Make sure that wq_unbound_cpumask is never empty + - drivers/base/cpu: crash data showing should depends on KEXEC_CORE + - mm/memory_hotplug: add missing mem_hotplug_lock + - mm/memory_hotplug: fix error handling in add_memory_resource() + - drm/atomic-helpers: Invoke end_fb_access while owning plane state + - drm/i915/mst: Fix .mode_valid_ctx() return values + - drm/i915/mst: Reject modes that require the bigjoiner + - arm64: dts: mt7986: change cooling trips + - arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3 + - arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization + - arm64: dts: mediatek: mt8186: fix clock names for power domains + - arm64: dts: mediatek: mt8186: Change gpu speedbin nvmem cell name + - coresight: Fix crash when Perf and sysfs modes are used concurrently + - coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb + - coresight: ultrasoc-smb: Config SMB buffer before register sink + - coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base + - ASoC: ops: add correct range check for limiting volume + - nvmem: Do not expect fixed layouts to grab a layout driver + - serial: ma35d1: Validate console index before assignment + - powerpc/ftrace: Fix stack teardown in ftrace_no_trace + - perf metrics: Avoid segv if default metricgroup isn't set + - ASoC: qcom: sc8280xp: Limit speaker digital volumes + - gcc-plugins: randstruct: Update code comment in relayout_struct() + - drm/amdgpu: Fix refclk reporting for SMU v13.0.6 + - drm/amdgpu: Add bootloader status check + - drm/amdgpu: Add bootloader wait for PSP v13 + - drm/amdgpu: Restrict bootloader wait to SMUv13.0.6 + - drm/amdgpu: update retry times for psp vmbx wait + - drm/amdgpu: update retry times for psp BL wait + - drm/amdgpu: Restrict extended wait to PSP v13.0.6 + - Upstream stable to v6.1.68, v6.6.7 + * i915 regression introduced with 5.5 kernel (LP: #2044131) + - drm/i915: Skip some timing checks on BXT/GLK DSI transcoders + * Mantic update: upstream stable patchset 2024-01-26 (LP: #2051366) + - cifs: Fix FALLOC_FL_ZERO_RANGE by setting i_size if EOF moved + - cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF moved + - smb: client: report correct st_size for SMB and NFS symlinks + - pinctrl: avoid reload of p state in list iteration + - firewire: core: fix possible memory leak in create_units() + - mmc: sdhci-pci-gli: Disable LPM during initialization + - mmc: cqhci: Increase recovery halt timeout + - mmc: cqhci: Warn of halt or task clear failure + - mmc: cqhci: Fix task clearing in CQE error recovery + - mmc: block: Retry commands in CQE error recovery + - mmc: block: Do not lose cache flush during CQE error recovery + - mmc: block: Be sure to wait while busy in CQE error recovery + - ALSA: hda: Disable power-save on KONTRON SinglePC + - ALSA: hda/realtek: Headset Mic VREF to 100% + - ALSA: hda/realtek: Add supported ALC257 for ChromeOS + - dm-verity: align struct dm_verity_fec_io properly + - scsi: Change SCSI device boolean fields to single bit flags + - scsi: sd: Fix system start for ATA devices + - drm/amd: Enable PCIe PME from D3 + - drm/amdgpu: Force order between a read and write to the same address + - drm/amd/display: Include udelay when waiting for INBOX0 ACK + - drm/amd/display: Remove min_dst_y_next_start check for Z8 + - drm/amd/display: Use DRAM speed from validation for dummy p-state + - drm/amd/display: Update min Z8 residency time to 2100 for DCN314 + - drm/amd/display: fix ABM disablement + - dm verity: initialize fec io before freeing it + - dm verity: don't perform FEC for failed readahead IO + - nvme: check for valid nvme_identify_ns() before using it + - powercap: DTPM: Fix unneeded conversions to micro-Watts + - cpufreq/amd-pstate: Fix the return value of amd_pstate_fast_switch() + - dma-buf: fix check in dma_resv_add_fence + - bcache: revert replacing IS_ERR_OR_NULL with IS_ERR + - iommu/vt-d: Add MTL to quirk list to skip TE disabling + - KVM: PPC: Book3S HV: Fix KVM_RUN clobbering FP/VEC user registers + - powerpc: Don't clobber f0/vs0 during fp|altivec register save + - parisc: Mark ex_table entries 32-bit aligned in assembly.h + - parisc: Mark ex_table entries 32-bit aligned in uaccess.h + - parisc: Use natural CPU alignment for bug_table + - parisc: Mark lock_aligned variables 16-byte aligned on SMP + - parisc: Drop the HP-UX ENOSYM and EREMOTERELEASE error codes + - parisc: Mark jump_table naturally aligned + - parisc: Ensure 32-bit alignment on parisc unwind section + - parisc: Mark altinstructions read-only and 32-bit aligned + - btrfs: add dmesg output for first mount and last unmount of a filesystem + - btrfs: ref-verify: fix memory leaks in btrfs_ref_tree_mod() + - btrfs: fix off-by-one when checking chunk map includes logical address + - btrfs: send: ensure send_fd is writable + - btrfs: make error messages more clear when getting a chunk map + - btrfs: fix 64bit compat send ioctl arguments not initializing version member + - auxdisplay: hd44780: move cursor home after clear display command + - serial: sc16is7xx: Put IOControl register into regmap_volatile + - serial: sc16is7xx: add missing support for rs485 devicetree properties + - dpaa2-eth: increase the needed headroom to account for alignment + - uapi: propagate __struct_group() attributes to the container union + - selftests/net: ipsec: fix constant out of range + - selftests/net: fix a char signedness issue + - selftests/net: unix: fix unused variable compiler warning + - selftests/net: mptcp: fix uninitialized variable warnings + - octeontx2-af: Fix possible buffer overflow + - net: stmmac: xgmac: Disable FPE MMC interrupts + - octeontx2-pf: Fix adding mbox work queue entry when num_vfs > 64 + - octeontx2-af: Install TC filter rules in hardware based on priority + - octeontx2-pf: Restore TC ingress police rules when interface is up + - r8169: prevent potential deadlock in rtl8169_close + - ravb: Fix races between ravb_tx_timeout_work() and net related ops + - net: ravb: Check return value of reset_control_deassert() + - net: ravb: Use pm_runtime_resume_and_get() + - net: ravb: Make write access to CXR35 first before accessing other EMAC + registers + - net: ravb: Start TX queues after HW initialization succeeded + - net: ravb: Stop DMA in case of failures on ravb_open() + - net: ravb: Keep reverse order of operations in ravb_remove() + - octeontx2-af: Initialize 'cntr_val' to fix uninitialized symbol error + - spi: Fix null dereference on suspend + - cpufreq: imx6q: Don't disable 792 Mhz OPP unnecessarily + - iommu/vt-d: Omit devTLB invalidation requests when TES=0 + - iommu/vt-d: Disable PCI ATS in legacy passthrough mode + - iommu/vt-d: Make context clearing consistent with context mapping + - drm/amd/pm: fix a memleak in aldebaran_tables_init + - mmc: sdhci-sprd: Fix vqmmc not shutting down after the card was pulled + - drm/amd/display: Fix MPCC 1DLUT programming + - r8169: fix deadlock on RTL8125 in jumbo mtu mode + - xen: simplify evtchn_do_upcall() call maze + - x86/xen: fix percpu vcpu_info allocation + - smb: client: fix missing mode bits for SMB symlinks + - ksmbd: fix possible deadlock in smb2_open + - drm/i915: Also check for VGA converter in eDP probe + - net: libwx: fix memory leak on msix entry + - drm/amdgpu: correct the amdgpu runtime dereference usage count + - drm/amdgpu: fix memory overflow in the IB test + - drm/amdgpu: Update EEPROM I2C address for smu v13_0_0 + - drm/amd/display: force toggle rate wa for first link training for a retimer + - ACPI: video: Use acpi_video_device for cooling-dev driver data + - iommu/vt-d: Fix incorrect cache invalidation for mm notification + - io_uring: free io_buffer_list entries via RCU + - io_uring: don't guard IORING_OFF_PBUF_RING with SETUP_NO_MMAP + - iommu: Avoid more races around device probe + - ext2: Fix ki_pos update for DIO buffered-io fallback case + - btrfs: free the allocated memory if btrfs_alloc_page_array() fails + - io_uring/kbuf: recycle freed mapped buffer ring entries + - media: v4l2-subdev: Fix a 64bit bug + - netdevsim: Don't accept device bound programs + - net: rswitch: Fix type of ret in rswitch_start_xmit() + - net: rswitch: Fix return value in rswitch_start_xmit() + - net: rswitch: Fix missing dev_kfree_skb_any() in error path + - wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta() + - wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during flush + - net: dsa: mv88e6xxx: fix marvell 6350 switch probing + - dpaa2-eth: recycle the RX buffer only after all processing done + - bpf: Add missed allocation hint for bpf_mem_cache_alloc_flags() + - neighbour: Fix __randomize_layout crash in struct neighbour + - efi/unaccepted: Fix off-by-one when checking for overlapping ranges + - ethtool: don't propagate EOPNOTSUPP from dumps + - bpf, sockmap: af_unix stream sockets need to hold ref for pair sock + - powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR- + IOV device + - s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir + - drm/amd/display: Refactor edp power control + - drm/amd/display: Remove power sequencing check + - drm/i915/gsc: Mark internal GSC engine with reserved uabi class + - drm/panel: starry-2081101qfh032011-53g: Fine tune the panel power sequence + - drm/panel: nt36523: fix return value check in nt36523_probe() + - cpufreq/amd-pstate: Fix scaling_min_freq and scaling_max_freq update + - cpufreq/amd-pstate: Only print supported EPP values for performance governor + - iommu: Fix printk arg in of_iommu_get_resv_regions() + - drm/amd/display: refactor ILR to make it work + - drm/amd/display: Reduce default backlight min from 5 nits to 1 nits + - Upstream stable to v6.1.66, v6.6.5 + * Mantic update: upstream stable patchset 2024-01-25 (LP: #2051231) + - afs: Fix afs_server_list to be cleaned up with RCU + - afs: Make error on cell lookup failure consistent with OpenAFS + - drm/panel: auo,b101uan08.3: Fine tune the panel power sequence + - drm/panel: simple: Fix Innolux G101ICE-L01 bus flags + - drm/panel: simple: Fix Innolux G101ICE-L01 timings + - wireguard: use DEV_STATS_INC() + - octeontx2-pf: Fix memory leak during interface down + - ata: pata_isapnp: Add missing error check for devm_ioport_map() + - drm/i915: do not clean GT table on error path + - drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full + - HID: fix HID device resource race between HID core and debugging support + - ipv4: Correct/silence an endian warning in __ip_do_redirect + - net: usb: ax88179_178a: fix failed operations during ax88179_reset + - net/smc: avoid data corruption caused by decline + - arm/xen: fix xen_vcpu_info allocation alignment + - octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx + queue than its PF + - amd-xgbe: handle corner-case during sfp hotplug + - amd-xgbe: handle the corner-case during tx completion + - amd-xgbe: propagate the correct speed and duplex status + - net: axienet: Fix check for partial TX checksum + - afs: Return ENOENT if no cell DNS record can be found + - afs: Fix file locking on R/O volumes to operate in local mode + - arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y + - i40e: Fix adding unsupported cloud filters + - nvmet: nul-terminate the NQNs passed in the connect command + - USB: dwc3: qcom: fix resource leaks on probe deferral + - USB: dwc3: qcom: fix ACPI platform device leak + - lockdep: Fix block chain corruption + - cifs: distribute channels across interfaces based on speed + - cifs: account for primary channel in the interface list + - cifs: fix leak of iface for primary channel + - MIPS: KVM: Fix a build warning about variable set but not used + - media: qcom: Initialise V4L2 async notifier later + - media: qcom: camss: Fix V4L2 async notifier error path + - media: qcom: camss: Fix genpd cleanup + - NFSD: Fix "start of NFS reply" pointer passed to nfsd_cache_update() + - NFSD: Fix checksum mismatches in the duplicate reply cache + - ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA + - swiotlb-xen: provide the "max_mapping_size" method + - bcache: replace a mistaken IS_ERR() by IS_ERR_OR_NULL() in + btree_gc_coalesce() + - md: fix bi_status reporting in md_end_clone_io + - bcache: fixup multi-threaded bch_sectors_dirty_init() wake-up race + - io_uring/fs: consider link->flags when getting path for LINKAT + - s390/dasd: protect device queue against concurrent access + - USB: serial: option: add Luat Air72*U series products + - hv_netvsc: fix race of netvsc and VF register_netdevice + - hv_netvsc: Fix race of register_netdevice_notifier and VF register + - hv_netvsc: Mark VF as slave before exposing it to user-mode + - dm-delay: fix a race between delay_presuspend and delay_bio + - bcache: check return value from btree_node_alloc_replacement() + - bcache: prevent potential division by zero error + - bcache: fixup init dirty data errors + - bcache: fixup lock c->root error + - usb: cdnsp: Fix deadlock issue during using NCM gadget + - USB: serial: option: add Fibocom L7xx modules + - USB: serial: option: fix FM101R-GL defines + - USB: serial: option: don't claim interface 4 for ZTE MF290 + - usb: typec: tcpm: Skip hard reset when in error recovery + - USB: dwc2: write HCINT with INTMASK applied + - usb: dwc3: Fix default mode initialization + - usb: dwc3: set the dma max_seg_size + - USB: dwc3: qcom: fix software node leak on probe errors + - USB: dwc3: qcom: fix wakeup after probe deferral + - io_uring: fix off-by one bvec index + - irqchip/gic-v3-its: Flush ITS tables correctly in non-coherent GIC designs + - drm/msm/dsi: use the correct VREG_CTRL_1 value for 4nm cphy + - s390/ism: ism driver implies smc protocol + - rxrpc: Fix RTT determination to use any ACK as a source + - rxrpc: Defer the response to a PING ACK until we've parsed it + - blk-cgroup: avoid to warn !rcu_read_lock_held() in blkg_lookup() + - fs: Pass AT_GETATTR_NOSEC flag to getattr interface function + - net: wangxun: fix kernel panic due to null pointer + - filemap: add a per-mapping stable writes flag + - block: update the stable_writes flag in bdev_add + - PM: tools: Fix sleepgraph syntax error + - net, vrf: Move dstats structure to core + - net: Move {l,t,d}stats allocation to core and convert veth & vrf + - bpf: Fix dev's rx stats for bpf_redirect_peer traffic + - drm/panel: boe-tv101wum-nl6: Fine tune Himax83102-j02 panel HFP and HBP + - s390/ipl: add missing IPL_TYPE_ECKD_DUMP case to ipl_init() + - net: veth: fix ethtool stats reporting + - vsock/test: fix SEQPACKET message bounds test + - net: ipa: fix one GSI register field width + - nvme: blank out authentication fabrics options if not configured + - mm: add a NO_INHERIT flag to the PR_SET_MDWE prctl + - prctl: Disable prctl(PR_SET_MDWE) on parisc + - kselftest/arm64: Fix output formatting for za-fork + - drm/msm/dpu: Add missing safe_lut_tbl in sc8280xp catalog + - drm/ast: Disconnect BMC if physical connector is connected + - thunderbolt: Set lane bonding bit only for downstream port + - ACPI: video: Use acpi_device_fix_up_power_children() + - ACPI: processor_idle: use raw_safe_halt() in acpi_idle_play_dead() + - ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA + - ACPI: PM: Add acpi_device_fix_up_power_children() function + - tls: fix NULL deref on tls_sw_splice_eof() with empty record + - dt-bindings: usb: microchip,usb5744: Add second supply + - usb: misc: onboard-hub: add support for Microchip USB5744 + - platform/x86/amd/pmc: adjust getting DRAM size behavior + - ALSA: hda: ASUS UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus + - ALSA: hda/realtek: Add quirks for ASUS 2024 Zenbooks + - veth: Use tstats per-CPU traffic counters + - USB: xhci-plat: fix legacy PHY double init + - usb: config: fix iteration issue in 'usb_get_bos_descriptor()' + - Upstream stable to v6.1.65, v6.6.4 + * Mantic update: v6.5.13 upstream stable release (LP: #2051142) + - locking/ww_mutex/test: Fix potential workqueue corruption + - btrfs: abort transaction on generation mismatch when marking eb as dirty + - lib/generic-radix-tree.c: Don't overflow in peek() + - x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN + - perf/core: Bail out early if the request AUX area is out of bound + - srcu: Fix srcu_struct node grpmask overflow on 64-bit systems + - selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config + - clocksource/drivers/timer-imx-gpt: Fix potential memory leak + - clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware + - srcu: Only accelerate on enqueue time + - smp,csd: Throw an error if a CSD lock is stuck for too long + - cpu/hotplug: Don't offline the last non-isolated CPU + - workqueue: Provide one lock class key per work_on_cpu() callsite + - x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size + - wifi: plfxlc: fix clang-specific fortify warning + - wifi: ath12k: Ignore fragments from uninitialized peer in dp + - wifi: mac80211_hwsim: fix clang-specific fortify warning + - wifi: mac80211: don't return unset power in ieee80211_get_tx_power() + - atl1c: Work around the DMA RX overflow issue + - bpf: Detect IP == ksym.end as part of BPF program + - wifi: ath9k: fix clang-specific fortify warnings + - wifi: ath12k: fix possible out-of-bound read in ath12k_htt_pull_ppdu_stats() + - wifi: ath10k: fix clang-specific fortify warning + - wifi: ath12k: fix possible out-of-bound write in + ath12k_wmi_ext_hal_reg_caps() + - ACPI: APEI: Fix AER info corruption when error status data has multiple + sections + - net: sfp: add quirk for Fiberstone GPON-ONU-34-20BI + - wifi: mt76: mt7921e: Support MT7992 IP in Xiaomi Redmibook 15 Pro (2023) + - net: annotate data-races around sk->sk_tx_queue_mapping + - net: annotate data-races around sk->sk_dst_pending_confirm + - wifi: ath12k: mhi: fix potential memory leak in ath12k_mhi_register() + - wifi: ath10k: Don't touch the CE interrupt registers after power up + - net: sfp: add quirk for FS's 2.5G copper SFP + - vsock: read from socket's error queue + - bpf: Ensure proper register state printing for cond jumps + - wifi: iwlwifi: mvm: fix size check for fw_link_id + - Bluetooth: btusb: Add date->evt_skb is NULL check + - Bluetooth: Fix double free in hci_conn_cleanup + - ACPI: EC: Add quirk for HP 250 G7 Notebook PC + - tsnep: Fix tsnep_request_irq() format-overflow warning + - gpiolib: acpi: Add a ignore interrupt quirk for Peaq C1010 + - platform/chrome: kunit: initialize lock for fake ec_dev + - of: address: Fix address translation when address-size is greater than 2 + - platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e + - drm/gma500: Fix call trace when psb_gem_mm_init() fails + - drm/amdkfd: ratelimited SQ interrupt messages + - drm/komeda: drop all currently held locks if deadlock happens + - drm/amd/display: Blank phantom OTG before enabling + - drm/amd/display: Don't lock phantom pipe on disabling + - drm/amd/display: add seamless pipe topology transition check + - drm/edid: Fixup h/vsync_end instead of h/vtotal + - md: don't rely on 'mddev->pers' to be set in mddev_suspend() + - drm/amdgpu: not to save bo in the case of RAS err_event_athub + - drm/amdkfd: Fix a race condition of vram buffer unref in svm code + - drm/amd: Update `update_pcie_parameters` functions to use uint8_t arguments + - drm/amd/display: use full update for clip size increase of large plane + source + - string.h: add array-wrappers for (v)memdup_user() + - kernel: kexec: copy user-array safely + - kernel: watch_queue: copy user-array safely + - drm_lease.c: copy user-array safely + - drm: vmwgfx_surface.c: copy user-array safely + - drm/msm/dp: skip validity check for DP CTS EDID checksum + - drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 + - drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga + - drm/amdgpu: Fix potential null pointer derefernce + - drm/panel: fix a possible null pointer dereference + - drm/panel/panel-tpo-tpg110: fix a possible null pointer dereference + - drm/radeon: fix a possible null pointer dereference + - drm/amdgpu/vkms: fix a possible null pointer dereference + - drm/panel: st7703: Pick different reset sequence + - drm/amdkfd: Fix shift out-of-bounds issue + - drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL + - drm/amd: Disable PP_PCIE_DPM_MASK when dynamic speed switching not supported + - drm/amd/display: fix num_ways overflow error + - drm/amd: check num of link levels when update pcie param + - arm64: dts: ls208xa: use a pseudo-bus to constrain usb dma size + - selftests/efivarfs: create-read: fix a resource leak + - ASoC: mediatek: mt8188-mt6359: support dynamic pinctrl + - ASoC: soc-card: Add storage for PCI SSID + - ASoC: SOF: Pass PCI SSID to machine driver + - crypto: pcrypt - Fix hungtask for PADATA_RESET + - ASoC: SOF: ipc4: handle EXCEPTION_CAUGHT notification from firmware + - RDMA/hfi1: Use FIELD_GET() to extract Link Width + - scsi: hisi_sas: Set debugfs_dir pointer to NULL after removing debugfs + - scsi: ibmvfc: Remove BUG_ON in the case of an empty event pool + - fs/jfs: Add check for negative db_l2nbperpage + - fs/jfs: Add validity check for db_maxag and db_agpref + - jfs: fix array-index-out-of-bounds in dbFindLeaf + - jfs: fix array-index-out-of-bounds in diAlloc + - HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround + - ARM: 9320/1: fix stack depot IRQ stack filter + - ALSA: hda: Fix possible null-ptr-deref when assigning a stream + - gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound + - PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields + - PCI: mvebu: Use FIELD_PREP() with Link Width + - atm: iphase: Do PCI error checks on own line + - PCI: Do error check on own line to split long "if" conditions + - scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup() + - PCI: Use FIELD_GET() to extract Link Width + - PCI: Extract ATS disabling to a helper function + - PCI: Disable ATS for specific Intel IPU E2000 devices + - PCI: dwc: Add dw_pcie_link_set_max_link_width() + - PCI: dwc: Add missing PCI_EXP_LNKCAP_MLW handling + - misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller + - PCI: Use FIELD_GET() in Sapphire RX 5600 XT Pulse quirk + - ASoC: Intel: soc-acpi-cht: Add Lenovo Yoga Tab 3 Pro YT3-X90 quirk + - crypto: hisilicon/qm - prevent soft lockup in receive loop + - HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W + - exfat: support handle zero-size directory + - mfd: intel-lpss: Add Intel Lunar Lake-M PCI IDs + - iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe() + - thunderbolt: Apply USB 3.x bandwidth quirk only in software connection + manager + - tty: vcc: Add check for kstrdup() in vcc_probe() + - dt-bindings: phy: qcom,snps-eusb2-repeater: Add magic tuning overrides + - phy: qualcomm: phy-qcom-eusb2-repeater: Use regmap_fields + - phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs + - usb: dwc3: core: configure TX/RX threshold for DWC3_IP + - usb: ucsi: glink: use the connector orientation GPIO to provide switch + events + - soundwire: dmi-quirks: update HP Omen match + - f2fs: fix error path of __f2fs_build_free_nids + - f2fs: fix error handling of __get_node_page + - usb: host: xhci: Avoid XHCI resume delay if SSUSB device is not present + - usb: gadget: f_ncm: Always set current gadget in ncm_bind() + - 9p/trans_fd: Annotate data-racy writes to file::f_flags + - 9p: v9fs_listxattr: fix %s null argument warning + - i3c: mipi-i3c-hci: Fix out of bounds access in hci_dma_irq_handler + - i2c: i801: Add support for Intel Birch Stream SoC + - i2c: fix memleak in i2c_new_client_device() + - i2c: sun6i-p2wi: Prevent potential division by zero + - virtio-blk: fix implicit overflow on virtio_max_dma_size + - i3c: master: mipi-i3c-hci: Fix a kernel panic for accessing DAT_data. + - media: gspca: cpia1: shift-out-of-bounds in set_flicker + - media: vivid: avoid integer overflow + - media: ipu-bridge: increase sensor_name size + - gfs2: ignore negated quota changes + - gfs2: fix an oops in gfs2_permission + - media: cobalt: Use FIELD_GET() to extract Link Width + - media: ccs: Fix driver quirk struct documentation + - media: imon: fix access to invalid resource for the second interface + - drm/amd/display: Avoid NULL dereference of timing generator + - kgdb: Flush console before entering kgdb on panic + - riscv: VMAP_STACK overflow detection thread-safe + - i2c: dev: copy userspace array safely + - ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings + - drm/qxl: prevent memory leak + - ALSA: hda/realtek: Add quirk for ASUS UX7602ZM + - drm/amdgpu: fix software pci_unplug on some chips + - pwm: Fix double shift bug + - mtd: rawnand: tegra: add missing check for platform_get_irq() + - wifi: iwlwifi: Use FW rate for non-data frames + - sched/core: Optimize in_task() and in_interrupt() a bit + - samples/bpf: syscall_tp_user: Rename num_progs into nr_tests + - samples/bpf: syscall_tp_user: Fix array out-of-bound access + - dt-bindings: serial: fix regex pattern for matching serial node children + - SUNRPC: ECONNRESET might require a rebind + - mtd: rawnand: intel: check return value of devm_kasprintf() + - mtd: rawnand: meson: check return value of devm_kasprintf() + - drm/i915/mtl: avoid stringop-overflow warning + - NFSv4.1: fix handling NFS4ERR_DELAY when testing for session trunking + - SUNRPC: Add an IS_ERR() check back to where it was + - NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO + - SUNRPC: Fix RPC client cleaned up the freed pipefs dentries + - RISC-V: hwprobe: Fix vDSO SIGSEGV + - riscv: provide riscv-specific is_trap_insn() + - gfs2: Silence "suspicious RCU usage in gfs2_permission" warning + - drm/i915/tc: Fix -Wformat-truncation in intel_tc_port_init + - vdpa_sim_blk: allocate the buffer zeroed + - vhost-vdpa: fix use after free in vhost_vdpa_probe() + - gcc-plugins: randstruct: Only warn about true flexible arrays + - bpf: handle ldimm64 properly in check_cfg() + - bpf: fix precision backtracking instruction iteration + - net: set SOCK_RCU_FREE before inserting socket into hashtable + - ipvlan: add ipvlan_route_v6_outbound() helper + - tty: Fix uninit-value access in ppp_sync_receive() + - xen/events: avoid using info_for_irq() in xen_send_IPI_one() + - net: hns3: fix add VLAN fail issue + - net: hns3: add barrier in vf mailbox reply process + - net: hns3: fix incorrect capability bit display for copper port + - net: hns3: fix out-of-bounds access may occur when coalesce info is read via + debugfs + - net: hns3: fix variable may not initialized problem in hns3_init_mac_addr() + - net: hns3: fix VF reset fail issue + - net: hns3: fix VF wrong speed and duplex issue + - tipc: Fix kernel-infoleak due to uninitialized TLV value + - net: mvneta: fix calls to page_pool_get_stats + - ppp: limit MRU to 64K + - xen/events: fix delayed eoi list handling + - blk-mq: make sure active queue usage is held for bio_integrity_prep() + - ptp: annotate data-race around q->head and q->tail + - bonding: stop the device in bond_setup_by_slave() + - net: ethernet: cortina: Fix max RX frame define + - net: ethernet: cortina: Handle large frames + - net: ethernet: cortina: Fix MTU max setting + - af_unix: fix use-after-free in unix_stream_read_actor() + - netfilter: nf_conntrack_bridge: initialize err to 0 + - netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval() + - netfilter: nf_tables: bogus ENOENT when destroying element which does not + exist + - net: stmmac: fix rx budget limit check + - net: stmmac: avoid rx queue overrun + - pds_core: use correct index to mask irq + - pds_core: fix up some format-truncation complaints + - gve: Fixes for napi_poll when budget is 0 + - io_uring/fdinfo: remove need for sqpoll lock for thread/pid retrieval + - net/mlx5: Decouple PHC .adjtime and .adjphase implementations + - net/mlx5e: fix double free of encap_header + - net/mlx5e: fix double free of encap_header in update funcs + - net/mlx5e: Fix pedit endianness + - net/mlx5: Consolidate devlink documentation in devlink/mlx5.rst + - net/mlx5e: Make tx_port_ts logic resilient to out-of-order CQEs + - net/mlx5e: Add recovery flow for tx devlink health reporter for unhealthy + PTP SQ + - net/mlx5e: Update doorbell for port timestamping CQ before the software + counter + - net/mlx5: Increase size of irq name buffer + - net/mlx5e: Reduce the size of icosq_str + - net/mlx5e: Check return value of snprintf writing to fw_version buffer + - net/mlx5e: Check return value of snprintf writing to fw_version buffer for + representors + - net: sched: do not offload flows with a helper in act_ct + - macvlan: Don't propagate promisc change to lower dev in passthru + - tools/power/turbostat: Fix a knl bug + - tools/power/turbostat: Enable the C-state Pre-wake printing + - scsi: ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1 + - cifs: spnego: add ';' in HOST_KEY_LEN + - cifs: fix check of rc in function generate_smb3signingkey + - perf/core: Fix cpuctx refcounting + - i915/perf: Fix NULL deref bugs with drm_dbg() calls + - perf: arm_cspmu: Reject events meant for other PMUs + - drivers: perf: Check find_first_bit() return value + - media: venus: hfi: add checks to perform sanity on queue pointers + - perf intel-pt: Fix async branch flags + - powerpc/perf: Fix disabling BHRB and instruction sampling + - randstruct: Fix gcc-plugin performance mode to stay in group + - bpf: Fix check_stack_write_fixed_off() to correctly spill imm + - bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END + - scsi: mpt3sas: Fix loop logic + - scsi: megaraid_sas: Increase register read retry rount from 3 to 30 for + selected registers + - scsi: ufs: qcom: Update PHY settings only when scaling to higher gears + - scsi: qla2xxx: Fix system crash due to bad pointer access + - scsi: ufs: core: Fix racing issue between ufshcd_mcq_abort() and ISR + - crypto: x86/sha - load modules based on CPU features + - x86/PCI: Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 + - x86/apic/msi: Fix misconfigured non-maskable MSI quirk + - x86/cpu/hygon: Fix the CPU topology evaluation for real + - KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space + - KVM: x86: Ignore MSR_AMD64_TW_CFG access + - KVM: x86: Clear bit12 of ICR after APIC-write VM-exit + - KVM: x86: Fix lapic timer interrupt lost after loading a snapshot. + - mmc: sdhci-pci-gli: GL9755: Mask the replay timer timeout of AER + - sched: psi: fix unprivileged polling against cgroups + - audit: don't take task_lock() in audit_exe_compare() code path + - audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() + - proc: sysctl: prevent aliased sysctls from getting passed to init + - tty/sysrq: replace smp_processor_id() with get_cpu() + - tty: serial: meson: fix hard LOCKUP on crtscts mode + - hvc/xen: fix console unplug + - hvc/xen: fix error path in xen_hvc_init() to always register frontend driver + - hvc/xen: fix event channel handling for secondary consoles + - PCI/sysfs: Protect driver's D3cold preference from user space + - mm/damon/sysfs: remove requested targets when online-commit inputs + - mm/damon/sysfs: update monitoring target regions for online input commit + - watchdog: move softlockup_panic back to early_param + - iommufd: Fix missing update of domains_itree after splitting iopt_area + - fbdev: stifb: Make the STI next font pointer a 32-bit signed offset + - dm crypt: account large pages in cc->n_allocated_pages + - mm/damon/lru_sort: avoid divide-by-zero in hot threshold calculation + - mm/damon/ops-common: avoid divide-by-zero during region hotness calculation + - mm/damon: implement a function for max nr_accesses safe calculation + - mm/damon/core: avoid divide-by-zero during monitoring results update + - mm/damon/sysfs-schemes: handle tried region directory allocation failure + - mm/damon/sysfs-schemes: handle tried regions sysfs directory allocation + failure + - mm/damon/sysfs: check error from damon_sysfs_update_target() + - parisc: Add nop instructions after TLB inserts + - ACPI: resource: Do IRQ override on TongFang GMxXGxx + - regmap: Ensure range selector registers are updated after cache sync + - wifi: ath11k: fix temperature event locking + - wifi: ath11k: fix dfs radar event locking + - wifi: ath11k: fix htt pktlog locking + - wifi: ath11k: fix gtk offload status event locking + - wifi: ath12k: fix htt mlo-offset event locking + - wifi: ath12k: fix dfs-radar and temperature event locking + - mmc: meson-gx: Remove setting of CMD_CFG_ERROR + - genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware + - sched/core: Fix RQCF_ACT_SKIP leak + - KEYS: trusted: tee: Refactor register SHM usage + - KEYS: trusted: Rollback init_trusted() consistently + - PCI: keystone: Don't discard .remove() callback + - PCI: keystone: Don't discard .probe() callback + - arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer + - arm64: module: Fix PLT counting when CONFIG_RANDOMIZE_BASE=n + - parisc/agp: Use 64-bit LE values in SBA IOMMU PDIR table + - parisc/pdc: Add width field to struct pdc_model + - parisc/power: Add power soft-off when running on qemu + - cpufreq: stats: Fix buffer overflow detection in trans_stats() + - powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() + - clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data + - clk: visconti: Fix undefined behavior bug in struct visconti_pll_provider + - clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks + - clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks + - ksmbd: fix recursive locking in vfs helpers + - ksmbd: handle malformed smb1 message + - ksmbd: fix slab out of bounds write in smb_inherit_dacl() + - mmc: vub300: fix an error code + - mmc: sdhci_am654: fix start loop index for TAP value parsing + - mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A + - PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() + - PCI: kirin: Don't discard .remove() callback + - PCI: exynos: Don't discard .remove() callback + - wifi: wilc1000: use vmm_table as array in wilc struct + - svcrdma: Drop connection after an RDMA Read error + - rcu/tree: Defer setting of jiffies during stall reset + - arm64: dts: qcom: ipq6018: Fix hwlock index for SMEM + - dt-bindings: timer: renesas,rz-mtu3: Fix overflow/underflow interrupt names + - PM: hibernate: Use __get_safe_page() rather than touching the list + - PM: hibernate: Clean up sync_read handling in snapshot_write_next() + - rcu: kmemleak: Ignore kmemleak false positives when RCU-freeing objects + - btrfs: don't arbitrarily slow down delalloc if we're committing + - thermal: intel: powerclamp: fix mismatch in get function for max_idle + - arm64: dts: qcom: ipq5332: Fix hwlock index for SMEM + - arm64: dts: qcom: ipq8074: Fix hwlock index for SMEM + - firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit + - ACPI: FPDT: properly handle invalid FPDT subtables + - arm64: dts: qcom: ipq9574: Fix hwlock index for SMEM + - arm64: dts: qcom: ipq6018: Fix tcsr_mutex register size + - leds: trigger: netdev: Move size check in set_device_name + - mfd: qcom-spmi-pmic: Fix reference leaks in revid helper + - mfd: qcom-spmi-pmic: Fix revid implementation + - ima: annotate iint mutex to avoid lockdep false positive warnings + - ima: detect changes to the backing overlay file + - netfilter: nf_tables: split async and sync catchall in two functions + - ASoC: soc-dai: add flag to mute and unmute stream during trigger + - ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag + - selftests/resctrl: Fix uninitialized .sa_flags + - selftests/resctrl: Remove duplicate feature check from CMT test + - selftests/resctrl: Move _GNU_SOURCE define into Makefile + - selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests + - hid: lenovo: Resend all settings on reset_resume for compact keyboards + - ASoC: codecs: wsa-macro: fix uninitialized stack variables with name prefix + - jbd2: fix potential data lost in recovering journal raced with synchronizing + fs bdev + - quota: explicitly forbid quota files from being encrypted + - kernel/reboot: emergency_restart: Set correct system_state + - i2c: core: Run atomic i2c xfer when !preemptible + - selftests/clone3: Fix broken test under !CONFIG_TIME_NS + - tracing: Have the user copy of synthetic event address use correct context + - driver core: Release all resources during unbind before updating device + links + - mcb: fix error handling for different scenarios when parsing + - dmaengine: stm32-mdma: correct desc prep when channel running + - s390/mm: add missing arch_set_page_dat() call to vmem_crst_alloc() + - s390/cmma: fix detection of DAT pages + - mm/cma: use nth_page() in place of direct struct page manipulation + - mm/memory_hotplug: use pfn math in place of direct struct page manipulation + - mm: make PR_MDWE_REFUSE_EXEC_GAIN an unsigned long + - mtd: cfi_cmdset_0001: Byte swap OTP info + - cxl/region: Do not try to cleanup after cxl_region_setup_targets() fails + - i3c: master: cdns: Fix reading status register + - i3c: master: svc: fix race condition in ibi work thread + - i3c: master: svc: fix wrong data return when IBI happen during start frame + - i3c: master: svc: fix ibi may not return mandatory data byte + - i3c: master: svc: fix check wrong status register in irq handler + - i3c: master: svc: fix SDA keep low when polling IBIWON timeout happen + - i3c: master: svc: fix random hot join failure since timeout error + - cxl/region: Fix x1 root-decoder granularity calculations + - cxl/port: Fix delete_endpoint() vs parent unregistration race + - pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable + - pmdomain: amlogic: Fix mask for the second NNA mem PD domain + - pmdomain: imx: Make imx pgc power domain also set the fwnode + - PCI: qcom-ep: Add dedicated callback for writing to DBI2 registers + - PCI: Lengthen reset delay for VideoPropulsion Torrent QN16e card + - torture: Add a kthread-creation callback to _torture_create_kthread() + - torture: Add lock_torture writer_fifo module parameter + - torture: Make torture_hrtimeout_*() use TASK_IDLE + - torture: Move stutter_wait() timeouts to hrtimers + - torture: Make torture_hrtimeout_ns() take an hrtimer mode parameter + - rcutorture: Fix stuttering races and other issues + - mm/hugetlb: prepare hugetlb_follow_page_mask() for FOLL_PIN + - mm/hugetlb: use nth_page() in place of direct struct page manipulation + - parisc: Prevent booting 64-bit kernels on PA1.x machines + - parisc/pgtable: Do not drop upper 5 address bits of physical address + - parisc/power: Fix power soft-off when running on qemu + - xhci: Enable RPM on controllers that support low-power states + - fs: add ctime accessors infrastructure + - smb3: fix creating FIFOs when mounting with "sfu" mount option + - smb3: fix touch -h of symlink + - smb3: allow dumping session and tcon id to improve stats analysis and + debugging + - smb3: fix caching of ctime on setxattr + - smb: client: fix use-after-free bug in cifs_debug_data_proc_show() + - smb: client: fix use-after-free in smb2_query_info_compound() + - smb: client: fix potential deadlock when releasing mids + - cifs: reconnect helper should set reconnect for the right channel + - cifs: force interface update before a fresh session setup + - cifs: do not reset chan_max if multichannel is not supported at mount + - cifs: Fix encryption of cleared, but unset rq_iter data buffers + - xfs: recovery should not clear di_flushiter unconditionally + - btrfs: zoned: wait for data BG to be finished on direct IO allocation + - ALSA: info: Fix potential deadlock at disconnection + - ALSA: hda/realtek: Enable Mute LED on HP 255 G8 + - ALSA: hda/realtek - Add Dell ALC295 to pin fall back table + - ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC + - ALSA: hda/realtek: Enable Mute LED on HP 255 G10 + - ALSA: hda/realtek: Add quirks for HP Laptops + - Revert ncsi: Propagate carrier gain/loss events to the NCSI controller + - Revert "i2c: pxa: move to generic GPIO recovery" + - lsm: fix default return value for vm_enough_memory + - lsm: fix default return value for inode_getsecctx + - sbsa_gwdt: Calculate timeout with 64-bit math + - i2c: designware: Disable TX_EMPTY irq while waiting for block length byte + - s390/ap: fix AP bus crash on early config change callback invocation + - net: ethtool: Fix documentation of ethtool_sprintf() + - net: dsa: lan9303: consequently nested-lock physical MDIO + - net: phylink: initialize carrier state at creation + - gfs2: don't withdraw if init_threads() got interrupted + - i2c: i801: fix potential race in i801_block_transaction_byte_by_byte + - f2fs: do not return EFSCORRUPTED, but try to run online repair + - f2fs: set the default compress_level on ioctl + - f2fs: avoid format-overflow warning + - f2fs: split initial and dynamic conditions for extent_cache + - media: lirc: drop trailing space from scancode transmit + - media: sharp: fix sharp encoding + - media: venus: hfi_parser: Add check to keep the number of codecs within + range + - media: venus: hfi: fix the check to handle session buffer requirement + - media: venus: hfi: add checks to handle capabilities from firmware + - media: ccs: Correctly initialise try compose rectangle + - drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection + - drm/mediatek/dp: fix memory leak on ->get_edid callback error path + - dm-bufio: fix no-sleep mode + - dm-verity: don't use blocking calls from tasklets + - nfsd: fix file memleak on client_opens_release + - NFSD: Update nfsd_cache_append() to use xdr_stream + - LoongArch: Mark __percpu functions as always inline + - riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause + - riscv: put interrupt entries into .irqentry.text + - riscv: mm: Update the comment of CONFIG_PAGE_OFFSET + - riscv: correct pt_level name via pgtable_l5/4_enabled + - riscv: kprobes: allow writing to x0 + - mmc: sdhci-pci-gli: A workaround to allow GL9750 to enter ASPM L1.2 + - mm: fix for negative counter: nr_file_hugepages + - mm: kmem: drop __GFP_NOFAIL when allocating objcg vectors + - mptcp: deal with large GSO size + - mptcp: add validity check for sending RM_ADDR + - mptcp: fix setsockopt(IP_TOS) subflow locking + - selftests: mptcp: fix fastclose with csum failure + - mmc: sdhci-pci-gli: GL9750: Mask the replay timer timeout of AER + - media: qcom: camss: Fix pm_domain_on sequence in probe + - media: qcom: camss: Fix vfe_get() error jump + - media: qcom: camss: Fix VFE-17x vfe_disable_output() + - media: qcom: camss: Fix VFE-480 vfe_disable_output() + - media: qcom: camss: Fix missing vfe_lite clocks check + - media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3 + - media: qcom: camss: Fix invalid clock enable bit disjunction + - media: qcom: camss: Fix csid-gen2 for test pattern generator + - ext4: fix race between writepages and remount + - ext4: make sure allocate pending entry not fail + - ext4: apply umask if ACL support is disabled + - ext4: correct offset of gdb backup in non meta_bg group to update_backups + - ext4: mark buffer new if it is unwritten to avoid stale data exposure + - ext4: correct return value of ext4_convert_meta_bg + - ext4: correct the start block of counting reserved clusters + - ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks + - ext4: add missed brelse in update_backups + - ext4: properly sync file size update after O_SYNC direct IO + - ext4: fix racy may inline data check in dio write + - drm/amd/pm: Handle non-terminated overdrive commands. + - drm: bridge: it66121: ->get_edid callback must not return err pointers + - drm/i915/mtl: Support HBR3 rate with C10 phy and eDP in MTL + - drm/i915: Bump GLK CDCLK frequency when driving multiple pipes + - drm/i915: Fix potential spectre vulnerability + - drm/i915: Flush WC GGTT only on required platforms + - drm/amdgpu/smu13: drop compute workload workaround + - drm/amdgpu: don't use pci_is_thunderbolt_attached() + - drm/amdgpu: fix GRBM read timeout when do mes_self_test + - drm/amdgpu: add a retry for IP discovery init + - drm/amdgpu: don't use ATRM for external devices + - drm/amdgpu: fix error handling in amdgpu_vm_init + - drm/amdgpu: fix error handling in amdgpu_bo_list_get() + - drm/amdgpu: lower CS errors to debug severity + - drm/amdgpu: Fix possible null pointer dereference + - drm/amd/display: Guard against invalid RPTR/WPTR being set + - drm/amd/display: Fix DSC not Enabled on Direct MST Sink + - drm/amd/display: fix a NULL pointer dereference in amdgpu_dm_i2c_xfer() + - drm/amd/display: Enable fast plane updates on DCN3.2 and above + - drm/amd/display: Change the DMCUB mailbox memory location from FB to inbox + - powerpc/powernv: Fix fortify source warnings in opal-prd.c + - tracing: Have trace_event_file have ref counters + - net/mlx5e: Avoid referencing skb after free-ing in drop path of + mlx5e_sq_xmit_wqe + - net/mlx5e: Track xmit submission to PTP WQ after populating metadata map + - Linux 6.5.13 + * Mantic update: v6.5.12 upstream stable release (LP: #2051129) + - hwmon: (nct6775) Fix incorrect variable reuse in fan_div calculation + - numa: Generalize numa_map_to_online_node() + - sched/topology: Fix sched_numa_find_nth_cpu() in CPU-less case + - sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case + - sched/fair: Fix cfs_rq_is_decayed() on !SMP + - iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user() + - sched/uclamp: Set max_spare_cap_cpu even if max_spare_cap is 0 + - sched/uclamp: Ignore (util == 0) optimization in feec() when p_util_max = 0 + - objtool: Propagate early errors + - sched: Fix stop_one_cpu_nowait() vs hotplug + - nfsd: Handle EOPENSTALE correctly in the filecache + - vfs: fix readahead(2) on block devices + - writeback, cgroup: switch inodes with dirty timestamps to release dying + cgwbs + - x86/srso: Fix SBPB enablement for (possible) future fixed HW + - x86/srso: Print mitigation for retbleed IBPB case + - x86/srso: Fix vulnerability reporting for missing microcode + - x86/srso: Fix unret validation dependencies + - futex: Don't include process MM in futex key on no-MMU + - x86/numa: Introduce numa_fill_memblks() + - ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window + - x86/sev-es: Allow copy_from_kernel_nofault() in earlier boot + - x86/boot: Fix incorrect startup_gdt_descr.size + - cpu/hotplug: Remove dependancy against cpu_primary_thread_mask + - cpu/SMT: Create topology_smt_thread_allowed() + - cpu/SMT: Make SMT control more robust against enumeration failures + - x86/apic: Fake primary thread mask for XEN/PV + - srcu: Fix callbacks acceleration mishandling + - drivers/clocksource/timer-ti-dm: Don't call clk_get_rate() in stop function + - x86/nmi: Fix out-of-order NMI nesting checks & false positive warning + - pstore/platform: Add check for kstrdup + - perf: Optimize perf_cgroup_switch() + - selftests/x86/lam: Zero out buffer for readlink() + - PCI/MSI: Provide stubs for IMS functions + - string: Adjust strtomem() logic to allow for smaller sources + - genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() + - irqchip/sifive-plic: Fix syscore registration for multi-socket systems + - wifi: ath12k: fix undefined behavior with __fls in dp + - wifi: cfg80211: add flush functions for wiphy work + - wifi: mac80211: move radar detect work to wiphy work + - wifi: mac80211: move scan work to wiphy work + - wifi: mac80211: move offchannel works to wiphy work + - wifi: mac80211: move sched-scan stop work to wiphy work + - wifi: mac80211: fix RCU usage warning in mesh fast-xmit + - wifi: cfg80211: fix off-by-one in element defrag + - wifi: mac80211: fix # of MSDU in A-MSDU calculation + - wifi: iwlwifi: honor the enable_ini value + - wifi: iwlwifi: don't use an uninitialized variable + - i40e: fix potential memory leaks in i40e_remove() + - iavf: Fix promiscuous mode configuration flow messages + - selftests/bpf: Correct map_fd to data_fd in tailcalls + - bpf, x86: save/restore regs with BPF_DW size + - bpf, x86: allow function arguments up to 12 for TRACING + - bpf, x64: Fix tailcall infinite loop + - wifi: cfg80211: fix kernel-doc for wiphy_delayed_work_flush() + - udp: introduce udp->udp_flags + - udp: move udp->no_check6_tx to udp->udp_flags + - udp: move udp->no_check6_rx to udp->udp_flags + - udp: move udp->gro_enabled to udp->udp_flags + - udp: add missing WRITE_ONCE() around up->encap_rcv + - udp: move udp->accept_udp_{l4|fraglist} to udp->udp_flags + - udp: lockless UDP_ENCAP_L2TPINUDP / UDP_GRO + - udp: annotate data-races around udp->encap_type + - udplite: remove UDPLITE_BIT + - udplite: fix various data-races + - selftests/bpf: Skip module_fentry_shadow test when bpf_testmod is not + available + - tcp: call tcp_try_undo_recovery when an RTOd TFO SYNACK is ACKed + - bpf: Fix kfunc callback register type handling + - gve: Use size_add() in call to struct_size() + - mlxsw: Use size_mul() in call to struct_size() + - tls: Use size_add() in call to struct_size() + - tipc: Use size_add() in calls to struct_size() + - net: spider_net: Use size_add() in call to struct_size() + - net: ethernet: mtk_wed: fix EXT_INT_STATUS_RX_FBUF definitions for MT7986 + SoC + - wifi: rtw88: debug: Fix the NULL vs IS_ERR() bug for debugfs_create_file() + - wifi: ath12k: fix DMA unmap warning on NULL DMA address + - wifi: ath11k: fix boot failure with one MSI vector + - wifi: mac80211: fix check for unusable RX result + - PM: sleep: Fix symbol export for _SIMPLE_ variants of _PM_OPS() + - cpufreq: tegra194: fix warning due to missing opp_put + - wifi: mt76: mt7603: rework/fix rx pse hang check + - wifi: mt76: mt7603: improve watchdog reset reliablity + - wifi: mt76: mt7603: improve stuck beacon handling + - wifi: mt76: connac: move connac3 definitions in mt76_connac3_mac.h + - wifi: mt76: remove unused error path in mt76_connac_tx_complete_skb + - wifi: mt76: mt7996: set correct wcid in txp + - wifi: mt76: mt7996: fix beamform mcu cmd configuration + - wifi: mt76: mt7996: fix beamformee ss subfield in EHT PHY cap + - wifi: mt76: mt7996: fix wmm queue mapping + - wifi: mt76: mt7996: fix rx rate report for CBW320-2 + - wifi: mt76: mt7996: fix TWT command format + - wifi: mt76: update beacon size limitation + - wifi: mt76: fix potential memory leak of beacon commands + - wifi: mt76: get rid of false alamrs of tx emission issues + - wifi: mt76: fix per-band IEEE80211_CONF_MONITOR flag comparison + - wifi: mt76: mt7915: fix beamforming availability check + - wifi: ath: dfs_pattern_detector: Fix a memory initialization issue + - tcp_metrics: add missing barriers on delete + - tcp_metrics: properly set tp->snd_ssthresh in tcp_init_metrics() + - tcp_metrics: do not create an entry from tcp_init_metrics() + - wifi: rtlwifi: fix EDCA limit set by BT coexistence + - ACPI: property: Allow _DSD buffer data only for byte accessors + - ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100 + - can: etas_es58x: rework the version check logic to silence -Wformat- + truncation + - can: etas_es58x: add missing a blank line after declaration + - wifi: ath11k: fix Tx power value during active CAC + - can: dev: can_restart(): don't crash kernel if carrier is OK + - can: dev: can_restart(): fix race condition between controller restart and + netif_carrier_on() + - can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is + accessed out of bounds + - PM / devfreq: rockchip-dfi: Make pmu regmap mandatory + - wifi: wfx: fix case where rates are out of order + - netfilter: nf_tables: Drop pointless memset when dumping rules + - wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() + - thermal: core: prevent potential string overflow + - r8169: fix rare issue with broken rx after link-down on RTL8125 + - thermal/drivers/mediatek: Fix probe for THERMAL_V2 + - bpf: Fix missed rcu read lock in bpf_task_under_cgroup() + - selftests: netfilter: test for sctp collision processing in nf_conntrack + - net: skb_find_text: Ignore patterns extending past 'to' + - thermal: core: Don't update trip points inside the hysteresis range + - chtls: fix tp->rcv_tstamp initialization + - tcp: fix cookie_init_timestamp() overflows + - wifi: iwlwifi: mvm: update station's MFP flag after association + - wifi: iwlwifi: mvm: fix removing pasn station for responder + - wifi: iwlwifi: mvm: use correct sta ID for IGTK/BIGTK + - wifi: mac80211: don't recreate driver link debugfs in reconfig + - wifi: mac80211: Fix setting vif links + - wifi: iwlwifi: yoyo: swap cdb and jacket bits values + - wifi: iwlwifi: mvm: Correctly set link configuration + - wifi: iwlwifi: mvm: Fix key flags for IGTK on AP interface + - wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface + - wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API + - wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta() + - wifi: iwlwifi: mvm: remove TDLS stations from FW + - wifi: iwlwifi: increase number of RX buffers for EHT devices + - wifi: iwlwifi: mvm: fix netif csum flags + - wifi: iwlwifi: pcie: synchronize IRQs before NAPI + - wifi: iwlwifi: mvm: update IGTK in mvmvif upon D3 resume + - wifi: iwlwifi: empty overflow queue during flush + - Bluetooth: ISO: Use defer setup to separate PA sync and BIG sync + - Bluetooth: ISO: Pass BIG encryption info through QoS + - Bluetooth: Make handle of hci_conn be unique + - Bluetooth: hci_sync: Fix Opcode prints in bt_dev_dbg/err + - bpf: Fix unnecessary -EBUSY from htab_lock_bucket + - ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() + - mptcp: properly account fastopen data + - ipv6: avoid atomic fragment on GSO packets + - virtio_net: use u64_stats_t infra to avoid data-races + - net: add DEV_STATS_READ() helper + - ipvlan: properly track tx_errors + - regmap: debugfs: Fix a erroneous check after snprintf() + - spi: tegra: Fix missing IRQ check in tegra_slink_probe() + - clk: qcom: ipq5332: Drop set rate parent from gpll0 dependent clocks + - clk: qcom: gcc-msm8996: Remove RPM bus clocks + - clk: qcom: clk-rcg2: Fix clock rate overflow for high parent frequencies + - clk: qcom: mmcc-msm8998: Don't check halt bit on some branch clks + - clk: qcom: mmcc-msm8998: Fix the SMMU GDSC + - clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src + - regulator: mt6358: Fail probe on unknown chip ID + - clk: imx: Select MXC_CLK for CLK_IMX8QXP + - clk: imx: imx8mq: correct error handling path + - clk: imx: imx8qxp: Fix elcdif_pll clock + - clk: renesas: rcar-gen3: Extend SDnH divider table + - clk: renesas: rzg2l: Wait for status bit of SD mux before continuing + - clk: renesas: rzg2l: Lock around writes to mux register + - clk: renesas: rzg2l: Trust value returned by hardware + - clk: renesas: rzg2l: Use FIELD_GET() for PLL register fields + - clk: renesas: rzg2l: Fix computation formula + - clk: linux/clk-provider.h: fix kernel-doc warnings and typos + - spi: nxp-fspi: use the correct ioremap function + - clk: ralink: mtmips: quiet unused variable warning + - clk: keystone: pll: fix a couple NULL vs IS_ERR() checks + - clk: ti: fix double free in of_ti_divider_clk_setup() + - clk: npcm7xx: Fix incorrect kfree + - clk: mediatek: clk-mt6765: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt6779: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt6797: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt7629-eth: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt7629: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data + - clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM + - clk: qcom: clk-alpha-pll: introduce stromer plus ops + - clk: qcom: apss-ipq-pll: Use stromer plus ops for stromer plus pll + - clk: qcom: apss-ipq-pll: Fix 'l' value for ipq5332_pll_config + - clk: qcom: ipq9574: drop the CLK_SET_RATE_PARENT flag from GPLL clocks + - clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks + - clk: mediatek: fix double free in mtk_clk_register_pllfh() + - platform/x86: wmi: Fix probe failure when failing to register WMI devices + - platform/x86: wmi: Fix opening of char device + - regulator: qcom-rpmh: Fix smps4 regulator for pm8550ve + - hwmon: (axi-fan-control) Fix possible NULL pointer dereference + - hwmon: (coretemp) Fix potentially truncated sysfs attribute name + - Revert "hwmon: (sch56xx-common) Add DMI override table" + - Revert "hwmon: (sch56xx-common) Add automatic module loading on supported + devices" + - hwmon: (sch5627) Use bit macros when accessing the control register + - hwmon: (sch5627) Disallow write access if virtual registers are locked + - hte: tegra: Fix missing error code in tegra_hte_test_probe() + - platform/chrome: cros_ec_lpc: Separate host command and irq disable + - spi: omap2-mcspi: remove redundant dev_err_probe() + - spi: omap2-mcspi: switch to use modern name + - spi: omap2-mcspi: Fix hardcoded reference clock + - drm: bridge: samsung-dsim: Initialize ULPS EXIT for i.MX8M DSIM + - drm: bridge: for GENERIC_PHY_MIPI_DPHY also select GENERIC_PHY + - drm: bridge: samsung-dsim: Fix waiting for empty cmd transfer FIFO on older + Exynos + - drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs + - drm/rockchip: vop: Fix call to crtc reset helper + - drm/rockchip: vop2: Don't crash for invalid duplicate_state + - drm/rockchip: vop2: Add missing call to crtc reset helper + - drm/radeon: possible buffer overflow + - drm: bridge: it66121: Fix invalid connector dereference + - drm/bridge: lt8912b: Fix bridge_detach + - drm/bridge: lt8912b: Fix crash on bridge detach + - drm/bridge: lt8912b: Manually disable HPD only if it was enabled + - drm/bridge: lt8912b: Add missing drm_bridge_attach call + - drm/mediatek: Fix coverity issue with unintentional integer overflow + - x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro + - drm/bridge: tc358768: Fix use of uninitialized variable + - drm/bridge: tc358768: Fix bit updates + - drm/bridge: tc358768: Use struct videomode + - drm/bridge: tc358768: Print logical values, not raw register values + - drm/bridge: tc358768: Use dev for dbg prints, not priv->dev + - drm/bridge: tc358768: Rename dsibclk to hsbyteclk + - drm/bridge: tc358768: Clean up clock period code + - drm/bridge: tc358768: Fix tc358768_ns_to_cnt() + - drm/aspeed: Convert to platform remove callback returning void + - drm/stm: Convert to platform remove callback returning void + - drm/tve200: Convert to platform remove callback returning void + - drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc + drivers + - drm/amdgpu: Increase IH soft ring size for GFX v9.4.3 dGPU + - drm/amdkfd: fix some race conditions in vram buffer alloc/free of svm code + - drm/amdkfd: retry after EBUSY is returned from hmm_ranges_get_pages + - drm/amdkfd: Remove svm range validated_once flag + - drm/amdkfd: Handle errors from svm validate and map + - drm/amd/display: Fix null pointer dereference in error message + - drm/amd/display: Check all enabled planes in dm_check_crtc_cursor + - drm/amd/display: Refactor dm_get_plane_scale helper + - drm/amd/display: Bail from dm_check_crtc_cursor if no relevant change + - io_uring/kbuf: Fix check of BID wrapping in provided buffers + - io_uring/kbuf: Allow the full buffer id space for provided buffers + - drm/mediatek: Add mmsys_dev_num to mt8188 vdosys0 driver data + - drm/mediatek: Fix iommu fault by swapping FBs after updating plane state + - drm/mediatek: Fix iommu fault during crtc enabling + - accel/habanalabs/gaudi2: Fix incorrect string length computation in + gaudi2_psoc_razwi_get_engines() + - drm/rockchip: cdn-dp: Fix some error handling paths in cdn_dp_probe() + - gpu: host1x: Correct allocated size for contexts + - drm/bridge: lt9611uxc: fix the race in the error path + - arm64/arm: xen: enlighten: Fix KPTI checks + - drm/rockchip: Fix type promotion bug in rockchip_gem_iommu_map() + - xenbus: fix error exit in xenbus_init() + - xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled + - drm/msm/dsi: use msm_gem_kernel_put to free TX buffer + - drm/msm/dsi: free TX buffer in unbind + - clocksource/drivers/arm_arch_timer: limit XGene-1 workaround + - drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling + - drivers/perf: hisi: use cpuhp_state_remove_instance_nocalls() for + hisi_hns3_pmu uninit process + - drm/amd/pm: Fix a memory leak on an error path + - perf/arm-cmn: Fix DTC domain detection + - drivers/perf: hisi_pcie: Check the type first in pmu::event_init() + - perf: hisi: Fix use-after-free when register pmu fails + - ARM: dts: renesas: blanche: Fix typo in GP_11_2 pin name + - arm64: dts: qcom: sdm845: Fix PSCI power domain names + - arm64: dts: qcom: sdm845: cheza doesn't support LMh node + - arm64: dts: qcom: sc7280: link usb3_phy_wrapper_gcc_usb30_pipe_clk + - arm64: dts: qcom: msm8916: Fix iommu local address range + - arm64: dts: qcom: msm8992-libra: drop duplicated reserved memory + - arm64: dts: qcom: sm6125: Pad APPS IOMMU address to 8 characters + - arm64: dts: qcom: sc7280: Add missing LMH interrupts + - arm64: dts: qcom: qrb2210-rb1: Swap UART index + - arm64: dts: qcom: sc7280: drop incorrect EUD port on SoC side + - arm64: dts: qcom: sm8150: add ref clock to PCIe PHYs + - arm64: dts: qcom: sm8350: fix pinctrl for UART18 + - arm64: dts: qcom: sdm845-mtp: fix WiFi configuration + - ARM64: dts: marvell: cn9310: Use appropriate label for spi1 pins + - arm64: dts: qcom: msm8976: Fix ipc bit shifts + - arm64: dts: qcom: msm8939: Fix iommu local address range + - riscv: dts: allwinner: remove address-cells from intc node + - arm64: dts: qcom: apq8016-sbc: Add missing ADV7533 regulators + - ARM: dts: qcom: apq8026-samsung-matisse-wifi: Fix inverted hall sensor + - ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator + - soc: qcom: llcc: Handle a second device without data corruption + - kunit: Fix missed memory release in kunit_free_suite_set() + - firmware: ti_sci: Mark driver as non removable + - arm64: dts: ti: k3-am625-beagleplay: Fix typo in ramoops reg + - arm64: dts: ti: k3-am62a7-sk: Drop i2c-1 to 100Khz + - firmware: arm_ffa: Assign the missing IDR allocation ID to the FFA device + - firmware: arm_ffa: Allow the FF-A drivers to use 32bit mode of messaging + - ARM: dts: am3517-evm: Fix LED3/4 pinmux + - clk: scmi: Free scmi_clk allocated when the clocks with invalid info are + skipped + - arm64: dts: imx8qm-ss-img: Fix jpegenc compatible entry + - arm64: dts: imx8mp-debix-model-a: Remove USB hub reset-gpios + - arm64: dts: imx8mm: Add sound-dai-cells to micfil node + - arm64: dts: imx8mn: Add sound-dai-cells to micfil node + - arm64: tegra: Fix P3767 card detect polarity + - arm64: tegra: Fix P3767 QSPI speed + - firmware: tegra: Add suspend hook and reset BPMP IPC early on resume + - memory: tegra: Set BPMP msg flags to reset IPC channels + - arm64: tegra: Use correct interrupts for Tegra234 TKE + - selftests/pidfd: Fix ksft print formats + - selftests/resctrl: Ensure the benchmark commands fits to its array + - soc: qcom: pmic_glink: fix connector type to be DisplayPort + - ARM: dts: BCM5301X: Explicitly disable unused switch CPU ports + - iommufd: Add iopt_area_alloc() + - module/decompress: use vmalloc() for gzip decompression workspace + - ASoC: cs35l41: Handle mdsync_down reg write errors + - ASoC: cs35l41: Initialize completion object before requesting IRQ + - ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler + - ASoC: cs35l41: Undo runtime PM changes at driver exit time + - ALSA: hda: cs35l41: Fix unbalanced pm_runtime_get() + - ALSA: hda: cs35l41: Undo runtime PM changes at driver exit time + - KEYS: Include linux/errno.h in linux/verification.h + - crypto: hisilicon/hpre - Fix a erroneous check after snprintf() + - hwrng: bcm2835 - Fix hwrng throughput regression + - hwrng: geode - fix accessing registers + - RDMA/core: Use size_{add,sub,mul}() in calls to struct_size() + - crypto: qat - fix state machines cleanup paths + - crypto: qat - ignore subsequent state up commands + - crypto: qat - fix unregistration of crypto algorithms + - crypto: qat - fix unregistration of compression algorithms + - scsi: ibmvfc: Fix erroneous use of rtas_busy_delay with hcall return code + - ASoC: soc-pcm.c: Make sure DAI parameters cleared if the DAI becomes + inactive + - libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return + value + - nd_btt: Make BTT lanes preemptible + - crypto: caam/qi2 - fix Chacha20 + Poly1305 self test failure + - crypto: caam/jr - fix Chacha20 + Poly1305 self test failure + - crypto: qat - increase size of buffers + - ASoC: SOF: ipc4-topology: Use size_add() in call to struct_size() + - PCI: vmd: Correct PCI Header Type Register's multi-function check + - hid: cp2112: Fix duplicate workqueue initialization + - crypto: hisilicon/qm - fix PF queue parameter issue + - ARM: 9321/1: memset: cast the constant byte to unsigned char + - ARM: 9323/1: mm: Fix ARCH_LOW_ADDRESS_LIMIT when CONFIG_ZONE_DMA + - ext4: move 'ix' sanity check to corrent position + - kselftest: vm: fix mdwe's mmap_FIXED test case + - ASoC: fsl: mpc5200_dma.c: Fix warning of Function parameter or member not + described + - backlight: pwm_bl: Disable PWM on shutdown, suspend and remove + - ASoC: fsl-asoc-card: Add comment for mclk in the codec_priv + - dlm: fix no ack after final message + - IB/mlx5: Fix rdma counter binding for RAW QP + - RDMA/hns: Fix printing level of asynchronous events + - RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common() + - RDMA/hns: Fix signed-unsigned mixed comparisons + - RDMA/hns: Add check for SL + - RDMA/hns: The UD mode can only be configured with DCQCN + - ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran. + - ASoC: fsl: Fix PM disable depth imbalance in fsl_easrc_probe + - scsi: ufs: core: Leave space for '\0' in utf8 desc string + - RDMA/hfi1: Workaround truncation compilation error + - HID: cp2112: Make irq_chip immutable + - hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip + - HID: uclogic: Fix user-memory-access bug in + uclogic_params_ugee_v2_init_event_hooks() + - HID: uclogic: Fix a work->entry not empty bug in __queue_work() + - sh: bios: Revive earlyprintk support + - HID: logitech-hidpp: Don't restart IO, instead defer hid_connect() only + - HID: logitech-hidpp: Revert "Don't restart communication if not necessary" + - HID: logitech-hidpp: Move get_wireless_feature_index() check to + hidpp_connect_event() + - ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails + - PCI: endpoint: Fix double free in __pci_epc_create() + - padata: Fix refcnt handling in padata_free_shell() + - certs: Break circular dependency when selftest is modular + - crypto: qat - fix deadlock in backlog processing + - ASoC: ams-delta.c: use component after check + - erofs: fix erofs_insert_workgroup() lockref usage + - IB/mlx5: Fix init stage error handling to avoid double free of same QP and + UAF + - mfd: core: Un-constify mfd_cell.of_reg + - mfd: core: Ensure disabled devices are skipped without aborting + - mfd: dln2: Fix double put in dln2_probe + - dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC + - mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs + - leds: turris-omnia: Drop unnecessary mutex locking + - leds: turris-omnia: Do not use SMBUS calls + - leds: pwm: Don't disable the PWM when the LED should be off + - leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' + - scripts/gdb: fix usage of MOD_TEXT not defined when CONFIG_MODULES=n + - perf stat: Fix aggr mode initialization + - iio: frequency: adf4350: Use device managed functions and fix power down + issue. + - perf kwork: Fix incorrect and missing free atom in work_push_atom() + - perf kwork: Add the supported subcommands to the document + - perf kwork: Set ordered_events to true in 'struct perf_tool' + - f2fs: compress: fix deadloop in f2fs_write_cache_pages() + - f2fs: compress: fix to avoid use-after-free on dic + - f2fs: compress: fix to avoid redundant compress extension + - f2fs: fix to drop meta_inode's page cache in f2fs_put_super() + - tty: tty_jobctrl: fix pid memleak in disassociate_ctty() + - perf parse-events: Remove unused PE_PMU_EVENT_FAKE token + - perf parse-events: Remove unused PE_KERNEL_PMU_EVENT token + - perf parse-events: Remove ABORT_ON + - perf tools: Revert enable indices setting syntax for BPF map + - perf parse-events: Fix tracepoint name memory leak + - livepatch: Fix missing newline character in klp_resolve_symbols() + - pinctrl: renesas: rzg2l: Make reverse order of enable() for disable() + - perf record: Fix BTF type checks in the off-cpu profiling + - dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers + - usb: dwc2: fix possible NULL pointer dereference caused by driver + concurrency + - usb: chipidea: Fix DMA overwrite for Tegra + - usb: chipidea: Simplify Tegra DMA alignment code + - dmaengine: ti: edma: handle irq_of_parse_and_map() errors + - tools/perf: Update call stack check in builtin-lock.c + - misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() + - tools: iio: iio_generic_buffer ensure alignment + - USB: usbip: fix stub_dev hub disconnect + - dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() + - f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() + - interconnect: qcom: qdu1000: Set ACV enable_mask + - interconnect: qcom: sc7180: Retire DEFINE_QBCM + - interconnect: qcom: sc7180: Set ACV enable_mask + - interconnect: qcom: sc7280: Set ACV enable_mask + - interconnect: qcom: sc8180x: Set ACV enable_mask + - interconnect: qcom: sc8280xp: Set ACV enable_mask + - interconnect: qcom: sdm670: Retire DEFINE_QBCM + - interconnect: qcom: sdm670: Set ACV enable_mask + - interconnect: qcom: sdm845: Retire DEFINE_QBCM + - interconnect: qcom: sdm845: Set ACV enable_mask + - interconnect: qcom: sm6350: Retire DEFINE_QBCM + - interconnect: qcom: sm6350: Set ACV enable_mask + - interconnect: qcom: sm8150: Retire DEFINE_QBCM + - interconnect: qcom: sm8150: Set ACV enable_mask + - interconnect: qcom: sm8350: Retire DEFINE_QBCM + - interconnect: qcom: sm8350: Set ACV enable_mask + - powerpc: Only define __parse_fpscr() when required + - interconnect: fix error handling in qnoc_probe() + - perf build: Add missing comment about NO_LIBTRACEEVENT=1 + - perf parse-events: Fix for term values that are raw events + - perf pmu: Remove logic for PMU name being NULL + - perf mem-events: Avoid uninitialized read + - s390/ap: re-init AP queues on config on + - modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host + - modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host + - perf tools: Do not ignore the default vmlinux.h + - powerpc/40x: Remove stale PTE_ATOMIC_UPDATES macro + - powerpc/xive: Fix endian conversion size + - powerpc: Hide empty pt_regs at base of the stack + - perf trace: Use the right bpf_probe_read(_str) variant for reading user data + - powerpc/vas: Limit open window failure messages in log bufffer + - powerpc/imc-pmu: Use the correct spinlock initializer. + - powerpc/pseries: fix potential memory leak in init_cpu_associativity() + - perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 + platform + - xhci: Loosen RPM as default policy to cover for AMD xHC 1.1 + - usb: host: xhci-plat: fix possible kernel oops while resuming + - perf machine: Avoid out of bounds LBR memory read + - libperf rc_check: Make implicit enabling work for GCC + - perf hist: Add missing puts to hist__account_cycles + - perf vendor events intel: Fix broadwellde tma_info_system_dram_bw_use metric + - perf vendor events intel: Add broadwellde two metrics + - 9p/net: fix possible memory leak in p9_check_errors() + - rtla: Fix uninitialized variable found + - i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs + - rtc: brcmstb-waketimer: support level alarm_irq + - cxl/pci: Remove unnecessary device reference management in sanitize work + - cxl/pci: Cleanup 'sanitize' to always poll + - cxl/pci: Remove inconsistent usage of dev_err_probe() + - cxl/pci: Clarify devm host for memdev relative setup + - cxl/pci: Fix sanitize notifier setup + - cxl/memdev: Fix sanitize vs decoder setup locking + - cxl/mem: Fix shutdown order + - virt: sevguest: Fix passing a stack buffer as a scatterlist target + - rtc: pcf85363: Allow to wake up system without IRQ + - rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call + - cxl/region: Prepare the decoder match range helper for reuse + - cxl/region: Calculate a target position in a region interleave + - cxl/region: Use cxl_calc_interleave_pos() for auto-discovery + - cxl/region: Fix cxl_region_rwsem lock held when returning to user space + - cxl/core/regs: Rename @dev to @host in struct cxl_register_map + - cxl/port: Fix @host confusion in cxl_dport_setup_regs() + - cxl/hdm: Remove broken error path + - pcmcia: cs: fix possible hung task and memory leak pccardd() + - pcmcia: ds: fix refcount leak in pcmcia_device_add() + - pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() + - media: imx-jpeg: initiate a drain of the capture queue in dynamic resolution + change + - media: hantro: Check whether reset op is defined before use + - media: verisilicon: Do not enable G2 postproc downscale if source is + narrower than destination + - media: ov5640: fix vblank unchange issue when work at dvp mode + - media: i2c: max9286: Fix some redundant of_node_put() calls + - media: ov5640: Fix a memory leak when ov5640_probe fails + - media: bttv: fix use after free error due to btv->timeout timer + - media: amphion: handle firmware debug message + - media: mtk-jpegenc: Fix bug in JPEG encode quality selection + - media: s3c-camif: Avoid inappropriate kfree() + - media: vidtv: psi: Add check for kstrdup + - media: vidtv: mux: Add check and kfree for kstrdup + - media: cedrus: Fix clock/reset sequence + - media: cadence: csi2rx: Unregister v4l2 async notifier + - media: dvb-usb-v2: af9035: fix missing unlock + - media: verisilicon: Fixes clock list for rk3588 av1 decoder + - media: imx-jpeg: notify source chagne event when the first picture parsed + - media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() + - media: cec: meson: always include meson sub-directory in Makefile + - cpupower: fix reference to nonexistent document + - regmap: prevent noinc writes from clobbering cache + - drm/amdgpu/gfx10,11: use memcpy_to/fromio for MQDs + - drm/amdgpu: don't put MQDs in VRAM on ARM | ARM64 + - pwm: sti: Reduce number of allocations and drop usage of chip_data + - pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume + - Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() + - watchdog: ixp4xx: Make sure restart always works + - llc: verify mac len before reading mac header + - hsr: Prevent use after free in prp_create_tagged_frame() + - tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING + - rxrpc: Fix two connection reaping bugs + - bpf: Check map->usercnt after timer->timer is assigned + - inet: shrink struct flowi_common + - octeontx2-pf: Fix error codes + - octeontx2-pf: Fix holes in error code + - net: page_pool: add missing free_percpu when page_pool_init fail + - dccp: Call security_inet_conn_request() after setting IPv4 addresses. + - dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. + - Fix termination state for idr_for_each_entry_ul() + - net: stmmac: xgmac: Enable support for multiple Flexible PPS outputs + - selftests: pmtu.sh: fix result checking + - octeontx2-pf: Free pending and dropped SQEs + - net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT + - net/smc: allow cdc msg send rather than drop it with NULL sndbuf_desc + - net/smc: put sk reference if close work was canceled + - nvme: fix error-handling for io_uring nvme-passthrough + - riscv: boot: Fix creation of loader.bin + - tg3: power down device only on SYSTEM_POWER_OFF + - nbd: fix uaf in nbd_open + - blk-core: use pr_warn_ratelimited() in bio_check_ro() + - vsock/virtio: remove socket from connected/bound list on shutdown + - r8169: respect userspace disabling IFF_MULTICAST + - net: enetc: shorten enetc_setup_xdp_prog() error message to fit + NETLINK_MAX_FMTMSG_LEN + - i2c: iproc: handle invalid slave state + - netfilter: xt_recent: fix (increase) ipv6 literal buffer length + - netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses + - net/sched: act_ct: Always fill offloading tuple iifidx + - RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs + - module/decompress: use kvmalloc() consistently + - drm/vc4: tests: Fix UAF in the mock helpers + - drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE + - ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: trivial: fix error messages + - ASoC: hdmi-codec: register hpd callback on component probe + - ASoC: dapm: fix clock get name + - spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies + - arm64/arm: arm_pmuv3: perf: Don't truncate 64-bit registers + - fbdev: imsttfb: fix double free in probe() + - fbdev: imsttfb: fix a resource leak in probe + - fbdev: fsl-diu-fb: mark wr_reg_wa() static + - tracing/kprobes: Fix the order of argument descriptions + - Revert "drm/ast: report connection status on Display Port." + - selftests: mptcp: fix wait_rm_addr/sf parameters + - io_uring/net: ensure socket is marked connected on connect retry + - x86/amd_nb: Use Family 19h Models 60h-7Fh Function 4 IDs + - Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1" + - btrfs: use u64 for buffer sizes in the tree search ioctls + - bpf, x86: initialize the variable "first_off" in save_args() + - perf parse-events: Fix driver config term + - btrfs: make found_logical_ret parameter mandatory for function + queue_scrub_stripe() + - Linux 6.5.12 + * Mantic update: v6.5.11 upstream stable release (LP: #2051117) + - ASoC: Intel: sof_sdw: add support for SKU 0B14 + - ASoC: simple-card: fixup asoc_simple_probe() error handling + - coresight: tmc-etr: Disable warnings for allocation failures + - ASoC: fsl-asoc-card: use integer type for fll_id and pll_id + - ASoC: core: Do not call link_exit() on uninitialized rtd objects + - ASoC: tlv320adc3xxx: BUG: Correct micbias setting + - net: sched: cls_u32: Fix allocation size in u32_init() + - arm64: dts: imx93: add the Flex-CAN stop mode by GPR + - can: flexcan: remove the auto stop mode for IMX93 + - irqchip/riscv-intc: Mark all INTC nodes as initialized + - irqchip/stm32-exti: add missing DT IRQ flag translation + - dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe + - ata: pata_parport: add custom version of wait_after_reset + - ata: pata_parport: fit3: implement IDE command set registers + - powerpc/85xx: Fix math emulation exception + - media: i2c: ov8858: Don't set fwnode in the driver + - Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport + - fbdev: atyfb: only use ioremap_uc() on i386 and ia64 + - fs/ntfs3: Add ckeck in ni_update_parent() + - fs/ntfs3: Write immediately updated ntfs state + - fs/ntfs3: Use kvmalloc instead of kmalloc(... __GFP_NOWARN) + - fs/ntfs3: Add more attributes checks in mi_enum_attr() + - fs/ntfs3: Fix alternative boot searching + - fs/ntfs3: Add more info into /proc/fs/ntfs3//volinfo + - fs/ntfs3: Do not allow to change label if volume is read-only + - fs/ntfs3: Fix possible NULL-ptr-deref in ni_readpage_cmpr() + - fs/ntfs3: Fix NULL pointer dereference on error in attr_allocate_frame() + - fs/ntfs3: Fix directory element type detection + - fs/ntfs3: Avoid possible memory leak + - spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0 + - ASoC: soc-dapm: Add helper for comparing widget name + - netfilter: nfnetlink_log: silence bogus compiler warning + - net/mlx5: Bridge, fix peer entry ageing in LAG mode + - x86/efistub: Don't try to print after ExitBootService() + - efi: fix memory leak in krealloc failure handling + - ASoC: rt5650: fix the wrong result of key button + - ASoC: codecs: tas2780: Fix log of failed reset via I2C. + - s390/kasan: handle DCSS mapping in memory holes + - fbdev: omapfb: fix some error codes + - fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() + - scsi: mpt3sas: Fix in error path + - ASoC: da7219: Correct the process of setting up Gnd switch in AAD + - drm/amdgpu: Unset context priority is now invalid + - gpu/drm: Eliminate DRM_SCHED_PRIORITY_UNSET + - LoongArch: Use SYM_CODE_* to annotate exception handlers + - LoongArch: Export symbol invalid_pud_table for modules building + - LoongArch: Replace kmap_atomic() with kmap_local_page() in + copy_user_highpage() + - LoongArch: Disable WUC for pgprot_writecombine() like ioremap_wc() + - netfilter: nf_tables: audit log object reset once per table + - platform/mellanox: mlxbf-tmfifo: Fix a warning message + - drm/amdgpu: Reserve fences for VM update + - riscv: dts: thead: set dma-noncoherent to soc bus + - net: chelsio: cxgb4: add an error code check in t4_load_phy_fw + - r8152: Check for unplug in rtl_phy_patch_request() + - r8152: Check for unplug in r8153b_ups_en() / r8153c_ups_en() + - powerpc/mm: Fix boot crash with FLATMEM + - ceph_wait_on_conflict_unlink(): grab reference before dropping ->d_lock + - drm/amd/display: Don't use fsleep for PSR exit waits + - rust: make `UnsafeCell` the outer type in `Opaque` + - rust: types: make `Opaque` be `!Unpin` + - perf evlist: Avoid frequency mode for the dummy event + - mmap: fix vma_iterator in error path of vma_merge() + - mmap: fix error paths with dup_anon_vma() + - ALSA: usb-audio: add quirk flag to enable native DSD for McIntosh devices + - PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device + - usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" + compatibility + - usb: typec: tcpm: Add additional checks for contaminant + - usb: typec: tcpm: Fix NULL pointer dereference in tcpm_pd_svdm() + - usb: raw-gadget: properly handle interrupted requests + - Bluetooth: hci_bcm4377: Mark bcm4378/bcm4387 as BROKEN_LE_CODED + - tty: n_gsm: fix race condition in status line change on dead connections + - tty: 8250: Remove UC-257 and UC-431 + - tty: 8250: Add support for additional Brainboxes UC cards + - tty: 8250: Add support for Brainboxes UP cards + - tty: 8250: Add support for Intashield IS-100 + - tty: 8250: Fix port count of PX-257 + - tty: 8250: Fix up PX-803/PX-857 + - tty: 8250: Add support for additional Brainboxes PX cards + - tty: 8250: Add support for Intashield IX cards + - tty: 8250: Add Brainboxes Oxford Semiconductor-based quirks + - dt-bindings: serial: rs485: Add rs485-rts-active-high + - misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support + - serial: core: Fix runtime PM handling for pending tx + - ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection + - ASoC: SOF: sof-pci-dev: Fix community key quirk detection + - Linux 6.5.11 + * Mantic update: v6.5.11 upstream stable release (LP: #2051117) // black + screen when wake up from s3 with AMD W7600 gfx (LP: #2051341) + - drm/ttm: Reorder sys manager cleanup step + * CVE-2024-0646 + - net: tls, update curr on splice as well + * CVE-2024-0582 + - io_uring: enable io_mem_alloc/free to be used in other parts + - io_uring/kbuf: defer release of mapped buffer rings + * CVE-2024-0565 + - smb: client: fix OOB in receive_encrypted_standard() + * CVE-2023-51781 + - appletalk: Fix Use-After-Free in atalk_ioctl + * Reject connection when malformed L2CAP signal packet is received + (LP: #2047634) + - Bluetooth: L2CAP: Send reject on command corrupted request + * Mantic update: v6.5.10 upstream stable release (LP: #2049412) + - vdpa/mlx5: Fix firmware error on creation of 1k VQs + - smb3: allow controlling length of time directory entries are cached with dir + leases + - smb3: allow controlling maximum number of cached directories + - smb3: do not start laundromat thread when dir leases disabled + - smb: client: do not start laundromat thread on nohandlecache + - smb: client: make laundromat a delayed worker + - smb: client: prevent new fids from being removed by laundromat + - virtio_balloon: Fix endless deflation and inflation on arm64 + - virtio-mmio: fix memory leak of vm_dev + - virtio-crypto: handle config changed by work queue + - virtio_pci: fix the common cfg map size + - vsock/virtio: initialize the_virtio_vsock before using VQs + - vhost: Allow null msg.size on VHOST_IOTLB_INVALIDATE + - arm64: dts: qcom: apq8096-db820c: fix missing clock populate + - arm64: dts: qcom: msm8996-xiaomi: fix missing clock populate + - arm64: dts: rockchip: use codec as clock master on px30-ringneck-haikou + - arm64: dts: rockchip: set codec system-clock-fixed on px30-ringneck-haikou + - arm64: dts: qcom: sa8775p: correct PMIC GPIO label in gpio-ranges + - arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399 + - arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards + - i40e: sync next_to_clean and next_to_process for programming status desc + - mm: fix vm_brk_flags() to not bail out while holding lock + - hugetlbfs: clear resv_map pointer if mmap fails + - mm/page_alloc: correct start page when guard page debug is enabled + - mm/migrate: fix do_pages_move for compat pointers + - selftests/mm: include mman header to access MREMAP_DONTUNMAP identifier + - mm/mempolicy: fix set_mempolicy_home_node() previous VMA pointer + - hugetlbfs: extend hugetlb_vma_lock to private VMAs + - maple_tree: add GFP_KERNEL to allocations in mas_expected_entries() + - nfsd: lock_rename() needs both directories to live on the same fs + - vdpa_sim_blk: Fix the potential leak of mgmt_dev + - vdpa/mlx5: Fix double release of debugfs entry + - ARM: OMAP1: ams-delta: Fix MODEM initialization failure + - ARM: dts: rockchip: Fix i2c0 register address for RK3128 + - ARM: dts: rockchip: Add missing arm timer interrupt for RK3128 + - ARM: dts: rockchip: Add missing quirk for RK3128's dma engine + - ARM: dts: rockchip: Fix timer clocks for RK3128 + - accel/ivpu: Don't enter d0i3 during FLR + - drm/i915/pmu: Check if pmu is closed before stopping event + - drm/amd: Disable ASPM for VI w/ all Intel systems + - drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper() + - btrfs: remove v0 extent handling + - btrfs: fix unwritten extent buffer after snapshotting a new subvolume + - ARM: OMAP: timer32K: fix all kernel-doc warnings + - firmware/imx-dsp: Fix use_after_free in imx_dsp_setup_channels() + - clk: ti: Fix missing omap4 mcbsp functional clock and aliases + - clk: ti: Fix missing omap5 mcbsp functional clock and aliases + - r8169: fix the KCSAN reported data-race in rtl_tx() while reading tp->cur_tx + - r8169: fix the KCSAN reported data-race in rtl_tx while reading + TxDescArray[entry].opts1 + - r8169: fix the KCSAN reported data race in rtl_rx while reading desc->opts1 + - iavf: initialize waitqueues before starting watchdog_task + - i40e: Fix I40E_FLAG_VF_VLAN_PRUNING value + - treewide: Spelling fix in comment + - igb: Fix potential memory leak in igb_add_ethtool_nfc_entry + - net: do not leave an empty skb in write queue + - neighbour: fix various data-races + - igc: Fix ambiguity in the ethtool advertising + - net: ethernet: adi: adin1110: Fix uninitialized variable + - net: ieee802154: adf7242: Fix some potential buffer overflow in + adf7242_stats_show() + - net: usb: smsc95xx: Fix uninit-value access in smsc95xx_read_reg + - r8152: Increase USB control msg timeout to 5000ms as per spec + - r8152: Run the unload routine if we have errors during probe + - r8152: Cancel hw_phy_work if we have an error in probe + - r8152: Release firmware if we have an error in probe + - tcp: fix wrong RTO timeout when received SACK reneging + - wifi: cfg80211: pass correct pointer to rdev_inform_bss() + - wifi: cfg80211: fix assoc response warning on failed links + - wifi: mac80211: don't drop all unprotected public action frames + - net/handshake: fix file ref count in handshake_nl_accept_doit() + - gtp: uapi: fix GTPA_MAX + - gtp: fix fragmentation needed check with gso + - drm/i915/perf: Determine context valid in OA reports + - i40e: Fix wrong check for I40E_TXR_FLAGS_WB_ON_ITR + - netfilter: flowtable: GC pushes back packets to classic path + - net/sched: act_ct: additional checks for outdated flows + - drm/logicvc: Kconfig: select REGMAP and REGMAP_MMIO + - drm/i915/mcr: Hold GT forcewake during steering operations + - iavf: in iavf_down, disable queues when removing the driver + - scsi: sd: Introduce manage_shutdown device flag + - blk-throttle: check for overflow in calculate_bytes_allowed + - kasan: print the original fault addr when access invalid shadow + - iio: afe: rescale: Accept only offset channels + - iio: exynos-adc: request second interupt only when touchscreen mode is used + - iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds + - iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale + - i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() + - i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() + - i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() + - i2c: stm32f7: Fix PEC handling in case of SMBUS transfers + - i2c: aspeed: Fix i2c bus hang in slave read + - tracing/kprobes: Fix symbol counting logic by looking at modules as well + - tracing/kprobes: Fix the description of variable length arguments + - misc: fastrpc: Reset metadata buffer to avoid incorrect free + - misc: fastrpc: Free DMA handles for RPC calls with no arguments + - misc: fastrpc: Clean buffers on remote invocation failures + - misc: fastrpc: Unmap only if buffer is unmapped from DSP + - nvmem: imx: correct nregs for i.MX6ULL + - nvmem: imx: correct nregs for i.MX6SLL + - nvmem: imx: correct nregs for i.MX6UL + - x86/tsc: Defer marking TSC unstable to a worker + - x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility + - x86/cpu: Add model number for Intel Arrow Lake mobile processor + - perf/core: Fix potential NULL deref + - sparc32: fix a braino in fault handling in csum_and_copy_..._user() + - clk: Sanitize possible_parent_show to Handle Return Value of + of_clk_get_parent_name + - clk: socfpga: gate: Account for the divider in determine_rate + - clk: stm32: Fix a signedness issue in clk_stm32_composite_determine_rate() + - platform/x86: Add s2idle quirk for more Lenovo laptops + - mm/damon/sysfs: check DAMOS regions update progress from before_terminate() + - accel/ivpu/37xx: Fix missing VPUIP interrupts + - Linux 6.5.10 + * CVE-2023-6560 + - io_uring: don't allow discontig pages for IORING_SETUP_NO_MMAP + * CVE-2023-51782 + - net/rose: Fix Use-After-Free in rose_ioctl + * Mantic update: v6.5.9 upstream stable release (LP: #2049202) + - Bluetooth: hci_event: Ignore NULL link key + - Bluetooth: Reject connection with the device which has same BD_ADDR + - Bluetooth: Fix a refcnt underflow problem for hci_conn + - Bluetooth: vhci: Fix race when opening vhci device + - Bluetooth: hci_event: Fix coding style + - Bluetooth: avoid memcmp() out of bounds warning + - Bluetooth: hci_conn: Fix modifying handle while aborting + - ice: fix over-shifted variable + - ice: Fix safe mode when DDP is missing + - ice: reset first in crash dump kernels + - net/smc: return the right falback reason when prefix checks fail + - btrfs: fix stripe length calculation for non-zoned data chunk allocation + - nfc: nci: fix possible NULL pointer dereference in send_acknowledge() + - regmap: fix NULL deref on lookup + - KVM: x86: Mask LVTPC when handling a PMI + - x86/fpu: Allow caller to constrain xfeatures when copying to uabi buffer + - KVM: x86/pmu: Truncate counter value to allowed width on write + - KVM: x86: Constrain guest-supported xfeatures only at KVM_GET_XSAVE{2} + - x86: KVM: SVM: add support for Invalid IPI Vector interception + - x86: KVM: SVM: refresh AVIC inhibition in svm_leave_nested() + - tcp: check mptcp-level constraints for backlog coalescing + - mptcp: more conservative check for zero probes + - selftests: mptcp: join: no RST when rm subflow/addr + - mm: slab: Do not create kmalloc caches smaller than arch_slab_minalign() + - fs/ntfs3: Fix OOB read in ntfs_init_from_boot + - fs/ntfs3: Fix possible null-pointer dereference in hdr_find_e() + - fs/ntfs3: fix panic about slab-out-of-bounds caused by ntfs_list_ea() + - fs/ntfs3: Fix shift-out-of-bounds in ntfs_fill_super + - fs/ntfs3: fix deadlock in mark_as_free_ex + - Revert "net: wwan: iosm: enable runtime pm support for 7560" + - netfilter: nft_payload: fix wrong mac header matching + - drm/i915: Retry gtt fault when out of fence registers + - drm/mediatek: Correctly free sg_table in gem prime vmap + - drm/nouveau/disp: fix DP capable DSM connectors + - drm/edid: add 8 bpc quirk to the BenQ GW2765 + - ALSA: hda/realtek - Fixed ASUS platform headset Mic issue + - ALSA: hda/realtek: Add quirk for ASUS ROG GU603ZV + - ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq5xxx + - ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind + - ASoC: codecs: wcd938x-sdw: fix runtime PM imbalance on probe errors + - ASoC: codecs: wcd938x: drop bogus bind error handling + - ASoC: codecs: wcd938x: fix unbind tear down order + - ASoC: codecs: wcd938x: fix resource leaks on bind errors + - ASoC: codecs: wcd938x: fix regulator leaks on probe errors + - ASoC: codecs: wcd938x: fix runtime PM imbalance on remove + - qed: fix LL2 RX buffer allocation + - xfrm: fix a data-race in xfrm_lookup_with_ifid() + - xfrm6: fix inet6_dev refcount underflow problem + - xfrm: fix a data-race in xfrm_gen_index() + - xfrm: interface: use DEV_STATS_INC() + - net: xfrm: skip policies marked as dead while reinserting policies + - fprobe: Fix to ensure the number of active retprobes is not zero + - wifi: cfg80211: use system_unbound_wq for wiphy work + - net: ipv4: fix return value check in esp_remove_trailer + - net: ipv6: fix return value check in esp_remove_trailer + - net: rfkill: gpio: prevent value glitch during probe + - tcp: fix excessive TLP and RACK timeouts from HZ rounding + - tcp: tsq: relax tcp_small_queue_check() when rtx queue contains a single skb + - tcp: Fix listen() warning with v4-mapped-v6 address. + - docs: fix info about representor identification + - tun: prevent negative ifindex + - gve: Do not fully free QPL pages on prefill errors + - ipv4: fib: annotate races around nh->nh_saddr_genid and nh->nh_saddr + - net: usb: smsc95xx: Fix an error code in smsc95xx_reset() + - octeon_ep: update BQL sent bytes before ringing doorbell + - i40e: prevent crash on probe if hw registers have invalid values + - net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() + - bonding: Return pointer to data after pull on skb + - net/sched: sch_hfsc: upgrade 'rt' to 'sc' when it becomes a inner curve + - neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section + - selftests: openvswitch: Catch cases where the tests are killed + - selftests: openvswitch: Fix the ct_tuple for v4 + - selftests: netfilter: Run nft_audit.sh in its own netns + - netfilter: nft_set_rbtree: .deactivate fails if element has expired + - netlink: Correct offload_xstats size + - netfilter: nf_tables: do not refresh timeout when resetting element + - netfilter: nf_tables: do not remove elements if set backend implements + .abort + - netfilter: nf_tables: revert do not remove elements if set backend + implements .abort + - selftests: openvswitch: Add version check for pyroute2 + - net: phy: bcm7xxx: Add missing 16nm EPHY statistics + - net: pktgen: Fix interface flags printing + - net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation + - net: mdio-mux: fix C45 access returning -EIO after API change + - net: avoid UAF on deleted altname + - net: fix ifname in netlink ntf during netns move + - net: check for altname conflicts when changing netdev's netns + - iio: light: vcnl4000: Don't power on/off chip in config + - pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency + - ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone + - arm64: dts: mediatek: Fix "mediatek,merge-mute" and "mediatek,merge-fifo-en" + types + - fs-writeback: do not requeue a clean inode having skipped pages + - btrfs: fix race when refilling delayed refs block reserve + - btrfs: prevent transaction block reserve underflow when starting transaction + - btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1 + - btrfs: initialize start_slot in btrfs_log_prealloc_extents + - i2c: mux: Avoid potential false error message in i2c_mux_add_adapter + - overlayfs: set ctime when setting mtime and atime + - accel/ivpu: Don't flood dmesg with VPU ready message + - gpio: timberdale: Fix potential deadlock on &tgpio->lock + - ata: libata-core: Fix compilation warning in ata_dev_config_ncq() + - ata: libata-eh: Fix compilation warning in ata_eh_link_report() + - tracing: relax trace_event_eval_update() execution with cond_resched() + - wifi: mwifiex: Sanity check tlv_len and tlv_bitmap_len + - wifi: cfg80211: validate AP phy operation before starting it + - wifi: iwlwifi: Ensure ack flag is properly cleared. + - rfkill: sync before userspace visibility/changes + - HID: logitech-hidpp: Add Bluetooth ID for the Logitech M720 Triathlon mouse + - HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event + - Bluetooth: btusb: add shutdown function for QCA6174 + - Bluetooth: Avoid redundant authentication + - Bluetooth: hci_core: Fix build warnings + - wifi: cfg80211: Fix 6GHz scan configuration + - wifi: mac80211: work around Cisco AP 9115 VHT MPDU length + - wifi: mac80211: allow transmitting EAPOL frames with tainted key + - wifi: cfg80211: avoid leaking stack data into trace + - regulator/core: Revert "fix kobject release warning and memory leak in + regulator_register()" + - SUNRPC: Fail quickly when server does not recognize TLS + - SUNRPC/TLS: Lock the lower_xprt during the tls handshake + - nfs: decrement nrequests counter before releasing the req + - sky2: Make sure there is at least one frag_addr available + - ipv4/fib: send notify when delete source address routes + - drm: panel-orientation-quirks: Add quirk for One Mix 2S + - btrfs: fix some -Wmaybe-uninitialized warnings in ioctl.c + - btrfs: error out when COWing block using a stale transaction + - btrfs: error when COWing block from a root that is being deleted + - btrfs: error out when reallocating block for defrag using a stale + transaction + - platform/x86: touchscreen_dmi: Add info for the BUSH Bush Windows tablet + - drm/amd/pm: add unique_id for gc 11.0.3 + - HID: multitouch: Add required quirk for Synaptics 0xcd7e device + - HID: nintendo: reinitialize USB Pro Controller after resuming from suspend + - HID: Add quirk to ignore the touchscreen battery on HP ENVY 15-eu0556ng + - platform/x86: touchscreen_dmi: Add info for the Positivo C4128B + - cpufreq: schedutil: Update next_freq when cpufreq_limits change + - Bluetooth: hci_sync: Fix not handling ISO_LINK in hci_abort_conn_sync + - Bluetooth: hci_sync: Introduce PTR_UINT/UINT_PTR macros + - Bluetooth: ISO: Fix invalid context error + - Bluetooth: hci_sync: delete CIS in BT_OPEN/CONNECT/BOUND when aborting + - Bluetooth: hci_sync: always check if connection is alive before deleting + - net/mlx5: E-switch, register event handler before arming the event + - net/mlx5: Handle fw tracer change ownership event based on MTRC + - net/mlx5e: RX, Fix page_pool allocation failure recovery for striding rq + - net/mlx5e: RX, Fix page_pool allocation failure recovery for legacy rq + - net/mlx5e: XDP, Fix XDP_REDIRECT mpwqe page fragment leaks on shutdown + - net/mlx5e: Take RTNL lock before triggering netdev notifiers + - net/mlx5e: Don't offload internal port if filter device is out device + - net/mlx5e: Fix VF representors reporting zero counters to "ip -s" command + - net/tls: split tls_rx_reader_lock + - tcp: allow again tcp_disconnect() when threads are waiting + - Bluetooth: hci_event: Fix using memcmp when comparing keys + - tcp_bpf: properly release resources on error paths + - mtd: rawnand: qcom: Unmap the right resource upon probe failure + - mtd: rawnand: pl353: Ensure program page operations are successful + - mtd: rawnand: marvell: Ensure program page operations are successful + - mtd: rawnand: arasan: Ensure program page operations are successful + - mtd: rawnand: Ensure the nand chip supports cached reads + - mtd: spinand: micron: correct bitmask for ecc status + - mtd: physmap-core: Restore map_rom fallback + - dt-bindings: mmc: sdhci-msm: correct minimum number of clocks + - mmc: sdhci-pci-gli: fix LPM negotiation so x86/S0ix SoCs can suspend + - mmc: mtk-sd: Use readl_poll_timeout_atomic in msdc_reset_hw + - mmc: core: Fix error propagation for some ioctl commands + - mmc: core: sdio: hold retuning if sdio in 1-bit mode + - pinctrl: qcom: lpass-lpi: fix concurrent register updates + - pNFS: Fix a hang in nfs4_evict_inode() + - pNFS/flexfiles: Check the layout validity in ff_layout_mirror_prepare_stats + - NFSv4.1: fixup use EXCHGID4_FLAG_USE_PNFS_DS for DS server + - ACPI: irq: Fix incorrect return value in acpi_register_gsi() + - ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init() + - perf dlfilter: Fix use of addr_location__exit() in dlfilter__object_code() + - fanotify: limit reporting of event with non-decodeable file handles + - NFS: Fix potential oops in nfs_inode_remove_request() + - nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op + - nvme: sanitize metadata bounce buffer for reads + - nvme-pci: add BOGUS_NID for Intel 0a54 device + - nvme-auth: use chap->s2 to indicate bidirectional authentication + - nvmet-auth: complete a request only after freeing the dhchap pointers + - nvme-rdma: do not try to stop unallocated queues + - USB: serial: option: add Telit LE910C4-WWX 0x1035 composition + - USB: serial: option: add entry for Sierra EM9191 with new firmware + - USB: serial: option: add Fibocom to DELL custom modem FM101R-GL + - thunderbolt: Call tb_switch_put() once DisplayPort bandwidth request is + finished + - s390/pci: fix iommu bitmap allocation + - tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols + - selftests/ftrace: Add new test case which checks non unique symbol + - KEYS: asymmetric: Fix sign/verify on pkcs1pad without a hash + - apple-gmux: Hard Code max brightness for MMIO gmux + - s390/cio: fix a memleak in css_alloc_subchannel + - platform/surface: platform_profile: Propagate error if profile registration + fails + - platform/x86: intel-uncore-freq: Conditionally create attribute for read + frequency + - platform/x86: msi-ec: Fix the 3rd config + - platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e + - platform/x86: asus-wmi: Only map brightness codes when using asus-wmi + backlight control + - platform/x86: asus-wmi: Map 0x2a code, Ignore 0x2b and 0x2c events + - rust: error: fix the description for `ECHILD` + - gpiolib: acpi: Add missing memset(0) to acpi_get_gpiod_from_data() + - gpio: vf610: set value before the direction to avoid a glitch + - gpio: vf610: mask the gpio irq in system suspend and support wakeup + - ASoC: cs35l56: Fix illegal use of init_completion() + - ASoC: pxa: fix a memory leak in probe() + - ASoC: cs42l42: Fix missing include of gpio/consumer.h + - drm/bridge: ti-sn65dsi86: Associate DSI device lifetime with auxiliary + device + - drm/i915/cx0: Only clear/set the Pipe Reset bit of the PHY Lanes Owned + - drm/amdgpu: Fix possible null pointer dereference + - powerpc/mm: Allow ARCH_FORCE_MAX_ORDER up to 12 + - powerpc/qspinlock: Fix stale propagated yield_cpu + - docs: Move rustdoc output, cross-reference it + - rust: docs: fix logo replacement + - phy: mapphone-mdm6600: Fix runtime disable on probe + - phy: mapphone-mdm6600: Fix runtime PM for remove + - phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins + - phy: qcom-qmp-usb: initialize PCS_USB registers + - phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p + - phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1 + - phy: qcom-qmp-combo: initialize PCS_USB registers + - efi/unaccepted: Fix soft lockups caused by parallel memory acceptance + - net: move altnames together with the netdevice + - Bluetooth: hci_sock: fix slab oob read in create_monitor_event + - net: rfkill: reduce data->mtx scope in rfkill_fop_open + - docs: rust: update Rust docs output path + - kbuild: remove old Rust docs output path + - Bluetooth: hci_sock: Correctly bounds check and pad HCI_MON_NEW_INDEX name + - mptcp: avoid sending RST when closing the initial subflow + - selftests: mptcp: join: correctly check for no RST + - Linux 6.5.9 + * CVE-2023-51779 + - Bluetooth: af_bluetooth: Fix Use-After-Free in bt_sock_recvmsg + + -- Philip Cox Tue, 20 Feb 2024 13:39:22 -0500 + linux-aws-6.5 (6.5.0-1014.14~22.04.1) jammy; urgency=medium * jammy/linux-aws-6.5: 6.5.0-1014.14~22.04.1 -proposed tracker (LP: #2052270) diff -u linux-aws-6.5-6.5.0/debian.aws-6.5/reconstruct linux-aws-6.5-6.5.0/debian.aws-6.5/reconstruct --- linux-aws-6.5-6.5.0/debian.aws-6.5/reconstruct +++ linux-aws-6.5-6.5.0/debian.aws-6.5/reconstruct @@ -49,9 +49,12 @@ chmod +x 'debian/tests/rebuild' chmod +x 'debian/tests/ubuntu-regression-suite' chmod +x 'drivers/watchdog/f71808e_wdt.c' +chmod +x 'tools/testing/selftests/netfilter/conntrack_sctp_collision.sh' chmod +x 'tools/testing/selftests/netfilter/nft_audit.sh' +chmod +x 'tools/testing/selftests/netfilter/xt_string.sh' chmod +x 'update-dkms-versions' # Remove any files deleted from the orig. +rm -f 'Documentation/networking/device_drivers/ethernet/mellanox/mlx5/devlink.rst' rm -f 'arch/parisc/include/asm/mckinley.h' rm -f 'drivers/media/pci/intel/ipu3/cio2-bridge.c' rm -f 'drivers/media/pci/intel/ipu3/cio2-bridge.h' diff -u linux-aws-6.5-6.5.0/debian.aws-6.5/tracking-bug linux-aws-6.5-6.5.0/debian.aws-6.5/tracking-bug --- linux-aws-6.5-6.5.0/debian.aws-6.5/tracking-bug +++ linux-aws-6.5-6.5.0/debian.aws-6.5/tracking-bug @@ -1 +1 @@ -2052270 s2024.01.08-1 +2052020 2024.02.05-1 diff -u linux-aws-6.5-6.5.0/debian.aws/abi/abiname linux-aws-6.5-6.5.0/debian.aws/abi/abiname --- linux-aws-6.5-6.5.0/debian.aws/abi/abiname +++ linux-aws-6.5-6.5.0/debian.aws/abi/abiname @@ -1 +1 @@ -1013 +1014 diff -u linux-aws-6.5-6.5.0/debian.aws/abi/amd64/aws linux-aws-6.5-6.5.0/debian.aws/abi/amd64/aws --- linux-aws-6.5-6.5.0/debian.aws/abi/amd64/aws +++ linux-aws-6.5-6.5.0/debian.aws/abi/amd64/aws @@ -5973,6 +5973,7 @@ EXPORT_SYMBOL vmlinux 0x0938c131 __invalidate_device EXPORT_SYMBOL vmlinux 0x094ab2bb jbd2_journal_set_features EXPORT_SYMBOL vmlinux 0x094ac47a ip_route_input_noref +EXPORT_SYMBOL vmlinux 0x094e9788 wake_up_process EXPORT_SYMBOL vmlinux 0x0966e107 __x86_indirect_call_thunk_r9 EXPORT_SYMBOL vmlinux 0x096cd61c config_item_get EXPORT_SYMBOL vmlinux 0x09769037 dmt_modes @@ -6250,6 +6251,7 @@ EXPORT_SYMBOL vmlinux 0x15f6b9bf __inode_add_bytes EXPORT_SYMBOL vmlinux 0x15f90688 slhc_init EXPORT_SYMBOL vmlinux 0x15f9efcb flow_rule_match_enc_ipv4_addrs +EXPORT_SYMBOL vmlinux 0x160c1764 can_nice EXPORT_SYMBOL vmlinux 0x1618c678 netif_set_real_num_queues EXPORT_SYMBOL vmlinux 0x161fb4b8 __skb_vlan_pop EXPORT_SYMBOL vmlinux 0x1625040f seg6_push_hmac @@ -7156,6 +7158,7 @@ EXPORT_SYMBOL vmlinux 0x3f2360fc devm_ioremap EXPORT_SYMBOL vmlinux 0x3f2b6fab copy_splice_read EXPORT_SYMBOL vmlinux 0x3f2c0cf7 pci_save_state +EXPORT_SYMBOL vmlinux 0x3f308f39 set_user_nice EXPORT_SYMBOL vmlinux 0x3f34644d zstd_dstream_workspace_bound EXPORT_SYMBOL vmlinux 0x3f4547a7 put_unused_fd EXPORT_SYMBOL vmlinux 0x3f4bd846 gen_pool_first_fit_order_align @@ -7350,7 +7353,6 @@ EXPORT_SYMBOL vmlinux 0x47c0c7e2 mr_mfc_find_any EXPORT_SYMBOL vmlinux 0x47c20f8a refcount_dec_not_one EXPORT_SYMBOL vmlinux 0x47c65bfc unregister_inet6addr_validator_notifier -EXPORT_SYMBOL vmlinux 0x47c811d1 io_uring_get_socket EXPORT_SYMBOL vmlinux 0x47cda76a bdi_register EXPORT_SYMBOL vmlinux 0x47cfd825 kstrtouint_from_user EXPORT_SYMBOL vmlinux 0x47d8d301 __cond_resched_rwlock_read @@ -10095,7 +10097,6 @@ EXPORT_SYMBOL vmlinux 0xc02ee3da mipi_dsi_dcs_set_display_on EXPORT_SYMBOL vmlinux 0xc0364007 fault_in_writeable EXPORT_SYMBOL vmlinux 0xc048415c __SCK__tp_func_kfree -EXPORT_SYMBOL vmlinux 0xc05c4cf5 set_user_nice EXPORT_SYMBOL vmlinux 0xc060c3f4 page_pool_ethtool_stats_get EXPORT_SYMBOL vmlinux 0xc07110d6 phy_drivers_unregister EXPORT_SYMBOL vmlinux 0xc0763484 rfkill_blocked @@ -10599,7 +10600,6 @@ EXPORT_SYMBOL vmlinux 0xd6b8649c generic_write_checks EXPORT_SYMBOL vmlinux 0xd6ba4821 __traceiter_kmem_cache_free EXPORT_SYMBOL vmlinux 0xd6cc42ef md_integrity_add_rdev -EXPORT_SYMBOL vmlinux 0xd6cc4fc8 can_nice EXPORT_SYMBOL vmlinux 0xd6cdd763 skb_copy_expand EXPORT_SYMBOL vmlinux 0xd6eaaea1 full_name_hash EXPORT_SYMBOL vmlinux 0xd6ee688f vmalloc @@ -10848,7 +10848,6 @@ EXPORT_SYMBOL vmlinux 0xe0b13336 argv_free EXPORT_SYMBOL vmlinux 0xe0b9065b security_xfrm_policy_alloc EXPORT_SYMBOL vmlinux 0xe0bad060 genphy_c37_read_status -EXPORT_SYMBOL vmlinux 0xe0bea2db wake_up_process EXPORT_SYMBOL vmlinux 0xe0cec8cc serio_close EXPORT_SYMBOL vmlinux 0xe0e04731 sys_fillrect EXPORT_SYMBOL vmlinux 0xe0ed8d34 devm_extcon_unregister_notifier @@ -11142,6 +11141,7 @@ EXPORT_SYMBOL vmlinux 0xeec5050b iov_iter_gap_alignment EXPORT_SYMBOL vmlinux 0xeec9b6a8 skb_copy_datagram_from_iter EXPORT_SYMBOL vmlinux 0xeec9b8ff vga_get +EXPORT_SYMBOL vmlinux 0xeecdcc23 io_uring_get_socket EXPORT_SYMBOL vmlinux 0xeedb9f0d tcp_ioctl EXPORT_SYMBOL vmlinux 0xeeedcf8e pm860x_page_reg_write EXPORT_SYMBOL vmlinux 0xef0ff220 mipi_dsi_dcs_set_column_address @@ -18666,6 +18666,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x00f1a9da __tracepoint_napi_poll EXPORT_SYMBOL_GPL vmlinux 0x010b633b pci_epf_free_space EXPORT_SYMBOL_GPL vmlinux 0x011a0396 clk_hw_determine_rate_no_reparent +EXPORT_SYMBOL_GPL vmlinux 0x011cb88b __traceiter_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0x012e730e apei_exec_noop EXPORT_SYMBOL_GPL vmlinux 0x0131443f __auxiliary_driver_register EXPORT_SYMBOL_GPL vmlinux 0x01374fb2 cpufreq_disable_fast_switch @@ -18779,6 +18780,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x052b4013 register_vmcore_cb EXPORT_SYMBOL_GPL vmlinux 0x052c9aed ktime_get_real_fast_ns EXPORT_SYMBOL_GPL vmlinux 0x05300676 pci_free_p2pmem +EXPORT_SYMBOL_GPL vmlinux 0x053ab9a3 __tracepoint_ipi_send_cpu EXPORT_SYMBOL_GPL vmlinux 0x05497390 fwnode_get_named_child_node EXPORT_SYMBOL_GPL vmlinux 0x054e550b kernel_halt EXPORT_SYMBOL_GPL vmlinux 0x05545edf kstrdup_quotable_cmdline @@ -18800,6 +18802,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x0610a1a8 peernet2id_alloc EXPORT_SYMBOL_GPL vmlinux 0x061336ae blocking_notifier_chain_register_unique_prio EXPORT_SYMBOL_GPL vmlinux 0x06209f49 phy_lookup_setting +EXPORT_SYMBOL_GPL vmlinux 0x06221362 __SCK__tp_func_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0x0626da5f od_unregister_powersave_bias_handler EXPORT_SYMBOL_GPL vmlinux 0x062b89c4 ghes_unregister_report_chain EXPORT_SYMBOL_GPL vmlinux 0x063ef5a1 acpi_register_gsi @@ -18819,7 +18822,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x06cca30b ring_buffer_record_off EXPORT_SYMBOL_GPL vmlinux 0x06e36313 clk_hw_get_parent_by_index EXPORT_SYMBOL_GPL vmlinux 0x06ea80a0 disk_set_independent_access_ranges -EXPORT_SYMBOL_GPL vmlinux 0x06eebfff __traceiter_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x06f7f11d ata_sff_check_status EXPORT_SYMBOL_GPL vmlinux 0x06f86ad5 irq_domain_disconnect_hierarchy EXPORT_SYMBOL_GPL vmlinux 0x0702f1dc devm_gpiod_get_array_optional @@ -18872,7 +18874,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x08bf9c7d vcap_tc_flower_handler_ipv4_usage EXPORT_SYMBOL_GPL vmlinux 0x08c78cf7 offline_and_remove_memory EXPORT_SYMBOL_GPL vmlinux 0x08cef620 crypto_shash_setkey -EXPORT_SYMBOL_GPL vmlinux 0x08d18a14 __tracepoint_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x08d1d949 regulator_enable_regmap EXPORT_SYMBOL_GPL vmlinux 0x08db1da5 devm_request_pci_bus_resources EXPORT_SYMBOL_GPL vmlinux 0x08e2a8af securityfs_remove @@ -18915,7 +18916,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x0a8162a8 raw_v4_hashinfo EXPORT_SYMBOL_GPL vmlinux 0x0a8894f4 mas_find_range_rev EXPORT_SYMBOL_GPL vmlinux 0x0a894fdb mctrl_gpio_init -EXPORT_SYMBOL_GPL vmlinux 0x0a8acc4a __tracepoint_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x0a8e458b crypto_req_done EXPORT_SYMBOL_GPL vmlinux 0x0a942799 crypto_akcipher_sync_decrypt EXPORT_SYMBOL_GPL vmlinux 0x0a94911b dev_pm_genpd_resume @@ -19121,7 +19121,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x126b17d9 dw_pcie_find_capability EXPORT_SYMBOL_GPL vmlinux 0x126c80fb blk_set_pm_only EXPORT_SYMBOL_GPL vmlinux 0x127694cd regmap_mmio_detach_clk -EXPORT_SYMBOL_GPL vmlinux 0x12777c19 io_uring_cmd_do_in_task_lazy EXPORT_SYMBOL_GPL vmlinux 0x127c109b __SCT__tp_func_suspend_resume EXPORT_SYMBOL_GPL vmlinux 0x128a7397 clkdev_hw_create EXPORT_SYMBOL_GPL vmlinux 0x128ce550 pcie_aspm_enabled @@ -19192,7 +19191,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x150b906c regmap_bulk_write EXPORT_SYMBOL_GPL vmlinux 0x151bfca7 tpm_chip_register EXPORT_SYMBOL_GPL vmlinux 0x151ce81f __SCK__tp_func_sk_data_ready -EXPORT_SYMBOL_GPL vmlinux 0x1522d251 __tracepoint_ipi_send_cpumask EXPORT_SYMBOL_GPL vmlinux 0x152ed1b0 platform_get_resource_byname EXPORT_SYMBOL_GPL vmlinux 0x153761cf usb_wakeup_notification EXPORT_SYMBOL_GPL vmlinux 0x1537a0ee led_trigger_unregister @@ -19200,7 +19198,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x15510a89 devlink_fmsg_binary_put EXPORT_SYMBOL_GPL vmlinux 0x15654ce9 pm_clk_runtime_suspend EXPORT_SYMBOL_GPL vmlinux 0x156e8afe __SCT__tp_func_fib6_table_lookup -EXPORT_SYMBOL_GPL vmlinux 0x15746a3a set_cpus_allowed_ptr EXPORT_SYMBOL_GPL vmlinux 0x15886f48 hte_disable_ts EXPORT_SYMBOL_GPL vmlinux 0x1593945b spi_setup EXPORT_SYMBOL_GPL vmlinux 0x159e3a1c debugfs_create_u64 @@ -19209,6 +19206,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x15b9e4c5 vp_legacy_get_queue_size EXPORT_SYMBOL_GPL vmlinux 0x15bd7435 psi_memstall_leave EXPORT_SYMBOL_GPL vmlinux 0x15d05085 usb_set_interface +EXPORT_SYMBOL_GPL vmlinux 0x15e14330 __SCK__tp_func_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0x15e6f667 device_reprobe EXPORT_SYMBOL_GPL vmlinux 0x15ea2648 hwpoison_filter_flags_mask EXPORT_SYMBOL_GPL vmlinux 0x15ed4bae vcap_find_admin @@ -19405,7 +19403,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x1d7a81e7 skb_scrub_packet EXPORT_SYMBOL_GPL vmlinux 0x1d8e6759 devl_dpipe_table_register EXPORT_SYMBOL_GPL vmlinux 0x1d91d3ce of_hwspin_lock_get_id -EXPORT_SYMBOL_GPL vmlinux 0x1d92c484 __tracepoint_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x1d94a218 dmi_memdev_handle EXPORT_SYMBOL_GPL vmlinux 0x1d97e0bf fuse_file_poll EXPORT_SYMBOL_GPL vmlinux 0x1db2e852 l3mdev_link_scope_lookup @@ -19430,6 +19427,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x1e4bb8ae kill_pid_usb_asyncio EXPORT_SYMBOL_GPL vmlinux 0x1e52b3c1 generic_online_page EXPORT_SYMBOL_GPL vmlinux 0x1e53f827 stack_depot_print +EXPORT_SYMBOL_GPL vmlinux 0x1e560460 sched_setattr_nocheck EXPORT_SYMBOL_GPL vmlinux 0x1e5a5f22 sn_partition_id EXPORT_SYMBOL_GPL vmlinux 0x1e66827b i2c_add_numbered_adapter EXPORT_SYMBOL_GPL vmlinux 0x1e70176b add_disk_randomness @@ -19442,7 +19440,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x1e9c590a usb_find_common_endpoints_reverse EXPORT_SYMBOL_GPL vmlinux 0x1eb9516e round_jiffies_relative EXPORT_SYMBOL_GPL vmlinux 0x1ebf6c2a pci_power_names -EXPORT_SYMBOL_GPL vmlinux 0x1ec4b8ef __tracepoint_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0x1ed4d2eb percpu_ref_kill_and_confirm EXPORT_SYMBOL_GPL vmlinux 0x1ed87360 xen_pci_frontend EXPORT_SYMBOL_GPL vmlinux 0x1ee47e00 is_vmalloc_or_module_addr @@ -19609,7 +19606,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x2528273c metadata_dst_free_percpu EXPORT_SYMBOL_GPL vmlinux 0x25301bc6 arch_wb_cache_pmem EXPORT_SYMBOL_GPL vmlinux 0x25379e73 clk_set_min_rate -EXPORT_SYMBOL_GPL vmlinux 0x253ce1ba io_uring_cmd_done EXPORT_SYMBOL_GPL vmlinux 0x25531469 gpiod_get_index EXPORT_SYMBOL_GPL vmlinux 0x2565dac9 sysfs_unmerge_group EXPORT_SYMBOL_GPL vmlinux 0x257393ea ata_sff_exec_command @@ -19621,7 +19617,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x25ae84d7 __kthread_init_worker EXPORT_SYMBOL_GPL vmlinux 0x25b1f0b1 power_supply_get_property_from_supplier EXPORT_SYMBOL_GPL vmlinux 0x25bbfa9a security_kernel_load_data -EXPORT_SYMBOL_GPL vmlinux 0x25c0c80d __SCK__tp_func_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0x25db7e68 lp8788_write_byte EXPORT_SYMBOL_GPL vmlinux 0x25e37f82 spi_mem_poll_status EXPORT_SYMBOL_GPL vmlinux 0x25eecc4d pci_bus_add_device @@ -19733,9 +19728,11 @@ EXPORT_SYMBOL_GPL vmlinux 0x29eba37f current_is_async EXPORT_SYMBOL_GPL vmlinux 0x29f3b02a devm_hwrng_register EXPORT_SYMBOL_GPL vmlinux 0x29f6a847 platform_device_unregister +EXPORT_SYMBOL_GPL vmlinux 0x29ffcead __tracepoint_ipi_send_cpumask EXPORT_SYMBOL_GPL vmlinux 0x2a07333a nvdimm_bus_unregister EXPORT_SYMBOL_GPL vmlinux 0x2a0783dd gpiod_disable_hw_timestamp_ns EXPORT_SYMBOL_GPL vmlinux 0x2a0ef55b nvdimm_delete +EXPORT_SYMBOL_GPL vmlinux 0x2a1c7fee __tracepoint_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0x2a2e1b99 kernfs_notify EXPORT_SYMBOL_GPL vmlinux 0x2a2f04fa ip_tunnel_netlink_parms EXPORT_SYMBOL_GPL vmlinux 0x2a316472 usb_create_shared_hcd @@ -19836,7 +19833,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x2e2df7f4 irq_remapping_cap EXPORT_SYMBOL_GPL vmlinux 0x2e2fc64a crypto_register_aeads EXPORT_SYMBOL_GPL vmlinux 0x2e387fa9 phy_modify_changed -EXPORT_SYMBOL_GPL vmlinux 0x2e3c0689 __SCK__tp_func_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0x2e5d44e8 fib6_check_nexthop EXPORT_SYMBOL_GPL vmlinux 0x2e65b188 unregister_kretprobe EXPORT_SYMBOL_GPL vmlinux 0x2e6b93e8 crypto_unregister_shash @@ -19894,7 +19890,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x3046f6c2 pci_alloc_p2pmem EXPORT_SYMBOL_GPL vmlinux 0x3049ca5e gpiochip_add_pin_range EXPORT_SYMBOL_GPL vmlinux 0x304c86b5 acpi_dev_pm_attach -EXPORT_SYMBOL_GPL vmlinux 0x304df02f sched_set_normal EXPORT_SYMBOL_GPL vmlinux 0x305363ab acpi_dev_remove_driver_gpios EXPORT_SYMBOL_GPL vmlinux 0x3061cfce ring_buffer_entries_cpu EXPORT_SYMBOL_GPL vmlinux 0x306d1b10 mnt_want_write_file @@ -19924,7 +19919,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x3156bfc3 tty_buffer_unlock_exclusive EXPORT_SYMBOL_GPL vmlinux 0x3165daa3 arbitrary_virt_to_machine EXPORT_SYMBOL_GPL vmlinux 0x31706316 __SCT__tp_func_error_report_end -EXPORT_SYMBOL_GPL vmlinux 0x3176ef4c __traceiter_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0x31773ea3 __tracepoint_rpm_resume EXPORT_SYMBOL_GPL vmlinux 0x31776110 device_get_child_node_count EXPORT_SYMBOL_GPL vmlinux 0x31824c8b pci_find_ext_capability @@ -20047,6 +20041,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x355bc89a klist_next EXPORT_SYMBOL_GPL vmlinux 0x35622fea devm_regulator_unregister_notifier EXPORT_SYMBOL_GPL vmlinux 0x3565a929 utf8_data_table +EXPORT_SYMBOL_GPL vmlinux 0x3566128b __traceiter_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x35666fc5 led_blink_set_nosleep EXPORT_SYMBOL_GPL vmlinux 0x356d09a1 unregister_kprobes EXPORT_SYMBOL_GPL vmlinux 0x358ff60f twl_get_hfclk_rate @@ -20060,7 +20055,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x35e9e8b3 md_rdev_clear EXPORT_SYMBOL_GPL vmlinux 0x35f94061 pm_runtime_barrier EXPORT_SYMBOL_GPL vmlinux 0x35fd6327 led_classdev_unregister -EXPORT_SYMBOL_GPL vmlinux 0x3603985f __SCK__tp_func_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0x3610b18b __blkg_prfill_rwstat EXPORT_SYMBOL_GPL vmlinux 0x36173c1d phys_to_target_node EXPORT_SYMBOL_GPL vmlinux 0x3618322f regmap_register_patch @@ -20192,7 +20186,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x3abb891d dev_pm_opp_get_opp_table EXPORT_SYMBOL_GPL vmlinux 0x3abdc17a cper_dimm_err_location EXPORT_SYMBOL_GPL vmlinux 0x3ac11c9a pm_generic_poweroff_late -EXPORT_SYMBOL_GPL vmlinux 0x3ac1c79a __traceiter_pelt_rt_tp +EXPORT_SYMBOL_GPL vmlinux 0x3ac2e9ad io_uring_cmd_import_fixed EXPORT_SYMBOL_GPL vmlinux 0x3ac3feba rhltable_init EXPORT_SYMBOL_GPL vmlinux 0x3acdf325 twl4030_audio_enable_resource EXPORT_SYMBOL_GPL vmlinux 0x3ae42cc8 __unwind_start @@ -20262,7 +20256,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x3d388324 dpm_resume_end EXPORT_SYMBOL_GPL vmlinux 0x3d472b3c devl_rate_nodes_destroy EXPORT_SYMBOL_GPL vmlinux 0x3d510a7b rcu_jiffies_till_stall_check -EXPORT_SYMBOL_GPL vmlinux 0x3d74716a __SCK__tp_func_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x3d7669c0 devl_port_register_with_ops EXPORT_SYMBOL_GPL vmlinux 0x3d7691f5 power_supply_get_drvdata EXPORT_SYMBOL_GPL vmlinux 0x3d7cb9f7 iommu_sva_get_pasid @@ -20304,7 +20297,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x3ebc6826 phy_save_page EXPORT_SYMBOL_GPL vmlinux 0x3ec93255 hv_get_isolation_type EXPORT_SYMBOL_GPL vmlinux 0x3edb086b pse_control_put -EXPORT_SYMBOL_GPL vmlinux 0x3eec3ed7 __SCK__tp_func_ipi_send_cpumask EXPORT_SYMBOL_GPL vmlinux 0x3ef051c8 crypto_inc EXPORT_SYMBOL_GPL vmlinux 0x3efbf971 devm_regmap_field_free EXPORT_SYMBOL_GPL vmlinux 0x3f23cfb8 sysfs_file_change_owner @@ -20334,6 +20326,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x3ff2e349 hte_request_ts_ns EXPORT_SYMBOL_GPL vmlinux 0x3ff5b2f4 pci_reset_function EXPORT_SYMBOL_GPL vmlinux 0x3ffdacf3 timerqueue_iterate_next +EXPORT_SYMBOL_GPL vmlinux 0x4005be76 kick_process EXPORT_SYMBOL_GPL vmlinux 0x400a024b acpi_scan_lock_release EXPORT_SYMBOL_GPL vmlinux 0x40131b3f inet_csk_listen_stop EXPORT_SYMBOL_GPL vmlinux 0x40258c3b tty_standard_install @@ -20343,7 +20336,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x403f9529 gpio_request_one EXPORT_SYMBOL_GPL vmlinux 0x4043757f init_iova_domain EXPORT_SYMBOL_GPL vmlinux 0x404ba2b8 fib_nl_delrule -EXPORT_SYMBOL_GPL vmlinux 0x40540326 sched_show_task EXPORT_SYMBOL_GPL vmlinux 0x4061e0c6 request_firmware_direct EXPORT_SYMBOL_GPL vmlinux 0x4065d168 pm_print_active_wakeup_sources EXPORT_SYMBOL_GPL vmlinux 0x406c4cb1 hrtimer_resolution @@ -20397,9 +20389,9 @@ EXPORT_SYMBOL_GPL vmlinux 0x42041512 i2c_get_dma_safe_msg_buf EXPORT_SYMBOL_GPL vmlinux 0x42069923 ata_sff_prereset EXPORT_SYMBOL_GPL vmlinux 0x420f3d01 nvmem_unregister_notifier -EXPORT_SYMBOL_GPL vmlinux 0x42128ec3 sched_setattr_nocheck EXPORT_SYMBOL_GPL vmlinux 0x42133288 gpiochip_irqchip_add_domain EXPORT_SYMBOL_GPL vmlinux 0x4213399a devm_hte_register_chip +EXPORT_SYMBOL_GPL vmlinux 0x4220eb43 __SCK__tp_func_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x422ccae2 vchan_find_desc EXPORT_SYMBOL_GPL vmlinux 0x422e578a __SCT__tp_func_add_device_to_group EXPORT_SYMBOL_GPL vmlinux 0x42615314 root_device_unregister @@ -20466,6 +20458,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x44a50ca5 acpi_get_first_physical_node EXPORT_SYMBOL_GPL vmlinux 0x44bae227 bit_wait_timeout EXPORT_SYMBOL_GPL vmlinux 0x44c10a52 kvfree_call_rcu +EXPORT_SYMBOL_GPL vmlinux 0x44cf092c preempt_notifier_register EXPORT_SYMBOL_GPL vmlinux 0x44cf8cf0 blk_zone_cond_str EXPORT_SYMBOL_GPL vmlinux 0x44d7c0f4 da903x_unregister_notifier EXPORT_SYMBOL_GPL vmlinux 0x44e1e9aa balloon_stats @@ -20497,7 +20490,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x45b33e15 devm_regmap_field_alloc EXPORT_SYMBOL_GPL vmlinux 0x45b51296 ata_change_queue_depth EXPORT_SYMBOL_GPL vmlinux 0x45b56a31 clk_hw_rate_is_protected -EXPORT_SYMBOL_GPL vmlinux 0x45c431db __SCK__tp_func_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x45d14bdf hypercall_page EXPORT_SYMBOL_GPL vmlinux 0x45d733cd blkcg_policy_register EXPORT_SYMBOL_GPL vmlinux 0x45da2095 vp_modern_get_num_queues @@ -20832,9 +20824,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x5261a263 __SCK__tp_func_nvme_sq EXPORT_SYMBOL_GPL vmlinux 0x526322cb umd_load_blob EXPORT_SYMBOL_GPL vmlinux 0x52647db1 ct_idle_exit -EXPORT_SYMBOL_GPL vmlinux 0x526a8767 __traceiter_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x527105ef da9052_free_irq -EXPORT_SYMBOL_GPL vmlinux 0x52742e30 __tracepoint_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0x528a58e7 exportfs_encode_fh EXPORT_SYMBOL_GPL vmlinux 0x529001a9 vp_legacy_remove EXPORT_SYMBOL_GPL vmlinux 0x52913d9d sdev_evt_send_simple @@ -20844,10 +20834,10 @@ EXPORT_SYMBOL_GPL vmlinux 0x52c62de2 irq_create_fwspec_mapping EXPORT_SYMBOL_GPL vmlinux 0x52cbf381 devl_param_driverinit_value_set EXPORT_SYMBOL_GPL vmlinux 0x52d54fce devlink_info_version_stored_put -EXPORT_SYMBOL_GPL vmlinux 0x52dc3915 __SCK__tp_func_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x52eddb69 raw_v6_hashinfo EXPORT_SYMBOL_GPL vmlinux 0x52f829fb acpi_unbind_one EXPORT_SYMBOL_GPL vmlinux 0x52fd035f shash_no_setkey +EXPORT_SYMBOL_GPL vmlinux 0x5305cc5c __SCK__tp_func_ipi_send_cpu EXPORT_SYMBOL_GPL vmlinux 0x530b1b8d usb_anchor_urb EXPORT_SYMBOL_GPL vmlinux 0x530e0f8c devl_health_reporter_destroy EXPORT_SYMBOL_GPL vmlinux 0x5314d1ae crypto_find_alg @@ -20896,6 +20886,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x5513b4fd adp5520_read EXPORT_SYMBOL_GPL vmlinux 0x5532ca68 xfrm_dev_offload_ok EXPORT_SYMBOL_GPL vmlinux 0x55339365 flush_delayed_fput +EXPORT_SYMBOL_GPL vmlinux 0x5538e38d __SCK__tp_func_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x553b49a4 cpufreq_get_driver_data EXPORT_SYMBOL_GPL vmlinux 0x553c023f mddev_resume EXPORT_SYMBOL_GPL vmlinux 0x55417264 unregister_vt_notifier @@ -20952,6 +20943,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x576cd9bc __traceiter_add_device_to_group EXPORT_SYMBOL_GPL vmlinux 0x576e9ed9 usb_match_id EXPORT_SYMBOL_GPL vmlinux 0x57719632 gnttab_grant_foreign_access +EXPORT_SYMBOL_GPL vmlinux 0x5780f204 __traceiter_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x5784da03 debugfs_print_regs32 EXPORT_SYMBOL_GPL vmlinux 0x57861a5c gds_ucode_mitigated EXPORT_SYMBOL_GPL vmlinux 0x578eeb4d hugetlb_cgrp_subsys_enabled_key @@ -20985,6 +20977,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x58b3376b regulator_get_bypass_regmap EXPORT_SYMBOL_GPL vmlinux 0x58b69e32 devm_register_restart_handler EXPORT_SYMBOL_GPL vmlinux 0x58bb8223 smp_ops +EXPORT_SYMBOL_GPL vmlinux 0x58bbd339 __traceiter_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x58cb0cd9 fscrypt_ioctl_remove_key EXPORT_SYMBOL_GPL vmlinux 0x58d2201f platform_add_devices EXPORT_SYMBOL_GPL vmlinux 0x58d39285 nvme_start_freeze @@ -21281,7 +21274,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x643d2246 regmap_attach_dev EXPORT_SYMBOL_GPL vmlinux 0x6456d570 clk_register_gate EXPORT_SYMBOL_GPL vmlinux 0x645fb8da pci_epc_write_header -EXPORT_SYMBOL_GPL vmlinux 0x6472ac55 __SCK__tp_func_pelt_thermal_tp +EXPORT_SYMBOL_GPL vmlinux 0x6482d53c __tracepoint_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0x648dfc82 list_lru_add EXPORT_SYMBOL_GPL vmlinux 0x648f579f devm_kmalloc EXPORT_SYMBOL_GPL vmlinux 0x648f59a9 sfp_module_insert @@ -21368,6 +21361,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x6739a503 balloon_set_new_target EXPORT_SYMBOL_GPL vmlinux 0x67410255 devlink_linecard_nested_dl_set EXPORT_SYMBOL_GPL vmlinux 0x6741e901 blk_queue_flag_test_and_set +EXPORT_SYMBOL_GPL vmlinux 0x67461ecf set_cpus_allowed_ptr EXPORT_SYMBOL_GPL vmlinux 0x674c5bc1 nvme_auth_hmac_name EXPORT_SYMBOL_GPL vmlinux 0x6756e582 regulator_enable EXPORT_SYMBOL_GPL vmlinux 0x6759bd00 __SCT__tp_func_rpm_idle @@ -21475,12 +21469,12 @@ EXPORT_SYMBOL_GPL vmlinux 0x6b0eaa18 hv_ghcb_msr_read EXPORT_SYMBOL_GPL vmlinux 0x6b11b9d5 rt_mutex_lock_killable EXPORT_SYMBOL_GPL vmlinux 0x6b1942ad __tracepoint_ata_bmdma_status +EXPORT_SYMBOL_GPL vmlinux 0x6b2346ad __tracepoint_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x6b2b69f7 static_key_enable EXPORT_SYMBOL_GPL vmlinux 0x6b35a16b intel_scu_ipc_dev_get EXPORT_SYMBOL_GPL vmlinux 0x6b38ed35 rio_local_set_device_id EXPORT_SYMBOL_GPL vmlinux 0x6b3ae022 acpi_os_unmap_iomem EXPORT_SYMBOL_GPL vmlinux 0x6b413c9b sfp_link_down -EXPORT_SYMBOL_GPL vmlinux 0x6b6870c6 __io_uring_cmd_do_in_task EXPORT_SYMBOL_GPL vmlinux 0x6b7a4335 hyperv_cleanup EXPORT_SYMBOL_GPL vmlinux 0x6b81c38b power_supply_unreg_notifier EXPORT_SYMBOL_GPL vmlinux 0x6b82c4a3 irq_gc_mask_set_bit @@ -21517,10 +21511,10 @@ EXPORT_SYMBOL_GPL vmlinux 0x6ccfd679 devm_power_supply_register EXPORT_SYMBOL_GPL vmlinux 0x6cd0c1e5 pm_runtime_set_autosuspend_delay EXPORT_SYMBOL_GPL vmlinux 0x6ce90882 devm_kasprintf +EXPORT_SYMBOL_GPL vmlinux 0x6ceb334d __tracepoint_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x6cfab41a xen_hvm_evtchn_do_upcall EXPORT_SYMBOL_GPL vmlinux 0x6cff907c vcap_get_rule EXPORT_SYMBOL_GPL vmlinux 0x6d04891d inet_getpeer -EXPORT_SYMBOL_GPL vmlinux 0x6d0501c8 __tracepoint_ipi_send_cpu EXPORT_SYMBOL_GPL vmlinux 0x6d09843f copy_bpf_fprog_from_user EXPORT_SYMBOL_GPL vmlinux 0x6d0ae550 pinctrl_gpio_request EXPORT_SYMBOL_GPL vmlinux 0x6d14c00a io_cgrp_subsys @@ -21749,7 +21743,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x749af7ac irq_work_queue EXPORT_SYMBOL_GPL vmlinux 0x749c0d12 cgroup_attach_task_all EXPORT_SYMBOL_GPL vmlinux 0x74ac7cef __platform_create_bundle -EXPORT_SYMBOL_GPL vmlinux 0x74b5c839 preempt_notifier_unregister EXPORT_SYMBOL_GPL vmlinux 0x74b5ea68 lcm_not_zero EXPORT_SYMBOL_GPL vmlinux 0x74baf17a tracing_is_on EXPORT_SYMBOL_GPL vmlinux 0x74bf2e01 scsi_pr_type_to_block @@ -21802,6 +21795,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7696efae bpf_trace_run12 EXPORT_SYMBOL_GPL vmlinux 0x769cefb5 percpu_ref_switch_to_atomic EXPORT_SYMBOL_GPL vmlinux 0x76a31f44 __devm_regmap_init_i2c +EXPORT_SYMBOL_GPL vmlinux 0x76bb9d94 sched_show_task EXPORT_SYMBOL_GPL vmlinux 0x76bf0190 spi_split_transfers_maxsize EXPORT_SYMBOL_GPL vmlinux 0x76c1a6b6 xhci_dbg_trace EXPORT_SYMBOL_GPL vmlinux 0x76c9315f crypto_register_scomp @@ -21819,6 +21813,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x773082af pci_set_pcie_reset_state EXPORT_SYMBOL_GPL vmlinux 0x77388439 tty_port_register_device_attr EXPORT_SYMBOL_GPL vmlinux 0x77389754 srcu_batches_completed +EXPORT_SYMBOL_GPL vmlinux 0x7741856e __tracepoint_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0x77522cf6 sbitmap_get_shallow EXPORT_SYMBOL_GPL vmlinux 0x7757b51a clk_unregister EXPORT_SYMBOL_GPL vmlinux 0x775ae404 pci_stop_root_bus @@ -21867,9 +21862,9 @@ EXPORT_SYMBOL_GPL vmlinux 0x789c73d9 rcu_cpu_stall_suppress_at_boot EXPORT_SYMBOL_GPL vmlinux 0x78bab66b irq_force_affinity EXPORT_SYMBOL_GPL vmlinux 0x78be7901 dev_pm_opp_find_freq_exact -EXPORT_SYMBOL_GPL vmlinux 0x78d124a7 kick_process EXPORT_SYMBOL_GPL vmlinux 0x78ddb76b dmi_match EXPORT_SYMBOL_GPL vmlinux 0x790be0b9 usb_bus_idr +EXPORT_SYMBOL_GPL vmlinux 0x790f20f1 __traceiter_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0x79109571 regmap_check_range_table EXPORT_SYMBOL_GPL vmlinux 0x7915cee5 do_machine_check EXPORT_SYMBOL_GPL vmlinux 0x7916343c __SCT__tp_func_br_mdb_full @@ -21937,7 +21932,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x7b64cbcb sysfs_remove_mount_point EXPORT_SYMBOL_GPL vmlinux 0x7b6b30f1 devm_regulator_get_enable EXPORT_SYMBOL_GPL vmlinux 0x7b6f9536 acpi_register_wakeup_handler -EXPORT_SYMBOL_GPL vmlinux 0x7b833dc9 __SCK__tp_func_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0x7b8910f4 kfence_sample_interval EXPORT_SYMBOL_GPL vmlinux 0x7b90d1a9 bind_virq_to_irqhandler EXPORT_SYMBOL_GPL vmlinux 0x7b9793a2 get_cpu_idle_time_us @@ -21958,6 +21952,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7c2c434a __fscrypt_inode_uses_inline_crypto EXPORT_SYMBOL_GPL vmlinux 0x7c30635f pcie_reset_flr EXPORT_SYMBOL_GPL vmlinux 0x7c35a36f fuse_init_fs_context_submount +EXPORT_SYMBOL_GPL vmlinux 0x7c3b4e63 __tracepoint_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x7c3d8a4b icc_bulk_put EXPORT_SYMBOL_GPL vmlinux 0x7c60b8e6 nvme_alloc_admin_tag_set EXPORT_SYMBOL_GPL vmlinux 0x7c983a5d dmi_walk @@ -21981,7 +21976,9 @@ EXPORT_SYMBOL_GPL vmlinux 0x7d00c65b nd_synchronize EXPORT_SYMBOL_GPL vmlinux 0x7d0e1d95 hv_setup_crash_handler EXPORT_SYMBOL_GPL vmlinux 0x7d1bb1d4 tnum_strn +EXPORT_SYMBOL_GPL vmlinux 0x7d1d3688 __traceiter_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x7d1e92c4 clockevents_config_and_register +EXPORT_SYMBOL_GPL vmlinux 0x7d46f1f4 __tracepoint_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0x7d48a446 tracepoint_probe_unregister EXPORT_SYMBOL_GPL vmlinux 0x7d509d9a regulator_get_exclusive EXPORT_SYMBOL_GPL vmlinux 0x7d59dd46 pm_wq @@ -21995,6 +21992,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7db8c839 crypto_hash_alg_has_setkey EXPORT_SYMBOL_GPL vmlinux 0x7dc4ec23 rtnl_get_net_ns_capable EXPORT_SYMBOL_GPL vmlinux 0x7dce4c12 blk_update_request +EXPORT_SYMBOL_GPL vmlinux 0x7dcf5437 preempt_notifier_unregister EXPORT_SYMBOL_GPL vmlinux 0x7dd04ab8 proc_create_net_data_write EXPORT_SYMBOL_GPL vmlinux 0x7dd27153 dst_cache_set_ip6 EXPORT_SYMBOL_GPL vmlinux 0x7dd4414b of_pm_clk_add_clks @@ -22030,7 +22028,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x7e8d8619 usb_anchor_empty EXPORT_SYMBOL_GPL vmlinux 0x7ea75c24 __wake_up_locked_key_bookmark EXPORT_SYMBOL_GPL vmlinux 0x7ea79c44 rt288x_setup -EXPORT_SYMBOL_GPL vmlinux 0x7eb74b40 sched_set_fifo_low EXPORT_SYMBOL_GPL vmlinux 0x7eb808d0 add_cpu EXPORT_SYMBOL_GPL vmlinux 0x7ec298e3 xhci_find_slot_id_by_port EXPORT_SYMBOL_GPL vmlinux 0x7ec8c9f9 tty_buffer_request_room @@ -22040,6 +22037,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7ef6030e fscrypt_set_bio_crypt_ctx EXPORT_SYMBOL_GPL vmlinux 0x7f03ab34 unregister_virtio_driver EXPORT_SYMBOL_GPL vmlinux 0x7f14ef4a device_find_child_by_name +EXPORT_SYMBOL_GPL vmlinux 0x7f16bc1a __SCK__tp_func_ipi_send_cpumask EXPORT_SYMBOL_GPL vmlinux 0x7f1e56a3 irqd_cfg EXPORT_SYMBOL_GPL vmlinux 0x7f27ffd7 fib4_rule_default EXPORT_SYMBOL_GPL vmlinux 0x7f3d5828 pm_generic_suspend_late @@ -22067,6 +22065,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x800553e1 bus_unregister_notifier EXPORT_SYMBOL_GPL vmlinux 0x8006093a fsstack_copy_inode_size EXPORT_SYMBOL_GPL vmlinux 0x800f2e72 pci_epc_get_features +EXPORT_SYMBOL_GPL vmlinux 0x800f416a __traceiter_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0x80228c33 tcp_splice_eof EXPORT_SYMBOL_GPL vmlinux 0x8033d2d3 uart_set_options EXPORT_SYMBOL_GPL vmlinux 0x8046712e divider_round_rate_parent @@ -22151,6 +22150,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x832beb70 device_property_read_u16_array EXPORT_SYMBOL_GPL vmlinux 0x8335ca43 __SCT__tp_func_io_page_fault EXPORT_SYMBOL_GPL vmlinux 0x8339df73 klist_add_behind +EXPORT_SYMBOL_GPL vmlinux 0x833d2ea7 __SCK__tp_func_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0x8341f5ef kernel_read_file EXPORT_SYMBOL_GPL vmlinux 0x8343ca54 ehci_adjust_port_wakeup_flags EXPORT_SYMBOL_GPL vmlinux 0x8349a895 nvmem_device_put @@ -22210,6 +22210,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x85783065 nvme_remove_namespaces EXPORT_SYMBOL_GPL vmlinux 0x858e2628 dax_holder EXPORT_SYMBOL_GPL vmlinux 0x859708b2 unregister_net_sysctl_table +EXPORT_SYMBOL_GPL vmlinux 0x85a75ce2 sched_set_fifo EXPORT_SYMBOL_GPL vmlinux 0x85a8d0ae usb_hcd_unlink_urb_from_ep EXPORT_SYMBOL_GPL vmlinux 0x85b114a2 crypto_spawn_tfm EXPORT_SYMBOL_GPL vmlinux 0x85b15444 arch_set_max_freq_ratio @@ -22223,6 +22224,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x85eed1be iopf_queue_discard_partial EXPORT_SYMBOL_GPL vmlinux 0x85f0937d inet_csk_reqsk_queue_hash_add EXPORT_SYMBOL_GPL vmlinux 0x85f4e487 devm_gpiod_put_array +EXPORT_SYMBOL_GPL vmlinux 0x86156da4 __traceiter_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0x86161a2c hid_bpf_connect_device EXPORT_SYMBOL_GPL vmlinux 0x86169f3e amd_smn_write EXPORT_SYMBOL_GPL vmlinux 0x861a7a70 fscrypt_dummy_policies_equal @@ -22457,7 +22459,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x8e1f4638 devm_kmemdup EXPORT_SYMBOL_GPL vmlinux 0x8e2aec0c xen_remap_pfn EXPORT_SYMBOL_GPL vmlinux 0x8e3d911b arch_phys_wc_index -EXPORT_SYMBOL_GPL vmlinux 0x8e4036d1 preempt_notifier_register EXPORT_SYMBOL_GPL vmlinux 0x8e4eb451 bpf_sk_storage_diag_free EXPORT_SYMBOL_GPL vmlinux 0x8e54261e fuse_conn_init EXPORT_SYMBOL_GPL vmlinux 0x8e6b1a9e net_selftest_get_count @@ -22471,7 +22472,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x8ec1152c cpufreq_enable_fast_switch EXPORT_SYMBOL_GPL vmlinux 0x8eca3377 scsi_template_proc_dir EXPORT_SYMBOL_GPL vmlinux 0x8ed3e4c7 __tracepoint_xhci_dbg_quirks -EXPORT_SYMBOL_GPL vmlinux 0x8ee0a09f __tracepoint_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x8eee3399 dax_read_unlock EXPORT_SYMBOL_GPL vmlinux 0x8ef4473c debugfs_create_ulong EXPORT_SYMBOL_GPL vmlinux 0x8ef48ff4 device_set_wakeup_enable @@ -22588,7 +22588,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x929d5790 regcache_cache_bypass EXPORT_SYMBOL_GPL vmlinux 0x929e95cf psi_memstall_enter EXPORT_SYMBOL_GPL vmlinux 0x92b8c78b hyperv_pcpu_output_arg -EXPORT_SYMBOL_GPL vmlinux 0x92c35487 __traceiter_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0x92cf74aa vcap_admin_rule_count EXPORT_SYMBOL_GPL vmlinux 0x92d31cfb fixed_phy_add EXPORT_SYMBOL_GPL vmlinux 0x92db8f68 do_trace_rcu_torture_read @@ -22656,7 +22655,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x947bb01c pci_remove_root_bus EXPORT_SYMBOL_GPL vmlinux 0x949163d6 dev_pm_opp_set_config EXPORT_SYMBOL_GPL vmlinux 0x949b5176 devlink_region_snapshot_create -EXPORT_SYMBOL_GPL vmlinux 0x949e60bb __traceiter_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0x949f7342 __alloc_percpu EXPORT_SYMBOL_GPL vmlinux 0x949fe2c8 devm_fwnode_gpiod_get_index EXPORT_SYMBOL_GPL vmlinux 0x94bbe626 bpf_offload_dev_match @@ -22780,6 +22778,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x99414b56 kobject_rename EXPORT_SYMBOL_GPL vmlinux 0x99430ba2 acpi_get_phys_id EXPORT_SYMBOL_GPL vmlinux 0x994699ce iommu_device_claim_dma_owner +EXPORT_SYMBOL_GPL vmlinux 0x9947e60a sched_set_normal EXPORT_SYMBOL_GPL vmlinux 0x9953acdb pkcs7_verify EXPORT_SYMBOL_GPL vmlinux 0x995d1071 prof_on EXPORT_SYMBOL_GPL vmlinux 0x996754e0 fsnotify_put_group @@ -22810,12 +22809,12 @@ EXPORT_SYMBOL_GPL vmlinux 0x9a404f31 iommu_register_device_fault_handler EXPORT_SYMBOL_GPL vmlinux 0x9a4894fe devres_release_group EXPORT_SYMBOL_GPL vmlinux 0x9a4e982f crypto_register_scomps -EXPORT_SYMBOL_GPL vmlinux 0x9a53906b __traceiter_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x9a54de7c __mdiobus_modify_changed EXPORT_SYMBOL_GPL vmlinux 0x9a58dd2d trace_print_bitmask_seq EXPORT_SYMBOL_GPL vmlinux 0x9a5dce5c rhashtable_walk_start_check EXPORT_SYMBOL_GPL vmlinux 0x9a6be5a4 bus_remove_file EXPORT_SYMBOL_GPL vmlinux 0x9a7641ac __serdev_device_driver_register +EXPORT_SYMBOL_GPL vmlinux 0x9a8a01fe __SCK__tp_func_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0x9aa71c2a efi_query_variable_store EXPORT_SYMBOL_GPL vmlinux 0x9aaac699 dev_pm_opp_cpumask_remove_table EXPORT_SYMBOL_GPL vmlinux 0x9aabb2bc scsi_flush_work @@ -22877,7 +22876,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x9c9ecd5d thermal_acpi_hot_trip_temp EXPORT_SYMBOL_GPL vmlinux 0x9ca6e11f cper_mem_err_location EXPORT_SYMBOL_GPL vmlinux 0x9cc4f70a register_pm_notifier -EXPORT_SYMBOL_GPL vmlinux 0x9ccea9e1 __tracepoint_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0x9cd7551a rhashtable_walk_stop EXPORT_SYMBOL_GPL vmlinux 0x9cdd6a66 sysctl_long_vals EXPORT_SYMBOL_GPL vmlinux 0x9cde2fbe power_supply_set_property @@ -22904,7 +22902,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x9d4894c8 x2apic_mode EXPORT_SYMBOL_GPL vmlinux 0x9d521fd4 cookie_tcp_reqsk_alloc EXPORT_SYMBOL_GPL vmlinux 0x9d539284 vp_legacy_set_status -EXPORT_SYMBOL_GPL vmlinux 0x9d5eb9ce __SCK__tp_func_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x9d603d94 devm_phy_destroy EXPORT_SYMBOL_GPL vmlinux 0x9d7c1a85 __SCK__tp_func_neigh_cleanup_and_release EXPORT_SYMBOL_GPL vmlinux 0x9d7dac4b acpi_bind_one @@ -22961,7 +22958,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x9feee9d6 devm_regulator_register EXPORT_SYMBOL_GPL vmlinux 0x9ff0aa11 fwnode_get_nth_parent EXPORT_SYMBOL_GPL vmlinux 0xa01a8d9b nd_cmd_bus_desc -EXPORT_SYMBOL_GPL vmlinux 0xa0235d34 __traceiter_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0xa02991a6 power_supply_get_property EXPORT_SYMBOL_GPL vmlinux 0xa02c31ca kthread_queue_work EXPORT_SYMBOL_GPL vmlinux 0xa03d0567 hid_bpf_disconnect_device @@ -22969,7 +22965,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xa04e0bfd noop_direct_IO EXPORT_SYMBOL_GPL vmlinux 0xa04f945a cpus_read_lock EXPORT_SYMBOL_GPL vmlinux 0xa052dc4b set_capacity_and_notify -EXPORT_SYMBOL_GPL vmlinux 0xa061938a __SCK__tp_func_ipi_send_cpu EXPORT_SYMBOL_GPL vmlinux 0xa06b6795 kernel_file_open EXPORT_SYMBOL_GPL vmlinux 0xa07011fc static_dev_dax EXPORT_SYMBOL_GPL vmlinux 0xa0712324 nd_region_dev @@ -22984,7 +22979,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xa0d3456d nr_swap_pages EXPORT_SYMBOL_GPL vmlinux 0xa0d81b76 __SCT__tp_func_devlink_hwmsg EXPORT_SYMBOL_GPL vmlinux 0xa0daef9d regmap_reinit_cache -EXPORT_SYMBOL_GPL vmlinux 0xa0dff5c8 __SCK__tp_func_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0xa0e172ec __SCK__tp_func_br_fdb_add EXPORT_SYMBOL_GPL vmlinux 0xa0e1f5d8 pci_find_vsec_capability EXPORT_SYMBOL_GPL vmlinux 0xa0e671d8 __SCT__tp_func_sched_update_nr_running_tp @@ -23105,7 +23099,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xa46d4723 __SCK__tp_func_cpu_idle EXPORT_SYMBOL_GPL vmlinux 0xa47394ec dpm_for_each_dev EXPORT_SYMBOL_GPL vmlinux 0xa48196c8 kdb_poll_idx -EXPORT_SYMBOL_GPL vmlinux 0xa484526d sched_set_fifo EXPORT_SYMBOL_GPL vmlinux 0xa49836cc firmware_request_nowarn EXPORT_SYMBOL_GPL vmlinux 0xa4a4d65e gpiod_to_irq EXPORT_SYMBOL_GPL vmlinux 0xa4a7fef9 vp_legacy_probe @@ -23125,6 +23118,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xa51f7676 __traceiter_devlink_trap_report EXPORT_SYMBOL_GPL vmlinux 0xa531471e clk_save_context EXPORT_SYMBOL_GPL vmlinux 0xa54a2cba devlink_linecard_provision_clear +EXPORT_SYMBOL_GPL vmlinux 0xa54d5b64 io_uring_cmd_done EXPORT_SYMBOL_GPL vmlinux 0xa5635a44 sdio_claim_host EXPORT_SYMBOL_GPL vmlinux 0xa568743b __SCK__tp_func_rpm_idle EXPORT_SYMBOL_GPL vmlinux 0xa56e1a52 sg_free_table_chained @@ -23163,9 +23157,11 @@ EXPORT_SYMBOL_GPL vmlinux 0xa6a7925c mas_walk EXPORT_SYMBOL_GPL vmlinux 0xa6abafb6 event_triggers_post_call EXPORT_SYMBOL_GPL vmlinux 0xa6ac87b5 device_set_node +EXPORT_SYMBOL_GPL vmlinux 0xa6ada3db __SCK__tp_func_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0xa6b06f65 ata_sff_queue_work EXPORT_SYMBOL_GPL vmlinux 0xa6b21ef2 dpm_suspend_end EXPORT_SYMBOL_GPL vmlinux 0xa6b2c82d ehci_suspend +EXPORT_SYMBOL_GPL vmlinux 0xa6b69624 io_uring_cmd_sock EXPORT_SYMBOL_GPL vmlinux 0xa6b8ca6a hvc_poll EXPORT_SYMBOL_GPL vmlinux 0xa6c6d0a7 i2c_generic_scl_recovery EXPORT_SYMBOL_GPL vmlinux 0xa6c7083c platform_unregister_drivers @@ -23188,6 +23184,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xa7169985 pci_dev_run_wake EXPORT_SYMBOL_GPL vmlinux 0xa718650a nvdimm_name EXPORT_SYMBOL_GPL vmlinux 0xa7218eba irq_set_affinity +EXPORT_SYMBOL_GPL vmlinux 0xa722878d __SCK__tp_func_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0xa7241959 pkcs7_supply_detached_data EXPORT_SYMBOL_GPL vmlinux 0xa727a75c driver_set_override EXPORT_SYMBOL_GPL vmlinux 0xa7289483 ksm_madvise @@ -23256,7 +23253,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xa9543ec4 phy_select_page EXPORT_SYMBOL_GPL vmlinux 0xa95b5c77 hwmon_sanitize_name EXPORT_SYMBOL_GPL vmlinux 0xa9652572 pci_disable_ats -EXPORT_SYMBOL_GPL vmlinux 0xa96761b5 io_uring_cmd_sock EXPORT_SYMBOL_GPL vmlinux 0xa96e8b4e hv_setup_vmbus_handler EXPORT_SYMBOL_GPL vmlinux 0xa976a58f relay_late_setup_files EXPORT_SYMBOL_GPL vmlinux 0xa9850cf7 register_fprobe @@ -23312,6 +23308,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xabf03fc3 __SCT__tp_func_xhci_dbg_quirks EXPORT_SYMBOL_GPL vmlinux 0xabf9d39f sock_diag_check_cookie EXPORT_SYMBOL_GPL vmlinux 0xac05a5f2 dm_device_name +EXPORT_SYMBOL_GPL vmlinux 0xac211670 __traceiter_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0xac309c2a iommu_fwspec_free EXPORT_SYMBOL_GPL vmlinux 0xac36d1de pci_epf_destroy EXPORT_SYMBOL_GPL vmlinux 0xac4afef7 rio_map_inb_region @@ -23589,6 +23586,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xb6e6d99d clk_disable EXPORT_SYMBOL_GPL vmlinux 0xb6eabe37 register_kprobes EXPORT_SYMBOL_GPL vmlinux 0xb703761f __kthread_should_park +EXPORT_SYMBOL_GPL vmlinux 0xb7043076 __traceiter_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0xb7119e6e spi_split_transfers_maxwords EXPORT_SYMBOL_GPL vmlinux 0xb72a62bb pci_rescan_bus EXPORT_SYMBOL_GPL vmlinux 0xb7329c06 clk_set_phase @@ -23675,6 +23673,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xba83064b fsnotify_add_mark EXPORT_SYMBOL_GPL vmlinux 0xba85a176 lwtunnel_output EXPORT_SYMBOL_GPL vmlinux 0xba8a83cf gpiod_set_value +EXPORT_SYMBOL_GPL vmlinux 0xba8efb8d __tracepoint_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0xbaa1f31a of_phy_get EXPORT_SYMBOL_GPL vmlinux 0xbab9a9f0 maxim_charger_currents EXPORT_SYMBOL_GPL vmlinux 0xbad63e9a mddev_unlock @@ -23725,6 +23724,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xbc6bec66 free_percpu_irq EXPORT_SYMBOL_GPL vmlinux 0xbc7cd717 ack_all_badblocks EXPORT_SYMBOL_GPL vmlinux 0xbc92596d intel_pt_validate_cap +EXPORT_SYMBOL_GPL vmlinux 0xbc93b45d __traceiter_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0xbc95d82b srcu_notifier_chain_register EXPORT_SYMBOL_GPL vmlinux 0xbc9a6ffb xdp_do_redirect_frame EXPORT_SYMBOL_GPL vmlinux 0xbc9b8588 ehci_cf_port_reset_rwsem @@ -23810,7 +23810,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xbf1cb4fb perf_msr_probe EXPORT_SYMBOL_GPL vmlinux 0xbf2e2e71 housekeeping_enabled EXPORT_SYMBOL_GPL vmlinux 0xbf312992 __spi_register_driver -EXPORT_SYMBOL_GPL vmlinux 0xbf33c52a __tracepoint_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0xbf4513c3 devlink_linecard_activate EXPORT_SYMBOL_GPL vmlinux 0xbf4a6f91 regmap_async_complete EXPORT_SYMBOL_GPL vmlinux 0xbf556edc spi_finalize_current_transfer @@ -23833,6 +23832,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xc028a9ce blk_lld_busy EXPORT_SYMBOL_GPL vmlinux 0xc02d628c events_sysfs_show EXPORT_SYMBOL_GPL vmlinux 0xc03acf70 pci_enable_rom +EXPORT_SYMBOL_GPL vmlinux 0xc03c95cb __tracepoint_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0xc0605b58 crypto_alloc_rng EXPORT_SYMBOL_GPL vmlinux 0xc0610597 fat_get_dotdot_entry EXPORT_SYMBOL_GPL vmlinux 0xc0705d48 regulator_bulk_unregister_supply_alias @@ -23963,7 +23963,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xc47c0597 clk_hw_round_rate EXPORT_SYMBOL_GPL vmlinux 0xc4a31146 rdma_cgrp_subsys_on_dfl_key EXPORT_SYMBOL_GPL vmlinux 0xc4a72936 trusted_tpm_send -EXPORT_SYMBOL_GPL vmlinux 0xc4a843a7 __tracepoint_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0xc4a95663 isa_register_driver EXPORT_SYMBOL_GPL vmlinux 0xc4ab3333 xdp_attachment_setup EXPORT_SYMBOL_GPL vmlinux 0xc4ae4681 __fscrypt_prepare_readdir @@ -23977,7 +23976,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xc4e52bd2 sysfs_update_groups EXPORT_SYMBOL_GPL vmlinux 0xc4e83500 tty_port_install EXPORT_SYMBOL_GPL vmlinux 0xc4f0da12 ktime_get_with_offset -EXPORT_SYMBOL_GPL vmlinux 0xc4f397fd __traceiter_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0xc50dca33 __SCT__tp_func_neigh_cleanup_and_release EXPORT_SYMBOL_GPL vmlinux 0xc512626a __supported_pte_mask EXPORT_SYMBOL_GPL vmlinux 0xc51b4097 rtc_set_alarm @@ -24056,7 +24054,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xc7f069ae nf_queue_entry_get_refs EXPORT_SYMBOL_GPL vmlinux 0xc7fa4aa9 kobj_ns_drop EXPORT_SYMBOL_GPL vmlinux 0xc8126340 clear_mce_nospec -EXPORT_SYMBOL_GPL vmlinux 0xc817ec3c __tracepoint_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0xc81d9ca4 transport_class_register EXPORT_SYMBOL_GPL vmlinux 0xc82c721f klist_remove EXPORT_SYMBOL_GPL vmlinux 0xc832d98a usb_mon_register @@ -24386,7 +24383,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xd36a2dc3 ethnl_cable_test_free EXPORT_SYMBOL_GPL vmlinux 0xd3752c27 atomic_notifier_call_chain EXPORT_SYMBOL_GPL vmlinux 0xd37f8cde usb_put_phy -EXPORT_SYMBOL_GPL vmlinux 0xd3805470 __SCK__tp_func_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0xd384f695 ata_sff_data_xfer EXPORT_SYMBOL_GPL vmlinux 0xd3901d33 acpi_dev_resource_address_space EXPORT_SYMBOL_GPL vmlinux 0xd39ac140 acpi_find_child_device @@ -24411,8 +24407,10 @@ EXPORT_SYMBOL_GPL vmlinux 0xd44a5eac kgdb_register_nmi_console EXPORT_SYMBOL_GPL vmlinux 0xd45434ee admin_timeout EXPORT_SYMBOL_GPL vmlinux 0xd4601805 __traceiter_ata_tf_load +EXPORT_SYMBOL_GPL vmlinux 0xd4648ee8 __SCK__tp_func_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0xd46a7eb1 devm_clk_hw_register EXPORT_SYMBOL_GPL vmlinux 0xd46af5ef cppc_get_perf_ctrs +EXPORT_SYMBOL_GPL vmlinux 0xd46b6259 __SCK__tp_func_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0xd473d5c0 exportfs_decode_fh EXPORT_SYMBOL_GPL vmlinux 0xd480af04 sock_diag_unregister_inet_compat EXPORT_SYMBOL_GPL vmlinux 0xd4868849 receive_fd @@ -24497,7 +24495,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xd763134d perf_event_enable EXPORT_SYMBOL_GPL vmlinux 0xd7635ed2 __SCK__tp_func_xhci_dbg_quirks EXPORT_SYMBOL_GPL vmlinux 0xd768e985 regulator_has_full_constraints -EXPORT_SYMBOL_GPL vmlinux 0xd76b13f5 __tracepoint_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0xd76e23ae __inet_lookup_listener EXPORT_SYMBOL_GPL vmlinux 0xd7774c5c fsnotify_find_mark EXPORT_SYMBOL_GPL vmlinux 0xd7835e1b usb_enable_ltm @@ -24509,8 +24506,8 @@ EXPORT_SYMBOL_GPL vmlinux 0xd7aea26e kernel_read_file_from_path_initns EXPORT_SYMBOL_GPL vmlinux 0xd7b9aac4 vcap_tc_flower_handler_vlan_usage EXPORT_SYMBOL_GPL vmlinux 0xd7cea889 edac_mod_work -EXPORT_SYMBOL_GPL vmlinux 0xd7d8a172 io_uring_cmd_import_fixed EXPORT_SYMBOL_GPL vmlinux 0xd7e27bf9 dm_post_suspending +EXPORT_SYMBOL_GPL vmlinux 0xd7e31d50 yield_to EXPORT_SYMBOL_GPL vmlinux 0xd7f0aa59 __tracepoint_ata_tf_load EXPORT_SYMBOL_GPL vmlinux 0xd813d36a ipv6_recv_error EXPORT_SYMBOL_GPL vmlinux 0xd8142e63 ata_sff_tf_load @@ -24745,6 +24742,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xe04c78db __SCT__tp_func_neigh_event_send_done EXPORT_SYMBOL_GPL vmlinux 0xe059617b ethnl_cable_test_amplitude EXPORT_SYMBOL_GPL vmlinux 0xe05aabeb __skb_zcopy_downgrade_managed +EXPORT_SYMBOL_GPL vmlinux 0xe05aef78 __SCK__tp_func_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0xe05c34c5 pci_msix_can_alloc_dyn EXPORT_SYMBOL_GPL vmlinux 0xe05e2f85 nexthop_free_rcu EXPORT_SYMBOL_GPL vmlinux 0xe06cca0c xdp_build_skb_from_frame @@ -24771,6 +24769,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xe16251af usb_control_msg_recv EXPORT_SYMBOL_GPL vmlinux 0xe17fa37c ata_host_detach EXPORT_SYMBOL_GPL vmlinux 0xe188442b __SCK__tp_func_neigh_event_send_done +EXPORT_SYMBOL_GPL vmlinux 0xe19de8f9 __tracepoint_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0xe1a8d7c9 net_rwsem EXPORT_SYMBOL_GPL vmlinux 0xe1aa2d62 set_hv_tscchange_cb EXPORT_SYMBOL_GPL vmlinux 0xe1b6529a device_match_fwnode @@ -24865,6 +24864,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xe4b818c3 phy_speed_to_str EXPORT_SYMBOL_GPL vmlinux 0xe4c2c66c rtc_ktime_to_tm EXPORT_SYMBOL_GPL vmlinux 0xe4ca4935 addrconf_prefix_rcv_add_addr +EXPORT_SYMBOL_GPL vmlinux 0xe4d591d9 __io_uring_cmd_do_in_task EXPORT_SYMBOL_GPL vmlinux 0xe4d790aa sata_link_scr_lpm EXPORT_SYMBOL_GPL vmlinux 0xe4e48b12 swphy_validate_state EXPORT_SYMBOL_GPL vmlinux 0xe50388b3 devm_extcon_dev_unregister @@ -24968,7 +24968,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xe87ff8af devm_phy_get EXPORT_SYMBOL_GPL vmlinux 0xe8915620 thermal_zone_get_crit_temp EXPORT_SYMBOL_GPL vmlinux 0xe8979afb mas_prev_range -EXPORT_SYMBOL_GPL vmlinux 0xe8a680fc __traceiter_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0xe8a772bd vcap_keyset_list_add EXPORT_SYMBOL_GPL vmlinux 0xe8bc40c5 cn_netlink_send EXPORT_SYMBOL_GPL vmlinux 0xe8bdf9ca crypto_unregister_scomp @@ -25058,6 +25057,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xeb957795 serial8250_do_set_divisor EXPORT_SYMBOL_GPL vmlinux 0xeba1fdef ip6_push_pending_frames EXPORT_SYMBOL_GPL vmlinux 0xeba78298 pm_generic_thaw +EXPORT_SYMBOL_GPL vmlinux 0xebaa5125 sched_set_fifo_low EXPORT_SYMBOL_GPL vmlinux 0xebb1f830 acpi_quirk_skip_gpio_event_handlers EXPORT_SYMBOL_GPL vmlinux 0xebb99c65 max8997_read_reg EXPORT_SYMBOL_GPL vmlinux 0xebc76d08 ata_sas_slave_configure @@ -25090,7 +25090,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xed2f06b7 mptcp_pm_get_add_addr_accept_max EXPORT_SYMBOL_GPL vmlinux 0xed33a567 sdio_retune_hold_now EXPORT_SYMBOL_GPL vmlinux 0xed35fcf0 platform_device_add_data -EXPORT_SYMBOL_GPL vmlinux 0xed3967f2 yield_to EXPORT_SYMBOL_GPL vmlinux 0xed39b7b8 parse_OID EXPORT_SYMBOL_GPL vmlinux 0xed3a8052 __ip6_local_out EXPORT_SYMBOL_GPL vmlinux 0xed3df7b6 regmap_field_bulk_alloc @@ -25241,6 +25240,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xf2488142 nvmem_cell_read_variable_le_u32 EXPORT_SYMBOL_GPL vmlinux 0xf2567ce3 nfnl_ct_hook EXPORT_SYMBOL_GPL vmlinux 0xf2688b7d skb_zerocopy_iter_stream +EXPORT_SYMBOL_GPL vmlinux 0xf26ace8f io_uring_cmd_do_in_task_lazy EXPORT_SYMBOL_GPL vmlinux 0xf27589de devm_nvmem_device_put EXPORT_SYMBOL_GPL vmlinux 0xf277e37d devm_clk_register EXPORT_SYMBOL_GPL vmlinux 0xf27d0a7b gnttab_grant_foreign_access_ref @@ -25533,7 +25533,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xfd2fa3f0 __tracepoint_block_bio_remap EXPORT_SYMBOL_GPL vmlinux 0xfd538097 virtqueue_kick_prepare EXPORT_SYMBOL_GPL vmlinux 0xfd541a44 iomap_read_folio -EXPORT_SYMBOL_GPL vmlinux 0xfd588d11 __traceiter_pelt_se_tp +EXPORT_SYMBOL_GPL vmlinux 0xfd672306 __tracepoint_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0xfd6ae3fc iomap_zero_range EXPORT_SYMBOL_GPL vmlinux 0xfd7243c7 erst_disable EXPORT_SYMBOL_GPL vmlinux 0xfd756bfc devm_gpiod_unhinge diff -u linux-aws-6.5-6.5.0/debian.aws/abi/arm64/aws linux-aws-6.5-6.5.0/debian.aws/abi/arm64/aws --- linux-aws-6.5-6.5.0/debian.aws/abi/arm64/aws +++ linux-aws-6.5-6.5.0/debian.aws/abi/arm64/aws @@ -6183,6 +6183,7 @@ EXPORT_SYMBOL vmlinux 0x0ea593f6 hdmi_drm_infoframe_init EXPORT_SYMBOL vmlinux 0x0ea69c79 alloc_skb_with_frags EXPORT_SYMBOL vmlinux 0x0eb30461 blk_mq_rq_cpu +EXPORT_SYMBOL vmlinux 0x0eb3d2ba io_uring_get_socket EXPORT_SYMBOL vmlinux 0x0eb6eb87 add_taint EXPORT_SYMBOL vmlinux 0x0ec5babe vme_dma_free EXPORT_SYMBOL vmlinux 0x0ece0ca0 dec_node_page_state @@ -7088,6 +7089,7 @@ EXPORT_SYMBOL vmlinux 0x38b06575 posix_lock_file EXPORT_SYMBOL vmlinux 0x38b1dee9 dquot_initialize_needed EXPORT_SYMBOL vmlinux 0x38cbb6d9 current_time +EXPORT_SYMBOL vmlinux 0x38e3242b set_user_nice EXPORT_SYMBOL vmlinux 0x38e46431 mempool_exit EXPORT_SYMBOL vmlinux 0x38ea5c75 pci_disable_link_state EXPORT_SYMBOL vmlinux 0x38f27fd9 pci_alloc_host_bridge @@ -7226,7 +7228,6 @@ EXPORT_SYMBOL vmlinux 0x3e79fb00 arm_smccc_1_2_smc EXPORT_SYMBOL vmlinux 0x3e7e490d ip6_frag_next EXPORT_SYMBOL vmlinux 0x3e89c7ee bio_add_folio -EXPORT_SYMBOL vmlinux 0x3ea22347 set_user_nice EXPORT_SYMBOL vmlinux 0x3eccbe2c __find_nth_bit EXPORT_SYMBOL vmlinux 0x3edc36e3 vga_client_register EXPORT_SYMBOL vmlinux 0x3efe1703 phy_unregister_fixup_for_id @@ -7258,6 +7259,7 @@ EXPORT_SYMBOL vmlinux 0x4032fcef md_integrity_register EXPORT_SYMBOL vmlinux 0x403f71fd grab_cache_page_write_begin EXPORT_SYMBOL vmlinux 0x40574d81 sockopt_release_sock +EXPORT_SYMBOL vmlinux 0x4067bb82 wake_up_process EXPORT_SYMBOL vmlinux 0x4072961d blkdev_issue_zeroout EXPORT_SYMBOL vmlinux 0x4085b8b4 fsync_bdev EXPORT_SYMBOL vmlinux 0x40863ba1 ioremap_prot @@ -7818,7 +7820,6 @@ EXPORT_SYMBOL vmlinux 0x581f98da zlib_inflate EXPORT_SYMBOL vmlinux 0x582606eb xudma_rflow_put EXPORT_SYMBOL vmlinux 0x582b6275 xfrm_if_unregister_cb -EXPORT_SYMBOL vmlinux 0x582df5e9 can_nice EXPORT_SYMBOL vmlinux 0x582f1b31 cdrom_number_of_slots EXPORT_SYMBOL vmlinux 0x5830bbb7 ip_frag_next EXPORT_SYMBOL vmlinux 0x5832f15f update_region @@ -9800,7 +9801,6 @@ EXPORT_SYMBOL vmlinux 0xb1db9a69 fsl_ifc_find EXPORT_SYMBOL vmlinux 0xb1ddf995 jiffies_64_to_clock_t EXPORT_SYMBOL vmlinux 0xb1ef2d50 cred_fscmp -EXPORT_SYMBOL vmlinux 0xb20076f5 io_uring_get_socket EXPORT_SYMBOL vmlinux 0xb203299c xp_raw_get_data EXPORT_SYMBOL vmlinux 0xb207dadc get_task_cred EXPORT_SYMBOL vmlinux 0xb22e16d5 radix_tree_maybe_preload @@ -11065,7 +11065,6 @@ EXPORT_SYMBOL vmlinux 0xe976942d register_console EXPORT_SYMBOL vmlinux 0xe97e9c72 __free_pages EXPORT_SYMBOL vmlinux 0xe994b282 __dst_destroy_metrics_generic -EXPORT_SYMBOL vmlinux 0xe9af2933 wake_up_process EXPORT_SYMBOL vmlinux 0xe9af7397 __xa_set_mark EXPORT_SYMBOL vmlinux 0xe9be5ff3 md_cluster_ops EXPORT_SYMBOL vmlinux 0xe9c2e980 md_bitmap_free @@ -11249,6 +11248,7 @@ EXPORT_SYMBOL vmlinux 0xf11dd46e _page_poisoning_enabled_early EXPORT_SYMBOL vmlinux 0xf1572312 __skb_wait_for_more_packets EXPORT_SYMBOL vmlinux 0xf18300ad logic_inb +EXPORT_SYMBOL vmlinux 0xf18e217f can_nice EXPORT_SYMBOL vmlinux 0xf195c682 fb_invert_cmaps EXPORT_SYMBOL vmlinux 0xf1969a8e __usecs_to_jiffies EXPORT_SYMBOL vmlinux 0xf1a65f7b zstd_reset_dstream @@ -19089,7 +19089,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x0d9cf5cc trace_array_put EXPORT_SYMBOL_GPL vmlinux 0x0db1dfdc pwm_get_chip_data EXPORT_SYMBOL_GPL vmlinux 0x0db794fb sock_diag_unregister -EXPORT_SYMBOL_GPL vmlinux 0x0db8668d sched_set_fifo_low EXPORT_SYMBOL_GPL vmlinux 0x0dbd99bc sdio_memcpy_fromio EXPORT_SYMBOL_GPL vmlinux 0x0dd43117 gnttab_foreach_grant_in_range EXPORT_SYMBOL_GPL vmlinux 0x0ddb1cd7 llist_reverse_order @@ -19756,7 +19755,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x25e959a4 regulator_set_voltage EXPORT_SYMBOL_GPL vmlinux 0x25e97f58 ip6_datagram_send_ctl EXPORT_SYMBOL_GPL vmlinux 0x25f21cbc devm_register_restart_handler -EXPORT_SYMBOL_GPL vmlinux 0x260efab6 io_uring_cmd_do_in_task_lazy EXPORT_SYMBOL_GPL vmlinux 0x26171049 check_move_unevictable_folios EXPORT_SYMBOL_GPL vmlinux 0x26216a11 usb_check_int_endpoints EXPORT_SYMBOL_GPL vmlinux 0x2635dacf sk_msg_free_partial @@ -19894,7 +19892,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x29f21d2e fuse_do_open EXPORT_SYMBOL_GPL vmlinux 0x29f59940 crypto_unregister_template EXPORT_SYMBOL_GPL vmlinux 0x2a0a01c9 security_kernel_read_file -EXPORT_SYMBOL_GPL vmlinux 0x2a19a8a1 __traceiter_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0x2a1f6573 devlink_port_health_reporter_create EXPORT_SYMBOL_GPL vmlinux 0x2a1fb2b8 devm_hwrng_register EXPORT_SYMBOL_GPL vmlinux 0x2a2f04fa ip_tunnel_netlink_parms @@ -20259,6 +20256,8 @@ EXPORT_SYMBOL_GPL vmlinux 0x365989e5 imx_1416x_pll EXPORT_SYMBOL_GPL vmlinux 0x367a17ab __fsverity_prepare_setattr EXPORT_SYMBOL_GPL vmlinux 0x368022c5 mtk_build_eint +EXPORT_SYMBOL_GPL vmlinux 0x36817dc8 __io_uring_cmd_do_in_task +EXPORT_SYMBOL_GPL vmlinux 0x36827e71 sched_setattr_nocheck EXPORT_SYMBOL_GPL vmlinux 0x36869f21 usb_set_wireless_status EXPORT_SYMBOL_GPL vmlinux 0x36898d6f gpiod_remove_hogs EXPORT_SYMBOL_GPL vmlinux 0x36933852 iommu_dev_enable_feature @@ -20630,7 +20629,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x4287f45a __skb_tstamp_tx EXPORT_SYMBOL_GPL vmlinux 0x4297bc16 pinctrl_count_index_with_args EXPORT_SYMBOL_GPL vmlinux 0x429c3f9c reboot_mode -EXPORT_SYMBOL_GPL vmlinux 0x42be7e07 yield_to EXPORT_SYMBOL_GPL vmlinux 0x42bf8fe1 list_lru_del EXPORT_SYMBOL_GPL vmlinux 0x42d9e0e3 power_supply_unregister EXPORT_SYMBOL_GPL vmlinux 0x42dbf2e0 em_dev_register_perf_domain @@ -20650,7 +20648,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x436e2e5b __pm_runtime_suspend EXPORT_SYMBOL_GPL vmlinux 0x437eb1df ipv6_mod_enabled EXPORT_SYMBOL_GPL vmlinux 0x43824d3a vfs_get_acl -EXPORT_SYMBOL_GPL vmlinux 0x438274aa sched_setattr_nocheck EXPORT_SYMBOL_GPL vmlinux 0x438d8df2 iova_cache_get EXPORT_SYMBOL_GPL vmlinux 0x43984f70 dw_pcie_ep_init EXPORT_SYMBOL_GPL vmlinux 0x43a57ed8 pinctrl_add_gpio_range @@ -20669,6 +20666,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x43f81957 clk_round_rate EXPORT_SYMBOL_GPL vmlinux 0x43f92edd wait_for_initramfs EXPORT_SYMBOL_GPL vmlinux 0x43f9c191 rio_release_inb_dbell +EXPORT_SYMBOL_GPL vmlinux 0x43fab8fc io_uring_cmd_do_in_task_lazy EXPORT_SYMBOL_GPL vmlinux 0x4401e6c2 mpi_cmpabs EXPORT_SYMBOL_GPL vmlinux 0x4406c814 regmap_write EXPORT_SYMBOL_GPL vmlinux 0x441037d6 scsi_nl_sock @@ -20940,6 +20938,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x4cf8880f vcap_rule_add_key_u32 EXPORT_SYMBOL_GPL vmlinux 0x4cfaf8aa fscrypt_parse_test_dummy_encryption EXPORT_SYMBOL_GPL vmlinux 0x4d0015e2 cpu_hotplug_disable +EXPORT_SYMBOL_GPL vmlinux 0x4d0558a5 __traceiter_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0x4d203284 xdp_do_redirect EXPORT_SYMBOL_GPL vmlinux 0x4d24458d rio_route_clr_table EXPORT_SYMBOL_GPL vmlinux 0x4d24a1e4 sbitmap_finish_wait @@ -21101,7 +21100,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x52aed0e5 raw_unhash_sk EXPORT_SYMBOL_GPL vmlinux 0x52b1e3c7 pci_flags EXPORT_SYMBOL_GPL vmlinux 0x52b81756 hypervisor_kobj -EXPORT_SYMBOL_GPL vmlinux 0x52bca621 sched_set_fifo EXPORT_SYMBOL_GPL vmlinux 0x52c35e83 call_rcu_tasks_trace EXPORT_SYMBOL_GPL vmlinux 0x52ce2057 hv_setup_crash_handler EXPORT_SYMBOL_GPL vmlinux 0x52d54fce devlink_info_version_stored_put @@ -21408,6 +21406,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x5dac6868 led_set_brightness_nosleep EXPORT_SYMBOL_GPL vmlinux 0x5db9dab0 __traceiter_fib6_table_lookup EXPORT_SYMBOL_GPL vmlinux 0x5dc19747 phylink_mii_c22_pcs_encode_advertisement +EXPORT_SYMBOL_GPL vmlinux 0x5dca26a8 __traceiter_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0x5dcd881a regmap_reinit_cache EXPORT_SYMBOL_GPL vmlinux 0x5dd07561 devm_thermal_of_cooling_device_register EXPORT_SYMBOL_GPL vmlinux 0x5de412cd k3_ringacc_ring_push @@ -21510,7 +21509,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x60d92c2e cdx_register_controller EXPORT_SYMBOL_GPL vmlinux 0x60e1a7df device_create_with_groups EXPORT_SYMBOL_GPL vmlinux 0x60ebc96f ring_buffer_read_prepare -EXPORT_SYMBOL_GPL vmlinux 0x60f7f23e __traceiter_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0x60fc7995 acpi_processor_get_performance_info EXPORT_SYMBOL_GPL vmlinux 0x6103dac1 bpf_offload_dev_match EXPORT_SYMBOL_GPL vmlinux 0x61050c6a meson_a1_parse_dt_extra @@ -21688,6 +21686,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x66b97421 sfp_link_up EXPORT_SYMBOL_GPL vmlinux 0x66ba5ec0 misc_cg_uncharge EXPORT_SYMBOL_GPL vmlinux 0x66c9a0bd bus_create_file +EXPORT_SYMBOL_GPL vmlinux 0x66cdfd8c __traceiter_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0x66d87d38 symbol_put_addr EXPORT_SYMBOL_GPL vmlinux 0x66dddcaf led_set_brightness_nopm EXPORT_SYMBOL_GPL vmlinux 0x66e11622 scsi_internal_device_unblock_nowait @@ -21703,7 +21702,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x674c5bc1 nvme_auth_hmac_name EXPORT_SYMBOL_GPL vmlinux 0x67690137 encrypt_blob EXPORT_SYMBOL_GPL vmlinux 0x676c688f k3_ringacc_ring_free -EXPORT_SYMBOL_GPL vmlinux 0x677062df preempt_notifier_register EXPORT_SYMBOL_GPL vmlinux 0x67755175 d_same_name EXPORT_SYMBOL_GPL vmlinux 0x6775be5c __nvdimm_create EXPORT_SYMBOL_GPL vmlinux 0x6775fe59 phy_driver_is_genphy @@ -21732,6 +21730,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x68388f84 regmap_bulk_write EXPORT_SYMBOL_GPL vmlinux 0x683cf0fb fsl_mc_portal_allocate EXPORT_SYMBOL_GPL vmlinux 0x683e7edd devlink_port_linecard_set +EXPORT_SYMBOL_GPL vmlinux 0x6840d539 sched_set_normal EXPORT_SYMBOL_GPL vmlinux 0x68460527 blkcg_set_fc_appid EXPORT_SYMBOL_GPL vmlinux 0x6848c9f8 __traceiter_io_page_fault EXPORT_SYMBOL_GPL vmlinux 0x684ca117 zynqmp_pm_get_pll_frac_mode @@ -21778,6 +21777,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x696f2b63 of_changeset_init EXPORT_SYMBOL_GPL vmlinux 0x697c5d0d tracing_snapshot_alloc EXPORT_SYMBOL_GPL vmlinux 0x69820564 sata_link_hardreset +EXPORT_SYMBOL_GPL vmlinux 0x698474bb preempt_notifier_unregister EXPORT_SYMBOL_GPL vmlinux 0x698edfc3 zynqmp_pm_set_gem_config EXPORT_SYMBOL_GPL vmlinux 0x6991231e iommu_get_domain_for_dev_pasid EXPORT_SYMBOL_GPL vmlinux 0x69a107e7 platform_get_irq @@ -21804,6 +21804,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x6a460dc5 schedule_hrtimeout EXPORT_SYMBOL_GPL vmlinux 0x6a4ab964 xhci_gen_setup EXPORT_SYMBOL_GPL vmlinux 0x6a4e2935 apple_rtkit_send_message +EXPORT_SYMBOL_GPL vmlinux 0x6a4e6abb io_uring_cmd_done EXPORT_SYMBOL_GPL vmlinux 0x6a4f623b mmu_notifier_synchronize EXPORT_SYMBOL_GPL vmlinux 0x6a5d905f __traceiter_wbc_writepage EXPORT_SYMBOL_GPL vmlinux 0x6a612159 phy_validate @@ -21894,7 +21895,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x6d467b08 arm_smccc_1_1_get_conduit EXPORT_SYMBOL_GPL vmlinux 0x6d49c8ed iommu_group_has_isolated_msi EXPORT_SYMBOL_GPL vmlinux 0x6d4c4855 skcipher_walk_complete -EXPORT_SYMBOL_GPL vmlinux 0x6d4ca601 __io_uring_cmd_do_in_task EXPORT_SYMBOL_GPL vmlinux 0x6d53f27b init_uts_ns EXPORT_SYMBOL_GPL vmlinux 0x6d6fec1f ktime_mono_to_any EXPORT_SYMBOL_GPL vmlinux 0x6d74e654 crypto_aead_decrypt @@ -22068,6 +22068,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x72ae1839 base64_decode EXPORT_SYMBOL_GPL vmlinux 0x72aeef94 mdiobus_c45_modify_changed EXPORT_SYMBOL_GPL vmlinux 0x72b0ab86 usb_hcd_start_port_resume +EXPORT_SYMBOL_GPL vmlinux 0x72bcdf5e sched_show_task EXPORT_SYMBOL_GPL vmlinux 0x72be1e2d __traceiter_neigh_cleanup_and_release EXPORT_SYMBOL_GPL vmlinux 0x72c97952 balloon_page_dequeue EXPORT_SYMBOL_GPL vmlinux 0x72d1d8dc blk_mq_freeze_queue_wait @@ -22348,7 +22349,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x7b1c3529 dev_pm_opp_set_config EXPORT_SYMBOL_GPL vmlinux 0x7b358fe1 iommu_device_unlink EXPORT_SYMBOL_GPL vmlinux 0x7b3efca8 usb_match_id -EXPORT_SYMBOL_GPL vmlinux 0x7b530f68 kick_process EXPORT_SYMBOL_GPL vmlinux 0x7b5452b8 acpi_unregister_gsi EXPORT_SYMBOL_GPL vmlinux 0x7b5a4926 sha1_zero_message_hash EXPORT_SYMBOL_GPL vmlinux 0x7b5de6a0 divider_determine_rate @@ -22470,6 +22470,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7f998912 ahci_error_handler EXPORT_SYMBOL_GPL vmlinux 0x7f9b1879 osc_cpc_flexible_adr_space_confirmed EXPORT_SYMBOL_GPL vmlinux 0x7fa96509 erst_get_record_id_next +EXPORT_SYMBOL_GPL vmlinux 0x7fabc3ca preempt_notifier_register EXPORT_SYMBOL_GPL vmlinux 0x7fc209db __dev_forward_skb EXPORT_SYMBOL_GPL vmlinux 0x7fd30bc4 kstrdup_quotable_cmdline EXPORT_SYMBOL_GPL vmlinux 0x7fee3bfa bus_unregister_notifier @@ -22499,7 +22500,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x80efd015 imx_dev_clk_hw_pll14xx EXPORT_SYMBOL_GPL vmlinux 0x80f14795 rio_set_port_lockout EXPORT_SYMBOL_GPL vmlinux 0x80f558d6 device_match_devt -EXPORT_SYMBOL_GPL vmlinux 0x81025525 __traceiter_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x81099c3f ptp_parse_header EXPORT_SYMBOL_GPL vmlinux 0x810a675a fscrypt_ioctl_add_key EXPORT_SYMBOL_GPL vmlinux 0x810a9ec2 usb_put_phy @@ -22759,7 +22759,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x8924eb1e rcu_force_quiescent_state EXPORT_SYMBOL_GPL vmlinux 0x89369f96 serdev_device_write_buf EXPORT_SYMBOL_GPL vmlinux 0x893abbdd devlink_fmsg_u32_pair_put -EXPORT_SYMBOL_GPL vmlinux 0x893c4388 __traceiter_pelt_thermal_tp EXPORT_SYMBOL_GPL vmlinux 0x893c5ddb unlock_system_sleep EXPORT_SYMBOL_GPL vmlinux 0x89485687 iommu_group_put EXPORT_SYMBOL_GPL vmlinux 0x8954dc8e __SCK__tp_func_br_fdb_external_learn_add @@ -22898,11 +22897,11 @@ EXPORT_SYMBOL_GPL vmlinux 0x8e0be6a6 rio_unregister_driver EXPORT_SYMBOL_GPL vmlinux 0x8e16419b trace_clock_local EXPORT_SYMBOL_GPL vmlinux 0x8e27f941 devm_serdev_device_open +EXPORT_SYMBOL_GPL vmlinux 0x8e3ef3c5 set_cpus_allowed_ptr EXPORT_SYMBOL_GPL vmlinux 0x8e4ad0d5 regulator_unregister EXPORT_SYMBOL_GPL vmlinux 0x8e4b63a6 hisi_clk_register_gate_sep EXPORT_SYMBOL_GPL vmlinux 0x8e4eb451 bpf_sk_storage_diag_free EXPORT_SYMBOL_GPL vmlinux 0x8e524487 rio_register_mport -EXPORT_SYMBOL_GPL vmlinux 0x8e5d578f __traceiter_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0x8e6b1a9e net_selftest_get_count EXPORT_SYMBOL_GPL vmlinux 0x8e6fa8b5 apei_exec_pre_map_gars EXPORT_SYMBOL_GPL vmlinux 0x8e76e546 acpi_initialize_hp_context @@ -23213,6 +23212,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x98cb1a58 pci_cfg_access_lock EXPORT_SYMBOL_GPL vmlinux 0x98ee62b2 ring_buffer_record_disable_cpu EXPORT_SYMBOL_GPL vmlinux 0x990bf810 acpi_subsys_runtime_suspend +EXPORT_SYMBOL_GPL vmlinux 0x991bb7ed __traceiter_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x992e570b iommu_device_release_dma_owner EXPORT_SYMBOL_GPL vmlinux 0x99489e26 virtqueue_add_inbuf EXPORT_SYMBOL_GPL vmlinux 0x9953acdb pkcs7_verify @@ -23518,7 +23518,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xa3619f28 edac_get_sysfs_subsys EXPORT_SYMBOL_GPL vmlinux 0xa36b9cf3 sdio_set_host_pm_flags EXPORT_SYMBOL_GPL vmlinux 0xa36f50fb is_binary_blacklisted -EXPORT_SYMBOL_GPL vmlinux 0xa37089a2 __traceiter_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0xa376ad7f dax_iomap_fault EXPORT_SYMBOL_GPL vmlinux 0xa38602cd drain_workqueue EXPORT_SYMBOL_GPL vmlinux 0xa38a9f71 get_itimerspec64 @@ -23585,6 +23584,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xa50eb24d nvmem_layout_unregister EXPORT_SYMBOL_GPL vmlinux 0xa50f5982 regcache_sync EXPORT_SYMBOL_GPL vmlinux 0xa5141365 ata_sff_check_status +EXPORT_SYMBOL_GPL vmlinux 0xa5156cab io_uring_cmd_import_fixed EXPORT_SYMBOL_GPL vmlinux 0xa531471e clk_save_context EXPORT_SYMBOL_GPL vmlinux 0xa541d069 reset_simple_ops EXPORT_SYMBOL_GPL vmlinux 0xa54a2cba devlink_linecard_provision_clear @@ -23617,6 +23617,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xa64ffe52 unix_peer_get EXPORT_SYMBOL_GPL vmlinux 0xa6860a16 usb_hub_release_port EXPORT_SYMBOL_GPL vmlinux 0xa68b4405 clockevents_register_device +EXPORT_SYMBOL_GPL vmlinux 0xa6902e71 sched_set_fifo EXPORT_SYMBOL_GPL vmlinux 0xa6a088b7 fscrypt_match_name EXPORT_SYMBOL_GPL vmlinux 0xa6a7925c mas_walk EXPORT_SYMBOL_GPL vmlinux 0xa6af1e35 __SCK__tp_func_block_rq_remap @@ -23663,6 +23664,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xa812ffb0 regulator_bulk_force_disable EXPORT_SYMBOL_GPL vmlinux 0xa81485e6 __traceiter_ipi_send_cpu EXPORT_SYMBOL_GPL vmlinux 0xa81a55e8 pci_max_pasids +EXPORT_SYMBOL_GPL vmlinux 0xa81f103e sched_set_fifo_low EXPORT_SYMBOL_GPL vmlinux 0xa826ac69 imx_pinconf_get_scu EXPORT_SYMBOL_GPL vmlinux 0xa834e0a0 regmap_parse_val EXPORT_SYMBOL_GPL vmlinux 0xa835bcb2 bd_link_disk_holder @@ -23791,7 +23793,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xada1a071 sk_setup_caps EXPORT_SYMBOL_GPL vmlinux 0xada38766 dst_cache_destroy EXPORT_SYMBOL_GPL vmlinux 0xada99a91 bpf_trace_run9 -EXPORT_SYMBOL_GPL vmlinux 0xadae59da preempt_notifier_unregister EXPORT_SYMBOL_GPL vmlinux 0xadb4d4cd trace_event_buffer_commit EXPORT_SYMBOL_GPL vmlinux 0xadbdffc2 pci_destroy_slot EXPORT_SYMBOL_GPL vmlinux 0xaddb7175 pci_find_doe_mailbox @@ -23919,6 +23920,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xb23c7ef4 failover_register EXPORT_SYMBOL_GPL vmlinux 0xb2405efc secure_tcp_seq EXPORT_SYMBOL_GPL vmlinux 0xb24256c4 tpm_calc_ordinal_duration +EXPORT_SYMBOL_GPL vmlinux 0xb2497777 __traceiter_sched_update_nr_running_tp EXPORT_SYMBOL_GPL vmlinux 0xb24a8b89 acpi_device_get_match_data EXPORT_SYMBOL_GPL vmlinux 0xb256be16 efivar_is_available EXPORT_SYMBOL_GPL vmlinux 0xb25a0f5c crypto_alloc_akcipher @@ -24005,6 +24007,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xb5a8c226 acpi_gsi_to_irq EXPORT_SYMBOL_GPL vmlinux 0xb5aab01d regulator_set_current_limit_regmap EXPORT_SYMBOL_GPL vmlinux 0xb5b3a208 dev_pm_opp_find_level_ceil +EXPORT_SYMBOL_GPL vmlinux 0xb5b4fdfd __traceiter_pelt_rt_tp EXPORT_SYMBOL_GPL vmlinux 0xb5b6fb04 hv_get_vpreg EXPORT_SYMBOL_GPL vmlinux 0xb5c8df0a ata_scsi_change_queue_depth EXPORT_SYMBOL_GPL vmlinux 0xb5d4d10f devlink_flash_update_status_notify @@ -24087,6 +24090,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xb89e69b1 jump_label_update_timeout EXPORT_SYMBOL_GPL vmlinux 0xb89f304e blkcg_policy_unregister EXPORT_SYMBOL_GPL vmlinux 0xb8a204b7 pm_runtime_no_callbacks +EXPORT_SYMBOL_GPL vmlinux 0xb8a6276b __traceiter_sched_util_est_se_tp EXPORT_SYMBOL_GPL vmlinux 0xb8ab7d8b ahci_platform_enable_phys EXPORT_SYMBOL_GPL vmlinux 0xb8b8c4f0 ti_sci_release_resource EXPORT_SYMBOL_GPL vmlinux 0xb8b9a5ff __traceiter_block_split @@ -24106,7 +24110,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xb91346be kill_device EXPORT_SYMBOL_GPL vmlinux 0xb917b6d7 return_address EXPORT_SYMBOL_GPL vmlinux 0xb91c5701 priv_to_devlink -EXPORT_SYMBOL_GPL vmlinux 0xb93981bb io_uring_cmd_sock EXPORT_SYMBOL_GPL vmlinux 0xb940d90d hte_enable_ts EXPORT_SYMBOL_GPL vmlinux 0xb940e343 mmc_cmdq_enable EXPORT_SYMBOL_GPL vmlinux 0xb9618962 acpi_get_acpi_dev @@ -24231,7 +24234,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xbdb2217d hv_is_isolation_supported EXPORT_SYMBOL_GPL vmlinux 0xbdba30c1 dma_resv_iter_next EXPORT_SYMBOL_GPL vmlinux 0xbdbb9651 sock_diag_destroy -EXPORT_SYMBOL_GPL vmlinux 0xbdc6bda4 sched_set_normal EXPORT_SYMBOL_GPL vmlinux 0xbdd33312 pci_disable_sriov EXPORT_SYMBOL_GPL vmlinux 0xbdda1b5f vmalloc_huge EXPORT_SYMBOL_GPL vmlinux 0xbde9e270 __pm_runtime_use_autosuspend @@ -24260,7 +24262,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xbe947631 nd_region_provider_data EXPORT_SYMBOL_GPL vmlinux 0xbe96dfd8 of_reconfig_notifier_unregister EXPORT_SYMBOL_GPL vmlinux 0xbe9a83d5 dw_pcie_write -EXPORT_SYMBOL_GPL vmlinux 0xbe9d7b9f set_cpus_allowed_ptr EXPORT_SYMBOL_GPL vmlinux 0xbea5ff1e static_key_initialized EXPORT_SYMBOL_GPL vmlinux 0xbeab1679 bsg_setup_queue EXPORT_SYMBOL_GPL vmlinux 0xbeafe90d nvme_wait_freeze_timeout @@ -24305,7 +24306,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xc059b1c0 fscrypt_file_open EXPORT_SYMBOL_GPL vmlinux 0xc05b8a7d of_pci_get_devfn EXPORT_SYMBOL_GPL vmlinux 0xc05cee80 ipi_get_hwirq -EXPORT_SYMBOL_GPL vmlinux 0xc06a3895 __traceiter_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0xc090c376 net_selftest_get_strings EXPORT_SYMBOL_GPL vmlinux 0xc0944f39 devm_memunmap_pages EXPORT_SYMBOL_GPL vmlinux 0xc09e7497 regmap_register_patch @@ -24405,6 +24405,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xc3d56210 xenbus_dev_remove EXPORT_SYMBOL_GPL vmlinux 0xc3de65ff ring_buffer_bytes_cpu EXPORT_SYMBOL_GPL vmlinux 0xc3e25f6d sk_psock_drop +EXPORT_SYMBOL_GPL vmlinux 0xc3e7e196 yield_to EXPORT_SYMBOL_GPL vmlinux 0xc3ea5305 iommu_default_passthrough EXPORT_SYMBOL_GPL vmlinux 0xc3f273f7 iomap_seek_data EXPORT_SYMBOL_GPL vmlinux 0xc3f3c2b5 wakeup_source_add @@ -24601,6 +24602,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xca11ba54 ip6_update_pmtu EXPORT_SYMBOL_GPL vmlinux 0xca159b3f devlink_trap_report EXPORT_SYMBOL_GPL vmlinux 0xca247e41 trace_get_event_file +EXPORT_SYMBOL_GPL vmlinux 0xca312d9f __traceiter_pelt_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0xca386ef9 __fscrypt_prepare_rename EXPORT_SYMBOL_GPL vmlinux 0xca3c9f7b dm_bio_from_per_bio_data EXPORT_SYMBOL_GPL vmlinux 0xca400cd9 devm_led_trigger_register @@ -24740,7 +24742,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xcf473a52 fwnode_property_read_string EXPORT_SYMBOL_GPL vmlinux 0xcf479575 rdev_get_regmap EXPORT_SYMBOL_GPL vmlinux 0xcf484511 dev_pm_opp_sync_regulators -EXPORT_SYMBOL_GPL vmlinux 0xcf50aecf io_uring_cmd_import_fixed EXPORT_SYMBOL_GPL vmlinux 0xcf7ddb1d clk_regmap_divider_ro_ops EXPORT_SYMBOL_GPL vmlinux 0xcf833df0 fork_usermode_driver EXPORT_SYMBOL_GPL vmlinux 0xcf9c9e1d fsl_mc_bus_dpci_type @@ -24906,7 +24907,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xd4948d2c __irq_domain_alloc_fwnode EXPORT_SYMBOL_GPL vmlinux 0xd49573d5 fwnode_create_software_node EXPORT_SYMBOL_GPL vmlinux 0xd4ad0d07 fb_sys_read -EXPORT_SYMBOL_GPL vmlinux 0xd4b01027 io_uring_cmd_done EXPORT_SYMBOL_GPL vmlinux 0xd4b02f03 regulator_desc_list_voltage_linear EXPORT_SYMBOL_GPL vmlinux 0xd4b6157e devlink_health_reporter_recovery_done EXPORT_SYMBOL_GPL vmlinux 0xd4b9a616 reset_control_bulk_put @@ -24929,7 +24929,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xd5474690 usb_role_switch_set_role EXPORT_SYMBOL_GPL vmlinux 0xd54f8d68 acpi_ec_add_query_handler EXPORT_SYMBOL_GPL vmlinux 0xd55ad93b iommu_group_get_iommudata -EXPORT_SYMBOL_GPL vmlinux 0xd55d4ab4 __traceiter_pelt_se_tp EXPORT_SYMBOL_GPL vmlinux 0xd5704b85 dm_report_zones EXPORT_SYMBOL_GPL vmlinux 0xd5807af3 k3_ringacc_ring_pop EXPORT_SYMBOL_GPL vmlinux 0xd587c082 xenbus_probe_node @@ -25315,13 +25314,13 @@ EXPORT_SYMBOL_GPL vmlinux 0xe350debc serdev_device_write EXPORT_SYMBOL_GPL vmlinux 0xe3514ae2 blk_crypto_register EXPORT_SYMBOL_GPL vmlinux 0xe3592be8 gpiod_get_optional +EXPORT_SYMBOL_GPL vmlinux 0xe3691808 io_uring_cmd_sock EXPORT_SYMBOL_GPL vmlinux 0xe36c4109 power_supply_set_property EXPORT_SYMBOL_GPL vmlinux 0xe3700942 of_gen_pool_get EXPORT_SYMBOL_GPL vmlinux 0xe372393e nvme_auth_gen_shared_secret EXPORT_SYMBOL_GPL vmlinux 0xe37adbf1 pcie_flr EXPORT_SYMBOL_GPL vmlinux 0xe3840e18 secure_ipv4_port_ephemeral EXPORT_SYMBOL_GPL vmlinux 0xe38d6a47 mptcp_pm_get_add_addr_signal_max -EXPORT_SYMBOL_GPL vmlinux 0xe3922aa7 __traceiter_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0xe397caf5 seq_buf_printf EXPORT_SYMBOL_GPL vmlinux 0xe39d0794 usb_phy_roothub_exit EXPORT_SYMBOL_GPL vmlinux 0xe39d662b usb_of_get_device_node @@ -25346,6 +25345,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xe4309905 syscore_resume EXPORT_SYMBOL_GPL vmlinux 0xe4368d5a nvdimm_bus_add_badrange EXPORT_SYMBOL_GPL vmlinux 0xe436e90c __dma_fence_unwrap_merge +EXPORT_SYMBOL_GPL vmlinux 0xe458c290 __traceiter_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0xe46647a6 vcap_is_last_chain EXPORT_SYMBOL_GPL vmlinux 0xe466e72a wm8350_block_read EXPORT_SYMBOL_GPL vmlinux 0xe46771ce phy_resolve_aneg_pause @@ -25593,7 +25593,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xece97ccb devlink_params_register EXPORT_SYMBOL_GPL vmlinux 0xeceaf6a8 inet_hash EXPORT_SYMBOL_GPL vmlinux 0xeceb7f3d blkcg_root_css -EXPORT_SYMBOL_GPL vmlinux 0xecf3b299 __traceiter_sched_overutilized_tp EXPORT_SYMBOL_GPL vmlinux 0xed05c9cf syscon_regmap_lookup_by_phandle EXPORT_SYMBOL_GPL vmlinux 0xed11fa30 regulator_list_voltage_table EXPORT_SYMBOL_GPL vmlinux 0xed14a68f devm_extcon_dev_unregister @@ -25637,11 +25636,11 @@ EXPORT_SYMBOL_GPL vmlinux 0xee4091cb crypto_type_has_alg EXPORT_SYMBOL_GPL vmlinux 0xee518148 kmsg_dump_get_buffer EXPORT_SYMBOL_GPL vmlinux 0xee535703 bus_unregister +EXPORT_SYMBOL_GPL vmlinux 0xee5d002a __traceiter_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0xee6b71c4 syscon_regmap_lookup_by_compatible EXPORT_SYMBOL_GPL vmlinux 0xee6c633a devices_cgrp_subsys_on_dfl_key EXPORT_SYMBOL_GPL vmlinux 0xee6cff8c acpi_dev_for_each_child EXPORT_SYMBOL_GPL vmlinux 0xee6eec93 tcp_cong_avoid_ai -EXPORT_SYMBOL_GPL vmlinux 0xee6f771e sched_show_task EXPORT_SYMBOL_GPL vmlinux 0xee6fa5e3 virtio_max_dma_size EXPORT_SYMBOL_GPL vmlinux 0xee74a922 __tracepoint_console EXPORT_SYMBOL_GPL vmlinux 0xee9175c4 fwnode_device_is_available @@ -25661,7 +25660,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xeef68434 acpi_ec_remove_query_handler EXPORT_SYMBOL_GPL vmlinux 0xef1f6e23 apei_resources_request EXPORT_SYMBOL_GPL vmlinux 0xef29fcdd clk_bulk_put -EXPORT_SYMBOL_GPL vmlinux 0xef2edc6d __traceiter_pelt_dl_tp EXPORT_SYMBOL_GPL vmlinux 0xef33f570 of_get_named_gpio EXPORT_SYMBOL_GPL vmlinux 0xef34bf3e hrtimer_active EXPORT_SYMBOL_GPL vmlinux 0xef3bee46 rockchip_register_softrst_lut @@ -25858,6 +25856,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xf5dd5beb thermal_cooling_device_unregister EXPORT_SYMBOL_GPL vmlinux 0xf5f370e0 async_schedule_node EXPORT_SYMBOL_GPL vmlinux 0xf5f7ac27 mmc_cmdq_disable +EXPORT_SYMBOL_GPL vmlinux 0xf5fd9fb6 __traceiter_pelt_irq_tp EXPORT_SYMBOL_GPL vmlinux 0xf5fddf82 fib_rules_lookup EXPORT_SYMBOL_GPL vmlinux 0xf61c6b74 hv_do_hypercall EXPORT_SYMBOL_GPL vmlinux 0xf61c6f3b serial8250_clear_and_reinit_fifos @@ -26133,6 +26132,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xff81487d gpiod_remove_lookup_table EXPORT_SYMBOL_GPL vmlinux 0xff84a8a5 page_reporting_order EXPORT_SYMBOL_GPL vmlinux 0xff9e23d1 hugetlb_cgrp_subsys_on_dfl_key +EXPORT_SYMBOL_GPL vmlinux 0xffaab2bc kick_process EXPORT_SYMBOL_GPL vmlinux 0xffae8e8b nsecs_to_jiffies EXPORT_SYMBOL_GPL vmlinux 0xffb0522c ahci_pmp_retry_srst_ops EXPORT_SYMBOL_GPL vmlinux 0xffb6c07f ata_sff_dma_pause diff -u linux-aws-6.5-6.5.0/debian.aws/abi/version linux-aws-6.5-6.5.0/debian.aws/abi/version --- linux-aws-6.5-6.5.0/debian.aws/abi/version +++ linux-aws-6.5-6.5.0/debian.aws/abi/version @@ -1 +1 @@ -6.5.0-1013.13 +6.5.0-1014.14 diff -u linux-aws-6.5-6.5.0/debian.aws/changelog linux-aws-6.5-6.5.0/debian.aws/changelog --- linux-aws-6.5-6.5.0/debian.aws/changelog +++ linux-aws-6.5-6.5.0/debian.aws/changelog @@ -1,3 +1,2071 @@ +linux-aws (6.5.0-1015.15) mantic; urgency=medium + + * mantic/linux-aws: 6.5.0-1015.15 -proposed tracker (LP: #2052021) + + * Packaging resync (LP: #1786013) + - [Packaging] update Ubuntu.md + - debian/dkms-versions -- update from kernel-versions (main/2024.02.05) + + [ Ubuntu: 6.5.0-25.25 ] + + * mantic/linux: 6.5.0-25.25 -proposed tracker (LP: #2052615) + * Packaging resync (LP: #1786013) + - debian/dkms-versions -- update from kernel-versions (main/2024.02.05) + * [SRU][22.04.04]: mpi3mr driver update (LP: #2045233) + - scsi: mpi3mr: Invoke soft reset upon TSU or event ack time out + - scsi: mpi3mr: Update MPI Headers to version 3.00.28 + - scsi: mpi3mr: Add support for more than 1MB I/O + - scsi: mpi3mr: WRITE SAME implementation + - scsi: mpi3mr: Enhance handling of devices removed after controller reset + - scsi: mpi3mr: Update driver version to 8.5.0.0.0 + - scsi: mpi3mr: Split off bus_reset function from host_reset + - scsi: mpi3mr: Add support for SAS5116 PCI IDs + - scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 + - scsi: mpi3mr: Increase maximum number of PHYs to 64 from 32 + - scsi: mpi3mr: Add support for status reply descriptor + - scsi: mpi3mr: driver version upgrade to 8.5.0.0.50 + - scsi: mpi3mr: Refresh sdev queue depth after controller reset + - scsi: mpi3mr: Clean up block devices post controller reset + - scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable + State + - scsi: mpi3mr: Fetch correct device dev handle for status reply descriptor + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-1 + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-2 + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-3 + - scsi: mpi3mr: Update driver version to 8.5.1.0.0 + * The display becomes frozen after some time when a HDMI device is connected. + (LP: #2049027) + - drm/i915/dmc: Don't enable any pipe DMC events + * Audio balancing setting doesn't work with the cirrus codec (LP: #2051050) + - ALSA: hda/cs8409: Suppress vmaster control for Dolphin models + * partproke is broken on empty loopback device (LP: #2049689) + - block: Move checking GENHD_FL_NO_PART to bdev_add_partition() + * CVE-2023-51780 + - atm: Fix Use-After-Free in do_vcc_ioctl + * CVE-2023-6915 + - ida: Fix crash in ida_free when the bitmap is empty + * Update Ubuntu.md (LP: #2051176) + - [Packaging] update Ubuntu.md + * test_021_aslr_dapper_libs from ubuntu_qrt_kernel_security failed on K-5.19 / + J-OEM-6.1 / J-6.2 AMD64 (LP: #1983357) + - [Config]: set ARCH_MMAP_RND_{COMPAT_, }BITS to the maximum + * Intel E810-XXV - NETDEV WATCHDOG: (ice): transmit queue timed out + (LP: #2036239) + - ice: Add driver support for firmware changes for LAG + - ice: alter feature support check for SRIOV and LAG + * Mantic update: upstream stable patchset 2024-01-29 (LP: #2051584) + - Upstream stable to v6.1.67, v6.6.6 + - vdpa/mlx5: preserve CVQ vringh index + - hrtimers: Push pending hrtimers away from outgoing CPU earlier + - i2c: designware: Fix corrupted memory seen in the ISR + - netfilter: ipset: fix race condition between swap/destroy and kernel side + add/del/test + - zstd: Fix array-index-out-of-bounds UBSAN warning + - tg3: Move the [rt]x_dropped counters to tg3_napi + - tg3: Increment tx_dropped in tg3_tso_bug() + - kconfig: fix memory leak from range properties + - drm/amdgpu: correct chunk_ptr to a pointer to chunk. + - x86: Introduce ia32_enabled() + - x86/coco: Disable 32-bit emulation by default on TDX and SEV + - x86/entry: Convert INT 0x80 emulation to IDTENTRY + - x86/entry: Do not allow external 0x80 interrupts + - x86/tdx: Allow 32-bit emulation by default + - dt: dt-extract-compatibles: Handle cfile arguments in generator function + - dt: dt-extract-compatibles: Don't follow symlinks when walking tree + - platform/x86: asus-wmi: Move i8042 filter install to shared asus-wmi code + - of: dynamic: Fix of_reconfig_get_state_change() return value documentation + - platform/x86: wmi: Skip blocks with zero instances + - ipv6: fix potential NULL deref in fib6_add() + - octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam + - octeontx2-af: Check return value of nix_get_nixlf before using nixlf + - hv_netvsc: rndis_filter needs to select NLS + - r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE + - r8152: Add RTL8152_INACCESSIBLE checks to more loops + - r8152: Add RTL8152_INACCESSIBLE to r8156b_wait_loading_flash() + - r8152: Add RTL8152_INACCESSIBLE to r8153_pre_firmware_1() + - r8152: Add RTL8152_INACCESSIBLE to r8153_aldps_en() + - mlxbf-bootctl: correctly identify secure boot with development keys + - platform/mellanox: Add null pointer checks for devm_kasprintf() + - platform/mellanox: Check devm_hwmon_device_register_with_groups() return + value + - arcnet: restoring support for multiple Sohard Arcnet cards + - octeontx2-pf: consider both Rx and Tx packet stats for adaptive interrupt + coalescing + - net: stmmac: fix FPE events losing + - xsk: Skip polling event check for unbound socket + - octeontx2-af: fix a use-after-free in rvu_npa_register_reporters + - i40e: Fix unexpected MFS warning message + - iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero + - tcp: fix mid stream window clamp. + - ionic: fix snprintf format length warning + - ionic: Fix dim work handling in split interrupt mode + - ipv4: ip_gre: Avoid skb_pull() failure in ipgre_xmit() + - net: atlantic: Fix NULL dereference of skb pointer in + - net: hns: fix wrong head when modify the tx feature when sending packets + - net: hns: fix fake link up on xge port + - octeontx2-af: Adjust Tx credits when MCS external bypass is disabled + - octeontx2-af: Fix mcs sa cam entries size + - octeontx2-af: Fix mcs stats register address + - octeontx2-af: Add missing mcs flr handler call + - octeontx2-af: Update Tx link register range + - dt-bindings: interrupt-controller: Allow #power-domain-cells + - netfilter: nf_tables: fix 'exist' matching on bigendian arches + - netfilter: nf_tables: validate family when identifying table via handle + - netfilter: xt_owner: Fix for unsafe access of sk->sk_socket + - tcp: do not accept ACK of bytes we never sent + - bpf: sockmap, updating the sg structure should also update curr + - psample: Require 'CAP_NET_ADMIN' when joining "packets" group + - drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group + - mm/damon/sysfs: eliminate potential uninitialized variable warning + - tee: optee: Fix supplicant based device enumeration + - RDMA/hns: Fix unnecessary err return when using invalid congest control + algorithm + - RDMA/irdma: Do not modify to SQD on error + - RDMA/irdma: Add wait for suspend on SQD + - arm64: dts: rockchip: Expand reg size of vdec node for RK3328 + - arm64: dts: rockchip: Expand reg size of vdec node for RK3399 + - ASoC: fsl_sai: Fix no frame sync clock issue on i.MX8MP + - RDMA/rtrs-srv: Do not unconditionally enable irq + - RDMA/rtrs-clt: Start hb after path_up + - RDMA/rtrs-srv: Check return values while processing info request + - RDMA/rtrs-srv: Free srv_mr iu only when always_invalidate is true + - RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight + - RDMA/rtrs-clt: Fix the max_send_wr setting + - RDMA/rtrs-clt: Remove the warnings for req in_use check + - RDMA/bnxt_re: Correct module description string + - RDMA/irdma: Refactor error handling in create CQP + - RDMA/irdma: Fix UAF in irdma_sc_ccq_get_cqe_info() + - hwmon: (acpi_power_meter) Fix 4.29 MW bug + - ASoC: codecs: lpass-tx-macro: set active_decimator correct default value + - hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe() + - ASoC: wm_adsp: fix memleak in wm_adsp_buffer_populate + - RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz + - RDMA/irdma: Avoid free the non-cqp_request scratch + - drm/bridge: tc358768: select CONFIG_VIDEOMODE_HELPERS + - arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3 + - ARM: dts: imx6ul-pico: Describe the Ethernet PHY clock + - tracing: Fix a warning when allocating buffered events fails + - scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle() + - ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init + - ARM: dts: imx7: Declare timers compatible with fsl,imx6dl-gpt + - ARM: dts: imx28-xea: Pass the 'model' property + - riscv: fix misaligned access handling of C.SWSP and C.SDSP + - md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly() + - rethook: Use __rcu pointer for rethook::handler + - kprobes: consistent rcu api usage for kretprobe holder + - ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA + - nvme-pci: Add sleep quirk for Kingston drives + - io_uring: fix mutex_unlock with unreferenced ctx + - ALSA: usb-audio: Add Pioneer DJM-450 mixer controls + - ALSA: pcm: fix out-of-bounds in snd_pcm_state_names + - ALSA: hda/realtek: add new Framework laptop to quirks + - ALSA: hda/realtek: Add Framework laptop 16 to quirks + - ring-buffer: Test last update in 32bit version of __rb_time_read() + - nilfs2: fix missing error check for sb_set_blocksize call + - nilfs2: prevent WARNING in nilfs_sufile_set_segment_usage() + - cgroup_freezer: cgroup_freezing: Check if not frozen + - checkstack: fix printed address + - tracing: Always update snapshot buffer size + - tracing: Disable snapshot buffer when stopping instance tracers + - tracing: Fix incomplete locking when disabling buffered events + - tracing: Fix a possible race when disabling buffered events + - packet: Move reference count in packet_sock to atomic_long_t + - r8169: fix rtl8125b PAUSE frames blasting when suspended + - regmap: fix bogus error on regcache_sync success + - platform/surface: aggregator: fix recv_buf() return value + - hugetlb: fix null-ptr-deref in hugetlb_vma_lock_write + - mm: fix oops when filemap_map_pmd() without prealloc_pte + - powercap: DTPM: Fix missing cpufreq_cpu_put() calls + - md/raid6: use valid sector values to determine if an I/O should wait on the + reshape + - arm64: dts: mediatek: mt7622: fix memory node warning check + - arm64: dts: mediatek: mt8183-kukui-jacuzzi: fix dsi unnecessary cells + properties + - arm64: dts: mediatek: cherry: Fix interrupt cells for MT6360 on I2C7 + - arm64: dts: mediatek: mt8173-evb: Fix regulator-fixed node names + - arm64: dts: mediatek: mt8195: Fix PM suspend/resume with venc clocks + - arm64: dts: mediatek: mt8183: Fix unit address for scp reserved memory + - arm64: dts: mediatek: mt8183: Move thermal-zones to the root node + - arm64: dts: mediatek: mt8183-evb: Fix unit_address_vs_reg warning on ntc + - coresight: etm4x: Remove bogous __exit annotation for some functions + - hwtracing: hisi_ptt: Add dummy callback pmu::read() + - misc: mei: client.c: return negative error code in mei_cl_write + - misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write + - LoongArch: BPF: Don't sign extend memory load operand + - LoongArch: BPF: Don't sign extend function return value + - ring-buffer: Force absolute timestamp on discard of event + - tracing: Set actual size after ring buffer resize + - tracing: Stop current tracer when resizing buffer + - parisc: Reduce size of the bug_table on 64-bit kernel by half + - parisc: Fix asm operand number out of range build error in bug table + - arm64: dts: mediatek: add missing space before { + - arm64: dts: mt8183: kukui: Fix underscores in node names + - x86/sev: Fix kernel crash due to late update to read-only ghcb_version + - gpiolib: sysfs: Fix error handling on failed export + - drm/amd/amdgpu: Fix warnings in amdgpu/amdgpu_display.c + - drm/amdgpu: Add I2C EEPROM support on smu v13_0_6 + - usb: gadget: f_hid: fix report descriptor allocation + - serial: 8250_dw: Add ACPI ID for Granite Rapids-D UART + - parport: Add support for Brainboxes IX/UC/PX parallel cards + - cifs: Fix non-availability of dedup breaking generic/304 + - Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1" + - smb: client: fix potential NULL deref in parse_dfs_referrals() + - ARM: PL011: Fix DMA support + - serial: sc16is7xx: address RX timeout interrupt errata + - serial: 8250: 8250_omap: Clear UART_HAS_RHR_IT_DIS bit + - serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt + - serial: 8250_omap: Add earlycon support for the AM654 UART controller + - devcoredump: Send uevent once devcd is ready + - x86/CPU/AMD: Check vendor in the AMD microcode callback + - USB: gadget: core: adjust uevent timing on gadget unbind + - cifs: Fix flushing, invalidation and file size with copy_file_range() + - cifs: Fix flushing, invalidation and file size with FICLONE + - MIPS: kernel: Clear FPU states when setting up kernel threads + - KVM: s390/mm: Properly reset no-dat + - KVM: SVM: Update EFER software model on CR0 trap for SEV-ES + - MIPS: Loongson64: Reserve vgabios memory on boot + - MIPS: Loongson64: Handle more memory types passed from firmware + - MIPS: Loongson64: Enable DMA noncoherent support + - riscv: Kconfig: Add select ARM_AMBA to SOC_STARFIVE + - [Config] updateconfigs after enabling ARM_AMBA on riscv + - scsi: sd: Fix sshdr use in sd_suspend_common() + - nouveau: use an rwlock for the event lock. + - modpost: fix section mismatch message for RELA + - drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2) + - drm/amdgpu: finalizing mem_partitions at the end of GMC v9 sw_fini + - dm-crypt: start allocating with MAX_ORDER + - r8152: Hold the rtnl_lock for all of reset + - net: dsa: microchip: provide a list of valid protocols for xmit handler + - net/smc: fix missing byte order conversion in CLC handshake + - RDMA/core: Fix uninit-value access in ib_get_eth_speed() + - ARM: dts: imx6q: skov: fix ethernet clock regression + - ARM: dts: rockchip: Fix sdmmc_pwren's pinmux setting for RK3128 + - ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act + - firmware: arm_scmi: Extend perf protocol ops to get number of domains + - firmware: arm_scmi: Extend perf protocol ops to get information of a domain + - firmware: arm_scmi: Fix frequency truncation by promoting multiplier type + - firmware: arm_scmi: Simplify error path in scmi_dvfs_device_opps_add() + - RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned + - RDMA/irdma: Fix support for 64k pages + - io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring() + - io_uring/kbuf: check for buffer list readiness after NULL check + - arm64: dts: imx8-ss-lsio: Add PWM interrupts + - arm64: dts: freescale: imx8-ss-lsio: Fix #pwm-cells + - arm64: dts: imx93: correct mediamix power + - arm64: dts: imx8-apalis: set wifi regulator to always-on + - arm64: dts: rockchip: Fix eMMC Data Strobe PD on rk3588 + - scripts/gdb: fix lx-device-list-bus and lx-device-list-class + - ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA + - ALSA: hda/realtek: Apply quirk for ASUS UM3504DA + - ALSA: hda/realtek: fix speakers on XPS 9530 (2023) + - ALSA: hda/realtek: Add quirk for Lenovo Yoga Pro 7 + - lib/group_cpus.c: avoid acquiring cpu hotplug lock in group_cpus_evenly + - leds: trigger: netdev: fix RTNL handling to prevent potential deadlock + - nfp: flower: fix for take a mutex lock in soft irq context and rcu lock + - workqueue: Make sure that wq_unbound_cpumask is never empty + - drivers/base/cpu: crash data showing should depends on KEXEC_CORE + - mm/memory_hotplug: add missing mem_hotplug_lock + - mm/memory_hotplug: fix error handling in add_memory_resource() + - drm/atomic-helpers: Invoke end_fb_access while owning plane state + - drm/i915/mst: Fix .mode_valid_ctx() return values + - drm/i915/mst: Reject modes that require the bigjoiner + - arm64: dts: mt7986: change cooling trips + - arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3 + - arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization + - arm64: dts: mediatek: mt8186: fix clock names for power domains + - arm64: dts: mediatek: mt8186: Change gpu speedbin nvmem cell name + - coresight: Fix crash when Perf and sysfs modes are used concurrently + - coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb + - coresight: ultrasoc-smb: Config SMB buffer before register sink + - coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base + - ASoC: ops: add correct range check for limiting volume + - nvmem: Do not expect fixed layouts to grab a layout driver + - serial: ma35d1: Validate console index before assignment + - powerpc/ftrace: Fix stack teardown in ftrace_no_trace + - perf metrics: Avoid segv if default metricgroup isn't set + - ASoC: qcom: sc8280xp: Limit speaker digital volumes + - gcc-plugins: randstruct: Update code comment in relayout_struct() + - drm/amdgpu: Fix refclk reporting for SMU v13.0.6 + - drm/amdgpu: Add bootloader status check + - drm/amdgpu: Add bootloader wait for PSP v13 + - drm/amdgpu: Restrict bootloader wait to SMUv13.0.6 + - drm/amdgpu: update retry times for psp vmbx wait + - drm/amdgpu: update retry times for psp BL wait + - drm/amdgpu: Restrict extended wait to PSP v13.0.6 + - Upstream stable to v6.1.68, v6.6.7 + * i915 regression introduced with 5.5 kernel (LP: #2044131) + - drm/i915: Skip some timing checks on BXT/GLK DSI transcoders + * Mantic update: upstream stable patchset 2024-01-26 (LP: #2051366) + - cifs: Fix FALLOC_FL_ZERO_RANGE by setting i_size if EOF moved + - cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF moved + - smb: client: report correct st_size for SMB and NFS symlinks + - pinctrl: avoid reload of p state in list iteration + - firewire: core: fix possible memory leak in create_units() + - mmc: sdhci-pci-gli: Disable LPM during initialization + - mmc: cqhci: Increase recovery halt timeout + - mmc: cqhci: Warn of halt or task clear failure + - mmc: cqhci: Fix task clearing in CQE error recovery + - mmc: block: Retry commands in CQE error recovery + - mmc: block: Do not lose cache flush during CQE error recovery + - mmc: block: Be sure to wait while busy in CQE error recovery + - ALSA: hda: Disable power-save on KONTRON SinglePC + - ALSA: hda/realtek: Headset Mic VREF to 100% + - ALSA: hda/realtek: Add supported ALC257 for ChromeOS + - dm-verity: align struct dm_verity_fec_io properly + - scsi: Change SCSI device boolean fields to single bit flags + - scsi: sd: Fix system start for ATA devices + - drm/amd: Enable PCIe PME from D3 + - drm/amdgpu: Force order between a read and write to the same address + - drm/amd/display: Include udelay when waiting for INBOX0 ACK + - drm/amd/display: Remove min_dst_y_next_start check for Z8 + - drm/amd/display: Use DRAM speed from validation for dummy p-state + - drm/amd/display: Update min Z8 residency time to 2100 for DCN314 + - drm/amd/display: fix ABM disablement + - dm verity: initialize fec io before freeing it + - dm verity: don't perform FEC for failed readahead IO + - nvme: check for valid nvme_identify_ns() before using it + - powercap: DTPM: Fix unneeded conversions to micro-Watts + - cpufreq/amd-pstate: Fix the return value of amd_pstate_fast_switch() + - dma-buf: fix check in dma_resv_add_fence + - bcache: revert replacing IS_ERR_OR_NULL with IS_ERR + - iommu/vt-d: Add MTL to quirk list to skip TE disabling + - KVM: PPC: Book3S HV: Fix KVM_RUN clobbering FP/VEC user registers + - powerpc: Don't clobber f0/vs0 during fp|altivec register save + - parisc: Mark ex_table entries 32-bit aligned in assembly.h + - parisc: Mark ex_table entries 32-bit aligned in uaccess.h + - parisc: Use natural CPU alignment for bug_table + - parisc: Mark lock_aligned variables 16-byte aligned on SMP + - parisc: Drop the HP-UX ENOSYM and EREMOTERELEASE error codes + - parisc: Mark jump_table naturally aligned + - parisc: Ensure 32-bit alignment on parisc unwind section + - parisc: Mark altinstructions read-only and 32-bit aligned + - btrfs: add dmesg output for first mount and last unmount of a filesystem + - btrfs: ref-verify: fix memory leaks in btrfs_ref_tree_mod() + - btrfs: fix off-by-one when checking chunk map includes logical address + - btrfs: send: ensure send_fd is writable + - btrfs: make error messages more clear when getting a chunk map + - btrfs: fix 64bit compat send ioctl arguments not initializing version member + - auxdisplay: hd44780: move cursor home after clear display command + - serial: sc16is7xx: Put IOControl register into regmap_volatile + - serial: sc16is7xx: add missing support for rs485 devicetree properties + - dpaa2-eth: increase the needed headroom to account for alignment + - uapi: propagate __struct_group() attributes to the container union + - selftests/net: ipsec: fix constant out of range + - selftests/net: fix a char signedness issue + - selftests/net: unix: fix unused variable compiler warning + - selftests/net: mptcp: fix uninitialized variable warnings + - octeontx2-af: Fix possible buffer overflow + - net: stmmac: xgmac: Disable FPE MMC interrupts + - octeontx2-pf: Fix adding mbox work queue entry when num_vfs > 64 + - octeontx2-af: Install TC filter rules in hardware based on priority + - octeontx2-pf: Restore TC ingress police rules when interface is up + - r8169: prevent potential deadlock in rtl8169_close + - ravb: Fix races between ravb_tx_timeout_work() and net related ops + - net: ravb: Check return value of reset_control_deassert() + - net: ravb: Use pm_runtime_resume_and_get() + - net: ravb: Make write access to CXR35 first before accessing other EMAC + registers + - net: ravb: Start TX queues after HW initialization succeeded + - net: ravb: Stop DMA in case of failures on ravb_open() + - net: ravb: Keep reverse order of operations in ravb_remove() + - octeontx2-af: Initialize 'cntr_val' to fix uninitialized symbol error + - spi: Fix null dereference on suspend + - cpufreq: imx6q: Don't disable 792 Mhz OPP unnecessarily + - iommu/vt-d: Omit devTLB invalidation requests when TES=0 + - iommu/vt-d: Disable PCI ATS in legacy passthrough mode + - iommu/vt-d: Make context clearing consistent with context mapping + - drm/amd/pm: fix a memleak in aldebaran_tables_init + - mmc: sdhci-sprd: Fix vqmmc not shutting down after the card was pulled + - drm/amd/display: Fix MPCC 1DLUT programming + - r8169: fix deadlock on RTL8125 in jumbo mtu mode + - xen: simplify evtchn_do_upcall() call maze + - x86/xen: fix percpu vcpu_info allocation + - smb: client: fix missing mode bits for SMB symlinks + - ksmbd: fix possible deadlock in smb2_open + - drm/i915: Also check for VGA converter in eDP probe + - net: libwx: fix memory leak on msix entry + - drm/amdgpu: correct the amdgpu runtime dereference usage count + - drm/amdgpu: fix memory overflow in the IB test + - drm/amdgpu: Update EEPROM I2C address for smu v13_0_0 + - drm/amd/display: force toggle rate wa for first link training for a retimer + - ACPI: video: Use acpi_video_device for cooling-dev driver data + - iommu/vt-d: Fix incorrect cache invalidation for mm notification + - io_uring: free io_buffer_list entries via RCU + - io_uring: don't guard IORING_OFF_PBUF_RING with SETUP_NO_MMAP + - iommu: Avoid more races around device probe + - ext2: Fix ki_pos update for DIO buffered-io fallback case + - btrfs: free the allocated memory if btrfs_alloc_page_array() fails + - io_uring/kbuf: recycle freed mapped buffer ring entries + - media: v4l2-subdev: Fix a 64bit bug + - netdevsim: Don't accept device bound programs + - net: rswitch: Fix type of ret in rswitch_start_xmit() + - net: rswitch: Fix return value in rswitch_start_xmit() + - net: rswitch: Fix missing dev_kfree_skb_any() in error path + - wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta() + - wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during flush + - net: dsa: mv88e6xxx: fix marvell 6350 switch probing + - dpaa2-eth: recycle the RX buffer only after all processing done + - bpf: Add missed allocation hint for bpf_mem_cache_alloc_flags() + - neighbour: Fix __randomize_layout crash in struct neighbour + - efi/unaccepted: Fix off-by-one when checking for overlapping ranges + - ethtool: don't propagate EOPNOTSUPP from dumps + - bpf, sockmap: af_unix stream sockets need to hold ref for pair sock + - powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR- + IOV device + - s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir + - drm/amd/display: Refactor edp power control + - drm/amd/display: Remove power sequencing check + - drm/i915/gsc: Mark internal GSC engine with reserved uabi class + - drm/panel: starry-2081101qfh032011-53g: Fine tune the panel power sequence + - drm/panel: nt36523: fix return value check in nt36523_probe() + - cpufreq/amd-pstate: Fix scaling_min_freq and scaling_max_freq update + - cpufreq/amd-pstate: Only print supported EPP values for performance governor + - iommu: Fix printk arg in of_iommu_get_resv_regions() + - drm/amd/display: refactor ILR to make it work + - drm/amd/display: Reduce default backlight min from 5 nits to 1 nits + - Upstream stable to v6.1.66, v6.6.5 + * Mantic update: upstream stable patchset 2024-01-25 (LP: #2051231) + - afs: Fix afs_server_list to be cleaned up with RCU + - afs: Make error on cell lookup failure consistent with OpenAFS + - drm/panel: auo,b101uan08.3: Fine tune the panel power sequence + - drm/panel: simple: Fix Innolux G101ICE-L01 bus flags + - drm/panel: simple: Fix Innolux G101ICE-L01 timings + - wireguard: use DEV_STATS_INC() + - octeontx2-pf: Fix memory leak during interface down + - ata: pata_isapnp: Add missing error check for devm_ioport_map() + - drm/i915: do not clean GT table on error path + - drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full + - HID: fix HID device resource race between HID core and debugging support + - ipv4: Correct/silence an endian warning in __ip_do_redirect + - net: usb: ax88179_178a: fix failed operations during ax88179_reset + - net/smc: avoid data corruption caused by decline + - arm/xen: fix xen_vcpu_info allocation alignment + - octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx + queue than its PF + - amd-xgbe: handle corner-case during sfp hotplug + - amd-xgbe: handle the corner-case during tx completion + - amd-xgbe: propagate the correct speed and duplex status + - net: axienet: Fix check for partial TX checksum + - afs: Return ENOENT if no cell DNS record can be found + - afs: Fix file locking on R/O volumes to operate in local mode + - arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y + - i40e: Fix adding unsupported cloud filters + - nvmet: nul-terminate the NQNs passed in the connect command + - USB: dwc3: qcom: fix resource leaks on probe deferral + - USB: dwc3: qcom: fix ACPI platform device leak + - lockdep: Fix block chain corruption + - cifs: distribute channels across interfaces based on speed + - cifs: account for primary channel in the interface list + - cifs: fix leak of iface for primary channel + - MIPS: KVM: Fix a build warning about variable set but not used + - media: qcom: Initialise V4L2 async notifier later + - media: qcom: camss: Fix V4L2 async notifier error path + - media: qcom: camss: Fix genpd cleanup + - NFSD: Fix "start of NFS reply" pointer passed to nfsd_cache_update() + - NFSD: Fix checksum mismatches in the duplicate reply cache + - ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA + - swiotlb-xen: provide the "max_mapping_size" method + - bcache: replace a mistaken IS_ERR() by IS_ERR_OR_NULL() in + btree_gc_coalesce() + - md: fix bi_status reporting in md_end_clone_io + - bcache: fixup multi-threaded bch_sectors_dirty_init() wake-up race + - io_uring/fs: consider link->flags when getting path for LINKAT + - s390/dasd: protect device queue against concurrent access + - USB: serial: option: add Luat Air72*U series products + - hv_netvsc: fix race of netvsc and VF register_netdevice + - hv_netvsc: Fix race of register_netdevice_notifier and VF register + - hv_netvsc: Mark VF as slave before exposing it to user-mode + - dm-delay: fix a race between delay_presuspend and delay_bio + - bcache: check return value from btree_node_alloc_replacement() + - bcache: prevent potential division by zero error + - bcache: fixup init dirty data errors + - bcache: fixup lock c->root error + - usb: cdnsp: Fix deadlock issue during using NCM gadget + - USB: serial: option: add Fibocom L7xx modules + - USB: serial: option: fix FM101R-GL defines + - USB: serial: option: don't claim interface 4 for ZTE MF290 + - usb: typec: tcpm: Skip hard reset when in error recovery + - USB: dwc2: write HCINT with INTMASK applied + - usb: dwc3: Fix default mode initialization + - usb: dwc3: set the dma max_seg_size + - USB: dwc3: qcom: fix software node leak on probe errors + - USB: dwc3: qcom: fix wakeup after probe deferral + - io_uring: fix off-by one bvec index + - irqchip/gic-v3-its: Flush ITS tables correctly in non-coherent GIC designs + - drm/msm/dsi: use the correct VREG_CTRL_1 value for 4nm cphy + - s390/ism: ism driver implies smc protocol + - rxrpc: Fix RTT determination to use any ACK as a source + - rxrpc: Defer the response to a PING ACK until we've parsed it + - blk-cgroup: avoid to warn !rcu_read_lock_held() in blkg_lookup() + - fs: Pass AT_GETATTR_NOSEC flag to getattr interface function + - net: wangxun: fix kernel panic due to null pointer + - filemap: add a per-mapping stable writes flag + - block: update the stable_writes flag in bdev_add + - PM: tools: Fix sleepgraph syntax error + - net, vrf: Move dstats structure to core + - net: Move {l,t,d}stats allocation to core and convert veth & vrf + - bpf: Fix dev's rx stats for bpf_redirect_peer traffic + - drm/panel: boe-tv101wum-nl6: Fine tune Himax83102-j02 panel HFP and HBP + - s390/ipl: add missing IPL_TYPE_ECKD_DUMP case to ipl_init() + - net: veth: fix ethtool stats reporting + - vsock/test: fix SEQPACKET message bounds test + - net: ipa: fix one GSI register field width + - nvme: blank out authentication fabrics options if not configured + - mm: add a NO_INHERIT flag to the PR_SET_MDWE prctl + - prctl: Disable prctl(PR_SET_MDWE) on parisc + - kselftest/arm64: Fix output formatting for za-fork + - drm/msm/dpu: Add missing safe_lut_tbl in sc8280xp catalog + - drm/ast: Disconnect BMC if physical connector is connected + - thunderbolt: Set lane bonding bit only for downstream port + - ACPI: video: Use acpi_device_fix_up_power_children() + - ACPI: processor_idle: use raw_safe_halt() in acpi_idle_play_dead() + - ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA + - ACPI: PM: Add acpi_device_fix_up_power_children() function + - tls: fix NULL deref on tls_sw_splice_eof() with empty record + - dt-bindings: usb: microchip,usb5744: Add second supply + - usb: misc: onboard-hub: add support for Microchip USB5744 + - platform/x86/amd/pmc: adjust getting DRAM size behavior + - ALSA: hda: ASUS UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus + - ALSA: hda/realtek: Add quirks for ASUS 2024 Zenbooks + - veth: Use tstats per-CPU traffic counters + - USB: xhci-plat: fix legacy PHY double init + - usb: config: fix iteration issue in 'usb_get_bos_descriptor()' + - Upstream stable to v6.1.65, v6.6.4 + * Mantic update: v6.5.13 upstream stable release (LP: #2051142) + - locking/ww_mutex/test: Fix potential workqueue corruption + - btrfs: abort transaction on generation mismatch when marking eb as dirty + - lib/generic-radix-tree.c: Don't overflow in peek() + - x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN + - perf/core: Bail out early if the request AUX area is out of bound + - srcu: Fix srcu_struct node grpmask overflow on 64-bit systems + - selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config + - clocksource/drivers/timer-imx-gpt: Fix potential memory leak + - clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware + - srcu: Only accelerate on enqueue time + - smp,csd: Throw an error if a CSD lock is stuck for too long + - cpu/hotplug: Don't offline the last non-isolated CPU + - workqueue: Provide one lock class key per work_on_cpu() callsite + - x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size + - wifi: plfxlc: fix clang-specific fortify warning + - wifi: ath12k: Ignore fragments from uninitialized peer in dp + - wifi: mac80211_hwsim: fix clang-specific fortify warning + - wifi: mac80211: don't return unset power in ieee80211_get_tx_power() + - atl1c: Work around the DMA RX overflow issue + - bpf: Detect IP == ksym.end as part of BPF program + - wifi: ath9k: fix clang-specific fortify warnings + - wifi: ath12k: fix possible out-of-bound read in ath12k_htt_pull_ppdu_stats() + - wifi: ath10k: fix clang-specific fortify warning + - wifi: ath12k: fix possible out-of-bound write in + ath12k_wmi_ext_hal_reg_caps() + - ACPI: APEI: Fix AER info corruption when error status data has multiple + sections + - net: sfp: add quirk for Fiberstone GPON-ONU-34-20BI + - wifi: mt76: mt7921e: Support MT7992 IP in Xiaomi Redmibook 15 Pro (2023) + - net: annotate data-races around sk->sk_tx_queue_mapping + - net: annotate data-races around sk->sk_dst_pending_confirm + - wifi: ath12k: mhi: fix potential memory leak in ath12k_mhi_register() + - wifi: ath10k: Don't touch the CE interrupt registers after power up + - net: sfp: add quirk for FS's 2.5G copper SFP + - vsock: read from socket's error queue + - bpf: Ensure proper register state printing for cond jumps + - wifi: iwlwifi: mvm: fix size check for fw_link_id + - Bluetooth: btusb: Add date->evt_skb is NULL check + - Bluetooth: Fix double free in hci_conn_cleanup + - ACPI: EC: Add quirk for HP 250 G7 Notebook PC + - tsnep: Fix tsnep_request_irq() format-overflow warning + - gpiolib: acpi: Add a ignore interrupt quirk for Peaq C1010 + - platform/chrome: kunit: initialize lock for fake ec_dev + - of: address: Fix address translation when address-size is greater than 2 + - platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e + - drm/gma500: Fix call trace when psb_gem_mm_init() fails + - drm/amdkfd: ratelimited SQ interrupt messages + - drm/komeda: drop all currently held locks if deadlock happens + - drm/amd/display: Blank phantom OTG before enabling + - drm/amd/display: Don't lock phantom pipe on disabling + - drm/amd/display: add seamless pipe topology transition check + - drm/edid: Fixup h/vsync_end instead of h/vtotal + - md: don't rely on 'mddev->pers' to be set in mddev_suspend() + - drm/amdgpu: not to save bo in the case of RAS err_event_athub + - drm/amdkfd: Fix a race condition of vram buffer unref in svm code + - drm/amd: Update `update_pcie_parameters` functions to use uint8_t arguments + - drm/amd/display: use full update for clip size increase of large plane + source + - string.h: add array-wrappers for (v)memdup_user() + - kernel: kexec: copy user-array safely + - kernel: watch_queue: copy user-array safely + - drm_lease.c: copy user-array safely + - drm: vmwgfx_surface.c: copy user-array safely + - drm/msm/dp: skip validity check for DP CTS EDID checksum + - drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 + - drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga + - drm/amdgpu: Fix potential null pointer derefernce + - drm/panel: fix a possible null pointer dereference + - drm/panel/panel-tpo-tpg110: fix a possible null pointer dereference + - drm/radeon: fix a possible null pointer dereference + - drm/amdgpu/vkms: fix a possible null pointer dereference + - drm/panel: st7703: Pick different reset sequence + - drm/amdkfd: Fix shift out-of-bounds issue + - drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL + - drm/amd: Disable PP_PCIE_DPM_MASK when dynamic speed switching not supported + - drm/amd/display: fix num_ways overflow error + - drm/amd: check num of link levels when update pcie param + - arm64: dts: ls208xa: use a pseudo-bus to constrain usb dma size + - selftests/efivarfs: create-read: fix a resource leak + - ASoC: mediatek: mt8188-mt6359: support dynamic pinctrl + - ASoC: soc-card: Add storage for PCI SSID + - ASoC: SOF: Pass PCI SSID to machine driver + - crypto: pcrypt - Fix hungtask for PADATA_RESET + - ASoC: SOF: ipc4: handle EXCEPTION_CAUGHT notification from firmware + - RDMA/hfi1: Use FIELD_GET() to extract Link Width + - scsi: hisi_sas: Set debugfs_dir pointer to NULL after removing debugfs + - scsi: ibmvfc: Remove BUG_ON in the case of an empty event pool + - fs/jfs: Add check for negative db_l2nbperpage + - fs/jfs: Add validity check for db_maxag and db_agpref + - jfs: fix array-index-out-of-bounds in dbFindLeaf + - jfs: fix array-index-out-of-bounds in diAlloc + - HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround + - ARM: 9320/1: fix stack depot IRQ stack filter + - ALSA: hda: Fix possible null-ptr-deref when assigning a stream + - gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound + - PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields + - PCI: mvebu: Use FIELD_PREP() with Link Width + - atm: iphase: Do PCI error checks on own line + - PCI: Do error check on own line to split long "if" conditions + - scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup() + - PCI: Use FIELD_GET() to extract Link Width + - PCI: Extract ATS disabling to a helper function + - PCI: Disable ATS for specific Intel IPU E2000 devices + - PCI: dwc: Add dw_pcie_link_set_max_link_width() + - PCI: dwc: Add missing PCI_EXP_LNKCAP_MLW handling + - misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller + - PCI: Use FIELD_GET() in Sapphire RX 5600 XT Pulse quirk + - ASoC: Intel: soc-acpi-cht: Add Lenovo Yoga Tab 3 Pro YT3-X90 quirk + - crypto: hisilicon/qm - prevent soft lockup in receive loop + - HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W + - exfat: support handle zero-size directory + - mfd: intel-lpss: Add Intel Lunar Lake-M PCI IDs + - iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe() + - thunderbolt: Apply USB 3.x bandwidth quirk only in software connection + manager + - tty: vcc: Add check for kstrdup() in vcc_probe() + - dt-bindings: phy: qcom,snps-eusb2-repeater: Add magic tuning overrides + - phy: qualcomm: phy-qcom-eusb2-repeater: Use regmap_fields + - phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs + - usb: dwc3: core: configure TX/RX threshold for DWC3_IP + - usb: ucsi: glink: use the connector orientation GPIO to provide switch + events + - soundwire: dmi-quirks: update HP Omen match + - f2fs: fix error path of __f2fs_build_free_nids + - f2fs: fix error handling of __get_node_page + - usb: host: xhci: Avoid XHCI resume delay if SSUSB device is not present + - usb: gadget: f_ncm: Always set current gadget in ncm_bind() + - 9p/trans_fd: Annotate data-racy writes to file::f_flags + - 9p: v9fs_listxattr: fix %s null argument warning + - i3c: mipi-i3c-hci: Fix out of bounds access in hci_dma_irq_handler + - i2c: i801: Add support for Intel Birch Stream SoC + - i2c: fix memleak in i2c_new_client_device() + - i2c: sun6i-p2wi: Prevent potential division by zero + - virtio-blk: fix implicit overflow on virtio_max_dma_size + - i3c: master: mipi-i3c-hci: Fix a kernel panic for accessing DAT_data. + - media: gspca: cpia1: shift-out-of-bounds in set_flicker + - media: vivid: avoid integer overflow + - media: ipu-bridge: increase sensor_name size + - gfs2: ignore negated quota changes + - gfs2: fix an oops in gfs2_permission + - media: cobalt: Use FIELD_GET() to extract Link Width + - media: ccs: Fix driver quirk struct documentation + - media: imon: fix access to invalid resource for the second interface + - drm/amd/display: Avoid NULL dereference of timing generator + - kgdb: Flush console before entering kgdb on panic + - riscv: VMAP_STACK overflow detection thread-safe + - i2c: dev: copy userspace array safely + - ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings + - drm/qxl: prevent memory leak + - ALSA: hda/realtek: Add quirk for ASUS UX7602ZM + - drm/amdgpu: fix software pci_unplug on some chips + - pwm: Fix double shift bug + - mtd: rawnand: tegra: add missing check for platform_get_irq() + - wifi: iwlwifi: Use FW rate for non-data frames + - sched/core: Optimize in_task() and in_interrupt() a bit + - samples/bpf: syscall_tp_user: Rename num_progs into nr_tests + - samples/bpf: syscall_tp_user: Fix array out-of-bound access + - dt-bindings: serial: fix regex pattern for matching serial node children + - SUNRPC: ECONNRESET might require a rebind + - mtd: rawnand: intel: check return value of devm_kasprintf() + - mtd: rawnand: meson: check return value of devm_kasprintf() + - drm/i915/mtl: avoid stringop-overflow warning + - NFSv4.1: fix handling NFS4ERR_DELAY when testing for session trunking + - SUNRPC: Add an IS_ERR() check back to where it was + - NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO + - SUNRPC: Fix RPC client cleaned up the freed pipefs dentries + - RISC-V: hwprobe: Fix vDSO SIGSEGV + - riscv: provide riscv-specific is_trap_insn() + - gfs2: Silence "suspicious RCU usage in gfs2_permission" warning + - drm/i915/tc: Fix -Wformat-truncation in intel_tc_port_init + - vdpa_sim_blk: allocate the buffer zeroed + - vhost-vdpa: fix use after free in vhost_vdpa_probe() + - gcc-plugins: randstruct: Only warn about true flexible arrays + - bpf: handle ldimm64 properly in check_cfg() + - bpf: fix precision backtracking instruction iteration + - net: set SOCK_RCU_FREE before inserting socket into hashtable + - ipvlan: add ipvlan_route_v6_outbound() helper + - tty: Fix uninit-value access in ppp_sync_receive() + - xen/events: avoid using info_for_irq() in xen_send_IPI_one() + - net: hns3: fix add VLAN fail issue + - net: hns3: add barrier in vf mailbox reply process + - net: hns3: fix incorrect capability bit display for copper port + - net: hns3: fix out-of-bounds access may occur when coalesce info is read via + debugfs + - net: hns3: fix variable may not initialized problem in hns3_init_mac_addr() + - net: hns3: fix VF reset fail issue + - net: hns3: fix VF wrong speed and duplex issue + - tipc: Fix kernel-infoleak due to uninitialized TLV value + - net: mvneta: fix calls to page_pool_get_stats + - ppp: limit MRU to 64K + - xen/events: fix delayed eoi list handling + - blk-mq: make sure active queue usage is held for bio_integrity_prep() + - ptp: annotate data-race around q->head and q->tail + - bonding: stop the device in bond_setup_by_slave() + - net: ethernet: cortina: Fix max RX frame define + - net: ethernet: cortina: Handle large frames + - net: ethernet: cortina: Fix MTU max setting + - af_unix: fix use-after-free in unix_stream_read_actor() + - netfilter: nf_conntrack_bridge: initialize err to 0 + - netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval() + - netfilter: nf_tables: bogus ENOENT when destroying element which does not + exist + - net: stmmac: fix rx budget limit check + - net: stmmac: avoid rx queue overrun + - pds_core: use correct index to mask irq + - pds_core: fix up some format-truncation complaints + - gve: Fixes for napi_poll when budget is 0 + - io_uring/fdinfo: remove need for sqpoll lock for thread/pid retrieval + - net/mlx5: Decouple PHC .adjtime and .adjphase implementations + - net/mlx5e: fix double free of encap_header + - net/mlx5e: fix double free of encap_header in update funcs + - net/mlx5e: Fix pedit endianness + - net/mlx5: Consolidate devlink documentation in devlink/mlx5.rst + - net/mlx5e: Make tx_port_ts logic resilient to out-of-order CQEs + - net/mlx5e: Add recovery flow for tx devlink health reporter for unhealthy + PTP SQ + - net/mlx5e: Update doorbell for port timestamping CQ before the software + counter + - net/mlx5: Increase size of irq name buffer + - net/mlx5e: Reduce the size of icosq_str + - net/mlx5e: Check return value of snprintf writing to fw_version buffer + - net/mlx5e: Check return value of snprintf writing to fw_version buffer for + representors + - net: sched: do not offload flows with a helper in act_ct + - macvlan: Don't propagate promisc change to lower dev in passthru + - tools/power/turbostat: Fix a knl bug + - tools/power/turbostat: Enable the C-state Pre-wake printing + - scsi: ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1 + - cifs: spnego: add ';' in HOST_KEY_LEN + - cifs: fix check of rc in function generate_smb3signingkey + - perf/core: Fix cpuctx refcounting + - i915/perf: Fix NULL deref bugs with drm_dbg() calls + - perf: arm_cspmu: Reject events meant for other PMUs + - drivers: perf: Check find_first_bit() return value + - media: venus: hfi: add checks to perform sanity on queue pointers + - perf intel-pt: Fix async branch flags + - powerpc/perf: Fix disabling BHRB and instruction sampling + - randstruct: Fix gcc-plugin performance mode to stay in group + - bpf: Fix check_stack_write_fixed_off() to correctly spill imm + - bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END + - scsi: mpt3sas: Fix loop logic + - scsi: megaraid_sas: Increase register read retry rount from 3 to 30 for + selected registers + - scsi: ufs: qcom: Update PHY settings only when scaling to higher gears + - scsi: qla2xxx: Fix system crash due to bad pointer access + - scsi: ufs: core: Fix racing issue between ufshcd_mcq_abort() and ISR + - crypto: x86/sha - load modules based on CPU features + - x86/PCI: Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 + - x86/apic/msi: Fix misconfigured non-maskable MSI quirk + - x86/cpu/hygon: Fix the CPU topology evaluation for real + - KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space + - KVM: x86: Ignore MSR_AMD64_TW_CFG access + - KVM: x86: Clear bit12 of ICR after APIC-write VM-exit + - KVM: x86: Fix lapic timer interrupt lost after loading a snapshot. + - mmc: sdhci-pci-gli: GL9755: Mask the replay timer timeout of AER + - sched: psi: fix unprivileged polling against cgroups + - audit: don't take task_lock() in audit_exe_compare() code path + - audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() + - proc: sysctl: prevent aliased sysctls from getting passed to init + - tty/sysrq: replace smp_processor_id() with get_cpu() + - tty: serial: meson: fix hard LOCKUP on crtscts mode + - hvc/xen: fix console unplug + - hvc/xen: fix error path in xen_hvc_init() to always register frontend driver + - hvc/xen: fix event channel handling for secondary consoles + - PCI/sysfs: Protect driver's D3cold preference from user space + - mm/damon/sysfs: remove requested targets when online-commit inputs + - mm/damon/sysfs: update monitoring target regions for online input commit + - watchdog: move softlockup_panic back to early_param + - iommufd: Fix missing update of domains_itree after splitting iopt_area + - fbdev: stifb: Make the STI next font pointer a 32-bit signed offset + - dm crypt: account large pages in cc->n_allocated_pages + - mm/damon/lru_sort: avoid divide-by-zero in hot threshold calculation + - mm/damon/ops-common: avoid divide-by-zero during region hotness calculation + - mm/damon: implement a function for max nr_accesses safe calculation + - mm/damon/core: avoid divide-by-zero during monitoring results update + - mm/damon/sysfs-schemes: handle tried region directory allocation failure + - mm/damon/sysfs-schemes: handle tried regions sysfs directory allocation + failure + - mm/damon/sysfs: check error from damon_sysfs_update_target() + - parisc: Add nop instructions after TLB inserts + - ACPI: resource: Do IRQ override on TongFang GMxXGxx + - regmap: Ensure range selector registers are updated after cache sync + - wifi: ath11k: fix temperature event locking + - wifi: ath11k: fix dfs radar event locking + - wifi: ath11k: fix htt pktlog locking + - wifi: ath11k: fix gtk offload status event locking + - wifi: ath12k: fix htt mlo-offset event locking + - wifi: ath12k: fix dfs-radar and temperature event locking + - mmc: meson-gx: Remove setting of CMD_CFG_ERROR + - genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware + - sched/core: Fix RQCF_ACT_SKIP leak + - KEYS: trusted: tee: Refactor register SHM usage + - KEYS: trusted: Rollback init_trusted() consistently + - PCI: keystone: Don't discard .remove() callback + - PCI: keystone: Don't discard .probe() callback + - arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer + - arm64: module: Fix PLT counting when CONFIG_RANDOMIZE_BASE=n + - parisc/agp: Use 64-bit LE values in SBA IOMMU PDIR table + - parisc/pdc: Add width field to struct pdc_model + - parisc/power: Add power soft-off when running on qemu + - cpufreq: stats: Fix buffer overflow detection in trans_stats() + - powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() + - clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data + - clk: visconti: Fix undefined behavior bug in struct visconti_pll_provider + - clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks + - clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks + - ksmbd: fix recursive locking in vfs helpers + - ksmbd: handle malformed smb1 message + - ksmbd: fix slab out of bounds write in smb_inherit_dacl() + - mmc: vub300: fix an error code + - mmc: sdhci_am654: fix start loop index for TAP value parsing + - mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A + - PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() + - PCI: kirin: Don't discard .remove() callback + - PCI: exynos: Don't discard .remove() callback + - wifi: wilc1000: use vmm_table as array in wilc struct + - svcrdma: Drop connection after an RDMA Read error + - rcu/tree: Defer setting of jiffies during stall reset + - arm64: dts: qcom: ipq6018: Fix hwlock index for SMEM + - dt-bindings: timer: renesas,rz-mtu3: Fix overflow/underflow interrupt names + - PM: hibernate: Use __get_safe_page() rather than touching the list + - PM: hibernate: Clean up sync_read handling in snapshot_write_next() + - rcu: kmemleak: Ignore kmemleak false positives when RCU-freeing objects + - btrfs: don't arbitrarily slow down delalloc if we're committing + - thermal: intel: powerclamp: fix mismatch in get function for max_idle + - arm64: dts: qcom: ipq5332: Fix hwlock index for SMEM + - arm64: dts: qcom: ipq8074: Fix hwlock index for SMEM + - firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit + - ACPI: FPDT: properly handle invalid FPDT subtables + - arm64: dts: qcom: ipq9574: Fix hwlock index for SMEM + - arm64: dts: qcom: ipq6018: Fix tcsr_mutex register size + - leds: trigger: netdev: Move size check in set_device_name + - mfd: qcom-spmi-pmic: Fix reference leaks in revid helper + - mfd: qcom-spmi-pmic: Fix revid implementation + - ima: annotate iint mutex to avoid lockdep false positive warnings + - ima: detect changes to the backing overlay file + - netfilter: nf_tables: split async and sync catchall in two functions + - ASoC: soc-dai: add flag to mute and unmute stream during trigger + - ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag + - selftests/resctrl: Fix uninitialized .sa_flags + - selftests/resctrl: Remove duplicate feature check from CMT test + - selftests/resctrl: Move _GNU_SOURCE define into Makefile + - selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests + - hid: lenovo: Resend all settings on reset_resume for compact keyboards + - ASoC: codecs: wsa-macro: fix uninitialized stack variables with name prefix + - jbd2: fix potential data lost in recovering journal raced with synchronizing + fs bdev + - quota: explicitly forbid quota files from being encrypted + - kernel/reboot: emergency_restart: Set correct system_state + - i2c: core: Run atomic i2c xfer when !preemptible + - selftests/clone3: Fix broken test under !CONFIG_TIME_NS + - tracing: Have the user copy of synthetic event address use correct context + - driver core: Release all resources during unbind before updating device + links + - mcb: fix error handling for different scenarios when parsing + - dmaengine: stm32-mdma: correct desc prep when channel running + - s390/mm: add missing arch_set_page_dat() call to vmem_crst_alloc() + - s390/cmma: fix detection of DAT pages + - mm/cma: use nth_page() in place of direct struct page manipulation + - mm/memory_hotplug: use pfn math in place of direct struct page manipulation + - mm: make PR_MDWE_REFUSE_EXEC_GAIN an unsigned long + - mtd: cfi_cmdset_0001: Byte swap OTP info + - cxl/region: Do not try to cleanup after cxl_region_setup_targets() fails + - i3c: master: cdns: Fix reading status register + - i3c: master: svc: fix race condition in ibi work thread + - i3c: master: svc: fix wrong data return when IBI happen during start frame + - i3c: master: svc: fix ibi may not return mandatory data byte + - i3c: master: svc: fix check wrong status register in irq handler + - i3c: master: svc: fix SDA keep low when polling IBIWON timeout happen + - i3c: master: svc: fix random hot join failure since timeout error + - cxl/region: Fix x1 root-decoder granularity calculations + - cxl/port: Fix delete_endpoint() vs parent unregistration race + - pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable + - pmdomain: amlogic: Fix mask for the second NNA mem PD domain + - pmdomain: imx: Make imx pgc power domain also set the fwnode + - PCI: qcom-ep: Add dedicated callback for writing to DBI2 registers + - PCI: Lengthen reset delay for VideoPropulsion Torrent QN16e card + - torture: Add a kthread-creation callback to _torture_create_kthread() + - torture: Add lock_torture writer_fifo module parameter + - torture: Make torture_hrtimeout_*() use TASK_IDLE + - torture: Move stutter_wait() timeouts to hrtimers + - torture: Make torture_hrtimeout_ns() take an hrtimer mode parameter + - rcutorture: Fix stuttering races and other issues + - mm/hugetlb: prepare hugetlb_follow_page_mask() for FOLL_PIN + - mm/hugetlb: use nth_page() in place of direct struct page manipulation + - parisc: Prevent booting 64-bit kernels on PA1.x machines + - parisc/pgtable: Do not drop upper 5 address bits of physical address + - parisc/power: Fix power soft-off when running on qemu + - xhci: Enable RPM on controllers that support low-power states + - fs: add ctime accessors infrastructure + - smb3: fix creating FIFOs when mounting with "sfu" mount option + - smb3: fix touch -h of symlink + - smb3: allow dumping session and tcon id to improve stats analysis and + debugging + - smb3: fix caching of ctime on setxattr + - smb: client: fix use-after-free bug in cifs_debug_data_proc_show() + - smb: client: fix use-after-free in smb2_query_info_compound() + - smb: client: fix potential deadlock when releasing mids + - cifs: reconnect helper should set reconnect for the right channel + - cifs: force interface update before a fresh session setup + - cifs: do not reset chan_max if multichannel is not supported at mount + - cifs: Fix encryption of cleared, but unset rq_iter data buffers + - xfs: recovery should not clear di_flushiter unconditionally + - btrfs: zoned: wait for data BG to be finished on direct IO allocation + - ALSA: info: Fix potential deadlock at disconnection + - ALSA: hda/realtek: Enable Mute LED on HP 255 G8 + - ALSA: hda/realtek - Add Dell ALC295 to pin fall back table + - ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC + - ALSA: hda/realtek: Enable Mute LED on HP 255 G10 + - ALSA: hda/realtek: Add quirks for HP Laptops + - Revert ncsi: Propagate carrier gain/loss events to the NCSI controller + - Revert "i2c: pxa: move to generic GPIO recovery" + - lsm: fix default return value for vm_enough_memory + - lsm: fix default return value for inode_getsecctx + - sbsa_gwdt: Calculate timeout with 64-bit math + - i2c: designware: Disable TX_EMPTY irq while waiting for block length byte + - s390/ap: fix AP bus crash on early config change callback invocation + - net: ethtool: Fix documentation of ethtool_sprintf() + - net: dsa: lan9303: consequently nested-lock physical MDIO + - net: phylink: initialize carrier state at creation + - gfs2: don't withdraw if init_threads() got interrupted + - i2c: i801: fix potential race in i801_block_transaction_byte_by_byte + - f2fs: do not return EFSCORRUPTED, but try to run online repair + - f2fs: set the default compress_level on ioctl + - f2fs: avoid format-overflow warning + - f2fs: split initial and dynamic conditions for extent_cache + - media: lirc: drop trailing space from scancode transmit + - media: sharp: fix sharp encoding + - media: venus: hfi_parser: Add check to keep the number of codecs within + range + - media: venus: hfi: fix the check to handle session buffer requirement + - media: venus: hfi: add checks to handle capabilities from firmware + - media: ccs: Correctly initialise try compose rectangle + - drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection + - drm/mediatek/dp: fix memory leak on ->get_edid callback error path + - dm-bufio: fix no-sleep mode + - dm-verity: don't use blocking calls from tasklets + - nfsd: fix file memleak on client_opens_release + - NFSD: Update nfsd_cache_append() to use xdr_stream + - LoongArch: Mark __percpu functions as always inline + - riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause + - riscv: put interrupt entries into .irqentry.text + - riscv: mm: Update the comment of CONFIG_PAGE_OFFSET + - riscv: correct pt_level name via pgtable_l5/4_enabled + - riscv: kprobes: allow writing to x0 + - mmc: sdhci-pci-gli: A workaround to allow GL9750 to enter ASPM L1.2 + - mm: fix for negative counter: nr_file_hugepages + - mm: kmem: drop __GFP_NOFAIL when allocating objcg vectors + - mptcp: deal with large GSO size + - mptcp: add validity check for sending RM_ADDR + - mptcp: fix setsockopt(IP_TOS) subflow locking + - selftests: mptcp: fix fastclose with csum failure + - mmc: sdhci-pci-gli: GL9750: Mask the replay timer timeout of AER + - media: qcom: camss: Fix pm_domain_on sequence in probe + - media: qcom: camss: Fix vfe_get() error jump + - media: qcom: camss: Fix VFE-17x vfe_disable_output() + - media: qcom: camss: Fix VFE-480 vfe_disable_output() + - media: qcom: camss: Fix missing vfe_lite clocks check + - media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3 + - media: qcom: camss: Fix invalid clock enable bit disjunction + - media: qcom: camss: Fix csid-gen2 for test pattern generator + - ext4: fix race between writepages and remount + - ext4: make sure allocate pending entry not fail + - ext4: apply umask if ACL support is disabled + - ext4: correct offset of gdb backup in non meta_bg group to update_backups + - ext4: mark buffer new if it is unwritten to avoid stale data exposure + - ext4: correct return value of ext4_convert_meta_bg + - ext4: correct the start block of counting reserved clusters + - ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks + - ext4: add missed brelse in update_backups + - ext4: properly sync file size update after O_SYNC direct IO + - ext4: fix racy may inline data check in dio write + - drm/amd/pm: Handle non-terminated overdrive commands. + - drm: bridge: it66121: ->get_edid callback must not return err pointers + - drm/i915/mtl: Support HBR3 rate with C10 phy and eDP in MTL + - drm/i915: Bump GLK CDCLK frequency when driving multiple pipes + - drm/i915: Fix potential spectre vulnerability + - drm/i915: Flush WC GGTT only on required platforms + - drm/amdgpu/smu13: drop compute workload workaround + - drm/amdgpu: don't use pci_is_thunderbolt_attached() + - drm/amdgpu: fix GRBM read timeout when do mes_self_test + - drm/amdgpu: add a retry for IP discovery init + - drm/amdgpu: don't use ATRM for external devices + - drm/amdgpu: fix error handling in amdgpu_vm_init + - drm/amdgpu: fix error handling in amdgpu_bo_list_get() + - drm/amdgpu: lower CS errors to debug severity + - drm/amdgpu: Fix possible null pointer dereference + - drm/amd/display: Guard against invalid RPTR/WPTR being set + - drm/amd/display: Fix DSC not Enabled on Direct MST Sink + - drm/amd/display: fix a NULL pointer dereference in amdgpu_dm_i2c_xfer() + - drm/amd/display: Enable fast plane updates on DCN3.2 and above + - drm/amd/display: Change the DMCUB mailbox memory location from FB to inbox + - powerpc/powernv: Fix fortify source warnings in opal-prd.c + - tracing: Have trace_event_file have ref counters + - net/mlx5e: Avoid referencing skb after free-ing in drop path of + mlx5e_sq_xmit_wqe + - net/mlx5e: Track xmit submission to PTP WQ after populating metadata map + - Linux 6.5.13 + * Mantic update: v6.5.12 upstream stable release (LP: #2051129) + - hwmon: (nct6775) Fix incorrect variable reuse in fan_div calculation + - numa: Generalize numa_map_to_online_node() + - sched/topology: Fix sched_numa_find_nth_cpu() in CPU-less case + - sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case + - sched/fair: Fix cfs_rq_is_decayed() on !SMP + - iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user() + - sched/uclamp: Set max_spare_cap_cpu even if max_spare_cap is 0 + - sched/uclamp: Ignore (util == 0) optimization in feec() when p_util_max = 0 + - objtool: Propagate early errors + - sched: Fix stop_one_cpu_nowait() vs hotplug + - nfsd: Handle EOPENSTALE correctly in the filecache + - vfs: fix readahead(2) on block devices + - writeback, cgroup: switch inodes with dirty timestamps to release dying + cgwbs + - x86/srso: Fix SBPB enablement for (possible) future fixed HW + - x86/srso: Print mitigation for retbleed IBPB case + - x86/srso: Fix vulnerability reporting for missing microcode + - x86/srso: Fix unret validation dependencies + - futex: Don't include process MM in futex key on no-MMU + - x86/numa: Introduce numa_fill_memblks() + - ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window + - x86/sev-es: Allow copy_from_kernel_nofault() in earlier boot + - x86/boot: Fix incorrect startup_gdt_descr.size + - cpu/hotplug: Remove dependancy against cpu_primary_thread_mask + - cpu/SMT: Create topology_smt_thread_allowed() + - cpu/SMT: Make SMT control more robust against enumeration failures + - x86/apic: Fake primary thread mask for XEN/PV + - srcu: Fix callbacks acceleration mishandling + - drivers/clocksource/timer-ti-dm: Don't call clk_get_rate() in stop function + - x86/nmi: Fix out-of-order NMI nesting checks & false positive warning + - pstore/platform: Add check for kstrdup + - perf: Optimize perf_cgroup_switch() + - selftests/x86/lam: Zero out buffer for readlink() + - PCI/MSI: Provide stubs for IMS functions + - string: Adjust strtomem() logic to allow for smaller sources + - genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() + - irqchip/sifive-plic: Fix syscore registration for multi-socket systems + - wifi: ath12k: fix undefined behavior with __fls in dp + - wifi: cfg80211: add flush functions for wiphy work + - wifi: mac80211: move radar detect work to wiphy work + - wifi: mac80211: move scan work to wiphy work + - wifi: mac80211: move offchannel works to wiphy work + - wifi: mac80211: move sched-scan stop work to wiphy work + - wifi: mac80211: fix RCU usage warning in mesh fast-xmit + - wifi: cfg80211: fix off-by-one in element defrag + - wifi: mac80211: fix # of MSDU in A-MSDU calculation + - wifi: iwlwifi: honor the enable_ini value + - wifi: iwlwifi: don't use an uninitialized variable + - i40e: fix potential memory leaks in i40e_remove() + - iavf: Fix promiscuous mode configuration flow messages + - selftests/bpf: Correct map_fd to data_fd in tailcalls + - bpf, x86: save/restore regs with BPF_DW size + - bpf, x86: allow function arguments up to 12 for TRACING + - bpf, x64: Fix tailcall infinite loop + - wifi: cfg80211: fix kernel-doc for wiphy_delayed_work_flush() + - udp: introduce udp->udp_flags + - udp: move udp->no_check6_tx to udp->udp_flags + - udp: move udp->no_check6_rx to udp->udp_flags + - udp: move udp->gro_enabled to udp->udp_flags + - udp: add missing WRITE_ONCE() around up->encap_rcv + - udp: move udp->accept_udp_{l4|fraglist} to udp->udp_flags + - udp: lockless UDP_ENCAP_L2TPINUDP / UDP_GRO + - udp: annotate data-races around udp->encap_type + - udplite: remove UDPLITE_BIT + - udplite: fix various data-races + - selftests/bpf: Skip module_fentry_shadow test when bpf_testmod is not + available + - tcp: call tcp_try_undo_recovery when an RTOd TFO SYNACK is ACKed + - bpf: Fix kfunc callback register type handling + - gve: Use size_add() in call to struct_size() + - mlxsw: Use size_mul() in call to struct_size() + - tls: Use size_add() in call to struct_size() + - tipc: Use size_add() in calls to struct_size() + - net: spider_net: Use size_add() in call to struct_size() + - net: ethernet: mtk_wed: fix EXT_INT_STATUS_RX_FBUF definitions for MT7986 + SoC + - wifi: rtw88: debug: Fix the NULL vs IS_ERR() bug for debugfs_create_file() + - wifi: ath12k: fix DMA unmap warning on NULL DMA address + - wifi: ath11k: fix boot failure with one MSI vector + - wifi: mac80211: fix check for unusable RX result + - PM: sleep: Fix symbol export for _SIMPLE_ variants of _PM_OPS() + - cpufreq: tegra194: fix warning due to missing opp_put + - wifi: mt76: mt7603: rework/fix rx pse hang check + - wifi: mt76: mt7603: improve watchdog reset reliablity + - wifi: mt76: mt7603: improve stuck beacon handling + - wifi: mt76: connac: move connac3 definitions in mt76_connac3_mac.h + - wifi: mt76: remove unused error path in mt76_connac_tx_complete_skb + - wifi: mt76: mt7996: set correct wcid in txp + - wifi: mt76: mt7996: fix beamform mcu cmd configuration + - wifi: mt76: mt7996: fix beamformee ss subfield in EHT PHY cap + - wifi: mt76: mt7996: fix wmm queue mapping + - wifi: mt76: mt7996: fix rx rate report for CBW320-2 + - wifi: mt76: mt7996: fix TWT command format + - wifi: mt76: update beacon size limitation + - wifi: mt76: fix potential memory leak of beacon commands + - wifi: mt76: get rid of false alamrs of tx emission issues + - wifi: mt76: fix per-band IEEE80211_CONF_MONITOR flag comparison + - wifi: mt76: mt7915: fix beamforming availability check + - wifi: ath: dfs_pattern_detector: Fix a memory initialization issue + - tcp_metrics: add missing barriers on delete + - tcp_metrics: properly set tp->snd_ssthresh in tcp_init_metrics() + - tcp_metrics: do not create an entry from tcp_init_metrics() + - wifi: rtlwifi: fix EDCA limit set by BT coexistence + - ACPI: property: Allow _DSD buffer data only for byte accessors + - ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100 + - can: etas_es58x: rework the version check logic to silence -Wformat- + truncation + - can: etas_es58x: add missing a blank line after declaration + - wifi: ath11k: fix Tx power value during active CAC + - can: dev: can_restart(): don't crash kernel if carrier is OK + - can: dev: can_restart(): fix race condition between controller restart and + netif_carrier_on() + - can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is + accessed out of bounds + - PM / devfreq: rockchip-dfi: Make pmu regmap mandatory + - wifi: wfx: fix case where rates are out of order + - netfilter: nf_tables: Drop pointless memset when dumping rules + - wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() + - thermal: core: prevent potential string overflow + - r8169: fix rare issue with broken rx after link-down on RTL8125 + - thermal/drivers/mediatek: Fix probe for THERMAL_V2 + - bpf: Fix missed rcu read lock in bpf_task_under_cgroup() + - selftests: netfilter: test for sctp collision processing in nf_conntrack + - net: skb_find_text: Ignore patterns extending past 'to' + - thermal: core: Don't update trip points inside the hysteresis range + - chtls: fix tp->rcv_tstamp initialization + - tcp: fix cookie_init_timestamp() overflows + - wifi: iwlwifi: mvm: update station's MFP flag after association + - wifi: iwlwifi: mvm: fix removing pasn station for responder + - wifi: iwlwifi: mvm: use correct sta ID for IGTK/BIGTK + - wifi: mac80211: don't recreate driver link debugfs in reconfig + - wifi: mac80211: Fix setting vif links + - wifi: iwlwifi: yoyo: swap cdb and jacket bits values + - wifi: iwlwifi: mvm: Correctly set link configuration + - wifi: iwlwifi: mvm: Fix key flags for IGTK on AP interface + - wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface + - wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API + - wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta() + - wifi: iwlwifi: mvm: remove TDLS stations from FW + - wifi: iwlwifi: increase number of RX buffers for EHT devices + - wifi: iwlwifi: mvm: fix netif csum flags + - wifi: iwlwifi: pcie: synchronize IRQs before NAPI + - wifi: iwlwifi: mvm: update IGTK in mvmvif upon D3 resume + - wifi: iwlwifi: empty overflow queue during flush + - Bluetooth: ISO: Use defer setup to separate PA sync and BIG sync + - Bluetooth: ISO: Pass BIG encryption info through QoS + - Bluetooth: Make handle of hci_conn be unique + - Bluetooth: hci_sync: Fix Opcode prints in bt_dev_dbg/err + - bpf: Fix unnecessary -EBUSY from htab_lock_bucket + - ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() + - mptcp: properly account fastopen data + - ipv6: avoid atomic fragment on GSO packets + - virtio_net: use u64_stats_t infra to avoid data-races + - net: add DEV_STATS_READ() helper + - ipvlan: properly track tx_errors + - regmap: debugfs: Fix a erroneous check after snprintf() + - spi: tegra: Fix missing IRQ check in tegra_slink_probe() + - clk: qcom: ipq5332: Drop set rate parent from gpll0 dependent clocks + - clk: qcom: gcc-msm8996: Remove RPM bus clocks + - clk: qcom: clk-rcg2: Fix clock rate overflow for high parent frequencies + - clk: qcom: mmcc-msm8998: Don't check halt bit on some branch clks + - clk: qcom: mmcc-msm8998: Fix the SMMU GDSC + - clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src + - regulator: mt6358: Fail probe on unknown chip ID + - clk: imx: Select MXC_CLK for CLK_IMX8QXP + - clk: imx: imx8mq: correct error handling path + - clk: imx: imx8qxp: Fix elcdif_pll clock + - clk: renesas: rcar-gen3: Extend SDnH divider table + - clk: renesas: rzg2l: Wait for status bit of SD mux before continuing + - clk: renesas: rzg2l: Lock around writes to mux register + - clk: renesas: rzg2l: Trust value returned by hardware + - clk: renesas: rzg2l: Use FIELD_GET() for PLL register fields + - clk: renesas: rzg2l: Fix computation formula + - clk: linux/clk-provider.h: fix kernel-doc warnings and typos + - spi: nxp-fspi: use the correct ioremap function + - clk: ralink: mtmips: quiet unused variable warning + - clk: keystone: pll: fix a couple NULL vs IS_ERR() checks + - clk: ti: fix double free in of_ti_divider_clk_setup() + - clk: npcm7xx: Fix incorrect kfree + - clk: mediatek: clk-mt6765: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt6779: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt6797: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt7629-eth: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt7629: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data + - clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM + - clk: qcom: clk-alpha-pll: introduce stromer plus ops + - clk: qcom: apss-ipq-pll: Use stromer plus ops for stromer plus pll + - clk: qcom: apss-ipq-pll: Fix 'l' value for ipq5332_pll_config + - clk: qcom: ipq9574: drop the CLK_SET_RATE_PARENT flag from GPLL clocks + - clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks + - clk: mediatek: fix double free in mtk_clk_register_pllfh() + - platform/x86: wmi: Fix probe failure when failing to register WMI devices + - platform/x86: wmi: Fix opening of char device + - regulator: qcom-rpmh: Fix smps4 regulator for pm8550ve + - hwmon: (axi-fan-control) Fix possible NULL pointer dereference + - hwmon: (coretemp) Fix potentially truncated sysfs attribute name + - Revert "hwmon: (sch56xx-common) Add DMI override table" + - Revert "hwmon: (sch56xx-common) Add automatic module loading on supported + devices" + - hwmon: (sch5627) Use bit macros when accessing the control register + - hwmon: (sch5627) Disallow write access if virtual registers are locked + - hte: tegra: Fix missing error code in tegra_hte_test_probe() + - platform/chrome: cros_ec_lpc: Separate host command and irq disable + - spi: omap2-mcspi: remove redundant dev_err_probe() + - spi: omap2-mcspi: switch to use modern name + - spi: omap2-mcspi: Fix hardcoded reference clock + - drm: bridge: samsung-dsim: Initialize ULPS EXIT for i.MX8M DSIM + - drm: bridge: for GENERIC_PHY_MIPI_DPHY also select GENERIC_PHY + - drm: bridge: samsung-dsim: Fix waiting for empty cmd transfer FIFO on older + Exynos + - drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs + - drm/rockchip: vop: Fix call to crtc reset helper + - drm/rockchip: vop2: Don't crash for invalid duplicate_state + - drm/rockchip: vop2: Add missing call to crtc reset helper + - drm/radeon: possible buffer overflow + - drm: bridge: it66121: Fix invalid connector dereference + - drm/bridge: lt8912b: Fix bridge_detach + - drm/bridge: lt8912b: Fix crash on bridge detach + - drm/bridge: lt8912b: Manually disable HPD only if it was enabled + - drm/bridge: lt8912b: Add missing drm_bridge_attach call + - drm/mediatek: Fix coverity issue with unintentional integer overflow + - x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro + - drm/bridge: tc358768: Fix use of uninitialized variable + - drm/bridge: tc358768: Fix bit updates + - drm/bridge: tc358768: Use struct videomode + - drm/bridge: tc358768: Print logical values, not raw register values + - drm/bridge: tc358768: Use dev for dbg prints, not priv->dev + - drm/bridge: tc358768: Rename dsibclk to hsbyteclk + - drm/bridge: tc358768: Clean up clock period code + - drm/bridge: tc358768: Fix tc358768_ns_to_cnt() + - drm/aspeed: Convert to platform remove callback returning void + - drm/stm: Convert to platform remove callback returning void + - drm/tve200: Convert to platform remove callback returning void + - drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc + drivers + - drm/amdgpu: Increase IH soft ring size for GFX v9.4.3 dGPU + - drm/amdkfd: fix some race conditions in vram buffer alloc/free of svm code + - drm/amdkfd: retry after EBUSY is returned from hmm_ranges_get_pages + - drm/amdkfd: Remove svm range validated_once flag + - drm/amdkfd: Handle errors from svm validate and map + - drm/amd/display: Fix null pointer dereference in error message + - drm/amd/display: Check all enabled planes in dm_check_crtc_cursor + - drm/amd/display: Refactor dm_get_plane_scale helper + - drm/amd/display: Bail from dm_check_crtc_cursor if no relevant change + - io_uring/kbuf: Fix check of BID wrapping in provided buffers + - io_uring/kbuf: Allow the full buffer id space for provided buffers + - drm/mediatek: Add mmsys_dev_num to mt8188 vdosys0 driver data + - drm/mediatek: Fix iommu fault by swapping FBs after updating plane state + - drm/mediatek: Fix iommu fault during crtc enabling + - accel/habanalabs/gaudi2: Fix incorrect string length computation in + gaudi2_psoc_razwi_get_engines() + - drm/rockchip: cdn-dp: Fix some error handling paths in cdn_dp_probe() + - gpu: host1x: Correct allocated size for contexts + - drm/bridge: lt9611uxc: fix the race in the error path + - arm64/arm: xen: enlighten: Fix KPTI checks + - drm/rockchip: Fix type promotion bug in rockchip_gem_iommu_map() + - xenbus: fix error exit in xenbus_init() + - xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled + - drm/msm/dsi: use msm_gem_kernel_put to free TX buffer + - drm/msm/dsi: free TX buffer in unbind + - clocksource/drivers/arm_arch_timer: limit XGene-1 workaround + - drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling + - drivers/perf: hisi: use cpuhp_state_remove_instance_nocalls() for + hisi_hns3_pmu uninit process + - drm/amd/pm: Fix a memory leak on an error path + - perf/arm-cmn: Fix DTC domain detection + - drivers/perf: hisi_pcie: Check the type first in pmu::event_init() + - perf: hisi: Fix use-after-free when register pmu fails + - ARM: dts: renesas: blanche: Fix typo in GP_11_2 pin name + - arm64: dts: qcom: sdm845: Fix PSCI power domain names + - arm64: dts: qcom: sdm845: cheza doesn't support LMh node + - arm64: dts: qcom: sc7280: link usb3_phy_wrapper_gcc_usb30_pipe_clk + - arm64: dts: qcom: msm8916: Fix iommu local address range + - arm64: dts: qcom: msm8992-libra: drop duplicated reserved memory + - arm64: dts: qcom: sm6125: Pad APPS IOMMU address to 8 characters + - arm64: dts: qcom: sc7280: Add missing LMH interrupts + - arm64: dts: qcom: qrb2210-rb1: Swap UART index + - arm64: dts: qcom: sc7280: drop incorrect EUD port on SoC side + - arm64: dts: qcom: sm8150: add ref clock to PCIe PHYs + - arm64: dts: qcom: sm8350: fix pinctrl for UART18 + - arm64: dts: qcom: sdm845-mtp: fix WiFi configuration + - ARM64: dts: marvell: cn9310: Use appropriate label for spi1 pins + - arm64: dts: qcom: msm8976: Fix ipc bit shifts + - arm64: dts: qcom: msm8939: Fix iommu local address range + - riscv: dts: allwinner: remove address-cells from intc node + - arm64: dts: qcom: apq8016-sbc: Add missing ADV7533 regulators + - ARM: dts: qcom: apq8026-samsung-matisse-wifi: Fix inverted hall sensor + - ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator + - soc: qcom: llcc: Handle a second device without data corruption + - kunit: Fix missed memory release in kunit_free_suite_set() + - firmware: ti_sci: Mark driver as non removable + - arm64: dts: ti: k3-am625-beagleplay: Fix typo in ramoops reg + - arm64: dts: ti: k3-am62a7-sk: Drop i2c-1 to 100Khz + - firmware: arm_ffa: Assign the missing IDR allocation ID to the FFA device + - firmware: arm_ffa: Allow the FF-A drivers to use 32bit mode of messaging + - ARM: dts: am3517-evm: Fix LED3/4 pinmux + - clk: scmi: Free scmi_clk allocated when the clocks with invalid info are + skipped + - arm64: dts: imx8qm-ss-img: Fix jpegenc compatible entry + - arm64: dts: imx8mp-debix-model-a: Remove USB hub reset-gpios + - arm64: dts: imx8mm: Add sound-dai-cells to micfil node + - arm64: dts: imx8mn: Add sound-dai-cells to micfil node + - arm64: tegra: Fix P3767 card detect polarity + - arm64: tegra: Fix P3767 QSPI speed + - firmware: tegra: Add suspend hook and reset BPMP IPC early on resume + - memory: tegra: Set BPMP msg flags to reset IPC channels + - arm64: tegra: Use correct interrupts for Tegra234 TKE + - selftests/pidfd: Fix ksft print formats + - selftests/resctrl: Ensure the benchmark commands fits to its array + - soc: qcom: pmic_glink: fix connector type to be DisplayPort + - ARM: dts: BCM5301X: Explicitly disable unused switch CPU ports + - iommufd: Add iopt_area_alloc() + - module/decompress: use vmalloc() for gzip decompression workspace + - ASoC: cs35l41: Handle mdsync_down reg write errors + - ASoC: cs35l41: Initialize completion object before requesting IRQ + - ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler + - ASoC: cs35l41: Undo runtime PM changes at driver exit time + - ALSA: hda: cs35l41: Fix unbalanced pm_runtime_get() + - ALSA: hda: cs35l41: Undo runtime PM changes at driver exit time + - KEYS: Include linux/errno.h in linux/verification.h + - crypto: hisilicon/hpre - Fix a erroneous check after snprintf() + - hwrng: bcm2835 - Fix hwrng throughput regression + - hwrng: geode - fix accessing registers + - RDMA/core: Use size_{add,sub,mul}() in calls to struct_size() + - crypto: qat - fix state machines cleanup paths + - crypto: qat - ignore subsequent state up commands + - crypto: qat - fix unregistration of crypto algorithms + - crypto: qat - fix unregistration of compression algorithms + - scsi: ibmvfc: Fix erroneous use of rtas_busy_delay with hcall return code + - ASoC: soc-pcm.c: Make sure DAI parameters cleared if the DAI becomes + inactive + - libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return + value + - nd_btt: Make BTT lanes preemptible + - crypto: caam/qi2 - fix Chacha20 + Poly1305 self test failure + - crypto: caam/jr - fix Chacha20 + Poly1305 self test failure + - crypto: qat - increase size of buffers + - ASoC: SOF: ipc4-topology: Use size_add() in call to struct_size() + - PCI: vmd: Correct PCI Header Type Register's multi-function check + - hid: cp2112: Fix duplicate workqueue initialization + - crypto: hisilicon/qm - fix PF queue parameter issue + - ARM: 9321/1: memset: cast the constant byte to unsigned char + - ARM: 9323/1: mm: Fix ARCH_LOW_ADDRESS_LIMIT when CONFIG_ZONE_DMA + - ext4: move 'ix' sanity check to corrent position + - kselftest: vm: fix mdwe's mmap_FIXED test case + - ASoC: fsl: mpc5200_dma.c: Fix warning of Function parameter or member not + described + - backlight: pwm_bl: Disable PWM on shutdown, suspend and remove + - ASoC: fsl-asoc-card: Add comment for mclk in the codec_priv + - dlm: fix no ack after final message + - IB/mlx5: Fix rdma counter binding for RAW QP + - RDMA/hns: Fix printing level of asynchronous events + - RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common() + - RDMA/hns: Fix signed-unsigned mixed comparisons + - RDMA/hns: Add check for SL + - RDMA/hns: The UD mode can only be configured with DCQCN + - ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran. + - ASoC: fsl: Fix PM disable depth imbalance in fsl_easrc_probe + - scsi: ufs: core: Leave space for '\0' in utf8 desc string + - RDMA/hfi1: Workaround truncation compilation error + - HID: cp2112: Make irq_chip immutable + - hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip + - HID: uclogic: Fix user-memory-access bug in + uclogic_params_ugee_v2_init_event_hooks() + - HID: uclogic: Fix a work->entry not empty bug in __queue_work() + - sh: bios: Revive earlyprintk support + - HID: logitech-hidpp: Don't restart IO, instead defer hid_connect() only + - HID: logitech-hidpp: Revert "Don't restart communication if not necessary" + - HID: logitech-hidpp: Move get_wireless_feature_index() check to + hidpp_connect_event() + - ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails + - PCI: endpoint: Fix double free in __pci_epc_create() + - padata: Fix refcnt handling in padata_free_shell() + - certs: Break circular dependency when selftest is modular + - crypto: qat - fix deadlock in backlog processing + - ASoC: ams-delta.c: use component after check + - erofs: fix erofs_insert_workgroup() lockref usage + - IB/mlx5: Fix init stage error handling to avoid double free of same QP and + UAF + - mfd: core: Un-constify mfd_cell.of_reg + - mfd: core: Ensure disabled devices are skipped without aborting + - mfd: dln2: Fix double put in dln2_probe + - dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC + - mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs + - leds: turris-omnia: Drop unnecessary mutex locking + - leds: turris-omnia: Do not use SMBUS calls + - leds: pwm: Don't disable the PWM when the LED should be off + - leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' + - scripts/gdb: fix usage of MOD_TEXT not defined when CONFIG_MODULES=n + - perf stat: Fix aggr mode initialization + - iio: frequency: adf4350: Use device managed functions and fix power down + issue. + - perf kwork: Fix incorrect and missing free atom in work_push_atom() + - perf kwork: Add the supported subcommands to the document + - perf kwork: Set ordered_events to true in 'struct perf_tool' + - f2fs: compress: fix deadloop in f2fs_write_cache_pages() + - f2fs: compress: fix to avoid use-after-free on dic + - f2fs: compress: fix to avoid redundant compress extension + - f2fs: fix to drop meta_inode's page cache in f2fs_put_super() + - tty: tty_jobctrl: fix pid memleak in disassociate_ctty() + - perf parse-events: Remove unused PE_PMU_EVENT_FAKE token + - perf parse-events: Remove unused PE_KERNEL_PMU_EVENT token + - perf parse-events: Remove ABORT_ON + - perf tools: Revert enable indices setting syntax for BPF map + - perf parse-events: Fix tracepoint name memory leak + - livepatch: Fix missing newline character in klp_resolve_symbols() + - pinctrl: renesas: rzg2l: Make reverse order of enable() for disable() + - perf record: Fix BTF type checks in the off-cpu profiling + - dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers + - usb: dwc2: fix possible NULL pointer dereference caused by driver + concurrency + - usb: chipidea: Fix DMA overwrite for Tegra + - usb: chipidea: Simplify Tegra DMA alignment code + - dmaengine: ti: edma: handle irq_of_parse_and_map() errors + - tools/perf: Update call stack check in builtin-lock.c + - misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() + - tools: iio: iio_generic_buffer ensure alignment + - USB: usbip: fix stub_dev hub disconnect + - dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() + - f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() + - interconnect: qcom: qdu1000: Set ACV enable_mask + - interconnect: qcom: sc7180: Retire DEFINE_QBCM + - interconnect: qcom: sc7180: Set ACV enable_mask + - interconnect: qcom: sc7280: Set ACV enable_mask + - interconnect: qcom: sc8180x: Set ACV enable_mask + - interconnect: qcom: sc8280xp: Set ACV enable_mask + - interconnect: qcom: sdm670: Retire DEFINE_QBCM + - interconnect: qcom: sdm670: Set ACV enable_mask + - interconnect: qcom: sdm845: Retire DEFINE_QBCM + - interconnect: qcom: sdm845: Set ACV enable_mask + - interconnect: qcom: sm6350: Retire DEFINE_QBCM + - interconnect: qcom: sm6350: Set ACV enable_mask + - interconnect: qcom: sm8150: Retire DEFINE_QBCM + - interconnect: qcom: sm8150: Set ACV enable_mask + - interconnect: qcom: sm8350: Retire DEFINE_QBCM + - interconnect: qcom: sm8350: Set ACV enable_mask + - powerpc: Only define __parse_fpscr() when required + - interconnect: fix error handling in qnoc_probe() + - perf build: Add missing comment about NO_LIBTRACEEVENT=1 + - perf parse-events: Fix for term values that are raw events + - perf pmu: Remove logic for PMU name being NULL + - perf mem-events: Avoid uninitialized read + - s390/ap: re-init AP queues on config on + - modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host + - modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host + - perf tools: Do not ignore the default vmlinux.h + - powerpc/40x: Remove stale PTE_ATOMIC_UPDATES macro + - powerpc/xive: Fix endian conversion size + - powerpc: Hide empty pt_regs at base of the stack + - perf trace: Use the right bpf_probe_read(_str) variant for reading user data + - powerpc/vas: Limit open window failure messages in log bufffer + - powerpc/imc-pmu: Use the correct spinlock initializer. + - powerpc/pseries: fix potential memory leak in init_cpu_associativity() + - perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 + platform + - xhci: Loosen RPM as default policy to cover for AMD xHC 1.1 + - usb: host: xhci-plat: fix possible kernel oops while resuming + - perf machine: Avoid out of bounds LBR memory read + - libperf rc_check: Make implicit enabling work for GCC + - perf hist: Add missing puts to hist__account_cycles + - perf vendor events intel: Fix broadwellde tma_info_system_dram_bw_use metric + - perf vendor events intel: Add broadwellde two metrics + - 9p/net: fix possible memory leak in p9_check_errors() + - rtla: Fix uninitialized variable found + - i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs + - rtc: brcmstb-waketimer: support level alarm_irq + - cxl/pci: Remove unnecessary device reference management in sanitize work + - cxl/pci: Cleanup 'sanitize' to always poll + - cxl/pci: Remove inconsistent usage of dev_err_probe() + - cxl/pci: Clarify devm host for memdev relative setup + - cxl/pci: Fix sanitize notifier setup + - cxl/memdev: Fix sanitize vs decoder setup locking + - cxl/mem: Fix shutdown order + - virt: sevguest: Fix passing a stack buffer as a scatterlist target + - rtc: pcf85363: Allow to wake up system without IRQ + - rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call + - cxl/region: Prepare the decoder match range helper for reuse + - cxl/region: Calculate a target position in a region interleave + - cxl/region: Use cxl_calc_interleave_pos() for auto-discovery + - cxl/region: Fix cxl_region_rwsem lock held when returning to user space + - cxl/core/regs: Rename @dev to @host in struct cxl_register_map + - cxl/port: Fix @host confusion in cxl_dport_setup_regs() + - cxl/hdm: Remove broken error path + - pcmcia: cs: fix possible hung task and memory leak pccardd() + - pcmcia: ds: fix refcount leak in pcmcia_device_add() + - pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() + - media: imx-jpeg: initiate a drain of the capture queue in dynamic resolution + change + - media: hantro: Check whether reset op is defined before use + - media: verisilicon: Do not enable G2 postproc downscale if source is + narrower than destination + - media: ov5640: fix vblank unchange issue when work at dvp mode + - media: i2c: max9286: Fix some redundant of_node_put() calls + - media: ov5640: Fix a memory leak when ov5640_probe fails + - media: bttv: fix use after free error due to btv->timeout timer + - media: amphion: handle firmware debug message + - media: mtk-jpegenc: Fix bug in JPEG encode quality selection + - media: s3c-camif: Avoid inappropriate kfree() + - media: vidtv: psi: Add check for kstrdup + - media: vidtv: mux: Add check and kfree for kstrdup + - media: cedrus: Fix clock/reset sequence + - media: cadence: csi2rx: Unregister v4l2 async notifier + - media: dvb-usb-v2: af9035: fix missing unlock + - media: verisilicon: Fixes clock list for rk3588 av1 decoder + - media: imx-jpeg: notify source chagne event when the first picture parsed + - media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() + - media: cec: meson: always include meson sub-directory in Makefile + - cpupower: fix reference to nonexistent document + - regmap: prevent noinc writes from clobbering cache + - drm/amdgpu/gfx10,11: use memcpy_to/fromio for MQDs + - drm/amdgpu: don't put MQDs in VRAM on ARM | ARM64 + - pwm: sti: Reduce number of allocations and drop usage of chip_data + - pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume + - Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() + - watchdog: ixp4xx: Make sure restart always works + - llc: verify mac len before reading mac header + - hsr: Prevent use after free in prp_create_tagged_frame() + - tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING + - rxrpc: Fix two connection reaping bugs + - bpf: Check map->usercnt after timer->timer is assigned + - inet: shrink struct flowi_common + - octeontx2-pf: Fix error codes + - octeontx2-pf: Fix holes in error code + - net: page_pool: add missing free_percpu when page_pool_init fail + - dccp: Call security_inet_conn_request() after setting IPv4 addresses. + - dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. + - Fix termination state for idr_for_each_entry_ul() + - net: stmmac: xgmac: Enable support for multiple Flexible PPS outputs + - selftests: pmtu.sh: fix result checking + - octeontx2-pf: Free pending and dropped SQEs + - net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT + - net/smc: allow cdc msg send rather than drop it with NULL sndbuf_desc + - net/smc: put sk reference if close work was canceled + - nvme: fix error-handling for io_uring nvme-passthrough + - riscv: boot: Fix creation of loader.bin + - tg3: power down device only on SYSTEM_POWER_OFF + - nbd: fix uaf in nbd_open + - blk-core: use pr_warn_ratelimited() in bio_check_ro() + - vsock/virtio: remove socket from connected/bound list on shutdown + - r8169: respect userspace disabling IFF_MULTICAST + - net: enetc: shorten enetc_setup_xdp_prog() error message to fit + NETLINK_MAX_FMTMSG_LEN + - i2c: iproc: handle invalid slave state + - netfilter: xt_recent: fix (increase) ipv6 literal buffer length + - netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses + - net/sched: act_ct: Always fill offloading tuple iifidx + - RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs + - module/decompress: use kvmalloc() consistently + - drm/vc4: tests: Fix UAF in the mock helpers + - drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE + - ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: trivial: fix error messages + - ASoC: hdmi-codec: register hpd callback on component probe + - ASoC: dapm: fix clock get name + - spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies + - arm64/arm: arm_pmuv3: perf: Don't truncate 64-bit registers + - fbdev: imsttfb: fix double free in probe() + - fbdev: imsttfb: fix a resource leak in probe + - fbdev: fsl-diu-fb: mark wr_reg_wa() static + - tracing/kprobes: Fix the order of argument descriptions + - Revert "drm/ast: report connection status on Display Port." + - selftests: mptcp: fix wait_rm_addr/sf parameters + - io_uring/net: ensure socket is marked connected on connect retry + - x86/amd_nb: Use Family 19h Models 60h-7Fh Function 4 IDs + - Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1" + - btrfs: use u64 for buffer sizes in the tree search ioctls + - bpf, x86: initialize the variable "first_off" in save_args() + - perf parse-events: Fix driver config term + - btrfs: make found_logical_ret parameter mandatory for function + queue_scrub_stripe() + - Linux 6.5.12 + * Mantic update: v6.5.11 upstream stable release (LP: #2051117) + - ASoC: Intel: sof_sdw: add support for SKU 0B14 + - ASoC: simple-card: fixup asoc_simple_probe() error handling + - coresight: tmc-etr: Disable warnings for allocation failures + - ASoC: fsl-asoc-card: use integer type for fll_id and pll_id + - ASoC: core: Do not call link_exit() on uninitialized rtd objects + - ASoC: tlv320adc3xxx: BUG: Correct micbias setting + - net: sched: cls_u32: Fix allocation size in u32_init() + - arm64: dts: imx93: add the Flex-CAN stop mode by GPR + - can: flexcan: remove the auto stop mode for IMX93 + - irqchip/riscv-intc: Mark all INTC nodes as initialized + - irqchip/stm32-exti: add missing DT IRQ flag translation + - dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe + - ata: pata_parport: add custom version of wait_after_reset + - ata: pata_parport: fit3: implement IDE command set registers + - powerpc/85xx: Fix math emulation exception + - media: i2c: ov8858: Don't set fwnode in the driver + - Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport + - fbdev: atyfb: only use ioremap_uc() on i386 and ia64 + - fs/ntfs3: Add ckeck in ni_update_parent() + - fs/ntfs3: Write immediately updated ntfs state + - fs/ntfs3: Use kvmalloc instead of kmalloc(... __GFP_NOWARN) + - fs/ntfs3: Add more attributes checks in mi_enum_attr() + - fs/ntfs3: Fix alternative boot searching + - fs/ntfs3: Add more info into /proc/fs/ntfs3//volinfo + - fs/ntfs3: Do not allow to change label if volume is read-only + - fs/ntfs3: Fix possible NULL-ptr-deref in ni_readpage_cmpr() + - fs/ntfs3: Fix NULL pointer dereference on error in attr_allocate_frame() + - fs/ntfs3: Fix directory element type detection + - fs/ntfs3: Avoid possible memory leak + - spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0 + - ASoC: soc-dapm: Add helper for comparing widget name + - netfilter: nfnetlink_log: silence bogus compiler warning + - net/mlx5: Bridge, fix peer entry ageing in LAG mode + - x86/efistub: Don't try to print after ExitBootService() + - efi: fix memory leak in krealloc failure handling + - ASoC: rt5650: fix the wrong result of key button + - ASoC: codecs: tas2780: Fix log of failed reset via I2C. + - s390/kasan: handle DCSS mapping in memory holes + - fbdev: omapfb: fix some error codes + - fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() + - scsi: mpt3sas: Fix in error path + - ASoC: da7219: Correct the process of setting up Gnd switch in AAD + - drm/amdgpu: Unset context priority is now invalid + - gpu/drm: Eliminate DRM_SCHED_PRIORITY_UNSET + - LoongArch: Use SYM_CODE_* to annotate exception handlers + - LoongArch: Export symbol invalid_pud_table for modules building + - LoongArch: Replace kmap_atomic() with kmap_local_page() in + copy_user_highpage() + - LoongArch: Disable WUC for pgprot_writecombine() like ioremap_wc() + - netfilter: nf_tables: audit log object reset once per table + - platform/mellanox: mlxbf-tmfifo: Fix a warning message + - drm/amdgpu: Reserve fences for VM update + - riscv: dts: thead: set dma-noncoherent to soc bus + - net: chelsio: cxgb4: add an error code check in t4_load_phy_fw + - r8152: Check for unplug in rtl_phy_patch_request() + - r8152: Check for unplug in r8153b_ups_en() / r8153c_ups_en() + - powerpc/mm: Fix boot crash with FLATMEM + - ceph_wait_on_conflict_unlink(): grab reference before dropping ->d_lock + - drm/amd/display: Don't use fsleep for PSR exit waits + - rust: make `UnsafeCell` the outer type in `Opaque` + - rust: types: make `Opaque` be `!Unpin` + - perf evlist: Avoid frequency mode for the dummy event + - mmap: fix vma_iterator in error path of vma_merge() + - mmap: fix error paths with dup_anon_vma() + - ALSA: usb-audio: add quirk flag to enable native DSD for McIntosh devices + - PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device + - usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" + compatibility + - usb: typec: tcpm: Add additional checks for contaminant + - usb: typec: tcpm: Fix NULL pointer dereference in tcpm_pd_svdm() + - usb: raw-gadget: properly handle interrupted requests + - Bluetooth: hci_bcm4377: Mark bcm4378/bcm4387 as BROKEN_LE_CODED + - tty: n_gsm: fix race condition in status line change on dead connections + - tty: 8250: Remove UC-257 and UC-431 + - tty: 8250: Add support for additional Brainboxes UC cards + - tty: 8250: Add support for Brainboxes UP cards + - tty: 8250: Add support for Intashield IS-100 + - tty: 8250: Fix port count of PX-257 + - tty: 8250: Fix up PX-803/PX-857 + - tty: 8250: Add support for additional Brainboxes PX cards + - tty: 8250: Add support for Intashield IX cards + - tty: 8250: Add Brainboxes Oxford Semiconductor-based quirks + - dt-bindings: serial: rs485: Add rs485-rts-active-high + - misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support + - serial: core: Fix runtime PM handling for pending tx + - ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection + - ASoC: SOF: sof-pci-dev: Fix community key quirk detection + - Linux 6.5.11 + * Mantic update: v6.5.11 upstream stable release (LP: #2051117) // black + screen when wake up from s3 with AMD W7600 gfx (LP: #2051341) + - drm/ttm: Reorder sys manager cleanup step + * CVE-2024-0646 + - net: tls, update curr on splice as well + * CVE-2024-0582 + - io_uring: enable io_mem_alloc/free to be used in other parts + - io_uring/kbuf: defer release of mapped buffer rings + * CVE-2024-0565 + - smb: client: fix OOB in receive_encrypted_standard() + * CVE-2023-51781 + - appletalk: Fix Use-After-Free in atalk_ioctl + * Reject connection when malformed L2CAP signal packet is received + (LP: #2047634) + - Bluetooth: L2CAP: Send reject on command corrupted request + * Mantic update: v6.5.10 upstream stable release (LP: #2049412) + - vdpa/mlx5: Fix firmware error on creation of 1k VQs + - smb3: allow controlling length of time directory entries are cached with dir + leases + - smb3: allow controlling maximum number of cached directories + - smb3: do not start laundromat thread when dir leases disabled + - smb: client: do not start laundromat thread on nohandlecache + - smb: client: make laundromat a delayed worker + - smb: client: prevent new fids from being removed by laundromat + - virtio_balloon: Fix endless deflation and inflation on arm64 + - virtio-mmio: fix memory leak of vm_dev + - virtio-crypto: handle config changed by work queue + - virtio_pci: fix the common cfg map size + - vsock/virtio: initialize the_virtio_vsock before using VQs + - vhost: Allow null msg.size on VHOST_IOTLB_INVALIDATE + - arm64: dts: qcom: apq8096-db820c: fix missing clock populate + - arm64: dts: qcom: msm8996-xiaomi: fix missing clock populate + - arm64: dts: rockchip: use codec as clock master on px30-ringneck-haikou + - arm64: dts: rockchip: set codec system-clock-fixed on px30-ringneck-haikou + - arm64: dts: qcom: sa8775p: correct PMIC GPIO label in gpio-ranges + - arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399 + - arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards + - i40e: sync next_to_clean and next_to_process for programming status desc + - mm: fix vm_brk_flags() to not bail out while holding lock + - hugetlbfs: clear resv_map pointer if mmap fails + - mm/page_alloc: correct start page when guard page debug is enabled + - mm/migrate: fix do_pages_move for compat pointers + - selftests/mm: include mman header to access MREMAP_DONTUNMAP identifier + - mm/mempolicy: fix set_mempolicy_home_node() previous VMA pointer + - hugetlbfs: extend hugetlb_vma_lock to private VMAs + - maple_tree: add GFP_KERNEL to allocations in mas_expected_entries() + - nfsd: lock_rename() needs both directories to live on the same fs + - vdpa_sim_blk: Fix the potential leak of mgmt_dev + - vdpa/mlx5: Fix double release of debugfs entry + - ARM: OMAP1: ams-delta: Fix MODEM initialization failure + - ARM: dts: rockchip: Fix i2c0 register address for RK3128 + - ARM: dts: rockchip: Add missing arm timer interrupt for RK3128 + - ARM: dts: rockchip: Add missing quirk for RK3128's dma engine + - ARM: dts: rockchip: Fix timer clocks for RK3128 + - accel/ivpu: Don't enter d0i3 during FLR + - drm/i915/pmu: Check if pmu is closed before stopping event + - drm/amd: Disable ASPM for VI w/ all Intel systems + - drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper() + - btrfs: remove v0 extent handling + - btrfs: fix unwritten extent buffer after snapshotting a new subvolume + - ARM: OMAP: timer32K: fix all kernel-doc warnings + - firmware/imx-dsp: Fix use_after_free in imx_dsp_setup_channels() + - clk: ti: Fix missing omap4 mcbsp functional clock and aliases + - clk: ti: Fix missing omap5 mcbsp functional clock and aliases + - r8169: fix the KCSAN reported data-race in rtl_tx() while reading tp->cur_tx + - r8169: fix the KCSAN reported data-race in rtl_tx while reading + TxDescArray[entry].opts1 + - r8169: fix the KCSAN reported data race in rtl_rx while reading desc->opts1 + - iavf: initialize waitqueues before starting watchdog_task + - i40e: Fix I40E_FLAG_VF_VLAN_PRUNING value + - treewide: Spelling fix in comment + - igb: Fix potential memory leak in igb_add_ethtool_nfc_entry + - net: do not leave an empty skb in write queue + - neighbour: fix various data-races + - igc: Fix ambiguity in the ethtool advertising + - net: ethernet: adi: adin1110: Fix uninitialized variable + - net: ieee802154: adf7242: Fix some potential buffer overflow in + adf7242_stats_show() + - net: usb: smsc95xx: Fix uninit-value access in smsc95xx_read_reg + - r8152: Increase USB control msg timeout to 5000ms as per spec + - r8152: Run the unload routine if we have errors during probe + - r8152: Cancel hw_phy_work if we have an error in probe + - r8152: Release firmware if we have an error in probe + - tcp: fix wrong RTO timeout when received SACK reneging + - wifi: cfg80211: pass correct pointer to rdev_inform_bss() + - wifi: cfg80211: fix assoc response warning on failed links + - wifi: mac80211: don't drop all unprotected public action frames + - net/handshake: fix file ref count in handshake_nl_accept_doit() + - gtp: uapi: fix GTPA_MAX + - gtp: fix fragmentation needed check with gso + - drm/i915/perf: Determine context valid in OA reports + - i40e: Fix wrong check for I40E_TXR_FLAGS_WB_ON_ITR + - netfilter: flowtable: GC pushes back packets to classic path + - net/sched: act_ct: additional checks for outdated flows + - drm/logicvc: Kconfig: select REGMAP and REGMAP_MMIO + - drm/i915/mcr: Hold GT forcewake during steering operations + - iavf: in iavf_down, disable queues when removing the driver + - scsi: sd: Introduce manage_shutdown device flag + - blk-throttle: check for overflow in calculate_bytes_allowed + - kasan: print the original fault addr when access invalid shadow + - iio: afe: rescale: Accept only offset channels + - iio: exynos-adc: request second interupt only when touchscreen mode is used + - iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds + - iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale + - i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() + - i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() + - i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() + - i2c: stm32f7: Fix PEC handling in case of SMBUS transfers + - i2c: aspeed: Fix i2c bus hang in slave read + - tracing/kprobes: Fix symbol counting logic by looking at modules as well + - tracing/kprobes: Fix the description of variable length arguments + - misc: fastrpc: Reset metadata buffer to avoid incorrect free + - misc: fastrpc: Free DMA handles for RPC calls with no arguments + - misc: fastrpc: Clean buffers on remote invocation failures + - misc: fastrpc: Unmap only if buffer is unmapped from DSP + - nvmem: imx: correct nregs for i.MX6ULL + - nvmem: imx: correct nregs for i.MX6SLL + - nvmem: imx: correct nregs for i.MX6UL + - x86/tsc: Defer marking TSC unstable to a worker + - x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility + - x86/cpu: Add model number for Intel Arrow Lake mobile processor + - perf/core: Fix potential NULL deref + - sparc32: fix a braino in fault handling in csum_and_copy_..._user() + - clk: Sanitize possible_parent_show to Handle Return Value of + of_clk_get_parent_name + - clk: socfpga: gate: Account for the divider in determine_rate + - clk: stm32: Fix a signedness issue in clk_stm32_composite_determine_rate() + - platform/x86: Add s2idle quirk for more Lenovo laptops + - mm/damon/sysfs: check DAMOS regions update progress from before_terminate() + - accel/ivpu/37xx: Fix missing VPUIP interrupts + - Linux 6.5.10 + * CVE-2023-6560 + - io_uring: don't allow discontig pages for IORING_SETUP_NO_MMAP + * CVE-2023-51782 + - net/rose: Fix Use-After-Free in rose_ioctl + * Mantic update: v6.5.9 upstream stable release (LP: #2049202) + - Bluetooth: hci_event: Ignore NULL link key + - Bluetooth: Reject connection with the device which has same BD_ADDR + - Bluetooth: Fix a refcnt underflow problem for hci_conn + - Bluetooth: vhci: Fix race when opening vhci device + - Bluetooth: hci_event: Fix coding style + - Bluetooth: avoid memcmp() out of bounds warning + - Bluetooth: hci_conn: Fix modifying handle while aborting + - ice: fix over-shifted variable + - ice: Fix safe mode when DDP is missing + - ice: reset first in crash dump kernels + - net/smc: return the right falback reason when prefix checks fail + - btrfs: fix stripe length calculation for non-zoned data chunk allocation + - nfc: nci: fix possible NULL pointer dereference in send_acknowledge() + - regmap: fix NULL deref on lookup + - KVM: x86: Mask LVTPC when handling a PMI + - x86/fpu: Allow caller to constrain xfeatures when copying to uabi buffer + - KVM: x86/pmu: Truncate counter value to allowed width on write + - KVM: x86: Constrain guest-supported xfeatures only at KVM_GET_XSAVE{2} + - x86: KVM: SVM: add support for Invalid IPI Vector interception + - x86: KVM: SVM: refresh AVIC inhibition in svm_leave_nested() + - tcp: check mptcp-level constraints for backlog coalescing + - mptcp: more conservative check for zero probes + - selftests: mptcp: join: no RST when rm subflow/addr + - mm: slab: Do not create kmalloc caches smaller than arch_slab_minalign() + - fs/ntfs3: Fix OOB read in ntfs_init_from_boot + - fs/ntfs3: Fix possible null-pointer dereference in hdr_find_e() + - fs/ntfs3: fix panic about slab-out-of-bounds caused by ntfs_list_ea() + - fs/ntfs3: Fix shift-out-of-bounds in ntfs_fill_super + - fs/ntfs3: fix deadlock in mark_as_free_ex + - Revert "net: wwan: iosm: enable runtime pm support for 7560" + - netfilter: nft_payload: fix wrong mac header matching + - drm/i915: Retry gtt fault when out of fence registers + - drm/mediatek: Correctly free sg_table in gem prime vmap + - drm/nouveau/disp: fix DP capable DSM connectors + - drm/edid: add 8 bpc quirk to the BenQ GW2765 + - ALSA: hda/realtek - Fixed ASUS platform headset Mic issue + - ALSA: hda/realtek: Add quirk for ASUS ROG GU603ZV + - ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq5xxx + - ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind + - ASoC: codecs: wcd938x-sdw: fix runtime PM imbalance on probe errors + - ASoC: codecs: wcd938x: drop bogus bind error handling + - ASoC: codecs: wcd938x: fix unbind tear down order + - ASoC: codecs: wcd938x: fix resource leaks on bind errors + - ASoC: codecs: wcd938x: fix regulator leaks on probe errors + - ASoC: codecs: wcd938x: fix runtime PM imbalance on remove + - qed: fix LL2 RX buffer allocation + - xfrm: fix a data-race in xfrm_lookup_with_ifid() + - xfrm6: fix inet6_dev refcount underflow problem + - xfrm: fix a data-race in xfrm_gen_index() + - xfrm: interface: use DEV_STATS_INC() + - net: xfrm: skip policies marked as dead while reinserting policies + - fprobe: Fix to ensure the number of active retprobes is not zero + - wifi: cfg80211: use system_unbound_wq for wiphy work + - net: ipv4: fix return value check in esp_remove_trailer + - net: ipv6: fix return value check in esp_remove_trailer + - net: rfkill: gpio: prevent value glitch during probe + - tcp: fix excessive TLP and RACK timeouts from HZ rounding + - tcp: tsq: relax tcp_small_queue_check() when rtx queue contains a single skb + - tcp: Fix listen() warning with v4-mapped-v6 address. + - docs: fix info about representor identification + - tun: prevent negative ifindex + - gve: Do not fully free QPL pages on prefill errors + - ipv4: fib: annotate races around nh->nh_saddr_genid and nh->nh_saddr + - net: usb: smsc95xx: Fix an error code in smsc95xx_reset() + - octeon_ep: update BQL sent bytes before ringing doorbell + - i40e: prevent crash on probe if hw registers have invalid values + - net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() + - bonding: Return pointer to data after pull on skb + - net/sched: sch_hfsc: upgrade 'rt' to 'sc' when it becomes a inner curve + - neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section + - selftests: openvswitch: Catch cases where the tests are killed + - selftests: openvswitch: Fix the ct_tuple for v4 + - selftests: netfilter: Run nft_audit.sh in its own netns + - netfilter: nft_set_rbtree: .deactivate fails if element has expired + - netlink: Correct offload_xstats size + - netfilter: nf_tables: do not refresh timeout when resetting element + - netfilter: nf_tables: do not remove elements if set backend implements + .abort + - netfilter: nf_tables: revert do not remove elements if set backend + implements .abort + - selftests: openvswitch: Add version check for pyroute2 + - net: phy: bcm7xxx: Add missing 16nm EPHY statistics + - net: pktgen: Fix interface flags printing + - net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation + - net: mdio-mux: fix C45 access returning -EIO after API change + - net: avoid UAF on deleted altname + - net: fix ifname in netlink ntf during netns move + - net: check for altname conflicts when changing netdev's netns + - iio: light: vcnl4000: Don't power on/off chip in config + - pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency + - ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone + - arm64: dts: mediatek: Fix "mediatek,merge-mute" and "mediatek,merge-fifo-en" + types + - fs-writeback: do not requeue a clean inode having skipped pages + - btrfs: fix race when refilling delayed refs block reserve + - btrfs: prevent transaction block reserve underflow when starting transaction + - btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1 + - btrfs: initialize start_slot in btrfs_log_prealloc_extents + - i2c: mux: Avoid potential false error message in i2c_mux_add_adapter + - overlayfs: set ctime when setting mtime and atime + - accel/ivpu: Don't flood dmesg with VPU ready message + - gpio: timberdale: Fix potential deadlock on &tgpio->lock + - ata: libata-core: Fix compilation warning in ata_dev_config_ncq() + - ata: libata-eh: Fix compilation warning in ata_eh_link_report() + - tracing: relax trace_event_eval_update() execution with cond_resched() + - wifi: mwifiex: Sanity check tlv_len and tlv_bitmap_len + - wifi: cfg80211: validate AP phy operation before starting it + - wifi: iwlwifi: Ensure ack flag is properly cleared. + - rfkill: sync before userspace visibility/changes + - HID: logitech-hidpp: Add Bluetooth ID for the Logitech M720 Triathlon mouse + - HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event + - Bluetooth: btusb: add shutdown function for QCA6174 + - Bluetooth: Avoid redundant authentication + - Bluetooth: hci_core: Fix build warnings + - wifi: cfg80211: Fix 6GHz scan configuration + - wifi: mac80211: work around Cisco AP 9115 VHT MPDU length + - wifi: mac80211: allow transmitting EAPOL frames with tainted key + - wifi: cfg80211: avoid leaking stack data into trace + - regulator/core: Revert "fix kobject release warning and memory leak in + regulator_register()" + - SUNRPC: Fail quickly when server does not recognize TLS + - SUNRPC/TLS: Lock the lower_xprt during the tls handshake + - nfs: decrement nrequests counter before releasing the req + - sky2: Make sure there is at least one frag_addr available + - ipv4/fib: send notify when delete source address routes + - drm: panel-orientation-quirks: Add quirk for One Mix 2S + - btrfs: fix some -Wmaybe-uninitialized warnings in ioctl.c + - btrfs: error out when COWing block using a stale transaction + - btrfs: error when COWing block from a root that is being deleted + - btrfs: error out when reallocating block for defrag using a stale + transaction + - platform/x86: touchscreen_dmi: Add info for the BUSH Bush Windows tablet + - drm/amd/pm: add unique_id for gc 11.0.3 + - HID: multitouch: Add required quirk for Synaptics 0xcd7e device + - HID: nintendo: reinitialize USB Pro Controller after resuming from suspend + - HID: Add quirk to ignore the touchscreen battery on HP ENVY 15-eu0556ng + - platform/x86: touchscreen_dmi: Add info for the Positivo C4128B + - cpufreq: schedutil: Update next_freq when cpufreq_limits change + - Bluetooth: hci_sync: Fix not handling ISO_LINK in hci_abort_conn_sync + - Bluetooth: hci_sync: Introduce PTR_UINT/UINT_PTR macros + - Bluetooth: ISO: Fix invalid context error + - Bluetooth: hci_sync: delete CIS in BT_OPEN/CONNECT/BOUND when aborting + - Bluetooth: hci_sync: always check if connection is alive before deleting + - net/mlx5: E-switch, register event handler before arming the event + - net/mlx5: Handle fw tracer change ownership event based on MTRC + - net/mlx5e: RX, Fix page_pool allocation failure recovery for striding rq + - net/mlx5e: RX, Fix page_pool allocation failure recovery for legacy rq + - net/mlx5e: XDP, Fix XDP_REDIRECT mpwqe page fragment leaks on shutdown + - net/mlx5e: Take RTNL lock before triggering netdev notifiers + - net/mlx5e: Don't offload internal port if filter device is out device + - net/mlx5e: Fix VF representors reporting zero counters to "ip -s" command + - net/tls: split tls_rx_reader_lock + - tcp: allow again tcp_disconnect() when threads are waiting + - Bluetooth: hci_event: Fix using memcmp when comparing keys + - tcp_bpf: properly release resources on error paths + - mtd: rawnand: qcom: Unmap the right resource upon probe failure + - mtd: rawnand: pl353: Ensure program page operations are successful + - mtd: rawnand: marvell: Ensure program page operations are successful + - mtd: rawnand: arasan: Ensure program page operations are successful + - mtd: rawnand: Ensure the nand chip supports cached reads + - mtd: spinand: micron: correct bitmask for ecc status + - mtd: physmap-core: Restore map_rom fallback + - dt-bindings: mmc: sdhci-msm: correct minimum number of clocks + - mmc: sdhci-pci-gli: fix LPM negotiation so x86/S0ix SoCs can suspend + - mmc: mtk-sd: Use readl_poll_timeout_atomic in msdc_reset_hw + - mmc: core: Fix error propagation for some ioctl commands + - mmc: core: sdio: hold retuning if sdio in 1-bit mode + - pinctrl: qcom: lpass-lpi: fix concurrent register updates + - pNFS: Fix a hang in nfs4_evict_inode() + - pNFS/flexfiles: Check the layout validity in ff_layout_mirror_prepare_stats + - NFSv4.1: fixup use EXCHGID4_FLAG_USE_PNFS_DS for DS server + - ACPI: irq: Fix incorrect return value in acpi_register_gsi() + - ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init() + - perf dlfilter: Fix use of addr_location__exit() in dlfilter__object_code() + - fanotify: limit reporting of event with non-decodeable file handles + - NFS: Fix potential oops in nfs_inode_remove_request() + - nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op + - nvme: sanitize metadata bounce buffer for reads + - nvme-pci: add BOGUS_NID for Intel 0a54 device + - nvme-auth: use chap->s2 to indicate bidirectional authentication + - nvmet-auth: complete a request only after freeing the dhchap pointers + - nvme-rdma: do not try to stop unallocated queues + - USB: serial: option: add Telit LE910C4-WWX 0x1035 composition + - USB: serial: option: add entry for Sierra EM9191 with new firmware + - USB: serial: option: add Fibocom to DELL custom modem FM101R-GL + - thunderbolt: Call tb_switch_put() once DisplayPort bandwidth request is + finished + - s390/pci: fix iommu bitmap allocation + - tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols + - selftests/ftrace: Add new test case which checks non unique symbol + - KEYS: asymmetric: Fix sign/verify on pkcs1pad without a hash + - apple-gmux: Hard Code max brightness for MMIO gmux + - s390/cio: fix a memleak in css_alloc_subchannel + - platform/surface: platform_profile: Propagate error if profile registration + fails + - platform/x86: intel-uncore-freq: Conditionally create attribute for read + frequency + - platform/x86: msi-ec: Fix the 3rd config + - platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e + - platform/x86: asus-wmi: Only map brightness codes when using asus-wmi + backlight control + - platform/x86: asus-wmi: Map 0x2a code, Ignore 0x2b and 0x2c events + - rust: error: fix the description for `ECHILD` + - gpiolib: acpi: Add missing memset(0) to acpi_get_gpiod_from_data() + - gpio: vf610: set value before the direction to avoid a glitch + - gpio: vf610: mask the gpio irq in system suspend and support wakeup + - ASoC: cs35l56: Fix illegal use of init_completion() + - ASoC: pxa: fix a memory leak in probe() + - ASoC: cs42l42: Fix missing include of gpio/consumer.h + - drm/bridge: ti-sn65dsi86: Associate DSI device lifetime with auxiliary + device + - drm/i915/cx0: Only clear/set the Pipe Reset bit of the PHY Lanes Owned + - drm/amdgpu: Fix possible null pointer dereference + - powerpc/mm: Allow ARCH_FORCE_MAX_ORDER up to 12 + - powerpc/qspinlock: Fix stale propagated yield_cpu + - docs: Move rustdoc output, cross-reference it + - rust: docs: fix logo replacement + - phy: mapphone-mdm6600: Fix runtime disable on probe + - phy: mapphone-mdm6600: Fix runtime PM for remove + - phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins + - phy: qcom-qmp-usb: initialize PCS_USB registers + - phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p + - phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1 + - phy: qcom-qmp-combo: initialize PCS_USB registers + - efi/unaccepted: Fix soft lockups caused by parallel memory acceptance + - net: move altnames together with the netdevice + - Bluetooth: hci_sock: fix slab oob read in create_monitor_event + - net: rfkill: reduce data->mtx scope in rfkill_fop_open + - docs: rust: update Rust docs output path + - kbuild: remove old Rust docs output path + - Bluetooth: hci_sock: Correctly bounds check and pad HCI_MON_NEW_INDEX name + - mptcp: avoid sending RST when closing the initial subflow + - selftests: mptcp: join: correctly check for no RST + - Linux 6.5.9 + * CVE-2023-51779 + - Bluetooth: af_bluetooth: Fix Use-After-Free in bt_sock_recvmsg + + -- Philip Cox Fri, 16 Feb 2024 14:54:54 -0500 + linux-aws (6.5.0-1014.14) mantic; urgency=medium * mantic/linux-aws: 6.5.0-1014.14 -proposed tracker (LP: #2052271) diff -u linux-aws-6.5-6.5.0/debian.aws/reconstruct linux-aws-6.5-6.5.0/debian.aws/reconstruct --- linux-aws-6.5-6.5.0/debian.aws/reconstruct +++ linux-aws-6.5-6.5.0/debian.aws/reconstruct @@ -47,9 +47,12 @@ chmod +x 'debian/tests/rebuild' chmod +x 'debian/tests/ubuntu-regression-suite' chmod +x 'drivers/watchdog/f71808e_wdt.c' +chmod +x 'tools/testing/selftests/netfilter/conntrack_sctp_collision.sh' chmod +x 'tools/testing/selftests/netfilter/nft_audit.sh' +chmod +x 'tools/testing/selftests/netfilter/xt_string.sh' chmod +x 'update-dkms-versions' # Remove any files deleted from the orig. +rm -f 'Documentation/networking/device_drivers/ethernet/mellanox/mlx5/devlink.rst' rm -f 'arch/parisc/include/asm/mckinley.h' rm -f 'drivers/media/pci/intel/ipu3/cio2-bridge.c' rm -f 'drivers/media/pci/intel/ipu3/cio2-bridge.h' diff -u linux-aws-6.5-6.5.0/debian.aws/tracking-bug linux-aws-6.5-6.5.0/debian.aws/tracking-bug --- linux-aws-6.5-6.5.0/debian.aws/tracking-bug +++ linux-aws-6.5-6.5.0/debian.aws/tracking-bug @@ -1 +1 @@ -2052271 s2024.01.08-1 +2052021 2024.02.05-1 diff -u linux-aws-6.5-6.5.0/debian.master/changelog linux-aws-6.5-6.5.0/debian.master/changelog --- linux-aws-6.5-6.5.0/debian.master/changelog +++ linux-aws-6.5-6.5.0/debian.master/changelog @@ -1,34 +1,2090 @@ -linux (6.5.0-21.21) mantic; urgency=medium +linux (6.5.0-25.25) mantic; urgency=medium - * mantic/linux: 6.5.0-21.21 -proposed tracker (LP: #2052603) + * mantic/linux: 6.5.0-25.25 -proposed tracker (LP: #2052615) + + * Packaging resync (LP: #1786013) + - debian/dkms-versions -- update from kernel-versions (main/2024.02.05) + + * [SRU][22.04.04]: mpi3mr driver update (LP: #2045233) + - scsi: mpi3mr: Invoke soft reset upon TSU or event ack time out + - scsi: mpi3mr: Update MPI Headers to version 3.00.28 + - scsi: mpi3mr: Add support for more than 1MB I/O + - scsi: mpi3mr: WRITE SAME implementation + - scsi: mpi3mr: Enhance handling of devices removed after controller reset + - scsi: mpi3mr: Update driver version to 8.5.0.0.0 + - scsi: mpi3mr: Split off bus_reset function from host_reset + - scsi: mpi3mr: Add support for SAS5116 PCI IDs + - scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 + - scsi: mpi3mr: Increase maximum number of PHYs to 64 from 32 + - scsi: mpi3mr: Add support for status reply descriptor + - scsi: mpi3mr: driver version upgrade to 8.5.0.0.50 + - scsi: mpi3mr: Refresh sdev queue depth after controller reset + - scsi: mpi3mr: Clean up block devices post controller reset + - scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable + State + - scsi: mpi3mr: Fetch correct device dev handle for status reply descriptor + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-1 + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-2 + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-3 + - scsi: mpi3mr: Update driver version to 8.5.1.0.0 * The display becomes frozen after some time when a HDMI device is connected. (LP: #2049027) - drm/i915/dmc: Don't enable any pipe DMC events + * Audio balancing setting doesn't work with the cirrus codec (LP: #2051050) + - ALSA: hda/cs8409: Suppress vmaster control for Dolphin models + * partproke is broken on empty loopback device (LP: #2049689) - block: Move checking GENHD_FL_NO_PART to bdev_add_partition() - * CVE-2023-51781 - - appletalk: Fix Use-After-Free in atalk_ioctl - * CVE-2023-51780 - atm: Fix Use-After-Free in do_vcc_ioctl * CVE-2023-6915 - ida: Fix crash in ida_free when the bitmap is empty - * CVE-2024-0565 - - smb: client: fix OOB in receive_encrypted_standard() + * Update Ubuntu.md (LP: #2051176) + - [Packaging] update Ubuntu.md + + * test_021_aslr_dapper_libs from ubuntu_qrt_kernel_security failed on K-5.19 / + J-OEM-6.1 / J-6.2 AMD64 (LP: #1983357) + - [Config]: set ARCH_MMAP_RND_{COMPAT_, }BITS to the maximum + + * Intel E810-XXV - NETDEV WATCHDOG: (ice): transmit queue timed out + (LP: #2036239) + - ice: Add driver support for firmware changes for LAG + - ice: alter feature support check for SRIOV and LAG + + * Mantic update: upstream stable patchset 2024-01-29 (LP: #2051584) + - Upstream stable to v6.1.67, v6.6.6 + - vdpa/mlx5: preserve CVQ vringh index + - hrtimers: Push pending hrtimers away from outgoing CPU earlier + - i2c: designware: Fix corrupted memory seen in the ISR + - netfilter: ipset: fix race condition between swap/destroy and kernel side + add/del/test + - zstd: Fix array-index-out-of-bounds UBSAN warning + - tg3: Move the [rt]x_dropped counters to tg3_napi + - tg3: Increment tx_dropped in tg3_tso_bug() + - kconfig: fix memory leak from range properties + - drm/amdgpu: correct chunk_ptr to a pointer to chunk. + - x86: Introduce ia32_enabled() + - x86/coco: Disable 32-bit emulation by default on TDX and SEV + - x86/entry: Convert INT 0x80 emulation to IDTENTRY + - x86/entry: Do not allow external 0x80 interrupts + - x86/tdx: Allow 32-bit emulation by default + - dt: dt-extract-compatibles: Handle cfile arguments in generator function + - dt: dt-extract-compatibles: Don't follow symlinks when walking tree + - platform/x86: asus-wmi: Move i8042 filter install to shared asus-wmi code + - of: dynamic: Fix of_reconfig_get_state_change() return value documentation + - platform/x86: wmi: Skip blocks with zero instances + - ipv6: fix potential NULL deref in fib6_add() + - octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam + - octeontx2-af: Check return value of nix_get_nixlf before using nixlf + - hv_netvsc: rndis_filter needs to select NLS + - r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE + - r8152: Add RTL8152_INACCESSIBLE checks to more loops + - r8152: Add RTL8152_INACCESSIBLE to r8156b_wait_loading_flash() + - r8152: Add RTL8152_INACCESSIBLE to r8153_pre_firmware_1() + - r8152: Add RTL8152_INACCESSIBLE to r8153_aldps_en() + - mlxbf-bootctl: correctly identify secure boot with development keys + - platform/mellanox: Add null pointer checks for devm_kasprintf() + - platform/mellanox: Check devm_hwmon_device_register_with_groups() return + value + - arcnet: restoring support for multiple Sohard Arcnet cards + - octeontx2-pf: consider both Rx and Tx packet stats for adaptive interrupt + coalescing + - net: stmmac: fix FPE events losing + - xsk: Skip polling event check for unbound socket + - octeontx2-af: fix a use-after-free in rvu_npa_register_reporters + - i40e: Fix unexpected MFS warning message + - iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero + - tcp: fix mid stream window clamp. + - ionic: fix snprintf format length warning + - ionic: Fix dim work handling in split interrupt mode + - ipv4: ip_gre: Avoid skb_pull() failure in ipgre_xmit() + - net: atlantic: Fix NULL dereference of skb pointer in + - net: hns: fix wrong head when modify the tx feature when sending packets + - net: hns: fix fake link up on xge port + - octeontx2-af: Adjust Tx credits when MCS external bypass is disabled + - octeontx2-af: Fix mcs sa cam entries size + - octeontx2-af: Fix mcs stats register address + - octeontx2-af: Add missing mcs flr handler call + - octeontx2-af: Update Tx link register range + - dt-bindings: interrupt-controller: Allow #power-domain-cells + - netfilter: nf_tables: fix 'exist' matching on bigendian arches + - netfilter: nf_tables: validate family when identifying table via handle + - netfilter: xt_owner: Fix for unsafe access of sk->sk_socket + - tcp: do not accept ACK of bytes we never sent + - bpf: sockmap, updating the sg structure should also update curr + - psample: Require 'CAP_NET_ADMIN' when joining "packets" group + - drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group + - mm/damon/sysfs: eliminate potential uninitialized variable warning + - tee: optee: Fix supplicant based device enumeration + - RDMA/hns: Fix unnecessary err return when using invalid congest control + algorithm + - RDMA/irdma: Do not modify to SQD on error + - RDMA/irdma: Add wait for suspend on SQD + - arm64: dts: rockchip: Expand reg size of vdec node for RK3328 + - arm64: dts: rockchip: Expand reg size of vdec node for RK3399 + - ASoC: fsl_sai: Fix no frame sync clock issue on i.MX8MP + - RDMA/rtrs-srv: Do not unconditionally enable irq + - RDMA/rtrs-clt: Start hb after path_up + - RDMA/rtrs-srv: Check return values while processing info request + - RDMA/rtrs-srv: Free srv_mr iu only when always_invalidate is true + - RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight + - RDMA/rtrs-clt: Fix the max_send_wr setting + - RDMA/rtrs-clt: Remove the warnings for req in_use check + - RDMA/bnxt_re: Correct module description string + - RDMA/irdma: Refactor error handling in create CQP + - RDMA/irdma: Fix UAF in irdma_sc_ccq_get_cqe_info() + - hwmon: (acpi_power_meter) Fix 4.29 MW bug + - ASoC: codecs: lpass-tx-macro: set active_decimator correct default value + - hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe() + - ASoC: wm_adsp: fix memleak in wm_adsp_buffer_populate + - RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz + - RDMA/irdma: Avoid free the non-cqp_request scratch + - drm/bridge: tc358768: select CONFIG_VIDEOMODE_HELPERS + - arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3 + - ARM: dts: imx6ul-pico: Describe the Ethernet PHY clock + - tracing: Fix a warning when allocating buffered events fails + - scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle() + - ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init + - ARM: dts: imx7: Declare timers compatible with fsl,imx6dl-gpt + - ARM: dts: imx28-xea: Pass the 'model' property + - riscv: fix misaligned access handling of C.SWSP and C.SDSP + - md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly() + - rethook: Use __rcu pointer for rethook::handler + - kprobes: consistent rcu api usage for kretprobe holder + - ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA + - nvme-pci: Add sleep quirk for Kingston drives + - io_uring: fix mutex_unlock with unreferenced ctx + - ALSA: usb-audio: Add Pioneer DJM-450 mixer controls + - ALSA: pcm: fix out-of-bounds in snd_pcm_state_names + - ALSA: hda/realtek: add new Framework laptop to quirks + - ALSA: hda/realtek: Add Framework laptop 16 to quirks + - ring-buffer: Test last update in 32bit version of __rb_time_read() + - nilfs2: fix missing error check for sb_set_blocksize call + - nilfs2: prevent WARNING in nilfs_sufile_set_segment_usage() + - cgroup_freezer: cgroup_freezing: Check if not frozen + - checkstack: fix printed address + - tracing: Always update snapshot buffer size + - tracing: Disable snapshot buffer when stopping instance tracers + - tracing: Fix incomplete locking when disabling buffered events + - tracing: Fix a possible race when disabling buffered events + - packet: Move reference count in packet_sock to atomic_long_t + - r8169: fix rtl8125b PAUSE frames blasting when suspended + - regmap: fix bogus error on regcache_sync success + - platform/surface: aggregator: fix recv_buf() return value + - hugetlb: fix null-ptr-deref in hugetlb_vma_lock_write + - mm: fix oops when filemap_map_pmd() without prealloc_pte + - powercap: DTPM: Fix missing cpufreq_cpu_put() calls + - md/raid6: use valid sector values to determine if an I/O should wait on the + reshape + - arm64: dts: mediatek: mt7622: fix memory node warning check + - arm64: dts: mediatek: mt8183-kukui-jacuzzi: fix dsi unnecessary cells + properties + - arm64: dts: mediatek: cherry: Fix interrupt cells for MT6360 on I2C7 + - arm64: dts: mediatek: mt8173-evb: Fix regulator-fixed node names + - arm64: dts: mediatek: mt8195: Fix PM suspend/resume with venc clocks + - arm64: dts: mediatek: mt8183: Fix unit address for scp reserved memory + - arm64: dts: mediatek: mt8183: Move thermal-zones to the root node + - arm64: dts: mediatek: mt8183-evb: Fix unit_address_vs_reg warning on ntc + - coresight: etm4x: Remove bogous __exit annotation for some functions + - hwtracing: hisi_ptt: Add dummy callback pmu::read() + - misc: mei: client.c: return negative error code in mei_cl_write + - misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write + - LoongArch: BPF: Don't sign extend memory load operand + - LoongArch: BPF: Don't sign extend function return value + - ring-buffer: Force absolute timestamp on discard of event + - tracing: Set actual size after ring buffer resize + - tracing: Stop current tracer when resizing buffer + - parisc: Reduce size of the bug_table on 64-bit kernel by half + - parisc: Fix asm operand number out of range build error in bug table + - arm64: dts: mediatek: add missing space before { + - arm64: dts: mt8183: kukui: Fix underscores in node names + - x86/sev: Fix kernel crash due to late update to read-only ghcb_version + - gpiolib: sysfs: Fix error handling on failed export + - drm/amd/amdgpu: Fix warnings in amdgpu/amdgpu_display.c + - drm/amdgpu: Add I2C EEPROM support on smu v13_0_6 + - usb: gadget: f_hid: fix report descriptor allocation + - serial: 8250_dw: Add ACPI ID for Granite Rapids-D UART + - parport: Add support for Brainboxes IX/UC/PX parallel cards + - cifs: Fix non-availability of dedup breaking generic/304 + - Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1" + - smb: client: fix potential NULL deref in parse_dfs_referrals() + - ARM: PL011: Fix DMA support + - serial: sc16is7xx: address RX timeout interrupt errata + - serial: 8250: 8250_omap: Clear UART_HAS_RHR_IT_DIS bit + - serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt + - serial: 8250_omap: Add earlycon support for the AM654 UART controller + - devcoredump: Send uevent once devcd is ready + - x86/CPU/AMD: Check vendor in the AMD microcode callback + - USB: gadget: core: adjust uevent timing on gadget unbind + - cifs: Fix flushing, invalidation and file size with copy_file_range() + - cifs: Fix flushing, invalidation and file size with FICLONE + - MIPS: kernel: Clear FPU states when setting up kernel threads + - KVM: s390/mm: Properly reset no-dat + - KVM: SVM: Update EFER software model on CR0 trap for SEV-ES + - MIPS: Loongson64: Reserve vgabios memory on boot + - MIPS: Loongson64: Handle more memory types passed from firmware + - MIPS: Loongson64: Enable DMA noncoherent support + - riscv: Kconfig: Add select ARM_AMBA to SOC_STARFIVE + - [Config] updateconfigs after enabling ARM_AMBA on riscv + - scsi: sd: Fix sshdr use in sd_suspend_common() + - nouveau: use an rwlock for the event lock. + - modpost: fix section mismatch message for RELA + - drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2) + - drm/amdgpu: finalizing mem_partitions at the end of GMC v9 sw_fini + - dm-crypt: start allocating with MAX_ORDER + - r8152: Hold the rtnl_lock for all of reset + - net: dsa: microchip: provide a list of valid protocols for xmit handler + - net/smc: fix missing byte order conversion in CLC handshake + - RDMA/core: Fix uninit-value access in ib_get_eth_speed() + - ARM: dts: imx6q: skov: fix ethernet clock regression + - ARM: dts: rockchip: Fix sdmmc_pwren's pinmux setting for RK3128 + - ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act + - firmware: arm_scmi: Extend perf protocol ops to get number of domains + - firmware: arm_scmi: Extend perf protocol ops to get information of a domain + - firmware: arm_scmi: Fix frequency truncation by promoting multiplier type + - firmware: arm_scmi: Simplify error path in scmi_dvfs_device_opps_add() + - RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned + - RDMA/irdma: Fix support for 64k pages + - io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring() + - io_uring/kbuf: check for buffer list readiness after NULL check + - arm64: dts: imx8-ss-lsio: Add PWM interrupts + - arm64: dts: freescale: imx8-ss-lsio: Fix #pwm-cells + - arm64: dts: imx93: correct mediamix power + - arm64: dts: imx8-apalis: set wifi regulator to always-on + - arm64: dts: rockchip: Fix eMMC Data Strobe PD on rk3588 + - scripts/gdb: fix lx-device-list-bus and lx-device-list-class + - ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA + - ALSA: hda/realtek: Apply quirk for ASUS UM3504DA + - ALSA: hda/realtek: fix speakers on XPS 9530 (2023) + - ALSA: hda/realtek: Add quirk for Lenovo Yoga Pro 7 + - lib/group_cpus.c: avoid acquiring cpu hotplug lock in group_cpus_evenly + - leds: trigger: netdev: fix RTNL handling to prevent potential deadlock + - nfp: flower: fix for take a mutex lock in soft irq context and rcu lock + - workqueue: Make sure that wq_unbound_cpumask is never empty + - drivers/base/cpu: crash data showing should depends on KEXEC_CORE + - mm/memory_hotplug: add missing mem_hotplug_lock + - mm/memory_hotplug: fix error handling in add_memory_resource() + - drm/atomic-helpers: Invoke end_fb_access while owning plane state + - drm/i915/mst: Fix .mode_valid_ctx() return values + - drm/i915/mst: Reject modes that require the bigjoiner + - arm64: dts: mt7986: change cooling trips + - arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3 + - arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization + - arm64: dts: mediatek: mt8186: fix clock names for power domains + - arm64: dts: mediatek: mt8186: Change gpu speedbin nvmem cell name + - coresight: Fix crash when Perf and sysfs modes are used concurrently + - coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb + - coresight: ultrasoc-smb: Config SMB buffer before register sink + - coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base + - ASoC: ops: add correct range check for limiting volume + - nvmem: Do not expect fixed layouts to grab a layout driver + - serial: ma35d1: Validate console index before assignment + - powerpc/ftrace: Fix stack teardown in ftrace_no_trace + - perf metrics: Avoid segv if default metricgroup isn't set + - ASoC: qcom: sc8280xp: Limit speaker digital volumes + - gcc-plugins: randstruct: Update code comment in relayout_struct() + - drm/amdgpu: Fix refclk reporting for SMU v13.0.6 + - drm/amdgpu: Add bootloader status check + - drm/amdgpu: Add bootloader wait for PSP v13 + - drm/amdgpu: Restrict bootloader wait to SMUv13.0.6 + - drm/amdgpu: update retry times for psp vmbx wait + - drm/amdgpu: update retry times for psp BL wait + - drm/amdgpu: Restrict extended wait to PSP v13.0.6 + - Upstream stable to v6.1.68, v6.6.7 + + * i915 regression introduced with 5.5 kernel (LP: #2044131) + - drm/i915: Skip some timing checks on BXT/GLK DSI transcoders + + * Mantic update: upstream stable patchset 2024-01-26 (LP: #2051366) + - cifs: Fix FALLOC_FL_ZERO_RANGE by setting i_size if EOF moved + - cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF moved + - smb: client: report correct st_size for SMB and NFS symlinks + - pinctrl: avoid reload of p state in list iteration + - firewire: core: fix possible memory leak in create_units() + - mmc: sdhci-pci-gli: Disable LPM during initialization + - mmc: cqhci: Increase recovery halt timeout + - mmc: cqhci: Warn of halt or task clear failure + - mmc: cqhci: Fix task clearing in CQE error recovery + - mmc: block: Retry commands in CQE error recovery + - mmc: block: Do not lose cache flush during CQE error recovery + - mmc: block: Be sure to wait while busy in CQE error recovery + - ALSA: hda: Disable power-save on KONTRON SinglePC + - ALSA: hda/realtek: Headset Mic VREF to 100% + - ALSA: hda/realtek: Add supported ALC257 for ChromeOS + - dm-verity: align struct dm_verity_fec_io properly + - scsi: Change SCSI device boolean fields to single bit flags + - scsi: sd: Fix system start for ATA devices + - drm/amd: Enable PCIe PME from D3 + - drm/amdgpu: Force order between a read and write to the same address + - drm/amd/display: Include udelay when waiting for INBOX0 ACK + - drm/amd/display: Remove min_dst_y_next_start check for Z8 + - drm/amd/display: Use DRAM speed from validation for dummy p-state + - drm/amd/display: Update min Z8 residency time to 2100 for DCN314 + - drm/amd/display: fix ABM disablement + - dm verity: initialize fec io before freeing it + - dm verity: don't perform FEC for failed readahead IO + - nvme: check for valid nvme_identify_ns() before using it + - powercap: DTPM: Fix unneeded conversions to micro-Watts + - cpufreq/amd-pstate: Fix the return value of amd_pstate_fast_switch() + - dma-buf: fix check in dma_resv_add_fence + - bcache: revert replacing IS_ERR_OR_NULL with IS_ERR + - iommu/vt-d: Add MTL to quirk list to skip TE disabling + - KVM: PPC: Book3S HV: Fix KVM_RUN clobbering FP/VEC user registers + - powerpc: Don't clobber f0/vs0 during fp|altivec register save + - parisc: Mark ex_table entries 32-bit aligned in assembly.h + - parisc: Mark ex_table entries 32-bit aligned in uaccess.h + - parisc: Use natural CPU alignment for bug_table + - parisc: Mark lock_aligned variables 16-byte aligned on SMP + - parisc: Drop the HP-UX ENOSYM and EREMOTERELEASE error codes + - parisc: Mark jump_table naturally aligned + - parisc: Ensure 32-bit alignment on parisc unwind section + - parisc: Mark altinstructions read-only and 32-bit aligned + - btrfs: add dmesg output for first mount and last unmount of a filesystem + - btrfs: ref-verify: fix memory leaks in btrfs_ref_tree_mod() + - btrfs: fix off-by-one when checking chunk map includes logical address + - btrfs: send: ensure send_fd is writable + - btrfs: make error messages more clear when getting a chunk map + - btrfs: fix 64bit compat send ioctl arguments not initializing version member + - auxdisplay: hd44780: move cursor home after clear display command + - serial: sc16is7xx: Put IOControl register into regmap_volatile + - serial: sc16is7xx: add missing support for rs485 devicetree properties + - dpaa2-eth: increase the needed headroom to account for alignment + - uapi: propagate __struct_group() attributes to the container union + - selftests/net: ipsec: fix constant out of range + - selftests/net: fix a char signedness issue + - selftests/net: unix: fix unused variable compiler warning + - selftests/net: mptcp: fix uninitialized variable warnings + - octeontx2-af: Fix possible buffer overflow + - net: stmmac: xgmac: Disable FPE MMC interrupts + - octeontx2-pf: Fix adding mbox work queue entry when num_vfs > 64 + - octeontx2-af: Install TC filter rules in hardware based on priority + - octeontx2-pf: Restore TC ingress police rules when interface is up + - r8169: prevent potential deadlock in rtl8169_close + - ravb: Fix races between ravb_tx_timeout_work() and net related ops + - net: ravb: Check return value of reset_control_deassert() + - net: ravb: Use pm_runtime_resume_and_get() + - net: ravb: Make write access to CXR35 first before accessing other EMAC + registers + - net: ravb: Start TX queues after HW initialization succeeded + - net: ravb: Stop DMA in case of failures on ravb_open() + - net: ravb: Keep reverse order of operations in ravb_remove() + - octeontx2-af: Initialize 'cntr_val' to fix uninitialized symbol error + - spi: Fix null dereference on suspend + - cpufreq: imx6q: Don't disable 792 Mhz OPP unnecessarily + - iommu/vt-d: Omit devTLB invalidation requests when TES=0 + - iommu/vt-d: Disable PCI ATS in legacy passthrough mode + - iommu/vt-d: Make context clearing consistent with context mapping + - drm/amd/pm: fix a memleak in aldebaran_tables_init + - mmc: sdhci-sprd: Fix vqmmc not shutting down after the card was pulled + - drm/amd/display: Fix MPCC 1DLUT programming + - r8169: fix deadlock on RTL8125 in jumbo mtu mode + - xen: simplify evtchn_do_upcall() call maze + - x86/xen: fix percpu vcpu_info allocation + - smb: client: fix missing mode bits for SMB symlinks + - ksmbd: fix possible deadlock in smb2_open + - drm/i915: Also check for VGA converter in eDP probe + - net: libwx: fix memory leak on msix entry + - drm/amdgpu: correct the amdgpu runtime dereference usage count + - drm/amdgpu: fix memory overflow in the IB test + - drm/amdgpu: Update EEPROM I2C address for smu v13_0_0 + - drm/amd/display: force toggle rate wa for first link training for a retimer + - ACPI: video: Use acpi_video_device for cooling-dev driver data + - iommu/vt-d: Fix incorrect cache invalidation for mm notification + - io_uring: free io_buffer_list entries via RCU + - io_uring: don't guard IORING_OFF_PBUF_RING with SETUP_NO_MMAP + - iommu: Avoid more races around device probe + - ext2: Fix ki_pos update for DIO buffered-io fallback case + - btrfs: free the allocated memory if btrfs_alloc_page_array() fails + - io_uring/kbuf: recycle freed mapped buffer ring entries + - media: v4l2-subdev: Fix a 64bit bug + - netdevsim: Don't accept device bound programs + - net: rswitch: Fix type of ret in rswitch_start_xmit() + - net: rswitch: Fix return value in rswitch_start_xmit() + - net: rswitch: Fix missing dev_kfree_skb_any() in error path + - wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta() + - wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during flush + - net: dsa: mv88e6xxx: fix marvell 6350 switch probing + - dpaa2-eth: recycle the RX buffer only after all processing done + - bpf: Add missed allocation hint for bpf_mem_cache_alloc_flags() + - neighbour: Fix __randomize_layout crash in struct neighbour + - efi/unaccepted: Fix off-by-one when checking for overlapping ranges + - ethtool: don't propagate EOPNOTSUPP from dumps + - bpf, sockmap: af_unix stream sockets need to hold ref for pair sock + - powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR- + IOV device + - s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir + - drm/amd/display: Refactor edp power control + - drm/amd/display: Remove power sequencing check + - drm/i915/gsc: Mark internal GSC engine with reserved uabi class + - drm/panel: starry-2081101qfh032011-53g: Fine tune the panel power sequence + - drm/panel: nt36523: fix return value check in nt36523_probe() + - cpufreq/amd-pstate: Fix scaling_min_freq and scaling_max_freq update + - cpufreq/amd-pstate: Only print supported EPP values for performance governor + - iommu: Fix printk arg in of_iommu_get_resv_regions() + - drm/amd/display: refactor ILR to make it work + - drm/amd/display: Reduce default backlight min from 5 nits to 1 nits + - Upstream stable to v6.1.66, v6.6.5 + + * Mantic update: upstream stable patchset 2024-01-25 (LP: #2051231) + - afs: Fix afs_server_list to be cleaned up with RCU + - afs: Make error on cell lookup failure consistent with OpenAFS + - drm/panel: auo,b101uan08.3: Fine tune the panel power sequence + - drm/panel: simple: Fix Innolux G101ICE-L01 bus flags + - drm/panel: simple: Fix Innolux G101ICE-L01 timings + - wireguard: use DEV_STATS_INC() + - octeontx2-pf: Fix memory leak during interface down + - ata: pata_isapnp: Add missing error check for devm_ioport_map() + - drm/i915: do not clean GT table on error path + - drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full + - HID: fix HID device resource race between HID core and debugging support + - ipv4: Correct/silence an endian warning in __ip_do_redirect + - net: usb: ax88179_178a: fix failed operations during ax88179_reset + - net/smc: avoid data corruption caused by decline + - arm/xen: fix xen_vcpu_info allocation alignment + - octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx + queue than its PF + - amd-xgbe: handle corner-case during sfp hotplug + - amd-xgbe: handle the corner-case during tx completion + - amd-xgbe: propagate the correct speed and duplex status + - net: axienet: Fix check for partial TX checksum + - afs: Return ENOENT if no cell DNS record can be found + - afs: Fix file locking on R/O volumes to operate in local mode + - arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y + - i40e: Fix adding unsupported cloud filters + - nvmet: nul-terminate the NQNs passed in the connect command + - USB: dwc3: qcom: fix resource leaks on probe deferral + - USB: dwc3: qcom: fix ACPI platform device leak + - lockdep: Fix block chain corruption + - cifs: distribute channels across interfaces based on speed + - cifs: account for primary channel in the interface list + - cifs: fix leak of iface for primary channel + - MIPS: KVM: Fix a build warning about variable set but not used + - media: qcom: Initialise V4L2 async notifier later + - media: qcom: camss: Fix V4L2 async notifier error path + - media: qcom: camss: Fix genpd cleanup + - NFSD: Fix "start of NFS reply" pointer passed to nfsd_cache_update() + - NFSD: Fix checksum mismatches in the duplicate reply cache + - ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA + - swiotlb-xen: provide the "max_mapping_size" method + - bcache: replace a mistaken IS_ERR() by IS_ERR_OR_NULL() in + btree_gc_coalesce() + - md: fix bi_status reporting in md_end_clone_io + - bcache: fixup multi-threaded bch_sectors_dirty_init() wake-up race + - io_uring/fs: consider link->flags when getting path for LINKAT + - s390/dasd: protect device queue against concurrent access + - USB: serial: option: add Luat Air72*U series products + - hv_netvsc: fix race of netvsc and VF register_netdevice + - hv_netvsc: Fix race of register_netdevice_notifier and VF register + - hv_netvsc: Mark VF as slave before exposing it to user-mode + - dm-delay: fix a race between delay_presuspend and delay_bio + - bcache: check return value from btree_node_alloc_replacement() + - bcache: prevent potential division by zero error + - bcache: fixup init dirty data errors + - bcache: fixup lock c->root error + - usb: cdnsp: Fix deadlock issue during using NCM gadget + - USB: serial: option: add Fibocom L7xx modules + - USB: serial: option: fix FM101R-GL defines + - USB: serial: option: don't claim interface 4 for ZTE MF290 + - usb: typec: tcpm: Skip hard reset when in error recovery + - USB: dwc2: write HCINT with INTMASK applied + - usb: dwc3: Fix default mode initialization + - usb: dwc3: set the dma max_seg_size + - USB: dwc3: qcom: fix software node leak on probe errors + - USB: dwc3: qcom: fix wakeup after probe deferral + - io_uring: fix off-by one bvec index + - irqchip/gic-v3-its: Flush ITS tables correctly in non-coherent GIC designs + - drm/msm/dsi: use the correct VREG_CTRL_1 value for 4nm cphy + - s390/ism: ism driver implies smc protocol + - rxrpc: Fix RTT determination to use any ACK as a source + - rxrpc: Defer the response to a PING ACK until we've parsed it + - blk-cgroup: avoid to warn !rcu_read_lock_held() in blkg_lookup() + - fs: Pass AT_GETATTR_NOSEC flag to getattr interface function + - net: wangxun: fix kernel panic due to null pointer + - filemap: add a per-mapping stable writes flag + - block: update the stable_writes flag in bdev_add + - PM: tools: Fix sleepgraph syntax error + - net, vrf: Move dstats structure to core + - net: Move {l,t,d}stats allocation to core and convert veth & vrf + - bpf: Fix dev's rx stats for bpf_redirect_peer traffic + - drm/panel: boe-tv101wum-nl6: Fine tune Himax83102-j02 panel HFP and HBP + - s390/ipl: add missing IPL_TYPE_ECKD_DUMP case to ipl_init() + - net: veth: fix ethtool stats reporting + - vsock/test: fix SEQPACKET message bounds test + - net: ipa: fix one GSI register field width + - nvme: blank out authentication fabrics options if not configured + - mm: add a NO_INHERIT flag to the PR_SET_MDWE prctl + - prctl: Disable prctl(PR_SET_MDWE) on parisc + - kselftest/arm64: Fix output formatting for za-fork + - drm/msm/dpu: Add missing safe_lut_tbl in sc8280xp catalog + - drm/ast: Disconnect BMC if physical connector is connected + - thunderbolt: Set lane bonding bit only for downstream port + - ACPI: video: Use acpi_device_fix_up_power_children() + - ACPI: processor_idle: use raw_safe_halt() in acpi_idle_play_dead() + - ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA + - ACPI: PM: Add acpi_device_fix_up_power_children() function + - tls: fix NULL deref on tls_sw_splice_eof() with empty record + - dt-bindings: usb: microchip,usb5744: Add second supply + - usb: misc: onboard-hub: add support for Microchip USB5744 + - platform/x86/amd/pmc: adjust getting DRAM size behavior + - ALSA: hda: ASUS UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus + - ALSA: hda/realtek: Add quirks for ASUS 2024 Zenbooks + - veth: Use tstats per-CPU traffic counters + - USB: xhci-plat: fix legacy PHY double init + - usb: config: fix iteration issue in 'usb_get_bos_descriptor()' + - Upstream stable to v6.1.65, v6.6.4 + + * Mantic update: v6.5.13 upstream stable release (LP: #2051142) + - locking/ww_mutex/test: Fix potential workqueue corruption + - btrfs: abort transaction on generation mismatch when marking eb as dirty + - lib/generic-radix-tree.c: Don't overflow in peek() + - x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN + - perf/core: Bail out early if the request AUX area is out of bound + - srcu: Fix srcu_struct node grpmask overflow on 64-bit systems + - selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config + - clocksource/drivers/timer-imx-gpt: Fix potential memory leak + - clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware + - srcu: Only accelerate on enqueue time + - smp,csd: Throw an error if a CSD lock is stuck for too long + - cpu/hotplug: Don't offline the last non-isolated CPU + - workqueue: Provide one lock class key per work_on_cpu() callsite + - x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size + - wifi: plfxlc: fix clang-specific fortify warning + - wifi: ath12k: Ignore fragments from uninitialized peer in dp + - wifi: mac80211_hwsim: fix clang-specific fortify warning + - wifi: mac80211: don't return unset power in ieee80211_get_tx_power() + - atl1c: Work around the DMA RX overflow issue + - bpf: Detect IP == ksym.end as part of BPF program + - wifi: ath9k: fix clang-specific fortify warnings + - wifi: ath12k: fix possible out-of-bound read in ath12k_htt_pull_ppdu_stats() + - wifi: ath10k: fix clang-specific fortify warning + - wifi: ath12k: fix possible out-of-bound write in + ath12k_wmi_ext_hal_reg_caps() + - ACPI: APEI: Fix AER info corruption when error status data has multiple + sections + - net: sfp: add quirk for Fiberstone GPON-ONU-34-20BI + - wifi: mt76: mt7921e: Support MT7992 IP in Xiaomi Redmibook 15 Pro (2023) + - net: annotate data-races around sk->sk_tx_queue_mapping + - net: annotate data-races around sk->sk_dst_pending_confirm + - wifi: ath12k: mhi: fix potential memory leak in ath12k_mhi_register() + - wifi: ath10k: Don't touch the CE interrupt registers after power up + - net: sfp: add quirk for FS's 2.5G copper SFP + - vsock: read from socket's error queue + - bpf: Ensure proper register state printing for cond jumps + - wifi: iwlwifi: mvm: fix size check for fw_link_id + - Bluetooth: btusb: Add date->evt_skb is NULL check + - Bluetooth: Fix double free in hci_conn_cleanup + - ACPI: EC: Add quirk for HP 250 G7 Notebook PC + - tsnep: Fix tsnep_request_irq() format-overflow warning + - gpiolib: acpi: Add a ignore interrupt quirk for Peaq C1010 + - platform/chrome: kunit: initialize lock for fake ec_dev + - of: address: Fix address translation when address-size is greater than 2 + - platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e + - drm/gma500: Fix call trace when psb_gem_mm_init() fails + - drm/amdkfd: ratelimited SQ interrupt messages + - drm/komeda: drop all currently held locks if deadlock happens + - drm/amd/display: Blank phantom OTG before enabling + - drm/amd/display: Don't lock phantom pipe on disabling + - drm/amd/display: add seamless pipe topology transition check + - drm/edid: Fixup h/vsync_end instead of h/vtotal + - md: don't rely on 'mddev->pers' to be set in mddev_suspend() + - drm/amdgpu: not to save bo in the case of RAS err_event_athub + - drm/amdkfd: Fix a race condition of vram buffer unref in svm code + - drm/amd: Update `update_pcie_parameters` functions to use uint8_t arguments + - drm/amd/display: use full update for clip size increase of large plane + source + - string.h: add array-wrappers for (v)memdup_user() + - kernel: kexec: copy user-array safely + - kernel: watch_queue: copy user-array safely + - drm_lease.c: copy user-array safely + - drm: vmwgfx_surface.c: copy user-array safely + - drm/msm/dp: skip validity check for DP CTS EDID checksum + - drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 + - drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga + - drm/amdgpu: Fix potential null pointer derefernce + - drm/panel: fix a possible null pointer dereference + - drm/panel/panel-tpo-tpg110: fix a possible null pointer dereference + - drm/radeon: fix a possible null pointer dereference + - drm/amdgpu/vkms: fix a possible null pointer dereference + - drm/panel: st7703: Pick different reset sequence + - drm/amdkfd: Fix shift out-of-bounds issue + - drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL + - drm/amd: Disable PP_PCIE_DPM_MASK when dynamic speed switching not supported + - drm/amd/display: fix num_ways overflow error + - drm/amd: check num of link levels when update pcie param + - arm64: dts: ls208xa: use a pseudo-bus to constrain usb dma size + - selftests/efivarfs: create-read: fix a resource leak + - ASoC: mediatek: mt8188-mt6359: support dynamic pinctrl + - ASoC: soc-card: Add storage for PCI SSID + - ASoC: SOF: Pass PCI SSID to machine driver + - crypto: pcrypt - Fix hungtask for PADATA_RESET + - ASoC: SOF: ipc4: handle EXCEPTION_CAUGHT notification from firmware + - RDMA/hfi1: Use FIELD_GET() to extract Link Width + - scsi: hisi_sas: Set debugfs_dir pointer to NULL after removing debugfs + - scsi: ibmvfc: Remove BUG_ON in the case of an empty event pool + - fs/jfs: Add check for negative db_l2nbperpage + - fs/jfs: Add validity check for db_maxag and db_agpref + - jfs: fix array-index-out-of-bounds in dbFindLeaf + - jfs: fix array-index-out-of-bounds in diAlloc + - HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround + - ARM: 9320/1: fix stack depot IRQ stack filter + - ALSA: hda: Fix possible null-ptr-deref when assigning a stream + - gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound + - PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields + - PCI: mvebu: Use FIELD_PREP() with Link Width + - atm: iphase: Do PCI error checks on own line + - PCI: Do error check on own line to split long "if" conditions + - scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup() + - PCI: Use FIELD_GET() to extract Link Width + - PCI: Extract ATS disabling to a helper function + - PCI: Disable ATS for specific Intel IPU E2000 devices + - PCI: dwc: Add dw_pcie_link_set_max_link_width() + - PCI: dwc: Add missing PCI_EXP_LNKCAP_MLW handling + - misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller + - PCI: Use FIELD_GET() in Sapphire RX 5600 XT Pulse quirk + - ASoC: Intel: soc-acpi-cht: Add Lenovo Yoga Tab 3 Pro YT3-X90 quirk + - crypto: hisilicon/qm - prevent soft lockup in receive loop + - HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W + - exfat: support handle zero-size directory + - mfd: intel-lpss: Add Intel Lunar Lake-M PCI IDs + - iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe() + - thunderbolt: Apply USB 3.x bandwidth quirk only in software connection + manager + - tty: vcc: Add check for kstrdup() in vcc_probe() + - dt-bindings: phy: qcom,snps-eusb2-repeater: Add magic tuning overrides + - phy: qualcomm: phy-qcom-eusb2-repeater: Use regmap_fields + - phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs + - usb: dwc3: core: configure TX/RX threshold for DWC3_IP + - usb: ucsi: glink: use the connector orientation GPIO to provide switch + events + - soundwire: dmi-quirks: update HP Omen match + - f2fs: fix error path of __f2fs_build_free_nids + - f2fs: fix error handling of __get_node_page + - usb: host: xhci: Avoid XHCI resume delay if SSUSB device is not present + - usb: gadget: f_ncm: Always set current gadget in ncm_bind() + - 9p/trans_fd: Annotate data-racy writes to file::f_flags + - 9p: v9fs_listxattr: fix %s null argument warning + - i3c: mipi-i3c-hci: Fix out of bounds access in hci_dma_irq_handler + - i2c: i801: Add support for Intel Birch Stream SoC + - i2c: fix memleak in i2c_new_client_device() + - i2c: sun6i-p2wi: Prevent potential division by zero + - virtio-blk: fix implicit overflow on virtio_max_dma_size + - i3c: master: mipi-i3c-hci: Fix a kernel panic for accessing DAT_data. + - media: gspca: cpia1: shift-out-of-bounds in set_flicker + - media: vivid: avoid integer overflow + - media: ipu-bridge: increase sensor_name size + - gfs2: ignore negated quota changes + - gfs2: fix an oops in gfs2_permission + - media: cobalt: Use FIELD_GET() to extract Link Width + - media: ccs: Fix driver quirk struct documentation + - media: imon: fix access to invalid resource for the second interface + - drm/amd/display: Avoid NULL dereference of timing generator + - kgdb: Flush console before entering kgdb on panic + - riscv: VMAP_STACK overflow detection thread-safe + - i2c: dev: copy userspace array safely + - ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings + - drm/qxl: prevent memory leak + - ALSA: hda/realtek: Add quirk for ASUS UX7602ZM + - drm/amdgpu: fix software pci_unplug on some chips + - pwm: Fix double shift bug + - mtd: rawnand: tegra: add missing check for platform_get_irq() + - wifi: iwlwifi: Use FW rate for non-data frames + - sched/core: Optimize in_task() and in_interrupt() a bit + - samples/bpf: syscall_tp_user: Rename num_progs into nr_tests + - samples/bpf: syscall_tp_user: Fix array out-of-bound access + - dt-bindings: serial: fix regex pattern for matching serial node children + - SUNRPC: ECONNRESET might require a rebind + - mtd: rawnand: intel: check return value of devm_kasprintf() + - mtd: rawnand: meson: check return value of devm_kasprintf() + - drm/i915/mtl: avoid stringop-overflow warning + - NFSv4.1: fix handling NFS4ERR_DELAY when testing for session trunking + - SUNRPC: Add an IS_ERR() check back to where it was + - NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO + - SUNRPC: Fix RPC client cleaned up the freed pipefs dentries + - RISC-V: hwprobe: Fix vDSO SIGSEGV + - riscv: provide riscv-specific is_trap_insn() + - gfs2: Silence "suspicious RCU usage in gfs2_permission" warning + - drm/i915/tc: Fix -Wformat-truncation in intel_tc_port_init + - vdpa_sim_blk: allocate the buffer zeroed + - vhost-vdpa: fix use after free in vhost_vdpa_probe() + - gcc-plugins: randstruct: Only warn about true flexible arrays + - bpf: handle ldimm64 properly in check_cfg() + - bpf: fix precision backtracking instruction iteration + - net: set SOCK_RCU_FREE before inserting socket into hashtable + - ipvlan: add ipvlan_route_v6_outbound() helper + - tty: Fix uninit-value access in ppp_sync_receive() + - xen/events: avoid using info_for_irq() in xen_send_IPI_one() + - net: hns3: fix add VLAN fail issue + - net: hns3: add barrier in vf mailbox reply process + - net: hns3: fix incorrect capability bit display for copper port + - net: hns3: fix out-of-bounds access may occur when coalesce info is read via + debugfs + - net: hns3: fix variable may not initialized problem in hns3_init_mac_addr() + - net: hns3: fix VF reset fail issue + - net: hns3: fix VF wrong speed and duplex issue + - tipc: Fix kernel-infoleak due to uninitialized TLV value + - net: mvneta: fix calls to page_pool_get_stats + - ppp: limit MRU to 64K + - xen/events: fix delayed eoi list handling + - blk-mq: make sure active queue usage is held for bio_integrity_prep() + - ptp: annotate data-race around q->head and q->tail + - bonding: stop the device in bond_setup_by_slave() + - net: ethernet: cortina: Fix max RX frame define + - net: ethernet: cortina: Handle large frames + - net: ethernet: cortina: Fix MTU max setting + - af_unix: fix use-after-free in unix_stream_read_actor() + - netfilter: nf_conntrack_bridge: initialize err to 0 + - netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval() + - netfilter: nf_tables: bogus ENOENT when destroying element which does not + exist + - net: stmmac: fix rx budget limit check + - net: stmmac: avoid rx queue overrun + - pds_core: use correct index to mask irq + - pds_core: fix up some format-truncation complaints + - gve: Fixes for napi_poll when budget is 0 + - io_uring/fdinfo: remove need for sqpoll lock for thread/pid retrieval + - net/mlx5: Decouple PHC .adjtime and .adjphase implementations + - net/mlx5e: fix double free of encap_header + - net/mlx5e: fix double free of encap_header in update funcs + - net/mlx5e: Fix pedit endianness + - net/mlx5: Consolidate devlink documentation in devlink/mlx5.rst + - net/mlx5e: Make tx_port_ts logic resilient to out-of-order CQEs + - net/mlx5e: Add recovery flow for tx devlink health reporter for unhealthy + PTP SQ + - net/mlx5e: Update doorbell for port timestamping CQ before the software + counter + - net/mlx5: Increase size of irq name buffer + - net/mlx5e: Reduce the size of icosq_str + - net/mlx5e: Check return value of snprintf writing to fw_version buffer + - net/mlx5e: Check return value of snprintf writing to fw_version buffer for + representors + - net: sched: do not offload flows with a helper in act_ct + - macvlan: Don't propagate promisc change to lower dev in passthru + - tools/power/turbostat: Fix a knl bug + - tools/power/turbostat: Enable the C-state Pre-wake printing + - scsi: ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1 + - cifs: spnego: add ';' in HOST_KEY_LEN + - cifs: fix check of rc in function generate_smb3signingkey + - perf/core: Fix cpuctx refcounting + - i915/perf: Fix NULL deref bugs with drm_dbg() calls + - perf: arm_cspmu: Reject events meant for other PMUs + - drivers: perf: Check find_first_bit() return value + - media: venus: hfi: add checks to perform sanity on queue pointers + - perf intel-pt: Fix async branch flags + - powerpc/perf: Fix disabling BHRB and instruction sampling + - randstruct: Fix gcc-plugin performance mode to stay in group + - bpf: Fix check_stack_write_fixed_off() to correctly spill imm + - bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END + - scsi: mpt3sas: Fix loop logic + - scsi: megaraid_sas: Increase register read retry rount from 3 to 30 for + selected registers + - scsi: ufs: qcom: Update PHY settings only when scaling to higher gears + - scsi: qla2xxx: Fix system crash due to bad pointer access + - scsi: ufs: core: Fix racing issue between ufshcd_mcq_abort() and ISR + - crypto: x86/sha - load modules based on CPU features + - x86/PCI: Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 + - x86/apic/msi: Fix misconfigured non-maskable MSI quirk + - x86/cpu/hygon: Fix the CPU topology evaluation for real + - KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space + - KVM: x86: Ignore MSR_AMD64_TW_CFG access + - KVM: x86: Clear bit12 of ICR after APIC-write VM-exit + - KVM: x86: Fix lapic timer interrupt lost after loading a snapshot. + - mmc: sdhci-pci-gli: GL9755: Mask the replay timer timeout of AER + - sched: psi: fix unprivileged polling against cgroups + - audit: don't take task_lock() in audit_exe_compare() code path + - audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() + - proc: sysctl: prevent aliased sysctls from getting passed to init + - tty/sysrq: replace smp_processor_id() with get_cpu() + - tty: serial: meson: fix hard LOCKUP on crtscts mode + - hvc/xen: fix console unplug + - hvc/xen: fix error path in xen_hvc_init() to always register frontend driver + - hvc/xen: fix event channel handling for secondary consoles + - PCI/sysfs: Protect driver's D3cold preference from user space + - mm/damon/sysfs: remove requested targets when online-commit inputs + - mm/damon/sysfs: update monitoring target regions for online input commit + - watchdog: move softlockup_panic back to early_param + - iommufd: Fix missing update of domains_itree after splitting iopt_area + - fbdev: stifb: Make the STI next font pointer a 32-bit signed offset + - dm crypt: account large pages in cc->n_allocated_pages + - mm/damon/lru_sort: avoid divide-by-zero in hot threshold calculation + - mm/damon/ops-common: avoid divide-by-zero during region hotness calculation + - mm/damon: implement a function for max nr_accesses safe calculation + - mm/damon/core: avoid divide-by-zero during monitoring results update + - mm/damon/sysfs-schemes: handle tried region directory allocation failure + - mm/damon/sysfs-schemes: handle tried regions sysfs directory allocation + failure + - mm/damon/sysfs: check error from damon_sysfs_update_target() + - parisc: Add nop instructions after TLB inserts + - ACPI: resource: Do IRQ override on TongFang GMxXGxx + - regmap: Ensure range selector registers are updated after cache sync + - wifi: ath11k: fix temperature event locking + - wifi: ath11k: fix dfs radar event locking + - wifi: ath11k: fix htt pktlog locking + - wifi: ath11k: fix gtk offload status event locking + - wifi: ath12k: fix htt mlo-offset event locking + - wifi: ath12k: fix dfs-radar and temperature event locking + - mmc: meson-gx: Remove setting of CMD_CFG_ERROR + - genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware + - sched/core: Fix RQCF_ACT_SKIP leak + - KEYS: trusted: tee: Refactor register SHM usage + - KEYS: trusted: Rollback init_trusted() consistently + - PCI: keystone: Don't discard .remove() callback + - PCI: keystone: Don't discard .probe() callback + - arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer + - arm64: module: Fix PLT counting when CONFIG_RANDOMIZE_BASE=n + - parisc/agp: Use 64-bit LE values in SBA IOMMU PDIR table + - parisc/pdc: Add width field to struct pdc_model + - parisc/power: Add power soft-off when running on qemu + - cpufreq: stats: Fix buffer overflow detection in trans_stats() + - powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() + - clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data + - clk: visconti: Fix undefined behavior bug in struct visconti_pll_provider + - clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks + - clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks + - ksmbd: fix recursive locking in vfs helpers + - ksmbd: handle malformed smb1 message + - ksmbd: fix slab out of bounds write in smb_inherit_dacl() + - mmc: vub300: fix an error code + - mmc: sdhci_am654: fix start loop index for TAP value parsing + - mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A + - PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() + - PCI: kirin: Don't discard .remove() callback + - PCI: exynos: Don't discard .remove() callback + - wifi: wilc1000: use vmm_table as array in wilc struct + - svcrdma: Drop connection after an RDMA Read error + - rcu/tree: Defer setting of jiffies during stall reset + - arm64: dts: qcom: ipq6018: Fix hwlock index for SMEM + - dt-bindings: timer: renesas,rz-mtu3: Fix overflow/underflow interrupt names + - PM: hibernate: Use __get_safe_page() rather than touching the list + - PM: hibernate: Clean up sync_read handling in snapshot_write_next() + - rcu: kmemleak: Ignore kmemleak false positives when RCU-freeing objects + - btrfs: don't arbitrarily slow down delalloc if we're committing + - thermal: intel: powerclamp: fix mismatch in get function for max_idle + - arm64: dts: qcom: ipq5332: Fix hwlock index for SMEM + - arm64: dts: qcom: ipq8074: Fix hwlock index for SMEM + - firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit + - ACPI: FPDT: properly handle invalid FPDT subtables + - arm64: dts: qcom: ipq9574: Fix hwlock index for SMEM + - arm64: dts: qcom: ipq6018: Fix tcsr_mutex register size + - leds: trigger: netdev: Move size check in set_device_name + - mfd: qcom-spmi-pmic: Fix reference leaks in revid helper + - mfd: qcom-spmi-pmic: Fix revid implementation + - ima: annotate iint mutex to avoid lockdep false positive warnings + - ima: detect changes to the backing overlay file + - netfilter: nf_tables: split async and sync catchall in two functions + - ASoC: soc-dai: add flag to mute and unmute stream during trigger + - ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag + - selftests/resctrl: Fix uninitialized .sa_flags + - selftests/resctrl: Remove duplicate feature check from CMT test + - selftests/resctrl: Move _GNU_SOURCE define into Makefile + - selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests + - hid: lenovo: Resend all settings on reset_resume for compact keyboards + - ASoC: codecs: wsa-macro: fix uninitialized stack variables with name prefix + - jbd2: fix potential data lost in recovering journal raced with synchronizing + fs bdev + - quota: explicitly forbid quota files from being encrypted + - kernel/reboot: emergency_restart: Set correct system_state + - i2c: core: Run atomic i2c xfer when !preemptible + - selftests/clone3: Fix broken test under !CONFIG_TIME_NS + - tracing: Have the user copy of synthetic event address use correct context + - driver core: Release all resources during unbind before updating device + links + - mcb: fix error handling for different scenarios when parsing + - dmaengine: stm32-mdma: correct desc prep when channel running + - s390/mm: add missing arch_set_page_dat() call to vmem_crst_alloc() + - s390/cmma: fix detection of DAT pages + - mm/cma: use nth_page() in place of direct struct page manipulation + - mm/memory_hotplug: use pfn math in place of direct struct page manipulation + - mm: make PR_MDWE_REFUSE_EXEC_GAIN an unsigned long + - mtd: cfi_cmdset_0001: Byte swap OTP info + - cxl/region: Do not try to cleanup after cxl_region_setup_targets() fails + - i3c: master: cdns: Fix reading status register + - i3c: master: svc: fix race condition in ibi work thread + - i3c: master: svc: fix wrong data return when IBI happen during start frame + - i3c: master: svc: fix ibi may not return mandatory data byte + - i3c: master: svc: fix check wrong status register in irq handler + - i3c: master: svc: fix SDA keep low when polling IBIWON timeout happen + - i3c: master: svc: fix random hot join failure since timeout error + - cxl/region: Fix x1 root-decoder granularity calculations + - cxl/port: Fix delete_endpoint() vs parent unregistration race + - pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable + - pmdomain: amlogic: Fix mask for the second NNA mem PD domain + - pmdomain: imx: Make imx pgc power domain also set the fwnode + - PCI: qcom-ep: Add dedicated callback for writing to DBI2 registers + - PCI: Lengthen reset delay for VideoPropulsion Torrent QN16e card + - torture: Add a kthread-creation callback to _torture_create_kthread() + - torture: Add lock_torture writer_fifo module parameter + - torture: Make torture_hrtimeout_*() use TASK_IDLE + - torture: Move stutter_wait() timeouts to hrtimers + - torture: Make torture_hrtimeout_ns() take an hrtimer mode parameter + - rcutorture: Fix stuttering races and other issues + - mm/hugetlb: prepare hugetlb_follow_page_mask() for FOLL_PIN + - mm/hugetlb: use nth_page() in place of direct struct page manipulation + - parisc: Prevent booting 64-bit kernels on PA1.x machines + - parisc/pgtable: Do not drop upper 5 address bits of physical address + - parisc/power: Fix power soft-off when running on qemu + - xhci: Enable RPM on controllers that support low-power states + - fs: add ctime accessors infrastructure + - smb3: fix creating FIFOs when mounting with "sfu" mount option + - smb3: fix touch -h of symlink + - smb3: allow dumping session and tcon id to improve stats analysis and + debugging + - smb3: fix caching of ctime on setxattr + - smb: client: fix use-after-free bug in cifs_debug_data_proc_show() + - smb: client: fix use-after-free in smb2_query_info_compound() + - smb: client: fix potential deadlock when releasing mids + - cifs: reconnect helper should set reconnect for the right channel + - cifs: force interface update before a fresh session setup + - cifs: do not reset chan_max if multichannel is not supported at mount + - cifs: Fix encryption of cleared, but unset rq_iter data buffers + - xfs: recovery should not clear di_flushiter unconditionally + - btrfs: zoned: wait for data BG to be finished on direct IO allocation + - ALSA: info: Fix potential deadlock at disconnection + - ALSA: hda/realtek: Enable Mute LED on HP 255 G8 + - ALSA: hda/realtek - Add Dell ALC295 to pin fall back table + - ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC + - ALSA: hda/realtek: Enable Mute LED on HP 255 G10 + - ALSA: hda/realtek: Add quirks for HP Laptops + - Revert ncsi: Propagate carrier gain/loss events to the NCSI controller + - Revert "i2c: pxa: move to generic GPIO recovery" + - lsm: fix default return value for vm_enough_memory + - lsm: fix default return value for inode_getsecctx + - sbsa_gwdt: Calculate timeout with 64-bit math + - i2c: designware: Disable TX_EMPTY irq while waiting for block length byte + - s390/ap: fix AP bus crash on early config change callback invocation + - net: ethtool: Fix documentation of ethtool_sprintf() + - net: dsa: lan9303: consequently nested-lock physical MDIO + - net: phylink: initialize carrier state at creation + - gfs2: don't withdraw if init_threads() got interrupted + - i2c: i801: fix potential race in i801_block_transaction_byte_by_byte + - f2fs: do not return EFSCORRUPTED, but try to run online repair + - f2fs: set the default compress_level on ioctl + - f2fs: avoid format-overflow warning + - f2fs: split initial and dynamic conditions for extent_cache + - media: lirc: drop trailing space from scancode transmit + - media: sharp: fix sharp encoding + - media: venus: hfi_parser: Add check to keep the number of codecs within + range + - media: venus: hfi: fix the check to handle session buffer requirement + - media: venus: hfi: add checks to handle capabilities from firmware + - media: ccs: Correctly initialise try compose rectangle + - drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection + - drm/mediatek/dp: fix memory leak on ->get_edid callback error path + - dm-bufio: fix no-sleep mode + - dm-verity: don't use blocking calls from tasklets + - nfsd: fix file memleak on client_opens_release + - NFSD: Update nfsd_cache_append() to use xdr_stream + - LoongArch: Mark __percpu functions as always inline + - riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause + - riscv: put interrupt entries into .irqentry.text + - riscv: mm: Update the comment of CONFIG_PAGE_OFFSET + - riscv: correct pt_level name via pgtable_l5/4_enabled + - riscv: kprobes: allow writing to x0 + - mmc: sdhci-pci-gli: A workaround to allow GL9750 to enter ASPM L1.2 + - mm: fix for negative counter: nr_file_hugepages + - mm: kmem: drop __GFP_NOFAIL when allocating objcg vectors + - mptcp: deal with large GSO size + - mptcp: add validity check for sending RM_ADDR + - mptcp: fix setsockopt(IP_TOS) subflow locking + - selftests: mptcp: fix fastclose with csum failure + - mmc: sdhci-pci-gli: GL9750: Mask the replay timer timeout of AER + - media: qcom: camss: Fix pm_domain_on sequence in probe + - media: qcom: camss: Fix vfe_get() error jump + - media: qcom: camss: Fix VFE-17x vfe_disable_output() + - media: qcom: camss: Fix VFE-480 vfe_disable_output() + - media: qcom: camss: Fix missing vfe_lite clocks check + - media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3 + - media: qcom: camss: Fix invalid clock enable bit disjunction + - media: qcom: camss: Fix csid-gen2 for test pattern generator + - ext4: fix race between writepages and remount + - ext4: make sure allocate pending entry not fail + - ext4: apply umask if ACL support is disabled + - ext4: correct offset of gdb backup in non meta_bg group to update_backups + - ext4: mark buffer new if it is unwritten to avoid stale data exposure + - ext4: correct return value of ext4_convert_meta_bg + - ext4: correct the start block of counting reserved clusters + - ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks + - ext4: add missed brelse in update_backups + - ext4: properly sync file size update after O_SYNC direct IO + - ext4: fix racy may inline data check in dio write + - drm/amd/pm: Handle non-terminated overdrive commands. + - drm: bridge: it66121: ->get_edid callback must not return err pointers + - drm/i915/mtl: Support HBR3 rate with C10 phy and eDP in MTL + - drm/i915: Bump GLK CDCLK frequency when driving multiple pipes + - drm/i915: Fix potential spectre vulnerability + - drm/i915: Flush WC GGTT only on required platforms + - drm/amdgpu/smu13: drop compute workload workaround + - drm/amdgpu: don't use pci_is_thunderbolt_attached() + - drm/amdgpu: fix GRBM read timeout when do mes_self_test + - drm/amdgpu: add a retry for IP discovery init + - drm/amdgpu: don't use ATRM for external devices + - drm/amdgpu: fix error handling in amdgpu_vm_init + - drm/amdgpu: fix error handling in amdgpu_bo_list_get() + - drm/amdgpu: lower CS errors to debug severity + - drm/amdgpu: Fix possible null pointer dereference + - drm/amd/display: Guard against invalid RPTR/WPTR being set + - drm/amd/display: Fix DSC not Enabled on Direct MST Sink + - drm/amd/display: fix a NULL pointer dereference in amdgpu_dm_i2c_xfer() + - drm/amd/display: Enable fast plane updates on DCN3.2 and above + - drm/amd/display: Change the DMCUB mailbox memory location from FB to inbox + - powerpc/powernv: Fix fortify source warnings in opal-prd.c + - tracing: Have trace_event_file have ref counters + - net/mlx5e: Avoid referencing skb after free-ing in drop path of + mlx5e_sq_xmit_wqe + - net/mlx5e: Track xmit submission to PTP WQ after populating metadata map + - Linux 6.5.13 + + * Mantic update: v6.5.12 upstream stable release (LP: #2051129) + - hwmon: (nct6775) Fix incorrect variable reuse in fan_div calculation + - numa: Generalize numa_map_to_online_node() + - sched/topology: Fix sched_numa_find_nth_cpu() in CPU-less case + - sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case + - sched/fair: Fix cfs_rq_is_decayed() on !SMP + - iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user() + - sched/uclamp: Set max_spare_cap_cpu even if max_spare_cap is 0 + - sched/uclamp: Ignore (util == 0) optimization in feec() when p_util_max = 0 + - objtool: Propagate early errors + - sched: Fix stop_one_cpu_nowait() vs hotplug + - nfsd: Handle EOPENSTALE correctly in the filecache + - vfs: fix readahead(2) on block devices + - writeback, cgroup: switch inodes with dirty timestamps to release dying + cgwbs + - x86/srso: Fix SBPB enablement for (possible) future fixed HW + - x86/srso: Print mitigation for retbleed IBPB case + - x86/srso: Fix vulnerability reporting for missing microcode + - x86/srso: Fix unret validation dependencies + - futex: Don't include process MM in futex key on no-MMU + - x86/numa: Introduce numa_fill_memblks() + - ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window + - x86/sev-es: Allow copy_from_kernel_nofault() in earlier boot + - x86/boot: Fix incorrect startup_gdt_descr.size + - cpu/hotplug: Remove dependancy against cpu_primary_thread_mask + - cpu/SMT: Create topology_smt_thread_allowed() + - cpu/SMT: Make SMT control more robust against enumeration failures + - x86/apic: Fake primary thread mask for XEN/PV + - srcu: Fix callbacks acceleration mishandling + - drivers/clocksource/timer-ti-dm: Don't call clk_get_rate() in stop function + - x86/nmi: Fix out-of-order NMI nesting checks & false positive warning + - pstore/platform: Add check for kstrdup + - perf: Optimize perf_cgroup_switch() + - selftests/x86/lam: Zero out buffer for readlink() + - PCI/MSI: Provide stubs for IMS functions + - string: Adjust strtomem() logic to allow for smaller sources + - genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() + - irqchip/sifive-plic: Fix syscore registration for multi-socket systems + - wifi: ath12k: fix undefined behavior with __fls in dp + - wifi: cfg80211: add flush functions for wiphy work + - wifi: mac80211: move radar detect work to wiphy work + - wifi: mac80211: move scan work to wiphy work + - wifi: mac80211: move offchannel works to wiphy work + - wifi: mac80211: move sched-scan stop work to wiphy work + - wifi: mac80211: fix RCU usage warning in mesh fast-xmit + - wifi: cfg80211: fix off-by-one in element defrag + - wifi: mac80211: fix # of MSDU in A-MSDU calculation + - wifi: iwlwifi: honor the enable_ini value + - wifi: iwlwifi: don't use an uninitialized variable + - i40e: fix potential memory leaks in i40e_remove() + - iavf: Fix promiscuous mode configuration flow messages + - selftests/bpf: Correct map_fd to data_fd in tailcalls + - bpf, x86: save/restore regs with BPF_DW size + - bpf, x86: allow function arguments up to 12 for TRACING + - bpf, x64: Fix tailcall infinite loop + - wifi: cfg80211: fix kernel-doc for wiphy_delayed_work_flush() + - udp: introduce udp->udp_flags + - udp: move udp->no_check6_tx to udp->udp_flags + - udp: move udp->no_check6_rx to udp->udp_flags + - udp: move udp->gro_enabled to udp->udp_flags + - udp: add missing WRITE_ONCE() around up->encap_rcv + - udp: move udp->accept_udp_{l4|fraglist} to udp->udp_flags + - udp: lockless UDP_ENCAP_L2TPINUDP / UDP_GRO + - udp: annotate data-races around udp->encap_type + - udplite: remove UDPLITE_BIT + - udplite: fix various data-races + - selftests/bpf: Skip module_fentry_shadow test when bpf_testmod is not + available + - tcp: call tcp_try_undo_recovery when an RTOd TFO SYNACK is ACKed + - bpf: Fix kfunc callback register type handling + - gve: Use size_add() in call to struct_size() + - mlxsw: Use size_mul() in call to struct_size() + - tls: Use size_add() in call to struct_size() + - tipc: Use size_add() in calls to struct_size() + - net: spider_net: Use size_add() in call to struct_size() + - net: ethernet: mtk_wed: fix EXT_INT_STATUS_RX_FBUF definitions for MT7986 + SoC + - wifi: rtw88: debug: Fix the NULL vs IS_ERR() bug for debugfs_create_file() + - wifi: ath12k: fix DMA unmap warning on NULL DMA address + - wifi: ath11k: fix boot failure with one MSI vector + - wifi: mac80211: fix check for unusable RX result + - PM: sleep: Fix symbol export for _SIMPLE_ variants of _PM_OPS() + - cpufreq: tegra194: fix warning due to missing opp_put + - wifi: mt76: mt7603: rework/fix rx pse hang check + - wifi: mt76: mt7603: improve watchdog reset reliablity + - wifi: mt76: mt7603: improve stuck beacon handling + - wifi: mt76: connac: move connac3 definitions in mt76_connac3_mac.h + - wifi: mt76: remove unused error path in mt76_connac_tx_complete_skb + - wifi: mt76: mt7996: set correct wcid in txp + - wifi: mt76: mt7996: fix beamform mcu cmd configuration + - wifi: mt76: mt7996: fix beamformee ss subfield in EHT PHY cap + - wifi: mt76: mt7996: fix wmm queue mapping + - wifi: mt76: mt7996: fix rx rate report for CBW320-2 + - wifi: mt76: mt7996: fix TWT command format + - wifi: mt76: update beacon size limitation + - wifi: mt76: fix potential memory leak of beacon commands + - wifi: mt76: get rid of false alamrs of tx emission issues + - wifi: mt76: fix per-band IEEE80211_CONF_MONITOR flag comparison + - wifi: mt76: mt7915: fix beamforming availability check + - wifi: ath: dfs_pattern_detector: Fix a memory initialization issue + - tcp_metrics: add missing barriers on delete + - tcp_metrics: properly set tp->snd_ssthresh in tcp_init_metrics() + - tcp_metrics: do not create an entry from tcp_init_metrics() + - wifi: rtlwifi: fix EDCA limit set by BT coexistence + - ACPI: property: Allow _DSD buffer data only for byte accessors + - ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100 + - can: etas_es58x: rework the version check logic to silence -Wformat- + truncation + - can: etas_es58x: add missing a blank line after declaration + - wifi: ath11k: fix Tx power value during active CAC + - can: dev: can_restart(): don't crash kernel if carrier is OK + - can: dev: can_restart(): fix race condition between controller restart and + netif_carrier_on() + - can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is + accessed out of bounds + - PM / devfreq: rockchip-dfi: Make pmu regmap mandatory + - wifi: wfx: fix case where rates are out of order + - netfilter: nf_tables: Drop pointless memset when dumping rules + - wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() + - thermal: core: prevent potential string overflow + - r8169: fix rare issue with broken rx after link-down on RTL8125 + - thermal/drivers/mediatek: Fix probe for THERMAL_V2 + - bpf: Fix missed rcu read lock in bpf_task_under_cgroup() + - selftests: netfilter: test for sctp collision processing in nf_conntrack + - net: skb_find_text: Ignore patterns extending past 'to' + - thermal: core: Don't update trip points inside the hysteresis range + - chtls: fix tp->rcv_tstamp initialization + - tcp: fix cookie_init_timestamp() overflows + - wifi: iwlwifi: mvm: update station's MFP flag after association + - wifi: iwlwifi: mvm: fix removing pasn station for responder + - wifi: iwlwifi: mvm: use correct sta ID for IGTK/BIGTK + - wifi: mac80211: don't recreate driver link debugfs in reconfig + - wifi: mac80211: Fix setting vif links + - wifi: iwlwifi: yoyo: swap cdb and jacket bits values + - wifi: iwlwifi: mvm: Correctly set link configuration + - wifi: iwlwifi: mvm: Fix key flags for IGTK on AP interface + - wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface + - wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API + - wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta() + - wifi: iwlwifi: mvm: remove TDLS stations from FW + - wifi: iwlwifi: increase number of RX buffers for EHT devices + - wifi: iwlwifi: mvm: fix netif csum flags + - wifi: iwlwifi: pcie: synchronize IRQs before NAPI + - wifi: iwlwifi: mvm: update IGTK in mvmvif upon D3 resume + - wifi: iwlwifi: empty overflow queue during flush + - Bluetooth: ISO: Use defer setup to separate PA sync and BIG sync + - Bluetooth: ISO: Pass BIG encryption info through QoS + - Bluetooth: Make handle of hci_conn be unique + - Bluetooth: hci_sync: Fix Opcode prints in bt_dev_dbg/err + - bpf: Fix unnecessary -EBUSY from htab_lock_bucket + - ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() + - mptcp: properly account fastopen data + - ipv6: avoid atomic fragment on GSO packets + - virtio_net: use u64_stats_t infra to avoid data-races + - net: add DEV_STATS_READ() helper + - ipvlan: properly track tx_errors + - regmap: debugfs: Fix a erroneous check after snprintf() + - spi: tegra: Fix missing IRQ check in tegra_slink_probe() + - clk: qcom: ipq5332: Drop set rate parent from gpll0 dependent clocks + - clk: qcom: gcc-msm8996: Remove RPM bus clocks + - clk: qcom: clk-rcg2: Fix clock rate overflow for high parent frequencies + - clk: qcom: mmcc-msm8998: Don't check halt bit on some branch clks + - clk: qcom: mmcc-msm8998: Fix the SMMU GDSC + - clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src + - regulator: mt6358: Fail probe on unknown chip ID + - clk: imx: Select MXC_CLK for CLK_IMX8QXP + - clk: imx: imx8mq: correct error handling path + - clk: imx: imx8qxp: Fix elcdif_pll clock + - clk: renesas: rcar-gen3: Extend SDnH divider table + - clk: renesas: rzg2l: Wait for status bit of SD mux before continuing + - clk: renesas: rzg2l: Lock around writes to mux register + - clk: renesas: rzg2l: Trust value returned by hardware + - clk: renesas: rzg2l: Use FIELD_GET() for PLL register fields + - clk: renesas: rzg2l: Fix computation formula + - clk: linux/clk-provider.h: fix kernel-doc warnings and typos + - spi: nxp-fspi: use the correct ioremap function + - clk: ralink: mtmips: quiet unused variable warning + - clk: keystone: pll: fix a couple NULL vs IS_ERR() checks + - clk: ti: fix double free in of_ti_divider_clk_setup() + - clk: npcm7xx: Fix incorrect kfree + - clk: mediatek: clk-mt6765: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt6779: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt6797: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt7629-eth: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt7629: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data + - clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM + - clk: qcom: clk-alpha-pll: introduce stromer plus ops + - clk: qcom: apss-ipq-pll: Use stromer plus ops for stromer plus pll + - clk: qcom: apss-ipq-pll: Fix 'l' value for ipq5332_pll_config + - clk: qcom: ipq9574: drop the CLK_SET_RATE_PARENT flag from GPLL clocks + - clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks + - clk: mediatek: fix double free in mtk_clk_register_pllfh() + - platform/x86: wmi: Fix probe failure when failing to register WMI devices + - platform/x86: wmi: Fix opening of char device + - regulator: qcom-rpmh: Fix smps4 regulator for pm8550ve + - hwmon: (axi-fan-control) Fix possible NULL pointer dereference + - hwmon: (coretemp) Fix potentially truncated sysfs attribute name + - Revert "hwmon: (sch56xx-common) Add DMI override table" + - Revert "hwmon: (sch56xx-common) Add automatic module loading on supported + devices" + - hwmon: (sch5627) Use bit macros when accessing the control register + - hwmon: (sch5627) Disallow write access if virtual registers are locked + - hte: tegra: Fix missing error code in tegra_hte_test_probe() + - platform/chrome: cros_ec_lpc: Separate host command and irq disable + - spi: omap2-mcspi: remove redundant dev_err_probe() + - spi: omap2-mcspi: switch to use modern name + - spi: omap2-mcspi: Fix hardcoded reference clock + - drm: bridge: samsung-dsim: Initialize ULPS EXIT for i.MX8M DSIM + - drm: bridge: for GENERIC_PHY_MIPI_DPHY also select GENERIC_PHY + - drm: bridge: samsung-dsim: Fix waiting for empty cmd transfer FIFO on older + Exynos + - drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs + - drm/rockchip: vop: Fix call to crtc reset helper + - drm/rockchip: vop2: Don't crash for invalid duplicate_state + - drm/rockchip: vop2: Add missing call to crtc reset helper + - drm/radeon: possible buffer overflow + - drm: bridge: it66121: Fix invalid connector dereference + - drm/bridge: lt8912b: Fix bridge_detach + - drm/bridge: lt8912b: Fix crash on bridge detach + - drm/bridge: lt8912b: Manually disable HPD only if it was enabled + - drm/bridge: lt8912b: Add missing drm_bridge_attach call + - drm/mediatek: Fix coverity issue with unintentional integer overflow + - x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro + - drm/bridge: tc358768: Fix use of uninitialized variable + - drm/bridge: tc358768: Fix bit updates + - drm/bridge: tc358768: Use struct videomode + - drm/bridge: tc358768: Print logical values, not raw register values + - drm/bridge: tc358768: Use dev for dbg prints, not priv->dev + - drm/bridge: tc358768: Rename dsibclk to hsbyteclk + - drm/bridge: tc358768: Clean up clock period code + - drm/bridge: tc358768: Fix tc358768_ns_to_cnt() + - drm/aspeed: Convert to platform remove callback returning void + - drm/stm: Convert to platform remove callback returning void + - drm/tve200: Convert to platform remove callback returning void + - drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc + drivers + - drm/amdgpu: Increase IH soft ring size for GFX v9.4.3 dGPU + - drm/amdkfd: fix some race conditions in vram buffer alloc/free of svm code + - drm/amdkfd: retry after EBUSY is returned from hmm_ranges_get_pages + - drm/amdkfd: Remove svm range validated_once flag + - drm/amdkfd: Handle errors from svm validate and map + - drm/amd/display: Fix null pointer dereference in error message + - drm/amd/display: Check all enabled planes in dm_check_crtc_cursor + - drm/amd/display: Refactor dm_get_plane_scale helper + - drm/amd/display: Bail from dm_check_crtc_cursor if no relevant change + - io_uring/kbuf: Fix check of BID wrapping in provided buffers + - io_uring/kbuf: Allow the full buffer id space for provided buffers + - drm/mediatek: Add mmsys_dev_num to mt8188 vdosys0 driver data + - drm/mediatek: Fix iommu fault by swapping FBs after updating plane state + - drm/mediatek: Fix iommu fault during crtc enabling + - accel/habanalabs/gaudi2: Fix incorrect string length computation in + gaudi2_psoc_razwi_get_engines() + - drm/rockchip: cdn-dp: Fix some error handling paths in cdn_dp_probe() + - gpu: host1x: Correct allocated size for contexts + - drm/bridge: lt9611uxc: fix the race in the error path + - arm64/arm: xen: enlighten: Fix KPTI checks + - drm/rockchip: Fix type promotion bug in rockchip_gem_iommu_map() + - xenbus: fix error exit in xenbus_init() + - xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled + - drm/msm/dsi: use msm_gem_kernel_put to free TX buffer + - drm/msm/dsi: free TX buffer in unbind + - clocksource/drivers/arm_arch_timer: limit XGene-1 workaround + - drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling + - drivers/perf: hisi: use cpuhp_state_remove_instance_nocalls() for + hisi_hns3_pmu uninit process + - drm/amd/pm: Fix a memory leak on an error path + - perf/arm-cmn: Fix DTC domain detection + - drivers/perf: hisi_pcie: Check the type first in pmu::event_init() + - perf: hisi: Fix use-after-free when register pmu fails + - ARM: dts: renesas: blanche: Fix typo in GP_11_2 pin name + - arm64: dts: qcom: sdm845: Fix PSCI power domain names + - arm64: dts: qcom: sdm845: cheza doesn't support LMh node + - arm64: dts: qcom: sc7280: link usb3_phy_wrapper_gcc_usb30_pipe_clk + - arm64: dts: qcom: msm8916: Fix iommu local address range + - arm64: dts: qcom: msm8992-libra: drop duplicated reserved memory + - arm64: dts: qcom: sm6125: Pad APPS IOMMU address to 8 characters + - arm64: dts: qcom: sc7280: Add missing LMH interrupts + - arm64: dts: qcom: qrb2210-rb1: Swap UART index + - arm64: dts: qcom: sc7280: drop incorrect EUD port on SoC side + - arm64: dts: qcom: sm8150: add ref clock to PCIe PHYs + - arm64: dts: qcom: sm8350: fix pinctrl for UART18 + - arm64: dts: qcom: sdm845-mtp: fix WiFi configuration + - ARM64: dts: marvell: cn9310: Use appropriate label for spi1 pins + - arm64: dts: qcom: msm8976: Fix ipc bit shifts + - arm64: dts: qcom: msm8939: Fix iommu local address range + - riscv: dts: allwinner: remove address-cells from intc node + - arm64: dts: qcom: apq8016-sbc: Add missing ADV7533 regulators + - ARM: dts: qcom: apq8026-samsung-matisse-wifi: Fix inverted hall sensor + - ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator + - soc: qcom: llcc: Handle a second device without data corruption + - kunit: Fix missed memory release in kunit_free_suite_set() + - firmware: ti_sci: Mark driver as non removable + - arm64: dts: ti: k3-am625-beagleplay: Fix typo in ramoops reg + - arm64: dts: ti: k3-am62a7-sk: Drop i2c-1 to 100Khz + - firmware: arm_ffa: Assign the missing IDR allocation ID to the FFA device + - firmware: arm_ffa: Allow the FF-A drivers to use 32bit mode of messaging + - ARM: dts: am3517-evm: Fix LED3/4 pinmux + - clk: scmi: Free scmi_clk allocated when the clocks with invalid info are + skipped + - arm64: dts: imx8qm-ss-img: Fix jpegenc compatible entry + - arm64: dts: imx8mp-debix-model-a: Remove USB hub reset-gpios + - arm64: dts: imx8mm: Add sound-dai-cells to micfil node + - arm64: dts: imx8mn: Add sound-dai-cells to micfil node + - arm64: tegra: Fix P3767 card detect polarity + - arm64: tegra: Fix P3767 QSPI speed + - firmware: tegra: Add suspend hook and reset BPMP IPC early on resume + - memory: tegra: Set BPMP msg flags to reset IPC channels + - arm64: tegra: Use correct interrupts for Tegra234 TKE + - selftests/pidfd: Fix ksft print formats + - selftests/resctrl: Ensure the benchmark commands fits to its array + - soc: qcom: pmic_glink: fix connector type to be DisplayPort + - ARM: dts: BCM5301X: Explicitly disable unused switch CPU ports + - iommufd: Add iopt_area_alloc() + - module/decompress: use vmalloc() for gzip decompression workspace + - ASoC: cs35l41: Handle mdsync_down reg write errors + - ASoC: cs35l41: Initialize completion object before requesting IRQ + - ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler + - ASoC: cs35l41: Undo runtime PM changes at driver exit time + - ALSA: hda: cs35l41: Fix unbalanced pm_runtime_get() + - ALSA: hda: cs35l41: Undo runtime PM changes at driver exit time + - KEYS: Include linux/errno.h in linux/verification.h + - crypto: hisilicon/hpre - Fix a erroneous check after snprintf() + - hwrng: bcm2835 - Fix hwrng throughput regression + - hwrng: geode - fix accessing registers + - RDMA/core: Use size_{add,sub,mul}() in calls to struct_size() + - crypto: qat - fix state machines cleanup paths + - crypto: qat - ignore subsequent state up commands + - crypto: qat - fix unregistration of crypto algorithms + - crypto: qat - fix unregistration of compression algorithms + - scsi: ibmvfc: Fix erroneous use of rtas_busy_delay with hcall return code + - ASoC: soc-pcm.c: Make sure DAI parameters cleared if the DAI becomes + inactive + - libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return + value + - nd_btt: Make BTT lanes preemptible + - crypto: caam/qi2 - fix Chacha20 + Poly1305 self test failure + - crypto: caam/jr - fix Chacha20 + Poly1305 self test failure + - crypto: qat - increase size of buffers + - ASoC: SOF: ipc4-topology: Use size_add() in call to struct_size() + - PCI: vmd: Correct PCI Header Type Register's multi-function check + - hid: cp2112: Fix duplicate workqueue initialization + - crypto: hisilicon/qm - fix PF queue parameter issue + - ARM: 9321/1: memset: cast the constant byte to unsigned char + - ARM: 9323/1: mm: Fix ARCH_LOW_ADDRESS_LIMIT when CONFIG_ZONE_DMA + - ext4: move 'ix' sanity check to corrent position + - kselftest: vm: fix mdwe's mmap_FIXED test case + - ASoC: fsl: mpc5200_dma.c: Fix warning of Function parameter or member not + described + - backlight: pwm_bl: Disable PWM on shutdown, suspend and remove + - ASoC: fsl-asoc-card: Add comment for mclk in the codec_priv + - dlm: fix no ack after final message + - IB/mlx5: Fix rdma counter binding for RAW QP + - RDMA/hns: Fix printing level of asynchronous events + - RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common() + - RDMA/hns: Fix signed-unsigned mixed comparisons + - RDMA/hns: Add check for SL + - RDMA/hns: The UD mode can only be configured with DCQCN + - ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran. + - ASoC: fsl: Fix PM disable depth imbalance in fsl_easrc_probe + - scsi: ufs: core: Leave space for '\0' in utf8 desc string + - RDMA/hfi1: Workaround truncation compilation error + - HID: cp2112: Make irq_chip immutable + - hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip + - HID: uclogic: Fix user-memory-access bug in + uclogic_params_ugee_v2_init_event_hooks() + - HID: uclogic: Fix a work->entry not empty bug in __queue_work() + - sh: bios: Revive earlyprintk support + - HID: logitech-hidpp: Don't restart IO, instead defer hid_connect() only + - HID: logitech-hidpp: Revert "Don't restart communication if not necessary" + - HID: logitech-hidpp: Move get_wireless_feature_index() check to + hidpp_connect_event() + - ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails + - PCI: endpoint: Fix double free in __pci_epc_create() + - padata: Fix refcnt handling in padata_free_shell() + - certs: Break circular dependency when selftest is modular + - crypto: qat - fix deadlock in backlog processing + - ASoC: ams-delta.c: use component after check + - erofs: fix erofs_insert_workgroup() lockref usage + - IB/mlx5: Fix init stage error handling to avoid double free of same QP and + UAF + - mfd: core: Un-constify mfd_cell.of_reg + - mfd: core: Ensure disabled devices are skipped without aborting + - mfd: dln2: Fix double put in dln2_probe + - dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC + - mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs + - leds: turris-omnia: Drop unnecessary mutex locking + - leds: turris-omnia: Do not use SMBUS calls + - leds: pwm: Don't disable the PWM when the LED should be off + - leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' + - scripts/gdb: fix usage of MOD_TEXT not defined when CONFIG_MODULES=n + - perf stat: Fix aggr mode initialization + - iio: frequency: adf4350: Use device managed functions and fix power down + issue. + - perf kwork: Fix incorrect and missing free atom in work_push_atom() + - perf kwork: Add the supported subcommands to the document + - perf kwork: Set ordered_events to true in 'struct perf_tool' + - f2fs: compress: fix deadloop in f2fs_write_cache_pages() + - f2fs: compress: fix to avoid use-after-free on dic + - f2fs: compress: fix to avoid redundant compress extension + - f2fs: fix to drop meta_inode's page cache in f2fs_put_super() + - tty: tty_jobctrl: fix pid memleak in disassociate_ctty() + - perf parse-events: Remove unused PE_PMU_EVENT_FAKE token + - perf parse-events: Remove unused PE_KERNEL_PMU_EVENT token + - perf parse-events: Remove ABORT_ON + - perf tools: Revert enable indices setting syntax for BPF map + - perf parse-events: Fix tracepoint name memory leak + - livepatch: Fix missing newline character in klp_resolve_symbols() + - pinctrl: renesas: rzg2l: Make reverse order of enable() for disable() + - perf record: Fix BTF type checks in the off-cpu profiling + - dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers + - usb: dwc2: fix possible NULL pointer dereference caused by driver + concurrency + - usb: chipidea: Fix DMA overwrite for Tegra + - usb: chipidea: Simplify Tegra DMA alignment code + - dmaengine: ti: edma: handle irq_of_parse_and_map() errors + - tools/perf: Update call stack check in builtin-lock.c + - misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() + - tools: iio: iio_generic_buffer ensure alignment + - USB: usbip: fix stub_dev hub disconnect + - dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() + - f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() + - interconnect: qcom: qdu1000: Set ACV enable_mask + - interconnect: qcom: sc7180: Retire DEFINE_QBCM + - interconnect: qcom: sc7180: Set ACV enable_mask + - interconnect: qcom: sc7280: Set ACV enable_mask + - interconnect: qcom: sc8180x: Set ACV enable_mask + - interconnect: qcom: sc8280xp: Set ACV enable_mask + - interconnect: qcom: sdm670: Retire DEFINE_QBCM + - interconnect: qcom: sdm670: Set ACV enable_mask + - interconnect: qcom: sdm845: Retire DEFINE_QBCM + - interconnect: qcom: sdm845: Set ACV enable_mask + - interconnect: qcom: sm6350: Retire DEFINE_QBCM + - interconnect: qcom: sm6350: Set ACV enable_mask + - interconnect: qcom: sm8150: Retire DEFINE_QBCM + - interconnect: qcom: sm8150: Set ACV enable_mask + - interconnect: qcom: sm8350: Retire DEFINE_QBCM + - interconnect: qcom: sm8350: Set ACV enable_mask + - powerpc: Only define __parse_fpscr() when required + - interconnect: fix error handling in qnoc_probe() + - perf build: Add missing comment about NO_LIBTRACEEVENT=1 + - perf parse-events: Fix for term values that are raw events + - perf pmu: Remove logic for PMU name being NULL + - perf mem-events: Avoid uninitialized read + - s390/ap: re-init AP queues on config on + - modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host + - modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host + - perf tools: Do not ignore the default vmlinux.h + - powerpc/40x: Remove stale PTE_ATOMIC_UPDATES macro + - powerpc/xive: Fix endian conversion size + - powerpc: Hide empty pt_regs at base of the stack + - perf trace: Use the right bpf_probe_read(_str) variant for reading user data + - powerpc/vas: Limit open window failure messages in log bufffer + - powerpc/imc-pmu: Use the correct spinlock initializer. + - powerpc/pseries: fix potential memory leak in init_cpu_associativity() + - perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 + platform + - xhci: Loosen RPM as default policy to cover for AMD xHC 1.1 + - usb: host: xhci-plat: fix possible kernel oops while resuming + - perf machine: Avoid out of bounds LBR memory read + - libperf rc_check: Make implicit enabling work for GCC + - perf hist: Add missing puts to hist__account_cycles + - perf vendor events intel: Fix broadwellde tma_info_system_dram_bw_use metric + - perf vendor events intel: Add broadwellde two metrics + - 9p/net: fix possible memory leak in p9_check_errors() + - rtla: Fix uninitialized variable found + - i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs + - rtc: brcmstb-waketimer: support level alarm_irq + - cxl/pci: Remove unnecessary device reference management in sanitize work + - cxl/pci: Cleanup 'sanitize' to always poll + - cxl/pci: Remove inconsistent usage of dev_err_probe() + - cxl/pci: Clarify devm host for memdev relative setup + - cxl/pci: Fix sanitize notifier setup + - cxl/memdev: Fix sanitize vs decoder setup locking + - cxl/mem: Fix shutdown order + - virt: sevguest: Fix passing a stack buffer as a scatterlist target + - rtc: pcf85363: Allow to wake up system without IRQ + - rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call + - cxl/region: Prepare the decoder match range helper for reuse + - cxl/region: Calculate a target position in a region interleave + - cxl/region: Use cxl_calc_interleave_pos() for auto-discovery + - cxl/region: Fix cxl_region_rwsem lock held when returning to user space + - cxl/core/regs: Rename @dev to @host in struct cxl_register_map + - cxl/port: Fix @host confusion in cxl_dport_setup_regs() + - cxl/hdm: Remove broken error path + - pcmcia: cs: fix possible hung task and memory leak pccardd() + - pcmcia: ds: fix refcount leak in pcmcia_device_add() + - pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() + - media: imx-jpeg: initiate a drain of the capture queue in dynamic resolution + change + - media: hantro: Check whether reset op is defined before use + - media: verisilicon: Do not enable G2 postproc downscale if source is + narrower than destination + - media: ov5640: fix vblank unchange issue when work at dvp mode + - media: i2c: max9286: Fix some redundant of_node_put() calls + - media: ov5640: Fix a memory leak when ov5640_probe fails + - media: bttv: fix use after free error due to btv->timeout timer + - media: amphion: handle firmware debug message + - media: mtk-jpegenc: Fix bug in JPEG encode quality selection + - media: s3c-camif: Avoid inappropriate kfree() + - media: vidtv: psi: Add check for kstrdup + - media: vidtv: mux: Add check and kfree for kstrdup + - media: cedrus: Fix clock/reset sequence + - media: cadence: csi2rx: Unregister v4l2 async notifier + - media: dvb-usb-v2: af9035: fix missing unlock + - media: verisilicon: Fixes clock list for rk3588 av1 decoder + - media: imx-jpeg: notify source chagne event when the first picture parsed + - media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() + - media: cec: meson: always include meson sub-directory in Makefile + - cpupower: fix reference to nonexistent document + - regmap: prevent noinc writes from clobbering cache + - drm/amdgpu/gfx10,11: use memcpy_to/fromio for MQDs + - drm/amdgpu: don't put MQDs in VRAM on ARM | ARM64 + - pwm: sti: Reduce number of allocations and drop usage of chip_data + - pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume + - Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() + - watchdog: ixp4xx: Make sure restart always works + - llc: verify mac len before reading mac header + - hsr: Prevent use after free in prp_create_tagged_frame() + - tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING + - rxrpc: Fix two connection reaping bugs + - bpf: Check map->usercnt after timer->timer is assigned + - inet: shrink struct flowi_common + - octeontx2-pf: Fix error codes + - octeontx2-pf: Fix holes in error code + - net: page_pool: add missing free_percpu when page_pool_init fail + - dccp: Call security_inet_conn_request() after setting IPv4 addresses. + - dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. + - Fix termination state for idr_for_each_entry_ul() + - net: stmmac: xgmac: Enable support for multiple Flexible PPS outputs + - selftests: pmtu.sh: fix result checking + - octeontx2-pf: Free pending and dropped SQEs + - net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT + - net/smc: allow cdc msg send rather than drop it with NULL sndbuf_desc + - net/smc: put sk reference if close work was canceled + - nvme: fix error-handling for io_uring nvme-passthrough + - riscv: boot: Fix creation of loader.bin + - tg3: power down device only on SYSTEM_POWER_OFF + - nbd: fix uaf in nbd_open + - blk-core: use pr_warn_ratelimited() in bio_check_ro() + - vsock/virtio: remove socket from connected/bound list on shutdown + - r8169: respect userspace disabling IFF_MULTICAST + - net: enetc: shorten enetc_setup_xdp_prog() error message to fit + NETLINK_MAX_FMTMSG_LEN + - i2c: iproc: handle invalid slave state + - netfilter: xt_recent: fix (increase) ipv6 literal buffer length + - netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses + - net/sched: act_ct: Always fill offloading tuple iifidx + - RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs + - module/decompress: use kvmalloc() consistently + - drm/vc4: tests: Fix UAF in the mock helpers + - drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE + - ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: trivial: fix error messages + - ASoC: hdmi-codec: register hpd callback on component probe + - ASoC: dapm: fix clock get name + - spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies + - arm64/arm: arm_pmuv3: perf: Don't truncate 64-bit registers + - fbdev: imsttfb: fix double free in probe() + - fbdev: imsttfb: fix a resource leak in probe + - fbdev: fsl-diu-fb: mark wr_reg_wa() static + - tracing/kprobes: Fix the order of argument descriptions + - Revert "drm/ast: report connection status on Display Port." + - selftests: mptcp: fix wait_rm_addr/sf parameters + - io_uring/net: ensure socket is marked connected on connect retry + - x86/amd_nb: Use Family 19h Models 60h-7Fh Function 4 IDs + - Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1" + - btrfs: use u64 for buffer sizes in the tree search ioctls + - bpf, x86: initialize the variable "first_off" in save_args() + - perf parse-events: Fix driver config term + - btrfs: make found_logical_ret parameter mandatory for function + queue_scrub_stripe() + - Linux 6.5.12 + + * Mantic update: v6.5.11 upstream stable release (LP: #2051117) + - ASoC: Intel: sof_sdw: add support for SKU 0B14 + - ASoC: simple-card: fixup asoc_simple_probe() error handling + - coresight: tmc-etr: Disable warnings for allocation failures + - ASoC: fsl-asoc-card: use integer type for fll_id and pll_id + - ASoC: core: Do not call link_exit() on uninitialized rtd objects + - ASoC: tlv320adc3xxx: BUG: Correct micbias setting + - net: sched: cls_u32: Fix allocation size in u32_init() + - arm64: dts: imx93: add the Flex-CAN stop mode by GPR + - can: flexcan: remove the auto stop mode for IMX93 + - irqchip/riscv-intc: Mark all INTC nodes as initialized + - irqchip/stm32-exti: add missing DT IRQ flag translation + - dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe + - ata: pata_parport: add custom version of wait_after_reset + - ata: pata_parport: fit3: implement IDE command set registers + - powerpc/85xx: Fix math emulation exception + - media: i2c: ov8858: Don't set fwnode in the driver + - Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport + - fbdev: atyfb: only use ioremap_uc() on i386 and ia64 + - fs/ntfs3: Add ckeck in ni_update_parent() + - fs/ntfs3: Write immediately updated ntfs state + - fs/ntfs3: Use kvmalloc instead of kmalloc(... __GFP_NOWARN) + - fs/ntfs3: Add more attributes checks in mi_enum_attr() + - fs/ntfs3: Fix alternative boot searching + - fs/ntfs3: Add more info into /proc/fs/ntfs3//volinfo + - fs/ntfs3: Do not allow to change label if volume is read-only + - fs/ntfs3: Fix possible NULL-ptr-deref in ni_readpage_cmpr() + - fs/ntfs3: Fix NULL pointer dereference on error in attr_allocate_frame() + - fs/ntfs3: Fix directory element type detection + - fs/ntfs3: Avoid possible memory leak + - spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0 + - ASoC: soc-dapm: Add helper for comparing widget name + - netfilter: nfnetlink_log: silence bogus compiler warning + - net/mlx5: Bridge, fix peer entry ageing in LAG mode + - x86/efistub: Don't try to print after ExitBootService() + - efi: fix memory leak in krealloc failure handling + - ASoC: rt5650: fix the wrong result of key button + - ASoC: codecs: tas2780: Fix log of failed reset via I2C. + - s390/kasan: handle DCSS mapping in memory holes + - fbdev: omapfb: fix some error codes + - fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() + - scsi: mpt3sas: Fix in error path + - ASoC: da7219: Correct the process of setting up Gnd switch in AAD + - drm/amdgpu: Unset context priority is now invalid + - gpu/drm: Eliminate DRM_SCHED_PRIORITY_UNSET + - LoongArch: Use SYM_CODE_* to annotate exception handlers + - LoongArch: Export symbol invalid_pud_table for modules building + - LoongArch: Replace kmap_atomic() with kmap_local_page() in + copy_user_highpage() + - LoongArch: Disable WUC for pgprot_writecombine() like ioremap_wc() + - netfilter: nf_tables: audit log object reset once per table + - platform/mellanox: mlxbf-tmfifo: Fix a warning message + - drm/amdgpu: Reserve fences for VM update + - riscv: dts: thead: set dma-noncoherent to soc bus + - net: chelsio: cxgb4: add an error code check in t4_load_phy_fw + - r8152: Check for unplug in rtl_phy_patch_request() + - r8152: Check for unplug in r8153b_ups_en() / r8153c_ups_en() + - powerpc/mm: Fix boot crash with FLATMEM + - ceph_wait_on_conflict_unlink(): grab reference before dropping ->d_lock + - drm/amd/display: Don't use fsleep for PSR exit waits + - rust: make `UnsafeCell` the outer type in `Opaque` + - rust: types: make `Opaque` be `!Unpin` + - perf evlist: Avoid frequency mode for the dummy event + - mmap: fix vma_iterator in error path of vma_merge() + - mmap: fix error paths with dup_anon_vma() + - ALSA: usb-audio: add quirk flag to enable native DSD for McIntosh devices + - PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device + - usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" + compatibility + - usb: typec: tcpm: Add additional checks for contaminant + - usb: typec: tcpm: Fix NULL pointer dereference in tcpm_pd_svdm() + - usb: raw-gadget: properly handle interrupted requests + - Bluetooth: hci_bcm4377: Mark bcm4378/bcm4387 as BROKEN_LE_CODED + - tty: n_gsm: fix race condition in status line change on dead connections + - tty: 8250: Remove UC-257 and UC-431 + - tty: 8250: Add support for additional Brainboxes UC cards + - tty: 8250: Add support for Brainboxes UP cards + - tty: 8250: Add support for Intashield IS-100 + - tty: 8250: Fix port count of PX-257 + - tty: 8250: Fix up PX-803/PX-857 + - tty: 8250: Add support for additional Brainboxes PX cards + - tty: 8250: Add support for Intashield IX cards + - tty: 8250: Add Brainboxes Oxford Semiconductor-based quirks + - dt-bindings: serial: rs485: Add rs485-rts-active-high + - misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support + - serial: core: Fix runtime PM handling for pending tx + - ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection + - ASoC: SOF: sof-pci-dev: Fix community key quirk detection + - Linux 6.5.11 + + * Mantic update: v6.5.11 upstream stable release (LP: #2051117) // black + screen when wake up from s3 with AMD W7600 gfx (LP: #2051341) + - drm/ttm: Reorder sys manager cleanup step + + * CVE-2024-0646 + - net: tls, update curr on splice as well * CVE-2024-0582 - io_uring: enable io_mem_alloc/free to be used in other parts - io_uring/kbuf: defer release of mapped buffer rings - * CVE-2024-0646 - - net: tls, update curr on splice as well + * CVE-2024-0565 + - smb: client: fix OOB in receive_encrypted_standard() + + * CVE-2023-51781 + - appletalk: Fix Use-After-Free in atalk_ioctl + + * Reject connection when malformed L2CAP signal packet is received + (LP: #2047634) + - Bluetooth: L2CAP: Send reject on command corrupted request + + * Mantic update: v6.5.10 upstream stable release (LP: #2049412) + - vdpa/mlx5: Fix firmware error on creation of 1k VQs + - smb3: allow controlling length of time directory entries are cached with dir + leases + - smb3: allow controlling maximum number of cached directories + - smb3: do not start laundromat thread when dir leases disabled + - smb: client: do not start laundromat thread on nohandlecache + - smb: client: make laundromat a delayed worker + - smb: client: prevent new fids from being removed by laundromat + - virtio_balloon: Fix endless deflation and inflation on arm64 + - virtio-mmio: fix memory leak of vm_dev + - virtio-crypto: handle config changed by work queue + - virtio_pci: fix the common cfg map size + - vsock/virtio: initialize the_virtio_vsock before using VQs + - vhost: Allow null msg.size on VHOST_IOTLB_INVALIDATE + - arm64: dts: qcom: apq8096-db820c: fix missing clock populate + - arm64: dts: qcom: msm8996-xiaomi: fix missing clock populate + - arm64: dts: rockchip: use codec as clock master on px30-ringneck-haikou + - arm64: dts: rockchip: set codec system-clock-fixed on px30-ringneck-haikou + - arm64: dts: qcom: sa8775p: correct PMIC GPIO label in gpio-ranges + - arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399 + - arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards + - i40e: sync next_to_clean and next_to_process for programming status desc + - mm: fix vm_brk_flags() to not bail out while holding lock + - hugetlbfs: clear resv_map pointer if mmap fails + - mm/page_alloc: correct start page when guard page debug is enabled + - mm/migrate: fix do_pages_move for compat pointers + - selftests/mm: include mman header to access MREMAP_DONTUNMAP identifier + - mm/mempolicy: fix set_mempolicy_home_node() previous VMA pointer + - hugetlbfs: extend hugetlb_vma_lock to private VMAs + - maple_tree: add GFP_KERNEL to allocations in mas_expected_entries() + - nfsd: lock_rename() needs both directories to live on the same fs + - vdpa_sim_blk: Fix the potential leak of mgmt_dev + - vdpa/mlx5: Fix double release of debugfs entry + - ARM: OMAP1: ams-delta: Fix MODEM initialization failure + - ARM: dts: rockchip: Fix i2c0 register address for RK3128 + - ARM: dts: rockchip: Add missing arm timer interrupt for RK3128 + - ARM: dts: rockchip: Add missing quirk for RK3128's dma engine + - ARM: dts: rockchip: Fix timer clocks for RK3128 + - accel/ivpu: Don't enter d0i3 during FLR + - drm/i915/pmu: Check if pmu is closed before stopping event + - drm/amd: Disable ASPM for VI w/ all Intel systems + - drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper() + - btrfs: remove v0 extent handling + - btrfs: fix unwritten extent buffer after snapshotting a new subvolume + - ARM: OMAP: timer32K: fix all kernel-doc warnings + - firmware/imx-dsp: Fix use_after_free in imx_dsp_setup_channels() + - clk: ti: Fix missing omap4 mcbsp functional clock and aliases + - clk: ti: Fix missing omap5 mcbsp functional clock and aliases + - r8169: fix the KCSAN reported data-race in rtl_tx() while reading tp->cur_tx + - r8169: fix the KCSAN reported data-race in rtl_tx while reading + TxDescArray[entry].opts1 + - r8169: fix the KCSAN reported data race in rtl_rx while reading desc->opts1 + - iavf: initialize waitqueues before starting watchdog_task + - i40e: Fix I40E_FLAG_VF_VLAN_PRUNING value + - treewide: Spelling fix in comment + - igb: Fix potential memory leak in igb_add_ethtool_nfc_entry + - net: do not leave an empty skb in write queue + - neighbour: fix various data-races + - igc: Fix ambiguity in the ethtool advertising + - net: ethernet: adi: adin1110: Fix uninitialized variable + - net: ieee802154: adf7242: Fix some potential buffer overflow in + adf7242_stats_show() + - net: usb: smsc95xx: Fix uninit-value access in smsc95xx_read_reg + - r8152: Increase USB control msg timeout to 5000ms as per spec + - r8152: Run the unload routine if we have errors during probe + - r8152: Cancel hw_phy_work if we have an error in probe + - r8152: Release firmware if we have an error in probe + - tcp: fix wrong RTO timeout when received SACK reneging + - wifi: cfg80211: pass correct pointer to rdev_inform_bss() + - wifi: cfg80211: fix assoc response warning on failed links + - wifi: mac80211: don't drop all unprotected public action frames + - net/handshake: fix file ref count in handshake_nl_accept_doit() + - gtp: uapi: fix GTPA_MAX + - gtp: fix fragmentation needed check with gso + - drm/i915/perf: Determine context valid in OA reports + - i40e: Fix wrong check for I40E_TXR_FLAGS_WB_ON_ITR + - netfilter: flowtable: GC pushes back packets to classic path + - net/sched: act_ct: additional checks for outdated flows + - drm/logicvc: Kconfig: select REGMAP and REGMAP_MMIO + - drm/i915/mcr: Hold GT forcewake during steering operations + - iavf: in iavf_down, disable queues when removing the driver + - scsi: sd: Introduce manage_shutdown device flag + - blk-throttle: check for overflow in calculate_bytes_allowed + - kasan: print the original fault addr when access invalid shadow + - iio: afe: rescale: Accept only offset channels + - iio: exynos-adc: request second interupt only when touchscreen mode is used + - iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds + - iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale + - i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() + - i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() + - i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() + - i2c: stm32f7: Fix PEC handling in case of SMBUS transfers + - i2c: aspeed: Fix i2c bus hang in slave read + - tracing/kprobes: Fix symbol counting logic by looking at modules as well + - tracing/kprobes: Fix the description of variable length arguments + - misc: fastrpc: Reset metadata buffer to avoid incorrect free + - misc: fastrpc: Free DMA handles for RPC calls with no arguments + - misc: fastrpc: Clean buffers on remote invocation failures + - misc: fastrpc: Unmap only if buffer is unmapped from DSP + - nvmem: imx: correct nregs for i.MX6ULL + - nvmem: imx: correct nregs for i.MX6SLL + - nvmem: imx: correct nregs for i.MX6UL + - x86/tsc: Defer marking TSC unstable to a worker + - x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility + - x86/cpu: Add model number for Intel Arrow Lake mobile processor + - perf/core: Fix potential NULL deref + - sparc32: fix a braino in fault handling in csum_and_copy_..._user() + - clk: Sanitize possible_parent_show to Handle Return Value of + of_clk_get_parent_name + - clk: socfpga: gate: Account for the divider in determine_rate + - clk: stm32: Fix a signedness issue in clk_stm32_composite_determine_rate() + - platform/x86: Add s2idle quirk for more Lenovo laptops + - mm/damon/sysfs: check DAMOS regions update progress from before_terminate() + - accel/ivpu/37xx: Fix missing VPUIP interrupts + - Linux 6.5.10 + + * CVE-2023-6560 + - io_uring: don't allow discontig pages for IORING_SETUP_NO_MMAP + + * CVE-2023-51782 + - net/rose: Fix Use-After-Free in rose_ioctl + + * Mantic update: v6.5.9 upstream stable release (LP: #2049202) + - Bluetooth: hci_event: Ignore NULL link key + - Bluetooth: Reject connection with the device which has same BD_ADDR + - Bluetooth: Fix a refcnt underflow problem for hci_conn + - Bluetooth: vhci: Fix race when opening vhci device + - Bluetooth: hci_event: Fix coding style + - Bluetooth: avoid memcmp() out of bounds warning + - Bluetooth: hci_conn: Fix modifying handle while aborting + - ice: fix over-shifted variable + - ice: Fix safe mode when DDP is missing + - ice: reset first in crash dump kernels + - net/smc: return the right falback reason when prefix checks fail + - btrfs: fix stripe length calculation for non-zoned data chunk allocation + - nfc: nci: fix possible NULL pointer dereference in send_acknowledge() + - regmap: fix NULL deref on lookup + - KVM: x86: Mask LVTPC when handling a PMI + - x86/fpu: Allow caller to constrain xfeatures when copying to uabi buffer + - KVM: x86/pmu: Truncate counter value to allowed width on write + - KVM: x86: Constrain guest-supported xfeatures only at KVM_GET_XSAVE{2} + - x86: KVM: SVM: add support for Invalid IPI Vector interception + - x86: KVM: SVM: refresh AVIC inhibition in svm_leave_nested() + - tcp: check mptcp-level constraints for backlog coalescing + - mptcp: more conservative check for zero probes + - selftests: mptcp: join: no RST when rm subflow/addr + - mm: slab: Do not create kmalloc caches smaller than arch_slab_minalign() + - fs/ntfs3: Fix OOB read in ntfs_init_from_boot + - fs/ntfs3: Fix possible null-pointer dereference in hdr_find_e() + - fs/ntfs3: fix panic about slab-out-of-bounds caused by ntfs_list_ea() + - fs/ntfs3: Fix shift-out-of-bounds in ntfs_fill_super + - fs/ntfs3: fix deadlock in mark_as_free_ex + - Revert "net: wwan: iosm: enable runtime pm support for 7560" + - netfilter: nft_payload: fix wrong mac header matching + - drm/i915: Retry gtt fault when out of fence registers + - drm/mediatek: Correctly free sg_table in gem prime vmap + - drm/nouveau/disp: fix DP capable DSM connectors + - drm/edid: add 8 bpc quirk to the BenQ GW2765 + - ALSA: hda/realtek - Fixed ASUS platform headset Mic issue + - ALSA: hda/realtek: Add quirk for ASUS ROG GU603ZV + - ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq5xxx + - ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind + - ASoC: codecs: wcd938x-sdw: fix runtime PM imbalance on probe errors + - ASoC: codecs: wcd938x: drop bogus bind error handling + - ASoC: codecs: wcd938x: fix unbind tear down order + - ASoC: codecs: wcd938x: fix resource leaks on bind errors + - ASoC: codecs: wcd938x: fix regulator leaks on probe errors + - ASoC: codecs: wcd938x: fix runtime PM imbalance on remove + - qed: fix LL2 RX buffer allocation + - xfrm: fix a data-race in xfrm_lookup_with_ifid() + - xfrm6: fix inet6_dev refcount underflow problem + - xfrm: fix a data-race in xfrm_gen_index() + - xfrm: interface: use DEV_STATS_INC() + - net: xfrm: skip policies marked as dead while reinserting policies + - fprobe: Fix to ensure the number of active retprobes is not zero + - wifi: cfg80211: use system_unbound_wq for wiphy work + - net: ipv4: fix return value check in esp_remove_trailer + - net: ipv6: fix return value check in esp_remove_trailer + - net: rfkill: gpio: prevent value glitch during probe + - tcp: fix excessive TLP and RACK timeouts from HZ rounding + - tcp: tsq: relax tcp_small_queue_check() when rtx queue contains a single skb + - tcp: Fix listen() warning with v4-mapped-v6 address. + - docs: fix info about representor identification + - tun: prevent negative ifindex + - gve: Do not fully free QPL pages on prefill errors + - ipv4: fib: annotate races around nh->nh_saddr_genid and nh->nh_saddr + - net: usb: smsc95xx: Fix an error code in smsc95xx_reset() + - octeon_ep: update BQL sent bytes before ringing doorbell + - i40e: prevent crash on probe if hw registers have invalid values + - net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() + - bonding: Return pointer to data after pull on skb + - net/sched: sch_hfsc: upgrade 'rt' to 'sc' when it becomes a inner curve + - neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section + - selftests: openvswitch: Catch cases where the tests are killed + - selftests: openvswitch: Fix the ct_tuple for v4 + - selftests: netfilter: Run nft_audit.sh in its own netns + - netfilter: nft_set_rbtree: .deactivate fails if element has expired + - netlink: Correct offload_xstats size + - netfilter: nf_tables: do not refresh timeout when resetting element + - netfilter: nf_tables: do not remove elements if set backend implements + .abort + - netfilter: nf_tables: revert do not remove elements if set backend + implements .abort + - selftests: openvswitch: Add version check for pyroute2 + - net: phy: bcm7xxx: Add missing 16nm EPHY statistics + - net: pktgen: Fix interface flags printing + - net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation + - net: mdio-mux: fix C45 access returning -EIO after API change + - net: avoid UAF on deleted altname + - net: fix ifname in netlink ntf during netns move + - net: check for altname conflicts when changing netdev's netns + - iio: light: vcnl4000: Don't power on/off chip in config + - pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency + - ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone + - arm64: dts: mediatek: Fix "mediatek,merge-mute" and "mediatek,merge-fifo-en" + types + - fs-writeback: do not requeue a clean inode having skipped pages + - btrfs: fix race when refilling delayed refs block reserve + - btrfs: prevent transaction block reserve underflow when starting transaction + - btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1 + - btrfs: initialize start_slot in btrfs_log_prealloc_extents + - i2c: mux: Avoid potential false error message in i2c_mux_add_adapter + - overlayfs: set ctime when setting mtime and atime + - accel/ivpu: Don't flood dmesg with VPU ready message + - gpio: timberdale: Fix potential deadlock on &tgpio->lock + - ata: libata-core: Fix compilation warning in ata_dev_config_ncq() + - ata: libata-eh: Fix compilation warning in ata_eh_link_report() + - tracing: relax trace_event_eval_update() execution with cond_resched() + - wifi: mwifiex: Sanity check tlv_len and tlv_bitmap_len + - wifi: cfg80211: validate AP phy operation before starting it + - wifi: iwlwifi: Ensure ack flag is properly cleared. + - rfkill: sync before userspace visibility/changes + - HID: logitech-hidpp: Add Bluetooth ID for the Logitech M720 Triathlon mouse + - HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event + - Bluetooth: btusb: add shutdown function for QCA6174 + - Bluetooth: Avoid redundant authentication + - Bluetooth: hci_core: Fix build warnings + - wifi: cfg80211: Fix 6GHz scan configuration + - wifi: mac80211: work around Cisco AP 9115 VHT MPDU length + - wifi: mac80211: allow transmitting EAPOL frames with tainted key + - wifi: cfg80211: avoid leaking stack data into trace + - regulator/core: Revert "fix kobject release warning and memory leak in + regulator_register()" + - SUNRPC: Fail quickly when server does not recognize TLS + - SUNRPC/TLS: Lock the lower_xprt during the tls handshake + - nfs: decrement nrequests counter before releasing the req + - sky2: Make sure there is at least one frag_addr available + - ipv4/fib: send notify when delete source address routes + - drm: panel-orientation-quirks: Add quirk for One Mix 2S + - btrfs: fix some -Wmaybe-uninitialized warnings in ioctl.c + - btrfs: error out when COWing block using a stale transaction + - btrfs: error when COWing block from a root that is being deleted + - btrfs: error out when reallocating block for defrag using a stale + transaction + - platform/x86: touchscreen_dmi: Add info for the BUSH Bush Windows tablet + - drm/amd/pm: add unique_id for gc 11.0.3 + - HID: multitouch: Add required quirk for Synaptics 0xcd7e device + - HID: nintendo: reinitialize USB Pro Controller after resuming from suspend + - HID: Add quirk to ignore the touchscreen battery on HP ENVY 15-eu0556ng + - platform/x86: touchscreen_dmi: Add info for the Positivo C4128B + - cpufreq: schedutil: Update next_freq when cpufreq_limits change + - Bluetooth: hci_sync: Fix not handling ISO_LINK in hci_abort_conn_sync + - Bluetooth: hci_sync: Introduce PTR_UINT/UINT_PTR macros + - Bluetooth: ISO: Fix invalid context error + - Bluetooth: hci_sync: delete CIS in BT_OPEN/CONNECT/BOUND when aborting + - Bluetooth: hci_sync: always check if connection is alive before deleting + - net/mlx5: E-switch, register event handler before arming the event + - net/mlx5: Handle fw tracer change ownership event based on MTRC + - net/mlx5e: RX, Fix page_pool allocation failure recovery for striding rq + - net/mlx5e: RX, Fix page_pool allocation failure recovery for legacy rq + - net/mlx5e: XDP, Fix XDP_REDIRECT mpwqe page fragment leaks on shutdown + - net/mlx5e: Take RTNL lock before triggering netdev notifiers + - net/mlx5e: Don't offload internal port if filter device is out device + - net/mlx5e: Fix VF representors reporting zero counters to "ip -s" command + - net/tls: split tls_rx_reader_lock + - tcp: allow again tcp_disconnect() when threads are waiting + - Bluetooth: hci_event: Fix using memcmp when comparing keys + - tcp_bpf: properly release resources on error paths + - mtd: rawnand: qcom: Unmap the right resource upon probe failure + - mtd: rawnand: pl353: Ensure program page operations are successful + - mtd: rawnand: marvell: Ensure program page operations are successful + - mtd: rawnand: arasan: Ensure program page operations are successful + - mtd: rawnand: Ensure the nand chip supports cached reads + - mtd: spinand: micron: correct bitmask for ecc status + - mtd: physmap-core: Restore map_rom fallback + - dt-bindings: mmc: sdhci-msm: correct minimum number of clocks + - mmc: sdhci-pci-gli: fix LPM negotiation so x86/S0ix SoCs can suspend + - mmc: mtk-sd: Use readl_poll_timeout_atomic in msdc_reset_hw + - mmc: core: Fix error propagation for some ioctl commands + - mmc: core: sdio: hold retuning if sdio in 1-bit mode + - pinctrl: qcom: lpass-lpi: fix concurrent register updates + - pNFS: Fix a hang in nfs4_evict_inode() + - pNFS/flexfiles: Check the layout validity in ff_layout_mirror_prepare_stats + - NFSv4.1: fixup use EXCHGID4_FLAG_USE_PNFS_DS for DS server + - ACPI: irq: Fix incorrect return value in acpi_register_gsi() + - ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init() + - perf dlfilter: Fix use of addr_location__exit() in dlfilter__object_code() + - fanotify: limit reporting of event with non-decodeable file handles + - NFS: Fix potential oops in nfs_inode_remove_request() + - nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op + - nvme: sanitize metadata bounce buffer for reads + - nvme-pci: add BOGUS_NID for Intel 0a54 device + - nvme-auth: use chap->s2 to indicate bidirectional authentication + - nvmet-auth: complete a request only after freeing the dhchap pointers + - nvme-rdma: do not try to stop unallocated queues + - USB: serial: option: add Telit LE910C4-WWX 0x1035 composition + - USB: serial: option: add entry for Sierra EM9191 with new firmware + - USB: serial: option: add Fibocom to DELL custom modem FM101R-GL + - thunderbolt: Call tb_switch_put() once DisplayPort bandwidth request is + finished + - s390/pci: fix iommu bitmap allocation + - tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols + - selftests/ftrace: Add new test case which checks non unique symbol + - KEYS: asymmetric: Fix sign/verify on pkcs1pad without a hash + - apple-gmux: Hard Code max brightness for MMIO gmux + - s390/cio: fix a memleak in css_alloc_subchannel + - platform/surface: platform_profile: Propagate error if profile registration + fails + - platform/x86: intel-uncore-freq: Conditionally create attribute for read + frequency + - platform/x86: msi-ec: Fix the 3rd config + - platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e + - platform/x86: asus-wmi: Only map brightness codes when using asus-wmi + backlight control + - platform/x86: asus-wmi: Map 0x2a code, Ignore 0x2b and 0x2c events + - rust: error: fix the description for `ECHILD` + - gpiolib: acpi: Add missing memset(0) to acpi_get_gpiod_from_data() + - gpio: vf610: set value before the direction to avoid a glitch + - gpio: vf610: mask the gpio irq in system suspend and support wakeup + - ASoC: cs35l56: Fix illegal use of init_completion() + - ASoC: pxa: fix a memory leak in probe() + - ASoC: cs42l42: Fix missing include of gpio/consumer.h + - drm/bridge: ti-sn65dsi86: Associate DSI device lifetime with auxiliary + device + - drm/i915/cx0: Only clear/set the Pipe Reset bit of the PHY Lanes Owned + - drm/amdgpu: Fix possible null pointer dereference + - powerpc/mm: Allow ARCH_FORCE_MAX_ORDER up to 12 + - powerpc/qspinlock: Fix stale propagated yield_cpu + - docs: Move rustdoc output, cross-reference it + - rust: docs: fix logo replacement + - phy: mapphone-mdm6600: Fix runtime disable on probe + - phy: mapphone-mdm6600: Fix runtime PM for remove + - phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins + - phy: qcom-qmp-usb: initialize PCS_USB registers + - phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p + - phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1 + - phy: qcom-qmp-combo: initialize PCS_USB registers + - efi/unaccepted: Fix soft lockups caused by parallel memory acceptance + - net: move altnames together with the netdevice + - Bluetooth: hci_sock: fix slab oob read in create_monitor_event + - net: rfkill: reduce data->mtx scope in rfkill_fop_open + - docs: rust: update Rust docs output path + - kbuild: remove old Rust docs output path + - Bluetooth: hci_sock: Correctly bounds check and pad HCI_MON_NEW_INDEX name + - mptcp: avoid sending RST when closing the initial subflow + - selftests: mptcp: join: correctly check for no RST + - Linux 6.5.9 + + * CVE-2023-51779 + - Bluetooth: af_bluetooth: Fix Use-After-Free in bt_sock_recvmsg - -- Manuel Diewald Wed, 07 Feb 2024 13:06:01 +0100 + -- Stefan Bader Fri, 02 Feb 2024 15:00:42 +0100 linux (6.5.0-17.17) mantic; urgency=medium diff -u linux-aws-6.5-6.5.0/debian.master/config/annotations linux-aws-6.5-6.5.0/debian.master/config/annotations --- linux-aws-6.5-6.5.0/debian.master/config/annotations +++ linux-aws-6.5-6.5.0/debian.master/config/annotations @@ -1120,7 +1120,7 @@ CONFIG_AM2315 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> CONFIG_AM335X_CONTROL_USB policy<{'armhf': 'm'}> CONFIG_AM335X_PHY_USB policy<{'armhf': 'm'}> -CONFIG_AMBA_PL08X policy<{'arm64': 'y', 'armhf': 'y'}> +CONFIG_AMBA_PL08X policy<{'arm64': 'y', 'armhf': 'y', 'riscv64': 'n'}> CONFIG_AMD8111_ETH policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': '-'}> CONFIG_AMDTEE policy<{'amd64': 'm'}> CONFIG_AMD_HSMP policy<{'amd64': 'm'}> @@ -1336,10 +1336,10 @@ CONFIG_ARCH_MIGHT_HAVE_PC_SERIO policy<{'amd64': 'y', 'ppc64el': 'y'}> CONFIG_ARCH_MILBEAUT policy<{'armhf': 'y'}> CONFIG_ARCH_MILBEAUT_M10V policy<{'armhf': 'y'}> -CONFIG_ARCH_MMAP_RND_BITS policy<{'amd64': '28', 'arm64': '18', 'armhf': '8', 'ppc64el': '28', 'riscv64': '18'}> +CONFIG_ARCH_MMAP_RND_BITS policy<{'amd64': '32', 'arm64': '33', 'arm64-generic-64k': '29', 'armhf': '16', 'ppc64el': '29', 'riscv64': '24'}> CONFIG_ARCH_MMAP_RND_BITS_MAX policy<{'amd64': '32', 'arm64': '33', 'arm64-generic-64k': '29', 'armhf': '16', 'ppc64el': '29', 'riscv64': '24'}> CONFIG_ARCH_MMAP_RND_BITS_MIN policy<{'amd64': '28', 'arm64': '18', 'arm64-generic-64k': '14', 'armhf': '8', 'ppc64el': '14', 'riscv64': '18'}> -CONFIG_ARCH_MMAP_RND_COMPAT_BITS policy<{'amd64': '8', 'arm64': '11', 'ppc64el': '8'}> +CONFIG_ARCH_MMAP_RND_COMPAT_BITS policy<{'amd64': '16', 'arm64': '16', 'ppc64el': '13', 'riscv64': '-'}> CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX policy<{'amd64': '16', 'arm64': '16', 'ppc64el': '13', 'riscv64': '17'}> CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN policy<{'amd64': '8', 'arm64': '11', 'arm64-generic-64k': '7', 'ppc64el': '7', 'riscv64': '8'}> CONFIG_ARCH_MMP policy<{'armhf': 'n'}> @@ -1602,7 +1602,7 @@ CONFIG_ARMADA_THERMAL policy<{'arm64': 'y', 'armhf': 'y'}> CONFIG_ARMADA_XP_CLK policy<{'armhf': 'y'}> CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM policy<{'arm64': 'm', 'armhf': '-'}> -CONFIG_ARM_AMBA policy<{'arm64': 'y', 'armhf': 'y'}> +CONFIG_ARM_AMBA policy<{'arm64': 'y', 'armhf': 'y', 'riscv64': 'y'}> CONFIG_ARM_APPENDED_DTB policy<{'armhf': 'y'}> CONFIG_ARM_APPLE_SOC_CPUFREQ policy<{'arm64': 'm'}> CONFIG_ARM_ARCH_TIMER policy<{'arm64': 'y', 'armhf': 'y'}> @@ -1676,14 +1676,14 @@ CONFIG_ARM_MEDIATEK_CCI_DEVFREQ policy<{'arm64': 'm', 'armhf': 'm'}> CONFIG_ARM_MEDIATEK_CPUFREQ policy<{'arm64': 'm', 'armhf': 'm'}> CONFIG_ARM_MEDIATEK_CPUFREQ_HW policy<{'arm64': 'm', 'armhf': 'm'}> -CONFIG_ARM_MHU policy<{'arm64': 'm', 'armhf': 'm'}> -CONFIG_ARM_MHU_V2 policy<{'arm64': 'm', 'armhf': 'm'}> +CONFIG_ARM_MHU policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'n'}> +CONFIG_ARM_MHU_V2 policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'n'}> CONFIG_ARM_MODULE_PLTS policy<{'armhf': 'y'}> CONFIG_ARM_MVEBU_V7_CPUIDLE policy<{'armhf': 'y'}> CONFIG_ARM_OMAP2PLUS_CPUFREQ policy<{'armhf': 'y'}> CONFIG_ARM_PATCH_IDIV policy<{'armhf': 'y'}> CONFIG_ARM_PATCH_PHYS_VIRT policy<{'armhf': 'y'}> -CONFIG_ARM_PL172_MPMC policy<{'arm64': 'm', 'armhf': 'm'}> +CONFIG_ARM_PL172_MPMC policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'n'}> CONFIG_ARM_PMU policy<{'arm64': 'y', 'armhf': 'y'}> CONFIG_ARM_PMUV3 policy<{'arm64': 'y', 'armhf': 'y'}> CONFIG_ARM_PMU_ACPI policy<{'arm64': 'y'}> @@ -5310,7 +5310,7 @@ CONFIG_GPIO_PCIE_IDIO_24 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': 'm'}> CONFIG_GPIO_PCI_IDIO_16 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': 'm'}> CONFIG_GPIO_PISOSR policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': '-'}> -CONFIG_GPIO_PL061 policy<{'arm64': 'y', 'armhf': 'y'}> +CONFIG_GPIO_PL061 policy<{'arm64': 'y', 'armhf': 'y', 'riscv64': 'n'}> CONFIG_GPIO_PMIC_EIC_SPRD policy<{'arm64': 'm'}> CONFIG_GPIO_RC5T583 policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y'}> CONFIG_GPIO_RCAR policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'm'}> @@ -6004,7 +6004,7 @@ CONFIG_I2C_MV64XXX policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'm'}> CONFIG_I2C_NFORCE2 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': 'n'}> CONFIG_I2C_NFORCE2_S4985 policy<{'amd64': 'm'}> -CONFIG_I2C_NOMADIK policy<{'arm64': 'm', 'armhf': 'm'}> +CONFIG_I2C_NOMADIK policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'n'}> CONFIG_I2C_NPCM policy<{'arm64': 'm', 'armhf': 'm'}> CONFIG_I2C_NVIDIA_GPU policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': 'n'}> CONFIG_I2C_OCORES policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': 'n'}> @@ -7900,7 +7900,7 @@ CONFIG_MMC35240 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> CONFIG_MMCONF_FAM10H policy<{'amd64': 'y'}> CONFIG_MMC_ALCOR policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> -CONFIG_MMC_ARMMMCI policy<{'arm64': 'y', 'armhf': 'y'}> +CONFIG_MMC_ARMMMCI policy<{'arm64': 'y', 'armhf': 'y', 'riscv64': 'n'}> CONFIG_MMC_BLOCK_MINORS policy<{'amd64': '8', 'arm64': '8', 'armhf': '8', 'ppc64el': '8', 'riscv64': '8'}> CONFIG_MMC_CAVIUM_THUNDERX policy<{'arm64': 'm'}> CONFIG_MMC_CB710 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': '-'}> @@ -9922,8 +9922,8 @@ CONFIG_PL310_ERRATA_727915 policy<{'armhf': 'y'}> CONFIG_PL310_ERRATA_753970 policy<{'armhf': 'y'}> CONFIG_PL310_ERRATA_769419 policy<{'armhf': 'y'}> -CONFIG_PL320_MBOX policy<{'arm64': 'y', 'armhf': 'y'}> -CONFIG_PL330_DMA policy<{'arm64': 'm', 'armhf': 'm'}> +CONFIG_PL320_MBOX policy<{'arm64': 'y', 'armhf': 'y', 'riscv64': 'n'}> +CONFIG_PL330_DMA policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'n'}> CONFIG_PL353_SMC policy<{'armhf': 'm'}> CONFIG_PLATFORM_MHU policy<{'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> CONFIG_PLATFORM_SI4713 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> @@ -10981,8 +10981,8 @@ CONFIG_RTC_DRV_PCF85363 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> CONFIG_RTC_DRV_PCF8563 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> CONFIG_RTC_DRV_PCF8583 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> -CONFIG_RTC_DRV_PL030 policy<{'arm64': 'm', 'armhf': 'm'}> -CONFIG_RTC_DRV_PL031 policy<{'arm64': 'm', 'armhf': 'y'}> +CONFIG_RTC_DRV_PL030 policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'n'}> +CONFIG_RTC_DRV_PL031 policy<{'arm64': 'm', 'armhf': 'y', 'riscv64': 'n'}> CONFIG_RTC_DRV_PM8XXX policy<{'arm64': 'm', 'armhf': 'm'}> CONFIG_RTC_DRV_POLARFIRE_SOC policy<{'riscv64': 'm'}> CONFIG_RTC_DRV_R7301 policy<{'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> @@ -11748,8 +11748,8 @@ CONFIG_SERIAL_ALTERA_UART policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': 'n'}> CONFIG_SERIAL_ALTERA_UART_BAUDRATE policy<{'amd64': '115200', 'arm64': '115200', 'armhf': '115200', 'ppc64el': '115200', 'riscv64': '115200'}> CONFIG_SERIAL_ALTERA_UART_MAXPORTS policy<{'amd64': '4', 'arm64': '4', 'armhf': '4', 'ppc64el': '4', 'riscv64': '4'}> -CONFIG_SERIAL_AMBA_PL010 policy<{'arm64': 'm', 'armhf': 'm'}> -CONFIG_SERIAL_AMBA_PL011 policy<{'arm64': 'y', 'armhf': 'y'}> +CONFIG_SERIAL_AMBA_PL010 policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'n'}> +CONFIG_SERIAL_AMBA_PL011 policy<{'arm64': 'y', 'armhf': 'y', 'riscv64': 'n'}> CONFIG_SERIAL_AMBA_PL011_CONSOLE policy<{'arm64': 'y', 'armhf': 'y'}> CONFIG_SERIAL_ARC policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': 'n'}> CONFIG_SERIAL_ARC_NR_PORTS policy<{'amd64': '1', 'arm64': '1', 'armhf': '1', 'ppc64el': '1', 'riscv64': '1'}> @@ -11821,7 +11821,7 @@ CONFIG_SERIAL_XILINX_PS_UART policy<{'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> CONFIG_SERIO policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'n'}> CONFIG_SERIO_ALTERA_PS2 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': '-'}> -CONFIG_SERIO_AMBAKMI policy<{'arm64': 'm', 'armhf': 'm'}> +CONFIG_SERIO_AMBAKMI policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'n'}> CONFIG_SERIO_APBPS2 policy<{'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> CONFIG_SERIO_ARC_PS2 policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': '-'}> CONFIG_SERIO_CT82C710 policy<{'amd64': 'm'}> @@ -12978,7 +12978,7 @@ CONFIG_SPI_OMAP24XX policy<{'arm64': 'y', 'armhf': 'y'}> CONFIG_SPI_ORION policy<{'arm64': 'm', 'armhf': 'm'}> CONFIG_SPI_PCI1XXXX policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> -CONFIG_SPI_PL022 policy<{'arm64': 'm', 'armhf': 'm'}> +CONFIG_SPI_PL022 policy<{'arm64': 'm', 'armhf': 'm', 'riscv64': 'n'}> CONFIG_SPI_PXA2XX policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': '-'}> CONFIG_SPI_PXA2XX_PCI policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm'}> CONFIG_SPI_QCOM_GENI policy<{'arm64': 'm', 'armhf': 'm'}> diff -u linux-aws-6.5-6.5.0/debian.master/reconstruct linux-aws-6.5-6.5.0/debian.master/reconstruct --- linux-aws-6.5-6.5.0/debian.master/reconstruct +++ linux-aws-6.5-6.5.0/debian.master/reconstruct @@ -46,9 +46,12 @@ chmod +x 'debian/tests/rebuild' chmod +x 'debian/tests/ubuntu-regression-suite' chmod +x 'drivers/watchdog/f71808e_wdt.c' +chmod +x 'tools/testing/selftests/netfilter/conntrack_sctp_collision.sh' chmod +x 'tools/testing/selftests/netfilter/nft_audit.sh' +chmod +x 'tools/testing/selftests/netfilter/xt_string.sh' chmod +x 'update-dkms-versions' # Remove any files deleted from the orig. +rm -f 'Documentation/networking/device_drivers/ethernet/mellanox/mlx5/devlink.rst' rm -f 'arch/parisc/include/asm/mckinley.h' rm -f 'drivers/media/pci/intel/ipu3/cio2-bridge.c' rm -f 'drivers/media/pci/intel/ipu3/cio2-bridge.h' diff -u linux-aws-6.5-6.5.0/debian.master/tracking-bug linux-aws-6.5-6.5.0/debian.master/tracking-bug --- linux-aws-6.5-6.5.0/debian.master/tracking-bug +++ linux-aws-6.5-6.5.0/debian.master/tracking-bug @@ -1 +1 @@ -2052603 s2024.01.08-2 +2052615 2024.02.05-2 diff -u linux-aws-6.5-6.5.0/debian.master/upstream-stable linux-aws-6.5-6.5.0/debian.master/upstream-stable --- linux-aws-6.5-6.5.0/debian.master/upstream-stable +++ linux-aws-6.5-6.5.0/debian.master/upstream-stable @@ -3 +3,3 @@ - linux-6.5.y = v6.5.8 + linux-6.1.y = v6.1.68 + linux-6.5.y = v6.5.13 + linux-6.6.y = v6.6.7 diff -u linux-aws-6.5-6.5.0/debian/changelog linux-aws-6.5-6.5.0/debian/changelog --- linux-aws-6.5-6.5.0/debian/changelog +++ linux-aws-6.5-6.5.0/debian/changelog @@ -1,3 +1,2074 @@ +linux-aws-6.5 (6.5.0-1015.15~22.04.1) jammy; urgency=medium + + * jammy/linux-aws-6.5: 6.5.0-1015.15~22.04.1 -proposed tracker (LP: #2052020) + + * Packaging resync (LP: #1786013) + - [Packaging] update Ubuntu.md + + [ Ubuntu: 6.5.0-1015.15 ] + + * mantic/linux-aws: 6.5.0-1015.15 -proposed tracker (LP: #2052021) + * Packaging resync (LP: #1786013) + - [Packaging] update Ubuntu.md + - debian/dkms-versions -- update from kernel-versions (main/2024.02.05) + * mantic/linux: 6.5.0-25.25 -proposed tracker (LP: #2052615) + * Packaging resync (LP: #1786013) + - debian/dkms-versions -- update from kernel-versions (main/2024.02.05) + * [SRU][22.04.04]: mpi3mr driver update (LP: #2045233) + - scsi: mpi3mr: Invoke soft reset upon TSU or event ack time out + - scsi: mpi3mr: Update MPI Headers to version 3.00.28 + - scsi: mpi3mr: Add support for more than 1MB I/O + - scsi: mpi3mr: WRITE SAME implementation + - scsi: mpi3mr: Enhance handling of devices removed after controller reset + - scsi: mpi3mr: Update driver version to 8.5.0.0.0 + - scsi: mpi3mr: Split off bus_reset function from host_reset + - scsi: mpi3mr: Add support for SAS5116 PCI IDs + - scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 + - scsi: mpi3mr: Increase maximum number of PHYs to 64 from 32 + - scsi: mpi3mr: Add support for status reply descriptor + - scsi: mpi3mr: driver version upgrade to 8.5.0.0.50 + - scsi: mpi3mr: Refresh sdev queue depth after controller reset + - scsi: mpi3mr: Clean up block devices post controller reset + - scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable + State + - scsi: mpi3mr: Fetch correct device dev handle for status reply descriptor + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-1 + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-2 + - scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-3 + - scsi: mpi3mr: Update driver version to 8.5.1.0.0 + * The display becomes frozen after some time when a HDMI device is connected. + (LP: #2049027) + - drm/i915/dmc: Don't enable any pipe DMC events + * Audio balancing setting doesn't work with the cirrus codec (LP: #2051050) + - ALSA: hda/cs8409: Suppress vmaster control for Dolphin models + * partproke is broken on empty loopback device (LP: #2049689) + - block: Move checking GENHD_FL_NO_PART to bdev_add_partition() + * CVE-2023-51780 + - atm: Fix Use-After-Free in do_vcc_ioctl + * CVE-2023-6915 + - ida: Fix crash in ida_free when the bitmap is empty + * Update Ubuntu.md (LP: #2051176) + - [Packaging] update Ubuntu.md + * test_021_aslr_dapper_libs from ubuntu_qrt_kernel_security failed on K-5.19 / + J-OEM-6.1 / J-6.2 AMD64 (LP: #1983357) + - [Config]: set ARCH_MMAP_RND_{COMPAT_, }BITS to the maximum + * Intel E810-XXV - NETDEV WATCHDOG: (ice): transmit queue timed out + (LP: #2036239) + - ice: Add driver support for firmware changes for LAG + - ice: alter feature support check for SRIOV and LAG + * Mantic update: upstream stable patchset 2024-01-29 (LP: #2051584) + - Upstream stable to v6.1.67, v6.6.6 + - vdpa/mlx5: preserve CVQ vringh index + - hrtimers: Push pending hrtimers away from outgoing CPU earlier + - i2c: designware: Fix corrupted memory seen in the ISR + - netfilter: ipset: fix race condition between swap/destroy and kernel side + add/del/test + - zstd: Fix array-index-out-of-bounds UBSAN warning + - tg3: Move the [rt]x_dropped counters to tg3_napi + - tg3: Increment tx_dropped in tg3_tso_bug() + - kconfig: fix memory leak from range properties + - drm/amdgpu: correct chunk_ptr to a pointer to chunk. + - x86: Introduce ia32_enabled() + - x86/coco: Disable 32-bit emulation by default on TDX and SEV + - x86/entry: Convert INT 0x80 emulation to IDTENTRY + - x86/entry: Do not allow external 0x80 interrupts + - x86/tdx: Allow 32-bit emulation by default + - dt: dt-extract-compatibles: Handle cfile arguments in generator function + - dt: dt-extract-compatibles: Don't follow symlinks when walking tree + - platform/x86: asus-wmi: Move i8042 filter install to shared asus-wmi code + - of: dynamic: Fix of_reconfig_get_state_change() return value documentation + - platform/x86: wmi: Skip blocks with zero instances + - ipv6: fix potential NULL deref in fib6_add() + - octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam + - octeontx2-af: Check return value of nix_get_nixlf before using nixlf + - hv_netvsc: rndis_filter needs to select NLS + - r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE + - r8152: Add RTL8152_INACCESSIBLE checks to more loops + - r8152: Add RTL8152_INACCESSIBLE to r8156b_wait_loading_flash() + - r8152: Add RTL8152_INACCESSIBLE to r8153_pre_firmware_1() + - r8152: Add RTL8152_INACCESSIBLE to r8153_aldps_en() + - mlxbf-bootctl: correctly identify secure boot with development keys + - platform/mellanox: Add null pointer checks for devm_kasprintf() + - platform/mellanox: Check devm_hwmon_device_register_with_groups() return + value + - arcnet: restoring support for multiple Sohard Arcnet cards + - octeontx2-pf: consider both Rx and Tx packet stats for adaptive interrupt + coalescing + - net: stmmac: fix FPE events losing + - xsk: Skip polling event check for unbound socket + - octeontx2-af: fix a use-after-free in rvu_npa_register_reporters + - i40e: Fix unexpected MFS warning message + - iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero + - tcp: fix mid stream window clamp. + - ionic: fix snprintf format length warning + - ionic: Fix dim work handling in split interrupt mode + - ipv4: ip_gre: Avoid skb_pull() failure in ipgre_xmit() + - net: atlantic: Fix NULL dereference of skb pointer in + - net: hns: fix wrong head when modify the tx feature when sending packets + - net: hns: fix fake link up on xge port + - octeontx2-af: Adjust Tx credits when MCS external bypass is disabled + - octeontx2-af: Fix mcs sa cam entries size + - octeontx2-af: Fix mcs stats register address + - octeontx2-af: Add missing mcs flr handler call + - octeontx2-af: Update Tx link register range + - dt-bindings: interrupt-controller: Allow #power-domain-cells + - netfilter: nf_tables: fix 'exist' matching on bigendian arches + - netfilter: nf_tables: validate family when identifying table via handle + - netfilter: xt_owner: Fix for unsafe access of sk->sk_socket + - tcp: do not accept ACK of bytes we never sent + - bpf: sockmap, updating the sg structure should also update curr + - psample: Require 'CAP_NET_ADMIN' when joining "packets" group + - drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group + - mm/damon/sysfs: eliminate potential uninitialized variable warning + - tee: optee: Fix supplicant based device enumeration + - RDMA/hns: Fix unnecessary err return when using invalid congest control + algorithm + - RDMA/irdma: Do not modify to SQD on error + - RDMA/irdma: Add wait for suspend on SQD + - arm64: dts: rockchip: Expand reg size of vdec node for RK3328 + - arm64: dts: rockchip: Expand reg size of vdec node for RK3399 + - ASoC: fsl_sai: Fix no frame sync clock issue on i.MX8MP + - RDMA/rtrs-srv: Do not unconditionally enable irq + - RDMA/rtrs-clt: Start hb after path_up + - RDMA/rtrs-srv: Check return values while processing info request + - RDMA/rtrs-srv: Free srv_mr iu only when always_invalidate is true + - RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight + - RDMA/rtrs-clt: Fix the max_send_wr setting + - RDMA/rtrs-clt: Remove the warnings for req in_use check + - RDMA/bnxt_re: Correct module description string + - RDMA/irdma: Refactor error handling in create CQP + - RDMA/irdma: Fix UAF in irdma_sc_ccq_get_cqe_info() + - hwmon: (acpi_power_meter) Fix 4.29 MW bug + - ASoC: codecs: lpass-tx-macro: set active_decimator correct default value + - hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe() + - ASoC: wm_adsp: fix memleak in wm_adsp_buffer_populate + - RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz + - RDMA/irdma: Avoid free the non-cqp_request scratch + - drm/bridge: tc358768: select CONFIG_VIDEOMODE_HELPERS + - arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3 + - ARM: dts: imx6ul-pico: Describe the Ethernet PHY clock + - tracing: Fix a warning when allocating buffered events fails + - scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle() + - ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init + - ARM: dts: imx7: Declare timers compatible with fsl,imx6dl-gpt + - ARM: dts: imx28-xea: Pass the 'model' property + - riscv: fix misaligned access handling of C.SWSP and C.SDSP + - md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly() + - rethook: Use __rcu pointer for rethook::handler + - kprobes: consistent rcu api usage for kretprobe holder + - ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA + - nvme-pci: Add sleep quirk for Kingston drives + - io_uring: fix mutex_unlock with unreferenced ctx + - ALSA: usb-audio: Add Pioneer DJM-450 mixer controls + - ALSA: pcm: fix out-of-bounds in snd_pcm_state_names + - ALSA: hda/realtek: add new Framework laptop to quirks + - ALSA: hda/realtek: Add Framework laptop 16 to quirks + - ring-buffer: Test last update in 32bit version of __rb_time_read() + - nilfs2: fix missing error check for sb_set_blocksize call + - nilfs2: prevent WARNING in nilfs_sufile_set_segment_usage() + - cgroup_freezer: cgroup_freezing: Check if not frozen + - checkstack: fix printed address + - tracing: Always update snapshot buffer size + - tracing: Disable snapshot buffer when stopping instance tracers + - tracing: Fix incomplete locking when disabling buffered events + - tracing: Fix a possible race when disabling buffered events + - packet: Move reference count in packet_sock to atomic_long_t + - r8169: fix rtl8125b PAUSE frames blasting when suspended + - regmap: fix bogus error on regcache_sync success + - platform/surface: aggregator: fix recv_buf() return value + - hugetlb: fix null-ptr-deref in hugetlb_vma_lock_write + - mm: fix oops when filemap_map_pmd() without prealloc_pte + - powercap: DTPM: Fix missing cpufreq_cpu_put() calls + - md/raid6: use valid sector values to determine if an I/O should wait on the + reshape + - arm64: dts: mediatek: mt7622: fix memory node warning check + - arm64: dts: mediatek: mt8183-kukui-jacuzzi: fix dsi unnecessary cells + properties + - arm64: dts: mediatek: cherry: Fix interrupt cells for MT6360 on I2C7 + - arm64: dts: mediatek: mt8173-evb: Fix regulator-fixed node names + - arm64: dts: mediatek: mt8195: Fix PM suspend/resume with venc clocks + - arm64: dts: mediatek: mt8183: Fix unit address for scp reserved memory + - arm64: dts: mediatek: mt8183: Move thermal-zones to the root node + - arm64: dts: mediatek: mt8183-evb: Fix unit_address_vs_reg warning on ntc + - coresight: etm4x: Remove bogous __exit annotation for some functions + - hwtracing: hisi_ptt: Add dummy callback pmu::read() + - misc: mei: client.c: return negative error code in mei_cl_write + - misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write + - LoongArch: BPF: Don't sign extend memory load operand + - LoongArch: BPF: Don't sign extend function return value + - ring-buffer: Force absolute timestamp on discard of event + - tracing: Set actual size after ring buffer resize + - tracing: Stop current tracer when resizing buffer + - parisc: Reduce size of the bug_table on 64-bit kernel by half + - parisc: Fix asm operand number out of range build error in bug table + - arm64: dts: mediatek: add missing space before { + - arm64: dts: mt8183: kukui: Fix underscores in node names + - x86/sev: Fix kernel crash due to late update to read-only ghcb_version + - gpiolib: sysfs: Fix error handling on failed export + - drm/amd/amdgpu: Fix warnings in amdgpu/amdgpu_display.c + - drm/amdgpu: Add I2C EEPROM support on smu v13_0_6 + - usb: gadget: f_hid: fix report descriptor allocation + - serial: 8250_dw: Add ACPI ID for Granite Rapids-D UART + - parport: Add support for Brainboxes IX/UC/PX parallel cards + - cifs: Fix non-availability of dedup breaking generic/304 + - Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1" + - smb: client: fix potential NULL deref in parse_dfs_referrals() + - ARM: PL011: Fix DMA support + - serial: sc16is7xx: address RX timeout interrupt errata + - serial: 8250: 8250_omap: Clear UART_HAS_RHR_IT_DIS bit + - serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt + - serial: 8250_omap: Add earlycon support for the AM654 UART controller + - devcoredump: Send uevent once devcd is ready + - x86/CPU/AMD: Check vendor in the AMD microcode callback + - USB: gadget: core: adjust uevent timing on gadget unbind + - cifs: Fix flushing, invalidation and file size with copy_file_range() + - cifs: Fix flushing, invalidation and file size with FICLONE + - MIPS: kernel: Clear FPU states when setting up kernel threads + - KVM: s390/mm: Properly reset no-dat + - KVM: SVM: Update EFER software model on CR0 trap for SEV-ES + - MIPS: Loongson64: Reserve vgabios memory on boot + - MIPS: Loongson64: Handle more memory types passed from firmware + - MIPS: Loongson64: Enable DMA noncoherent support + - riscv: Kconfig: Add select ARM_AMBA to SOC_STARFIVE + - [Config] updateconfigs after enabling ARM_AMBA on riscv + - scsi: sd: Fix sshdr use in sd_suspend_common() + - nouveau: use an rwlock for the event lock. + - modpost: fix section mismatch message for RELA + - drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2) + - drm/amdgpu: finalizing mem_partitions at the end of GMC v9 sw_fini + - dm-crypt: start allocating with MAX_ORDER + - r8152: Hold the rtnl_lock for all of reset + - net: dsa: microchip: provide a list of valid protocols for xmit handler + - net/smc: fix missing byte order conversion in CLC handshake + - RDMA/core: Fix uninit-value access in ib_get_eth_speed() + - ARM: dts: imx6q: skov: fix ethernet clock regression + - ARM: dts: rockchip: Fix sdmmc_pwren's pinmux setting for RK3128 + - ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act + - firmware: arm_scmi: Extend perf protocol ops to get number of domains + - firmware: arm_scmi: Extend perf protocol ops to get information of a domain + - firmware: arm_scmi: Fix frequency truncation by promoting multiplier type + - firmware: arm_scmi: Simplify error path in scmi_dvfs_device_opps_add() + - RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned + - RDMA/irdma: Fix support for 64k pages + - io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring() + - io_uring/kbuf: check for buffer list readiness after NULL check + - arm64: dts: imx8-ss-lsio: Add PWM interrupts + - arm64: dts: freescale: imx8-ss-lsio: Fix #pwm-cells + - arm64: dts: imx93: correct mediamix power + - arm64: dts: imx8-apalis: set wifi regulator to always-on + - arm64: dts: rockchip: Fix eMMC Data Strobe PD on rk3588 + - scripts/gdb: fix lx-device-list-bus and lx-device-list-class + - ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA + - ALSA: hda/realtek: Apply quirk for ASUS UM3504DA + - ALSA: hda/realtek: fix speakers on XPS 9530 (2023) + - ALSA: hda/realtek: Add quirk for Lenovo Yoga Pro 7 + - lib/group_cpus.c: avoid acquiring cpu hotplug lock in group_cpus_evenly + - leds: trigger: netdev: fix RTNL handling to prevent potential deadlock + - nfp: flower: fix for take a mutex lock in soft irq context and rcu lock + - workqueue: Make sure that wq_unbound_cpumask is never empty + - drivers/base/cpu: crash data showing should depends on KEXEC_CORE + - mm/memory_hotplug: add missing mem_hotplug_lock + - mm/memory_hotplug: fix error handling in add_memory_resource() + - drm/atomic-helpers: Invoke end_fb_access while owning plane state + - drm/i915/mst: Fix .mode_valid_ctx() return values + - drm/i915/mst: Reject modes that require the bigjoiner + - arm64: dts: mt7986: change cooling trips + - arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3 + - arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization + - arm64: dts: mediatek: mt8186: fix clock names for power domains + - arm64: dts: mediatek: mt8186: Change gpu speedbin nvmem cell name + - coresight: Fix crash when Perf and sysfs modes are used concurrently + - coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb + - coresight: ultrasoc-smb: Config SMB buffer before register sink + - coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base + - ASoC: ops: add correct range check for limiting volume + - nvmem: Do not expect fixed layouts to grab a layout driver + - serial: ma35d1: Validate console index before assignment + - powerpc/ftrace: Fix stack teardown in ftrace_no_trace + - perf metrics: Avoid segv if default metricgroup isn't set + - ASoC: qcom: sc8280xp: Limit speaker digital volumes + - gcc-plugins: randstruct: Update code comment in relayout_struct() + - drm/amdgpu: Fix refclk reporting for SMU v13.0.6 + - drm/amdgpu: Add bootloader status check + - drm/amdgpu: Add bootloader wait for PSP v13 + - drm/amdgpu: Restrict bootloader wait to SMUv13.0.6 + - drm/amdgpu: update retry times for psp vmbx wait + - drm/amdgpu: update retry times for psp BL wait + - drm/amdgpu: Restrict extended wait to PSP v13.0.6 + - Upstream stable to v6.1.68, v6.6.7 + * i915 regression introduced with 5.5 kernel (LP: #2044131) + - drm/i915: Skip some timing checks on BXT/GLK DSI transcoders + * Mantic update: upstream stable patchset 2024-01-26 (LP: #2051366) + - cifs: Fix FALLOC_FL_ZERO_RANGE by setting i_size if EOF moved + - cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF moved + - smb: client: report correct st_size for SMB and NFS symlinks + - pinctrl: avoid reload of p state in list iteration + - firewire: core: fix possible memory leak in create_units() + - mmc: sdhci-pci-gli: Disable LPM during initialization + - mmc: cqhci: Increase recovery halt timeout + - mmc: cqhci: Warn of halt or task clear failure + - mmc: cqhci: Fix task clearing in CQE error recovery + - mmc: block: Retry commands in CQE error recovery + - mmc: block: Do not lose cache flush during CQE error recovery + - mmc: block: Be sure to wait while busy in CQE error recovery + - ALSA: hda: Disable power-save on KONTRON SinglePC + - ALSA: hda/realtek: Headset Mic VREF to 100% + - ALSA: hda/realtek: Add supported ALC257 for ChromeOS + - dm-verity: align struct dm_verity_fec_io properly + - scsi: Change SCSI device boolean fields to single bit flags + - scsi: sd: Fix system start for ATA devices + - drm/amd: Enable PCIe PME from D3 + - drm/amdgpu: Force order between a read and write to the same address + - drm/amd/display: Include udelay when waiting for INBOX0 ACK + - drm/amd/display: Remove min_dst_y_next_start check for Z8 + - drm/amd/display: Use DRAM speed from validation for dummy p-state + - drm/amd/display: Update min Z8 residency time to 2100 for DCN314 + - drm/amd/display: fix ABM disablement + - dm verity: initialize fec io before freeing it + - dm verity: don't perform FEC for failed readahead IO + - nvme: check for valid nvme_identify_ns() before using it + - powercap: DTPM: Fix unneeded conversions to micro-Watts + - cpufreq/amd-pstate: Fix the return value of amd_pstate_fast_switch() + - dma-buf: fix check in dma_resv_add_fence + - bcache: revert replacing IS_ERR_OR_NULL with IS_ERR + - iommu/vt-d: Add MTL to quirk list to skip TE disabling + - KVM: PPC: Book3S HV: Fix KVM_RUN clobbering FP/VEC user registers + - powerpc: Don't clobber f0/vs0 during fp|altivec register save + - parisc: Mark ex_table entries 32-bit aligned in assembly.h + - parisc: Mark ex_table entries 32-bit aligned in uaccess.h + - parisc: Use natural CPU alignment for bug_table + - parisc: Mark lock_aligned variables 16-byte aligned on SMP + - parisc: Drop the HP-UX ENOSYM and EREMOTERELEASE error codes + - parisc: Mark jump_table naturally aligned + - parisc: Ensure 32-bit alignment on parisc unwind section + - parisc: Mark altinstructions read-only and 32-bit aligned + - btrfs: add dmesg output for first mount and last unmount of a filesystem + - btrfs: ref-verify: fix memory leaks in btrfs_ref_tree_mod() + - btrfs: fix off-by-one when checking chunk map includes logical address + - btrfs: send: ensure send_fd is writable + - btrfs: make error messages more clear when getting a chunk map + - btrfs: fix 64bit compat send ioctl arguments not initializing version member + - auxdisplay: hd44780: move cursor home after clear display command + - serial: sc16is7xx: Put IOControl register into regmap_volatile + - serial: sc16is7xx: add missing support for rs485 devicetree properties + - dpaa2-eth: increase the needed headroom to account for alignment + - uapi: propagate __struct_group() attributes to the container union + - selftests/net: ipsec: fix constant out of range + - selftests/net: fix a char signedness issue + - selftests/net: unix: fix unused variable compiler warning + - selftests/net: mptcp: fix uninitialized variable warnings + - octeontx2-af: Fix possible buffer overflow + - net: stmmac: xgmac: Disable FPE MMC interrupts + - octeontx2-pf: Fix adding mbox work queue entry when num_vfs > 64 + - octeontx2-af: Install TC filter rules in hardware based on priority + - octeontx2-pf: Restore TC ingress police rules when interface is up + - r8169: prevent potential deadlock in rtl8169_close + - ravb: Fix races between ravb_tx_timeout_work() and net related ops + - net: ravb: Check return value of reset_control_deassert() + - net: ravb: Use pm_runtime_resume_and_get() + - net: ravb: Make write access to CXR35 first before accessing other EMAC + registers + - net: ravb: Start TX queues after HW initialization succeeded + - net: ravb: Stop DMA in case of failures on ravb_open() + - net: ravb: Keep reverse order of operations in ravb_remove() + - octeontx2-af: Initialize 'cntr_val' to fix uninitialized symbol error + - spi: Fix null dereference on suspend + - cpufreq: imx6q: Don't disable 792 Mhz OPP unnecessarily + - iommu/vt-d: Omit devTLB invalidation requests when TES=0 + - iommu/vt-d: Disable PCI ATS in legacy passthrough mode + - iommu/vt-d: Make context clearing consistent with context mapping + - drm/amd/pm: fix a memleak in aldebaran_tables_init + - mmc: sdhci-sprd: Fix vqmmc not shutting down after the card was pulled + - drm/amd/display: Fix MPCC 1DLUT programming + - r8169: fix deadlock on RTL8125 in jumbo mtu mode + - xen: simplify evtchn_do_upcall() call maze + - x86/xen: fix percpu vcpu_info allocation + - smb: client: fix missing mode bits for SMB symlinks + - ksmbd: fix possible deadlock in smb2_open + - drm/i915: Also check for VGA converter in eDP probe + - net: libwx: fix memory leak on msix entry + - drm/amdgpu: correct the amdgpu runtime dereference usage count + - drm/amdgpu: fix memory overflow in the IB test + - drm/amdgpu: Update EEPROM I2C address for smu v13_0_0 + - drm/amd/display: force toggle rate wa for first link training for a retimer + - ACPI: video: Use acpi_video_device for cooling-dev driver data + - iommu/vt-d: Fix incorrect cache invalidation for mm notification + - io_uring: free io_buffer_list entries via RCU + - io_uring: don't guard IORING_OFF_PBUF_RING with SETUP_NO_MMAP + - iommu: Avoid more races around device probe + - ext2: Fix ki_pos update for DIO buffered-io fallback case + - btrfs: free the allocated memory if btrfs_alloc_page_array() fails + - io_uring/kbuf: recycle freed mapped buffer ring entries + - media: v4l2-subdev: Fix a 64bit bug + - netdevsim: Don't accept device bound programs + - net: rswitch: Fix type of ret in rswitch_start_xmit() + - net: rswitch: Fix return value in rswitch_start_xmit() + - net: rswitch: Fix missing dev_kfree_skb_any() in error path + - wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta() + - wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during flush + - net: dsa: mv88e6xxx: fix marvell 6350 switch probing + - dpaa2-eth: recycle the RX buffer only after all processing done + - bpf: Add missed allocation hint for bpf_mem_cache_alloc_flags() + - neighbour: Fix __randomize_layout crash in struct neighbour + - efi/unaccepted: Fix off-by-one when checking for overlapping ranges + - ethtool: don't propagate EOPNOTSUPP from dumps + - bpf, sockmap: af_unix stream sockets need to hold ref for pair sock + - powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR- + IOV device + - s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir + - drm/amd/display: Refactor edp power control + - drm/amd/display: Remove power sequencing check + - drm/i915/gsc: Mark internal GSC engine with reserved uabi class + - drm/panel: starry-2081101qfh032011-53g: Fine tune the panel power sequence + - drm/panel: nt36523: fix return value check in nt36523_probe() + - cpufreq/amd-pstate: Fix scaling_min_freq and scaling_max_freq update + - cpufreq/amd-pstate: Only print supported EPP values for performance governor + - iommu: Fix printk arg in of_iommu_get_resv_regions() + - drm/amd/display: refactor ILR to make it work + - drm/amd/display: Reduce default backlight min from 5 nits to 1 nits + - Upstream stable to v6.1.66, v6.6.5 + * Mantic update: upstream stable patchset 2024-01-25 (LP: #2051231) + - afs: Fix afs_server_list to be cleaned up with RCU + - afs: Make error on cell lookup failure consistent with OpenAFS + - drm/panel: auo,b101uan08.3: Fine tune the panel power sequence + - drm/panel: simple: Fix Innolux G101ICE-L01 bus flags + - drm/panel: simple: Fix Innolux G101ICE-L01 timings + - wireguard: use DEV_STATS_INC() + - octeontx2-pf: Fix memory leak during interface down + - ata: pata_isapnp: Add missing error check for devm_ioport_map() + - drm/i915: do not clean GT table on error path + - drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full + - HID: fix HID device resource race between HID core and debugging support + - ipv4: Correct/silence an endian warning in __ip_do_redirect + - net: usb: ax88179_178a: fix failed operations during ax88179_reset + - net/smc: avoid data corruption caused by decline + - arm/xen: fix xen_vcpu_info allocation alignment + - octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx + queue than its PF + - amd-xgbe: handle corner-case during sfp hotplug + - amd-xgbe: handle the corner-case during tx completion + - amd-xgbe: propagate the correct speed and duplex status + - net: axienet: Fix check for partial TX checksum + - afs: Return ENOENT if no cell DNS record can be found + - afs: Fix file locking on R/O volumes to operate in local mode + - arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y + - i40e: Fix adding unsupported cloud filters + - nvmet: nul-terminate the NQNs passed in the connect command + - USB: dwc3: qcom: fix resource leaks on probe deferral + - USB: dwc3: qcom: fix ACPI platform device leak + - lockdep: Fix block chain corruption + - cifs: distribute channels across interfaces based on speed + - cifs: account for primary channel in the interface list + - cifs: fix leak of iface for primary channel + - MIPS: KVM: Fix a build warning about variable set but not used + - media: qcom: Initialise V4L2 async notifier later + - media: qcom: camss: Fix V4L2 async notifier error path + - media: qcom: camss: Fix genpd cleanup + - NFSD: Fix "start of NFS reply" pointer passed to nfsd_cache_update() + - NFSD: Fix checksum mismatches in the duplicate reply cache + - ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA + - swiotlb-xen: provide the "max_mapping_size" method + - bcache: replace a mistaken IS_ERR() by IS_ERR_OR_NULL() in + btree_gc_coalesce() + - md: fix bi_status reporting in md_end_clone_io + - bcache: fixup multi-threaded bch_sectors_dirty_init() wake-up race + - io_uring/fs: consider link->flags when getting path for LINKAT + - s390/dasd: protect device queue against concurrent access + - USB: serial: option: add Luat Air72*U series products + - hv_netvsc: fix race of netvsc and VF register_netdevice + - hv_netvsc: Fix race of register_netdevice_notifier and VF register + - hv_netvsc: Mark VF as slave before exposing it to user-mode + - dm-delay: fix a race between delay_presuspend and delay_bio + - bcache: check return value from btree_node_alloc_replacement() + - bcache: prevent potential division by zero error + - bcache: fixup init dirty data errors + - bcache: fixup lock c->root error + - usb: cdnsp: Fix deadlock issue during using NCM gadget + - USB: serial: option: add Fibocom L7xx modules + - USB: serial: option: fix FM101R-GL defines + - USB: serial: option: don't claim interface 4 for ZTE MF290 + - usb: typec: tcpm: Skip hard reset when in error recovery + - USB: dwc2: write HCINT with INTMASK applied + - usb: dwc3: Fix default mode initialization + - usb: dwc3: set the dma max_seg_size + - USB: dwc3: qcom: fix software node leak on probe errors + - USB: dwc3: qcom: fix wakeup after probe deferral + - io_uring: fix off-by one bvec index + - irqchip/gic-v3-its: Flush ITS tables correctly in non-coherent GIC designs + - drm/msm/dsi: use the correct VREG_CTRL_1 value for 4nm cphy + - s390/ism: ism driver implies smc protocol + - rxrpc: Fix RTT determination to use any ACK as a source + - rxrpc: Defer the response to a PING ACK until we've parsed it + - blk-cgroup: avoid to warn !rcu_read_lock_held() in blkg_lookup() + - fs: Pass AT_GETATTR_NOSEC flag to getattr interface function + - net: wangxun: fix kernel panic due to null pointer + - filemap: add a per-mapping stable writes flag + - block: update the stable_writes flag in bdev_add + - PM: tools: Fix sleepgraph syntax error + - net, vrf: Move dstats structure to core + - net: Move {l,t,d}stats allocation to core and convert veth & vrf + - bpf: Fix dev's rx stats for bpf_redirect_peer traffic + - drm/panel: boe-tv101wum-nl6: Fine tune Himax83102-j02 panel HFP and HBP + - s390/ipl: add missing IPL_TYPE_ECKD_DUMP case to ipl_init() + - net: veth: fix ethtool stats reporting + - vsock/test: fix SEQPACKET message bounds test + - net: ipa: fix one GSI register field width + - nvme: blank out authentication fabrics options if not configured + - mm: add a NO_INHERIT flag to the PR_SET_MDWE prctl + - prctl: Disable prctl(PR_SET_MDWE) on parisc + - kselftest/arm64: Fix output formatting for za-fork + - drm/msm/dpu: Add missing safe_lut_tbl in sc8280xp catalog + - drm/ast: Disconnect BMC if physical connector is connected + - thunderbolt: Set lane bonding bit only for downstream port + - ACPI: video: Use acpi_device_fix_up_power_children() + - ACPI: processor_idle: use raw_safe_halt() in acpi_idle_play_dead() + - ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA + - ACPI: PM: Add acpi_device_fix_up_power_children() function + - tls: fix NULL deref on tls_sw_splice_eof() with empty record + - dt-bindings: usb: microchip,usb5744: Add second supply + - usb: misc: onboard-hub: add support for Microchip USB5744 + - platform/x86/amd/pmc: adjust getting DRAM size behavior + - ALSA: hda: ASUS UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus + - ALSA: hda/realtek: Add quirks for ASUS 2024 Zenbooks + - veth: Use tstats per-CPU traffic counters + - USB: xhci-plat: fix legacy PHY double init + - usb: config: fix iteration issue in 'usb_get_bos_descriptor()' + - Upstream stable to v6.1.65, v6.6.4 + * Mantic update: v6.5.13 upstream stable release (LP: #2051142) + - locking/ww_mutex/test: Fix potential workqueue corruption + - btrfs: abort transaction on generation mismatch when marking eb as dirty + - lib/generic-radix-tree.c: Don't overflow in peek() + - x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN + - perf/core: Bail out early if the request AUX area is out of bound + - srcu: Fix srcu_struct node grpmask overflow on 64-bit systems + - selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config + - clocksource/drivers/timer-imx-gpt: Fix potential memory leak + - clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware + - srcu: Only accelerate on enqueue time + - smp,csd: Throw an error if a CSD lock is stuck for too long + - cpu/hotplug: Don't offline the last non-isolated CPU + - workqueue: Provide one lock class key per work_on_cpu() callsite + - x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size + - wifi: plfxlc: fix clang-specific fortify warning + - wifi: ath12k: Ignore fragments from uninitialized peer in dp + - wifi: mac80211_hwsim: fix clang-specific fortify warning + - wifi: mac80211: don't return unset power in ieee80211_get_tx_power() + - atl1c: Work around the DMA RX overflow issue + - bpf: Detect IP == ksym.end as part of BPF program + - wifi: ath9k: fix clang-specific fortify warnings + - wifi: ath12k: fix possible out-of-bound read in ath12k_htt_pull_ppdu_stats() + - wifi: ath10k: fix clang-specific fortify warning + - wifi: ath12k: fix possible out-of-bound write in + ath12k_wmi_ext_hal_reg_caps() + - ACPI: APEI: Fix AER info corruption when error status data has multiple + sections + - net: sfp: add quirk for Fiberstone GPON-ONU-34-20BI + - wifi: mt76: mt7921e: Support MT7992 IP in Xiaomi Redmibook 15 Pro (2023) + - net: annotate data-races around sk->sk_tx_queue_mapping + - net: annotate data-races around sk->sk_dst_pending_confirm + - wifi: ath12k: mhi: fix potential memory leak in ath12k_mhi_register() + - wifi: ath10k: Don't touch the CE interrupt registers after power up + - net: sfp: add quirk for FS's 2.5G copper SFP + - vsock: read from socket's error queue + - bpf: Ensure proper register state printing for cond jumps + - wifi: iwlwifi: mvm: fix size check for fw_link_id + - Bluetooth: btusb: Add date->evt_skb is NULL check + - Bluetooth: Fix double free in hci_conn_cleanup + - ACPI: EC: Add quirk for HP 250 G7 Notebook PC + - tsnep: Fix tsnep_request_irq() format-overflow warning + - gpiolib: acpi: Add a ignore interrupt quirk for Peaq C1010 + - platform/chrome: kunit: initialize lock for fake ec_dev + - of: address: Fix address translation when address-size is greater than 2 + - platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e + - drm/gma500: Fix call trace when psb_gem_mm_init() fails + - drm/amdkfd: ratelimited SQ interrupt messages + - drm/komeda: drop all currently held locks if deadlock happens + - drm/amd/display: Blank phantom OTG before enabling + - drm/amd/display: Don't lock phantom pipe on disabling + - drm/amd/display: add seamless pipe topology transition check + - drm/edid: Fixup h/vsync_end instead of h/vtotal + - md: don't rely on 'mddev->pers' to be set in mddev_suspend() + - drm/amdgpu: not to save bo in the case of RAS err_event_athub + - drm/amdkfd: Fix a race condition of vram buffer unref in svm code + - drm/amd: Update `update_pcie_parameters` functions to use uint8_t arguments + - drm/amd/display: use full update for clip size increase of large plane + source + - string.h: add array-wrappers for (v)memdup_user() + - kernel: kexec: copy user-array safely + - kernel: watch_queue: copy user-array safely + - drm_lease.c: copy user-array safely + - drm: vmwgfx_surface.c: copy user-array safely + - drm/msm/dp: skip validity check for DP CTS EDID checksum + - drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 + - drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga + - drm/amdgpu: Fix potential null pointer derefernce + - drm/panel: fix a possible null pointer dereference + - drm/panel/panel-tpo-tpg110: fix a possible null pointer dereference + - drm/radeon: fix a possible null pointer dereference + - drm/amdgpu/vkms: fix a possible null pointer dereference + - drm/panel: st7703: Pick different reset sequence + - drm/amdkfd: Fix shift out-of-bounds issue + - drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL + - drm/amd: Disable PP_PCIE_DPM_MASK when dynamic speed switching not supported + - drm/amd/display: fix num_ways overflow error + - drm/amd: check num of link levels when update pcie param + - arm64: dts: ls208xa: use a pseudo-bus to constrain usb dma size + - selftests/efivarfs: create-read: fix a resource leak + - ASoC: mediatek: mt8188-mt6359: support dynamic pinctrl + - ASoC: soc-card: Add storage for PCI SSID + - ASoC: SOF: Pass PCI SSID to machine driver + - crypto: pcrypt - Fix hungtask for PADATA_RESET + - ASoC: SOF: ipc4: handle EXCEPTION_CAUGHT notification from firmware + - RDMA/hfi1: Use FIELD_GET() to extract Link Width + - scsi: hisi_sas: Set debugfs_dir pointer to NULL after removing debugfs + - scsi: ibmvfc: Remove BUG_ON in the case of an empty event pool + - fs/jfs: Add check for negative db_l2nbperpage + - fs/jfs: Add validity check for db_maxag and db_agpref + - jfs: fix array-index-out-of-bounds in dbFindLeaf + - jfs: fix array-index-out-of-bounds in diAlloc + - HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround + - ARM: 9320/1: fix stack depot IRQ stack filter + - ALSA: hda: Fix possible null-ptr-deref when assigning a stream + - gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound + - PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields + - PCI: mvebu: Use FIELD_PREP() with Link Width + - atm: iphase: Do PCI error checks on own line + - PCI: Do error check on own line to split long "if" conditions + - scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup() + - PCI: Use FIELD_GET() to extract Link Width + - PCI: Extract ATS disabling to a helper function + - PCI: Disable ATS for specific Intel IPU E2000 devices + - PCI: dwc: Add dw_pcie_link_set_max_link_width() + - PCI: dwc: Add missing PCI_EXP_LNKCAP_MLW handling + - misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller + - PCI: Use FIELD_GET() in Sapphire RX 5600 XT Pulse quirk + - ASoC: Intel: soc-acpi-cht: Add Lenovo Yoga Tab 3 Pro YT3-X90 quirk + - crypto: hisilicon/qm - prevent soft lockup in receive loop + - HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W + - exfat: support handle zero-size directory + - mfd: intel-lpss: Add Intel Lunar Lake-M PCI IDs + - iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe() + - thunderbolt: Apply USB 3.x bandwidth quirk only in software connection + manager + - tty: vcc: Add check for kstrdup() in vcc_probe() + - dt-bindings: phy: qcom,snps-eusb2-repeater: Add magic tuning overrides + - phy: qualcomm: phy-qcom-eusb2-repeater: Use regmap_fields + - phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs + - usb: dwc3: core: configure TX/RX threshold for DWC3_IP + - usb: ucsi: glink: use the connector orientation GPIO to provide switch + events + - soundwire: dmi-quirks: update HP Omen match + - f2fs: fix error path of __f2fs_build_free_nids + - f2fs: fix error handling of __get_node_page + - usb: host: xhci: Avoid XHCI resume delay if SSUSB device is not present + - usb: gadget: f_ncm: Always set current gadget in ncm_bind() + - 9p/trans_fd: Annotate data-racy writes to file::f_flags + - 9p: v9fs_listxattr: fix %s null argument warning + - i3c: mipi-i3c-hci: Fix out of bounds access in hci_dma_irq_handler + - i2c: i801: Add support for Intel Birch Stream SoC + - i2c: fix memleak in i2c_new_client_device() + - i2c: sun6i-p2wi: Prevent potential division by zero + - virtio-blk: fix implicit overflow on virtio_max_dma_size + - i3c: master: mipi-i3c-hci: Fix a kernel panic for accessing DAT_data. + - media: gspca: cpia1: shift-out-of-bounds in set_flicker + - media: vivid: avoid integer overflow + - media: ipu-bridge: increase sensor_name size + - gfs2: ignore negated quota changes + - gfs2: fix an oops in gfs2_permission + - media: cobalt: Use FIELD_GET() to extract Link Width + - media: ccs: Fix driver quirk struct documentation + - media: imon: fix access to invalid resource for the second interface + - drm/amd/display: Avoid NULL dereference of timing generator + - kgdb: Flush console before entering kgdb on panic + - riscv: VMAP_STACK overflow detection thread-safe + - i2c: dev: copy userspace array safely + - ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings + - drm/qxl: prevent memory leak + - ALSA: hda/realtek: Add quirk for ASUS UX7602ZM + - drm/amdgpu: fix software pci_unplug on some chips + - pwm: Fix double shift bug + - mtd: rawnand: tegra: add missing check for platform_get_irq() + - wifi: iwlwifi: Use FW rate for non-data frames + - sched/core: Optimize in_task() and in_interrupt() a bit + - samples/bpf: syscall_tp_user: Rename num_progs into nr_tests + - samples/bpf: syscall_tp_user: Fix array out-of-bound access + - dt-bindings: serial: fix regex pattern for matching serial node children + - SUNRPC: ECONNRESET might require a rebind + - mtd: rawnand: intel: check return value of devm_kasprintf() + - mtd: rawnand: meson: check return value of devm_kasprintf() + - drm/i915/mtl: avoid stringop-overflow warning + - NFSv4.1: fix handling NFS4ERR_DELAY when testing for session trunking + - SUNRPC: Add an IS_ERR() check back to where it was + - NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO + - SUNRPC: Fix RPC client cleaned up the freed pipefs dentries + - RISC-V: hwprobe: Fix vDSO SIGSEGV + - riscv: provide riscv-specific is_trap_insn() + - gfs2: Silence "suspicious RCU usage in gfs2_permission" warning + - drm/i915/tc: Fix -Wformat-truncation in intel_tc_port_init + - vdpa_sim_blk: allocate the buffer zeroed + - vhost-vdpa: fix use after free in vhost_vdpa_probe() + - gcc-plugins: randstruct: Only warn about true flexible arrays + - bpf: handle ldimm64 properly in check_cfg() + - bpf: fix precision backtracking instruction iteration + - net: set SOCK_RCU_FREE before inserting socket into hashtable + - ipvlan: add ipvlan_route_v6_outbound() helper + - tty: Fix uninit-value access in ppp_sync_receive() + - xen/events: avoid using info_for_irq() in xen_send_IPI_one() + - net: hns3: fix add VLAN fail issue + - net: hns3: add barrier in vf mailbox reply process + - net: hns3: fix incorrect capability bit display for copper port + - net: hns3: fix out-of-bounds access may occur when coalesce info is read via + debugfs + - net: hns3: fix variable may not initialized problem in hns3_init_mac_addr() + - net: hns3: fix VF reset fail issue + - net: hns3: fix VF wrong speed and duplex issue + - tipc: Fix kernel-infoleak due to uninitialized TLV value + - net: mvneta: fix calls to page_pool_get_stats + - ppp: limit MRU to 64K + - xen/events: fix delayed eoi list handling + - blk-mq: make sure active queue usage is held for bio_integrity_prep() + - ptp: annotate data-race around q->head and q->tail + - bonding: stop the device in bond_setup_by_slave() + - net: ethernet: cortina: Fix max RX frame define + - net: ethernet: cortina: Handle large frames + - net: ethernet: cortina: Fix MTU max setting + - af_unix: fix use-after-free in unix_stream_read_actor() + - netfilter: nf_conntrack_bridge: initialize err to 0 + - netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval() + - netfilter: nf_tables: bogus ENOENT when destroying element which does not + exist + - net: stmmac: fix rx budget limit check + - net: stmmac: avoid rx queue overrun + - pds_core: use correct index to mask irq + - pds_core: fix up some format-truncation complaints + - gve: Fixes for napi_poll when budget is 0 + - io_uring/fdinfo: remove need for sqpoll lock for thread/pid retrieval + - net/mlx5: Decouple PHC .adjtime and .adjphase implementations + - net/mlx5e: fix double free of encap_header + - net/mlx5e: fix double free of encap_header in update funcs + - net/mlx5e: Fix pedit endianness + - net/mlx5: Consolidate devlink documentation in devlink/mlx5.rst + - net/mlx5e: Make tx_port_ts logic resilient to out-of-order CQEs + - net/mlx5e: Add recovery flow for tx devlink health reporter for unhealthy + PTP SQ + - net/mlx5e: Update doorbell for port timestamping CQ before the software + counter + - net/mlx5: Increase size of irq name buffer + - net/mlx5e: Reduce the size of icosq_str + - net/mlx5e: Check return value of snprintf writing to fw_version buffer + - net/mlx5e: Check return value of snprintf writing to fw_version buffer for + representors + - net: sched: do not offload flows with a helper in act_ct + - macvlan: Don't propagate promisc change to lower dev in passthru + - tools/power/turbostat: Fix a knl bug + - tools/power/turbostat: Enable the C-state Pre-wake printing + - scsi: ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1 + - cifs: spnego: add ';' in HOST_KEY_LEN + - cifs: fix check of rc in function generate_smb3signingkey + - perf/core: Fix cpuctx refcounting + - i915/perf: Fix NULL deref bugs with drm_dbg() calls + - perf: arm_cspmu: Reject events meant for other PMUs + - drivers: perf: Check find_first_bit() return value + - media: venus: hfi: add checks to perform sanity on queue pointers + - perf intel-pt: Fix async branch flags + - powerpc/perf: Fix disabling BHRB and instruction sampling + - randstruct: Fix gcc-plugin performance mode to stay in group + - bpf: Fix check_stack_write_fixed_off() to correctly spill imm + - bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END + - scsi: mpt3sas: Fix loop logic + - scsi: megaraid_sas: Increase register read retry rount from 3 to 30 for + selected registers + - scsi: ufs: qcom: Update PHY settings only when scaling to higher gears + - scsi: qla2xxx: Fix system crash due to bad pointer access + - scsi: ufs: core: Fix racing issue between ufshcd_mcq_abort() and ISR + - crypto: x86/sha - load modules based on CPU features + - x86/PCI: Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 + - x86/apic/msi: Fix misconfigured non-maskable MSI quirk + - x86/cpu/hygon: Fix the CPU topology evaluation for real + - KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space + - KVM: x86: Ignore MSR_AMD64_TW_CFG access + - KVM: x86: Clear bit12 of ICR after APIC-write VM-exit + - KVM: x86: Fix lapic timer interrupt lost after loading a snapshot. + - mmc: sdhci-pci-gli: GL9755: Mask the replay timer timeout of AER + - sched: psi: fix unprivileged polling against cgroups + - audit: don't take task_lock() in audit_exe_compare() code path + - audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() + - proc: sysctl: prevent aliased sysctls from getting passed to init + - tty/sysrq: replace smp_processor_id() with get_cpu() + - tty: serial: meson: fix hard LOCKUP on crtscts mode + - hvc/xen: fix console unplug + - hvc/xen: fix error path in xen_hvc_init() to always register frontend driver + - hvc/xen: fix event channel handling for secondary consoles + - PCI/sysfs: Protect driver's D3cold preference from user space + - mm/damon/sysfs: remove requested targets when online-commit inputs + - mm/damon/sysfs: update monitoring target regions for online input commit + - watchdog: move softlockup_panic back to early_param + - iommufd: Fix missing update of domains_itree after splitting iopt_area + - fbdev: stifb: Make the STI next font pointer a 32-bit signed offset + - dm crypt: account large pages in cc->n_allocated_pages + - mm/damon/lru_sort: avoid divide-by-zero in hot threshold calculation + - mm/damon/ops-common: avoid divide-by-zero during region hotness calculation + - mm/damon: implement a function for max nr_accesses safe calculation + - mm/damon/core: avoid divide-by-zero during monitoring results update + - mm/damon/sysfs-schemes: handle tried region directory allocation failure + - mm/damon/sysfs-schemes: handle tried regions sysfs directory allocation + failure + - mm/damon/sysfs: check error from damon_sysfs_update_target() + - parisc: Add nop instructions after TLB inserts + - ACPI: resource: Do IRQ override on TongFang GMxXGxx + - regmap: Ensure range selector registers are updated after cache sync + - wifi: ath11k: fix temperature event locking + - wifi: ath11k: fix dfs radar event locking + - wifi: ath11k: fix htt pktlog locking + - wifi: ath11k: fix gtk offload status event locking + - wifi: ath12k: fix htt mlo-offset event locking + - wifi: ath12k: fix dfs-radar and temperature event locking + - mmc: meson-gx: Remove setting of CMD_CFG_ERROR + - genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware + - sched/core: Fix RQCF_ACT_SKIP leak + - KEYS: trusted: tee: Refactor register SHM usage + - KEYS: trusted: Rollback init_trusted() consistently + - PCI: keystone: Don't discard .remove() callback + - PCI: keystone: Don't discard .probe() callback + - arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer + - arm64: module: Fix PLT counting when CONFIG_RANDOMIZE_BASE=n + - parisc/agp: Use 64-bit LE values in SBA IOMMU PDIR table + - parisc/pdc: Add width field to struct pdc_model + - parisc/power: Add power soft-off when running on qemu + - cpufreq: stats: Fix buffer overflow detection in trans_stats() + - powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() + - clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data + - clk: visconti: Fix undefined behavior bug in struct visconti_pll_provider + - clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks + - clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks + - ksmbd: fix recursive locking in vfs helpers + - ksmbd: handle malformed smb1 message + - ksmbd: fix slab out of bounds write in smb_inherit_dacl() + - mmc: vub300: fix an error code + - mmc: sdhci_am654: fix start loop index for TAP value parsing + - mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A + - PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() + - PCI: kirin: Don't discard .remove() callback + - PCI: exynos: Don't discard .remove() callback + - wifi: wilc1000: use vmm_table as array in wilc struct + - svcrdma: Drop connection after an RDMA Read error + - rcu/tree: Defer setting of jiffies during stall reset + - arm64: dts: qcom: ipq6018: Fix hwlock index for SMEM + - dt-bindings: timer: renesas,rz-mtu3: Fix overflow/underflow interrupt names + - PM: hibernate: Use __get_safe_page() rather than touching the list + - PM: hibernate: Clean up sync_read handling in snapshot_write_next() + - rcu: kmemleak: Ignore kmemleak false positives when RCU-freeing objects + - btrfs: don't arbitrarily slow down delalloc if we're committing + - thermal: intel: powerclamp: fix mismatch in get function for max_idle + - arm64: dts: qcom: ipq5332: Fix hwlock index for SMEM + - arm64: dts: qcom: ipq8074: Fix hwlock index for SMEM + - firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit + - ACPI: FPDT: properly handle invalid FPDT subtables + - arm64: dts: qcom: ipq9574: Fix hwlock index for SMEM + - arm64: dts: qcom: ipq6018: Fix tcsr_mutex register size + - leds: trigger: netdev: Move size check in set_device_name + - mfd: qcom-spmi-pmic: Fix reference leaks in revid helper + - mfd: qcom-spmi-pmic: Fix revid implementation + - ima: annotate iint mutex to avoid lockdep false positive warnings + - ima: detect changes to the backing overlay file + - netfilter: nf_tables: split async and sync catchall in two functions + - ASoC: soc-dai: add flag to mute and unmute stream during trigger + - ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag + - selftests/resctrl: Fix uninitialized .sa_flags + - selftests/resctrl: Remove duplicate feature check from CMT test + - selftests/resctrl: Move _GNU_SOURCE define into Makefile + - selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests + - hid: lenovo: Resend all settings on reset_resume for compact keyboards + - ASoC: codecs: wsa-macro: fix uninitialized stack variables with name prefix + - jbd2: fix potential data lost in recovering journal raced with synchronizing + fs bdev + - quota: explicitly forbid quota files from being encrypted + - kernel/reboot: emergency_restart: Set correct system_state + - i2c: core: Run atomic i2c xfer when !preemptible + - selftests/clone3: Fix broken test under !CONFIG_TIME_NS + - tracing: Have the user copy of synthetic event address use correct context + - driver core: Release all resources during unbind before updating device + links + - mcb: fix error handling for different scenarios when parsing + - dmaengine: stm32-mdma: correct desc prep when channel running + - s390/mm: add missing arch_set_page_dat() call to vmem_crst_alloc() + - s390/cmma: fix detection of DAT pages + - mm/cma: use nth_page() in place of direct struct page manipulation + - mm/memory_hotplug: use pfn math in place of direct struct page manipulation + - mm: make PR_MDWE_REFUSE_EXEC_GAIN an unsigned long + - mtd: cfi_cmdset_0001: Byte swap OTP info + - cxl/region: Do not try to cleanup after cxl_region_setup_targets() fails + - i3c: master: cdns: Fix reading status register + - i3c: master: svc: fix race condition in ibi work thread + - i3c: master: svc: fix wrong data return when IBI happen during start frame + - i3c: master: svc: fix ibi may not return mandatory data byte + - i3c: master: svc: fix check wrong status register in irq handler + - i3c: master: svc: fix SDA keep low when polling IBIWON timeout happen + - i3c: master: svc: fix random hot join failure since timeout error + - cxl/region: Fix x1 root-decoder granularity calculations + - cxl/port: Fix delete_endpoint() vs parent unregistration race + - pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable + - pmdomain: amlogic: Fix mask for the second NNA mem PD domain + - pmdomain: imx: Make imx pgc power domain also set the fwnode + - PCI: qcom-ep: Add dedicated callback for writing to DBI2 registers + - PCI: Lengthen reset delay for VideoPropulsion Torrent QN16e card + - torture: Add a kthread-creation callback to _torture_create_kthread() + - torture: Add lock_torture writer_fifo module parameter + - torture: Make torture_hrtimeout_*() use TASK_IDLE + - torture: Move stutter_wait() timeouts to hrtimers + - torture: Make torture_hrtimeout_ns() take an hrtimer mode parameter + - rcutorture: Fix stuttering races and other issues + - mm/hugetlb: prepare hugetlb_follow_page_mask() for FOLL_PIN + - mm/hugetlb: use nth_page() in place of direct struct page manipulation + - parisc: Prevent booting 64-bit kernels on PA1.x machines + - parisc/pgtable: Do not drop upper 5 address bits of physical address + - parisc/power: Fix power soft-off when running on qemu + - xhci: Enable RPM on controllers that support low-power states + - fs: add ctime accessors infrastructure + - smb3: fix creating FIFOs when mounting with "sfu" mount option + - smb3: fix touch -h of symlink + - smb3: allow dumping session and tcon id to improve stats analysis and + debugging + - smb3: fix caching of ctime on setxattr + - smb: client: fix use-after-free bug in cifs_debug_data_proc_show() + - smb: client: fix use-after-free in smb2_query_info_compound() + - smb: client: fix potential deadlock when releasing mids + - cifs: reconnect helper should set reconnect for the right channel + - cifs: force interface update before a fresh session setup + - cifs: do not reset chan_max if multichannel is not supported at mount + - cifs: Fix encryption of cleared, but unset rq_iter data buffers + - xfs: recovery should not clear di_flushiter unconditionally + - btrfs: zoned: wait for data BG to be finished on direct IO allocation + - ALSA: info: Fix potential deadlock at disconnection + - ALSA: hda/realtek: Enable Mute LED on HP 255 G8 + - ALSA: hda/realtek - Add Dell ALC295 to pin fall back table + - ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC + - ALSA: hda/realtek: Enable Mute LED on HP 255 G10 + - ALSA: hda/realtek: Add quirks for HP Laptops + - Revert ncsi: Propagate carrier gain/loss events to the NCSI controller + - Revert "i2c: pxa: move to generic GPIO recovery" + - lsm: fix default return value for vm_enough_memory + - lsm: fix default return value for inode_getsecctx + - sbsa_gwdt: Calculate timeout with 64-bit math + - i2c: designware: Disable TX_EMPTY irq while waiting for block length byte + - s390/ap: fix AP bus crash on early config change callback invocation + - net: ethtool: Fix documentation of ethtool_sprintf() + - net: dsa: lan9303: consequently nested-lock physical MDIO + - net: phylink: initialize carrier state at creation + - gfs2: don't withdraw if init_threads() got interrupted + - i2c: i801: fix potential race in i801_block_transaction_byte_by_byte + - f2fs: do not return EFSCORRUPTED, but try to run online repair + - f2fs: set the default compress_level on ioctl + - f2fs: avoid format-overflow warning + - f2fs: split initial and dynamic conditions for extent_cache + - media: lirc: drop trailing space from scancode transmit + - media: sharp: fix sharp encoding + - media: venus: hfi_parser: Add check to keep the number of codecs within + range + - media: venus: hfi: fix the check to handle session buffer requirement + - media: venus: hfi: add checks to handle capabilities from firmware + - media: ccs: Correctly initialise try compose rectangle + - drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection + - drm/mediatek/dp: fix memory leak on ->get_edid callback error path + - dm-bufio: fix no-sleep mode + - dm-verity: don't use blocking calls from tasklets + - nfsd: fix file memleak on client_opens_release + - NFSD: Update nfsd_cache_append() to use xdr_stream + - LoongArch: Mark __percpu functions as always inline + - riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause + - riscv: put interrupt entries into .irqentry.text + - riscv: mm: Update the comment of CONFIG_PAGE_OFFSET + - riscv: correct pt_level name via pgtable_l5/4_enabled + - riscv: kprobes: allow writing to x0 + - mmc: sdhci-pci-gli: A workaround to allow GL9750 to enter ASPM L1.2 + - mm: fix for negative counter: nr_file_hugepages + - mm: kmem: drop __GFP_NOFAIL when allocating objcg vectors + - mptcp: deal with large GSO size + - mptcp: add validity check for sending RM_ADDR + - mptcp: fix setsockopt(IP_TOS) subflow locking + - selftests: mptcp: fix fastclose with csum failure + - mmc: sdhci-pci-gli: GL9750: Mask the replay timer timeout of AER + - media: qcom: camss: Fix pm_domain_on sequence in probe + - media: qcom: camss: Fix vfe_get() error jump + - media: qcom: camss: Fix VFE-17x vfe_disable_output() + - media: qcom: camss: Fix VFE-480 vfe_disable_output() + - media: qcom: camss: Fix missing vfe_lite clocks check + - media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3 + - media: qcom: camss: Fix invalid clock enable bit disjunction + - media: qcom: camss: Fix csid-gen2 for test pattern generator + - ext4: fix race between writepages and remount + - ext4: make sure allocate pending entry not fail + - ext4: apply umask if ACL support is disabled + - ext4: correct offset of gdb backup in non meta_bg group to update_backups + - ext4: mark buffer new if it is unwritten to avoid stale data exposure + - ext4: correct return value of ext4_convert_meta_bg + - ext4: correct the start block of counting reserved clusters + - ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks + - ext4: add missed brelse in update_backups + - ext4: properly sync file size update after O_SYNC direct IO + - ext4: fix racy may inline data check in dio write + - drm/amd/pm: Handle non-terminated overdrive commands. + - drm: bridge: it66121: ->get_edid callback must not return err pointers + - drm/i915/mtl: Support HBR3 rate with C10 phy and eDP in MTL + - drm/i915: Bump GLK CDCLK frequency when driving multiple pipes + - drm/i915: Fix potential spectre vulnerability + - drm/i915: Flush WC GGTT only on required platforms + - drm/amdgpu/smu13: drop compute workload workaround + - drm/amdgpu: don't use pci_is_thunderbolt_attached() + - drm/amdgpu: fix GRBM read timeout when do mes_self_test + - drm/amdgpu: add a retry for IP discovery init + - drm/amdgpu: don't use ATRM for external devices + - drm/amdgpu: fix error handling in amdgpu_vm_init + - drm/amdgpu: fix error handling in amdgpu_bo_list_get() + - drm/amdgpu: lower CS errors to debug severity + - drm/amdgpu: Fix possible null pointer dereference + - drm/amd/display: Guard against invalid RPTR/WPTR being set + - drm/amd/display: Fix DSC not Enabled on Direct MST Sink + - drm/amd/display: fix a NULL pointer dereference in amdgpu_dm_i2c_xfer() + - drm/amd/display: Enable fast plane updates on DCN3.2 and above + - drm/amd/display: Change the DMCUB mailbox memory location from FB to inbox + - powerpc/powernv: Fix fortify source warnings in opal-prd.c + - tracing: Have trace_event_file have ref counters + - net/mlx5e: Avoid referencing skb after free-ing in drop path of + mlx5e_sq_xmit_wqe + - net/mlx5e: Track xmit submission to PTP WQ after populating metadata map + - Linux 6.5.13 + * Mantic update: v6.5.12 upstream stable release (LP: #2051129) + - hwmon: (nct6775) Fix incorrect variable reuse in fan_div calculation + - numa: Generalize numa_map_to_online_node() + - sched/topology: Fix sched_numa_find_nth_cpu() in CPU-less case + - sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case + - sched/fair: Fix cfs_rq_is_decayed() on !SMP + - iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user() + - sched/uclamp: Set max_spare_cap_cpu even if max_spare_cap is 0 + - sched/uclamp: Ignore (util == 0) optimization in feec() when p_util_max = 0 + - objtool: Propagate early errors + - sched: Fix stop_one_cpu_nowait() vs hotplug + - nfsd: Handle EOPENSTALE correctly in the filecache + - vfs: fix readahead(2) on block devices + - writeback, cgroup: switch inodes with dirty timestamps to release dying + cgwbs + - x86/srso: Fix SBPB enablement for (possible) future fixed HW + - x86/srso: Print mitigation for retbleed IBPB case + - x86/srso: Fix vulnerability reporting for missing microcode + - x86/srso: Fix unret validation dependencies + - futex: Don't include process MM in futex key on no-MMU + - x86/numa: Introduce numa_fill_memblks() + - ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window + - x86/sev-es: Allow copy_from_kernel_nofault() in earlier boot + - x86/boot: Fix incorrect startup_gdt_descr.size + - cpu/hotplug: Remove dependancy against cpu_primary_thread_mask + - cpu/SMT: Create topology_smt_thread_allowed() + - cpu/SMT: Make SMT control more robust against enumeration failures + - x86/apic: Fake primary thread mask for XEN/PV + - srcu: Fix callbacks acceleration mishandling + - drivers/clocksource/timer-ti-dm: Don't call clk_get_rate() in stop function + - x86/nmi: Fix out-of-order NMI nesting checks & false positive warning + - pstore/platform: Add check for kstrdup + - perf: Optimize perf_cgroup_switch() + - selftests/x86/lam: Zero out buffer for readlink() + - PCI/MSI: Provide stubs for IMS functions + - string: Adjust strtomem() logic to allow for smaller sources + - genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() + - irqchip/sifive-plic: Fix syscore registration for multi-socket systems + - wifi: ath12k: fix undefined behavior with __fls in dp + - wifi: cfg80211: add flush functions for wiphy work + - wifi: mac80211: move radar detect work to wiphy work + - wifi: mac80211: move scan work to wiphy work + - wifi: mac80211: move offchannel works to wiphy work + - wifi: mac80211: move sched-scan stop work to wiphy work + - wifi: mac80211: fix RCU usage warning in mesh fast-xmit + - wifi: cfg80211: fix off-by-one in element defrag + - wifi: mac80211: fix # of MSDU in A-MSDU calculation + - wifi: iwlwifi: honor the enable_ini value + - wifi: iwlwifi: don't use an uninitialized variable + - i40e: fix potential memory leaks in i40e_remove() + - iavf: Fix promiscuous mode configuration flow messages + - selftests/bpf: Correct map_fd to data_fd in tailcalls + - bpf, x86: save/restore regs with BPF_DW size + - bpf, x86: allow function arguments up to 12 for TRACING + - bpf, x64: Fix tailcall infinite loop + - wifi: cfg80211: fix kernel-doc for wiphy_delayed_work_flush() + - udp: introduce udp->udp_flags + - udp: move udp->no_check6_tx to udp->udp_flags + - udp: move udp->no_check6_rx to udp->udp_flags + - udp: move udp->gro_enabled to udp->udp_flags + - udp: add missing WRITE_ONCE() around up->encap_rcv + - udp: move udp->accept_udp_{l4|fraglist} to udp->udp_flags + - udp: lockless UDP_ENCAP_L2TPINUDP / UDP_GRO + - udp: annotate data-races around udp->encap_type + - udplite: remove UDPLITE_BIT + - udplite: fix various data-races + - selftests/bpf: Skip module_fentry_shadow test when bpf_testmod is not + available + - tcp: call tcp_try_undo_recovery when an RTOd TFO SYNACK is ACKed + - bpf: Fix kfunc callback register type handling + - gve: Use size_add() in call to struct_size() + - mlxsw: Use size_mul() in call to struct_size() + - tls: Use size_add() in call to struct_size() + - tipc: Use size_add() in calls to struct_size() + - net: spider_net: Use size_add() in call to struct_size() + - net: ethernet: mtk_wed: fix EXT_INT_STATUS_RX_FBUF definitions for MT7986 + SoC + - wifi: rtw88: debug: Fix the NULL vs IS_ERR() bug for debugfs_create_file() + - wifi: ath12k: fix DMA unmap warning on NULL DMA address + - wifi: ath11k: fix boot failure with one MSI vector + - wifi: mac80211: fix check for unusable RX result + - PM: sleep: Fix symbol export for _SIMPLE_ variants of _PM_OPS() + - cpufreq: tegra194: fix warning due to missing opp_put + - wifi: mt76: mt7603: rework/fix rx pse hang check + - wifi: mt76: mt7603: improve watchdog reset reliablity + - wifi: mt76: mt7603: improve stuck beacon handling + - wifi: mt76: connac: move connac3 definitions in mt76_connac3_mac.h + - wifi: mt76: remove unused error path in mt76_connac_tx_complete_skb + - wifi: mt76: mt7996: set correct wcid in txp + - wifi: mt76: mt7996: fix beamform mcu cmd configuration + - wifi: mt76: mt7996: fix beamformee ss subfield in EHT PHY cap + - wifi: mt76: mt7996: fix wmm queue mapping + - wifi: mt76: mt7996: fix rx rate report for CBW320-2 + - wifi: mt76: mt7996: fix TWT command format + - wifi: mt76: update beacon size limitation + - wifi: mt76: fix potential memory leak of beacon commands + - wifi: mt76: get rid of false alamrs of tx emission issues + - wifi: mt76: fix per-band IEEE80211_CONF_MONITOR flag comparison + - wifi: mt76: mt7915: fix beamforming availability check + - wifi: ath: dfs_pattern_detector: Fix a memory initialization issue + - tcp_metrics: add missing barriers on delete + - tcp_metrics: properly set tp->snd_ssthresh in tcp_init_metrics() + - tcp_metrics: do not create an entry from tcp_init_metrics() + - wifi: rtlwifi: fix EDCA limit set by BT coexistence + - ACPI: property: Allow _DSD buffer data only for byte accessors + - ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100 + - can: etas_es58x: rework the version check logic to silence -Wformat- + truncation + - can: etas_es58x: add missing a blank line after declaration + - wifi: ath11k: fix Tx power value during active CAC + - can: dev: can_restart(): don't crash kernel if carrier is OK + - can: dev: can_restart(): fix race condition between controller restart and + netif_carrier_on() + - can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is + accessed out of bounds + - PM / devfreq: rockchip-dfi: Make pmu regmap mandatory + - wifi: wfx: fix case where rates are out of order + - netfilter: nf_tables: Drop pointless memset when dumping rules + - wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() + - thermal: core: prevent potential string overflow + - r8169: fix rare issue with broken rx after link-down on RTL8125 + - thermal/drivers/mediatek: Fix probe for THERMAL_V2 + - bpf: Fix missed rcu read lock in bpf_task_under_cgroup() + - selftests: netfilter: test for sctp collision processing in nf_conntrack + - net: skb_find_text: Ignore patterns extending past 'to' + - thermal: core: Don't update trip points inside the hysteresis range + - chtls: fix tp->rcv_tstamp initialization + - tcp: fix cookie_init_timestamp() overflows + - wifi: iwlwifi: mvm: update station's MFP flag after association + - wifi: iwlwifi: mvm: fix removing pasn station for responder + - wifi: iwlwifi: mvm: use correct sta ID for IGTK/BIGTK + - wifi: mac80211: don't recreate driver link debugfs in reconfig + - wifi: mac80211: Fix setting vif links + - wifi: iwlwifi: yoyo: swap cdb and jacket bits values + - wifi: iwlwifi: mvm: Correctly set link configuration + - wifi: iwlwifi: mvm: Fix key flags for IGTK on AP interface + - wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface + - wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API + - wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta() + - wifi: iwlwifi: mvm: remove TDLS stations from FW + - wifi: iwlwifi: increase number of RX buffers for EHT devices + - wifi: iwlwifi: mvm: fix netif csum flags + - wifi: iwlwifi: pcie: synchronize IRQs before NAPI + - wifi: iwlwifi: mvm: update IGTK in mvmvif upon D3 resume + - wifi: iwlwifi: empty overflow queue during flush + - Bluetooth: ISO: Use defer setup to separate PA sync and BIG sync + - Bluetooth: ISO: Pass BIG encryption info through QoS + - Bluetooth: Make handle of hci_conn be unique + - Bluetooth: hci_sync: Fix Opcode prints in bt_dev_dbg/err + - bpf: Fix unnecessary -EBUSY from htab_lock_bucket + - ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() + - mptcp: properly account fastopen data + - ipv6: avoid atomic fragment on GSO packets + - virtio_net: use u64_stats_t infra to avoid data-races + - net: add DEV_STATS_READ() helper + - ipvlan: properly track tx_errors + - regmap: debugfs: Fix a erroneous check after snprintf() + - spi: tegra: Fix missing IRQ check in tegra_slink_probe() + - clk: qcom: ipq5332: Drop set rate parent from gpll0 dependent clocks + - clk: qcom: gcc-msm8996: Remove RPM bus clocks + - clk: qcom: clk-rcg2: Fix clock rate overflow for high parent frequencies + - clk: qcom: mmcc-msm8998: Don't check halt bit on some branch clks + - clk: qcom: mmcc-msm8998: Fix the SMMU GDSC + - clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src + - regulator: mt6358: Fail probe on unknown chip ID + - clk: imx: Select MXC_CLK for CLK_IMX8QXP + - clk: imx: imx8mq: correct error handling path + - clk: imx: imx8qxp: Fix elcdif_pll clock + - clk: renesas: rcar-gen3: Extend SDnH divider table + - clk: renesas: rzg2l: Wait for status bit of SD mux before continuing + - clk: renesas: rzg2l: Lock around writes to mux register + - clk: renesas: rzg2l: Trust value returned by hardware + - clk: renesas: rzg2l: Use FIELD_GET() for PLL register fields + - clk: renesas: rzg2l: Fix computation formula + - clk: linux/clk-provider.h: fix kernel-doc warnings and typos + - spi: nxp-fspi: use the correct ioremap function + - clk: ralink: mtmips: quiet unused variable warning + - clk: keystone: pll: fix a couple NULL vs IS_ERR() checks + - clk: ti: fix double free in of_ti_divider_clk_setup() + - clk: npcm7xx: Fix incorrect kfree + - clk: mediatek: clk-mt6765: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt6779: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt6797: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt7629-eth: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt7629: Add check for mtk_alloc_clk_data + - clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data + - clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM + - clk: qcom: clk-alpha-pll: introduce stromer plus ops + - clk: qcom: apss-ipq-pll: Use stromer plus ops for stromer plus pll + - clk: qcom: apss-ipq-pll: Fix 'l' value for ipq5332_pll_config + - clk: qcom: ipq9574: drop the CLK_SET_RATE_PARENT flag from GPLL clocks + - clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks + - clk: mediatek: fix double free in mtk_clk_register_pllfh() + - platform/x86: wmi: Fix probe failure when failing to register WMI devices + - platform/x86: wmi: Fix opening of char device + - regulator: qcom-rpmh: Fix smps4 regulator for pm8550ve + - hwmon: (axi-fan-control) Fix possible NULL pointer dereference + - hwmon: (coretemp) Fix potentially truncated sysfs attribute name + - Revert "hwmon: (sch56xx-common) Add DMI override table" + - Revert "hwmon: (sch56xx-common) Add automatic module loading on supported + devices" + - hwmon: (sch5627) Use bit macros when accessing the control register + - hwmon: (sch5627) Disallow write access if virtual registers are locked + - hte: tegra: Fix missing error code in tegra_hte_test_probe() + - platform/chrome: cros_ec_lpc: Separate host command and irq disable + - spi: omap2-mcspi: remove redundant dev_err_probe() + - spi: omap2-mcspi: switch to use modern name + - spi: omap2-mcspi: Fix hardcoded reference clock + - drm: bridge: samsung-dsim: Initialize ULPS EXIT for i.MX8M DSIM + - drm: bridge: for GENERIC_PHY_MIPI_DPHY also select GENERIC_PHY + - drm: bridge: samsung-dsim: Fix waiting for empty cmd transfer FIFO on older + Exynos + - drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs + - drm/rockchip: vop: Fix call to crtc reset helper + - drm/rockchip: vop2: Don't crash for invalid duplicate_state + - drm/rockchip: vop2: Add missing call to crtc reset helper + - drm/radeon: possible buffer overflow + - drm: bridge: it66121: Fix invalid connector dereference + - drm/bridge: lt8912b: Fix bridge_detach + - drm/bridge: lt8912b: Fix crash on bridge detach + - drm/bridge: lt8912b: Manually disable HPD only if it was enabled + - drm/bridge: lt8912b: Add missing drm_bridge_attach call + - drm/mediatek: Fix coverity issue with unintentional integer overflow + - x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro + - drm/bridge: tc358768: Fix use of uninitialized variable + - drm/bridge: tc358768: Fix bit updates + - drm/bridge: tc358768: Use struct videomode + - drm/bridge: tc358768: Print logical values, not raw register values + - drm/bridge: tc358768: Use dev for dbg prints, not priv->dev + - drm/bridge: tc358768: Rename dsibclk to hsbyteclk + - drm/bridge: tc358768: Clean up clock period code + - drm/bridge: tc358768: Fix tc358768_ns_to_cnt() + - drm/aspeed: Convert to platform remove callback returning void + - drm/stm: Convert to platform remove callback returning void + - drm/tve200: Convert to platform remove callback returning void + - drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc + drivers + - drm/amdgpu: Increase IH soft ring size for GFX v9.4.3 dGPU + - drm/amdkfd: fix some race conditions in vram buffer alloc/free of svm code + - drm/amdkfd: retry after EBUSY is returned from hmm_ranges_get_pages + - drm/amdkfd: Remove svm range validated_once flag + - drm/amdkfd: Handle errors from svm validate and map + - drm/amd/display: Fix null pointer dereference in error message + - drm/amd/display: Check all enabled planes in dm_check_crtc_cursor + - drm/amd/display: Refactor dm_get_plane_scale helper + - drm/amd/display: Bail from dm_check_crtc_cursor if no relevant change + - io_uring/kbuf: Fix check of BID wrapping in provided buffers + - io_uring/kbuf: Allow the full buffer id space for provided buffers + - drm/mediatek: Add mmsys_dev_num to mt8188 vdosys0 driver data + - drm/mediatek: Fix iommu fault by swapping FBs after updating plane state + - drm/mediatek: Fix iommu fault during crtc enabling + - accel/habanalabs/gaudi2: Fix incorrect string length computation in + gaudi2_psoc_razwi_get_engines() + - drm/rockchip: cdn-dp: Fix some error handling paths in cdn_dp_probe() + - gpu: host1x: Correct allocated size for contexts + - drm/bridge: lt9611uxc: fix the race in the error path + - arm64/arm: xen: enlighten: Fix KPTI checks + - drm/rockchip: Fix type promotion bug in rockchip_gem_iommu_map() + - xenbus: fix error exit in xenbus_init() + - xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled + - drm/msm/dsi: use msm_gem_kernel_put to free TX buffer + - drm/msm/dsi: free TX buffer in unbind + - clocksource/drivers/arm_arch_timer: limit XGene-1 workaround + - drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling + - drivers/perf: hisi: use cpuhp_state_remove_instance_nocalls() for + hisi_hns3_pmu uninit process + - drm/amd/pm: Fix a memory leak on an error path + - perf/arm-cmn: Fix DTC domain detection + - drivers/perf: hisi_pcie: Check the type first in pmu::event_init() + - perf: hisi: Fix use-after-free when register pmu fails + - ARM: dts: renesas: blanche: Fix typo in GP_11_2 pin name + - arm64: dts: qcom: sdm845: Fix PSCI power domain names + - arm64: dts: qcom: sdm845: cheza doesn't support LMh node + - arm64: dts: qcom: sc7280: link usb3_phy_wrapper_gcc_usb30_pipe_clk + - arm64: dts: qcom: msm8916: Fix iommu local address range + - arm64: dts: qcom: msm8992-libra: drop duplicated reserved memory + - arm64: dts: qcom: sm6125: Pad APPS IOMMU address to 8 characters + - arm64: dts: qcom: sc7280: Add missing LMH interrupts + - arm64: dts: qcom: qrb2210-rb1: Swap UART index + - arm64: dts: qcom: sc7280: drop incorrect EUD port on SoC side + - arm64: dts: qcom: sm8150: add ref clock to PCIe PHYs + - arm64: dts: qcom: sm8350: fix pinctrl for UART18 + - arm64: dts: qcom: sdm845-mtp: fix WiFi configuration + - ARM64: dts: marvell: cn9310: Use appropriate label for spi1 pins + - arm64: dts: qcom: msm8976: Fix ipc bit shifts + - arm64: dts: qcom: msm8939: Fix iommu local address range + - riscv: dts: allwinner: remove address-cells from intc node + - arm64: dts: qcom: apq8016-sbc: Add missing ADV7533 regulators + - ARM: dts: qcom: apq8026-samsung-matisse-wifi: Fix inverted hall sensor + - ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator + - soc: qcom: llcc: Handle a second device without data corruption + - kunit: Fix missed memory release in kunit_free_suite_set() + - firmware: ti_sci: Mark driver as non removable + - arm64: dts: ti: k3-am625-beagleplay: Fix typo in ramoops reg + - arm64: dts: ti: k3-am62a7-sk: Drop i2c-1 to 100Khz + - firmware: arm_ffa: Assign the missing IDR allocation ID to the FFA device + - firmware: arm_ffa: Allow the FF-A drivers to use 32bit mode of messaging + - ARM: dts: am3517-evm: Fix LED3/4 pinmux + - clk: scmi: Free scmi_clk allocated when the clocks with invalid info are + skipped + - arm64: dts: imx8qm-ss-img: Fix jpegenc compatible entry + - arm64: dts: imx8mp-debix-model-a: Remove USB hub reset-gpios + - arm64: dts: imx8mm: Add sound-dai-cells to micfil node + - arm64: dts: imx8mn: Add sound-dai-cells to micfil node + - arm64: tegra: Fix P3767 card detect polarity + - arm64: tegra: Fix P3767 QSPI speed + - firmware: tegra: Add suspend hook and reset BPMP IPC early on resume + - memory: tegra: Set BPMP msg flags to reset IPC channels + - arm64: tegra: Use correct interrupts for Tegra234 TKE + - selftests/pidfd: Fix ksft print formats + - selftests/resctrl: Ensure the benchmark commands fits to its array + - soc: qcom: pmic_glink: fix connector type to be DisplayPort + - ARM: dts: BCM5301X: Explicitly disable unused switch CPU ports + - iommufd: Add iopt_area_alloc() + - module/decompress: use vmalloc() for gzip decompression workspace + - ASoC: cs35l41: Handle mdsync_down reg write errors + - ASoC: cs35l41: Initialize completion object before requesting IRQ + - ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler + - ASoC: cs35l41: Undo runtime PM changes at driver exit time + - ALSA: hda: cs35l41: Fix unbalanced pm_runtime_get() + - ALSA: hda: cs35l41: Undo runtime PM changes at driver exit time + - KEYS: Include linux/errno.h in linux/verification.h + - crypto: hisilicon/hpre - Fix a erroneous check after snprintf() + - hwrng: bcm2835 - Fix hwrng throughput regression + - hwrng: geode - fix accessing registers + - RDMA/core: Use size_{add,sub,mul}() in calls to struct_size() + - crypto: qat - fix state machines cleanup paths + - crypto: qat - ignore subsequent state up commands + - crypto: qat - fix unregistration of crypto algorithms + - crypto: qat - fix unregistration of compression algorithms + - scsi: ibmvfc: Fix erroneous use of rtas_busy_delay with hcall return code + - ASoC: soc-pcm.c: Make sure DAI parameters cleared if the DAI becomes + inactive + - libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return + value + - nd_btt: Make BTT lanes preemptible + - crypto: caam/qi2 - fix Chacha20 + Poly1305 self test failure + - crypto: caam/jr - fix Chacha20 + Poly1305 self test failure + - crypto: qat - increase size of buffers + - ASoC: SOF: ipc4-topology: Use size_add() in call to struct_size() + - PCI: vmd: Correct PCI Header Type Register's multi-function check + - hid: cp2112: Fix duplicate workqueue initialization + - crypto: hisilicon/qm - fix PF queue parameter issue + - ARM: 9321/1: memset: cast the constant byte to unsigned char + - ARM: 9323/1: mm: Fix ARCH_LOW_ADDRESS_LIMIT when CONFIG_ZONE_DMA + - ext4: move 'ix' sanity check to corrent position + - kselftest: vm: fix mdwe's mmap_FIXED test case + - ASoC: fsl: mpc5200_dma.c: Fix warning of Function parameter or member not + described + - backlight: pwm_bl: Disable PWM on shutdown, suspend and remove + - ASoC: fsl-asoc-card: Add comment for mclk in the codec_priv + - dlm: fix no ack after final message + - IB/mlx5: Fix rdma counter binding for RAW QP + - RDMA/hns: Fix printing level of asynchronous events + - RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common() + - RDMA/hns: Fix signed-unsigned mixed comparisons + - RDMA/hns: Add check for SL + - RDMA/hns: The UD mode can only be configured with DCQCN + - ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran. + - ASoC: fsl: Fix PM disable depth imbalance in fsl_easrc_probe + - scsi: ufs: core: Leave space for '\0' in utf8 desc string + - RDMA/hfi1: Workaround truncation compilation error + - HID: cp2112: Make irq_chip immutable + - hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip + - HID: uclogic: Fix user-memory-access bug in + uclogic_params_ugee_v2_init_event_hooks() + - HID: uclogic: Fix a work->entry not empty bug in __queue_work() + - sh: bios: Revive earlyprintk support + - HID: logitech-hidpp: Don't restart IO, instead defer hid_connect() only + - HID: logitech-hidpp: Revert "Don't restart communication if not necessary" + - HID: logitech-hidpp: Move get_wireless_feature_index() check to + hidpp_connect_event() + - ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails + - PCI: endpoint: Fix double free in __pci_epc_create() + - padata: Fix refcnt handling in padata_free_shell() + - certs: Break circular dependency when selftest is modular + - crypto: qat - fix deadlock in backlog processing + - ASoC: ams-delta.c: use component after check + - erofs: fix erofs_insert_workgroup() lockref usage + - IB/mlx5: Fix init stage error handling to avoid double free of same QP and + UAF + - mfd: core: Un-constify mfd_cell.of_reg + - mfd: core: Ensure disabled devices are skipped without aborting + - mfd: dln2: Fix double put in dln2_probe + - dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC + - mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs + - leds: turris-omnia: Drop unnecessary mutex locking + - leds: turris-omnia: Do not use SMBUS calls + - leds: pwm: Don't disable the PWM when the LED should be off + - leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' + - scripts/gdb: fix usage of MOD_TEXT not defined when CONFIG_MODULES=n + - perf stat: Fix aggr mode initialization + - iio: frequency: adf4350: Use device managed functions and fix power down + issue. + - perf kwork: Fix incorrect and missing free atom in work_push_atom() + - perf kwork: Add the supported subcommands to the document + - perf kwork: Set ordered_events to true in 'struct perf_tool' + - f2fs: compress: fix deadloop in f2fs_write_cache_pages() + - f2fs: compress: fix to avoid use-after-free on dic + - f2fs: compress: fix to avoid redundant compress extension + - f2fs: fix to drop meta_inode's page cache in f2fs_put_super() + - tty: tty_jobctrl: fix pid memleak in disassociate_ctty() + - perf parse-events: Remove unused PE_PMU_EVENT_FAKE token + - perf parse-events: Remove unused PE_KERNEL_PMU_EVENT token + - perf parse-events: Remove ABORT_ON + - perf tools: Revert enable indices setting syntax for BPF map + - perf parse-events: Fix tracepoint name memory leak + - livepatch: Fix missing newline character in klp_resolve_symbols() + - pinctrl: renesas: rzg2l: Make reverse order of enable() for disable() + - perf record: Fix BTF type checks in the off-cpu profiling + - dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers + - usb: dwc2: fix possible NULL pointer dereference caused by driver + concurrency + - usb: chipidea: Fix DMA overwrite for Tegra + - usb: chipidea: Simplify Tegra DMA alignment code + - dmaengine: ti: edma: handle irq_of_parse_and_map() errors + - tools/perf: Update call stack check in builtin-lock.c + - misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() + - tools: iio: iio_generic_buffer ensure alignment + - USB: usbip: fix stub_dev hub disconnect + - dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() + - f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() + - interconnect: qcom: qdu1000: Set ACV enable_mask + - interconnect: qcom: sc7180: Retire DEFINE_QBCM + - interconnect: qcom: sc7180: Set ACV enable_mask + - interconnect: qcom: sc7280: Set ACV enable_mask + - interconnect: qcom: sc8180x: Set ACV enable_mask + - interconnect: qcom: sc8280xp: Set ACV enable_mask + - interconnect: qcom: sdm670: Retire DEFINE_QBCM + - interconnect: qcom: sdm670: Set ACV enable_mask + - interconnect: qcom: sdm845: Retire DEFINE_QBCM + - interconnect: qcom: sdm845: Set ACV enable_mask + - interconnect: qcom: sm6350: Retire DEFINE_QBCM + - interconnect: qcom: sm6350: Set ACV enable_mask + - interconnect: qcom: sm8150: Retire DEFINE_QBCM + - interconnect: qcom: sm8150: Set ACV enable_mask + - interconnect: qcom: sm8350: Retire DEFINE_QBCM + - interconnect: qcom: sm8350: Set ACV enable_mask + - powerpc: Only define __parse_fpscr() when required + - interconnect: fix error handling in qnoc_probe() + - perf build: Add missing comment about NO_LIBTRACEEVENT=1 + - perf parse-events: Fix for term values that are raw events + - perf pmu: Remove logic for PMU name being NULL + - perf mem-events: Avoid uninitialized read + - s390/ap: re-init AP queues on config on + - modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host + - modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host + - perf tools: Do not ignore the default vmlinux.h + - powerpc/40x: Remove stale PTE_ATOMIC_UPDATES macro + - powerpc/xive: Fix endian conversion size + - powerpc: Hide empty pt_regs at base of the stack + - perf trace: Use the right bpf_probe_read(_str) variant for reading user data + - powerpc/vas: Limit open window failure messages in log bufffer + - powerpc/imc-pmu: Use the correct spinlock initializer. + - powerpc/pseries: fix potential memory leak in init_cpu_associativity() + - perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 + platform + - xhci: Loosen RPM as default policy to cover for AMD xHC 1.1 + - usb: host: xhci-plat: fix possible kernel oops while resuming + - perf machine: Avoid out of bounds LBR memory read + - libperf rc_check: Make implicit enabling work for GCC + - perf hist: Add missing puts to hist__account_cycles + - perf vendor events intel: Fix broadwellde tma_info_system_dram_bw_use metric + - perf vendor events intel: Add broadwellde two metrics + - 9p/net: fix possible memory leak in p9_check_errors() + - rtla: Fix uninitialized variable found + - i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs + - rtc: brcmstb-waketimer: support level alarm_irq + - cxl/pci: Remove unnecessary device reference management in sanitize work + - cxl/pci: Cleanup 'sanitize' to always poll + - cxl/pci: Remove inconsistent usage of dev_err_probe() + - cxl/pci: Clarify devm host for memdev relative setup + - cxl/pci: Fix sanitize notifier setup + - cxl/memdev: Fix sanitize vs decoder setup locking + - cxl/mem: Fix shutdown order + - virt: sevguest: Fix passing a stack buffer as a scatterlist target + - rtc: pcf85363: Allow to wake up system without IRQ + - rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call + - cxl/region: Prepare the decoder match range helper for reuse + - cxl/region: Calculate a target position in a region interleave + - cxl/region: Use cxl_calc_interleave_pos() for auto-discovery + - cxl/region: Fix cxl_region_rwsem lock held when returning to user space + - cxl/core/regs: Rename @dev to @host in struct cxl_register_map + - cxl/port: Fix @host confusion in cxl_dport_setup_regs() + - cxl/hdm: Remove broken error path + - pcmcia: cs: fix possible hung task and memory leak pccardd() + - pcmcia: ds: fix refcount leak in pcmcia_device_add() + - pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() + - media: imx-jpeg: initiate a drain of the capture queue in dynamic resolution + change + - media: hantro: Check whether reset op is defined before use + - media: verisilicon: Do not enable G2 postproc downscale if source is + narrower than destination + - media: ov5640: fix vblank unchange issue when work at dvp mode + - media: i2c: max9286: Fix some redundant of_node_put() calls + - media: ov5640: Fix a memory leak when ov5640_probe fails + - media: bttv: fix use after free error due to btv->timeout timer + - media: amphion: handle firmware debug message + - media: mtk-jpegenc: Fix bug in JPEG encode quality selection + - media: s3c-camif: Avoid inappropriate kfree() + - media: vidtv: psi: Add check for kstrdup + - media: vidtv: mux: Add check and kfree for kstrdup + - media: cedrus: Fix clock/reset sequence + - media: cadence: csi2rx: Unregister v4l2 async notifier + - media: dvb-usb-v2: af9035: fix missing unlock + - media: verisilicon: Fixes clock list for rk3588 av1 decoder + - media: imx-jpeg: notify source chagne event when the first picture parsed + - media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() + - media: cec: meson: always include meson sub-directory in Makefile + - cpupower: fix reference to nonexistent document + - regmap: prevent noinc writes from clobbering cache + - drm/amdgpu/gfx10,11: use memcpy_to/fromio for MQDs + - drm/amdgpu: don't put MQDs in VRAM on ARM | ARM64 + - pwm: sti: Reduce number of allocations and drop usage of chip_data + - pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume + - Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() + - watchdog: ixp4xx: Make sure restart always works + - llc: verify mac len before reading mac header + - hsr: Prevent use after free in prp_create_tagged_frame() + - tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING + - rxrpc: Fix two connection reaping bugs + - bpf: Check map->usercnt after timer->timer is assigned + - inet: shrink struct flowi_common + - octeontx2-pf: Fix error codes + - octeontx2-pf: Fix holes in error code + - net: page_pool: add missing free_percpu when page_pool_init fail + - dccp: Call security_inet_conn_request() after setting IPv4 addresses. + - dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. + - Fix termination state for idr_for_each_entry_ul() + - net: stmmac: xgmac: Enable support for multiple Flexible PPS outputs + - selftests: pmtu.sh: fix result checking + - octeontx2-pf: Free pending and dropped SQEs + - net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT + - net/smc: allow cdc msg send rather than drop it with NULL sndbuf_desc + - net/smc: put sk reference if close work was canceled + - nvme: fix error-handling for io_uring nvme-passthrough + - riscv: boot: Fix creation of loader.bin + - tg3: power down device only on SYSTEM_POWER_OFF + - nbd: fix uaf in nbd_open + - blk-core: use pr_warn_ratelimited() in bio_check_ro() + - vsock/virtio: remove socket from connected/bound list on shutdown + - r8169: respect userspace disabling IFF_MULTICAST + - net: enetc: shorten enetc_setup_xdp_prog() error message to fit + NETLINK_MAX_FMTMSG_LEN + - i2c: iproc: handle invalid slave state + - netfilter: xt_recent: fix (increase) ipv6 literal buffer length + - netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses + - net/sched: act_ct: Always fill offloading tuple iifidx + - RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs + - module/decompress: use kvmalloc() consistently + - drm/vc4: tests: Fix UAF in the mock helpers + - drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE + - ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: trivial: fix error messages + - ASoC: hdmi-codec: register hpd callback on component probe + - ASoC: dapm: fix clock get name + - spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies + - arm64/arm: arm_pmuv3: perf: Don't truncate 64-bit registers + - fbdev: imsttfb: fix double free in probe() + - fbdev: imsttfb: fix a resource leak in probe + - fbdev: fsl-diu-fb: mark wr_reg_wa() static + - tracing/kprobes: Fix the order of argument descriptions + - Revert "drm/ast: report connection status on Display Port." + - selftests: mptcp: fix wait_rm_addr/sf parameters + - io_uring/net: ensure socket is marked connected on connect retry + - x86/amd_nb: Use Family 19h Models 60h-7Fh Function 4 IDs + - Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1" + - btrfs: use u64 for buffer sizes in the tree search ioctls + - bpf, x86: initialize the variable "first_off" in save_args() + - perf parse-events: Fix driver config term + - btrfs: make found_logical_ret parameter mandatory for function + queue_scrub_stripe() + - Linux 6.5.12 + * Mantic update: v6.5.11 upstream stable release (LP: #2051117) + - ASoC: Intel: sof_sdw: add support for SKU 0B14 + - ASoC: simple-card: fixup asoc_simple_probe() error handling + - coresight: tmc-etr: Disable warnings for allocation failures + - ASoC: fsl-asoc-card: use integer type for fll_id and pll_id + - ASoC: core: Do not call link_exit() on uninitialized rtd objects + - ASoC: tlv320adc3xxx: BUG: Correct micbias setting + - net: sched: cls_u32: Fix allocation size in u32_init() + - arm64: dts: imx93: add the Flex-CAN stop mode by GPR + - can: flexcan: remove the auto stop mode for IMX93 + - irqchip/riscv-intc: Mark all INTC nodes as initialized + - irqchip/stm32-exti: add missing DT IRQ flag translation + - dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe + - ata: pata_parport: add custom version of wait_after_reset + - ata: pata_parport: fit3: implement IDE command set registers + - powerpc/85xx: Fix math emulation exception + - media: i2c: ov8858: Don't set fwnode in the driver + - Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport + - fbdev: atyfb: only use ioremap_uc() on i386 and ia64 + - fs/ntfs3: Add ckeck in ni_update_parent() + - fs/ntfs3: Write immediately updated ntfs state + - fs/ntfs3: Use kvmalloc instead of kmalloc(... __GFP_NOWARN) + - fs/ntfs3: Add more attributes checks in mi_enum_attr() + - fs/ntfs3: Fix alternative boot searching + - fs/ntfs3: Add more info into /proc/fs/ntfs3//volinfo + - fs/ntfs3: Do not allow to change label if volume is read-only + - fs/ntfs3: Fix possible NULL-ptr-deref in ni_readpage_cmpr() + - fs/ntfs3: Fix NULL pointer dereference on error in attr_allocate_frame() + - fs/ntfs3: Fix directory element type detection + - fs/ntfs3: Avoid possible memory leak + - spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0 + - ASoC: soc-dapm: Add helper for comparing widget name + - netfilter: nfnetlink_log: silence bogus compiler warning + - net/mlx5: Bridge, fix peer entry ageing in LAG mode + - x86/efistub: Don't try to print after ExitBootService() + - efi: fix memory leak in krealloc failure handling + - ASoC: rt5650: fix the wrong result of key button + - ASoC: codecs: tas2780: Fix log of failed reset via I2C. + - s390/kasan: handle DCSS mapping in memory holes + - fbdev: omapfb: fix some error codes + - fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() + - scsi: mpt3sas: Fix in error path + - ASoC: da7219: Correct the process of setting up Gnd switch in AAD + - drm/amdgpu: Unset context priority is now invalid + - gpu/drm: Eliminate DRM_SCHED_PRIORITY_UNSET + - LoongArch: Use SYM_CODE_* to annotate exception handlers + - LoongArch: Export symbol invalid_pud_table for modules building + - LoongArch: Replace kmap_atomic() with kmap_local_page() in + copy_user_highpage() + - LoongArch: Disable WUC for pgprot_writecombine() like ioremap_wc() + - netfilter: nf_tables: audit log object reset once per table + - platform/mellanox: mlxbf-tmfifo: Fix a warning message + - drm/amdgpu: Reserve fences for VM update + - riscv: dts: thead: set dma-noncoherent to soc bus + - net: chelsio: cxgb4: add an error code check in t4_load_phy_fw + - r8152: Check for unplug in rtl_phy_patch_request() + - r8152: Check for unplug in r8153b_ups_en() / r8153c_ups_en() + - powerpc/mm: Fix boot crash with FLATMEM + - ceph_wait_on_conflict_unlink(): grab reference before dropping ->d_lock + - drm/amd/display: Don't use fsleep for PSR exit waits + - rust: make `UnsafeCell` the outer type in `Opaque` + - rust: types: make `Opaque` be `!Unpin` + - perf evlist: Avoid frequency mode for the dummy event + - mmap: fix vma_iterator in error path of vma_merge() + - mmap: fix error paths with dup_anon_vma() + - ALSA: usb-audio: add quirk flag to enable native DSD for McIntosh devices + - PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device + - usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" + compatibility + - usb: typec: tcpm: Add additional checks for contaminant + - usb: typec: tcpm: Fix NULL pointer dereference in tcpm_pd_svdm() + - usb: raw-gadget: properly handle interrupted requests + - Bluetooth: hci_bcm4377: Mark bcm4378/bcm4387 as BROKEN_LE_CODED + - tty: n_gsm: fix race condition in status line change on dead connections + - tty: 8250: Remove UC-257 and UC-431 + - tty: 8250: Add support for additional Brainboxes UC cards + - tty: 8250: Add support for Brainboxes UP cards + - tty: 8250: Add support for Intashield IS-100 + - tty: 8250: Fix port count of PX-257 + - tty: 8250: Fix up PX-803/PX-857 + - tty: 8250: Add support for additional Brainboxes PX cards + - tty: 8250: Add support for Intashield IX cards + - tty: 8250: Add Brainboxes Oxford Semiconductor-based quirks + - dt-bindings: serial: rs485: Add rs485-rts-active-high + - misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support + - serial: core: Fix runtime PM handling for pending tx + - ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection + - ASoC: SOF: sof-pci-dev: Fix community key quirk detection + - Linux 6.5.11 + * Mantic update: v6.5.11 upstream stable release (LP: #2051117) // black + screen when wake up from s3 with AMD W7600 gfx (LP: #2051341) + - drm/ttm: Reorder sys manager cleanup step + * CVE-2024-0646 + - net: tls, update curr on splice as well + * CVE-2024-0582 + - io_uring: enable io_mem_alloc/free to be used in other parts + - io_uring/kbuf: defer release of mapped buffer rings + * CVE-2024-0565 + - smb: client: fix OOB in receive_encrypted_standard() + * CVE-2023-51781 + - appletalk: Fix Use-After-Free in atalk_ioctl + * Reject connection when malformed L2CAP signal packet is received + (LP: #2047634) + - Bluetooth: L2CAP: Send reject on command corrupted request + * Mantic update: v6.5.10 upstream stable release (LP: #2049412) + - vdpa/mlx5: Fix firmware error on creation of 1k VQs + - smb3: allow controlling length of time directory entries are cached with dir + leases + - smb3: allow controlling maximum number of cached directories + - smb3: do not start laundromat thread when dir leases disabled + - smb: client: do not start laundromat thread on nohandlecache + - smb: client: make laundromat a delayed worker + - smb: client: prevent new fids from being removed by laundromat + - virtio_balloon: Fix endless deflation and inflation on arm64 + - virtio-mmio: fix memory leak of vm_dev + - virtio-crypto: handle config changed by work queue + - virtio_pci: fix the common cfg map size + - vsock/virtio: initialize the_virtio_vsock before using VQs + - vhost: Allow null msg.size on VHOST_IOTLB_INVALIDATE + - arm64: dts: qcom: apq8096-db820c: fix missing clock populate + - arm64: dts: qcom: msm8996-xiaomi: fix missing clock populate + - arm64: dts: rockchip: use codec as clock master on px30-ringneck-haikou + - arm64: dts: rockchip: set codec system-clock-fixed on px30-ringneck-haikou + - arm64: dts: qcom: sa8775p: correct PMIC GPIO label in gpio-ranges + - arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399 + - arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards + - i40e: sync next_to_clean and next_to_process for programming status desc + - mm: fix vm_brk_flags() to not bail out while holding lock + - hugetlbfs: clear resv_map pointer if mmap fails + - mm/page_alloc: correct start page when guard page debug is enabled + - mm/migrate: fix do_pages_move for compat pointers + - selftests/mm: include mman header to access MREMAP_DONTUNMAP identifier + - mm/mempolicy: fix set_mempolicy_home_node() previous VMA pointer + - hugetlbfs: extend hugetlb_vma_lock to private VMAs + - maple_tree: add GFP_KERNEL to allocations in mas_expected_entries() + - nfsd: lock_rename() needs both directories to live on the same fs + - vdpa_sim_blk: Fix the potential leak of mgmt_dev + - vdpa/mlx5: Fix double release of debugfs entry + - ARM: OMAP1: ams-delta: Fix MODEM initialization failure + - ARM: dts: rockchip: Fix i2c0 register address for RK3128 + - ARM: dts: rockchip: Add missing arm timer interrupt for RK3128 + - ARM: dts: rockchip: Add missing quirk for RK3128's dma engine + - ARM: dts: rockchip: Fix timer clocks for RK3128 + - accel/ivpu: Don't enter d0i3 during FLR + - drm/i915/pmu: Check if pmu is closed before stopping event + - drm/amd: Disable ASPM for VI w/ all Intel systems + - drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper() + - btrfs: remove v0 extent handling + - btrfs: fix unwritten extent buffer after snapshotting a new subvolume + - ARM: OMAP: timer32K: fix all kernel-doc warnings + - firmware/imx-dsp: Fix use_after_free in imx_dsp_setup_channels() + - clk: ti: Fix missing omap4 mcbsp functional clock and aliases + - clk: ti: Fix missing omap5 mcbsp functional clock and aliases + - r8169: fix the KCSAN reported data-race in rtl_tx() while reading tp->cur_tx + - r8169: fix the KCSAN reported data-race in rtl_tx while reading + TxDescArray[entry].opts1 + - r8169: fix the KCSAN reported data race in rtl_rx while reading desc->opts1 + - iavf: initialize waitqueues before starting watchdog_task + - i40e: Fix I40E_FLAG_VF_VLAN_PRUNING value + - treewide: Spelling fix in comment + - igb: Fix potential memory leak in igb_add_ethtool_nfc_entry + - net: do not leave an empty skb in write queue + - neighbour: fix various data-races + - igc: Fix ambiguity in the ethtool advertising + - net: ethernet: adi: adin1110: Fix uninitialized variable + - net: ieee802154: adf7242: Fix some potential buffer overflow in + adf7242_stats_show() + - net: usb: smsc95xx: Fix uninit-value access in smsc95xx_read_reg + - r8152: Increase USB control msg timeout to 5000ms as per spec + - r8152: Run the unload routine if we have errors during probe + - r8152: Cancel hw_phy_work if we have an error in probe + - r8152: Release firmware if we have an error in probe + - tcp: fix wrong RTO timeout when received SACK reneging + - wifi: cfg80211: pass correct pointer to rdev_inform_bss() + - wifi: cfg80211: fix assoc response warning on failed links + - wifi: mac80211: don't drop all unprotected public action frames + - net/handshake: fix file ref count in handshake_nl_accept_doit() + - gtp: uapi: fix GTPA_MAX + - gtp: fix fragmentation needed check with gso + - drm/i915/perf: Determine context valid in OA reports + - i40e: Fix wrong check for I40E_TXR_FLAGS_WB_ON_ITR + - netfilter: flowtable: GC pushes back packets to classic path + - net/sched: act_ct: additional checks for outdated flows + - drm/logicvc: Kconfig: select REGMAP and REGMAP_MMIO + - drm/i915/mcr: Hold GT forcewake during steering operations + - iavf: in iavf_down, disable queues when removing the driver + - scsi: sd: Introduce manage_shutdown device flag + - blk-throttle: check for overflow in calculate_bytes_allowed + - kasan: print the original fault addr when access invalid shadow + - iio: afe: rescale: Accept only offset channels + - iio: exynos-adc: request second interupt only when touchscreen mode is used + - iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds + - iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale + - i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() + - i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() + - i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() + - i2c: stm32f7: Fix PEC handling in case of SMBUS transfers + - i2c: aspeed: Fix i2c bus hang in slave read + - tracing/kprobes: Fix symbol counting logic by looking at modules as well + - tracing/kprobes: Fix the description of variable length arguments + - misc: fastrpc: Reset metadata buffer to avoid incorrect free + - misc: fastrpc: Free DMA handles for RPC calls with no arguments + - misc: fastrpc: Clean buffers on remote invocation failures + - misc: fastrpc: Unmap only if buffer is unmapped from DSP + - nvmem: imx: correct nregs for i.MX6ULL + - nvmem: imx: correct nregs for i.MX6SLL + - nvmem: imx: correct nregs for i.MX6UL + - x86/tsc: Defer marking TSC unstable to a worker + - x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility + - x86/cpu: Add model number for Intel Arrow Lake mobile processor + - perf/core: Fix potential NULL deref + - sparc32: fix a braino in fault handling in csum_and_copy_..._user() + - clk: Sanitize possible_parent_show to Handle Return Value of + of_clk_get_parent_name + - clk: socfpga: gate: Account for the divider in determine_rate + - clk: stm32: Fix a signedness issue in clk_stm32_composite_determine_rate() + - platform/x86: Add s2idle quirk for more Lenovo laptops + - mm/damon/sysfs: check DAMOS regions update progress from before_terminate() + - accel/ivpu/37xx: Fix missing VPUIP interrupts + - Linux 6.5.10 + * CVE-2023-6560 + - io_uring: don't allow discontig pages for IORING_SETUP_NO_MMAP + * CVE-2023-51782 + - net/rose: Fix Use-After-Free in rose_ioctl + * Mantic update: v6.5.9 upstream stable release (LP: #2049202) + - Bluetooth: hci_event: Ignore NULL link key + - Bluetooth: Reject connection with the device which has same BD_ADDR + - Bluetooth: Fix a refcnt underflow problem for hci_conn + - Bluetooth: vhci: Fix race when opening vhci device + - Bluetooth: hci_event: Fix coding style + - Bluetooth: avoid memcmp() out of bounds warning + - Bluetooth: hci_conn: Fix modifying handle while aborting + - ice: fix over-shifted variable + - ice: Fix safe mode when DDP is missing + - ice: reset first in crash dump kernels + - net/smc: return the right falback reason when prefix checks fail + - btrfs: fix stripe length calculation for non-zoned data chunk allocation + - nfc: nci: fix possible NULL pointer dereference in send_acknowledge() + - regmap: fix NULL deref on lookup + - KVM: x86: Mask LVTPC when handling a PMI + - x86/fpu: Allow caller to constrain xfeatures when copying to uabi buffer + - KVM: x86/pmu: Truncate counter value to allowed width on write + - KVM: x86: Constrain guest-supported xfeatures only at KVM_GET_XSAVE{2} + - x86: KVM: SVM: add support for Invalid IPI Vector interception + - x86: KVM: SVM: refresh AVIC inhibition in svm_leave_nested() + - tcp: check mptcp-level constraints for backlog coalescing + - mptcp: more conservative check for zero probes + - selftests: mptcp: join: no RST when rm subflow/addr + - mm: slab: Do not create kmalloc caches smaller than arch_slab_minalign() + - fs/ntfs3: Fix OOB read in ntfs_init_from_boot + - fs/ntfs3: Fix possible null-pointer dereference in hdr_find_e() + - fs/ntfs3: fix panic about slab-out-of-bounds caused by ntfs_list_ea() + - fs/ntfs3: Fix shift-out-of-bounds in ntfs_fill_super + - fs/ntfs3: fix deadlock in mark_as_free_ex + - Revert "net: wwan: iosm: enable runtime pm support for 7560" + - netfilter: nft_payload: fix wrong mac header matching + - drm/i915: Retry gtt fault when out of fence registers + - drm/mediatek: Correctly free sg_table in gem prime vmap + - drm/nouveau/disp: fix DP capable DSM connectors + - drm/edid: add 8 bpc quirk to the BenQ GW2765 + - ALSA: hda/realtek - Fixed ASUS platform headset Mic issue + - ALSA: hda/realtek: Add quirk for ASUS ROG GU603ZV + - ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq5xxx + - ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind + - ASoC: codecs: wcd938x-sdw: fix runtime PM imbalance on probe errors + - ASoC: codecs: wcd938x: drop bogus bind error handling + - ASoC: codecs: wcd938x: fix unbind tear down order + - ASoC: codecs: wcd938x: fix resource leaks on bind errors + - ASoC: codecs: wcd938x: fix regulator leaks on probe errors + - ASoC: codecs: wcd938x: fix runtime PM imbalance on remove + - qed: fix LL2 RX buffer allocation + - xfrm: fix a data-race in xfrm_lookup_with_ifid() + - xfrm6: fix inet6_dev refcount underflow problem + - xfrm: fix a data-race in xfrm_gen_index() + - xfrm: interface: use DEV_STATS_INC() + - net: xfrm: skip policies marked as dead while reinserting policies + - fprobe: Fix to ensure the number of active retprobes is not zero + - wifi: cfg80211: use system_unbound_wq for wiphy work + - net: ipv4: fix return value check in esp_remove_trailer + - net: ipv6: fix return value check in esp_remove_trailer + - net: rfkill: gpio: prevent value glitch during probe + - tcp: fix excessive TLP and RACK timeouts from HZ rounding + - tcp: tsq: relax tcp_small_queue_check() when rtx queue contains a single skb + - tcp: Fix listen() warning with v4-mapped-v6 address. + - docs: fix info about representor identification + - tun: prevent negative ifindex + - gve: Do not fully free QPL pages on prefill errors + - ipv4: fib: annotate races around nh->nh_saddr_genid and nh->nh_saddr + - net: usb: smsc95xx: Fix an error code in smsc95xx_reset() + - octeon_ep: update BQL sent bytes before ringing doorbell + - i40e: prevent crash on probe if hw registers have invalid values + - net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() + - bonding: Return pointer to data after pull on skb + - net/sched: sch_hfsc: upgrade 'rt' to 'sc' when it becomes a inner curve + - neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section + - selftests: openvswitch: Catch cases where the tests are killed + - selftests: openvswitch: Fix the ct_tuple for v4 + - selftests: netfilter: Run nft_audit.sh in its own netns + - netfilter: nft_set_rbtree: .deactivate fails if element has expired + - netlink: Correct offload_xstats size + - netfilter: nf_tables: do not refresh timeout when resetting element + - netfilter: nf_tables: do not remove elements if set backend implements + .abort + - netfilter: nf_tables: revert do not remove elements if set backend + implements .abort + - selftests: openvswitch: Add version check for pyroute2 + - net: phy: bcm7xxx: Add missing 16nm EPHY statistics + - net: pktgen: Fix interface flags printing + - net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation + - net: mdio-mux: fix C45 access returning -EIO after API change + - net: avoid UAF on deleted altname + - net: fix ifname in netlink ntf during netns move + - net: check for altname conflicts when changing netdev's netns + - iio: light: vcnl4000: Don't power on/off chip in config + - pwr-mlxbf: extend Kconfig to include gpio-mlxbf3 dependency + - ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone + - arm64: dts: mediatek: Fix "mediatek,merge-mute" and "mediatek,merge-fifo-en" + types + - fs-writeback: do not requeue a clean inode having skipped pages + - btrfs: fix race when refilling delayed refs block reserve + - btrfs: prevent transaction block reserve underflow when starting transaction + - btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1 + - btrfs: initialize start_slot in btrfs_log_prealloc_extents + - i2c: mux: Avoid potential false error message in i2c_mux_add_adapter + - overlayfs: set ctime when setting mtime and atime + - accel/ivpu: Don't flood dmesg with VPU ready message + - gpio: timberdale: Fix potential deadlock on &tgpio->lock + - ata: libata-core: Fix compilation warning in ata_dev_config_ncq() + - ata: libata-eh: Fix compilation warning in ata_eh_link_report() + - tracing: relax trace_event_eval_update() execution with cond_resched() + - wifi: mwifiex: Sanity check tlv_len and tlv_bitmap_len + - wifi: cfg80211: validate AP phy operation before starting it + - wifi: iwlwifi: Ensure ack flag is properly cleared. + - rfkill: sync before userspace visibility/changes + - HID: logitech-hidpp: Add Bluetooth ID for the Logitech M720 Triathlon mouse + - HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event + - Bluetooth: btusb: add shutdown function for QCA6174 + - Bluetooth: Avoid redundant authentication + - Bluetooth: hci_core: Fix build warnings + - wifi: cfg80211: Fix 6GHz scan configuration + - wifi: mac80211: work around Cisco AP 9115 VHT MPDU length + - wifi: mac80211: allow transmitting EAPOL frames with tainted key + - wifi: cfg80211: avoid leaking stack data into trace + - regulator/core: Revert "fix kobject release warning and memory leak in + regulator_register()" + - SUNRPC: Fail quickly when server does not recognize TLS + - SUNRPC/TLS: Lock the lower_xprt during the tls handshake + - nfs: decrement nrequests counter before releasing the req + - sky2: Make sure there is at least one frag_addr available + - ipv4/fib: send notify when delete source address routes + - drm: panel-orientation-quirks: Add quirk for One Mix 2S + - btrfs: fix some -Wmaybe-uninitialized warnings in ioctl.c + - btrfs: error out when COWing block using a stale transaction + - btrfs: error when COWing block from a root that is being deleted + - btrfs: error out when reallocating block for defrag using a stale + transaction + - platform/x86: touchscreen_dmi: Add info for the BUSH Bush Windows tablet + - drm/amd/pm: add unique_id for gc 11.0.3 + - HID: multitouch: Add required quirk for Synaptics 0xcd7e device + - HID: nintendo: reinitialize USB Pro Controller after resuming from suspend + - HID: Add quirk to ignore the touchscreen battery on HP ENVY 15-eu0556ng + - platform/x86: touchscreen_dmi: Add info for the Positivo C4128B + - cpufreq: schedutil: Update next_freq when cpufreq_limits change + - Bluetooth: hci_sync: Fix not handling ISO_LINK in hci_abort_conn_sync + - Bluetooth: hci_sync: Introduce PTR_UINT/UINT_PTR macros + - Bluetooth: ISO: Fix invalid context error + - Bluetooth: hci_sync: delete CIS in BT_OPEN/CONNECT/BOUND when aborting + - Bluetooth: hci_sync: always check if connection is alive before deleting + - net/mlx5: E-switch, register event handler before arming the event + - net/mlx5: Handle fw tracer change ownership event based on MTRC + - net/mlx5e: RX, Fix page_pool allocation failure recovery for striding rq + - net/mlx5e: RX, Fix page_pool allocation failure recovery for legacy rq + - net/mlx5e: XDP, Fix XDP_REDIRECT mpwqe page fragment leaks on shutdown + - net/mlx5e: Take RTNL lock before triggering netdev notifiers + - net/mlx5e: Don't offload internal port if filter device is out device + - net/mlx5e: Fix VF representors reporting zero counters to "ip -s" command + - net/tls: split tls_rx_reader_lock + - tcp: allow again tcp_disconnect() when threads are waiting + - Bluetooth: hci_event: Fix using memcmp when comparing keys + - tcp_bpf: properly release resources on error paths + - mtd: rawnand: qcom: Unmap the right resource upon probe failure + - mtd: rawnand: pl353: Ensure program page operations are successful + - mtd: rawnand: marvell: Ensure program page operations are successful + - mtd: rawnand: arasan: Ensure program page operations are successful + - mtd: rawnand: Ensure the nand chip supports cached reads + - mtd: spinand: micron: correct bitmask for ecc status + - mtd: physmap-core: Restore map_rom fallback + - dt-bindings: mmc: sdhci-msm: correct minimum number of clocks + - mmc: sdhci-pci-gli: fix LPM negotiation so x86/S0ix SoCs can suspend + - mmc: mtk-sd: Use readl_poll_timeout_atomic in msdc_reset_hw + - mmc: core: Fix error propagation for some ioctl commands + - mmc: core: sdio: hold retuning if sdio in 1-bit mode + - pinctrl: qcom: lpass-lpi: fix concurrent register updates + - pNFS: Fix a hang in nfs4_evict_inode() + - pNFS/flexfiles: Check the layout validity in ff_layout_mirror_prepare_stats + - NFSv4.1: fixup use EXCHGID4_FLAG_USE_PNFS_DS for DS server + - ACPI: irq: Fix incorrect return value in acpi_register_gsi() + - ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init() + - perf dlfilter: Fix use of addr_location__exit() in dlfilter__object_code() + - fanotify: limit reporting of event with non-decodeable file handles + - NFS: Fix potential oops in nfs_inode_remove_request() + - nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op + - nvme: sanitize metadata bounce buffer for reads + - nvme-pci: add BOGUS_NID for Intel 0a54 device + - nvme-auth: use chap->s2 to indicate bidirectional authentication + - nvmet-auth: complete a request only after freeing the dhchap pointers + - nvme-rdma: do not try to stop unallocated queues + - USB: serial: option: add Telit LE910C4-WWX 0x1035 composition + - USB: serial: option: add entry for Sierra EM9191 with new firmware + - USB: serial: option: add Fibocom to DELL custom modem FM101R-GL + - thunderbolt: Call tb_switch_put() once DisplayPort bandwidth request is + finished + - s390/pci: fix iommu bitmap allocation + - tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols + - selftests/ftrace: Add new test case which checks non unique symbol + - KEYS: asymmetric: Fix sign/verify on pkcs1pad without a hash + - apple-gmux: Hard Code max brightness for MMIO gmux + - s390/cio: fix a memleak in css_alloc_subchannel + - platform/surface: platform_profile: Propagate error if profile registration + fails + - platform/x86: intel-uncore-freq: Conditionally create attribute for read + frequency + - platform/x86: msi-ec: Fix the 3rd config + - platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e + - platform/x86: asus-wmi: Only map brightness codes when using asus-wmi + backlight control + - platform/x86: asus-wmi: Map 0x2a code, Ignore 0x2b and 0x2c events + - rust: error: fix the description for `ECHILD` + - gpiolib: acpi: Add missing memset(0) to acpi_get_gpiod_from_data() + - gpio: vf610: set value before the direction to avoid a glitch + - gpio: vf610: mask the gpio irq in system suspend and support wakeup + - ASoC: cs35l56: Fix illegal use of init_completion() + - ASoC: pxa: fix a memory leak in probe() + - ASoC: cs42l42: Fix missing include of gpio/consumer.h + - drm/bridge: ti-sn65dsi86: Associate DSI device lifetime with auxiliary + device + - drm/i915/cx0: Only clear/set the Pipe Reset bit of the PHY Lanes Owned + - drm/amdgpu: Fix possible null pointer dereference + - powerpc/mm: Allow ARCH_FORCE_MAX_ORDER up to 12 + - powerpc/qspinlock: Fix stale propagated yield_cpu + - docs: Move rustdoc output, cross-reference it + - rust: docs: fix logo replacement + - phy: mapphone-mdm6600: Fix runtime disable on probe + - phy: mapphone-mdm6600: Fix runtime PM for remove + - phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins + - phy: qcom-qmp-usb: initialize PCS_USB registers + - phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p + - phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1 + - phy: qcom-qmp-combo: initialize PCS_USB registers + - efi/unaccepted: Fix soft lockups caused by parallel memory acceptance + - net: move altnames together with the netdevice + - Bluetooth: hci_sock: fix slab oob read in create_monitor_event + - net: rfkill: reduce data->mtx scope in rfkill_fop_open + - docs: rust: update Rust docs output path + - kbuild: remove old Rust docs output path + - Bluetooth: hci_sock: Correctly bounds check and pad HCI_MON_NEW_INDEX name + - mptcp: avoid sending RST when closing the initial subflow + - selftests: mptcp: join: correctly check for no RST + - Linux 6.5.9 + * CVE-2023-51779 + - Bluetooth: af_bluetooth: Fix Use-After-Free in bt_sock_recvmsg + + -- Philip Cox Tue, 20 Feb 2024 13:39:22 -0500 + linux-aws-6.5 (6.5.0-1014.14~22.04.1) jammy; urgency=medium * jammy/linux-aws-6.5: 6.5.0-1014.14~22.04.1 -proposed tracker (LP: #2052270) diff -u linux-aws-6.5-6.5.0/debian/control linux-aws-6.5-6.5.0/debian/control --- linux-aws-6.5-6.5.0/debian/control +++ linux-aws-6.5-6.5.0/debian/control @@ -70,7 +70,7 @@ XS-Testsuite: autopkgtest #XS-Testsuite-Depends: gcc-4.7 binutils -Package: linux-aws-6.5-headers-6.5.0-1014 +Package: linux-aws-6.5-headers-6.5.0-1015 Build-Profiles: Architecture: all Multi-Arch: foreign @@ -81,46 +81,46 @@ Description: Header files related to Linux kernel version 6.5.0 This package provides kernel header files for version 6.5.0, for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-aws-6.5-headers-6.5.0-1014/debian.README.gz for details + /usr/share/doc/linux-aws-6.5-headers-6.5.0-1015/debian.README.gz for details -Package: linux-aws-6.5-tools-6.5.0-1014 +Package: linux-aws-6.5-tools-6.5.0-1015 Build-Profiles: Architecture: amd64 arm64 Section: devel Priority: optional Depends: ${misc:Depends}, ${shlibs:Depends}, linux-tools-common -Description: Linux kernel version specific tools for version 6.5.0-1014 +Description: Linux kernel version specific tools for version 6.5.0-1015 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 6.5.0-1014 on + version 6.5.0-1015 on 64 bit x86. - You probably want to install linux-tools-6.5.0-1014-. + You probably want to install linux-tools-6.5.0-1015-. -Package: linux-aws-6.5-cloud-tools-6.5.0-1014 +Package: linux-aws-6.5-cloud-tools-6.5.0-1015 Build-Profiles: Architecture: amd64 arm64 Section: devel Priority: optional Depends: ${misc:Depends}, ${shlibs:Depends}, linux-cloud-tools-common -Description: Linux kernel version specific cloud tools for version 6.5.0-1014 +Description: Linux kernel version specific cloud tools for version 6.5.0-1015 This package provides the architecture dependant parts for kernel - version locked tools for cloud tools for version 6.5.0-1014 on + version locked tools for cloud tools for version 6.5.0-1015 on 64 bit x86. - You probably want to install linux-cloud-tools-6.5.0-1014-. + You probably want to install linux-cloud-tools-6.5.0-1015-. -Package: linux-image-unsigned-6.5.0-1014-aws +Package: linux-image-unsigned-6.5.0-1015-aws Build-Profiles: Architecture: amd64 arm64 Section: kernel Priority: optional Provides: linux-image, fuse-module, ${linux:rprovides} -Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-6.5.0-1014-aws +Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-6.5.0-1015-aws Recommends: grub-pc [amd64] | grub-efi-amd64 [amd64] | grub-efi-ia32 [amd64] | grub [amd64] | lilo [amd64] | grub-efi-arm64 [arm64], initramfs-tools | linux-initramfs-tool Breaks: flash-kernel (<< 3.90ubuntu2) [arm64 armhf], s390-tools (<< 2.3.0-0ubuntu3) [s390x] -Conflicts: linux-image-6.5.0-1014-aws -Suggests: fdutils, linux-aws-6.5-doc-6.5.0 | linux-aws-6.5-source-6.5.0, linux-aws-6.5-tools, linux-headers-6.5.0-1014-aws +Conflicts: linux-image-6.5.0-1015-aws +Suggests: fdutils, linux-aws-6.5-doc-6.5.0 | linux-aws-6.5-source-6.5.0, linux-aws-6.5-tools, linux-headers-6.5.0-1015-aws Description: Linux kernel image for version 6.5.0 on 64 bit x86 SMP This package contains the unsigned Linux kernel image for version 6.5.0 on 64 bit x86 SMP. @@ -133,12 +133,12 @@ the linux-aws meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-6.5.0-1014-aws +Package: linux-modules-6.5.0-1015-aws Build-Profiles: Architecture: amd64 arm64 Section: kernel Priority: optional -Depends: ${misc:Depends}, ${shlibs:Depends}, linux-image-6.5.0-1014-aws | linux-image-unsigned-6.5.0-1014-aws +Depends: ${misc:Depends}, ${shlibs:Depends}, linux-image-6.5.0-1015-aws | linux-image-unsigned-6.5.0-1015-aws Built-Using: ${linux:BuiltUsing} Description: Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP Contains the corresponding System.map file, the modules built by the @@ -153,12 +153,12 @@ the linux-aws meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-extra-6.5.0-1014-aws +Package: linux-modules-extra-6.5.0-1015-aws Build-Profiles: Architecture: amd64 arm64 Section: kernel Priority: optional -Depends: ${misc:Depends}, ${shlibs:Depends}, wireless-regdb, linux-modules-6.5.0-1014-aws +Depends: ${misc:Depends}, ${shlibs:Depends}, wireless-regdb, linux-modules-6.5.0-1015-aws Description: Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP This package contains the Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP. @@ -171,21 +171,21 @@ the linux-modules-extra-aws meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-headers-6.5.0-1014-aws +Package: linux-headers-6.5.0-1015-aws Build-Profiles: Architecture: amd64 arm64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-aws-6.5-headers-6.5.0-1014, ${shlibs:Depends} +Depends: ${misc:Depends}, linux-aws-6.5-headers-6.5.0-1015, ${shlibs:Depends} Provides: linux-headers, linux-headers-3.0 Description: Linux kernel headers for version 6.5.0 on 64 bit x86 SMP This package provides kernel header files for version 6.5.0 on 64 bit x86 SMP. . This is for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-headers-6.5.0-1014/debian.README.gz for details. + /usr/share/doc/linux-headers-6.5.0-1015/debian.README.gz for details. -Package: linux-image-unsigned-6.5.0-1014-aws-dbgsym +Package: linux-image-unsigned-6.5.0-1015-aws-dbgsym Build-Profiles: Architecture: amd64 arm64 Section: devel @@ -202,27 +202,27 @@ is uncompressed, and unstripped. This package also includes the unstripped modules. -Package: linux-tools-6.5.0-1014-aws +Package: linux-tools-6.5.0-1015-aws Build-Profiles: Architecture: amd64 arm64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-aws-6.5-tools-6.5.0-1014 -Description: Linux kernel version specific tools for version 6.5.0-1014 +Depends: ${misc:Depends}, linux-aws-6.5-tools-6.5.0-1015 +Description: Linux kernel version specific tools for version 6.5.0-1015 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 6.5.0-1014 on + version 6.5.0-1015 on 64 bit x86. -Package: linux-cloud-tools-6.5.0-1014-aws +Package: linux-cloud-tools-6.5.0-1015-aws Build-Profiles: Architecture: amd64 arm64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-aws-6.5-cloud-tools-6.5.0-1014 -Description: Linux kernel version specific cloud tools for version 6.5.0-1014 +Depends: ${misc:Depends}, linux-aws-6.5-cloud-tools-6.5.0-1015 +Description: Linux kernel version specific cloud tools for version 6.5.0-1015 This package provides the architecture dependant parts for kernel - version locked tools for cloud for version 6.5.0-1014 on + version locked tools for cloud for version 6.5.0-1015 on 64 bit x86. Package: linux-udebs-aws @@ -236,7 +236,7 @@ for easier version and migration tracking. -Package: linux-buildinfo-6.5.0-1014-aws +Package: linux-buildinfo-6.5.0-1015-aws Build-Profiles: Architecture: amd64 arm64 Section: kernel diff -u linux-aws-6.5-6.5.0/debian/dkms-versions linux-aws-6.5-6.5.0/debian/dkms-versions --- linux-aws-6.5-6.5.0/debian/dkms-versions +++ linux-aws-6.5-6.5.0/debian/dkms-versions @@ -1,2 +1,2 @@ -zfs-linux 2.2.0-0ubuntu1~23.10 modulename=zfs debpath=pool/universe/z/%package%/zfs-dkms_%version%_all.deb arch=amd64 arch=arm64 arch=ppc64el arch=s390x rprovides=spl-modules rprovides=spl-dkms rprovides=zfs-modules rprovides=zfs-dkms +zfs-linux 2.2.0-0ubuntu1~23.10.1 modulename=zfs debpath=pool/universe/z/%package%/zfs-dkms_%version%_all.deb arch=amd64 arch=arm64 arch=ppc64el arch=s390x rprovides=spl-modules rprovides=spl-dkms rprovides=zfs-modules rprovides=zfs-dkms v4l2loopback 0.12.7-2ubuntu4 modulename=v4l2loopback debpath=pool/universe/v/%package%/v4l2loopback-dkms_%version%_all.deb arch=amd64 rprovides=v4l2loopback-modules rprovides=v4l2loopback-dkms diff -u linux-aws-6.5-6.5.0/drivers/acpi/acpi_video.c linux-aws-6.5-6.5.0/drivers/acpi/acpi_video.c --- linux-aws-6.5-6.5.0/drivers/acpi/acpi_video.c +++ linux-aws-6.5-6.5.0/drivers/acpi/acpi_video.c @@ -254,8 +254,7 @@ static int video_get_max_state(struct thermal_cooling_device *cooling_dev, unsigned long *state) { - struct acpi_device *device = cooling_dev->devdata; - struct acpi_video_device *video = acpi_driver_data(device); + struct acpi_video_device *video = cooling_dev->devdata; *state = video->brightness->count - ACPI_VIDEO_FIRST_LEVEL - 1; return 0; @@ -264,8 +263,7 @@ static int video_get_cur_state(struct thermal_cooling_device *cooling_dev, unsigned long *state) { - struct acpi_device *device = cooling_dev->devdata; - struct acpi_video_device *video = acpi_driver_data(device); + struct acpi_video_device *video = cooling_dev->devdata; unsigned long long level; int offset; @@ -284,8 +282,7 @@ static int video_set_cur_state(struct thermal_cooling_device *cooling_dev, unsigned long state) { - struct acpi_device *device = cooling_dev->devdata; - struct acpi_video_device *video = acpi_driver_data(device); + struct acpi_video_device *video = cooling_dev->devdata; int level; if (state >= video->brightness->count - ACPI_VIDEO_FIRST_LEVEL) @@ -1126,7 +1123,6 @@ strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); - device->driver_data = data; data->device_id = device_id; data->video = video; @@ -1747,8 +1743,8 @@ device->backlight->props.brightness = acpi_video_get_brightness(device->backlight); - device->cooling_dev = thermal_cooling_device_register("LCD", - device->dev, &video_cooling_ops); + device->cooling_dev = thermal_cooling_device_register("LCD", device, + &video_cooling_ops); if (IS_ERR(device->cooling_dev)) { /* * Set cooling_dev to NULL so we don't crash trying to free it. @@ -2031,7 +2027,7 @@ * HP ZBook Fury 16 G10 requires ACPI video's child devices have _PS0 * evaluated to have functional panel brightness control. */ - acpi_device_fix_up_power_extended(device); + acpi_device_fix_up_power_children(device); pr_info("%s [%s] (multi-head: %s rom: %s post: %s)\n", ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device), diff -u linux-aws-6.5-6.5.0/drivers/acpi/ec.c linux-aws-6.5-6.5.0/drivers/acpi/ec.c --- linux-aws-6.5-6.5.0/drivers/acpi/ec.c +++ linux-aws-6.5-6.5.0/drivers/acpi/ec.c @@ -1926,6 +1926,16 @@ }, { /* + * HP 250 G7 Notebook PC + */ + .callback = ec_honor_dsdt_gpe, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP 250 G7 Notebook PC"), + }, + }, + { + /* * Samsung hardware * https://bugzilla.kernel.org/show_bug.cgi?id=44161 */ diff -u linux-aws-6.5-6.5.0/drivers/acpi/processor_idle.c linux-aws-6.5-6.5.0/drivers/acpi/processor_idle.c --- linux-aws-6.5-6.5.0/drivers/acpi/processor_idle.c +++ linux-aws-6.5-6.5.0/drivers/acpi/processor_idle.c @@ -592,7 +592,7 @@ while (1) { if (cx->entry_method == ACPI_CSTATE_HALT) - safe_halt(); + raw_safe_halt(); else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) { io_idle(cx->address); } else diff -u linux-aws-6.5-6.5.0/drivers/acpi/resource.c linux-aws-6.5-6.5.0/drivers/acpi/resource.c --- linux-aws-6.5-6.5.0/drivers/acpi/resource.c +++ linux-aws-6.5-6.5.0/drivers/acpi/resource.c @@ -447,6 +447,13 @@ }, }, { + /* Asus ExpertBook B1402CVA */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_BOARD_NAME, "B1402CVA"), + }, + }, + { .ident = "Asus ExpertBook B1502CBA", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), @@ -454,6 +461,13 @@ }, }, { + /* Asus ExpertBook B1402CVA */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_BOARD_NAME, "B1402CVA"), + }, + }, + { .ident = "Asus ExpertBook B2402CBA", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), @@ -496,6 +510,18 @@ } }, { + /* TongFang GMxXGxx/TUXEDO Polaris 15 Gen5 AMD */ + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "GMxXGxx"), + }, + }, + { + /* TongFang GM6XGxX/TUXEDO Stellaris 16 Gen5 AMD */ + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "GM6XGxX"), + }, + }, + { .ident = "MAINGEAR Vector Pro 2 17", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"), diff -u linux-aws-6.5-6.5.0/drivers/acpi/video_detect.c linux-aws-6.5-6.5.0/drivers/acpi/video_detect.c --- linux-aws-6.5-6.5.0/drivers/acpi/video_detect.c +++ linux-aws-6.5-6.5.0/drivers/acpi/video_detect.c @@ -130,6 +130,16 @@ return 0; } +static int video_detect_portege_r100(const struct dmi_system_id *d) +{ + struct pci_dev *dev; + /* Search for Trident CyberBlade XP4m32 to confirm Portégé R100 */ + dev = pci_get_device(PCI_VENDOR_ID_TRIDENT, 0x2100, NULL); + if (dev) + acpi_backlight_dmi = acpi_backlight_vendor; + return 0; +} + static const struct dmi_system_id video_detect_dmi_table[] = { /* * Models which should use the vendor backlight interface, @@ -271,6 +281,22 @@ }, /* + * Toshiba Portégé R100 has working both acpi_video and toshiba_acpi + * vendor driver. But none of them gets activated as it has a VGA with + * no kernel driver (Trident CyberBlade XP4m32). + * The DMI strings are generic so check for the VGA chip in callback. + */ + { + .callback = video_detect_portege_r100, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), + DMI_MATCH(DMI_PRODUCT_NAME, "Portable PC"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Version 1.0"), + DMI_MATCH(DMI_BOARD_NAME, "Portable PC") + }, + }, + + /* * Models which need acpi_video backlight control where the GPU drivers * do not call acpi_video_register_backlight() because no internal panel * is detected. Typically these are all-in-ones (monitors with builtin diff -u linux-aws-6.5-6.5.0/drivers/ata/libata-core.c linux-aws-6.5-6.5.0/drivers/ata/libata-core.c --- linux-aws-6.5-6.5.0/drivers/ata/libata-core.c +++ linux-aws-6.5-6.5.0/drivers/ata/libata-core.c @@ -2624,7 +2624,7 @@ { const u16 *id = dev->id; const char *lba_desc; - char ncq_desc[24]; + char ncq_desc[32]; int ret; dev->flags |= ATA_DFLAG_LBA; diff -u linux-aws-6.5-6.5.0/drivers/ata/libata-eh.c linux-aws-6.5-6.5.0/drivers/ata/libata-eh.c --- linux-aws-6.5-6.5.0/drivers/ata/libata-eh.c +++ linux-aws-6.5-6.5.0/drivers/ata/libata-eh.c @@ -2366,7 +2366,7 @@ struct ata_eh_context *ehc = &link->eh_context; struct ata_queued_cmd *qc; const char *frozen, *desc; - char tries_buf[6] = ""; + char tries_buf[16] = ""; int tag, nr_failed = 0; if (ehc->i.flags & ATA_EHI_QUIET) diff -u linux-aws-6.5-6.5.0/drivers/ata/libata-scsi.c linux-aws-6.5-6.5.0/drivers/ata/libata-scsi.c --- linux-aws-6.5-6.5.0/drivers/ata/libata-scsi.c +++ linux-aws-6.5-6.5.0/drivers/ata/libata-scsi.c @@ -1103,10 +1103,16 @@ /* * Ask the sd driver to issue START STOP UNIT on runtime suspend - * and resume only. For system level suspend/resume, devices - * power state is handled directly by libata EH. + * and resume and shutdown only. For system level suspend/resume, + * devices power state is handled directly by libata EH. + * Given that disks are always spun up on system resume, also + * make sure that the sd driver forces runtime suspended disks + * to be resumed to correctly reflect the power state of the + * device. */ - sdev->manage_runtime_start_stop = true; + sdev->manage_runtime_start_stop = 1; + sdev->manage_shutdown = 1; + sdev->force_runtime_start_on_system_start = 1; } /* diff -u linux-aws-6.5-6.5.0/drivers/ata/pata_parport/pata_parport.c linux-aws-6.5-6.5.0/drivers/ata/pata_parport/pata_parport.c --- linux-aws-6.5-6.5.0/drivers/ata/pata_parport/pata_parport.c +++ linux-aws-6.5-6.5.0/drivers/ata/pata_parport/pata_parport.c @@ -80,6 +80,72 @@ return (nsect == 0x55) && (lbal == 0xaa); } +static int pata_parport_wait_after_reset(struct ata_link *link, + unsigned int devmask, + unsigned long deadline) +{ + struct ata_port *ap = link->ap; + struct pi_adapter *pi = ap->host->private_data; + unsigned int dev0 = devmask & (1 << 0); + unsigned int dev1 = devmask & (1 << 1); + int rc, ret = 0; + + ata_msleep(ap, ATA_WAIT_AFTER_RESET); + + /* always check readiness of the master device */ + rc = ata_sff_wait_ready(link, deadline); + if (rc) { + /* + * some adapters return bogus values if master device is not + * present, so don't abort now if a slave device is present + */ + if (!dev1) + return rc; + ret = -ENODEV; + } + + /* + * if device 1 was found in ata_devchk, wait for register + * access briefly, then wait for BSY to clear. + */ + if (dev1) { + int i; + + pata_parport_dev_select(ap, 1); + + /* + * Wait for register access. Some ATAPI devices fail + * to set nsect/lbal after reset, so don't waste too + * much time on it. We're gonna wait for !BSY anyway. + */ + for (i = 0; i < 2; i++) { + u8 nsect, lbal; + + nsect = pi->proto->read_regr(pi, 0, ATA_REG_NSECT); + lbal = pi->proto->read_regr(pi, 0, ATA_REG_LBAL); + if (nsect == 1 && lbal == 1) + break; + /* give drive a breather */ + ata_msleep(ap, 50); + } + + rc = ata_sff_wait_ready(link, deadline); + if (rc) { + if (rc != -ENODEV) + return rc; + ret = rc; + } + } + + pata_parport_dev_select(ap, 0); + if (dev1) + pata_parport_dev_select(ap, 1); + if (dev0) + pata_parport_dev_select(ap, 0); + + return ret; +} + static int pata_parport_bus_softreset(struct ata_port *ap, unsigned int devmask, unsigned long deadline) { @@ -94,7 +160,7 @@ ap->last_ctl = ap->ctl; /* wait the port to become ready */ - return ata_sff_wait_after_reset(&ap->link, devmask, deadline); + return pata_parport_wait_after_reset(&ap->link, devmask, deadline); } static int pata_parport_softreset(struct ata_link *link, unsigned int *classes, diff -u linux-aws-6.5-6.5.0/drivers/base/dd.c linux-aws-6.5-6.5.0/drivers/base/dd.c --- linux-aws-6.5-6.5.0/drivers/base/dd.c +++ linux-aws-6.5-6.5.0/drivers/base/dd.c @@ -1274,8 +1274,8 @@ if (dev->bus && dev->bus->dma_cleanup) dev->bus->dma_cleanup(dev); - device_links_driver_cleanup(dev); device_unbind_cleanup(dev); + device_links_driver_cleanup(dev); klist_remove(&dev->p->knode_driver); device_pm_check_callbacks(dev); diff -u linux-aws-6.5-6.5.0/drivers/block/nbd.c linux-aws-6.5-6.5.0/drivers/block/nbd.c --- linux-aws-6.5-6.5.0/drivers/block/nbd.c +++ linux-aws-6.5-6.5.0/drivers/block/nbd.c @@ -250,7 +250,6 @@ struct gendisk *disk = nbd->disk; del_gendisk(disk); - put_disk(disk); blk_mq_free_tag_set(&nbd->tag_set); /* @@ -261,7 +260,7 @@ idr_remove(&nbd_index_idr, nbd->index); mutex_unlock(&nbd_index_mutex); destroy_workqueue(nbd->recv_workq); - kfree(nbd); + put_disk(disk); } static void nbd_dev_remove_work(struct work_struct *work) @@ -1609,6 +1608,13 @@ nbd_put(nbd); } +static void nbd_free_disk(struct gendisk *disk) +{ + struct nbd_device *nbd = disk->private_data; + + kfree(nbd); +} + static const struct block_device_operations nbd_fops = { .owner = THIS_MODULE, @@ -1616,6 +1622,7 @@ .release = nbd_release, .ioctl = nbd_ioctl, .compat_ioctl = nbd_ioctl, + .free_disk = nbd_free_disk, }; #if IS_ENABLED(CONFIG_DEBUG_FS) diff -u linux-aws-6.5-6.5.0/drivers/bluetooth/btusb.c linux-aws-6.5-6.5.0/drivers/bluetooth/btusb.c --- linux-aws-6.5-6.5.0/drivers/bluetooth/btusb.c +++ linux-aws-6.5-6.5.0/drivers/bluetooth/btusb.c @@ -2809,6 +2809,9 @@ goto err_free_wc; } + if (data->evt_skb == NULL) + goto err_free_wc; + /* Parse and handle the return WMT event */ wmt_evt = (struct btmtk_hci_wmt_evt *)data->evt_skb->data; if (wmt_evt->whdr.op != hdr->op) { @@ -4393,6 +4396,7 @@ if (id->driver_info & BTUSB_QCA_ROME) { data->setup_on_usb = btusb_setup_qca; + hdev->shutdown = btusb_shutdown_qca; hdev->set_bdaddr = btusb_set_bdaddr_ath3012; hdev->cmd_timeout = btusb_qca_cmd_timeout; set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); diff -u linux-aws-6.5-6.5.0/drivers/char/agp/parisc-agp.c linux-aws-6.5-6.5.0/drivers/char/agp/parisc-agp.c --- linux-aws-6.5-6.5.0/drivers/char/agp/parisc-agp.c +++ linux-aws-6.5-6.5.0/drivers/char/agp/parisc-agp.c @@ -38,7 +38,7 @@ int lba_cap_offset; - u64 *gatt; + __le64 *gatt; u64 gatt_entries; u64 gart_base; @@ -104,7 +104,7 @@ int i; for (i = 0; i < info->gatt_entries; i++) { - info->gatt[i] = (unsigned long)agp_bridge->scratch_page; + info->gatt[i] = cpu_to_le64(agp_bridge->scratch_page); } return 0; @@ -158,9 +158,9 @@ for (k = 0; k < info->io_pages_per_kpage; k++, j++, paddr += info->io_page_size) { - info->gatt[j] = + info->gatt[j] = cpu_to_le64( parisc_agp_mask_memory(agp_bridge, - paddr, type); + paddr, type)); asm_io_fdc(&info->gatt[j]); } } @@ -184,7 +184,7 @@ io_pg_start = info->io_pages_per_kpage * pg_start; io_pg_count = info->io_pages_per_kpage * mem->page_count; for (i = io_pg_start; i < io_pg_count + io_pg_start; i++) { - info->gatt[i] = agp_bridge->scratch_page; + info->gatt[i] = cpu_to_le64(agp_bridge->scratch_page); } agp_bridge->driver->tlb_flush(mem); @@ -204,7 +204,8 @@ pa |= (ci >> PAGE_SHIFT) & 0xff;/* move CI (8 bits) into lowest byte */ pa |= SBA_PDIR_VALID_BIT; /* set "valid" bit */ - return cpu_to_le64(pa); + /* return native (big-endian) PDIR entry */ + return pa; } static void @@ -251,7 +252,8 @@ agp_ioc_init(void __iomem *ioc_regs) { struct _parisc_agp_info *info = &parisc_agp_info; - u64 iova_base, *io_pdir, io_tlb_ps; + u64 iova_base, io_tlb_ps; + __le64 *io_pdir; int io_tlb_shift; printk(KERN_INFO DRVPFX "IO PDIR shared with sba_iommu\n"); diff -u linux-aws-6.5-6.5.0/drivers/clk/keystone/pll.c linux-aws-6.5-6.5.0/drivers/clk/keystone/pll.c --- linux-aws-6.5-6.5.0/drivers/clk/keystone/pll.c +++ linux-aws-6.5-6.5.0/drivers/clk/keystone/pll.c @@ -281,12 +281,13 @@ clk = clk_register_divider(NULL, clk_name, parent_name, 0, reg, shift, mask, 0, NULL); - if (clk) { - of_clk_add_provider(node, of_clk_src_simple_get, clk); - } else { + if (IS_ERR(clk)) { pr_err("%s: error registering divider %s\n", __func__, clk_name); iounmap(reg); + return; } + + of_clk_add_provider(node, of_clk_src_simple_get, clk); } CLK_OF_DECLARE(pll_divider_clock, "ti,keystone,pll-divider-clock", of_pll_div_clk_init); @@ -328,10 +329,12 @@ clk = clk_register_mux(NULL, clk_name, (const char **)&parents, ARRAY_SIZE(parents) , 0, reg, shift, mask, 0, NULL); - if (clk) - of_clk_add_provider(node, of_clk_src_simple_get, clk); - else + if (IS_ERR(clk)) { pr_err("%s: error registering mux %s\n", __func__, clk_name); + return; + } + + of_clk_add_provider(node, of_clk_src_simple_get, clk); } CLK_OF_DECLARE(pll_mux_clock, "ti,keystone,pll-mux-clock", of_pll_mux_clk_init); diff -u linux-aws-6.5-6.5.0/drivers/clk/qcom/Kconfig linux-aws-6.5-6.5.0/drivers/clk/qcom/Kconfig --- linux-aws-6.5-6.5.0/drivers/clk/qcom/Kconfig +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/Kconfig @@ -131,6 +131,7 @@ tristate "IPQ APSS Clock Controller" select IPQ_APSS_PLL depends on QCOM_APCS_IPC || COMPILE_TEST + depends on QCOM_SMEM help Support for APSS clock controller on IPQ platforms. The APSS clock controller manages the Mux and enable block that feeds the diff -u linux-aws-6.5-6.5.0/drivers/clocksource/arm_arch_timer.c linux-aws-6.5-6.5.0/drivers/clocksource/arm_arch_timer.c --- linux-aws-6.5-6.5.0/drivers/clocksource/arm_arch_timer.c +++ linux-aws-6.5-6.5.0/drivers/clocksource/arm_arch_timer.c @@ -836,8 +836,9 @@ * Note that TVAL is signed, thus has only 31 of its * 32 bits to express magnitude. */ - MIDR_ALL_VERSIONS(MIDR_CPU_MODEL(ARM_CPU_IMP_APM, - APM_CPU_PART_POTENZA)), + MIDR_REV_RANGE(MIDR_CPU_MODEL(ARM_CPU_IMP_APM, + APM_CPU_PART_XGENE), + APM_CPU_VAR_POTENZA, 0x0, 0xf), {}, }; diff -u linux-aws-6.5-6.5.0/drivers/cpufreq/tegra194-cpufreq.c linux-aws-6.5-6.5.0/drivers/cpufreq/tegra194-cpufreq.c --- linux-aws-6.5-6.5.0/drivers/cpufreq/tegra194-cpufreq.c +++ linux-aws-6.5-6.5.0/drivers/cpufreq/tegra194-cpufreq.c @@ -450,6 +450,8 @@ if (IS_ERR(opp)) continue; + dev_pm_opp_put(opp); + ret = dev_pm_opp_enable(cpu_dev, pos->frequency * KHZ); if (ret < 0) return ret; diff -u linux-aws-6.5-6.5.0/drivers/cxl/core/mbox.c linux-aws-6.5-6.5.0/drivers/cxl/core/mbox.c --- linux-aws-6.5-6.5.0/drivers/cxl/core/mbox.c +++ linux-aws-6.5-6.5.0/drivers/cxl/core/mbox.c @@ -1125,20 +1125,7 @@ } EXPORT_SYMBOL_NS_GPL(cxl_dev_state_identify, CXL); -/** - * cxl_mem_sanitize() - Send a sanitization command to the device. - * @mds: The device data for the operation - * @cmd: The specific sanitization command opcode - * - * Return: 0 if the command was executed successfully, regardless of - * whether or not the actual security operation is done in the background, - * such as for the Sanitize case. - * Error return values can be the result of the mailbox command, -EINVAL - * when security requirements are not met or invalid contexts. - * - * See CXL 3.0 @8.2.9.8.5.1 Sanitize and @8.2.9.8.5.2 Secure Erase. - */ -int cxl_mem_sanitize(struct cxl_memdev_state *mds, u16 cmd) +static int __cxl_mem_sanitize(struct cxl_memdev_state *mds, u16 cmd) { int rc; u32 sec_out = 0; @@ -1183,7 +1170,45 @@ return 0; } -EXPORT_SYMBOL_NS_GPL(cxl_mem_sanitize, CXL); + + +/** + * cxl_mem_sanitize() - Send a sanitization command to the device. + * @cxlmd: The device for the operation + * @cmd: The specific sanitization command opcode + * + * Return: 0 if the command was executed successfully, regardless of + * whether or not the actual security operation is done in the background, + * such as for the Sanitize case. + * Error return values can be the result of the mailbox command, -EINVAL + * when security requirements are not met or invalid contexts, or -EBUSY + * if the sanitize operation is already in flight. + * + * See CXL 3.0 @8.2.9.8.5.1 Sanitize and @8.2.9.8.5.2 Secure Erase. + */ +int cxl_mem_sanitize(struct cxl_memdev *cxlmd, u16 cmd) +{ + struct cxl_memdev_state *mds = to_cxl_memdev_state(cxlmd->cxlds); + struct cxl_port *endpoint; + int rc; + + /* synchronize with cxl_mem_probe() and decoder write operations */ + device_lock(&cxlmd->dev); + endpoint = cxlmd->endpoint; + down_read(&cxl_region_rwsem); + /* + * Require an endpoint to be safe otherwise the driver can not + * be sure that the device is unmapped. + */ + if (endpoint && endpoint->commit_end == -1) + rc = __cxl_mem_sanitize(mds, cmd); + else + rc = -EBUSY; + up_read(&cxl_region_rwsem); + device_unlock(&cxlmd->dev); + + return rc; +} static int add_dpa_res(struct device *dev, struct resource *parent, struct resource *res, resource_size_t start, diff -u linux-aws-6.5-6.5.0/drivers/cxl/core/port.c linux-aws-6.5-6.5.0/drivers/cxl/core/port.c --- linux-aws-6.5-6.5.0/drivers/cxl/core/port.c +++ linux-aws-6.5-6.5.0/drivers/cxl/core/port.c @@ -28,6 +28,12 @@ * instantiated by the core. */ +/* + * All changes to the interleave configuration occur with this lock held + * for write. + */ +DECLARE_RWSEM(cxl_region_rwsem); + static DEFINE_IDA(cxl_port_ida); static DEFINE_XARRAY(cxl_root_buses); @@ -691,14 +697,14 @@ return ERR_PTR(rc); } -static int cxl_setup_comp_regs(struct device *dev, struct cxl_register_map *map, +static int cxl_setup_comp_regs(struct device *host, struct cxl_register_map *map, resource_size_t component_reg_phys) { if (component_reg_phys == CXL_RESOURCE_NONE) return 0; *map = (struct cxl_register_map) { - .dev = dev, + .host = host, .reg_type = CXL_REGLOC_RBI_COMPONENT, .resource = component_reg_phys, .max_size = CXL_COMPONENT_REG_BLOCK_SIZE, @@ -716,13 +722,23 @@ component_reg_phys); } -static int cxl_dport_setup_regs(struct cxl_dport *dport, +static int cxl_dport_setup_regs(struct device *host, struct cxl_dport *dport, resource_size_t component_reg_phys) { + int rc; + if (dev_is_platform(dport->dport_dev)) return 0; - return cxl_setup_comp_regs(dport->dport_dev, &dport->comp_map, - component_reg_phys); + + /* + * use @dport->dport_dev for the context for error messages during + * register probing, and fixup @host after the fact, since @host may be + * NULL. + */ + rc = cxl_setup_comp_regs(dport->dport_dev, &dport->comp_map, + component_reg_phys); + dport->comp_map.host = host; + return rc; } static struct cxl_port *__devm_cxl_add_port(struct device *host, @@ -983,7 +999,16 @@ if (!dport) return ERR_PTR(-ENOMEM); - if (rcrb != CXL_RESOURCE_NONE) { + dport->dport_dev = dport_dev; + dport->port_id = port_id; + dport->port = port; + + if (rcrb == CXL_RESOURCE_NONE) { + rc = cxl_dport_setup_regs(&port->dev, dport, + component_reg_phys); + if (rc) + return ERR_PTR(rc); + } else { dport->rcrb.base = rcrb; component_reg_phys = __rcrb_to_component(dport_dev, &dport->rcrb, CXL_RCRB_DOWNSTREAM); @@ -992,6 +1017,14 @@ return ERR_PTR(-ENXIO); } + /* + * RCH @dport is not ready to map until associated with its + * memdev + */ + rc = cxl_dport_setup_regs(NULL, dport, component_reg_phys); + if (rc) + return ERR_PTR(rc); + dport->rch = true; } @@ -999,14 +1032,6 @@ dev_dbg(dport_dev, "Component Registers found for dport: %pa\n", &component_reg_phys); - dport->dport_dev = dport_dev; - dport->port_id = port_id; - dport->port = port; - - rc = cxl_dport_setup_regs(dport, component_reg_phys); - if (rc) - return ERR_PTR(rc); - cond_cxl_root_lock(port); rc = add_dport(port, dport); cond_cxl_root_unlock(port); @@ -1217,35 +1242,39 @@ return NULL; } +static struct device *endpoint_host(struct cxl_port *endpoint) +{ + struct cxl_port *port = to_cxl_port(endpoint->dev.parent); + + if (is_cxl_root(port)) + return port->uport_dev; + return &port->dev; +} + static void delete_endpoint(void *data) { struct cxl_memdev *cxlmd = data; struct cxl_port *endpoint = cxlmd->endpoint; - struct cxl_port *parent_port; - struct device *parent; + struct device *host = endpoint_host(endpoint); - parent_port = cxl_mem_find_port(cxlmd, NULL); - if (!parent_port) - goto out; - parent = &parent_port->dev; - - device_lock(parent); - if (parent->driver && !endpoint->dead) { - devm_release_action(parent, cxl_unlink_parent_dport, endpoint); - devm_release_action(parent, cxl_unlink_uport, endpoint); - devm_release_action(parent, unregister_port, endpoint); + device_lock(host); + if (host->driver && !endpoint->dead) { + devm_release_action(host, cxl_unlink_parent_dport, endpoint); + devm_release_action(host, cxl_unlink_uport, endpoint); + devm_release_action(host, unregister_port, endpoint); } cxlmd->endpoint = NULL; - device_unlock(parent); - put_device(parent); -out: + device_unlock(host); put_device(&endpoint->dev); + put_device(host); } int cxl_endpoint_autoremove(struct cxl_memdev *cxlmd, struct cxl_port *endpoint) { + struct device *host = endpoint_host(endpoint); struct device *dev = &cxlmd->dev; + get_device(host); get_device(&endpoint->dev); cxlmd->endpoint = endpoint; cxlmd->depth = endpoint->depth; diff -u linux-aws-6.5-6.5.0/drivers/cxl/core/region.c linux-aws-6.5-6.5.0/drivers/cxl/core/region.c --- linux-aws-6.5-6.5.0/drivers/cxl/core/region.c +++ linux-aws-6.5-6.5.0/drivers/cxl/core/region.c @@ -28,12 +28,6 @@ * 3. Decoder targets */ -/* - * All changes to the interleave configuration occur with this lock held - * for write. - */ -static DECLARE_RWSEM(cxl_region_rwsem); - static struct cxl_region *to_cxl_region(struct device *dev); static ssize_t uuid_show(struct device *dev, struct device_attribute *attr, @@ -294,7 +288,7 @@ */ rc = cxl_region_invalidate_memregion(cxlr); if (rc) - return rc; + goto out; if (commit) { rc = cxl_region_decode_commit(cxlr); @@ -1133,7 +1127,14 @@ } if (is_cxl_root(parent_port)) { - parent_ig = cxlrd->cxlsd.cxld.interleave_granularity; + /* + * Root decoder IG is always set to value in CFMWS which + * may be different than this region's IG. We can use the + * region's IG here since interleave_granularity_store() + * does not allow interleaved host-bridges with + * root IG != region IG. + */ + parent_ig = p->interleave_granularity; parent_iw = cxlrd->cxlsd.cxld.interleave_ways; /* * For purposes of address bit routing, use power-of-2 math for @@ -1196,6 +1197,14 @@ return rc; } + if (iw > 8 || iw > cxlsd->nr_targets) { + dev_dbg(&cxlr->dev, + "%s:%s:%s: ways: %d overflows targets: %d\n", + dev_name(port->uport_dev), dev_name(&port->dev), + dev_name(&cxld->dev), iw, cxlsd->nr_targets); + return -ENXIO; + } + if (test_bit(CXL_REGION_F_AUTO, &cxlr->flags)) { if (cxld->interleave_ways != iw || cxld->interleave_granularity != ig || @@ -1481,6 +1490,14 @@ return 0; } +static int cmp_interleave_pos(const void *a, const void *b) +{ + struct cxl_endpoint_decoder *cxled_a = *(typeof(cxled_a) *)a; + struct cxl_endpoint_decoder *cxled_b = *(typeof(cxled_b) *)b; + + return cxled_a->pos - cxled_b->pos; +} + static struct cxl_port *next_port(struct cxl_port *port) { if (!port->parent_dport) @@ -1488,119 +1505,127 @@ return port->parent_dport->port; } -static int decoder_match_range(struct device *dev, void *data) +static int match_switch_decoder_by_range(struct device *dev, void *data) { - struct cxl_endpoint_decoder *cxled = data; struct cxl_switch_decoder *cxlsd; + struct range *r1, *r2 = data; if (!is_switch_decoder(dev)) return 0; cxlsd = to_cxl_switch_decoder(dev); - return range_contains(&cxlsd->cxld.hpa_range, &cxled->cxld.hpa_range); -} - -static void find_positions(const struct cxl_switch_decoder *cxlsd, - const struct cxl_port *iter_a, - const struct cxl_port *iter_b, int *a_pos, - int *b_pos) -{ - int i; + r1 = &cxlsd->cxld.hpa_range; - for (i = 0, *a_pos = -1, *b_pos = -1; i < cxlsd->nr_targets; i++) { - if (cxlsd->target[i] == iter_a->parent_dport) - *a_pos = i; - else if (cxlsd->target[i] == iter_b->parent_dport) - *b_pos = i; - if (*a_pos >= 0 && *b_pos >= 0) - break; - } + if (is_root_decoder(dev)) + return range_contains(r1, r2); + return (r1->start == r2->start && r1->end == r2->end); } -static int cmp_decode_pos(const void *a, const void *b) +static int find_pos_and_ways(struct cxl_port *port, struct range *range, + int *pos, int *ways) { - struct cxl_endpoint_decoder *cxled_a = *(typeof(cxled_a) *)a; - struct cxl_endpoint_decoder *cxled_b = *(typeof(cxled_b) *)b; - struct cxl_memdev *cxlmd_a = cxled_to_memdev(cxled_a); - struct cxl_memdev *cxlmd_b = cxled_to_memdev(cxled_b); - struct cxl_port *port_a = cxled_to_port(cxled_a); - struct cxl_port *port_b = cxled_to_port(cxled_b); - struct cxl_port *iter_a, *iter_b, *port = NULL; struct cxl_switch_decoder *cxlsd; + struct cxl_port *parent; struct device *dev; - int a_pos, b_pos; - unsigned int seq; + int rc = -ENXIO; - /* Exit early if any prior sorting failed */ - if (cxled_a->pos < 0 || cxled_b->pos < 0) - return 0; - - /* - * Walk up the hierarchy to find a shared port, find the decoder that - * maps the range, compare the relative position of those dport - * mappings. - */ - for (iter_a = port_a; iter_a; iter_a = next_port(iter_a)) { - struct cxl_port *next_a, *next_b; + parent = next_port(port); + if (!parent) + return rc; - next_a = next_port(iter_a); - if (!next_a) - break; + dev = device_find_child(&parent->dev, range, + match_switch_decoder_by_range); + if (!dev) { + dev_err(port->uport_dev, + "failed to find decoder mapping %#llx-%#llx\n", + range->start, range->end); + return rc; + } + cxlsd = to_cxl_switch_decoder(dev); + *ways = cxlsd->cxld.interleave_ways; - for (iter_b = port_b; iter_b; iter_b = next_port(iter_b)) { - next_b = next_port(iter_b); - if (next_a != next_b) - continue; - port = next_a; + for (int i = 0; i < *ways; i++) { + if (cxlsd->target[i] == port->parent_dport) { + *pos = i; + rc = 0; break; } - - if (port) - break; } + put_device(dev); - if (!port) { - dev_err(cxlmd_a->dev.parent, - "failed to find shared port with %s\n", - dev_name(cxlmd_b->dev.parent)); - goto err; - } + return rc; +} - dev = device_find_child(&port->dev, cxled_a, decoder_match_range); - if (!dev) { - struct range *range = &cxled_a->cxld.hpa_range; +/** + * cxl_calc_interleave_pos() - calculate an endpoint position in a region + * @cxled: endpoint decoder member of given region + * + * The endpoint position is calculated by traversing the topology from + * the endpoint to the root decoder and iteratively applying this + * calculation: + * + * position = position * parent_ways + parent_pos; + * + * ...where @position is inferred from switch and root decoder target lists. + * + * Return: position >= 0 on success + * -ENXIO on failure + */ +static int cxl_calc_interleave_pos(struct cxl_endpoint_decoder *cxled) +{ + struct cxl_port *iter, *port = cxled_to_port(cxled); + struct cxl_memdev *cxlmd = cxled_to_memdev(cxled); + struct range *range = &cxled->cxld.hpa_range; + int parent_ways = 0, parent_pos = 0, pos = 0; + int rc; - dev_err(port->uport_dev, - "failed to find decoder that maps %#llx-%#llx\n", - range->start, range->end); - goto err; - } + /* + * Example: the expected interleave order of the 4-way region shown + * below is: mem0, mem2, mem1, mem3 + * + * root_port + * / \ + * host_bridge_0 host_bridge_1 + * | | | | + * mem0 mem1 mem2 mem3 + * + * In the example the calculator will iterate twice. The first iteration + * uses the mem position in the host-bridge and the ways of the host- + * bridge to generate the first, or local, position. The second + * iteration uses the host-bridge position in the root_port and the ways + * of the root_port to refine the position. + * + * A trace of the calculation per endpoint looks like this: + * mem0: pos = 0 * 2 + 0 mem2: pos = 0 * 2 + 0 + * pos = 0 * 2 + 0 pos = 0 * 2 + 1 + * pos: 0 pos: 1 + * + * mem1: pos = 0 * 2 + 1 mem3: pos = 0 * 2 + 1 + * pos = 1 * 2 + 0 pos = 1 * 2 + 1 + * pos: 2 pos = 3 + * + * Note that while this example is simple, the method applies to more + * complex topologies, including those with switches. + */ - cxlsd = to_cxl_switch_decoder(dev); - do { - seq = read_seqbegin(&cxlsd->target_lock); - find_positions(cxlsd, iter_a, iter_b, &a_pos, &b_pos); - } while (read_seqretry(&cxlsd->target_lock, seq)); + /* Iterate from endpoint to root_port refining the position */ + for (iter = port; iter; iter = next_port(iter)) { + if (is_cxl_root(iter)) + break; - put_device(dev); + rc = find_pos_and_ways(iter, range, &parent_pos, &parent_ways); + if (rc) + return rc; - if (a_pos < 0 || b_pos < 0) { - dev_err(port->uport_dev, - "failed to find shared decoder for %s and %s\n", - dev_name(cxlmd_a->dev.parent), - dev_name(cxlmd_b->dev.parent)); - goto err; + pos = pos * parent_ways + parent_pos; } - dev_dbg(port->uport_dev, "%s comes %s %s\n", - dev_name(cxlmd_a->dev.parent), - a_pos - b_pos < 0 ? "before" : "after", - dev_name(cxlmd_b->dev.parent)); - - return a_pos - b_pos; -err: - cxled_a->pos = -1; - return 0; + dev_dbg(&cxlmd->dev, + "decoder:%s parent:%s port:%s range:%#llx-%#llx pos:%d\n", + dev_name(&cxled->cxld.dev), dev_name(cxlmd->dev.parent), + dev_name(&port->dev), range->start, range->end, pos); + + return pos; } static int cxl_region_sort_targets(struct cxl_region *cxlr) @@ -1608,22 +1633,21 @@ struct cxl_region_params *p = &cxlr->params; int i, rc = 0; - sort(p->targets, p->nr_targets, sizeof(p->targets[0]), cmp_decode_pos, - NULL); - for (i = 0; i < p->nr_targets; i++) { struct cxl_endpoint_decoder *cxled = p->targets[i]; + cxled->pos = cxl_calc_interleave_pos(cxled); /* - * Record that sorting failed, but still continue to restore - * cxled->pos with its ->targets[] position so that follow-on - * code paths can reliably do p->targets[cxled->pos] to - * self-reference their entry. + * Record that sorting failed, but still continue to calc + * cxled->pos so that follow-on code paths can reliably + * do p->targets[cxled->pos] to self-reference their entry. */ if (cxled->pos < 0) rc = -ENXIO; - cxled->pos = i; } + /* Keep the cxlr target list in interleave position order */ + sort(p->targets, p->nr_targets, sizeof(p->targets[0]), + cmp_interleave_pos, NULL); dev_dbg(&cxlr->dev, "region sort %s\n", rc ? "failed" : "successful"); return rc; @@ -1659,6 +1683,12 @@ return -ENXIO; } + if (p->nr_targets >= p->interleave_ways) { + dev_dbg(&cxlr->dev, "region already has %d endpoints\n", + p->nr_targets); + return -EINVAL; + } + ep_port = cxled_to_port(cxled); root_port = cxlrd_to_port(cxlrd); dport = cxl_find_dport_by_dev(root_port, ep_port->host_bridge); @@ -1751,7 +1781,7 @@ if (p->nr_targets == p->interleave_ways) { rc = cxl_region_setup_targets(cxlr); if (rc) - goto err_decrement; + return rc; p->state = CXL_CONFIG_ACTIVE; } @@ -1762,13 +1792,27 @@ .end = p->res->end, }; - return 0; + if (p->nr_targets != p->interleave_ways) + return 0; -err_decrement: - p->nr_targets--; - cxled->pos = -1; - p->targets[pos] = NULL; - return rc; + /* + * Test the auto-discovery position calculator function + * against this successfully created user-defined region. + * A fail message here means that this interleave config + * will fail when presented as CXL_REGION_F_AUTO. + */ + for (int i = 0; i < p->nr_targets; i++) { + struct cxl_endpoint_decoder *cxled = p->targets[i]; + int test_pos; + + test_pos = cxl_calc_interleave_pos(cxled); + dev_dbg(&cxled->cxld.dev, + "Test cxl_calc_interleave_pos(): %s test_pos:%d cxled->pos:%d\n", + (test_pos == cxled->pos) ? "success" : "fail", + test_pos, cxled->pos); + } + + return 0; } static int cxl_region_detach(struct cxl_endpoint_decoder *cxled) @@ -2697,7 +2741,7 @@ return rc; } -static int match_decoder_by_range(struct device *dev, void *data) +static int match_root_decoder_by_range(struct device *dev, void *data) { struct range *r1, *r2 = data; struct cxl_root_decoder *cxlrd; @@ -2828,7 +2872,7 @@ int rc; cxlrd_dev = device_find_child(&root->dev, &cxld->hpa_range, - match_decoder_by_range); + match_root_decoder_by_range); if (!cxlrd_dev) { dev_err(cxlmd->dev.parent, "%s:%s no CXL window for range %#llx:%#llx\n", diff -u linux-aws-6.5-6.5.0/drivers/cxl/pci.c linux-aws-6.5-6.5.0/drivers/cxl/pci.c --- linux-aws-6.5-6.5.0/drivers/cxl/pci.c +++ linux-aws-6.5-6.5.0/drivers/cxl/pci.c @@ -128,10 +128,10 @@ reg = readq(cxlds->regs.mbox + CXLDEV_MBOX_BG_CMD_STATUS_OFFSET); opcode = FIELD_GET(CXLDEV_MBOX_BG_CMD_COMMAND_OPCODE_MASK, reg); if (opcode == CXL_MBOX_OP_SANITIZE) { + mutex_lock(&mds->mbox_mutex); if (mds->security.sanitize_node) - sysfs_notify_dirent(mds->security.sanitize_node); - - dev_dbg(cxlds->dev, "Sanitization operation ended\n"); + mod_delayed_work(system_wq, &mds->security.poll_dwork, 0); + mutex_unlock(&mds->mbox_mutex); } else { /* short-circuit the wait in __cxl_pci_mbox_send_cmd() */ rcuwait_wake_up(&mds->mbox_wait); @@ -152,18 +152,16 @@ mutex_lock(&mds->mbox_mutex); if (cxl_mbox_background_complete(cxlds)) { mds->security.poll_tmo_secs = 0; - put_device(cxlds->dev); - if (mds->security.sanitize_node) sysfs_notify_dirent(mds->security.sanitize_node); + mds->security.sanitize_active = false; dev_dbg(cxlds->dev, "Sanitization operation ended\n"); } else { int timeout = mds->security.poll_tmo_secs + 10; mds->security.poll_tmo_secs = min(15 * 60, timeout); - queue_delayed_work(system_wq, &mds->security.poll_dwork, - timeout * HZ); + schedule_delayed_work(&mds->security.poll_dwork, timeout * HZ); } mutex_unlock(&mds->mbox_mutex); } @@ -295,18 +293,15 @@ * and allow userspace to poll(2) for completion. */ if (mbox_cmd->opcode == CXL_MBOX_OP_SANITIZE) { - if (mds->security.poll) { - /* hold the device throughout */ - get_device(cxlds->dev); - - /* give first timeout a second */ - timeout = 1; - mds->security.poll_tmo_secs = timeout; - queue_delayed_work(system_wq, - &mds->security.poll_dwork, - timeout * HZ); - } + if (mds->security.sanitize_active) + return -EBUSY; + /* give first timeout a second */ + timeout = 1; + mds->security.poll_tmo_secs = timeout; + mds->security.sanitize_active = true; + schedule_delayed_work(&mds->security.poll_dwork, + timeout * HZ); dev_dbg(dev, "Sanitization operation started\n"); goto success; } @@ -389,7 +384,9 @@ const int cap = readl(cxlds->regs.mbox + CXLDEV_MBOX_CAPS_OFFSET); struct device *dev = cxlds->dev; unsigned long timeout; + int irq, msgnum; u64 md_status; + u32 ctrl; timeout = jiffies + mbox_ready_timeout * HZ; do { @@ -437,33 +434,26 @@ dev_dbg(dev, "Mailbox payload sized %zu", mds->payload_size); rcuwait_init(&mds->mbox_wait); + INIT_DELAYED_WORK(&mds->security.poll_dwork, cxl_mbox_sanitize_work); - if (cap & CXLDEV_MBOX_CAP_BG_CMD_IRQ) { - u32 ctrl; - int irq, msgnum; - struct pci_dev *pdev = to_pci_dev(cxlds->dev); - - msgnum = FIELD_GET(CXLDEV_MBOX_CAP_IRQ_MSGNUM_MASK, cap); - irq = pci_irq_vector(pdev, msgnum); - if (irq < 0) - goto mbox_poll; - - if (cxl_request_irq(cxlds, irq, cxl_pci_mbox_irq, NULL)) - goto mbox_poll; - - /* enable background command mbox irq support */ - ctrl = readl(cxlds->regs.mbox + CXLDEV_MBOX_CTRL_OFFSET); - ctrl |= CXLDEV_MBOX_CTRL_BG_CMD_IRQ; - writel(ctrl, cxlds->regs.mbox + CXLDEV_MBOX_CTRL_OFFSET); + /* background command interrupts are optional */ + if (!(cap & CXLDEV_MBOX_CAP_BG_CMD_IRQ)) + return 0; + msgnum = FIELD_GET(CXLDEV_MBOX_CAP_IRQ_MSGNUM_MASK, cap); + irq = pci_irq_vector(to_pci_dev(cxlds->dev), msgnum); + if (irq < 0) return 0; - } -mbox_poll: - mds->security.poll = true; - INIT_DELAYED_WORK(&mds->security.poll_dwork, cxl_mbox_sanitize_work); + if (cxl_request_irq(cxlds, irq, NULL, cxl_pci_mbox_irq)) + return 0; + + dev_dbg(cxlds->dev, "Mailbox interrupts enabled\n"); + /* enable background command mbox irq support */ + ctrl = readl(cxlds->regs.mbox + CXLDEV_MBOX_CTRL_OFFSET); + ctrl |= CXLDEV_MBOX_CTRL_BG_CMD_IRQ; + writel(ctrl, cxlds->regs.mbox + CXLDEV_MBOX_CTRL_OFFSET); - dev_dbg(cxlds->dev, "Mailbox interrupts are unsupported"); return 0; } @@ -484,7 +474,7 @@ resource_size_t component_reg_phys; *map = (struct cxl_register_map) { - .dev = &pdev->dev, + .host = &pdev->dev, .resource = CXL_RESOURCE_NONE, }; @@ -883,11 +873,15 @@ if (rc) return rc; - cxlmd = devm_cxl_add_memdev(cxlds); + cxlmd = devm_cxl_add_memdev(&pdev->dev, cxlds); if (IS_ERR(cxlmd)) return PTR_ERR(cxlmd); - rc = cxl_memdev_setup_fw_upload(mds); + rc = devm_cxl_setup_fw_upload(&pdev->dev, mds); + if (rc) + return rc; + + rc = devm_cxl_sanitize_setup_notifier(&pdev->dev, cxlmd); if (rc) return rc; diff -u linux-aws-6.5-6.5.0/drivers/dma/ste_dma40.c linux-aws-6.5-6.5.0/drivers/dma/ste_dma40.c --- linux-aws-6.5-6.5.0/drivers/dma/ste_dma40.c +++ linux-aws-6.5-6.5.0/drivers/dma/ste_dma40.c @@ -3668,6 +3668,7 @@ regulator_disable(base->lcpa_regulator); regulator_put(base->lcpa_regulator); } + pm_runtime_disable(base->dev); report_failure: d40_err(dev, "probe failed\n"); diff -u linux-aws-6.5-6.5.0/drivers/dma/stm32-mdma.c linux-aws-6.5-6.5.0/drivers/dma/stm32-mdma.c --- linux-aws-6.5-6.5.0/drivers/dma/stm32-mdma.c +++ linux-aws-6.5-6.5.0/drivers/dma/stm32-mdma.c @@ -490,7 +490,7 @@ src_maxburst = chan->dma_config.src_maxburst; dst_maxburst = chan->dma_config.dst_maxburst; - ccr = stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)); + ccr = stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)) & ~STM32_MDMA_CCR_EN; ctcr = stm32_mdma_read(dmadev, STM32_MDMA_CTCR(chan->id)); ctbr = stm32_mdma_read(dmadev, STM32_MDMA_CTBR(chan->id)); @@ -966,7 +966,7 @@ if (!desc) return NULL; - ccr = stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)); + ccr = stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)) & ~STM32_MDMA_CCR_EN; ctcr = stm32_mdma_read(dmadev, STM32_MDMA_CTCR(chan->id)); ctbr = stm32_mdma_read(dmadev, STM32_MDMA_CTBR(chan->id)); cbndtr = stm32_mdma_read(dmadev, STM32_MDMA_CBNDTR(chan->id)); diff -u linux-aws-6.5-6.5.0/drivers/firewire/core-device.c linux-aws-6.5-6.5.0/drivers/firewire/core-device.c --- linux-aws-6.5-6.5.0/drivers/firewire/core-device.c +++ linux-aws-6.5-6.5.0/drivers/firewire/core-device.c @@ -717,14 +717,11 @@ fw_unit_attributes, &unit->attribute_group); - if (device_register(&unit->device) < 0) - goto skip_unit; - fw_device_get(device); - continue; - - skip_unit: - kfree(unit); + if (device_register(&unit->device) < 0) { + put_device(&unit->device); + continue; + } } } diff -u linux-aws-6.5-6.5.0/drivers/firewire/sbp2.c linux-aws-6.5-6.5.0/drivers/firewire/sbp2.c --- linux-aws-6.5-6.5.0/drivers/firewire/sbp2.c +++ linux-aws-6.5-6.5.0/drivers/firewire/sbp2.c @@ -1519,8 +1519,9 @@ sdev->use_10_for_rw = 1; if (sbp2_param_exclusive_login) { - sdev->manage_system_start_stop = true; - sdev->manage_runtime_start_stop = true; + sdev->manage_system_start_stop = 1; + sdev->manage_runtime_start_stop = 1; + sdev->manage_shutdown = 1; } if (sdev->type == TYPE_ROM) diff -u linux-aws-6.5-6.5.0/drivers/firmware/arm_ffa/driver.c linux-aws-6.5-6.5.0/drivers/firmware/arm_ffa/driver.c --- linux-aws-6.5-6.5.0/drivers/firmware/arm_ffa/driver.c +++ linux-aws-6.5-6.5.0/drivers/firmware/arm_ffa/driver.c @@ -587,17 +587,9 @@ return 0; } -static void _ffa_mode_32bit_set(struct ffa_device *dev) -{ - dev->mode_32bit = true; -} - static void ffa_mode_32bit_set(struct ffa_device *dev) { - if (drv_info->version > FFA_VERSION_1_0) - return; - - _ffa_mode_32bit_set(dev); + dev->mode_32bit = true; } static int ffa_sync_send_receive(struct ffa_device *dev, @@ -706,7 +698,7 @@ if (drv_info->version > FFA_VERSION_1_0 && !(tpbuf->properties & FFA_PARTITION_AARCH64_EXEC)) - _ffa_mode_32bit_set(ffa_dev); + ffa_mode_32bit_set(ffa_dev); } kfree(pbuf); } diff -u linux-aws-6.5-6.5.0/drivers/firmware/arm_scmi/perf.c linux-aws-6.5-6.5.0/drivers/firmware/arm_scmi/perf.c --- linux-aws-6.5-6.5.0/drivers/firmware/arm_scmi/perf.c +++ linux-aws-6.5-6.5.0/drivers/firmware/arm_scmi/perf.c @@ -124,15 +124,14 @@ struct perf_dom_info { bool set_limits; - bool set_perf; bool perf_limit_notify; bool perf_level_notify; bool perf_fastchannels; u32 opp_count; u32 sustained_freq_khz; u32 sustained_perf_level; - u32 mult_factor; - char name[SCMI_MAX_STR_SIZE]; + unsigned long mult_factor; + struct scmi_perf_domain_info info; struct scmi_opp opp[MAX_OPPS]; struct scmi_fc_info *fc_info; }; @@ -209,7 +208,7 @@ flags = le32_to_cpu(attr->flags); dom_info->set_limits = SUPPORTS_SET_LIMITS(flags); - dom_info->set_perf = SUPPORTS_SET_PERF_LVL(flags); + dom_info->info.set_perf = SUPPORTS_SET_PERF_LVL(flags); dom_info->perf_limit_notify = SUPPORTS_PERF_LIMIT_NOTIFY(flags); dom_info->perf_level_notify = SUPPORTS_PERF_LEVEL_NOTIFY(flags); dom_info->perf_fastchannels = SUPPORTS_PERF_FASTCHANNELS(flags); @@ -223,9 +222,10 @@ dom_info->mult_factor = 1000; else dom_info->mult_factor = - (dom_info->sustained_freq_khz * 1000) / - dom_info->sustained_perf_level; - strscpy(dom_info->name, attr->name, SCMI_SHORT_NAME_MAX_SIZE); + (dom_info->sustained_freq_khz * 1000UL) + / dom_info->sustained_perf_level; + strscpy(dom_info->info.name, attr->name, + SCMI_SHORT_NAME_MAX_SIZE); } ph->xops->xfer_put(ph, t); @@ -237,7 +237,7 @@ if (!ret && PROTOCOL_REV_MAJOR(version) >= 0x3 && SUPPORTS_EXTENDED_NAMES(flags)) ph->hops->extended_name_get(ph, PERF_DOMAIN_NAME_GET, domain, - dom_info->name, SCMI_MAX_STR_SIZE); + dom_info->info.name, SCMI_MAX_STR_SIZE); return ret; } @@ -333,6 +333,36 @@ return ret; } +static int scmi_perf_num_domains_get(const struct scmi_protocol_handle *ph) +{ + struct scmi_perf_info *pi = ph->get_priv(ph); + + return pi->num_domains; +} + +static inline struct perf_dom_info * +scmi_perf_domain_lookup(const struct scmi_protocol_handle *ph, u32 domain) +{ + struct scmi_perf_info *pi = ph->get_priv(ph); + + if (domain >= pi->num_domains) + return ERR_PTR(-EINVAL); + + return pi->dom_info + domain; +} + +static const struct scmi_perf_domain_info * +scmi_perf_info_get(const struct scmi_protocol_handle *ph, u32 domain) +{ + struct perf_dom_info *dom; + + dom = scmi_perf_domain_lookup(ph, domain); + if (IS_ERR(dom)) + return ERR_PTR(-EINVAL); + + return &dom->info; +} + static int scmi_perf_mb_limits_set(const struct scmi_protocol_handle *ph, u32 domain, u32 max_perf, u32 min_perf) { @@ -356,17 +386,6 @@ return ret; } -static inline struct perf_dom_info * -scmi_perf_domain_lookup(const struct scmi_protocol_handle *ph, u32 domain) -{ - struct scmi_perf_info *pi = ph->get_priv(ph); - - if (domain >= pi->num_domains) - return ERR_PTR(-EINVAL); - - return pi->dom_info + domain; -} - static int scmi_perf_limits_set(const struct scmi_protocol_handle *ph, u32 domain, u32 max_perf, u32 min_perf) { @@ -596,7 +615,6 @@ { int idx, ret, domain; unsigned long freq; - struct scmi_opp *opp; struct perf_dom_info *dom; domain = scmi_dev_domain_id(dev); @@ -607,17 +625,14 @@ if (IS_ERR(dom)) return PTR_ERR(dom); - for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) { - freq = opp->perf * dom->mult_factor; + for (idx = 0; idx < dom->opp_count; idx++) { + freq = dom->opp[idx].perf * dom->mult_factor; ret = dev_pm_opp_add(dev, freq, 0); if (ret) { dev_warn(dev, "failed to add opp %luHz\n", freq); - while (idx-- > 0) { - freq = (--opp)->perf * dom->mult_factor; - dev_pm_opp_remove(dev, freq); - } + dev_pm_opp_remove_all_dynamic(dev); return ret; } } @@ -726,6 +741,8 @@ } static const struct scmi_perf_proto_ops perf_proto_ops = { + .num_domains_get = scmi_perf_num_domains_get, + .info_get = scmi_perf_info_get, .limits_set = scmi_perf_limits_set, .limits_get = scmi_perf_limits_get, .level_set = scmi_perf_level_set, diff -u linux-aws-6.5-6.5.0/drivers/firmware/efi/efi.c linux-aws-6.5-6.5.0/drivers/firmware/efi/efi.c --- linux-aws-6.5-6.5.0/drivers/firmware/efi/efi.c +++ linux-aws-6.5-6.5.0/drivers/firmware/efi/efi.c @@ -274,9 +274,13 @@ if (status == EFI_NOT_FOUND) { break; } else if (status == EFI_BUFFER_TOO_SMALL) { - name = krealloc(name, name_size, GFP_KERNEL); - if (!name) + efi_char16_t *name_tmp = + krealloc(name, name_size, GFP_KERNEL); + if (!name_tmp) { + kfree(name); return -ENOMEM; + } + name = name_tmp; continue; } diff -u linux-aws-6.5-6.5.0/drivers/firmware/efi/libstub/x86-stub.c linux-aws-6.5-6.5.0/drivers/firmware/efi/libstub/x86-stub.c --- linux-aws-6.5-6.5.0/drivers/firmware/efi/libstub/x86-stub.c +++ linux-aws-6.5-6.5.0/drivers/firmware/efi/libstub/x86-stub.c @@ -648,11 +648,8 @@ break; case EFI_UNACCEPTED_MEMORY: - if (!IS_ENABLED(CONFIG_UNACCEPTED_MEMORY)) { - efi_warn_once( -"The system has unaccepted memory, but kernel does not support it\nConsider enabling CONFIG_UNACCEPTED_MEMORY\n"); + if (!IS_ENABLED(CONFIG_UNACCEPTED_MEMORY)) continue; - } e820_type = E820_TYPE_RAM; process_unaccepted_memory(d->phys_addr, d->phys_addr + PAGE_SIZE * d->num_pages); diff -u linux-aws-6.5-6.5.0/drivers/firmware/imx/imx-dsp.c linux-aws-6.5-6.5.0/drivers/firmware/imx/imx-dsp.c --- linux-aws-6.5-6.5.0/drivers/firmware/imx/imx-dsp.c +++ linux-aws-6.5-6.5.0/drivers/firmware/imx/imx-dsp.c @@ -115,11 +115,11 @@ dsp_chan->idx = i % 2; dsp_chan->ch = mbox_request_channel_byname(cl, chan_name); if (IS_ERR(dsp_chan->ch)) { - kfree(dsp_chan->name); ret = PTR_ERR(dsp_chan->ch); if (ret != -EPROBE_DEFER) dev_err(dev, "Failed to request mbox chan %s ret %d\n", chan_name, ret); + kfree(dsp_chan->name); goto out; } diff -u linux-aws-6.5-6.5.0/drivers/firmware/ti_sci.c linux-aws-6.5-6.5.0/drivers/firmware/ti_sci.c --- linux-aws-6.5-6.5.0/drivers/firmware/ti_sci.c +++ linux-aws-6.5-6.5.0/drivers/firmware/ti_sci.c @@ -190,19 +190,6 @@ return 0; } -/** - * ti_sci_debugfs_destroy() - clean up log debug file - * @pdev: platform device pointer - * @info: Pointer to SCI entity information - */ -static void ti_sci_debugfs_destroy(struct platform_device *pdev, - struct ti_sci_info *info) -{ - if (IS_ERR(info->debug_region)) - return; - - debugfs_remove(info->d); -} #else /* CONFIG_DEBUG_FS */ static inline int ti_sci_debugfs_create(struct platform_device *dev, struct ti_sci_info *info) @@ -3448,43 +3435,12 @@ return ret; } -static int ti_sci_remove(struct platform_device *pdev) -{ - struct ti_sci_info *info; - struct device *dev = &pdev->dev; - int ret = 0; - - of_platform_depopulate(dev); - - info = platform_get_drvdata(pdev); - - if (info->nb.notifier_call) - unregister_restart_handler(&info->nb); - - mutex_lock(&ti_sci_list_mutex); - if (info->users) - ret = -EBUSY; - else - list_del(&info->node); - mutex_unlock(&ti_sci_list_mutex); - - if (!ret) { - ti_sci_debugfs_destroy(pdev, info); - - /* Safe to free channels since no more users */ - mbox_free_channel(info->chan_tx); - mbox_free_channel(info->chan_rx); - } - - return ret; -} - static struct platform_driver ti_sci_driver = { .probe = ti_sci_probe, - .remove = ti_sci_remove, .driver = { .name = "ti-sci", .of_match_table = of_match_ptr(ti_sci_of_match), + .suppress_bind_attrs = true, }, }; module_platform_driver(ti_sci_driver); diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -208,7 +208,7 @@ } for (i = 0; i < p->nchunks; i++) { - struct drm_amdgpu_cs_chunk __user **chunk_ptr = NULL; + struct drm_amdgpu_cs_chunk __user *chunk_ptr = NULL; struct drm_amdgpu_cs_chunk user_chunk; uint32_t __user *cdata; @@ -1438,7 +1438,7 @@ if (r == -ENOMEM) DRM_ERROR("Not enough memory for command submission!\n"); else if (r != -ERESTARTSYS && r != -EAGAIN) - DRM_ERROR("Failed to process the buffer list %d!\n", r); + DRM_DEBUG("Failed to process the buffer list %d!\n", r); goto error_fini; } diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -1032,13 +1033,20 @@ */ static int amdgpu_device_asic_init(struct amdgpu_device *adev) { + int ret; + amdgpu_asic_pre_asic_init(adev); if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 3) || - adev->ip_versions[GC_HWIP][0] >= IP_VERSION(11, 0, 0)) - return amdgpu_atomfirmware_asic_init(adev, true); - else + adev->ip_versions[GC_HWIP][0] >= IP_VERSION(11, 0, 0)) { + amdgpu_psp_wait_for_bootloader(adev); + ret = amdgpu_atomfirmware_asic_init(adev, true); + return ret; + } else { return amdgpu_atom_asic_init(adev->mode_info.atom_context); + } + + return 0; } /** @@ -2233,7 +2241,6 @@ */ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) { - struct drm_device *dev = adev_to_drm(adev); struct pci_dev *parent; int i, r; bool total; @@ -2304,7 +2311,7 @@ (amdgpu_is_atpx_hybrid() || amdgpu_has_atpx_dgpu_power_cntl()) && ((adev->flags & AMD_IS_APU) == 0) && - !pci_is_thunderbolt_attached(to_pci_dev(dev->dev))) + !dev_is_removable(&adev->pdev->dev)) adev->flags |= AMD_IS_PX; if (!(adev->flags & AMD_IS_APU)) { @@ -2318,6 +2325,8 @@ adev->pm.pp_feature &= ~PP_GFXOFF_MASK; if (amdgpu_sriov_vf(adev) && adev->asic_type == CHIP_SIENNA_CICHLID) adev->pm.pp_feature &= ~PP_OVERDRIVE_MASK; + if (!amdgpu_device_pcie_dynamic_switching_supported()) + adev->pm.pp_feature &= ~PP_PCIE_DPM_MASK; total = true; for (i = 0; i < adev->num_ip_blocks; i++) { @@ -4126,7 +4135,7 @@ px = amdgpu_device_supports_px(ddev); - if (px || (!pci_is_thunderbolt_attached(adev->pdev) && + if (px || (!dev_is_removable(&adev->pdev->dev) && apple_gmux_detect(NULL, NULL))) vga_switcheroo_register_client(adev->pdev, &amdgpu_switcheroo_ops, px); @@ -4272,7 +4281,7 @@ px = amdgpu_device_supports_px(adev_to_drm(adev)); - if (px || (!pci_is_thunderbolt_attached(adev->pdev) && + if (px || (!dev_is_removable(&adev->pdev->dev) && apple_gmux_detect(NULL, NULL))) vga_switcheroo_unregister_client(adev->pdev); @@ -4901,6 +4910,9 @@ dev_err(adev->dev, "GPU mode1 reset failed\n"); amdgpu_device_load_pci_state(adev->pdev); + ret = amdgpu_psp_wait_for_bootloader(adev); + if (ret) + return ret; /* wait for asic to come out of reset */ for (i = 0; i < adev->usec_timeout; i++) { @@ -4912,6 +4924,7 @@ } amdgpu_atombios_scratch_regs_engine_hung(adev, false); + return ret; } @@ -5395,7 +5408,8 @@ * Flush RAM to disk so that after reboot * the user can read log and see why the system rebooted. */ - if (need_emergency_restart && amdgpu_ras_get_context(adev)->reboot) { + if (need_emergency_restart && amdgpu_ras_get_context(adev) && + amdgpu_ras_get_context(adev)->reboot) { DRM_WARN("Emergency reboot."); ksys_sync_helper(); diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -126,7 +126,7 @@ struct drm_crtc *crtc = &amdgpu_crtc->base; unsigned long flags; - unsigned i; + unsigned int i; int vpos, hpos; for (i = 0; i < work->shared_count; ++i) @@ -203,7 +203,7 @@ u64 tiling_flags; int i, r; - work = kzalloc(sizeof *work, GFP_KERNEL); + work = kzalloc(sizeof(*work), GFP_KERNEL); if (work == NULL) return -ENOMEM; @@ -334,18 +334,17 @@ adev = drm_to_adev(dev); /* if we have active crtcs and we don't have a power ref, - take the current one */ + * take the current one + */ if (active && !adev->have_disp_power_ref) { adev->have_disp_power_ref = true; return ret; } - /* if we have no active crtcs, then drop the power ref - we got before */ - if (!active && adev->have_disp_power_ref) { - pm_runtime_put_autosuspend(dev->dev); + /* if we have no active crtcs, then go to + * drop the power ref we got before + */ + if (!active && adev->have_disp_power_ref) adev->have_disp_power_ref = false; - } - out: /* drop the power reference we got coming in here */ pm_runtime_put_autosuspend(dev->dev); @@ -509,11 +508,10 @@ if (amdgpu_connector->router.ddc_valid) amdgpu_i2c_router_select_ddc_port(amdgpu_connector); - if (use_aux) { + if (use_aux) ret = i2c_transfer(&amdgpu_connector->ddc_bus->aux.ddc, msgs, 2); - } else { + else ret = i2c_transfer(&amdgpu_connector->ddc_bus->adapter, msgs, 2); - } if (ret != 2) /* Couldn't find an accessible DDC on this connector */ @@ -522,10 +520,12 @@ * EDID header starts with: * 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00. * Only the first 6 bytes must be valid as - * drm_edid_block_valid() can fix the last 2 bytes */ + * drm_edid_block_valid() can fix the last 2 bytes + */ if (drm_edid_header_is_valid(buf) < 6) { /* Couldn't find an accessible EDID on this - * connector */ + * connector + */ return false; } return true; @@ -1240,8 +1240,10 @@ obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); if (obj == NULL) { - drm_dbg_kms(dev, "No GEM object associated to handle 0x%08X, " - "can't create framebuffer\n", mode_cmd->handles[0]); + drm_dbg_kms(dev, + "No GEM object associated to handle 0x%08X, can't create framebuffer\n", + mode_cmd->handles[0]); + return ERR_PTR(-ENOENT); } @@ -1434,6 +1436,7 @@ } if (amdgpu_crtc->rmx_type != RMX_OFF) { fixed20_12 a, b; + a.full = dfixed_const(src_v); b.full = dfixed_const(dst_v); amdgpu_crtc->vsc.full = dfixed_div(a, b); @@ -1453,7 +1456,7 @@ * * \param dev Device to query. * \param pipe Crtc to query. - * \param flags Flags from caller (DRM_CALLED_FROM_VBLIRQ or 0). + * \param flags from caller (DRM_CALLED_FROM_VBLIRQ or 0). * For driver internal use only also supports these flags: * * USE_REAL_VBLANKSTART to use the real start of vblank instead @@ -1528,8 +1531,8 @@ /* Called from driver internal vblank counter query code? */ if (flags & GET_DISTANCE_TO_VBLANKSTART) { - /* Caller wants distance from real vbl_start in *hpos */ - *hpos = *vpos - vbl_start; + /* Caller wants distance from real vbl_start in *hpos */ + *hpos = *vpos - vbl_start; } /* Fudge vblank to start a few scanlines earlier to handle the @@ -1551,7 +1554,7 @@ /* In vblank? */ if (in_vbl) - ret |= DRM_SCANOUTPOS_IN_VBLANK; + ret |= DRM_SCANOUTPOS_IN_VBLANK; /* Called from driver internal vblank counter query code? */ if (flags & GET_DISTANCE_TO_VBLANKSTART) { @@ -1659,6 +1662,7 @@ if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) { struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); + r = amdgpu_bo_reserve(aobj, true); if (r == 0) { amdgpu_bo_unpin(aobj); @@ -1666,9 +1670,9 @@ } } - if (fb == NULL || fb->obj[0] == NULL) { + if (!fb || !fb->obj[0]) continue; - } + robj = gem_to_amdgpu_bo(fb->obj[0]); if (!amdgpu_display_robj_is_fb(adev, robj)) { r = amdgpu_bo_reserve(robj, true); @@ -1695,6 +1699,7 @@ if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) { struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); + r = amdgpu_bo_reserve(aobj, true); if (r == 0) { r = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM); diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2238,6 +2238,8 @@ pm_runtime_mark_last_busy(ddev->dev); pm_runtime_put_autosuspend(ddev->dev); + pci_wake_from_d3(pdev, TRUE); + /* * For runpm implemented via BACO, PMFW will handle the * timing for BACO in and out: diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h @@ -28,7 +28,7 @@ #define AMDGPU_IH_MAX_NUM_IVS 32 #define IH_RING_SIZE (256 * 1024) -#define IH_SW_RING_SIZE (8 * 1024) /* enough for 256 CAM entries */ +#define IH_SW_RING_SIZE (16 * 1024) /* enough for 512 CAM entries */ struct amdgpu_device; struct amdgpu_iv_entry; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h @@ -112,6 +112,7 @@ struct psp_funcs { int (*init_microcode)(struct psp_context *psp); + int (*wait_for_bootloader)(struct psp_context *psp); int (*bootloader_load_kdb)(struct psp_context *psp); int (*bootloader_load_spl)(struct psp_context *psp); int (*bootloader_load_sysdrv)(struct psp_context *psp); @@ -527,6 +528,8 @@ int is_psp_fw_valid(struct psp_bin_desc bin); +int amdgpu_psp_wait_for_bootloader(struct amdgpu_device *adev); + int amdgpu_psp_sysfs_init(struct amdgpu_device *adev); void amdgpu_psp_sysfs_fini(struct amdgpu_device *adev); #endif diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -1380,7 +1380,8 @@ { struct amdgpu_ras *con = amdgpu_ras_get_context(adev); - sysfs_remove_file_from_group(&adev->dev->kobj, + if (adev->dev->kobj.sd) + sysfs_remove_file_from_group(&adev->dev->kobj, &con->badpages_attr.attr, RAS_FS_NAME); } @@ -1397,7 +1398,8 @@ .attrs = attrs, }; - sysfs_remove_group(&adev->dev->kobj, &group); + if (adev->dev->kobj.sd) + sysfs_remove_group(&adev->dev->kobj, &group); return 0; } @@ -1444,7 +1446,8 @@ if (!obj || !obj->attr_inuse) return -EINVAL; - sysfs_remove_file_from_group(&adev->dev->kobj, + if (adev->dev->kobj.sd) + sysfs_remove_file_from_group(&adev->dev->kobj, &obj->sysfs_attr.attr, RAS_FS_NAME); obj->attr_inuse = 0; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -6466,11 +6466,11 @@ nv_grbm_select(adev, 0, 0, 0, 0); mutex_unlock(&adev->srbm_mutex); if (adev->gfx.me.mqd_backup[mqd_idx]) - memcpy(adev->gfx.me.mqd_backup[mqd_idx], mqd, sizeof(*mqd)); + memcpy_fromio(adev->gfx.me.mqd_backup[mqd_idx], mqd, sizeof(*mqd)); } else { /* restore mqd with the backup copy */ if (adev->gfx.me.mqd_backup[mqd_idx]) - memcpy(mqd, adev->gfx.me.mqd_backup[mqd_idx], sizeof(*mqd)); + memcpy_toio(mqd, adev->gfx.me.mqd_backup[mqd_idx], sizeof(*mqd)); /* reset the ring */ ring->wptr = 0; *ring->wptr_cpu_addr = 0; @@ -6744,7 +6744,7 @@ if (amdgpu_in_reset(adev)) { /* for GPU_RESET case */ /* reset MQD to a clean status */ if (adev->gfx.kiq[0].mqd_backup) - memcpy(mqd, adev->gfx.kiq[0].mqd_backup, sizeof(*mqd)); + memcpy_toio(mqd, adev->gfx.kiq[0].mqd_backup, sizeof(*mqd)); /* reset ring buffer */ ring->wptr = 0; @@ -6767,7 +6767,7 @@ mutex_unlock(&adev->srbm_mutex); if (adev->gfx.kiq[0].mqd_backup) - memcpy(adev->gfx.kiq[0].mqd_backup, mqd, sizeof(*mqd)); + memcpy_fromio(adev->gfx.kiq[0].mqd_backup, mqd, sizeof(*mqd)); } return 0; @@ -6788,11 +6788,11 @@ mutex_unlock(&adev->srbm_mutex); if (adev->gfx.mec.mqd_backup[mqd_idx]) - memcpy(adev->gfx.mec.mqd_backup[mqd_idx], mqd, sizeof(*mqd)); + memcpy_fromio(adev->gfx.mec.mqd_backup[mqd_idx], mqd, sizeof(*mqd)); } else { /* restore MQD to a clean status */ if (adev->gfx.mec.mqd_backup[mqd_idx]) - memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(*mqd)); + memcpy_toio(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(*mqd)); /* reset ring buffer */ ring->wptr = 0; atomic64_set((atomic64_t *)ring->wptr_cpu_addr, 0); diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c @@ -83,6 +83,10 @@ MODULE_FIRMWARE("amdgpu/gc_11_0_4_mec.bin"); MODULE_FIRMWARE("amdgpu/gc_11_0_4_rlc.bin"); +static const struct soc15_reg_golden golden_settings_gc_11_0[] = { + SOC15_REG_GOLDEN_VALUE(GC, 0, regTCP_CNTL, 0x20000000, 0x20000000) +}; + static const struct soc15_reg_golden golden_settings_gc_11_0_1[] = { SOC15_REG_GOLDEN_VALUE(GC, 0, regCGTT_GS_NGG_CLK_CTRL, 0x9fff8fff, 0x00000010), @@ -275,6 +279,10 @@ default: break; } + soc15_program_register_sequence(adev, + golden_settings_gc_11_0, + (const u32)ARRAY_SIZE(golden_settings_gc_11_0)); + } static void gfx_v11_0_write_data_to_reg(struct amdgpu_ring *ring, int eng_sel, @@ -390,7 +398,7 @@ adev->wb.wb[index] = cpu_to_le32(0xCAFEDEAD); cpu_ptr = &adev->wb.wb[index]; - r = amdgpu_ib_get(adev, NULL, 16, AMDGPU_IB_POOL_DIRECT, &ib); + r = amdgpu_ib_get(adev, NULL, 20, AMDGPU_IB_POOL_DIRECT, &ib); if (r) { DRM_ERROR("amdgpu: failed to get ib (%ld).\n", r); goto err1; @@ -3684,11 +3692,11 @@ soc21_grbm_select(adev, 0, 0, 0, 0); mutex_unlock(&adev->srbm_mutex); if (adev->gfx.me.mqd_backup[mqd_idx]) - memcpy(adev->gfx.me.mqd_backup[mqd_idx], mqd, sizeof(*mqd)); + memcpy_fromio(adev->gfx.me.mqd_backup[mqd_idx], mqd, sizeof(*mqd)); } else { /* restore mqd with the backup copy */ if (adev->gfx.me.mqd_backup[mqd_idx]) - memcpy(mqd, adev->gfx.me.mqd_backup[mqd_idx], sizeof(*mqd)); + memcpy_toio(mqd, adev->gfx.me.mqd_backup[mqd_idx], sizeof(*mqd)); /* reset the ring */ ring->wptr = 0; *ring->wptr_cpu_addr = 0; @@ -3977,7 +3985,7 @@ if (amdgpu_in_reset(adev)) { /* for GPU_RESET case */ /* reset MQD to a clean status */ if (adev->gfx.kiq[0].mqd_backup) - memcpy(mqd, adev->gfx.kiq[0].mqd_backup, sizeof(*mqd)); + memcpy_toio(mqd, adev->gfx.kiq[0].mqd_backup, sizeof(*mqd)); /* reset ring buffer */ ring->wptr = 0; @@ -4000,7 +4008,7 @@ mutex_unlock(&adev->srbm_mutex); if (adev->gfx.kiq[0].mqd_backup) - memcpy(adev->gfx.kiq[0].mqd_backup, mqd, sizeof(*mqd)); + memcpy_fromio(adev->gfx.kiq[0].mqd_backup, mqd, sizeof(*mqd)); } return 0; @@ -4021,11 +4029,11 @@ mutex_unlock(&adev->srbm_mutex); if (adev->gfx.mec.mqd_backup[mqd_idx]) - memcpy(adev->gfx.mec.mqd_backup[mqd_idx], mqd, sizeof(*mqd)); + memcpy_fromio(adev->gfx.mec.mqd_backup[mqd_idx], mqd, sizeof(*mqd)); } else { /* restore MQD to a clean status */ if (adev->gfx.mec.mqd_backup[mqd_idx]) - memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(*mqd)); + memcpy_toio(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(*mqd)); /* reset ring buffer */ ring->wptr = 0; atomic64_set((atomic64_t *)ring->wptr_cpu_addr, 0); diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c @@ -883,8 +883,8 @@ gpu_addr = adev->wb.gpu_addr + (index * 4); adev->wb.wb[index] = cpu_to_le32(0xCAFEDEAD); memset(&ib, 0, sizeof(ib)); - r = amdgpu_ib_get(adev, NULL, 16, - AMDGPU_IB_POOL_DIRECT, &ib); + + r = amdgpu_ib_get(adev, NULL, 20, AMDGPU_IB_POOL_DIRECT, &ib); if (r) goto err1; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -1037,8 +1037,8 @@ gpu_addr = adev->wb.gpu_addr + (index * 4); adev->wb.wb[index] = cpu_to_le32(0xCAFEDEAD); memset(&ib, 0, sizeof(ib)); - r = amdgpu_ib_get(adev, NULL, 16, - AMDGPU_IB_POOL_DIRECT, &ib); + + r = amdgpu_ib_get(adev, NULL, 20, AMDGPU_IB_POOL_DIRECT, &ib); if (r) goto err1; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c @@ -296,8 +296,8 @@ gpu_addr = adev->wb.gpu_addr + (index * 4); adev->wb.wb[index] = cpu_to_le32(0xCAFEDEAD); memset(&ib, 0, sizeof(ib)); - r = amdgpu_ib_get(adev, NULL, 16, - AMDGPU_IB_POOL_DIRECT, &ib); + + r = amdgpu_ib_get(adev, NULL, 20, AMDGPU_IB_POOL_DIRECT, &ib); if (r) goto err1; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1690,8 +1690,7 @@ DRM_INFO("Display Core v%s initialized on %s\n", DC_VER, dce_version_to_string(adev->dm.dc->ctx->dce_version)); } else { - DRM_INFO("Display Core v%s failed to initialize on %s\n", DC_VER, - dce_version_to_string(adev->dm.dc->ctx->dce_version)); + DRM_INFO("Display Core failed to initialize with v%s!\n", DC_VER); goto error; } @@ -2078,7 +2077,7 @@ struct dmub_srv_create_params create_params; struct dmub_srv_region_params region_params; struct dmub_srv_region_info region_info; - struct dmub_srv_fb_params fb_params; + struct dmub_srv_memory_params memory_params; struct dmub_srv_fb_info *fb_info; struct dmub_srv *dmub_srv; const struct dmcub_firmware_header_v1_0 *hdr; @@ -2178,6 +2177,7 @@ adev->dm.dmub_fw->data + le32_to_cpu(hdr->header.ucode_array_offset_bytes) + PSP_HEADER_BYTES; + region_params.is_mailbox_in_inbox = false; status = dmub_srv_calc_region_info(dmub_srv, ®ion_params, ®ion_info); @@ -2201,10 +2201,10 @@ return r; /* Rebase the regions on the framebuffer address. */ - memset(&fb_params, 0, sizeof(fb_params)); - fb_params.cpu_addr = adev->dm.dmub_bo_cpu_addr; - fb_params.gpu_addr = adev->dm.dmub_bo_gpu_addr; - fb_params.region_info = ®ion_info; + memset(&memory_params, 0, sizeof(memory_params)); + memory_params.cpu_fb_addr = adev->dm.dmub_bo_cpu_addr; + memory_params.gpu_fb_addr = adev->dm.dmub_bo_gpu_addr; + memory_params.region_info = ®ion_info; adev->dm.dmub_fb_info = kzalloc(sizeof(*adev->dm.dmub_fb_info), GFP_KERNEL); @@ -2216,7 +2216,7 @@ return -ENOMEM; } - status = dmub_srv_calc_fb_info(dmub_srv, &fb_params, fb_info); + status = dmub_srv_calc_mem_info(dmub_srv, &memory_params, fb_info); if (status != DMUB_STATUS_OK) { DRM_ERROR("Error calculating DMUB FB info: %d\n", status); return -EINVAL; @@ -6203,7 +6203,7 @@ dm_new_state->underscan_enable = val; ret = 0; } else if (property == adev->mode_info.abm_level_property) { - dm_new_state->abm_level = val; + dm_new_state->abm_level = val ?: ABM_LEVEL_IMMEDIATE_DISABLE; ret = 0; } @@ -6248,7 +6248,8 @@ *val = dm_state->underscan_enable; ret = 0; } else if (property == adev->mode_info.abm_level_property) { - *val = dm_state->abm_level; + *val = (dm_state->abm_level != ABM_LEVEL_IMMEDIATE_DISABLE) ? + dm_state->abm_level : 0; ret = 0; } @@ -6321,7 +6322,8 @@ state->pbn = 0; if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) - state->abm_level = amdgpu_dm_abm_level; + state->abm_level = amdgpu_dm_abm_level ?: + ABM_LEVEL_IMMEDIATE_DISABLE; __drm_atomic_helper_connector_reset(connector, &state->base); } @@ -7398,6 +7400,9 @@ int i; int result = -EIO; + if (!ddc_service->ddc_pin || !ddc_service->ddc_pin->hw_info.hw_supported) + return result; + cmd.payloads = kcalloc(num, sizeof(struct i2c_payload), GFP_KERNEL); if (!cmd.payloads) @@ -9508,14 +9513,14 @@ struct drm_plane *other; struct drm_plane_state *old_other_state, *new_other_state; struct drm_crtc_state *new_crtc_state; + struct amdgpu_device *adev = drm_to_adev(plane->dev); int i; /* - * TODO: Remove this hack once the checks below are sufficient - * enough to determine when we need to reset all the planes on - * the stream. + * TODO: Remove this hack for all asics once it proves that the + * fast updates works fine on DCN3.2+. */ - if (state->allow_modeset) + if (adev->ip_versions[DCE_HWIP][0] < IP_VERSION(3, 2, 0) && state->allow_modeset) return true; /* Exit early if we know that we're adding or removing the plane. */ @@ -9861,16 +9866,27 @@ } } +static void +dm_get_plane_scale(struct drm_plane_state *plane_state, + int *out_plane_scale_w, int *out_plane_scale_h) +{ + int plane_src_w, plane_src_h; + + dm_get_oriented_plane_size(plane_state, &plane_src_w, &plane_src_h); + *out_plane_scale_w = plane_state->crtc_w * 1000 / plane_src_w; + *out_plane_scale_h = plane_state->crtc_h * 1000 / plane_src_h; +} + static int dm_check_crtc_cursor(struct drm_atomic_state *state, struct drm_crtc *crtc, struct drm_crtc_state *new_crtc_state) { - struct drm_plane *cursor = crtc->cursor, *underlying; + struct drm_plane *cursor = crtc->cursor, *plane, *underlying; + struct drm_plane_state *old_plane_state, *new_plane_state; struct drm_plane_state *new_cursor_state, *new_underlying_state; int i; int cursor_scale_w, cursor_scale_h, underlying_scale_w, underlying_scale_h; - int cursor_src_w, cursor_src_h; - int underlying_src_w, underlying_src_h; + bool any_relevant_change = false; /* On DCE and DCN there is no dedicated hardware cursor plane. We get a * cursor per pipe but it's going to inherit the scaling and @@ -9878,13 +9894,50 @@ * blending properties match the underlying planes'. */ - new_cursor_state = drm_atomic_get_new_plane_state(state, cursor); - if (!new_cursor_state || !new_cursor_state->fb) + /* If no plane was enabled or changed scaling, no need to check again */ + for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) { + int new_scale_w, new_scale_h, old_scale_w, old_scale_h; + + if (!new_plane_state || !new_plane_state->fb || new_plane_state->crtc != crtc) + continue; + + if (!old_plane_state || !old_plane_state->fb || old_plane_state->crtc != crtc) { + any_relevant_change = true; + break; + } + + if (new_plane_state->fb == old_plane_state->fb && + new_plane_state->crtc_w == old_plane_state->crtc_w && + new_plane_state->crtc_h == old_plane_state->crtc_h) + continue; + + dm_get_plane_scale(new_plane_state, &new_scale_w, &new_scale_h); + dm_get_plane_scale(old_plane_state, &old_scale_w, &old_scale_h); + + if (new_scale_w != old_scale_w || new_scale_h != old_scale_h) { + any_relevant_change = true; + break; + } + } + + if (!any_relevant_change) return 0; - dm_get_oriented_plane_size(new_cursor_state, &cursor_src_w, &cursor_src_h); - cursor_scale_w = new_cursor_state->crtc_w * 1000 / cursor_src_w; - cursor_scale_h = new_cursor_state->crtc_h * 1000 / cursor_src_h; + new_cursor_state = drm_atomic_get_plane_state(state, cursor); + if (IS_ERR(new_cursor_state)) + return PTR_ERR(new_cursor_state); + + if (!new_cursor_state->fb) + return 0; + + dm_get_plane_scale(new_cursor_state, &cursor_scale_w, &cursor_scale_h); + + /* Need to check all enabled planes, even if this commit doesn't change + * their state + */ + i = drm_atomic_add_affected_planes(state, crtc); + if (i) + return i; for_each_new_plane_in_state_reverse(state, underlying, new_underlying_state, i) { /* Narrow down to non-cursor planes on the same CRTC as the cursor */ @@ -9895,10 +9948,8 @@ if (!new_underlying_state->fb) continue; - dm_get_oriented_plane_size(new_underlying_state, - &underlying_src_w, &underlying_src_h); - underlying_scale_w = new_underlying_state->crtc_w * 1000 / underlying_src_w; - underlying_scale_h = new_underlying_state->crtc_h * 1000 / underlying_src_h; + dm_get_plane_scale(new_underlying_state, + &underlying_scale_w, &underlying_scale_h); if (cursor_scale_w != underlying_scale_w || cursor_scale_h != underlying_scale_h) { diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/core/dc.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/core/dc.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/core/dc.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -993,7 +993,8 @@ /* set i2c speed if not done by the respective dcnxxx__resource.c */ if (dc->caps.i2c_speed_in_khz_hdcp == 0) dc->caps.i2c_speed_in_khz_hdcp = dc->caps.i2c_speed_in_khz; - + if (dc->caps.max_optimizable_video_width == 0) + dc->caps.max_optimizable_video_width = 5120; dc->clk_mgr = dc_clk_mgr_create(dc->ctx, dc->res_pool->pp_smu, dc->res_pool->dccg); if (!dc->clk_mgr) goto fail; @@ -1070,53 +1071,6 @@ } } -static void phantom_pipe_blank( - struct dc *dc, - struct timing_generator *tg, - int width, - int height) -{ - struct dce_hwseq *hws = dc->hwseq; - enum dc_color_space color_space; - struct tg_color black_color = {0}; - struct output_pixel_processor *opp = NULL; - uint32_t num_opps, opp_id_src0, opp_id_src1; - uint32_t otg_active_width, otg_active_height; - uint32_t i; - - /* program opp dpg blank color */ - color_space = COLOR_SPACE_SRGB; - color_space_to_black_color(dc, color_space, &black_color); - - otg_active_width = width; - otg_active_height = height; - - /* get the OPTC source */ - tg->funcs->get_optc_source(tg, &num_opps, &opp_id_src0, &opp_id_src1); - ASSERT(opp_id_src0 < dc->res_pool->res_cap->num_opp); - - for (i = 0; i < dc->res_pool->res_cap->num_opp; i++) { - if (dc->res_pool->opps[i] != NULL && dc->res_pool->opps[i]->inst == opp_id_src0) { - opp = dc->res_pool->opps[i]; - break; - } - } - - if (opp && opp->funcs->opp_set_disp_pattern_generator) - opp->funcs->opp_set_disp_pattern_generator( - opp, - CONTROLLER_DP_TEST_PATTERN_SOLID_COLOR, - CONTROLLER_DP_COLOR_SPACE_UDEFINED, - COLOR_DEPTH_UNDEFINED, - &black_color, - otg_active_width, - otg_active_height, - 0); - - if (tg->funcs->is_tg_enabled(tg)) - hws->funcs.wait_for_blank_complete(opp); -} - static void dc_update_viusal_confirm_color(struct dc *dc, struct dc_state *context, struct pipe_ctx *pipe_ctx) { if (dc->ctx->dce_version >= DCN_VERSION_1_0) { @@ -1207,7 +1161,8 @@ main_pipe_width = old_stream->mall_stream_config.paired_stream->dst.width; main_pipe_height = old_stream->mall_stream_config.paired_stream->dst.height; - phantom_pipe_blank(dc, tg, main_pipe_width, main_pipe_height); + if (dc->hwss.blank_phantom) + dc->hwss.blank_phantom(dc, tg, main_pipe_width, main_pipe_height); tg->funcs->enable_crtc(tg); } } @@ -2476,6 +2431,7 @@ } static enum surface_update_type get_scaling_info_update_type( + const struct dc *dc, const struct dc_surface_update *u) { union surface_update_flags *update_flags = &u->surface->update_flags; @@ -2510,6 +2466,12 @@ update_flags->bits.clock_change = 1; } + if (u->scaling_info->src_rect.width > dc->caps.max_optimizable_video_width && + (u->scaling_info->clip_rect.width > u->surface->clip_rect.width || + u->scaling_info->clip_rect.height > u->surface->clip_rect.height)) + /* Changing clip size of a large surface may result in MPC slice count change */ + update_flags->bits.bandwidth_change = 1; + if (u->scaling_info->src_rect.x != u->surface->src_rect.x || u->scaling_info->src_rect.y != u->surface->src_rect.y || u->scaling_info->clip_rect.x != u->surface->clip_rect.x @@ -2547,7 +2509,7 @@ type = get_plane_info_update_type(u); elevate_update_type(&overall_type, type); - type = get_scaling_info_update_type(u); + type = get_scaling_info_update_type(dc, u); elevate_update_type(&overall_type, type); if (u->flip_addr) { @@ -4460,6 +4422,14 @@ update_type, context); } else { + if (!stream_update && + dc->hwss.is_pipe_topology_transition_seamless && + !dc->hwss.is_pipe_topology_transition_seamless( + dc, dc->current_state, context)) { + + DC_LOG_ERROR("performing non-seamless pipe topology transition with surface only update!\n"); + BREAK_TO_DEBUGGER(); + } commit_planes_for_stream( dc, srf_updates, @@ -5302,0 +5273,22 @@ + +/** + ***************************************************************************** + * dc_set_edp_power() - DM controls eDP power to be ON/OFF + * + * Called when DM wants to power on/off eDP. + * Only work on links with flag skip_implict_edp_power_control is set. + * + ***************************************************************************** + */ +void dc_set_edp_power(const struct dc *dc, struct dc_link *edp_link, + bool powerOn) +{ + if (edp_link->connector_signal != SIGNAL_TYPE_EDP) + return; + + if (edp_link->skip_implict_edp_power_control == false) + return; + + edp_link->dc->link_srv->edp_set_panel_power(edp_link, powerOn); +} + diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dc.h linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dc.h --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dc.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dc.h @@ -229,6 +229,11 @@ uint32_t dmdata_alloc_size; unsigned int max_cursor_size; unsigned int max_video_width; + /* + * max video plane width that can be safely assumed to be always + * supported by single DPP pipe. + */ + unsigned int max_optimizable_video_width; unsigned int min_horizontal_blanking_period; int linear_pitch_alignment; bool dcc_const_color; @@ -1552,6 +1557,7 @@ struct phy_state phy_state; // BW ALLOCATON USB4 ONLY struct dc_dpia_bw_alloc dpia_bw_alloc_config; + bool skip_implict_edp_power_control; }; /* Return an enumerated dc_link. @@ -1571,6 +1577,9 @@ struct dc_link **edp_links, int *edp_num); +void dc_set_edp_power(const struct dc *dc, struct dc_link *edp_link, + bool powerOn); + /* The function initiates detection handshake over the given link. It first * determines if there are display connections over the link. If so it initiates * detection protocols supported by the connected receiver device. The function diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c @@ -1219,7 +1219,7 @@ struct dce_hwseq *hws = link->dc->hwseq; if (link->local_sink && link->local_sink->sink_signal == SIGNAL_TYPE_EDP) { - if (!stream->skip_edp_power_down) + if (!link->skip_implict_edp_power_control) hws->funcs.edp_backlight_control(link, false); link->dc->hwss.set_abm_immediate_disable(pipe_ctx); } diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c @@ -111,7 +111,8 @@ if (pipe_ctx->top_pipe || !pipe_ctx->stream || (!pipe_ctx->plane_state && !old_pipe_ctx->plane_state) || - !tg->funcs->is_tg_enabled(tg)) + !tg->funcs->is_tg_enabled(tg) || + pipe_ctx->stream->mall_stream_config.type == SUBVP_PHANTOM) continue; if (lock) diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c @@ -1846,8 +1846,16 @@ dc->current_state->res_ctx.pipe_ctx[i].stream->mall_stream_config.type == SUBVP_PHANTOM) { struct timing_generator *tg = dc->current_state->res_ctx.pipe_ctx[i].stream_res.tg; - if (tg->funcs->enable_crtc) + if (tg->funcs->enable_crtc) { + if (dc->hwss.blank_phantom) { + int main_pipe_width, main_pipe_height; + + main_pipe_width = dc->current_state->res_ctx.pipe_ctx[i].stream->mall_stream_config.paired_stream->dst.width; + main_pipe_height = dc->current_state->res_ctx.pipe_ctx[i].stream->mall_stream_config.paired_stream->dst.height; + dc->hwss.blank_phantom(dc, tg, main_pipe_width, main_pipe_height); + } tg->funcs->enable_crtc(tg); + } } } /* OTG blank before disabling all front ends */ diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c @@ -868,7 +868,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_z10 = false, .enable_z9_disable_interface = true, - .minimum_z8_residency_time = 2000, + .minimum_z8_residency_time = 2100, .psr_skip_crtc_disable = true, .disable_dmcu = true, .force_abm_enable = false, diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c @@ -948,10 +948,8 @@ { int plane_count; int i; - unsigned int min_dst_y_next_start_us; plane_count = 0; - min_dst_y_next_start_us = 0; for (i = 0; i < dc->res_pool->pipe_count; i++) { if (context->res_ctx.pipe_ctx[i].plane_state) plane_count++; @@ -973,26 +971,15 @@ else if (context->stream_count == 1 && context->streams[0]->signal == SIGNAL_TYPE_EDP) { struct dc_link *link = context->streams[0]->sink->link; struct dc_stream_status *stream_status = &context->stream_status[0]; - struct dc_stream_state *current_stream = context->streams[0]; int minmum_z8_residency = dc->debug.minimum_z8_residency_time > 0 ? dc->debug.minimum_z8_residency_time : 1000; bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > (double)minmum_z8_residency; bool is_pwrseq0 = link->link_index == 0; - bool isFreesyncVideo; - - isFreesyncVideo = current_stream->adjust.v_total_min == current_stream->adjust.v_total_max; - isFreesyncVideo = isFreesyncVideo && current_stream->timing.v_total < current_stream->adjust.v_total_min; - for (i = 0; i < dc->res_pool->pipe_count; i++) { - if (context->res_ctx.pipe_ctx[i].stream == current_stream && isFreesyncVideo) { - min_dst_y_next_start_us = context->res_ctx.pipe_ctx[i].dlg_regs.min_dst_y_next_start_us; - break; - } - } /* Don't support multi-plane configurations */ if (stream_status->plane_count > 1) return DCN_ZSTATE_SUPPORT_DISALLOW; - if (is_pwrseq0 && (context->bw_ctx.dml.vba.StutterPeriod > 5000.0 || min_dst_y_next_start_us > 5000)) + if (is_pwrseq0 && context->bw_ctx.dml.vba.StutterPeriod > 5000.0) return DCN_ZSTATE_SUPPORT_ALLOW; else if (is_pwrseq0 && link->psr_settings.psr_version == DC_PSR_VERSION_1 && !link->panel_config.psr.disable_psr) return allow_z8 ? DCN_ZSTATE_SUPPORT_ALLOW_Z8_Z10_ONLY : DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/link_factory.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/link_factory.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/link_factory.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/link_factory.c @@ -215,6 +215,7 @@ link_srv->edp_receiver_ready_T9 = edp_receiver_ready_T9; link_srv->edp_receiver_ready_T7 = edp_receiver_ready_T7; link_srv->edp_power_alpm_dpcd_enable = edp_power_alpm_dpcd_enable; + link_srv->edp_set_panel_power = edp_set_panel_power; } /* link dp cts implements dp compliance test automation protocols and manual diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/amdgpu_pm.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/amdgpu_pm.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -734,7 +734,7 @@ if (adev->in_suspend && !adev->in_runpm) return -EPERM; - if (count > 127) + if (count > 127 || count == 0) return -EINVAL; if (*buf == 's') @@ -754,7 +754,8 @@ else return -EINVAL; - memcpy(buf_cpy, buf, count+1); + memcpy(buf_cpy, buf, count); + buf_cpy[count] = 0; tmp_str = buf_cpy; @@ -771,6 +772,9 @@ return -EINVAL; parameter_size++; + if (!tmp_str) + break; + while (isspace(*tmp_str)) tmp_str++; } @@ -2077,6 +2081,7 @@ case IP_VERSION(11, 0, 0): case IP_VERSION(11, 0, 1): case IP_VERSION(11, 0, 2): + case IP_VERSION(11, 0, 3): *states = ATTR_STATE_SUPPORTED; break; default: diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c @@ -2084,14 +2084,14 @@ #define MAX(a, b) ((a) > (b) ? (a) : (b)) static int sienna_cichlid_update_pcie_parameters(struct smu_context *smu, - uint32_t pcie_gen_cap, - uint32_t pcie_width_cap) + uint8_t pcie_gen_cap, + uint8_t pcie_width_cap) { struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context; struct smu_11_0_pcie_table *pcie_table = &dpm_context->dpm_tables.pcie_table; uint8_t *table_member1, *table_member2; - uint32_t min_gen_speed, max_gen_speed; - uint32_t min_lane_width, max_lane_width; + uint8_t min_gen_speed, max_gen_speed; + uint8_t min_lane_width, max_lane_width; uint32_t smu_pcie_arg; int ret, i; @@ -2107,7 +2107,7 @@ min_lane_width = min_lane_width > max_lane_width ? max_lane_width : min_lane_width; - if (!amdgpu_device_pcie_dynamic_switching_supported()) { + if (!(smu->adev->pm.pp_feature & PP_PCIE_DPM_MASK)) { pcie_table->pcie_gen[0] = max_gen_speed; pcie_table->pcie_lane[0] = max_lane_width; } else { diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c @@ -2162,38 +2162,10 @@ } } - if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_COMPUTE && - (((smu->adev->pdev->device == 0x744C) && (smu->adev->pdev->revision == 0xC8)) || - ((smu->adev->pdev->device == 0x744C) && (smu->adev->pdev->revision == 0xCC)))) { - ret = smu_cmn_update_table(smu, - SMU_TABLE_ACTIVITY_MONITOR_COEFF, - WORKLOAD_PPLIB_COMPUTE_BIT, - (void *)(&activity_monitor_external), - false); - if (ret) { - dev_err(smu->adev->dev, "[%s] Failed to get activity monitor!", __func__); - return ret; - } - - ret = smu_cmn_update_table(smu, - SMU_TABLE_ACTIVITY_MONITOR_COEFF, - WORKLOAD_PPLIB_CUSTOM_BIT, - (void *)(&activity_monitor_external), - true); - if (ret) { - dev_err(smu->adev->dev, "[%s] Failed to set activity monitor!", __func__); - return ret; - } - - workload_type = smu_cmn_to_asic_specific_index(smu, - CMN2ASIC_MAPPING_WORKLOAD, - PP_SMC_POWER_PROFILE_CUSTOM); - } else { - /* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ - workload_type = smu_cmn_to_asic_specific_index(smu, + /* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ + workload_type = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_WORKLOAD, smu->power_profile_mode); - } if (workload_type < 0) return -EINVAL; reverted: --- linux-aws-6.5-6.5.0/drivers/gpu/drm/ast/ast_dp.c +++ linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/ast/ast_dp.c @@ -7,17 +7,6 @@ #include #include "ast_drv.h" -bool ast_astdp_is_connected(struct ast_device *ast) -{ - if (!ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xD1, ASTDP_MCU_FW_EXECUTING)) - return false; - if (!ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xDF, ASTDP_HPD)) - return false; - if (!ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xDC, ASTDP_LINK_SUCCESS)) - return false; - return true; -} - int ast_astdp_read_edid(struct drm_device *dev, u8 *ediddata) { struct ast_device *ast = to_ast_device(dev); reverted: --- linux-aws-6.5-6.5.0/drivers/gpu/drm/ast/ast_dp501.c +++ linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/ast/ast_dp501.c @@ -272,9 +272,11 @@ return true; } +bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata) -bool ast_dp501_is_connected(struct ast_device *ast) { + struct ast_device *ast = to_ast_device(dev); + u32 i, boot_address, offset, data; + u32 *pEDIDidx; - u32 boot_address, offset, data; if (ast->config_mode == ast_use_p2a) { boot_address = get_fw_base(ast); @@ -290,6 +292,14 @@ data = ast_mindwm(ast, boot_address + offset); if (!(data & AST_DP501_PNP_CONNECTED)) return false; + + /* Read EDID */ + offset = AST_DP501_EDID_DATA; + for (i = 0; i < 128; i += 4) { + data = ast_mindwm(ast, boot_address + offset + i); + pEDIDidx = (u32 *)(ediddata + i); + *pEDIDidx = data; + } } else { if (!ast->dp501_fw_buf) return false; @@ -309,33 +319,10 @@ data = readl(ast->dp501_fw_buf + offset); if (!(data & AST_DP501_PNP_CONNECTED)) return false; - } - return true; -} - -bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata) -{ - struct ast_device *ast = to_ast_device(dev); - u32 i, boot_address, offset, data; - u32 *pEDIDidx; - - if (!ast_dp501_is_connected(ast)) - return false; - - if (ast->config_mode == ast_use_p2a) { - boot_address = get_fw_base(ast); /* Read EDID */ offset = AST_DP501_EDID_DATA; for (i = 0; i < 128; i += 4) { - data = ast_mindwm(ast, boot_address + offset + i); - pEDIDidx = (u32 *)(ediddata + i); - *pEDIDidx = data; - } - } else { - /* Read EDID */ - offset = AST_DP501_EDID_DATA; - for (i = 0; i < 128; i += 4) { data = readl(ast->dp501_fw_buf + offset + i); pEDIDidx = (u32 *)(ediddata + i); *pEDIDidx = data; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/ast/ast_drv.h linux-aws-6.5-6.5.0/drivers/gpu/drm/ast/ast_drv.h --- linux-aws-6.5-6.5.0/drivers/gpu/drm/ast/ast_drv.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/ast/ast_drv.h @@ -153,6 +153,17 @@ return container_of(connector, struct ast_sil164_connector, base); } +struct ast_bmc_connector { + struct drm_connector base; + struct drm_connector *physical_connector; +}; + +static inline struct ast_bmc_connector * +to_ast_bmc_connector(struct drm_connector *connector) +{ + return container_of(connector, struct ast_bmc_connector, base); +} + /* * Device */ @@ -198,7 +209,7 @@ } astdp; struct { struct drm_encoder encoder; - struct drm_connector connector; + struct ast_bmc_connector bmc_connector; } bmc; } output; @@ -472,7 +483,6 @@ /* ast dp501 */ void ast_set_dp501_video_output(struct drm_device *dev, u8 mode); bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size); -bool ast_dp501_is_connected(struct ast_device *ast); bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata); u8 ast_get_dp501_max_clk(struct drm_device *dev); void ast_init_3rdtx(struct drm_device *dev); @@ -481,7 +491,6 @@ struct ast_i2c_chan *ast_i2c_create(struct drm_device *dev); /* aspeed DP */ -bool ast_astdp_is_connected(struct ast_device *ast); int ast_astdp_read_edid(struct drm_device *dev, u8 *ediddata); void ast_dp_launch(struct drm_device *dev); void ast_dp_power_on_off(struct drm_device *dev, bool no); diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/ast/ast_mode.c linux-aws-6.5-6.5.0/drivers/gpu/drm/ast/ast_mode.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/ast/ast_mode.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/ast/ast_mode.c @@ -1585,20 +1585,8 @@ return 0; } -static int ast_dp501_connector_helper_detect_ctx(struct drm_connector *connector, - struct drm_modeset_acquire_ctx *ctx, - bool force) -{ - struct ast_device *ast = to_ast_device(connector->dev); - - if (ast_dp501_is_connected(ast)) - return connector_status_connected; - return connector_status_disconnected; -} - static const struct drm_connector_helper_funcs ast_dp501_connector_helper_funcs = { .get_modes = ast_dp501_connector_helper_get_modes, - .detect_ctx = ast_dp501_connector_helper_detect_ctx, }; static const struct drm_connector_funcs ast_dp501_connector_funcs = { @@ -1623,7 +1611,7 @@ connector->interlace_allowed = 0; connector->doublescan_allowed = 0; - connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; + connector->polled = DRM_CONNECTOR_POLL_CONNECT; return 0; } @@ -1695,20 +1683,8 @@ return 0; } -static int ast_astdp_connector_helper_detect_ctx(struct drm_connector *connector, - struct drm_modeset_acquire_ctx *ctx, - bool force) -{ - struct ast_device *ast = to_ast_device(connector->dev); - - if (ast_astdp_is_connected(ast)) - return connector_status_connected; - return connector_status_disconnected; -} - static const struct drm_connector_helper_funcs ast_astdp_connector_helper_funcs = { .get_modes = ast_astdp_connector_helper_get_modes, - .detect_ctx = ast_astdp_connector_helper_detect_ctx, }; static const struct drm_connector_funcs ast_astdp_connector_funcs = { @@ -1733,7 +1709,7 @@ connector->interlace_allowed = 0; connector->doublescan_allowed = 0; - connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; + connector->polled = DRM_CONNECTOR_POLL_CONNECT; return 0; } @@ -1770,6 +1746,30 @@ .destroy = drm_encoder_cleanup, }; +static int ast_bmc_connector_helper_detect_ctx(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx, + bool force) +{ + struct ast_bmc_connector *bmc_connector = to_ast_bmc_connector(connector); + struct drm_connector *physical_connector = bmc_connector->physical_connector; + + /* + * Most user-space compositors cannot handle more than one connected + * connector per CRTC. Hence, we only mark the BMC as connected if the + * physical connector is disconnected. If the physical connector's status + * is connected or unknown, the BMC remains disconnected. This has no + * effect on the output of the BMC. + * + * FIXME: Remove this logic once user-space compositors can handle more + * than one connector per CRTC. The BMC should always be connected. + */ + + if (physical_connector && physical_connector->status == connector_status_disconnected) + return connector_status_connected; + + return connector_status_disconnected; +} + static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector) { return drm_add_modes_noedid(connector, 4096, 4096); @@ -1777,6 +1777,7 @@ static const struct drm_connector_helper_funcs ast_bmc_connector_helper_funcs = { .get_modes = ast_bmc_connector_helper_get_modes, + .detect_ctx = ast_bmc_connector_helper_detect_ctx, }; static const struct drm_connector_funcs ast_bmc_connector_funcs = { @@ -1787,12 +1788,33 @@ .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; -static int ast_bmc_output_init(struct ast_device *ast) +static int ast_bmc_connector_init(struct drm_device *dev, + struct ast_bmc_connector *bmc_connector, + struct drm_connector *physical_connector) +{ + struct drm_connector *connector = &bmc_connector->base; + int ret; + + ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs, + DRM_MODE_CONNECTOR_VIRTUAL); + if (ret) + return ret; + + drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs); + + bmc_connector->physical_connector = physical_connector; + + return 0; +} + +static int ast_bmc_output_init(struct ast_device *ast, + struct drm_connector *physical_connector) { struct drm_device *dev = &ast->base; struct drm_crtc *crtc = &ast->crtc; struct drm_encoder *encoder = &ast->output.bmc.encoder; - struct drm_connector *connector = &ast->output.bmc.connector; + struct ast_bmc_connector *bmc_connector = &ast->output.bmc.bmc_connector; + struct drm_connector *connector = &bmc_connector->base; int ret; ret = drm_encoder_init(dev, encoder, @@ -1802,13 +1824,10 @@ return ret; encoder->possible_crtcs = drm_crtc_mask(crtc); - ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs, - DRM_MODE_CONNECTOR_VIRTUAL); + ret = ast_bmc_connector_init(dev, bmc_connector, physical_connector); if (ret) return ret; - drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs); - ret = drm_connector_attach_encoder(connector, encoder); if (ret) return ret; @@ -1867,6 +1886,7 @@ int ast_mode_config_init(struct ast_device *ast) { struct drm_device *dev = &ast->base; + struct drm_connector *physical_connector = NULL; int ret; ret = drmm_mode_config_init(dev); @@ -1908,28 +1928,30 @@ if (ret) return ret; + physical_connector = &ast->output.vga.vga_connector.base; } if (ast->tx_chip_types & AST_TX_SIL164_BIT) { ret = ast_sil164_output_init(ast); if (ret) return ret; + physical_connector = &ast->output.sil164.sil164_connector.base; } if (ast->tx_chip_types & AST_TX_DP501_BIT) { ret = ast_dp501_output_init(ast); if (ret) return ret; + physical_connector = &ast->output.dp501.connector; } if (ast->tx_chip_types & AST_TX_ASTDP_BIT) { ret = ast_astdp_output_init(ast); if (ret) return ret; + physical_connector = &ast->output.astdp.connector; } - ret = ast_bmc_output_init(ast); + ret = ast_bmc_output_init(ast, physical_connector); if (ret) return ret; drm_mode_config_reset(dev); - drm_kms_helper_poll_init(dev); - return 0; } diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/samsung-dsim.c linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/samsung-dsim.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/samsung-dsim.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/samsung-dsim.c @@ -384,7 +384,7 @@ [RESET_TYPE] = DSIM_SWRST, [PLL_TIMER] = 500, [STOP_STATE_CNT] = 0xf, - [PHYCTRL_ULPS_EXIT] = 0, + [PHYCTRL_ULPS_EXIT] = DSIM_PHYCTRL_ULPS_EXIT(0xaf), [PHYCTRL_VREG_LP] = 0, [PHYCTRL_SLEW_UP] = 0, [PHYTIMING_LPX] = DSIM_PHYTIMING_LPX(0x06), @@ -412,6 +412,7 @@ .m_min = 41, .m_max = 125, .min_freq = 500, + .has_broken_fifoctrl_emptyhdr = 1, }; static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = { @@ -428,6 +429,7 @@ .m_min = 41, .m_max = 125, .min_freq = 500, + .has_broken_fifoctrl_emptyhdr = 1, }; static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = { @@ -1009,8 +1011,20 @@ do { u32 reg = samsung_dsim_read(dsi, DSIM_FIFOCTRL_REG); - if (reg & DSIM_SFR_HEADER_EMPTY) - return 0; + if (!dsi->driver_data->has_broken_fifoctrl_emptyhdr) { + if (reg & DSIM_SFR_HEADER_EMPTY) + return 0; + } else { + if (!(reg & DSIM_SFR_HEADER_FULL)) { + /* + * Wait a little bit, so the pending data can + * actually leave the FIFO to avoid overflow. + */ + if (!cond_resched()) + usleep_range(950, 1050); + return 0; + } + } if (!cond_resched()) usleep_range(950, 1050); diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_atomic_helper.c linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_atomic_helper.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_atomic_helper.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_atomic_helper.c @@ -2012,7 +2012,7 @@ return ret; drm_atomic_helper_async_commit(dev, state); - drm_atomic_helper_cleanup_planes(dev, state); + drm_atomic_helper_unprepare_planes(dev, state); return 0; } @@ -2072,7 +2072,7 @@ return 0; err: - drm_atomic_helper_cleanup_planes(dev, state); + drm_atomic_helper_unprepare_planes(dev, state); return ret; } EXPORT_SYMBOL(drm_atomic_helper_commit); @@ -2650,6 +2650,39 @@ } EXPORT_SYMBOL(drm_atomic_helper_prepare_planes); +/** + * drm_atomic_helper_unprepare_planes - release plane resources on aborts + * @dev: DRM device + * @state: atomic state object with old state structures + * + * This function cleans up plane state, specifically framebuffers, from the + * atomic state. It undoes the effects of drm_atomic_helper_prepare_planes() + * when aborting an atomic commit. For cleaning up after a successful commit + * use drm_atomic_helper_cleanup_planes(). + */ +void drm_atomic_helper_unprepare_planes(struct drm_device *dev, + struct drm_atomic_state *state) +{ + struct drm_plane *plane; + struct drm_plane_state *new_plane_state; + int i; + + for_each_new_plane_in_state(state, plane, new_plane_state, i) { + const struct drm_plane_helper_funcs *funcs = plane->helper_private; + + if (funcs->end_fb_access) + funcs->end_fb_access(plane, new_plane_state); + } + + for_each_new_plane_in_state(state, plane, new_plane_state, i) { + const struct drm_plane_helper_funcs *funcs = plane->helper_private; + + if (funcs->cleanup_fb) + funcs->cleanup_fb(plane, new_plane_state); + } +} +EXPORT_SYMBOL(drm_atomic_helper_unprepare_planes); + static bool plane_crtc_active(const struct drm_plane_state *state) { return state->crtc && state->crtc->state->active; @@ -2784,6 +2817,17 @@ funcs->atomic_flush(crtc, old_state); } + + /* + * Signal end of framebuffer access here before hw_done. After hw_done, + * a later commit might have already released the plane state. + */ + for_each_old_plane_in_state(old_state, plane, old_plane_state, i) { + const struct drm_plane_helper_funcs *funcs = plane->helper_private; + + if (funcs->end_fb_access) + funcs->end_fb_access(plane, old_plane_state); + } } EXPORT_SYMBOL(drm_atomic_helper_commit_planes); @@ -2911,40 +2955,22 @@ * configuration. Hence the old configuration must be perserved in @old_state to * be able to call this function. * - * This function must also be called on the new state when the atomic update - * fails at any point after calling drm_atomic_helper_prepare_planes(). + * This function may not be called on the new state when the atomic update + * fails at any point after calling drm_atomic_helper_prepare_planes(). Use + * drm_atomic_helper_unprepare_planes() in this case. */ void drm_atomic_helper_cleanup_planes(struct drm_device *dev, struct drm_atomic_state *old_state) { struct drm_plane *plane; - struct drm_plane_state *old_plane_state, *new_plane_state; + struct drm_plane_state *old_plane_state; int i; - for_each_oldnew_plane_in_state(old_state, plane, old_plane_state, new_plane_state, i) { + for_each_old_plane_in_state(old_state, plane, old_plane_state, i) { const struct drm_plane_helper_funcs *funcs = plane->helper_private; - if (funcs->end_fb_access) - funcs->end_fb_access(plane, new_plane_state); - } - - for_each_oldnew_plane_in_state(old_state, plane, old_plane_state, new_plane_state, i) { - const struct drm_plane_helper_funcs *funcs; - struct drm_plane_state *plane_state; - - /* - * This might be called before swapping when commit is aborted, - * in which case we have to cleanup the new state. - */ - if (old_plane_state == plane->state) - plane_state = new_plane_state; - else - plane_state = old_plane_state; - - funcs = plane->helper_private; - if (funcs->cleanup_fb) - funcs->cleanup_fb(plane, plane_state); + funcs->cleanup_fb(plane, old_plane_state); } } EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes); diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_edid.c linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_edid.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_edid.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_edid.c @@ -123,6 +123,9 @@ /* AEO model 0 reports 8 bpc, but is a 6 bpc panel */ EDID_QUIRK('A', 'E', 'O', 0, EDID_QUIRK_FORCE_6BPC), + /* BenQ GW2765 */ + EDID_QUIRK('B', 'N', 'Q', 0x78d6, EDID_QUIRK_FORCE_8BPC), + /* BOE model on HP Pavilion 15-n233sl reports 8 bpc, but is a 6 bpc panel */ EDID_QUIRK('B', 'O', 'E', 0x78b, EDID_QUIRK_FORCE_6BPC), @@ -3496,11 +3499,19 @@ mode->vsync_end = mode->vsync_start + vsync_pulse_width; mode->vtotal = mode->vdisplay + vblank; - /* Some EDIDs have bogus h/vtotal values */ - if (mode->hsync_end > mode->htotal) - mode->htotal = mode->hsync_end + 1; - if (mode->vsync_end > mode->vtotal) - mode->vtotal = mode->vsync_end + 1; + /* Some EDIDs have bogus h/vsync_end values */ + if (mode->hsync_end > mode->htotal) { + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] reducing hsync_end %d->%d\n", + connector->base.id, connector->name, + mode->hsync_end, mode->htotal); + mode->hsync_end = mode->htotal; + } + if (mode->vsync_end > mode->vtotal) { + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] reducing vsync_end %d->%d\n", + connector->base.id, connector->name, + mode->vsync_end, mode->vtotal); + mode->vsync_end = mode->vtotal; + } drm_mode_do_interlace_quirk(mode, pt); diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_dp.c linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_dp.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_dp.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_dp.c @@ -430,7 +430,7 @@ enum phy phy = intel_port_to_phy(i915, dig_port->base.port); if (intel_is_c10phy(i915, phy)) - return intel_dp_is_edp(intel_dp) ? 675000 : 810000; + return 810000; return 2000000; } @@ -1118,6 +1118,10 @@ enum drm_mode_status status; bool dsc = false, bigjoiner = false; + status = intel_cpu_transcoder_mode_valid(dev_priv, mode); + if (status != MODE_OK) + return status; + if (mode->flags & DRM_MODE_FLAG_DBLCLK) return MODE_H_ILLEGAL; @@ -5508,8 +5512,7 @@ * (eg. Acer Chromebook C710), so we'll check it only if multiple * ports are attempting to use the same AUX CH, according to VBT. */ - if (intel_bios_dp_has_shared_aux_ch(encoder->devdata) && - !intel_digital_port_connected(encoder)) { + if (intel_bios_dp_has_shared_aux_ch(encoder->devdata)) { /* * If this fails, presume the DPCD answer came * from some other port using the same AUX CH. @@ -5517,10 +5520,27 @@ * FIXME maybe cleaner to check this before the * DPCD read? Would need sort out the VDD handling... */ - drm_info(&dev_priv->drm, - "[ENCODER:%d:%s] HPD is down, disabling eDP\n", - encoder->base.base.id, encoder->base.name); - goto out_vdd_off; + if (!intel_digital_port_connected(encoder)) { + drm_info(&dev_priv->drm, + "[ENCODER:%d:%s] HPD is down, disabling eDP\n", + encoder->base.base.id, encoder->base.name); + goto out_vdd_off; + } + + /* + * Unfortunately even the HPD based detection fails on + * eg. Asus B360M-A (CFL+CNP), so as a last resort fall + * back to checking for a VGA branch device. Only do this + * on known affected platforms to minimize false positives. + */ + if (DISPLAY_VER(dev_priv) == 9 && drm_dp_is_branch(intel_dp->dpcd) && + (intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_TYPE_MASK) == + DP_DWN_STRM_PORT_TYPE_ANALOG) { + drm_info(&dev_priv->drm, + "[ENCODER:%d:%s] VGA converter detected, disabling eDP\n", + encoder->base.base.id, encoder->base.name); + goto out_vdd_off; + } } mutex_lock(&dev_priv->drm.mode_config.mutex); diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/gt/intel_ggtt.c linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/gt/intel_ggtt.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/gt/intel_ggtt.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/gt/intel_ggtt.c @@ -190,6 +190,21 @@ spin_unlock_irq(&uncore->lock); } +static bool needs_wc_ggtt_mapping(struct drm_i915_private *i915) +{ + /* + * On BXT+/ICL+ writes larger than 64 bit to the GTT pagetable range + * will be dropped. For WC mappings in general we have 64 byte burst + * writes when the WC buffer is flushed, so we can't use it, but have to + * resort to an uncached mapping. The WC issue is easily caught by the + * readback check when writing GTT PTE entries. + */ + if (!IS_GEN9_LP(i915) && GRAPHICS_VER(i915) < 11) + return true; + + return false; +} + static void gen8_ggtt_invalidate(struct i915_ggtt *ggtt) { struct intel_uncore *uncore = ggtt->vm.gt->uncore; @@ -197,8 +212,12 @@ /* * Note that as an uncached mmio write, this will flush the * WCB of the writes into the GGTT before it triggers the invalidate. + * + * Only perform this when GGTT is mapped as WC, see ggtt_probe_common(). */ - intel_uncore_write_fw(uncore, GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN); + if (needs_wc_ggtt_mapping(ggtt->vm.i915)) + intel_uncore_write_fw(uncore, GFX_FLSH_CNTL_GEN6, + GFX_FLSH_CNTL_EN); } static void guc_ggtt_invalidate(struct i915_ggtt *ggtt) @@ -902,17 +921,11 @@ GEM_WARN_ON(pci_resource_len(pdev, GEN4_GTTMMADR_BAR) != gen6_gttmmadr_size(i915)); phys_addr = pci_resource_start(pdev, GEN4_GTTMMADR_BAR) + gen6_gttadr_offset(i915); - /* - * On BXT+/ICL+ writes larger than 64 bit to the GTT pagetable range - * will be dropped. For WC mappings in general we have 64 byte burst - * writes when the WC buffer is flushed, so we can't use it, but have to - * resort to an uncached mapping. The WC issue is easily caught by the - * readback check when writing GTT PTE entries. - */ - if (IS_GEN9_LP(i915) || GRAPHICS_VER(i915) >= 11) - ggtt->gsm = ioremap(phys_addr, size); - else + if (needs_wc_ggtt_mapping(i915)) ggtt->gsm = ioremap_wc(phys_addr, size); + else + ggtt->gsm = ioremap(phys_addr, size); + if (!ggtt->gsm) { drm_err(&i915->drm, "Failed to map the ggtt page table\n"); return -ENOMEM; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_dp.c linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_dp.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_dp.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_dp.c @@ -1983,7 +1983,6 @@ bool enabled = mtk_dp->enabled; struct edid *new_edid = NULL; struct mtk_dp_audio_cfg *audio_caps = &mtk_dp->info.audio_cur_cfg; - struct cea_sad *sads; if (!enabled) { drm_atomic_bridge_chain_pre_enable(bridge, connector->state->state); @@ -2006,11 +2005,16 @@ */ if (mtk_dp_parse_capabilities(mtk_dp)) { drm_err(mtk_dp->drm_dev, "Can't parse capabilities\n"); + kfree(new_edid); new_edid = NULL; } if (new_edid) { + struct cea_sad *sads; + audio_caps->sad_count = drm_edid_to_sad(new_edid, &sads); + kfree(sads); + audio_caps->detect_monitor = drm_detect_monitor_audio(new_edid); } diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_crtc.c linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_crtc.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -407,6 +407,9 @@ unsigned int local_layer; plane_state = to_mtk_plane_state(plane->state); + + /* should not enable layer before crtc enabled */ + plane_state->pending.enable = false; comp = mtk_drm_ddp_comp_for_plane(crtc, plane, &local_layer); if (comp) mtk_ddp_comp_layer_config(comp, local_layer, diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_drv.c linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_drv.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -287,6 +287,7 @@ static const struct mtk_mmsys_driver_data mt8188_vdosys0_driver_data = { .main_path = mt8188_mtk_ddp_main, .main_len = ARRAY_SIZE(mt8188_mtk_ddp_main), + .mmsys_dev_num = 1, }; static const struct mtk_mmsys_driver_data mt8192_mmsys_driver_data = { diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_gem.c linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_gem.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -121,7 +121,14 @@ int ret; args->pitch = DIV_ROUND_UP(args->width * args->bpp, 8); - args->size = args->pitch * args->height; + + /* + * Multiply 2 variables of different types, + * for example: args->size = args->spacing * args->height; + * may cause coverity issue with unintentional overflow. + */ + args->size = args->pitch; + args->size *= args->height; mtk_gem = mtk_drm_gem_create(dev, args->size, false); if (IS_ERR(mtk_gem)) @@ -239,6 +246,7 @@ npages = obj->size >> PAGE_SHIFT; mtk_gem->pages = kcalloc(npages, sizeof(*mtk_gem->pages), GFP_KERNEL); if (!mtk_gem->pages) { + sg_free_table(sgt); kfree(sgt); return -ENOMEM; } @@ -248,12 +256,15 @@ mtk_gem->kvaddr = vmap(mtk_gem->pages, npages, VM_MAP, pgprot_writecombine(PAGE_KERNEL)); if (!mtk_gem->kvaddr) { + sg_free_table(sgt); kfree(sgt); kfree(mtk_gem->pages); return -ENOMEM; } -out: + sg_free_table(sgt); kfree(sgt); + +out: iosys_map_set_vaddr(map, mtk_gem->kvaddr); return 0; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h --- linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h @@ -221,6 +221,7 @@ .min_llcc_ib = 0, .min_dram_ib = 800000, .danger_lut_tbl = {0xf, 0xffff, 0x0}, + .safe_lut_tbl = {0xfe00, 0xfe00, 0xffff}, .qos_lut_tbl = { {.nentry = ARRAY_SIZE(sc8180x_qos_linear), .entries = sc8180x_qos_linear diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/dsi/dsi_host.c linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/dsi/dsi_host.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/dsi/dsi_host.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -147,6 +147,7 @@ /* DSI 6G TX buffer*/ struct drm_gem_object *tx_gem_obj; + struct msm_gem_address_space *aspace; /* DSI v2 TX buffer */ void *tx_buf; @@ -1104,8 +1105,10 @@ uint64_t iova; u8 *data; + msm_host->aspace = msm_gem_address_space_get(priv->kms->aspace); + data = msm_gem_kernel_new(dev, size, MSM_BO_WC, - priv->kms->aspace, + msm_host->aspace, &msm_host->tx_gem_obj, &iova); if (IS_ERR(data)) { @@ -1134,10 +1137,10 @@ return 0; } -static void dsi_tx_buf_free(struct msm_dsi_host *msm_host) +void msm_dsi_tx_buf_free(struct mipi_dsi_host *host) { + struct msm_dsi_host *msm_host = to_msm_dsi_host(host); struct drm_device *dev = msm_host->dev; - struct msm_drm_private *priv; /* * This is possible if we're tearing down before we've had a chance to @@ -1148,11 +1151,11 @@ if (!dev) return; - priv = dev->dev_private; if (msm_host->tx_gem_obj) { - msm_gem_unpin_iova(msm_host->tx_gem_obj, priv->kms->aspace); - drm_gem_object_put(msm_host->tx_gem_obj); + msm_gem_kernel_put(msm_host->tx_gem_obj, msm_host->aspace); + msm_gem_address_space_put(msm_host->aspace); msm_host->tx_gem_obj = NULL; + msm_host->aspace = NULL; } if (msm_host->tx_buf) @@ -1938,7 +1941,6 @@ struct msm_dsi_host *msm_host = to_msm_dsi_host(host); DBG(""); - dsi_tx_buf_free(msm_host); if (msm_host->workqueue) { destroy_workqueue(msm_host->workqueue); msm_host->workqueue = NULL; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -2050,6 +2050,7 @@ .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_LPM, .init_cmds = auo_b101uan08_3_init_cmd, + .lp11_before_reset = true, }; static const struct drm_display_mode boe_tv105wum_nw0_default_mode = { @@ -2104,14 +2105,15 @@ .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_LPM, .init_cmds = starry_qfh032011_53g_init_cmd, + .lp11_before_reset = true, }; static const struct drm_display_mode starry_himax83102_j02_default_mode = { - .clock = 161600, + .clock = 162850, .hdisplay = 1200, - .hsync_start = 1200 + 40, - .hsync_end = 1200 + 40 + 20, - .htotal = 1200 + 40 + 20 + 40, + .hsync_start = 1200 + 50, + .hsync_end = 1200 + 50 + 20, + .htotal = 1200 + 50 + 20 + 50, .vdisplay = 1920, .vsync_start = 1920 + 116, .vsync_end = 1920 + 116 + 8, diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-simple.c linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-simple.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-simple.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-simple.c @@ -2298,13 +2298,13 @@ static const struct display_timing innolux_g101ice_l01_timing = { .pixelclock = { 60400000, 71100000, 74700000 }, .hactive = { 1280, 1280, 1280 }, - .hfront_porch = { 41, 80, 100 }, - .hback_porch = { 40, 79, 99 }, - .hsync_len = { 1, 1, 1 }, + .hfront_porch = { 30, 60, 70 }, + .hback_porch = { 30, 60, 70 }, + .hsync_len = { 22, 40, 60 }, .vactive = { 800, 800, 800 }, - .vfront_porch = { 5, 11, 14 }, - .vback_porch = { 4, 11, 14 }, - .vsync_len = { 1, 1, 1 }, + .vfront_porch = { 3, 8, 14 }, + .vback_porch = { 3, 8, 14 }, + .vsync_len = { 4, 7, 12 }, .flags = DISPLAY_FLAGS_DE_HIGH, }; @@ -2321,6 +2321,7 @@ .disable = 200, }, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, }; diff -u linux-aws-6.5-6.5.0/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c linux-aws-6.5-6.5.0/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c --- linux-aws-6.5-6.5.0/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -774,9 +774,9 @@ sizeof(metadata->mip_levels)); metadata->num_sizes = num_sizes; metadata->sizes = - memdup_user((struct drm_vmw_size __user *)(unsigned long) + memdup_array_user((struct drm_vmw_size __user *)(unsigned long) req->size_addr, - sizeof(*metadata->sizes) * metadata->num_sizes); + metadata->num_sizes, sizeof(*metadata->sizes)); if (IS_ERR(metadata->sizes)) { ret = PTR_ERR(metadata->sizes); goto out_no_sizes; diff -u linux-aws-6.5-6.5.0/drivers/hid/hid-input.c linux-aws-6.5-6.5.0/drivers/hid/hid-input.c --- linux-aws-6.5-6.5.0/drivers/hid/hid-input.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-input.c @@ -406,6 +406,8 @@ HID_BATTERY_QUIRK_IGNORE }, { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_SPECTRE_X360_14T_EA100_V2), HID_BATTERY_QUIRK_IGNORE }, + { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_ENVY_X360_15_EU0556NG), + HID_BATTERY_QUIRK_IGNORE }, {} }; diff -u linux-aws-6.5-6.5.0/drivers/hid/hid-logitech-hidpp.c linux-aws-6.5-6.5.0/drivers/hid/hid-logitech-hidpp.c --- linux-aws-6.5-6.5.0/drivers/hid/hid-logitech-hidpp.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-logitech-hidpp.c @@ -1835,15 +1835,14 @@ /* -------------------------------------------------------------------------- */ #define HIDPP_PAGE_WIRELESS_DEVICE_STATUS 0x1d4b -static int hidpp_set_wireless_feature_index(struct hidpp_device *hidpp) +static int hidpp_get_wireless_feature_index(struct hidpp_device *hidpp, u8 *feature_index) { u8 feature_type; int ret; ret = hidpp_root_get_feature(hidpp, HIDPP_PAGE_WIRELESS_DEVICE_STATUS, - &hidpp->wireless_feature_index, - &feature_type); + feature_index, &feature_type); return ret; } @@ -4249,6 +4248,13 @@ } } + if (hidpp->protocol_major >= 2) { + u8 feature_index; + + if (!hidpp_get_wireless_feature_index(hidpp, &feature_index)) + hidpp->wireless_feature_index = feature_index; + } + if (hidpp->name == hdev->name && hidpp->protocol_major >= 2) { name = hidpp_get_device_name(hidpp); if (name) { @@ -4394,7 +4400,6 @@ bool connected; unsigned int connect_mask = HID_CONNECT_DEFAULT; struct hidpp_ff_private_data data; - bool will_restart = false; /* report_fixup needs drvdata to be set before we call hid_parse */ hidpp = devm_kzalloc(&hdev->dev, sizeof(*hidpp), GFP_KERNEL); @@ -4445,10 +4450,6 @@ return ret; } - if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT || - hidpp->quirks & HIDPP_QUIRK_UNIFYING) - will_restart = true; - INIT_WORK(&hidpp->work, delayed_work_cb); mutex_init(&hidpp->send_mutex); init_waitqueue_head(&hidpp->wait); @@ -4460,10 +4461,12 @@ hdev->name); /* - * Plain USB connections need to actually call start and open - * on the transport driver to allow incoming data. + * First call hid_hw_start(hdev, 0) to allow IO without connecting any + * hid subdrivers (hid-input, hidraw). This allows retrieving the dev's + * name and serial number and store these in hdev->name and hdev->uniq, + * before the hid-input and hidraw drivers expose these to userspace. */ - ret = hid_hw_start(hdev, will_restart ? 0 : connect_mask); + ret = hid_hw_start(hdev, 0); if (ret) { hid_err(hdev, "hw start failed\n"); goto hid_hw_start_fail; @@ -4496,15 +4499,6 @@ hidpp_overwrite_name(hdev); } - if (connected && hidpp->protocol_major >= 2) { - ret = hidpp_set_wireless_feature_index(hidpp); - if (ret == -ENOENT) - hidpp->wireless_feature_index = 0; - else if (ret) - goto hid_hw_init_fail; - ret = 0; - } - if (connected && (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP)) { ret = wtp_get_config(hidpp); if (ret) @@ -4518,21 +4512,14 @@ schedule_work(&hidpp->work); flush_work(&hidpp->work); - if (will_restart) { - /* Reset the HID node state */ - hid_device_io_stop(hdev); - hid_hw_close(hdev); - hid_hw_stop(hdev); - - if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT) - connect_mask &= ~HID_CONNECT_HIDINPUT; + if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT) + connect_mask &= ~HID_CONNECT_HIDINPUT; - /* Now export the actual inputs and hidraw nodes to the world */ - ret = hid_hw_start(hdev, connect_mask); - if (ret) { - hid_err(hdev, "%s:hid_hw_start returned error\n", __func__); - goto hid_hw_start_fail; - } + /* Now export the actual inputs and hidraw nodes to the world */ + ret = hid_connect(hdev, connect_mask); + if (ret) { + hid_err(hdev, "%s:hid_connect returned error %d\n", __func__, ret); + goto hid_hw_init_fail; } if (hidpp->quirks & HIDPP_QUIRK_CLASS_G920) { @@ -4543,6 +4530,11 @@ ret); } + /* + * This relies on logi_dj_ll_close() being a no-op so that DJ connection + * events will still be received. + */ + hid_hw_close(hdev); return ret; hid_hw_init_fail: @@ -4676,6 +4668,8 @@ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb008) }, { /* MX Master mouse over Bluetooth */ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb012) }, + { /* M720 Triathlon mouse over Bluetooth */ + HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb015) }, { /* MX Ergo trackball over Bluetooth */ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01d) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01e) }, diff -u linux-aws-6.5-6.5.0/drivers/hid/hid-multitouch.c linux-aws-6.5-6.5.0/drivers/hid/hid-multitouch.c --- linux-aws-6.5-6.5.0/drivers/hid/hid-multitouch.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-multitouch.c @@ -2146,6 +2146,10 @@ /* Synaptics devices */ { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, + USB_VENDOR_ID_SYNAPTICS, 0xcd7e) }, + + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, + HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, USB_VENDOR_ID_SYNAPTICS, 0xce08) }, { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, diff -u linux-aws-6.5-6.5.0/drivers/hwtracing/coresight/coresight-tmc-etr.c linux-aws-6.5-6.5.0/drivers/hwtracing/coresight/coresight-tmc-etr.c --- linux-aws-6.5-6.5.0/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ linux-aws-6.5-6.5.0/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -610,7 +610,8 @@ flat_buf->vaddr = dma_alloc_noncoherent(real_dev, etr_buf->size, &flat_buf->daddr, - DMA_FROM_DEVICE, GFP_KERNEL); + DMA_FROM_DEVICE, + GFP_KERNEL | __GFP_NOWARN); if (!flat_buf->vaddr) { kfree(flat_buf); return -ENOMEM; diff -u linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-aspeed.c linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-aspeed.c --- linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-aspeed.c +++ linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-aspeed.c @@ -749,6 +749,8 @@ func_ctrl_reg_val = readl(bus->base + ASPEED_I2C_FUN_CTRL_REG); func_ctrl_reg_val |= ASPEED_I2CD_SLAVE_EN; writel(func_ctrl_reg_val, bus->base + ASPEED_I2C_FUN_CTRL_REG); + + bus->slave_state = ASPEED_I2C_SLAVE_INACTIVE; } static int aspeed_i2c_reg_slave(struct i2c_client *client) @@ -765,7 +767,6 @@ __aspeed_i2c_reg_slave(bus, client->addr); bus->slave = client; - bus->slave_state = ASPEED_I2C_SLAVE_INACTIVE; spin_unlock_irqrestore(&bus->lock, flags); return 0; diff -u linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-designware-common.c linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-designware-common.c --- linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-designware-common.c +++ linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-designware-common.c @@ -63,7 +63,7 @@ { struct dw_i2c_dev *dev = context; - *val = readl_relaxed(dev->base + reg); + *val = readl(dev->base + reg); return 0; } @@ -72,7 +72,7 @@ { struct dw_i2c_dev *dev = context; - writel_relaxed(val, dev->base + reg); + writel(val, dev->base + reg); return 0; } @@ -81,7 +81,7 @@ { struct dw_i2c_dev *dev = context; - *val = swab32(readl_relaxed(dev->base + reg)); + *val = swab32(readl(dev->base + reg)); return 0; } @@ -90,7 +90,7 @@ { struct dw_i2c_dev *dev = context; - writel_relaxed(swab32(val), dev->base + reg); + writel(swab32(val), dev->base + reg); return 0; } @@ -99,8 +99,8 @@ { struct dw_i2c_dev *dev = context; - *val = readw_relaxed(dev->base + reg) | - (readw_relaxed(dev->base + reg + 2) << 16); + *val = readw(dev->base + reg) | + (readw(dev->base + reg + 2) << 16); return 0; } @@ -109,8 +109,8 @@ { struct dw_i2c_dev *dev = context; - writew_relaxed(val, dev->base + reg); - writew_relaxed(val >> 16, dev->base + reg + 2); + writew(val, dev->base + reg); + writew(val >> 16, dev->base + reg + 2); return 0; } diff -u linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-i801.c linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-i801.c --- linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-i801.c +++ linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-i801.c @@ -79,6 +79,7 @@ * Meteor Lake-P (SOC) 0x7e22 32 hard yes yes yes * Meteor Lake SoC-S (SOC) 0xae22 32 hard yes yes yes * Meteor Lake PCH-S (PCH) 0x7f23 32 hard yes yes yes + * Birch Stream (SOC) 0x5796 32 hard yes yes yes * * Features supported by this driver: * Software PEC no @@ -231,6 +232,7 @@ #define PCI_DEVICE_ID_INTEL_JASPER_LAKE_SMBUS 0x4da3 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_P_SMBUS 0x51a3 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_M_SMBUS 0x54a3 +#define PCI_DEVICE_ID_INTEL_BIRCH_STREAM_SMBUS 0x5796 #define PCI_DEVICE_ID_INTEL_BROXTON_SMBUS 0x5ad4 #define PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_S_SMBUS 0x7a23 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_S_SMBUS 0x7aa3 @@ -679,15 +681,11 @@ return result ? priv->status : -ETIMEDOUT; } - for (i = 1; i <= len; i++) { - if (i == len && read_write == I2C_SMBUS_READ) - smbcmd |= SMBHSTCNT_LAST_BYTE; - outb_p(smbcmd, SMBHSTCNT(priv)); - - if (i == 1) - outb_p(inb(SMBHSTCNT(priv)) | SMBHSTCNT_START, - SMBHSTCNT(priv)); + if (len == 1 && read_write == I2C_SMBUS_READ) + smbcmd |= SMBHSTCNT_LAST_BYTE; + outb_p(smbcmd | SMBHSTCNT_START, SMBHSTCNT(priv)); + for (i = 1; i <= len; i++) { status = i801_wait_byte_done(priv); if (status) return status; @@ -710,9 +708,12 @@ data->block[0] = len; } - /* Retrieve/store value in SMBBLKDAT */ - if (read_write == I2C_SMBUS_READ) + if (read_write == I2C_SMBUS_READ) { data->block[i] = inb_p(SMBBLKDAT(priv)); + if (i == len - 1) + outb_p(smbcmd | SMBHSTCNT_LAST_BYTE, SMBHSTCNT(priv)); + } + if (read_write == I2C_SMBUS_WRITE && i+1 <= len) outb_p(data->block[i+1], SMBBLKDAT(priv)); @@ -1044,6 +1045,7 @@ { PCI_DEVICE_DATA(INTEL, METEOR_LAKE_P_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, { PCI_DEVICE_DATA(INTEL, METEOR_LAKE_SOC_S_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, { PCI_DEVICE_DATA(INTEL, METEOR_LAKE_PCH_S_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, + { PCI_DEVICE_DATA(INTEL, BIRCH_STREAM_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, { 0, } }; diff -u linux-aws-6.5-6.5.0/drivers/i2c/muxes/i2c-demux-pinctrl.c linux-aws-6.5-6.5.0/drivers/i2c/muxes/i2c-demux-pinctrl.c --- linux-aws-6.5-6.5.0/drivers/i2c/muxes/i2c-demux-pinctrl.c +++ linux-aws-6.5-6.5.0/drivers/i2c/muxes/i2c-demux-pinctrl.c @@ -61,7 +61,7 @@ if (ret) goto err; - adap = of_find_i2c_adapter_by_node(priv->chan[new_chan].parent_np); + adap = of_get_i2c_adapter_by_node(priv->chan[new_chan].parent_np); if (!adap) { ret = -ENODEV; goto err_with_revert; diff -u linux-aws-6.5-6.5.0/drivers/i3c/master/svc-i3c-master.c linux-aws-6.5-6.5.0/drivers/i3c/master/svc-i3c-master.c --- linux-aws-6.5-6.5.0/drivers/i3c/master/svc-i3c-master.c +++ linux-aws-6.5-6.5.0/drivers/i3c/master/svc-i3c-master.c @@ -93,6 +93,7 @@ #define SVC_I3C_MINTMASKED 0x098 #define SVC_I3C_MERRWARN 0x09C #define SVC_I3C_MERRWARN_NACK BIT(2) +#define SVC_I3C_MERRWARN_TIMEOUT BIT(20) #define SVC_I3C_MDMACTRL 0x0A0 #define SVC_I3C_MDATACTRL 0x0AC #define SVC_I3C_MDATACTRL_FLUSHTB BIT(0) @@ -175,6 +176,7 @@ * @ibi.slots: Available IBI slots * @ibi.tbq_slot: To be queued IBI slot * @ibi.lock: IBI lock + * @lock: Transfer lock, protect between IBI work thread and callbacks from master */ struct svc_i3c_master { struct i3c_master_controller base; @@ -203,6 +205,7 @@ /* Prevent races within IBI handlers */ spinlock_t lock; } ibi; + struct mutex lock; }; /** @@ -225,6 +228,14 @@ if (SVC_I3C_MSTATUS_ERRWARN(mstatus)) { merrwarn = readl(master->regs + SVC_I3C_MERRWARN); writel(merrwarn, master->regs + SVC_I3C_MERRWARN); + + /* Ignore timeout error */ + if (merrwarn & SVC_I3C_MERRWARN_TIMEOUT) { + dev_dbg(master->dev, "Warning condition: MSTATUS 0x%08x, MERRWARN 0x%08x\n", + mstatus, merrwarn); + return false; + } + dev_err(master->dev, "Error condition: MSTATUS 0x%08x, MERRWARN 0x%08x\n", mstatus, merrwarn); @@ -331,6 +342,7 @@ struct i3c_ibi_slot *slot; unsigned int count; u32 mdatactrl; + int ret, val; u8 *buf; slot = i3c_generic_ibi_get_free_slot(data->ibi_pool); @@ -340,6 +352,13 @@ slot->len = 0; buf = slot->data; + ret = readl_relaxed_poll_timeout(master->regs + SVC_I3C_MSTATUS, val, + SVC_I3C_MSTATUS_COMPLETE(val), 0, 1000); + if (ret) { + dev_err(master->dev, "Timeout when polling for COMPLETE\n"); + return ret; + } + while (SVC_I3C_MSTATUS_RXPEND(readl(master->regs + SVC_I3C_MSTATUS)) && slot->len < SVC_I3C_FIFO_SIZE) { mdatactrl = readl(master->regs + SVC_I3C_MDATACTRL); @@ -384,6 +403,7 @@ u32 status, val; int ret; + mutex_lock(&master->lock); /* Acknowledge the incoming interrupt with the AUTOIBI mechanism */ writel(SVC_I3C_MCTRL_REQUEST_AUTO_IBI | SVC_I3C_MCTRL_IBIRESP_AUTO, @@ -394,6 +414,7 @@ SVC_I3C_MSTATUS_IBIWON(val), 0, 1000); if (ret) { dev_err(master->dev, "Timeout when polling for IBIWON\n"); + svc_i3c_master_emit_stop(master); goto reenable_ibis; } @@ -460,12 +481,13 @@ reenable_ibis: svc_i3c_master_enable_interrupts(master, SVC_I3C_MINT_SLVSTART); + mutex_unlock(&master->lock); } static irqreturn_t svc_i3c_master_irq_handler(int irq, void *dev_id) { struct svc_i3c_master *master = (struct svc_i3c_master *)dev_id; - u32 active = readl(master->regs + SVC_I3C_MINTMASKED); + u32 active = readl(master->regs + SVC_I3C_MSTATUS); if (!SVC_I3C_MSTATUS_SLVSTART(active)) return IRQ_NONE; @@ -1007,6 +1029,9 @@ u32 reg; int ret; + /* clean SVC_I3C_MINT_IBIWON w1c bits */ + writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS); + writel(SVC_I3C_MCTRL_REQUEST_START_ADDR | xfer_type | SVC_I3C_MCTRL_IBIRESP_NACK | @@ -1025,6 +1050,23 @@ goto emit_stop; } + /* + * According to I3C spec ver 1.1.1, 5.1.2.2.3 Consequence of Controller Starting a Frame + * with I3C Target Address. + * + * The I3C Controller normally should start a Frame, the Address may be arbitrated, and so + * the Controller shall monitor to see whether an In-Band Interrupt request, a Controller + * Role Request (i.e., Secondary Controller requests to become the Active Controller), or + * a Hot-Join Request has been made. + * + * If missed IBIWON check, the wrong data will be return. When IBIWON happen, return failure + * and yield the above events handler. + */ + if (SVC_I3C_MSTATUS_IBIWON(reg)) { + ret = -ENXIO; + goto emit_stop; + } + if (rnw) ret = svc_i3c_master_read(master, in, xfer_len); else @@ -1204,9 +1246,11 @@ cmd->read_len = 0; cmd->continued = false; + mutex_lock(&master->lock); svc_i3c_master_enqueue_xfer(master, xfer); if (!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000))) svc_i3c_master_dequeue_xfer(master, xfer); + mutex_unlock(&master->lock); ret = xfer->ret; kfree(buf); @@ -1250,9 +1294,11 @@ cmd->read_len = read_len; cmd->continued = false; + mutex_lock(&master->lock); svc_i3c_master_enqueue_xfer(master, xfer); if (!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000))) svc_i3c_master_dequeue_xfer(master, xfer); + mutex_unlock(&master->lock); if (cmd->read_len != xfer_len) ccc->dests[0].payload.len = cmd->read_len; @@ -1309,9 +1355,11 @@ cmd->continued = (i + 1) < nxfers; } + mutex_lock(&master->lock); svc_i3c_master_enqueue_xfer(master, xfer); if (!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000))) svc_i3c_master_dequeue_xfer(master, xfer); + mutex_unlock(&master->lock); ret = xfer->ret; svc_i3c_master_free_xfer(xfer); @@ -1347,9 +1395,11 @@ cmd->continued = (i + 1 < nxfers); } + mutex_lock(&master->lock); svc_i3c_master_enqueue_xfer(master, xfer); if (!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000))) svc_i3c_master_dequeue_xfer(master, xfer); + mutex_unlock(&master->lock); ret = xfer->ret; svc_i3c_master_free_xfer(xfer); @@ -1540,6 +1590,8 @@ INIT_WORK(&master->hj_work, svc_i3c_master_hj_work); INIT_WORK(&master->ibi_work, svc_i3c_master_ibi_work); + mutex_init(&master->lock); + ret = devm_request_irq(dev, master->irq, svc_i3c_master_irq_handler, IRQF_NO_SUSPEND, "svc-i3c-irq", master); if (ret) diff -u linux-aws-6.5-6.5.0/drivers/infiniband/hw/bnxt_re/main.c linux-aws-6.5-6.5.0/drivers/infiniband/hw/bnxt_re/main.c --- linux-aws-6.5-6.5.0/drivers/infiniband/hw/bnxt_re/main.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/bnxt_re/main.c @@ -71,7 +71,7 @@ BNXT_RE_DESC "\n"; MODULE_AUTHOR("Eddie Wai "); -MODULE_DESCRIPTION(BNXT_RE_DESC " Driver"); +MODULE_DESCRIPTION(BNXT_RE_DESC); MODULE_LICENSE("Dual BSD/GPL"); /* globals */ diff -u linux-aws-6.5-6.5.0/drivers/infiniband/hw/hns/hns_roce_hw_v2.c linux-aws-6.5-6.5.0/drivers/infiniband/hw/hns/hns_roce_hw_v2.c --- linux-aws-6.5-6.5.0/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -270,7 +270,7 @@ struct hns_roce_dev *hr_dev = to_hr_dev(qp->ibqp.device); int mtu = ib_mtu_enum_to_int(qp->path_mtu); - if (len > qp->max_inline_data || len > mtu) { + if (mtu < 0 || len > qp->max_inline_data || len > mtu) { ibdev_err(&hr_dev->ib_dev, "invalid length of data, data len = %u, max inline len = %u, path mtu = %d.\n", len, qp->max_inline_data, mtu); @@ -4740,6 +4740,9 @@ { struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); + if (ibqp->qp_type == IB_QPT_UD) + hr_dev->caps.cong_type = CONG_TYPE_DCQCN; + /* different congestion types match different configurations */ switch (hr_dev->caps.cong_type) { case CONG_TYPE_DCQCN: @@ -4767,10 +4770,15 @@ cong_alg->wnd_mode_sel = WND_LIMIT; break; default: - ibdev_err(&hr_dev->ib_dev, - "error type(%u) for congestion selection.\n", - hr_dev->caps.cong_type); - return -EINVAL; + ibdev_warn(&hr_dev->ib_dev, + "invalid type(%u) for congestion selection.\n", + hr_dev->caps.cong_type); + hr_dev->caps.cong_type = CONG_TYPE_DCQCN; + cong_alg->alg_sel = CONG_DCQCN; + cong_alg->alg_sub_sel = UNSUPPORT_CONG_LEVEL; + cong_alg->dip_vld = DIP_INVALID; + cong_alg->wnd_mode_sel = WND_LIMIT; + break; } return 0; @@ -4836,22 +4844,32 @@ struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); struct ib_device *ibdev = &hr_dev->ib_dev; const struct ib_gid_attr *gid_attr = NULL; + u8 sl = rdma_ah_get_sl(&attr->ah_attr); int is_roce_protocol; u16 vlan_id = 0xffff; bool is_udp = false; + u32 max_sl; u8 ib_port; u8 hr_port; int ret; + max_sl = min_t(u32, MAX_SERVICE_LEVEL, hr_dev->caps.sl_num - 1); + if (unlikely(sl > max_sl)) { + ibdev_err_ratelimited(ibdev, + "failed to fill QPC, sl (%u) shouldn't be larger than %u.\n", + sl, max_sl); + return -EINVAL; + } + /* * If free_mr_en of qp is set, it means that this qp comes from * free mr. This qp will perform the loopback operation. * In the loopback scenario, only sl needs to be set. */ if (hr_qp->free_mr_en) { - hr_reg_write(context, QPC_SL, rdma_ah_get_sl(&attr->ah_attr)); + hr_reg_write(context, QPC_SL, sl); hr_reg_clear(qpc_mask, QPC_SL); - hr_qp->sl = rdma_ah_get_sl(&attr->ah_attr); + hr_qp->sl = sl; return 0; } @@ -4918,14 +4936,7 @@ memcpy(context->dgid, grh->dgid.raw, sizeof(grh->dgid.raw)); memset(qpc_mask->dgid, 0, sizeof(grh->dgid.raw)); - hr_qp->sl = rdma_ah_get_sl(&attr->ah_attr); - if (unlikely(hr_qp->sl > MAX_SERVICE_LEVEL)) { - ibdev_err(ibdev, - "failed to fill QPC, sl (%u) shouldn't be larger than %d.\n", - hr_qp->sl, MAX_SERVICE_LEVEL); - return -EINVAL; - } - + hr_qp->sl = sl; hr_reg_write(context, QPC_SL, hr_qp->sl); hr_reg_clear(qpc_mask, QPC_SL); @@ -5819,7 +5830,7 @@ case HNS_ROCE_EVENT_TYPE_COMM_EST: break; case HNS_ROCE_EVENT_TYPE_SQ_DRAINED: - ibdev_warn(ibdev, "send queue drained.\n"); + ibdev_dbg(ibdev, "send queue drained.\n"); break; case HNS_ROCE_EVENT_TYPE_WQ_CATAS_ERROR: ibdev_err(ibdev, "local work queue 0x%x catast error, sub_event type is: %d\n", @@ -5834,10 +5845,10 @@ irq_work->queue_num, irq_work->sub_type); break; case HNS_ROCE_EVENT_TYPE_SRQ_LIMIT_REACH: - ibdev_warn(ibdev, "SRQ limit reach.\n"); + ibdev_dbg(ibdev, "SRQ limit reach.\n"); break; case HNS_ROCE_EVENT_TYPE_SRQ_LAST_WQE_REACH: - ibdev_warn(ibdev, "SRQ last wqe reach.\n"); + ibdev_dbg(ibdev, "SRQ last wqe reach.\n"); break; case HNS_ROCE_EVENT_TYPE_SRQ_CATAS_ERROR: ibdev_err(ibdev, "SRQ catas error.\n"); diff -u linux-aws-6.5-6.5.0/drivers/infiniband/hw/hns/hns_roce_qp.c linux-aws-6.5-6.5.0/drivers/infiniband/hw/hns/hns_roce_qp.c --- linux-aws-6.5-6.5.0/drivers/infiniband/hw/hns/hns_roce_qp.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/hns/hns_roce_qp.c @@ -1064,7 +1064,7 @@ { struct hns_roce_ib_create_qp_resp resp = {}; struct ib_device *ibdev = &hr_dev->ib_dev; - struct hns_roce_ib_create_qp ucmd; + struct hns_roce_ib_create_qp ucmd = {}; int ret; mutex_init(&hr_qp->mutex); diff -u linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/main.h linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/main.h --- linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/main.h +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/main.h @@ -78,7 +78,7 @@ #define MAX_DPC_ITERATIONS 128 -#define IRDMA_EVENT_TIMEOUT 50000 +#define IRDMA_EVENT_TIMEOUT_MS 5000 #define IRDMA_VCHNL_EVENT_TIMEOUT 100000 #define IRDMA_RST_TIMEOUT_HZ 4 diff -u linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/verbs.c linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/verbs.c --- linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/verbs.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/verbs.c @@ -1098,6 +1098,21 @@ return 0; } +static int irdma_wait_for_suspend(struct irdma_qp *iwqp) +{ + if (!wait_event_timeout(iwqp->iwdev->suspend_wq, + !iwqp->suspend_pending, + msecs_to_jiffies(IRDMA_EVENT_TIMEOUT_MS))) { + iwqp->suspend_pending = false; + ibdev_warn(&iwqp->iwdev->ibdev, + "modify_qp timed out waiting for suspend. qp_id = %d, last_ae = 0x%x\n", + iwqp->ibqp.qp_num, iwqp->last_aeq); + return -EBUSY; + } + + return 0; +} + /** * irdma_modify_qp_roce - modify qp request * @ibqp: qp's pointer for modify @@ -1355,17 +1370,11 @@ info.next_iwarp_state = IRDMA_QP_STATE_SQD; issue_modify_qp = 1; + iwqp->suspend_pending = true; break; case IB_QPS_SQE: case IB_QPS_ERR: case IB_QPS_RESET: - if (iwqp->iwarp_state == IRDMA_QP_STATE_RTS) { - spin_unlock_irqrestore(&iwqp->lock, flags); - info.next_iwarp_state = IRDMA_QP_STATE_SQD; - irdma_hw_modify_qp(iwdev, iwqp, &info, true); - spin_lock_irqsave(&iwqp->lock, flags); - } - if (iwqp->iwarp_state == IRDMA_QP_STATE_ERROR) { spin_unlock_irqrestore(&iwqp->lock, flags); if (udata && udata->inlen) { @@ -1402,6 +1411,11 @@ ctx_info->rem_endpoint_idx = udp_info->arp_idx; if (irdma_hw_modify_qp(iwdev, iwqp, &info, true)) return -EINVAL; + if (info.next_iwarp_state == IRDMA_QP_STATE_SQD) { + ret = irdma_wait_for_suspend(iwqp); + if (ret) + return ret; + } spin_lock_irqsave(&iwqp->lock, flags); if (iwqp->iwarp_state == info.curr_iwarp_state) { iwqp->iwarp_state = info.next_iwarp_state; @@ -2817,7 +2831,7 @@ iwmr->type = reg_type; pgsz_bitmap = (reg_type == IRDMA_MEMREG_TYPE_MEM) ? - iwdev->rf->sc_dev.hw_attrs.page_size_cap : PAGE_SIZE; + iwdev->rf->sc_dev.hw_attrs.page_size_cap : SZ_4K; iwmr->page_size = ib_umem_find_best_pgsz(region, pgsz_bitmap, virt); if (unlikely(!iwmr->page_size)) { @@ -2849,6 +2863,11 @@ int err; u8 lvl; + /* iWarp: Catch page not starting on OS page boundary */ + if (!rdma_protocol_roce(&iwdev->ibdev, 1) && + ib_umem_offset(iwmr->region)) + return -EINVAL; + total = req.sq_pages + req.rq_pages + 1; if (total > iwmr->page_cnt) return -EINVAL; diff -u linux-aws-6.5-6.5.0/drivers/infiniband/hw/mlx5/main.c linux-aws-6.5-6.5.0/drivers/infiniband/hw/mlx5/main.c --- linux-aws-6.5-6.5.0/drivers/infiniband/hw/mlx5/main.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/mlx5/main.c @@ -4052,10 +4052,8 @@ return ret; ret = mlx5_mkey_cache_init(dev); - if (ret) { + if (ret) mlx5_ib_warn(dev, "mr cache init failed %d\n", ret); - mlx5r_umr_resource_cleanup(dev); - } return ret; } diff -u linux-aws-6.5-6.5.0/drivers/input/mouse/synaptics.c linux-aws-6.5-6.5.0/drivers/input/mouse/synaptics.c --- linux-aws-6.5-6.5.0/drivers/input/mouse/synaptics.c +++ linux-aws-6.5-6.5.0/drivers/input/mouse/synaptics.c @@ -1753,6 +1753,7 @@ psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) && !SYN_CAP_EXT_BUTTONS_STICK(info->ext_cap_10); const struct rmi_device_platform_data pdata = { + .reset_delay_ms = 30, .sensor_pdata = { .sensor_type = rmi_sensor_touchpad, .axis_align.flip_y = true, diff -u linux-aws-6.5-6.5.0/drivers/iommu/intel/iommu.c linux-aws-6.5-6.5.0/drivers/iommu/intel/iommu.c --- linux-aws-6.5-6.5.0/drivers/iommu/intel/iommu.c +++ linux-aws-6.5-6.5.0/drivers/iommu/intel/iommu.c @@ -2451,7 +2451,8 @@ return ret; } - iommu_enable_pci_caps(info); + if (sm_supported(info->iommu) || !domain_type_is_si(info->domain)) + iommu_enable_pci_caps(info); return 0; } @@ -3951,8 +3952,8 @@ */ static void domain_context_clear(struct device_domain_info *info) { - if (!info->iommu || !info->dev || !dev_is_pci(info->dev)) - return; + if (!dev_is_pci(info->dev)) + domain_context_clear_one(info, info->bus, info->devfn); pci_for_each_dma_alias(to_pci_dev(info->dev), &domain_context_clear_one_cb, info); @@ -4886,7 +4887,7 @@ ver = (dev->device >> 8) & 0xff; if (ver != 0x45 && ver != 0x46 && ver != 0x4c && ver != 0x4e && ver != 0x8a && ver != 0x98 && - ver != 0x9a && ver != 0xa7) + ver != 0x9a && ver != 0xa7 && ver != 0x7d) return; if (risky_device(dev)) diff -u linux-aws-6.5-6.5.0/drivers/iommu/iommu.c linux-aws-6.5-6.5.0/drivers/iommu/iommu.c --- linux-aws-6.5-6.5.0/drivers/iommu/iommu.c +++ linux-aws-6.5-6.5.0/drivers/iommu/iommu.c @@ -333,12 +333,13 @@ return min_t(u32, max_pasids, dev->iommu->iommu_dev->max_pasids); } +DEFINE_MUTEX(iommu_probe_device_lock); + static int __iommu_probe_device(struct device *dev, struct list_head *group_list) { const struct iommu_ops *ops = dev->bus->iommu_ops; struct iommu_device *iommu_dev; struct iommu_group *group; - static DEFINE_MUTEX(iommu_probe_device_lock); int ret; if (!ops) @@ -350,10 +351,9 @@ * probably be able to use device_lock() here to minimise the scope, * but for now enforcing a simple global ordering is fine. */ - mutex_lock(&iommu_probe_device_lock); + lockdep_assert_held(&iommu_probe_device_lock); if (!dev_iommu_get(dev)) { - ret = -ENOMEM; - goto err_unlock; + return -ENOMEM; } if (!try_module_get(ops->owner)) { @@ -384,7 +384,6 @@ mutex_unlock(&group->mutex); iommu_group_put(group); - mutex_unlock(&iommu_probe_device_lock); iommu_device_link(iommu_dev, dev); return 0; @@ -399,9 +398,6 @@ err_free: dev_iommu_free(dev); -err_unlock: - mutex_unlock(&iommu_probe_device_lock); - return ret; } @@ -411,7 +407,9 @@ struct iommu_group *group; int ret; + mutex_lock(&iommu_probe_device_lock); ret = __iommu_probe_device(dev, NULL); + mutex_unlock(&iommu_probe_device_lock); if (ret) goto err_out; @@ -1721,7 +1719,9 @@ return 0; } + mutex_lock(&iommu_probe_device_lock); ret = __iommu_probe_device(dev, group_list); + mutex_unlock(&iommu_probe_device_lock); if (ret == -ENODEV) ret = 0; diff -u linux-aws-6.5-6.5.0/drivers/leds/leds-pwm.c linux-aws-6.5-6.5.0/drivers/leds/leds-pwm.c --- linux-aws-6.5-6.5.0/drivers/leds/leds-pwm.c +++ linux-aws-6.5-6.5.0/drivers/leds/leds-pwm.c @@ -53,7 +53,7 @@ duty = led_dat->pwmstate.period - duty; led_dat->pwmstate.duty_cycle = duty; - led_dat->pwmstate.enabled = duty > 0; + led_dat->pwmstate.enabled = true; return pwm_apply_state(led_dat->pwm, &led_dat->pwmstate); } diff -u linux-aws-6.5-6.5.0/drivers/mcb/mcb-core.c linux-aws-6.5-6.5.0/drivers/mcb/mcb-core.c --- linux-aws-6.5-6.5.0/drivers/mcb/mcb-core.c +++ linux-aws-6.5-6.5.0/drivers/mcb/mcb-core.c @@ -246,6 +246,7 @@ return 0; out: + put_device(&dev->dev); return ret; } diff -u linux-aws-6.5-6.5.0/drivers/mcb/mcb-parse.c linux-aws-6.5-6.5.0/drivers/mcb/mcb-parse.c --- linux-aws-6.5-6.5.0/drivers/mcb/mcb-parse.c +++ linux-aws-6.5-6.5.0/drivers/mcb/mcb-parse.c @@ -106,7 +106,7 @@ return 0; err: - put_device(&mdev->dev); + mcb_free_dev(mdev); return ret; } diff -u linux-aws-6.5-6.5.0/drivers/md/dm-crypt.c linux-aws-6.5-6.5.0/drivers/md/dm-crypt.c --- linux-aws-6.5-6.5.0/drivers/md/dm-crypt.c +++ linux-aws-6.5-6.5.0/drivers/md/dm-crypt.c @@ -1680,7 +1680,7 @@ unsigned int nr_iovecs = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; gfp_t gfp_mask = GFP_NOWAIT | __GFP_HIGHMEM; unsigned int remaining_size; - unsigned int order = MAX_ORDER - 1; + unsigned int order = MAX_ORDER; retry: if (unlikely(gfp_mask & __GFP_DIRECT_RECLAIM)) @@ -1700,11 +1700,17 @@ order = min(order, remaining_order); while (order > 0) { + if (unlikely(percpu_counter_read_positive(&cc->n_allocated_pages) + + (1 << order) > dm_crypt_pages_per_client)) + goto decrease_order; pages = alloc_pages(gfp_mask | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | __GFP_COMP, order); - if (likely(pages != NULL)) + if (likely(pages != NULL)) { + percpu_counter_add(&cc->n_allocated_pages, 1 << order); goto have_pages; + } +decrease_order: order--; } @@ -1742,10 +1748,13 @@ if (clone->bi_vcnt > 0) { /* bio_for_each_folio_all crashes with an empty bio */ bio_for_each_folio_all(fi, clone) { - if (folio_test_large(fi.folio)) + if (folio_test_large(fi.folio)) { + percpu_counter_sub(&cc->n_allocated_pages, + 1 << folio_order(fi.folio)); folio_put(fi.folio); - else + } else { mempool_free(&fi.folio->page, &cc->page_pool); + } } } } diff -u linux-aws-6.5-6.5.0/drivers/md/md.c linux-aws-6.5-6.5.0/drivers/md/md.c --- linux-aws-6.5-6.5.0/drivers/md/md.c +++ linux-aws-6.5-6.5.0/drivers/md/md.c @@ -449,7 +449,7 @@ set_bit(MD_ALLOW_SB_UPDATE, &mddev->flags); percpu_ref_kill(&mddev->active_io); - if (mddev->pers->prepare_suspend) + if (mddev->pers && mddev->pers->prepare_suspend) mddev->pers->prepare_suspend(mddev); wait_event(mddev->sb_wait, percpu_ref_is_zero(&mddev->active_io)); @@ -6275,6 +6275,9 @@ int err = 0; int did_freeze = 0; + if (mddev->external && test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags)) + return -EBUSY; + if (!test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) { did_freeze = 1; set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); @@ -6289,8 +6292,6 @@ */ md_wakeup_thread_directly(mddev->sync_thread); - if (mddev->external && test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags)) - return -EBUSY; mddev_unlock(mddev); wait_event(resync_wait, !test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)); @@ -6303,29 +6304,30 @@ mddev->sync_thread || test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { pr_warn("md: %s still in use.\n",mdname(mddev)); - if (did_freeze) { - clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); - set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); - md_wakeup_thread(mddev->thread); - } err = -EBUSY; goto out; } + if (mddev->pers) { __md_stop_writes(mddev); - err = -ENXIO; - if (mddev->ro == MD_RDONLY) + if (mddev->ro == MD_RDONLY) { + err = -ENXIO; goto out; + } + mddev->ro = MD_RDONLY; set_disk_ro(mddev->gendisk, 1); + } + +out: + if ((mddev->pers && !err) || did_freeze) { clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); md_wakeup_thread(mddev->thread); sysfs_notify_dirent_safe(mddev->sysfs_state); - err = 0; } -out: + mutex_unlock(&mddev->open_mutex); return err; } @@ -8635,7 +8637,8 @@ struct bio *orig_bio = md_io_acct->orig_bio; struct mddev *mddev = md_io_acct->mddev; - orig_bio->bi_status = bio->bi_status; + if (bio->bi_status && !orig_bio->bi_status) + orig_bio->bi_status = bio->bi_status; bio_end_io_acct(orig_bio, md_io_acct->start_time); bio_put(bio); diff -u linux-aws-6.5-6.5.0/drivers/md/raid5.c linux-aws-6.5-6.5.0/drivers/md/raid5.c --- linux-aws-6.5-6.5.0/drivers/md/raid5.c +++ linux-aws-6.5-6.5.0/drivers/md/raid5.c @@ -5905,11 +5905,11 @@ int dd_idx; for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { - if (dd_idx == sh->pd_idx) + if (dd_idx == sh->pd_idx || dd_idx == sh->qd_idx) continue; min_sector = min(min_sector, sh->dev[dd_idx].sector); - max_sector = min(max_sector, sh->dev[dd_idx].sector); + max_sector = max(max_sector, sh->dev[dd_idx].sector); } spin_lock_irq(&conf->device_lock); diff -u linux-aws-6.5-6.5.0/drivers/media/i2c/ov5640.c linux-aws-6.5-6.5.0/drivers/media/i2c/ov5640.c --- linux-aws-6.5-6.5.0/drivers/media/i2c/ov5640.c +++ linux-aws-6.5-6.5.0/drivers/media/i2c/ov5640.c @@ -2850,12 +2850,22 @@ return 0; } +static void __v4l2_ctrl_vblank_update(struct ov5640_dev *sensor, u32 vblank) +{ + const struct ov5640_mode_info *mode = sensor->current_mode; + + __v4l2_ctrl_modify_range(sensor->ctrls.vblank, OV5640_MIN_VBLANK, + OV5640_MAX_VTS - mode->height, 1, vblank); + + __v4l2_ctrl_s_ctrl(sensor->ctrls.vblank, vblank); +} + static int ov5640_update_pixel_rate(struct ov5640_dev *sensor) { const struct ov5640_mode_info *mode = sensor->current_mode; enum ov5640_pixel_rate_id pixel_rate_id = mode->pixel_rate; struct v4l2_mbus_framefmt *fmt = &sensor->fmt; - const struct ov5640_timings *timings; + const struct ov5640_timings *timings = ov5640_timings(sensor, mode); s32 exposure_val, exposure_max; unsigned int hblank; unsigned int i = 0; @@ -2874,6 +2884,8 @@ __v4l2_ctrl_s_ctrl_int64(sensor->ctrls.pixel_rate, ov5640_calc_pixel_rate(sensor)); + __v4l2_ctrl_vblank_update(sensor, timings->vblank_def); + return 0; } @@ -2916,15 +2928,12 @@ __v4l2_ctrl_s_ctrl_int64(sensor->ctrls.pixel_rate, pixel_rate); __v4l2_ctrl_s_ctrl(sensor->ctrls.link_freq, i); - timings = ov5640_timings(sensor, mode); hblank = timings->htot - mode->width; __v4l2_ctrl_modify_range(sensor->ctrls.hblank, hblank, hblank, 1, hblank); vblank = timings->vblank_def; - __v4l2_ctrl_modify_range(sensor->ctrls.vblank, OV5640_MIN_VBLANK, - OV5640_MAX_VTS - mode->height, 1, vblank); - __v4l2_ctrl_s_ctrl(sensor->ctrls.vblank, vblank); + __v4l2_ctrl_vblank_update(sensor, vblank); exposure_max = timings->crop.height + vblank - 4; exposure_val = clamp_t(s32, sensor->ctrls.exposure->val, @@ -3919,7 +3928,7 @@ ret = ov5640_sensor_resume(dev); if (ret) { dev_err(dev, "failed to power on\n"); - goto entity_cleanup; + goto free_ctrls; } pm_runtime_set_active(dev); @@ -3944,8 +3953,9 @@ err_pm_runtime: pm_runtime_put_noidle(dev); pm_runtime_disable(dev); - v4l2_ctrl_handler_free(&sensor->ctrls.handler); ov5640_sensor_suspend(dev); +free_ctrls: + v4l2_ctrl_handler_free(&sensor->ctrls.handler); entity_cleanup: media_entity_cleanup(&sensor->sd.entity); mutex_destroy(&sensor->lock); diff -u linux-aws-6.5-6.5.0/drivers/media/pci/intel/ipu-bridge.h linux-aws-6.5-6.5.0/drivers/media/pci/intel/ipu-bridge.h --- linux-aws-6.5-6.5.0/drivers/media/pci/intel/ipu-bridge.h +++ linux-aws-6.5-6.5.0/drivers/media/pci/intel/ipu-bridge.h @@ -103,7 +103,7 @@ struct ipu_node_names { char port[7]; char endpoint[11]; - char remote_port[7]; + char remote_port[9]; char vcm[16]; }; diff -u linux-aws-6.5-6.5.0/drivers/media/platform/amphion/vpu_helpers.c linux-aws-6.5-6.5.0/drivers/media/platform/amphion/vpu_helpers.c --- linux-aws-6.5-6.5.0/drivers/media/platform/amphion/vpu_helpers.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/amphion/vpu_helpers.c @@ -489,6 +489,7 @@ case VPU_MSG_ID_UNSUPPORTED: return "unsupported"; case VPU_MSG_ID_FIRMWARE_XCPT: return "exception"; case VPU_MSG_ID_PIC_SKIPPED: return "skipped"; + case VPU_MSG_ID_DBG_MSG: return "debug msg"; } return ""; } diff -u linux-aws-6.5-6.5.0/drivers/media/platform/amphion/vpu_msgs.c linux-aws-6.5-6.5.0/drivers/media/platform/amphion/vpu_msgs.c --- linux-aws-6.5-6.5.0/drivers/media/platform/amphion/vpu_msgs.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/amphion/vpu_msgs.c @@ -23,6 +23,7 @@ struct vpu_msg_handler { u32 id; void (*done)(struct vpu_inst *inst, struct vpu_rpc_event *pkt); + u32 is_str; }; static void vpu_session_handle_start_done(struct vpu_inst *inst, struct vpu_rpc_event *pkt) @@ -154,7 +155,7 @@ { char *str = (char *)pkt->data; - if (strlen(str)) + if (*str) dev_err(inst->dev, "instance %d firmware error : %s\n", inst->id, str); else dev_err(inst->dev, "instance %d is unsupported stream\n", inst->id); @@ -180,6 +181,21 @@ vpu_inst_unlock(inst); } +static void vpu_session_handle_dbg_msg(struct vpu_inst *inst, struct vpu_rpc_event *pkt) +{ + char *str = (char *)pkt->data; + + if (*str) + dev_info(inst->dev, "instance %d firmware dbg msg : %s\n", inst->id, str); +} + +static void vpu_terminate_string_msg(struct vpu_rpc_event *pkt) +{ + if (pkt->hdr.num == ARRAY_SIZE(pkt->data)) + pkt->hdr.num--; + pkt->data[pkt->hdr.num] = 0; +} + static struct vpu_msg_handler handlers[] = { {VPU_MSG_ID_START_DONE, vpu_session_handle_start_done}, {VPU_MSG_ID_STOP_DONE, vpu_session_handle_stop_done}, @@ -193,9 +209,10 @@ {VPU_MSG_ID_PIC_DECODED, vpu_session_handle_pic_decoded}, {VPU_MSG_ID_DEC_DONE, vpu_session_handle_pic_done}, {VPU_MSG_ID_PIC_EOS, vpu_session_handle_eos}, - {VPU_MSG_ID_UNSUPPORTED, vpu_session_handle_error}, - {VPU_MSG_ID_FIRMWARE_XCPT, vpu_session_handle_firmware_xcpt}, + {VPU_MSG_ID_UNSUPPORTED, vpu_session_handle_error, true}, + {VPU_MSG_ID_FIRMWARE_XCPT, vpu_session_handle_firmware_xcpt, true}, {VPU_MSG_ID_PIC_SKIPPED, vpu_session_handle_pic_skipped}, + {VPU_MSG_ID_DBG_MSG, vpu_session_handle_dbg_msg, true}, }; static int vpu_session_handle_msg(struct vpu_inst *inst, struct vpu_rpc_event *msg) @@ -219,8 +236,12 @@ } } - if (handler && handler->done) - handler->done(inst, msg); + if (handler) { + if (handler->is_str) + vpu_terminate_string_msg(msg); + if (handler->done) + handler->done(inst, msg); + } vpu_response_cmd(inst, msg_id, 1); diff -u linux-aws-6.5-6.5.0/drivers/media/platform/qcom/venus/hfi_venus.c linux-aws-6.5-6.5.0/drivers/media/platform/qcom/venus/hfi_venus.c --- linux-aws-6.5-6.5.0/drivers/media/platform/qcom/venus/hfi_venus.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/qcom/venus/hfi_venus.c @@ -205,6 +205,11 @@ new_wr_idx = wr_idx + dwords; wr_ptr = (u32 *)(queue->qmem.kva + (wr_idx << 2)); + + if (wr_ptr < (u32 *)queue->qmem.kva || + wr_ptr > (u32 *)(queue->qmem.kva + queue->qmem.size - sizeof(*wr_ptr))) + return -EINVAL; + if (new_wr_idx < qsize) { memcpy(wr_ptr, packet, dwords << 2); } else { @@ -272,6 +277,11 @@ } rd_ptr = (u32 *)(queue->qmem.kva + (rd_idx << 2)); + + if (rd_ptr < (u32 *)queue->qmem.kva || + rd_ptr > (u32 *)(queue->qmem.kva + queue->qmem.size - sizeof(*rd_ptr))) + return -EINVAL; + dwords = *rd_ptr >> 2; if (!dwords) return -EINVAL; diff -u linux-aws-6.5-6.5.0/drivers/media/usb/dvb-usb-v2/af9035.c linux-aws-6.5-6.5.0/drivers/media/usb/dvb-usb-v2/af9035.c --- linux-aws-6.5-6.5.0/drivers/media/usb/dvb-usb-v2/af9035.c +++ linux-aws-6.5-6.5.0/drivers/media/usb/dvb-usb-v2/af9035.c @@ -322,8 +322,10 @@ ret = -EOPNOTSUPP; } else if ((msg[0].addr == state->af9033_i2c_addr[0]) || (msg[0].addr == state->af9033_i2c_addr[1])) { - if (msg[0].len < 3 || msg[1].len < 1) - return -EOPNOTSUPP; + if (msg[0].len < 3 || msg[1].len < 1) { + ret = -EOPNOTSUPP; + goto unlock; + } /* demod access via firmware interface */ u32 reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 | msg[0].buf[2]; @@ -383,8 +385,10 @@ ret = -EOPNOTSUPP; } else if ((msg[0].addr == state->af9033_i2c_addr[0]) || (msg[0].addr == state->af9033_i2c_addr[1])) { - if (msg[0].len < 3) - return -EOPNOTSUPP; + if (msg[0].len < 3) { + ret = -EOPNOTSUPP; + goto unlock; + } /* demod access via firmware interface */ u32 reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 | msg[0].buf[2]; @@ -459,6 +463,7 @@ ret = -EOPNOTSUPP; } +unlock: mutex_unlock(&d->i2c_mutex); if (ret < 0) diff -u linux-aws-6.5-6.5.0/drivers/misc/fastrpc.c linux-aws-6.5-6.5.0/drivers/misc/fastrpc.c --- linux-aws-6.5-6.5.0/drivers/misc/fastrpc.c +++ linux-aws-6.5-6.5.0/drivers/misc/fastrpc.c @@ -957,6 +957,7 @@ if (err) return err; + memset(ctx->buf->virt, 0, pkt_size); rpra = ctx->buf->virt; list = fastrpc_invoke_buf_start(rpra, ctx->nscalars); pages = fastrpc_phy_page_start(list, ctx->nscalars); @@ -1089,6 +1090,7 @@ } } + /* Clean up fdlist which is updated by DSP */ for (i = 0; i < FASTRPC_MAX_FDLIST; i++) { if (!fdlist[i]) break; @@ -1155,11 +1157,9 @@ if (IS_ERR(ctx)) return PTR_ERR(ctx); - if (ctx->nscalars) { - err = fastrpc_get_args(kernel, ctx); - if (err) - goto bail; - } + err = fastrpc_get_args(kernel, ctx); + if (err) + goto bail; /* make sure that all CPU memory writes are seen by DSP */ dma_wmb(); @@ -1178,20 +1178,18 @@ if (err) goto bail; + /* make sure that all memory writes by DSP are seen by CPU */ + dma_rmb(); + /* populate all the output buffers with results */ + err = fastrpc_put_args(ctx, kernel); + if (err) + goto bail; + /* Check the response from remote dsp */ err = ctx->retval; if (err) goto bail; - if (ctx->nscalars) { - /* make sure that all memory writes by DSP are seen by CPU */ - dma_rmb(); - /* populate all the output buffers with results */ - err = fastrpc_put_args(ctx, kernel); - if (err) - goto bail; - } - bail: if (err != -ERESTARTSYS && err != -ETIMEDOUT) { /* We are done with this compute context */ @@ -1982,11 +1980,13 @@ sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_MEM_UNMAP, 1, 0); err = fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE, sc, &args[0]); - fastrpc_map_put(map); - if (err) + if (err) { dev_err(dev, "unmmap\tpt fd = %d, 0x%09llx error\n", map->fd, map->raddr); + return err; + } + fastrpc_map_put(map); - return err; + return 0; } static int fastrpc_req_mem_unmap(struct fastrpc_user *fl, char __user *argp) diff -u linux-aws-6.5-6.5.0/drivers/net/dsa/microchip/ksz_common.c linux-aws-6.5-6.5.0/drivers/net/dsa/microchip/ksz_common.c --- linux-aws-6.5-6.5.0/drivers/net/dsa/microchip/ksz_common.c +++ linux-aws-6.5-6.5.0/drivers/net/dsa/microchip/ksz_common.c @@ -2626,10 +2626,18 @@ { struct ksz_tagger_data *tagger_data; - tagger_data = ksz_tagger_data(ds); - tagger_data->xmit_work_fn = ksz_port_deferred_xmit; - - return 0; + switch (proto) { + case DSA_TAG_PROTO_KSZ8795: + return 0; + case DSA_TAG_PROTO_KSZ9893: + case DSA_TAG_PROTO_KSZ9477: + case DSA_TAG_PROTO_LAN937X: + tagger_data = ksz_tagger_data(ds); + tagger_data->xmit_work_fn = ksz_port_deferred_xmit; + return 0; + default: + return -EPROTONOSUPPORT; + } } static int ksz_port_vlan_filtering(struct dsa_switch *ds, int port, diff -u linux-aws-6.5-6.5.0/drivers/net/dsa/mv88e6xxx/chip.c linux-aws-6.5-6.5.0/drivers/net/dsa/mv88e6xxx/chip.c --- linux-aws-6.5-6.5.0/drivers/net/dsa/mv88e6xxx/chip.c +++ linux-aws-6.5-6.5.0/drivers/net/dsa/mv88e6xxx/chip.c @@ -652,6 +652,18 @@ config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100; } +static void mv88e6351_phylink_get_caps(struct mv88e6xxx_chip *chip, int port, + struct phylink_config *config) +{ + unsigned long *supported = config->supported_interfaces; + + /* Translate the default cmode */ + mv88e6xxx_translate_cmode(chip->ports[port].cmode, supported); + + config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100 | + MAC_1000FD; +} + static int mv88e6352_get_port4_serdes_cmode(struct mv88e6xxx_chip *chip) { u16 reg, val; @@ -4578,7 +4590,7 @@ .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge, .stu_getnext = mv88e6352_g1_stu_getnext, .stu_loadpurge = mv88e6352_g1_stu_loadpurge, - .phylink_get_caps = mv88e6185_phylink_get_caps, + .phylink_get_caps = mv88e6351_phylink_get_caps, }; static const struct mv88e6xxx_ops mv88e6172_ops = { @@ -4683,7 +4695,7 @@ .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge, .stu_getnext = mv88e6352_g1_stu_getnext, .stu_loadpurge = mv88e6352_g1_stu_loadpurge, - .phylink_get_caps = mv88e6185_phylink_get_caps, + .phylink_get_caps = mv88e6351_phylink_get_caps, }; static const struct mv88e6xxx_ops mv88e6176_ops = { @@ -5363,7 +5375,7 @@ .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge, .stu_getnext = mv88e6352_g1_stu_getnext, .stu_loadpurge = mv88e6352_g1_stu_loadpurge, - .phylink_get_caps = mv88e6185_phylink_get_caps, + .phylink_get_caps = mv88e6351_phylink_get_caps, }; static const struct mv88e6xxx_ops mv88e6351_ops = { @@ -5411,7 +5423,7 @@ .stu_loadpurge = mv88e6352_g1_stu_loadpurge, .avb_ops = &mv88e6352_avb_ops, .ptp_ops = &mv88e6352_ptp_ops, - .phylink_get_caps = mv88e6185_phylink_get_caps, + .phylink_get_caps = mv88e6351_phylink_get_caps, }; static const struct mv88e6xxx_ops mv88e6352_ops = { diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/adi/adin1110.c linux-aws-6.5-6.5.0/drivers/net/ethernet/adi/adin1110.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/adi/adin1110.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/adi/adin1110.c @@ -294,7 +294,7 @@ { struct adin1110_priv *priv = port_priv->priv; u32 header_len = ADIN1110_RD_HEADER_LEN; - struct spi_transfer t; + struct spi_transfer t = {0}; u32 frame_size_no_fcs; struct sk_buff *rxb; u32 frame_size; diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/pds_core/dev.c linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/pds_core/dev.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/pds_core/dev.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/pds_core/dev.c @@ -254,10 +254,14 @@ struct pds_core_drv_identity drv = {}; size_t sz; int err; + int n; drv.drv_type = cpu_to_le32(PDS_DRIVER_LINUX); - snprintf(drv.driver_ver_str, sizeof(drv.driver_ver_str), - "%s %s", PDS_CORE_DRV_NAME, utsname()->release); + /* Catching the return quiets a Wformat-truncation complaint */ + n = snprintf(drv.driver_ver_str, sizeof(drv.driver_ver_str), + "%s %s", PDS_CORE_DRV_NAME, utsname()->release); + if (n > sizeof(drv.driver_ver_str)) + dev_dbg(pdsc->dev, "release name truncated, don't care\n"); /* Next let's get some info about the device * We use the devcmd_lock at this level in order to diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/pds_core/devlink.c linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/pds_core/devlink.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/pds_core/devlink.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/pds_core/devlink.c @@ -104,7 +104,7 @@ struct pds_core_fw_list_info fw_list; struct pdsc *pdsc = devlink_priv(dl); union pds_core_dev_comp comp; - char buf[16]; + char buf[32]; int listlen; int err; int i; diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/engleder/tsnep_main.c linux-aws-6.5-6.5.0/drivers/net/ethernet/engleder/tsnep_main.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/engleder/tsnep_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/engleder/tsnep_main.c @@ -1778,14 +1778,14 @@ dev = queue->adapter; } else { if (queue->tx && queue->rx) - sprintf(queue->name, "%s-txrx-%d", name, - queue->rx->queue_index); + snprintf(queue->name, sizeof(queue->name), "%s-txrx-%d", + name, queue->rx->queue_index); else if (queue->tx) - sprintf(queue->name, "%s-tx-%d", name, - queue->tx->queue_index); + snprintf(queue->name, sizeof(queue->name), "%s-tx-%d", + name, queue->tx->queue_index); else - sprintf(queue->name, "%s-rx-%d", name, - queue->rx->queue_index); + snprintf(queue->name, sizeof(queue->name), "%s-rx-%d", + name, queue->rx->queue_index); handler = tsnep_irq_txrx; dev = queue; } diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c @@ -500,11 +500,14 @@ } sprintf(result[j++], "%d", i); - sprintf(result[j++], "%s", dim_state_str[dim->state]); + sprintf(result[j++], "%s", dim->state < ARRAY_SIZE(dim_state_str) ? + dim_state_str[dim->state] : "unknown"); sprintf(result[j++], "%u", dim->profile_ix); - sprintf(result[j++], "%s", dim_cqe_mode_str[dim->mode]); + sprintf(result[j++], "%s", dim->mode < ARRAY_SIZE(dim_cqe_mode_str) ? + dim_cqe_mode_str[dim->mode] : "unknown"); sprintf(result[j++], "%s", - dim_tune_stat_str[dim->tune_state]); + dim->tune_state < ARRAY_SIZE(dim_tune_stat_str) ? + dim_tune_stat_str[dim->tune_state] : "unknown"); sprintf(result[j++], "%u", dim->steps_left); sprintf(result[j++], "%u", dim->steps_right); sprintf(result[j++], "%u", dim->tired); diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -5139,7 +5139,7 @@ struct hns3_nic_priv *priv = netdev_priv(netdev); char format_mac_addr[HNAE3_FORMAT_MAC_ADDR_LEN]; struct hnae3_handle *h = priv->ae_handle; - u8 mac_addr_temp[ETH_ALEN]; + u8 mac_addr_temp[ETH_ALEN] = {0}; int ret = 0; if (h->ae_algo->ops->get_mac_addr) diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -61,6 +61,7 @@ static void hclge_update_fec_stats(struct hclge_dev *hdev); static int hclge_mac_link_status_wait(struct hclge_dev *hdev, int link_ret, int wait_cnt); +static int hclge_update_port_info(struct hclge_dev *hdev); static struct hnae3_ae_algo ae_algo; @@ -3043,6 +3044,9 @@ if (state != hdev->hw.mac.link) { hdev->hw.mac.link = state; + if (state == HCLGE_LINK_STATUS_UP) + hclge_update_port_info(hdev); + client->ops->link_status_change(handle, state); hclge_config_mac_tnl_int(hdev, state); if (rclient && rclient->ops->link_status_change) @@ -10026,8 +10030,6 @@ struct hclge_vport_vlan_cfg *vlan, *tmp; struct hclge_dev *hdev = vport->back; - mutex_lock(&hdev->vport_lock); - list_for_each_entry_safe(vlan, tmp, &vport->vlan_list, node) { if (vlan->vlan_id == vlan_id) { if (is_write_tbl && vlan->hd_tbl_status) @@ -10042,8 +10044,6 @@ break; } } - - mutex_unlock(&hdev->vport_lock); } void hclge_rm_vport_all_vlan_table(struct hclge_vport *vport, bool is_del_list) @@ -10452,11 +10452,16 @@ * handle mailbox. Just record the vlan id, and remove it after * reset finished. */ + mutex_lock(&hdev->vport_lock); if ((test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) || test_bit(HCLGE_STATE_RST_FAIL, &hdev->state)) && is_kill) { set_bit(vlan_id, vport->vlan_del_fail_bmap); + mutex_unlock(&hdev->vport_lock); return -EBUSY; + } else if (!is_kill && test_bit(vlan_id, vport->vlan_del_fail_bmap)) { + clear_bit(vlan_id, vport->vlan_del_fail_bmap); } + mutex_unlock(&hdev->vport_lock); /* when port base vlan enabled, we use port base vlan as the vlan * filter entry. In this case, we don't update vlan filter table @@ -10471,17 +10476,22 @@ } if (!ret) { - if (!is_kill) + if (!is_kill) { hclge_add_vport_vlan_table(vport, vlan_id, writen_to_tbl); - else if (is_kill && vlan_id != 0) + } else if (is_kill && vlan_id != 0) { + mutex_lock(&hdev->vport_lock); hclge_rm_vport_vlan_table(vport, vlan_id, false); + mutex_unlock(&hdev->vport_lock); + } } else if (is_kill) { /* when remove hw vlan filter failed, record the vlan id, * and try to remove it from hw later, to be consistence * with stack */ + mutex_lock(&hdev->vport_lock); set_bit(vlan_id, vport->vlan_del_fail_bmap); + mutex_unlock(&hdev->vport_lock); } hclge_set_vport_vlan_fltr_change(vport); @@ -10521,6 +10531,7 @@ int i, ret, sync_cnt = 0; u16 vlan_id; + mutex_lock(&hdev->vport_lock); /* start from vport 1 for PF is always alive */ for (i = 0; i < hdev->num_alloc_vport; i++) { struct hclge_vport *vport = &hdev->vport[i]; @@ -10531,21 +10542,26 @@ ret = hclge_set_vlan_filter_hw(hdev, htons(ETH_P_8021Q), vport->vport_id, vlan_id, true); - if (ret && ret != -EINVAL) + if (ret && ret != -EINVAL) { + mutex_unlock(&hdev->vport_lock); return; + } clear_bit(vlan_id, vport->vlan_del_fail_bmap); hclge_rm_vport_vlan_table(vport, vlan_id, false); hclge_set_vport_vlan_fltr_change(vport); sync_cnt++; - if (sync_cnt >= HCLGE_MAX_SYNC_COUNT) + if (sync_cnt >= HCLGE_MAX_SYNC_COUNT) { + mutex_unlock(&hdev->vport_lock); return; + } vlan_id = find_first_bit(vport->vlan_del_fail_bmap, VLAN_N_VID); } } + mutex_unlock(&hdev->vport_lock); hclge_sync_vlan_fltr_state(hdev); } @@ -11652,6 +11668,7 @@ goto err_msi_irq_uninit; if (hdev->hw.mac.media_type == HNAE3_MEDIA_TYPE_COPPER) { + clear_bit(HNAE3_DEV_SUPPORT_FEC_B, ae_dev->caps); if (hnae3_dev_phy_imp_supported(hdev)) ret = hclge_update_tp_port_info(hdev); else diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1206,6 +1206,8 @@ test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state)) && is_kill) { set_bit(vlan_id, hdev->vlan_del_fail_bmap); return -EBUSY; + } else if (!is_kill && test_bit(vlan_id, hdev->vlan_del_fail_bmap)) { + clear_bit(vlan_id, hdev->vlan_del_fail_bmap); } hclgevf_build_send_msg(&send_msg, HCLGE_MBX_SET_VLAN, @@ -1233,20 +1235,25 @@ int ret, sync_cnt = 0; u16 vlan_id; + if (bitmap_empty(hdev->vlan_del_fail_bmap, VLAN_N_VID)) + return; + + rtnl_lock(); vlan_id = find_first_bit(hdev->vlan_del_fail_bmap, VLAN_N_VID); while (vlan_id != VLAN_N_VID) { ret = hclgevf_set_vlan_filter(handle, htons(ETH_P_8021Q), vlan_id, true); if (ret) - return; + break; clear_bit(vlan_id, hdev->vlan_del_fail_bmap); sync_cnt++; if (sync_cnt >= HCLGEVF_MAX_SYNC_COUNT) - return; + break; vlan_id = find_first_bit(hdev->vlan_del_fail_bmap, VLAN_N_VID); } + rtnl_unlock(); } static int hclgevf_en_hw_strip_rxvtag(struct hnae3_handle *handle, bool enable) @@ -1974,8 +1981,18 @@ return HCLGEVF_VECTOR0_EVENT_OTHER; } +static void hclgevf_reset_timer(struct timer_list *t) +{ + struct hclgevf_dev *hdev = from_timer(hdev, t, reset_timer); + + hclgevf_clear_event_cause(hdev, HCLGEVF_VECTOR0_EVENT_RST); + hclgevf_reset_task_schedule(hdev); +} + static irqreturn_t hclgevf_misc_irq_handle(int irq, void *data) { +#define HCLGEVF_RESET_DELAY 5 + enum hclgevf_evt_cause event_cause; struct hclgevf_dev *hdev = data; u32 clearval; @@ -1987,7 +2004,8 @@ switch (event_cause) { case HCLGEVF_VECTOR0_EVENT_RST: - hclgevf_reset_task_schedule(hdev); + mod_timer(&hdev->reset_timer, + jiffies + msecs_to_jiffies(HCLGEVF_RESET_DELAY)); break; case HCLGEVF_VECTOR0_EVENT_MBX: hclgevf_mbx_handler(hdev); @@ -2930,6 +2948,7 @@ HCLGEVF_DRIVER_NAME); hclgevf_task_schedule(hdev, round_jiffies_relative(HZ)); + timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0); return 0; diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h --- linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h @@ -219,6 +219,7 @@ enum hnae3_reset_type reset_level; unsigned long reset_pending; enum hnae3_reset_type reset_type; + struct timer_list reset_timer; #define HCLGEVF_RESET_REQUESTED 0 #define HCLGEVF_RESET_PENDING 1 diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -3841,7 +3841,7 @@ struct i40e_pf *pf = vf->pf; struct i40e_vsi *vsi = NULL; int aq_ret = 0; - int i, ret; + int i; if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { aq_ret = I40E_ERR_PARAM; @@ -3865,8 +3865,10 @@ } cfilter = kzalloc(sizeof(*cfilter), GFP_KERNEL); - if (!cfilter) - return -ENOMEM; + if (!cfilter) { + aq_ret = -ENOMEM; + goto err_out; + } /* parse destination mac address */ for (i = 0; i < ETH_ALEN; i++) @@ -3914,13 +3916,13 @@ /* Adding cloud filter programmed as TC filter */ if (tcf.dst_port) - ret = i40e_add_del_cloud_filter_big_buf(vsi, cfilter, true); + aq_ret = i40e_add_del_cloud_filter_big_buf(vsi, cfilter, true); else - ret = i40e_add_del_cloud_filter(vsi, cfilter, true); - if (ret) { + aq_ret = i40e_add_del_cloud_filter(vsi, cfilter, true); + if (aq_ret) { dev_err(&pf->pdev->dev, "VF %d: Failed to add cloud filter, err %pe aq_err %s\n", - vf->vf_id, ERR_PTR(ret), + vf->vf_id, ERR_PTR(aq_ret), i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); goto err_free; } diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf.h linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf.h --- linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf.h @@ -298,8 +298,6 @@ #define IAVF_FLAG_CLIENT_NEEDS_OPEN BIT(10) #define IAVF_FLAG_CLIENT_NEEDS_CLOSE BIT(11) #define IAVF_FLAG_CLIENT_NEEDS_L2_PARAMS BIT(12) -#define IAVF_FLAG_PROMISC_ON BIT(13) -#define IAVF_FLAG_ALLMULTI_ON BIT(14) #define IAVF_FLAG_LEGACY_RX BIT(15) #define IAVF_FLAG_REINIT_ITR_NEEDED BIT(16) #define IAVF_FLAG_QUEUES_DISABLED BIT(17) @@ -325,10 +323,7 @@ #define IAVF_FLAG_AQ_SET_HENA BIT_ULL(12) #define IAVF_FLAG_AQ_SET_RSS_KEY BIT_ULL(13) #define IAVF_FLAG_AQ_SET_RSS_LUT BIT_ULL(14) -#define IAVF_FLAG_AQ_REQUEST_PROMISC BIT_ULL(15) -#define IAVF_FLAG_AQ_RELEASE_PROMISC BIT_ULL(16) -#define IAVF_FLAG_AQ_REQUEST_ALLMULTI BIT_ULL(17) -#define IAVF_FLAG_AQ_RELEASE_ALLMULTI BIT_ULL(18) +#define IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE BIT_ULL(15) #define IAVF_FLAG_AQ_ENABLE_VLAN_STRIPPING BIT_ULL(19) #define IAVF_FLAG_AQ_DISABLE_VLAN_STRIPPING BIT_ULL(20) #define IAVF_FLAG_AQ_ENABLE_CHANNELS BIT_ULL(21) @@ -365,6 +360,12 @@ (IAVF_EXTENDED_CAP_SEND_VLAN_V2 | \ IAVF_EXTENDED_CAP_RECV_VLAN_V2) + /* Lock to prevent possible clobbering of + * current_netdev_promisc_flags + */ + spinlock_t current_netdev_promisc_flags_lock; + netdev_features_t current_netdev_promisc_flags; + /* OS defined structs */ struct net_device *netdev; struct pci_dev *pdev; @@ -551,7 +552,8 @@ void iavf_del_ether_addrs(struct iavf_adapter *adapter); void iavf_add_vlans(struct iavf_adapter *adapter); void iavf_del_vlans(struct iavf_adapter *adapter); -void iavf_set_promiscuous(struct iavf_adapter *adapter, int flags); +void iavf_set_promiscuous(struct iavf_adapter *adapter); +bool iavf_promiscuous_mode_changed(struct iavf_adapter *adapter); void iavf_request_stats(struct iavf_adapter *adapter); int iavf_request_reset(struct iavf_adapter *adapter); void iavf_get_hena(struct iavf_adapter *adapter); diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf_ethtool.c linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf_ethtool.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf_ethtool.c @@ -829,18 +829,10 @@ struct iavf_adapter *adapter = netdev_priv(netdev); int i; - if (ec->rx_coalesce_usecs == 0) { - if (ec->use_adaptive_rx_coalesce) - netif_info(adapter, drv, netdev, "rx-usecs=0, need to disable adaptive-rx for a complete disable\n"); - } else if ((ec->rx_coalesce_usecs < IAVF_MIN_ITR) || - (ec->rx_coalesce_usecs > IAVF_MAX_ITR)) { + if (ec->rx_coalesce_usecs > IAVF_MAX_ITR) { netif_info(adapter, drv, netdev, "Invalid value, rx-usecs range is 0-8160\n"); return -EINVAL; - } else if (ec->tx_coalesce_usecs == 0) { - if (ec->use_adaptive_tx_coalesce) - netif_info(adapter, drv, netdev, "tx-usecs=0, need to disable adaptive-tx for a complete disable\n"); - } else if ((ec->tx_coalesce_usecs < IAVF_MIN_ITR) || - (ec->tx_coalesce_usecs > IAVF_MAX_ITR)) { + } else if (ec->tx_coalesce_usecs > IAVF_MAX_ITR) { netif_info(adapter, drv, netdev, "Invalid value, tx-usecs range is 0-8160\n"); return -EINVAL; } diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf_main.c linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf_main.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -1187,6 +1187,16 @@ } /** + * iavf_promiscuous_mode_changed - check if promiscuous mode bits changed + * @adapter: device specific adapter + */ +bool iavf_promiscuous_mode_changed(struct iavf_adapter *adapter) +{ + return (adapter->current_netdev_promisc_flags ^ adapter->netdev->flags) & + (IFF_PROMISC | IFF_ALLMULTI); +} + +/** * iavf_set_rx_mode - NDO callback to set the netdev filters * @netdev: network interface device structure **/ @@ -1199,19 +1209,10 @@ __dev_mc_sync(netdev, iavf_addr_sync, iavf_addr_unsync); spin_unlock_bh(&adapter->mac_vlan_list_lock); - if (netdev->flags & IFF_PROMISC && - !(adapter->flags & IAVF_FLAG_PROMISC_ON)) - adapter->aq_required |= IAVF_FLAG_AQ_REQUEST_PROMISC; - else if (!(netdev->flags & IFF_PROMISC) && - adapter->flags & IAVF_FLAG_PROMISC_ON) - adapter->aq_required |= IAVF_FLAG_AQ_RELEASE_PROMISC; - - if (netdev->flags & IFF_ALLMULTI && - !(adapter->flags & IAVF_FLAG_ALLMULTI_ON)) - adapter->aq_required |= IAVF_FLAG_AQ_REQUEST_ALLMULTI; - else if (!(netdev->flags & IFF_ALLMULTI) && - adapter->flags & IAVF_FLAG_ALLMULTI_ON) - adapter->aq_required |= IAVF_FLAG_AQ_RELEASE_ALLMULTI; + spin_lock_bh(&adapter->current_netdev_promisc_flags_lock); + if (iavf_promiscuous_mode_changed(adapter)) + adapter->aq_required |= IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE; + spin_unlock_bh(&adapter->current_netdev_promisc_flags_lock); } /** @@ -1437,9 +1438,9 @@ adapter->aq_required |= IAVF_FLAG_AQ_DEL_FDIR_FILTER; if (!list_empty(&adapter->adv_rss_list_head)) adapter->aq_required |= IAVF_FLAG_AQ_DEL_ADV_RSS_CFG; - adapter->aq_required |= IAVF_FLAG_AQ_DISABLE_QUEUES; } + adapter->aq_required |= IAVF_FLAG_AQ_DISABLE_QUEUES; mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); } @@ -2162,19 +2163,8 @@ return 0; } - if (adapter->aq_required & IAVF_FLAG_AQ_REQUEST_PROMISC) { - iavf_set_promiscuous(adapter, FLAG_VF_UNICAST_PROMISC | - FLAG_VF_MULTICAST_PROMISC); - return 0; - } - - if (adapter->aq_required & IAVF_FLAG_AQ_REQUEST_ALLMULTI) { - iavf_set_promiscuous(adapter, FLAG_VF_MULTICAST_PROMISC); - return 0; - } - if ((adapter->aq_required & IAVF_FLAG_AQ_RELEASE_PROMISC) || - (adapter->aq_required & IAVF_FLAG_AQ_RELEASE_ALLMULTI)) { - iavf_set_promiscuous(adapter, 0); + if (adapter->aq_required & IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE) { + iavf_set_promiscuous(adapter); return 0; } @@ -4970,6 +4960,7 @@ spin_lock_init(&adapter->cloud_filter_list_lock); spin_lock_init(&adapter->fdir_fltr_lock); spin_lock_init(&adapter->adv_rss_lock); + spin_lock_init(&adapter->current_netdev_promisc_flags_lock); INIT_LIST_HEAD(&adapter->mac_filter_list); INIT_LIST_HEAD(&adapter->vlan_filter_list); @@ -4982,8 +4973,6 @@ INIT_WORK(&adapter->finish_config, iavf_finish_config); INIT_DELAYED_WORK(&adapter->watchdog_task, iavf_watchdog_task); INIT_DELAYED_WORK(&adapter->client_task, iavf_client_task); - queue_delayed_work(adapter->wq, &adapter->watchdog_task, - msecs_to_jiffies(5 * (pdev->devfn & 0x07))); /* Setup the wait queue for indicating transition to down status */ init_waitqueue_head(&adapter->down_waitqueue); @@ -4994,6 +4983,9 @@ /* Setup the wait queue for indicating virtchannel events */ init_waitqueue_head(&adapter->vc_waitqueue); + queue_delayed_work(adapter->wq, &adapter->watchdog_task, + msecs_to_jiffies(5 * (pdev->devfn & 0x07))); + /* Initialization goes on in the work. Do not add more of it below. */ return 0; err_ioremap: diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice_main.c linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice_main.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice_main.c @@ -6,6 +6,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include +#include #include "ice.h" #include "ice_base.h" #include "ice_lib.h" @@ -64,6 +65,7 @@ } static struct workqueue_struct *ice_wq; +struct workqueue_struct *ice_lag_wq; static const struct net_device_ops ice_netdev_safe_mode_ops; static const struct net_device_ops ice_netdev_ops; @@ -3795,6 +3797,7 @@ static void ice_deinit_pf(struct ice_pf *pf) { ice_service_task_stop(pf); + mutex_destroy(&pf->lag_mutex); mutex_destroy(&pf->adev_mutex); mutex_destroy(&pf->sw_mutex); mutex_destroy(&pf->tc_mutex); @@ -3875,6 +3878,7 @@ mutex_init(&pf->sw_mutex); mutex_init(&pf->tc_mutex); mutex_init(&pf->adev_mutex); + mutex_init(&pf->lag_mutex); INIT_HLIST_HEAD(&pf->aq_wait_list); spin_lock_init(&pf->aq_wait_lock); @@ -4632,6 +4636,9 @@ static void ice_deinit_features(struct ice_pf *pf) { + if (ice_is_safe_mode(pf)) + return; + ice_deinit_lag(pf); if (test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags)) ice_cfg_lldp_mib_change(&pf->hw, false); @@ -4963,6 +4970,20 @@ return -EINVAL; } + /* when under a kdump kernel initiate a reset before enabling the + * device in order to clear out any pending DMA transactions. These + * transactions can cause some systems to machine check when doing + * the pcim_enable_device() below. + */ + if (is_kdump_kernel()) { + pci_save_state(pdev); + pci_clear_master(pdev); + err = pcie_flr(pdev); + if (err) + return err; + pci_restore_state(pdev); + } + /* this driver uses devres, see * Documentation/driver-api/driver-model/devres.rst */ @@ -5571,7 +5592,7 @@ */ static int __init ice_module_init(void) { - int status; + int status = -ENOMEM; pr_info("%s\n", ice_driver_string); pr_info("%s\n", ice_copyright); @@ -5579,15 +5600,27 @@ ice_wq = alloc_workqueue("%s", 0, 0, KBUILD_MODNAME); if (!ice_wq) { pr_err("Failed to create workqueue\n"); - return -ENOMEM; + return status; + } + + ice_lag_wq = alloc_ordered_workqueue("ice_lag_wq", 0); + if (!ice_lag_wq) { + pr_err("Failed to create LAG workqueue\n"); + goto err_dest_wq; } status = pci_register_driver(&ice_driver); if (status) { pr_err("failed to register PCI driver, err %d\n", status); - destroy_workqueue(ice_wq); + goto err_dest_lag_wq; } + return 0; + +err_dest_lag_wq: + destroy_workqueue(ice_lag_wq); +err_dest_wq: + destroy_workqueue(ice_wq); return status; } module_init(ice_module_init); @@ -5602,6 +5635,7 @@ { pci_unregister_driver(&ice_driver); destroy_workqueue(ice_wq); + destroy_workqueue(ice_lag_wq); pr_info("module unloaded\n"); } module_exit(ice_module_exit); diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/igc/igc_ethtool.c linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/igc/igc_ethtool.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -1817,7 +1817,7 @@ struct igc_adapter *adapter = netdev_priv(netdev); struct net_device *dev = adapter->netdev; struct igc_hw *hw = &adapter->hw; - u32 advertising; + u16 advertised = 0; /* When adapter in resetting mode, autoneg/speed/duplex * cannot be changed @@ -1842,18 +1842,33 @@ while (test_and_set_bit(__IGC_RESETTING, &adapter->state)) usleep_range(1000, 2000); - ethtool_convert_link_mode_to_legacy_u32(&advertising, - cmd->link_modes.advertising); - /* Converting to legacy u32 drops ETHTOOL_LINK_MODE_2500baseT_Full_BIT. - * We have to check this and convert it to ADVERTISE_2500_FULL - * (aka ETHTOOL_LINK_MODE_2500baseX_Full_BIT) explicitly. - */ - if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 2500baseT_Full)) - advertising |= ADVERTISE_2500_FULL; + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, + 2500baseT_Full)) + advertised |= ADVERTISE_2500_FULL; + + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, + 1000baseT_Full)) + advertised |= ADVERTISE_1000_FULL; + + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, + 100baseT_Full)) + advertised |= ADVERTISE_100_FULL; + + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, + 100baseT_Half)) + advertised |= ADVERTISE_100_HALF; + + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, + 10baseT_Full)) + advertised |= ADVERTISE_10_FULL; + + if (ethtool_link_ksettings_test_link_mode(cmd, advertising, + 10baseT_Half)) + advertised |= ADVERTISE_10_HALF; if (cmd->base.autoneg == AUTONEG_ENABLE) { hw->mac.autoneg = 1; - hw->phy.autoneg_advertised = advertising; + hw->phy.autoneg_advertised = advertised; if (adapter->fc_autoneg) hw->fc.requested_mode = igc_fc_default; } else { diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeon_ep/octep_main.c linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeon_ep/octep_main.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeon_ep/octep_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeon_ep/octep_main.c @@ -715,20 +715,19 @@ hw_desc->dptr = tx_buffer->sglist_dma; } - /* Flush the hw descriptor before writing to doorbell */ - wmb(); - - /* Ring Doorbell to notify the NIC there is a new packet */ - writel(1, iq->doorbell_reg); + netdev_tx_sent_queue(iq->netdev_q, skb->len); + skb_tx_timestamp(skb); atomic_inc(&iq->instr_pending); wi++; if (wi == iq->max_count) wi = 0; iq->host_write_index = wi; + /* Flush the hw descriptor before writing to doorbell */ + wmb(); - netdev_tx_sent_queue(iq->netdev_q, skb->len); + /* Ring Doorbell to notify the NIC there is a new packet */ + writel(1, iq->doorbell_reg); iq->stats.instr_posted++; - skb_tx_timestamp(skb); return NETDEV_TX_OK; dma_map_sg_err: diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -12,6 +12,7 @@ #include "rvu_reg.h" #include "rvu.h" #include "npc.h" +#include "mcs.h" #include "cgx.h" #include "lmac_common.h" #include "rvu_npc_hash.h" @@ -4389,6 +4390,12 @@ SDP_HW_MAX_FRS << 16 | NIC_HW_MIN_FRS); } + /* Get MCS external bypass status for CN10K-B */ + if (mcs_get_blkcnt() == 1) { + /* Adjust for 2 credits when external bypass is disabled */ + nix_hw->cc_mcs_cnt = is_mcs_bypass(0) ? 0 : 2; + } + /* Set credits for Tx links assuming max packet length allowed. * This will be reconfigured based on MTU set for PF/VF. */ @@ -4412,6 +4419,7 @@ tx_credits = (lmac_fifo_len - lmac_max_frs) / 16; /* Enable credits and set credit pkt count to max allowed */ cfg = (tx_credits << 12) | (0x1FF << 2) | BIT_ULL(1); + cfg |= FIELD_PREP(NIX_AF_LINKX_MCS_CNT_MASK, nix_hw->cc_mcs_cnt); link = iter + slink; nix_hw->tx_credits[link] = tx_credits; @@ -5505,6 +5513,8 @@ ipolicer = &nix_hw->ipolicer[layer]; for (idx = 0; idx < req->prof_count[layer]; idx++) { + if (idx == MAX_BANDPROF_PER_PFFUNC) + break; prof_idx = req->prof_idx[layer][idx]; if (prof_idx >= ipolicer->band_prof.max || ipolicer->pfvf_map[prof_idx] != pcifunc) @@ -5518,8 +5528,6 @@ ipolicer->pfvf_map[prof_idx] = 0x00; ipolicer->match_id[prof_idx] = 0; rvu_free_rsrc(&ipolicer->band_prof, prof_idx); - if (idx == MAX_BANDPROF_PER_PFFUNC) - break; } } mutex_unlock(&rvu->rsrc_lock); diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c @@ -450,6 +450,9 @@ aq->prof.pebs_mantissa = 0; aq->prof_mask.pebs_mantissa = 0xFF; + aq->prof.hl_en = 0; + aq->prof_mask.hl_en = 1; + /* Fill AQ info */ aq->qidx = profile; aq->ctype = NIX_AQ_CTYPE_BANDPROF; diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c @@ -816,7 +816,6 @@ int qidx, sqe_tail, sqe_head; struct otx2_snd_queue *sq; u64 incr, *ptr, val; - int timeout = 1000; ptr = (u64 *)otx2_get_regaddr(pfvf, NIX_LF_SQ_OP_STATUS); for (qidx = 0; qidx < otx2_get_total_tx_queues(pfvf); qidx++) { @@ -825,15 +824,11 @@ continue; incr = (u64)qidx << 32; - while (timeout) { - val = otx2_atomic64_add(incr, ptr); - sqe_head = (val >> 20) & 0x3F; - sqe_tail = (val >> 28) & 0x3F; - if (sqe_head == sqe_tail) - break; - usleep_range(1, 3); - timeout--; - } + val = otx2_atomic64_add(incr, ptr); + sqe_head = (val >> 20) & 0x3F; + sqe_tail = (val >> 28) & 0x3F; + if (sqe_head != sqe_tail) + usleep_range(50, 60); } } diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h --- linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h @@ -361,13 +361,8 @@ struct list_head flow_list; u32 dmacflt_max_flows; u16 max_flows; -}; - -struct otx2_tc_info { - /* hash table to store TC offloaded flows */ - struct rhashtable flow_table; - struct rhashtable_params flow_ht_params; - unsigned long *tc_entries_bitmap; + struct list_head flow_list_tc; + bool ntuple; }; struct dev_hw_ops { @@ -492,7 +487,6 @@ /* NPC MCAM */ struct otx2_flow_config *flow_cfg; struct otx2_mac_table *mac_table; - struct otx2_tc_info tc_info; u64 reset_count; struct work_struct reset_task; @@ -972,6 +966,7 @@ int otx2_txsch_alloc(struct otx2_nic *pfvf); void otx2_txschq_stop(struct otx2_nic *pfvf); void otx2_txschq_free_one(struct otx2_nic *pfvf, u16 lvl, u16 schq); +void otx2_free_pending_sqe(struct otx2_nic *pfvf); void otx2_sqb_flush(struct otx2_nic *pfvf); int otx2_alloc_rbuf(struct otx2_nic *pfvf, struct otx2_pool *pool, dma_addr_t *dma); @@ -1064,7 +1059,8 @@ void otx2_shutdown_tc(struct otx2_nic *nic); int otx2_setup_tc(struct net_device *netdev, enum tc_setup_type type, void *type_data); -int otx2_tc_alloc_ent_bitmap(struct otx2_nic *nic); +void otx2_tc_apply_ingress_police_rules(struct otx2_nic *nic); + /* CGX/RPM DMAC filters support */ int otx2_dmacflt_get_max_cnt(struct otx2_nic *pf); int otx2_dmacflt_add(struct otx2_nic *pf, const u8 *mac, u32 bit_pos); diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -565,7 +565,9 @@ otx2_write64(pf, RVU_PF_VFPF_MBOX_INTX(1), intr); otx2_queue_work(mbox, pf->mbox_pfvf_wq, 64, vfs, intr, TYPE_PFVF); - vfs -= 64; + if (intr) + trace_otx2_msg_interrupt(mbox->mbox.pdev, "VF(s) to PF", intr); + vfs = 64; } intr = otx2_read64(pf, RVU_PF_VFPF_MBOX_INTX(0)); @@ -573,7 +575,8 @@ otx2_queue_work(mbox, pf->mbox_pfvf_wq, 0, vfs, intr, TYPE_PFVF); - trace_otx2_msg_interrupt(mbox->mbox.pdev, "VF(s) to PF", intr); + if (intr) + trace_otx2_msg_interrupt(mbox->mbox.pdev, "VF(s) to PF", intr); return IRQ_HANDLED; } @@ -1192,31 +1195,32 @@ }; static char *nix_snd_status_e_str[NIX_SND_STATUS_MAX] = { - "NIX_SND_STATUS_GOOD", - "NIX_SND_STATUS_SQ_CTX_FAULT", - "NIX_SND_STATUS_SQ_CTX_POISON", - "NIX_SND_STATUS_SQB_FAULT", - "NIX_SND_STATUS_SQB_POISON", - "NIX_SND_STATUS_HDR_ERR", - "NIX_SND_STATUS_EXT_ERR", - "NIX_SND_STATUS_JUMP_FAULT", - "NIX_SND_STATUS_JUMP_POISON", - "NIX_SND_STATUS_CRC_ERR", - "NIX_SND_STATUS_IMM_ERR", - "NIX_SND_STATUS_SG_ERR", - "NIX_SND_STATUS_MEM_ERR", - "NIX_SND_STATUS_INVALID_SUBDC", - "NIX_SND_STATUS_SUBDC_ORDER_ERR", - "NIX_SND_STATUS_DATA_FAULT", - "NIX_SND_STATUS_DATA_POISON", - "NIX_SND_STATUS_NPC_DROP_ACTION", - "NIX_SND_STATUS_LOCK_VIOL", - "NIX_SND_STATUS_NPC_UCAST_CHAN_ERR", - "NIX_SND_STATUS_NPC_MCAST_CHAN_ERR", - "NIX_SND_STATUS_NPC_MCAST_ABORT", - "NIX_SND_STATUS_NPC_VTAG_PTR_ERR", - "NIX_SND_STATUS_NPC_VTAG_SIZE_ERR", - "NIX_SND_STATUS_SEND_STATS_ERR", + [NIX_SND_STATUS_GOOD] = "NIX_SND_STATUS_GOOD", + [NIX_SND_STATUS_SQ_CTX_FAULT] = "NIX_SND_STATUS_SQ_CTX_FAULT", + [NIX_SND_STATUS_SQ_CTX_POISON] = "NIX_SND_STATUS_SQ_CTX_POISON", + [NIX_SND_STATUS_SQB_FAULT] = "NIX_SND_STATUS_SQB_FAULT", + [NIX_SND_STATUS_SQB_POISON] = "NIX_SND_STATUS_SQB_POISON", + [NIX_SND_STATUS_HDR_ERR] = "NIX_SND_STATUS_HDR_ERR", + [NIX_SND_STATUS_EXT_ERR] = "NIX_SND_STATUS_EXT_ERR", + [NIX_SND_STATUS_JUMP_FAULT] = "NIX_SND_STATUS_JUMP_FAULT", + [NIX_SND_STATUS_JUMP_POISON] = "NIX_SND_STATUS_JUMP_POISON", + [NIX_SND_STATUS_CRC_ERR] = "NIX_SND_STATUS_CRC_ERR", + [NIX_SND_STATUS_IMM_ERR] = "NIX_SND_STATUS_IMM_ERR", + [NIX_SND_STATUS_SG_ERR] = "NIX_SND_STATUS_SG_ERR", + [NIX_SND_STATUS_MEM_ERR] = "NIX_SND_STATUS_MEM_ERR", + [NIX_SND_STATUS_INVALID_SUBDC] = "NIX_SND_STATUS_INVALID_SUBDC", + [NIX_SND_STATUS_SUBDC_ORDER_ERR] = "NIX_SND_STATUS_SUBDC_ORDER_ERR", + [NIX_SND_STATUS_DATA_FAULT] = "NIX_SND_STATUS_DATA_FAULT", + [NIX_SND_STATUS_DATA_POISON] = "NIX_SND_STATUS_DATA_POISON", + [NIX_SND_STATUS_NPC_DROP_ACTION] = "NIX_SND_STATUS_NPC_DROP_ACTION", + [NIX_SND_STATUS_LOCK_VIOL] = "NIX_SND_STATUS_LOCK_VIOL", + [NIX_SND_STATUS_NPC_UCAST_CHAN_ERR] = "NIX_SND_STAT_NPC_UCAST_CHAN_ERR", + [NIX_SND_STATUS_NPC_MCAST_CHAN_ERR] = "NIX_SND_STAT_NPC_MCAST_CHAN_ERR", + [NIX_SND_STATUS_NPC_MCAST_ABORT] = "NIX_SND_STATUS_NPC_MCAST_ABORT", + [NIX_SND_STATUS_NPC_VTAG_PTR_ERR] = "NIX_SND_STATUS_NPC_VTAG_PTR_ERR", + [NIX_SND_STATUS_NPC_VTAG_SIZE_ERR] = "NIX_SND_STATUS_NPC_VTAG_SIZE_ERR", + [NIX_SND_STATUS_SEND_MEM_FAULT] = "NIX_SND_STATUS_SEND_MEM_FAULT", + [NIX_SND_STATUS_SEND_STATS_ERR] = "NIX_SND_STATUS_SEND_STATS_ERR", }; static irqreturn_t otx2_q_intr_handler(int irq, void *data) @@ -1237,14 +1241,16 @@ continue; if (val & BIT_ULL(42)) { - netdev_err(pf->netdev, "CQ%lld: error reading NIX_LF_CQ_OP_INT, NIX_LF_ERR_INT 0x%llx\n", + netdev_err(pf->netdev, + "CQ%lld: error reading NIX_LF_CQ_OP_INT, NIX_LF_ERR_INT 0x%llx\n", qidx, otx2_read64(pf, NIX_LF_ERR_INT)); } else { if (val & BIT_ULL(NIX_CQERRINT_DOOR_ERR)) netdev_err(pf->netdev, "CQ%lld: Doorbell error", qidx); if (val & BIT_ULL(NIX_CQERRINT_CQE_FAULT)) - netdev_err(pf->netdev, "CQ%lld: Memory fault on CQE write to LLC/DRAM", + netdev_err(pf->netdev, + "CQ%lld: Memory fault on CQE write to LLC/DRAM", qidx); } @@ -1271,7 +1277,8 @@ (val & NIX_SQINT_BITS)); if (val & BIT_ULL(42)) { - netdev_err(pf->netdev, "SQ%lld: error reading NIX_LF_SQ_OP_INT, NIX_LF_ERR_INT 0x%llx\n", + netdev_err(pf->netdev, + "SQ%lld: error reading NIX_LF_SQ_OP_INT, NIX_LF_ERR_INT 0x%llx\n", qidx, otx2_read64(pf, NIX_LF_ERR_INT)); goto done; } @@ -1281,8 +1288,11 @@ goto chk_mnq_err_dbg; sq_op_err_code = FIELD_GET(GENMASK(7, 0), sq_op_err_dbg); - netdev_err(pf->netdev, "SQ%lld: NIX_LF_SQ_OP_ERR_DBG(%llx) err=%s\n", - qidx, sq_op_err_dbg, nix_sqoperr_e_str[sq_op_err_code]); + netdev_err(pf->netdev, + "SQ%lld: NIX_LF_SQ_OP_ERR_DBG(0x%llx) err=%s(%#x)\n", + qidx, sq_op_err_dbg, + nix_sqoperr_e_str[sq_op_err_code], + sq_op_err_code); otx2_write64(pf, NIX_LF_SQ_OP_ERR_DBG, BIT_ULL(44)); @@ -1299,16 +1309,21 @@ goto chk_snd_err_dbg; mnq_err_code = FIELD_GET(GENMASK(7, 0), mnq_err_dbg); - netdev_err(pf->netdev, "SQ%lld: NIX_LF_MNQ_ERR_DBG(%llx) err=%s\n", - qidx, mnq_err_dbg, nix_mnqerr_e_str[mnq_err_code]); + netdev_err(pf->netdev, + "SQ%lld: NIX_LF_MNQ_ERR_DBG(0x%llx) err=%s(%#x)\n", + qidx, mnq_err_dbg, nix_mnqerr_e_str[mnq_err_code], + mnq_err_code); otx2_write64(pf, NIX_LF_MNQ_ERR_DBG, BIT_ULL(44)); chk_snd_err_dbg: snd_err_dbg = otx2_read64(pf, NIX_LF_SEND_ERR_DBG); if (snd_err_dbg & BIT(44)) { snd_err_code = FIELD_GET(GENMASK(7, 0), snd_err_dbg); - netdev_err(pf->netdev, "SQ%lld: NIX_LF_SND_ERR_DBG:0x%llx err=%s\n", - qidx, snd_err_dbg, nix_snd_status_e_str[snd_err_code]); + netdev_err(pf->netdev, + "SQ%lld: NIX_LF_SND_ERR_DBG:0x%llx err=%s(%#x)\n", + qidx, snd_err_dbg, + nix_snd_status_e_str[snd_err_code], + snd_err_code); otx2_write64(pf, NIX_LF_SEND_ERR_DBG, BIT_ULL(44)); } @@ -1588,6 +1603,7 @@ else otx2_cleanup_tx_cqes(pf, cq); } + otx2_free_pending_sqe(pf); otx2_free_sq_res(pf); @@ -1671,6 +1687,14 @@ mutex_unlock(&pf->mbox.lock); } +static void otx2_set_irq_coalesce(struct otx2_nic *pfvf) +{ + int cint; + + for (cint = 0; cint < pfvf->hw.cint_cnt; cint++) + otx2_config_irq_coalescing(pfvf, cint); +} + static void otx2_dim_work(struct work_struct *w) { struct dim_cq_moder cur_moder; @@ -1686,6 +1710,7 @@ CQ_TIMER_THRESH_MAX : cur_moder.usec; pfvf->hw.cq_ecount_wait = (cur_moder.pkts > NAPI_POLL_WEIGHT) ? NAPI_POLL_WEIGHT : cur_moder.pkts; + otx2_set_irq_coalesce(pfvf); dim->state = DIM_START_MEASURE; } @@ -1856,6 +1881,8 @@ if (pf->flags & OTX2_FLAG_DMACFLTR_SUPPORT) otx2_dmacflt_reinstall_flows(pf); + otx2_tc_apply_ingress_police_rules(pf); + err = otx2_rxtx_enable(pf, true); /* If a mbox communication error happens at this point then interface * will end up in a state such that it is in down state but hardware @@ -1920,6 +1947,8 @@ /* Clear RSS enable flag */ rss = &pf->hw.rss_info; rss->enable = false; + if (!netif_is_rxfh_configured(netdev)) + kfree(rss->rss_ctx[DEFAULT_RSS_CONTEXT_GROUP]); /* Cleanup Queue IRQ */ vec = pci_irq_vector(pf->pdev, diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c @@ -512,11 +512,18 @@ { struct dim_sample dim_sample; u64 rx_frames, rx_bytes; + u64 tx_frames, tx_bytes; rx_frames = OTX2_GET_RX_STATS(RX_BCAST) + OTX2_GET_RX_STATS(RX_MCAST) + OTX2_GET_RX_STATS(RX_UCAST); rx_bytes = OTX2_GET_RX_STATS(RX_OCTS); - dim_update_sample(pfvf->napi_events, rx_frames, rx_bytes, &dim_sample); + tx_bytes = OTX2_GET_TX_STATS(TX_OCTS); + tx_frames = OTX2_GET_TX_STATS(TX_UCAST); + + dim_update_sample(pfvf->napi_events, + rx_frames + tx_frames, + rx_bytes + tx_bytes, + &dim_sample); net_dim(&cq_poll->dim, dim_sample); } @@ -558,16 +565,9 @@ if (pfvf->flags & OTX2_FLAG_INTF_DOWN) return workdone; - /* Check for adaptive interrupt coalesce */ - if (workdone != 0 && - ((pfvf->flags & OTX2_FLAG_ADPTV_INT_COAL_ENABLED) == - OTX2_FLAG_ADPTV_INT_COAL_ENABLED)) { - /* Adjust irq coalese using net_dim */ + /* Adjust irq coalese using net_dim */ + if (pfvf->flags & OTX2_FLAG_ADPTV_INT_COAL_ENABLED) otx2_adjust_adaptive_coalese(pfvf, cq_poll); - /* Update irq coalescing */ - for (i = 0; i < pfvf->hw.cint_cnt; i++) - otx2_config_irq_coalescing(pfvf, i); - } if (unlikely(!filled_cnt)) { struct refill_work *work; @@ -1247,9 +1247,11 @@ void otx2_cleanup_tx_cqes(struct otx2_nic *pfvf, struct otx2_cq_queue *cq) { + int tx_pkts = 0, tx_bytes = 0; struct sk_buff *skb = NULL; struct otx2_snd_queue *sq; struct nix_cqe_tx_s *cqe; + struct netdev_queue *txq; int processed_cqe = 0; struct sg_list *sg; int qidx; @@ -1270,12 +1272,20 @@ sg = &sq->sg[cqe->comp.sqe_id]; skb = (struct sk_buff *)sg->skb; if (skb) { + tx_bytes += skb->len; + tx_pkts++; otx2_dma_unmap_skb_frags(pfvf, sg); dev_kfree_skb_any(skb); sg->skb = (u64)NULL; } } + if (likely(tx_pkts)) { + if (qidx >= pfvf->hw.tx_queues) + qidx -= pfvf->hw.xdp_queues; + txq = netdev_get_tx_queue(pfvf->netdev, qidx); + netdev_tx_completed_queue(txq, tx_pkts, tx_bytes); + } /* Free CQEs to HW */ otx2_write64(pfvf, NIX_LF_CQ_OP_DOOR, ((u64)cq->cq_idx << 32) | processed_cqe); @@ -1302,6 +1312,38 @@ return err; } +void otx2_free_pending_sqe(struct otx2_nic *pfvf) +{ + int tx_pkts = 0, tx_bytes = 0; + struct sk_buff *skb = NULL; + struct otx2_snd_queue *sq; + struct netdev_queue *txq; + struct sg_list *sg; + int sq_idx, sqe; + + for (sq_idx = 0; sq_idx < pfvf->hw.tx_queues; sq_idx++) { + sq = &pfvf->qset.sq[sq_idx]; + for (sqe = 0; sqe < sq->sqe_cnt; sqe++) { + sg = &sq->sg[sqe]; + skb = (struct sk_buff *)sg->skb; + if (skb) { + tx_bytes += skb->len; + tx_pkts++; + otx2_dma_unmap_skb_frags(pfvf, sg); + dev_kfree_skb_any(skb); + sg->skb = (u64)NULL; + } + } + + if (!tx_pkts) + continue; + txq = netdev_get_tx_queue(pfvf->netdev, sq_idx); + netdev_tx_completed_queue(txq, tx_pkts, tx_bytes); + tx_pkts = 0; + tx_bytes = 0; + } +} + static void otx2_xdp_sqe_add_sg(struct otx2_snd_queue *sq, u64 dma_addr, int len, int *offset) { diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -3148,7 +3148,7 @@ OFFLOAD(DIPV6_31_0, 32, U32_MAX, ip6.daddr.s6_addr32[3], 0, dst_ipv4_dst_ipv6.ipv6_layout.ipv6[12]), OFFLOAD(IPV6_HOPLIMIT, 8, U8_MAX, ip6.hop_limit, 0, ttl_hoplimit), - OFFLOAD(IP_DSCP, 16, 0xc00f, ip6, 0, ip_dscp), + OFFLOAD(IP_DSCP, 16, 0x0fc0, ip6, 0, ip_dscp), OFFLOAD(TCP_SPORT, 16, U16_MAX, tcp.source, 0, tcp_sport), OFFLOAD(TCP_DPORT, 16, U16_MAX, tcp.dest, 0, tcp_dport), @@ -3159,21 +3159,31 @@ OFFLOAD(UDP_DPORT, 16, U16_MAX, udp.dest, 0, udp_dport), }; -static unsigned long mask_to_le(unsigned long mask, int size) +static u32 mask_field_get(void *mask, struct mlx5_fields *f) { - __be32 mask_be32; - __be16 mask_be16; - - if (size == 32) { - mask_be32 = (__force __be32)(mask); - mask = (__force unsigned long)cpu_to_le32(be32_to_cpu(mask_be32)); - } else if (size == 16) { - mask_be32 = (__force __be32)(mask); - mask_be16 = *(__be16 *)&mask_be32; - mask = (__force unsigned long)cpu_to_le16(be16_to_cpu(mask_be16)); + switch (f->field_bsize) { + case 32: + return be32_to_cpu(*(__be32 *)mask) & f->field_mask; + case 16: + return be16_to_cpu(*(__be16 *)mask) & (u16)f->field_mask; + default: + return *(u8 *)mask & (u8)f->field_mask; } +} - return mask; +static void mask_field_clear(void *mask, struct mlx5_fields *f) +{ + switch (f->field_bsize) { + case 32: + *(__be32 *)mask &= ~cpu_to_be32(f->field_mask); + break; + case 16: + *(__be16 *)mask &= ~cpu_to_be16((u16)f->field_mask); + break; + default: + *(u8 *)mask &= ~(u8)f->field_mask; + break; + } } static int offload_pedit_fields(struct mlx5e_priv *priv, @@ -3185,11 +3195,12 @@ struct pedit_headers *set_masks, *add_masks, *set_vals, *add_vals; struct pedit_headers_action *hdrs = parse_attr->hdrs; void *headers_c, *headers_v, *action, *vals_p; - u32 *s_masks_p, *a_masks_p, s_mask, a_mask; struct mlx5e_tc_mod_hdr_acts *mod_acts; - unsigned long mask, field_mask; + void *s_masks_p, *a_masks_p; int i, first, last, next_z; struct mlx5_fields *f; + unsigned long mask; + u32 s_mask, a_mask; u8 cmd; mod_acts = &parse_attr->mod_hdr_acts; @@ -3205,15 +3216,11 @@ bool skip; f = &fields[i]; - /* avoid seeing bits set from previous iterations */ - s_mask = 0; - a_mask = 0; - s_masks_p = (void *)set_masks + f->offset; a_masks_p = (void *)add_masks + f->offset; - s_mask = *s_masks_p & f->field_mask; - a_mask = *a_masks_p & f->field_mask; + s_mask = mask_field_get(s_masks_p, f); + a_mask = mask_field_get(a_masks_p, f); if (!s_mask && !a_mask) /* nothing to offload here */ continue; @@ -3240,22 +3247,20 @@ match_mask, f->field_bsize)) skip = true; /* clear to denote we consumed this field */ - *s_masks_p &= ~f->field_mask; + mask_field_clear(s_masks_p, f); } else { cmd = MLX5_ACTION_TYPE_ADD; mask = a_mask; vals_p = (void *)add_vals + f->offset; /* add 0 is no change */ - if ((*(u32 *)vals_p & f->field_mask) == 0) + if (!mask_field_get(vals_p, f)) skip = true; /* clear to denote we consumed this field */ - *a_masks_p &= ~f->field_mask; + mask_field_clear(a_masks_p, f); } if (skip) continue; - mask = mask_to_le(mask, f->field_bsize); - first = find_first_bit(&mask, f->field_bsize); next_z = find_next_zero_bit(&mask, f->field_bsize, first); last = find_last_bit(&mask, f->field_bsize); @@ -3282,10 +3287,9 @@ MLX5_SET(set_action_in, action, field, f->field); if (cmd == MLX5_ACTION_TYPE_SET) { + unsigned long field_mask = f->field_mask; int start; - field_mask = mask_to_le(f->field_mask, f->field_bsize); - /* if field is bit sized it can start not from first bit */ start = find_first_bit(&field_mask, f->field_bsize); @@ -4931,7 +4935,8 @@ if (err) return err; - rpriv->prev_vf_vport_stats = priv->stats.vf_vport; + mlx5e_stats_copy_rep_stats(&rpriv->prev_vf_vport_stats, + &priv->stats.rep_stats); break; default: NL_SET_ERR_MSG_MOD(extack, "mlx5 supports only police action for matchall"); @@ -4971,7 +4976,7 @@ u64 dbytes; u64 dpkts; - cur_stats = priv->stats.vf_vport; + mlx5e_stats_copy_rep_stats(&cur_stats, &priv->stats.rep_stats); dpkts = cur_stats.rx_packets - rpriv->prev_vf_vport_stats.rx_packets; dbytes = cur_stats.rx_bytes - rpriv->prev_vf_vport_stats.rx_bytes; rpriv->prev_vf_vport_stats = cur_stats; diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1022,11 +1022,8 @@ return ERR_PTR(err); } -static void mlx5_eswitch_event_handlers_register(struct mlx5_eswitch *esw) +static void mlx5_eswitch_event_handler_register(struct mlx5_eswitch *esw) { - MLX5_NB_INIT(&esw->nb, eswitch_vport_event, NIC_VPORT_CHANGE); - mlx5_eq_notifier_register(esw->dev, &esw->nb); - if (esw->mode == MLX5_ESWITCH_OFFLOADS && mlx5_eswitch_is_funcs_handler(esw->dev)) { MLX5_NB_INIT(&esw->esw_funcs.nb, mlx5_esw_funcs_changed_handler, ESW_FUNCTIONS_CHANGED); @@ -1034,13 +1031,11 @@ } } -static void mlx5_eswitch_event_handlers_unregister(struct mlx5_eswitch *esw) +static void mlx5_eswitch_event_handler_unregister(struct mlx5_eswitch *esw) { if (esw->mode == MLX5_ESWITCH_OFFLOADS && mlx5_eswitch_is_funcs_handler(esw->dev)) mlx5_eq_notifier_unregister(esw->dev, &esw->esw_funcs.nb); - mlx5_eq_notifier_unregister(esw->dev, &esw->nb); - flush_workqueue(esw->work_queue); } @@ -1419,6 +1414,9 @@ mlx5_eswitch_update_num_of_vfs(esw, num_vfs); + MLX5_NB_INIT(&esw->nb, eswitch_vport_event, NIC_VPORT_CHANGE); + mlx5_eq_notifier_register(esw->dev, &esw->nb); + if (esw->mode == MLX5_ESWITCH_LEGACY) { err = esw_legacy_enable(esw); } else { @@ -1431,7 +1429,7 @@ esw->fdb_table.flags |= MLX5_ESW_FDB_CREATED; - mlx5_eswitch_event_handlers_register(esw); + mlx5_eswitch_event_handler_register(esw); esw_info(esw->dev, "Enable: mode(%s), nvfs(%d), necvfs(%d), active vports(%d)\n", esw->mode == MLX5_ESWITCH_LEGACY ? "LEGACY" : "OFFLOADS", @@ -1558,7 +1556,8 @@ */ mlx5_esw_mode_change_notify(esw, MLX5_ESWITCH_LEGACY); - mlx5_eswitch_event_handlers_unregister(esw); + mlx5_eq_notifier_unregister(esw->dev, &esw->nb); + mlx5_eswitch_event_handler_unregister(esw); esw_info(esw->dev, "Disable: mode(%s), nvfs(%d), necvfs(%d), active vports(%d)\n", esw->mode == MLX5_ESWITCH_LEGACY ? "LEGACY" : "OFFLOADS", diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c @@ -384,7 +384,12 @@ static int mlx5_ptp_adjphase(struct ptp_clock_info *ptp, s32 delta) { - return mlx5_ptp_adjtime(ptp, delta); + struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock, ptp_info); + struct mlx5_core_dev *mdev; + + mdev = container_of(clock, struct mlx5_core_dev, clock); + + return mlx5_ptp_adjtime_real_time(mdev, delta); } static int mlx5_ptp_freq_adj_real_time(struct mlx5_core_dev *mdev, long scaled_ppm) diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/pensando/ionic/ionic_dev.h linux-aws-6.5-6.5.0/drivers/net/ethernet/pensando/ionic/ionic_dev.h --- linux-aws-6.5-6.5.0/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -222,7 +222,7 @@ void *cb_arg; }; -#define IONIC_QUEUE_NAME_MAX_SZ 32 +#define IONIC_QUEUE_NAME_MAX_SZ 16 struct ionic_queue { struct device *dev; diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/realtek/r8169_main.c linux-aws-6.5-6.5.0/drivers/net/ethernet/realtek/r8169_main.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/realtek/r8169_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/realtek/r8169_main.c @@ -196,6 +196,7 @@ /* No threshold before first PCI xfer */ #define RX_FIFO_THRESH (7 << RXCFG_FIFO_SHIFT) #define RX_EARLY_OFF (1 << 11) +#define RX_PAUSE_SLOT_ON (1 << 11) /* 8125b and later */ #define RXCFG_DMA_SHIFT 8 /* Unlimited maximum PCI burst. */ #define RX_DMA_BURST (7 << RXCFG_DMA_SHIFT) @@ -579,6 +580,7 @@ enum rtl_flag { RTL_FLAG_TASK_ENABLED = 0, RTL_FLAG_TASK_RESET_PENDING, + RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE, RTL_FLAG_TASK_TX_TIMEOUT, RTL_FLAG_MAX }; @@ -2305,9 +2307,13 @@ case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_53: RTL_W32(tp, RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST | RX_EARLY_OFF); break; - case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_63: + case RTL_GIGA_MAC_VER_61: RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST); break; + case RTL_GIGA_MAC_VER_63: + RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST | + RX_PAUSE_SLOT_ON); + break; default: RTL_W32(tp, RxConfig, RX128_INT_EN | RX_DMA_BURST); break; @@ -2595,6 +2601,8 @@ if (dev->flags & IFF_PROMISC) { rx_mode |= AcceptAllPhys; + } else if (!(dev->flags & IFF_MULTICAST)) { + rx_mode &= ~AcceptMulticast; } else if (netdev_mc_count(dev) > MC_FILTER_LIMIT || dev->flags & IFF_ALLMULTI || tp->mac_version == RTL_GIGA_MAC_VER_35) { @@ -4377,7 +4385,7 @@ unsigned int entry = dirty_tx % NUM_TX_DESC; u32 status; - status = le32_to_cpu(tp->TxDescArray[entry].opts1); + status = le32_to_cpu(READ_ONCE(tp->TxDescArray[entry].opts1)); if (status & DescOwn) break; @@ -4407,7 +4415,7 @@ * If skb is NULL then we come here again once a tx irq is * triggered after the last fragment is marked transmitted. */ - if (tp->cur_tx != dirty_tx && skb) + if (READ_ONCE(tp->cur_tx) != dirty_tx && skb) rtl8169_doorbell(tp); } } @@ -4440,7 +4448,7 @@ dma_addr_t addr; u32 status; - status = le32_to_cpu(desc->opts1); + status = le32_to_cpu(READ_ONCE(desc->opts1)); if (status & DescOwn) break; @@ -4580,6 +4588,8 @@ reset: rtl_reset_work(tp); netif_wake_queue(tp->dev); + } else if (test_and_clear_bit(RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE, tp->wk.flags)) { + rtl_reset_work(tp); } out_unlock: rtnl_unlock(); @@ -4609,7 +4619,11 @@ if (netif_carrier_ok(ndev)) { rtl_link_chg_patch(tp); pm_request_resume(d); + netif_wake_queue(tp->dev); } else { + /* In few cases rx is broken after link-down otherwise */ + if (rtl_is_8125(tp)) + rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE); pm_runtime_idle(d); } @@ -4685,7 +4699,7 @@ rtl8169_down(tp); rtl8169_rx_clear(tp); - cancel_work_sync(&tp->wk.work); + cancel_work(&tp->wk.work); free_irq(tp->irq, tp); @@ -4919,6 +4933,8 @@ if (pci_dev_run_wake(pdev)) pm_runtime_get_noresume(&pdev->dev); + cancel_work_sync(&tp->wk.work); + unregister_netdev(tp->dev); if (tp->dash_type != RTL_DASH_NONE) diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/renesas/ravb_main.c linux-aws-6.5-6.5.0/drivers/net/ethernet/renesas/ravb_main.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/renesas/ravb_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/renesas/ravb_main.c @@ -516,6 +516,15 @@ { struct ravb_private *priv = netdev_priv(ndev); + if (priv->phy_interface == PHY_INTERFACE_MODE_MII) { + ravb_write(ndev, (1000 << 16) | CXR35_SEL_XMII_MII, CXR35); + ravb_modify(ndev, CXR31, CXR31_SEL_LINK0 | CXR31_SEL_LINK1, 0); + } else { + ravb_write(ndev, (1000 << 16) | CXR35_SEL_XMII_RGMII, CXR35); + ravb_modify(ndev, CXR31, CXR31_SEL_LINK0 | CXR31_SEL_LINK1, + CXR31_SEL_LINK0); + } + /* Receive frame limit set register */ ravb_write(ndev, GBETH_RX_BUFF_MAX + ETH_FCS_LEN, RFLR); @@ -538,14 +547,6 @@ /* E-MAC interrupt enable register */ ravb_write(ndev, ECSIPR_ICDIP, ECSIPR); - - if (priv->phy_interface == PHY_INTERFACE_MODE_MII) { - ravb_modify(ndev, CXR31, CXR31_SEL_LINK0 | CXR31_SEL_LINK1, 0); - ravb_write(ndev, (1000 << 16) | CXR35_SEL_XMII_MII, CXR35); - } else { - ravb_modify(ndev, CXR31, CXR31_SEL_LINK0 | CXR31_SEL_LINK1, - CXR31_SEL_LINK0); - } } static void ravb_emac_init_rcar(struct net_device *ndev) @@ -1812,19 +1813,20 @@ if (info->gptp) ravb_ptp_init(ndev, priv->pdev); - netif_tx_start_all_queues(ndev); - /* PHY control start */ error = ravb_phy_start(ndev); if (error) goto out_ptp_stop; + netif_tx_start_all_queues(ndev); + return 0; out_ptp_stop: /* Stop PTP Clock driver */ if (info->gptp) ravb_ptp_stop(ndev); + ravb_stop_dma(ndev); out_free_irq_mgmta: if (!info->multi_irqs) goto out_free_irq; @@ -1875,6 +1877,12 @@ struct net_device *ndev = priv->ndev; int error; + if (!rtnl_trylock()) { + usleep_range(1000, 2000); + schedule_work(&priv->work); + return; + } + netif_tx_stop_all_queues(ndev); /* Stop PTP Clock driver */ @@ -1908,7 +1916,7 @@ */ netdev_err(ndev, "%s: ravb_dmac_init() failed, error %d\n", __func__, error); - return; + goto out_unlock; } ravb_emac_init(ndev); @@ -1918,6 +1926,9 @@ ravb_ptp_init(ndev, priv->pdev); netif_tx_start_all_queues(ndev); + +out_unlock: + rtnl_unlock(); } /* Packet transmit function for Ethernet AVB */ @@ -2646,9 +2657,14 @@ ndev->features = info->net_features; ndev->hw_features = info->net_hw_features; - reset_control_deassert(rstc); + error = reset_control_deassert(rstc); + if (error) + goto out_free_netdev; + pm_runtime_enable(&pdev->dev); - pm_runtime_get_sync(&pdev->dev); + error = pm_runtime_resume_and_get(&pdev->dev); + if (error < 0) + goto out_rpm_disable; if (info->multi_irqs) { if (info->err_mgmt_irqs) @@ -2873,11 +2889,12 @@ out_disable_refclk: clk_disable_unprepare(priv->refclk); out_release: - free_netdev(ndev); - pm_runtime_put(&pdev->dev); +out_rpm_disable: pm_runtime_disable(&pdev->dev); reset_control_assert(rstc); +out_free_netdev: + free_netdev(ndev); return error; } @@ -2887,22 +2904,26 @@ struct ravb_private *priv = netdev_priv(ndev); const struct ravb_hw_info *info = priv->info; - /* Stop PTP Clock driver */ - if (info->ccc_gac) - ravb_ptp_stop(ndev); - - clk_disable_unprepare(priv->gptp_clk); - clk_disable_unprepare(priv->refclk); - - /* Set reset mode */ - ravb_write(ndev, CCC_OPC_RESET, CCC); unregister_netdev(ndev); if (info->nc_queues) netif_napi_del(&priv->napi[RAVB_NC]); netif_napi_del(&priv->napi[RAVB_BE]); + ravb_mdio_release(priv); + + /* Stop PTP Clock driver */ + if (info->ccc_gac) + ravb_ptp_stop(ndev); + dma_free_coherent(ndev->dev.parent, priv->desc_bat_size, priv->desc_bat, priv->desc_bat_dma); + + /* Set reset mode */ + ravb_write(ndev, CCC_OPC_RESET, CCC); + + clk_disable_unprepare(priv->gptp_clk); + clk_disable_unprepare(priv->refclk); + pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); reset_control_assert(priv->rstc); diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/renesas/rswitch.c linux-aws-6.5-6.5.0/drivers/net/ethernet/renesas/rswitch.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/renesas/rswitch.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/renesas/rswitch.c @@ -1491,8 +1491,8 @@ { struct rswitch_device *rdev = netdev_priv(ndev); struct rswitch_gwca_queue *gq = rdev->tx_queue; + netdev_tx_t ret = NETDEV_TX_OK; struct rswitch_ext_desc *desc; - int ret = NETDEV_TX_OK; dma_addr_t dma_addr; if (rswitch_get_num_cur_queues(gq) >= gq->ring_size - 1) { @@ -1504,10 +1504,8 @@ return ret; dma_addr = dma_map_single(ndev->dev.parent, skb->data, skb->len, DMA_TO_DEVICE); - if (dma_mapping_error(ndev->dev.parent, dma_addr)) { - dev_kfree_skb_any(skb); - return ret; - } + if (dma_mapping_error(ndev->dev.parent, dma_addr)) + goto err_kfree; gq->skbs[gq->cur] = skb; desc = &gq->tx_ring[gq->cur]; @@ -1520,10 +1518,8 @@ struct rswitch_gwca_ts_info *ts_info; ts_info = kzalloc(sizeof(*ts_info), GFP_ATOMIC); - if (!ts_info) { - dma_unmap_single(ndev->dev.parent, dma_addr, skb->len, DMA_TO_DEVICE); - return -ENOMEM; - } + if (!ts_info) + goto err_unmap; skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; rdev->ts_tag++; @@ -1546,6 +1542,14 @@ rswitch_modify(rdev->addr, GWTRC(gq->index), 0, BIT(gq->index % 32)); return ret; + +err_unmap: + dma_unmap_single(ndev->dev.parent, dma_addr, skb->len, DMA_TO_DEVICE); + +err_kfree: + dev_kfree_skb_any(skb); + + return ret; } static struct net_device_stats *rswitch_get_stats(struct net_device *ndev) diff -u linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c --- linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -960,7 +960,8 @@ bool *hs_enable = &fpe_cfg->hs_enable; if (is_up && *hs_enable) { - stmmac_fpe_send_mpacket(priv, priv->ioaddr, MPACKET_VERIFY); + stmmac_fpe_send_mpacket(priv, priv->ioaddr, fpe_cfg, + MPACKET_VERIFY); } else { *lo_state = FPE_STATE_OFF; *lp_state = FPE_STATE_OFF; @@ -5223,6 +5224,7 @@ dma_dir = page_pool_get_dma_dir(rx_q->page_pool); buf_sz = DIV_ROUND_UP(priv->dma_conf.dma_buf_sz, PAGE_SIZE) * PAGE_SIZE; + limit = min(priv->dma_conf.dma_rx_size - 1, (unsigned int)limit); if (netif_msg_rx_status(priv)) { void *rx_head; @@ -5258,10 +5260,10 @@ len = 0; } +read_again: if (count >= limit) break; -read_again: buf1_len = 0; buf2_len = 0; entry = next_entry; @@ -5733,6 +5735,7 @@ /* If user has requested FPE enable, quickly response */ if (*hs_enable) stmmac_fpe_send_mpacket(priv, priv->ioaddr, + fpe_cfg, MPACKET_RESPONSE); } @@ -7029,6 +7032,7 @@ if (*lo_state == FPE_STATE_ENTERING_ON && *lp_state == FPE_STATE_ENTERING_ON) { stmmac_fpe_configure(priv, priv->ioaddr, + fpe_cfg, priv->plat->tx_queues_to_use, priv->plat->rx_queues_to_use, *enable); @@ -7047,6 +7051,7 @@ netdev_info(priv->dev, SEND_VERIFY_MPAKCET_FMT, *lo_state, *lp_state); stmmac_fpe_send_mpacket(priv, priv->ioaddr, + fpe_cfg, MPACKET_VERIFY); } /* Sleep then retry */ @@ -7061,6 +7066,7 @@ if (priv->plat->fpe_cfg->hs_enable != enable) { if (enable) { stmmac_fpe_send_mpacket(priv, priv->ioaddr, + priv->plat->fpe_cfg, MPACKET_VERIFY); } else { priv->plat->fpe_cfg->lo_fpe_state = FPE_STATE_OFF; @@ -7512,6 +7518,7 @@ if (priv->dma_cap.fpesel) { /* Disable FPE */ stmmac_fpe_configure(priv, priv->ioaddr, + priv->plat->fpe_cfg, priv->plat->tx_queues_to_use, priv->plat->rx_queues_to_use, false); diff -u linux-aws-6.5-6.5.0/drivers/net/macsec.c linux-aws-6.5-6.5.0/drivers/net/macsec.c --- linux-aws-6.5-6.5.0/drivers/net/macsec.c +++ linux-aws-6.5-6.5.0/drivers/net/macsec.c @@ -3668,9 +3668,9 @@ dev_fetch_sw_netstats(s, dev->tstats); - s->rx_dropped = atomic_long_read(&dev->stats.__rx_dropped); - s->tx_dropped = atomic_long_read(&dev->stats.__tx_dropped); - s->rx_errors = atomic_long_read(&dev->stats.__rx_errors); + s->rx_dropped = DEV_STATS_READ(dev, rx_dropped); + s->tx_dropped = DEV_STATS_READ(dev, tx_dropped); + s->rx_errors = DEV_STATS_READ(dev, rx_errors); } static int macsec_get_iflink(const struct net_device *dev) diff -u linux-aws-6.5-6.5.0/drivers/net/usb/r8152.c linux-aws-6.5-6.5.0/drivers/net/usb/r8152.c --- linux-aws-6.5-6.5.0/drivers/net/usb/r8152.c +++ linux-aws-6.5-6.5.0/drivers/net/usb/r8152.c @@ -764,7 +764,7 @@ /* rtl8152 flags */ enum rtl8152_flags { - RTL8152_UNPLUG = 0, + RTL8152_INACCESSIBLE = 0, RTL8152_SET_RX_MODE, WORK_ENABLE, RTL8152_LINK_CHG, @@ -1212,7 +1212,7 @@ ret = usb_control_msg(tp->udev, tp->pipe_ctrl_in, RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, - value, index, tmp, size, 500); + value, index, tmp, size, USB_CTRL_GET_TIMEOUT); if (ret < 0) memset(data, 0xff, size); else @@ -1235,7 +1235,7 @@ ret = usb_control_msg(tp->udev, tp->pipe_ctrl_out, RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, - value, index, tmp, size, 500); + value, index, tmp, size, USB_CTRL_SET_TIMEOUT); kfree(tmp); @@ -1245,7 +1245,7 @@ static void rtl_set_unplug(struct r8152 *tp) { if (tp->udev->state == USB_STATE_NOTATTACHED) { - set_bit(RTL8152_UNPLUG, &tp->flags); + set_bit(RTL8152_INACCESSIBLE, &tp->flags); smp_mb__after_atomic(); } } @@ -1256,7 +1256,7 @@ u16 limit = 64; int ret = 0; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return -ENODEV; /* both size and indix must be 4 bytes align */ @@ -1300,7 +1300,7 @@ u16 byteen_start, byteen_end, byen; u16 limit = 512; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return -ENODEV; /* both size and indix must be 4 bytes align */ @@ -1530,7 +1530,7 @@ struct r8152 *tp = netdev_priv(netdev); int ret; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return -ENODEV; if (phy_id != R8152_PHY_ID) @@ -1546,7 +1546,7 @@ { struct r8152 *tp = netdev_priv(netdev); - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; if (phy_id != R8152_PHY_ID) @@ -1751,7 +1751,7 @@ if (!tp) return; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; if (!test_bit(WORK_ENABLE, &tp->flags)) @@ -1843,7 +1843,7 @@ if (!test_bit(WORK_ENABLE, &tp->flags)) return; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; if (!skb_queue_empty(&tp->tx_queue)) @@ -1864,7 +1864,7 @@ if (!test_bit(WORK_ENABLE, &tp->flags)) return; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; switch (status) { @@ -2608,7 +2608,7 @@ { struct r8152 *tp = from_tasklet(tp, t, tx_tl); - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; if (!test_bit(WORK_ENABLE, &tp->flags)) @@ -2651,7 +2651,7 @@ int ret; /* The rx would be stopped, so skip submitting */ - if (test_bit(RTL8152_UNPLUG, &tp->flags) || + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || !test_bit(WORK_ENABLE, &tp->flags) || !netif_carrier_ok(tp->netdev)) return 0; @@ -2858,6 +2858,8 @@ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, CR_RST); for (i = 0; i < 1000; i++) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; if (!(ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CR) & CR_RST)) break; usleep_range(100, 400); @@ -3051,7 +3053,7 @@ static int rtl8152_enable(struct r8152 *tp) { - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return -ENODEV; set_tx_qlen(tp); @@ -3138,7 +3140,7 @@ { u32 ocp_data; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return -ENODEV; set_tx_qlen(tp); @@ -3170,7 +3172,7 @@ u32 ocp_data; int i; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { rtl_drop_queued_tx(tp); return; } @@ -3187,6 +3189,8 @@ rxdy_gated_en(tp, true); for (i = 0; i < 1000; i++) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); if ((ocp_data & FIFO_EMPTY) == FIFO_EMPTY) break; @@ -3194,6 +3198,8 @@ } for (i = 0; i < 1000; i++) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0) & TCR0_TX_EMPTY) break; usleep_range(1000, 2000); @@ -3624,7 +3630,7 @@ } msleep(20); - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) break; } @@ -3656,6 +3662,8 @@ int i; for (i = 0; i < 500; i++) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & AUTOLOAD_DONE) break; @@ -3696,6 +3704,8 @@ int i; for (i = 0; i < 500; i++) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & AUTOLOAD_DONE) break; @@ -4059,6 +4069,9 @@ for (i = 0; wait && i < 5000; i++) { u32 ocp_data; + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + usleep_range(1000, 2000); ocp_data = ocp_reg_read(tp, OCP_PHY_PATCH_STAT); if ((ocp_data & PATCH_READY) ^ check) @@ -5375,6 +5388,8 @@ int i; for (i = 0; i < 1000; i++) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); if (ocp_data & LINK_LIST_READY) break; @@ -5389,6 +5404,8 @@ int i; for (i = 0; i < 100; i++) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; if (ocp_read_word(tp, MCU_TYPE_USB, USB_GPHY_CTRL) & GPHY_PATCH_DONE) break; usleep_range(1000, 2000); @@ -5511,6 +5528,8 @@ for (i = 0; i < 104; i++) { u32 ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_WDT1_CTRL); + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; if (!(ocp_data & WTD1_EN)) break; usleep_range(1000, 2000); @@ -5667,6 +5686,8 @@ data &= ~EN_ALDPS; ocp_reg_write(tp, OCP_POWER_CFG, data); for (i = 0; i < 20; i++) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; usleep_range(1000, 2000); if (ocp_read_word(tp, MCU_TYPE_PLA, 0xe000) & 0x0100) break; @@ -6020,7 +6041,7 @@ u32 ocp_data; u16 speed; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return -ENODEV; r8156_fc_parameter(tp); @@ -6078,7 +6099,7 @@ u32 ocp_data; u16 speed; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return -ENODEV; set_tx_qlen(tp); @@ -6264,7 +6285,7 @@ static void rtl8152_up(struct r8152 *tp) { - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; r8152_aldps_en(tp, false); @@ -6274,7 +6295,7 @@ static void rtl8152_down(struct r8152 *tp) { - if (test_bit(RTL8152_UNPLUG, &tp->flags)) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { rtl_drop_queued_tx(tp); return; } @@ -6289,7 +6310,7 @@ { u32 ocp_data; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; r8153_u1u2en(tp, false); @@ -6329,7 +6350,7 @@ { u32 ocp_data; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { rtl_drop_queued_tx(tp); return; } @@ -6350,7 +6371,7 @@ { u32 ocp_data; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; r8153b_u1u2en(tp, false); @@ -6374,7 +6395,7 @@ { u32 ocp_data; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { rtl_drop_queued_tx(tp); return; } @@ -6411,7 +6432,7 @@ { u32 ocp_data; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; r8153b_u1u2en(tp, false); @@ -6492,7 +6513,7 @@ { u32 ocp_data; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; r8153b_u1u2en(tp, false); @@ -6565,7 +6586,7 @@ { u32 ocp_data; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) { + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { rtl_drop_queued_tx(tp); return; } @@ -6703,7 +6724,7 @@ /* If the device is unplugged or !netif_running(), the workqueue * doesn't need to wake the device, and could return directly. */ - if (test_bit(RTL8152_UNPLUG, &tp->flags) || !netif_running(tp->netdev)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || !netif_running(tp->netdev)) return; if (usb_autopm_get_interface(tp->intf) < 0) @@ -6742,7 +6763,7 @@ { struct r8152 *tp = container_of(work, struct r8152, hw_phy_work.work); - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; if (usb_autopm_get_interface(tp->intf) < 0) @@ -6869,7 +6890,7 @@ netif_stop_queue(netdev); res = usb_autopm_get_interface(tp->intf); - if (res < 0 || test_bit(RTL8152_UNPLUG, &tp->flags)) { + if (res < 0 || test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { rtl_drop_queued_tx(tp); rtl_stop_rx(tp); } else { @@ -6902,7 +6923,7 @@ u32 ocp_data; u16 data; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; data = r8152_mdio_read(tp, MII_BMCR); @@ -6946,7 +6967,7 @@ u16 data; int i; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; r8153_u1u2en(tp, false); @@ -6957,7 +6978,7 @@ break; msleep(20); - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) break; } @@ -7086,7 +7107,7 @@ u16 data; int i; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; r8153b_u1u2en(tp, false); @@ -7097,7 +7118,7 @@ break; msleep(20); - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) break; } @@ -7168,7 +7189,7 @@ u16 data; int i; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; r8153b_u1u2en(tp, false); @@ -7188,7 +7209,7 @@ break; msleep(20); - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; } @@ -8017,7 +8038,7 @@ u16 data; int i; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); @@ -8038,7 +8059,7 @@ break; msleep(20); - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; } @@ -8113,7 +8134,7 @@ u16 data; int i; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); @@ -8147,7 +8168,7 @@ break; msleep(20); - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; } @@ -8273,6 +8294,8 @@ struct r8152 *tp = usb_get_intfdata(intf); struct net_device *netdev; + rtnl_lock(); + if (!tp) return 0; @@ -8302,18 +8325,15 @@ struct sockaddr sa; if (!tp) - return 0; + goto exit; /* reset the MAC address in case of policy change */ - if (determine_ethernet_addr(tp, &sa) >= 0) { - rtnl_lock(); + if (determine_ethernet_addr(tp, &sa) >= 0) dev_set_mac_address (tp->netdev, &sa, NULL); - rtnl_unlock(); - } netdev = tp->netdev; if (!netif_running(netdev)) - return 0; + goto exit; set_bit(WORK_ENABLE, &tp->flags); if (netif_carrier_ok(netdev)) { @@ -8332,6 +8352,8 @@ if (!list_empty(&tp->rx_done)) napi_schedule(&tp->napi); +exit: + rtnl_unlock(); return 0; } @@ -9176,7 +9198,7 @@ struct mii_ioctl_data *data = if_mii(rq); int res; - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return -ENODEV; res = usb_autopm_get_interface(tp->intf); @@ -9278,7 +9300,7 @@ static void rtl8152_unload(struct r8152 *tp) { - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; if (tp->version != RTL_VER_01) @@ -9287,7 +9309,7 @@ static void rtl8153_unload(struct r8152 *tp) { - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; r8153_power_cut_en(tp, false); @@ -9295,7 +9317,7 @@ static void rtl8153b_unload(struct r8152 *tp) { - if (test_bit(RTL8152_UNPLUG, &tp->flags)) + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) return; r8153b_power_cut_en(tp, false); @@ -9512,7 +9534,8 @@ ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, - PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), 500); + PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), + USB_CTRL_GET_TIMEOUT); if (ret > 0) ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; @@ -9801,6 +9824,10 @@ out1: tasklet_kill(&tp->tx_tl); + cancel_delayed_work_sync(&tp->hw_phy_work); + if (tp->rtl_ops.unload) + tp->rtl_ops.unload(tp); + rtl8152_release_firmware(tp); usb_set_intfdata(intf, NULL); out: free_netdev(netdev); diff -u linux-aws-6.5-6.5.0/drivers/net/veth.c linux-aws-6.5-6.5.0/drivers/net/veth.c --- linux-aws-6.5-6.5.0/drivers/net/veth.c +++ linux-aws-6.5-6.5.0/drivers/net/veth.c @@ -236,8 +236,8 @@ data[tx_idx + j] += *(u64 *)(base + offset); } } while (u64_stats_fetch_retry(&rq_stats->syncp, start)); - pp_idx = tx_idx + VETH_TQ_STATS_LEN; } + pp_idx = idx + dev->real_num_tx_queues * VETH_TQ_STATS_LEN; page_pool_stats: veth_get_page_pool_stats(dev, &data[pp_idx]); @@ -373,7 +373,7 @@ skb_tx_timestamp(skb); if (likely(veth_forward_skb(rcv, skb, rq, use_napi) == NET_RX_SUCCESS)) { if (!use_napi) - dev_lstats_add(dev, length); + dev_sw_netstats_tx_add(dev, 1, length); } else { drop: atomic64_inc(&priv->dropped); @@ -390,10 +390,2 @@ -static u64 veth_stats_tx(struct net_device *dev, u64 *packets, u64 *bytes) -{ - struct veth_priv *priv = netdev_priv(dev); - - dev_lstats_read(dev, packets, bytes); - return atomic64_read(&priv->dropped); -} - static void veth_stats_rx(struct veth_stats *result, struct net_device *dev) @@ -433,24 +425,24 @@ struct veth_priv *priv = netdev_priv(dev); struct net_device *peer; struct veth_stats rx; - u64 packets, bytes; - tot->tx_dropped = veth_stats_tx(dev, &packets, &bytes); - tot->tx_bytes = bytes; - tot->tx_packets = packets; + tot->tx_dropped = atomic64_read(&priv->dropped); + dev_fetch_sw_netstats(tot, dev->tstats); veth_stats_rx(&rx, dev); tot->tx_dropped += rx.xdp_tx_err; tot->rx_dropped = rx.rx_drops + rx.peer_tq_xdp_xmit_err; - tot->rx_bytes = rx.xdp_bytes; - tot->rx_packets = rx.xdp_packets; + tot->rx_bytes += rx.xdp_bytes; + tot->rx_packets += rx.xdp_packets; rcu_read_lock(); peer = rcu_dereference(priv->peer); if (peer) { - veth_stats_tx(peer, &packets, &bytes); - tot->rx_bytes += bytes; - tot->rx_packets += packets; + struct rtnl_link_stats64 tot_peer = {}; + + dev_fetch_sw_netstats(&tot_peer, peer->tstats); + tot->rx_bytes += tot_peer.tx_bytes; + tot->rx_packets += tot_peer.tx_packets; veth_stats_rx(&rx, peer); tot->tx_dropped += rx.peer_tq_xdp_xmit_err; @@ -1500,25 +1492,12 @@ static int veth_dev_init(struct net_device *dev) { - int err; - - dev->lstats = netdev_alloc_pcpu_stats(struct pcpu_lstats); - if (!dev->lstats) - return -ENOMEM; - - err = veth_alloc_queues(dev); - if (err) { - free_percpu(dev->lstats); - return err; - } - - return 0; + return veth_alloc_queues(dev); } static void veth_dev_free(struct net_device *dev) { veth_free_queues(dev); - free_percpu(dev->lstats); } #ifdef CONFIG_NET_POLL_CONTROLLER @@ -1790,6 +1769,7 @@ NETIF_F_HW_VLAN_STAG_RX); dev->needs_free_netdev = true; dev->priv_destructor = veth_dev_free; + dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS; dev->max_mtu = ETH_MAX_MTU; dev->hw_features = VETH_FEATURES; diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath11k/dp_rx.c linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath11k/dp_rx.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath11k/dp_rx.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -1621,14 +1621,20 @@ u8 pdev_id; pdev_id = FIELD_GET(HTT_T2H_PPDU_STATS_INFO_PDEV_ID, data->hdr); + + rcu_read_lock(); + ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_id); if (!ar) { ath11k_warn(ab, "invalid pdev id %d on htt pktlog\n", pdev_id); - return; + goto out; } trace_ath11k_htt_pktlog(ar, data->payload, hdr->size, ar->ab->pktlog_defs_checksum); + +out: + rcu_read_unlock(); } static void ath11k_htt_backpressure_event_handler(struct ath11k_base *ab, diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath11k/pci.c linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath11k/pci.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath11k/pci.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath11k/pci.c @@ -853,10 +853,16 @@ if (ret) goto err_pci_disable_msi; + ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0)); + if (ret) { + ath11k_err(ab, "failed to set irq affinity %d\n", ret); + goto err_pci_disable_msi; + } + ret = ath11k_mhi_register(ab_pci); if (ret) { ath11k_err(ab, "failed to register mhi: %d\n", ret); - goto err_pci_disable_msi; + goto err_irq_affinity_cleanup; } ret = ath11k_hal_srng_init(ab); @@ -877,12 +883,6 @@ goto err_ce_free; } - ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0)); - if (ret) { - ath11k_err(ab, "failed to set irq affinity %d\n", ret); - goto err_free_irq; - } - /* kernel may allocate a dummy vector before request_irq and * then allocate a real vector when request_irq is called. * So get msi_data here again to avoid spurious interrupt @@ -891,19 +891,16 @@ ret = ath11k_pci_config_msi_data(ab_pci); if (ret) { ath11k_err(ab, "failed to config msi_data: %d\n", ret); - goto err_irq_affinity_cleanup; + goto err_free_irq; } ret = ath11k_core_init(ab); if (ret) { ath11k_err(ab, "failed to init core: %d\n", ret); - goto err_irq_affinity_cleanup; + goto err_free_irq; } return 0; -err_irq_affinity_cleanup: - ath11k_pci_set_irq_affinity_hint(ab_pci, NULL); - err_free_irq: ath11k_pcic_free_irq(ab); @@ -916,6 +913,9 @@ err_mhi_unregister: ath11k_mhi_unregister(ab_pci); +err_irq_affinity_cleanup: + ath11k_pci_set_irq_affinity_hint(ab_pci, NULL); + err_pci_disable_msi: ath11k_pci_free_msi(ab_pci); diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/dp.c linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/dp.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/dp.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/dp.c @@ -38,6 +38,7 @@ ath12k_dp_rx_peer_tid_cleanup(ar, peer); crypto_free_shash(peer->tfm_mmic); + peer->dp_setup_done = false; spin_unlock_bh(&ab->base_lock); } diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/wmi.c linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/wmi.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/wmi.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/wmi.c @@ -3799,6 +3799,12 @@ ath12k_warn(soc, "failed to extract reg cap %d\n", i); return ret; } + + if (reg_cap.phy_id >= MAX_RADIOS) { + ath12k_warn(soc, "unexpected phy id %u\n", reg_cap.phy_id); + return -EINVAL; + } + soc->hal_reg_cap[reg_cap.phy_id] = reg_cap; } return 0; @@ -6228,6 +6234,8 @@ ev->detector_id, ev->segment_id, ev->timestamp, ev->is_chirp, ev->freq_offset, ev->sidx); + rcu_read_lock(); + ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(ev->pdev_id)); if (!ar) { @@ -6245,6 +6253,8 @@ ieee80211_radar_detected(ar->hw); exit: + rcu_read_unlock(); + kfree(tb); } @@ -6263,11 +6273,16 @@ ath12k_dbg(ab, ATH12K_DBG_WMI, "pdev temperature ev temp %d pdev_id %d\n", ev.temp, ev.pdev_id); + rcu_read_lock(); + ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(ev.pdev_id)); if (!ar) { ath12k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev.pdev_id); - return; + goto exit; } + +exit: + rcu_read_unlock(); } static void ath12k_fils_discovery_event(struct ath12k_base *ab, diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath9k/htc_drv_debug.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath9k/htc_drv_debug.c @@ -428,7 +428,7 @@ u32 sset, u8 *data) { if (sset == ETH_SS_STATS) - memcpy(data, *ath9k_htc_gstrings_stats, + memcpy(data, ath9k_htc_gstrings_stats, sizeof(ath9k_htc_gstrings_stats)); } diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -56,43 +56,15 @@ IEEE80211_VIF_SUPPORTS_CQM_RSSI; } - /* - * P2P_DEVICE interface does not have a channel context assigned to it, - * so a dedicated PHY context is allocated to it and the corresponding - * MAC context is bound to it at this stage. - */ - if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { - mvmvif->deflink.phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); - if (!mvmvif->deflink.phy_ctxt) { - ret = -ENOSPC; - goto out_free_bf; - } - - iwl_mvm_phy_ctxt_ref(mvm, mvmvif->deflink.phy_ctxt); - ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf); - if (ret) - goto out_unref_phy; - - ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, - LINK_CONTEXT_MODIFY_ACTIVE | - LINK_CONTEXT_MODIFY_RATES_INFO, - true); - if (ret) - goto out_remove_link; - - ret = iwl_mvm_mld_add_bcast_sta(mvm, vif, &vif->bss_conf); - if (ret) - goto out_remove_link; + ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf); + if (ret) + goto out_free_bf; - /* Save a pointer to p2p device vif, so it can later be used to - * update the p2p device MAC when a GO is started/stopped - */ + /* Save a pointer to p2p device vif, so it can later be used to + * update the p2p device MAC when a GO is started/stopped + */ + if (vif->type == NL80211_IFTYPE_P2P_DEVICE) mvm->p2p_device_vif = vif; - } else { - ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf); - if (ret) - goto out_free_bf; - } ret = iwl_mvm_power_update_mac(mvm); if (ret) @@ -119,10 +91,6 @@ goto out_unlock; - out_remove_link: - iwl_mvm_disable_link(mvm, vif, &vif->bss_conf); - out_unref_phy: - iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); out_free_bf: if (mvm->bf_allowed_vif == mvmvif) { mvm->bf_allowed_vif = NULL; @@ -130,7 +98,6 @@ IEEE80211_VIF_SUPPORTS_CQM_RSSI); } out_remove_mac: - mvmvif->deflink.phy_ctxt = NULL; mvmvif->link[0] = NULL; iwl_mvm_mld_mac_ctxt_remove(mvm, vif); out_unlock: @@ -185,14 +152,18 @@ iwl_mvm_power_update_mac(mvm); + /* Before the interface removal, mac80211 would cancel the ROC, and the + * ROC worker would be scheduled if needed. The worker would be flushed + * in iwl_mvm_prepare_mac_removal() and thus at this point the link is + * not active. So need only to remove the link. + */ if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { + if (mvmvif->deflink.phy_ctxt) { + iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); + mvmvif->deflink.phy_ctxt = NULL; + } mvm->p2p_device_vif = NULL; - - /* P2P device uses only one link */ - iwl_mvm_mld_rm_bcast_sta(mvm, vif, &vif->bss_conf); - iwl_mvm_disable_link(mvm, vif, &vif->bss_conf); - iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); - mvmvif->deflink.phy_ctxt = NULL; + iwl_mvm_remove_link(mvm, vif, &vif->bss_conf); } else { iwl_mvm_disable_link(mvm, vif, &vif->bss_conf); } @@ -653,7 +624,7 @@ } /* Update EHT Puncturing info */ - if (changes & BSS_CHANGED_EHT_PUNCTURING && vif->cfg.assoc && has_eht) + if (changes & BSS_CHANGED_EHT_PUNCTURING && vif->cfg.assoc) link_changes |= LINK_CONTEXT_MODIFY_EHT_PARAMS; if (link_changes) { @@ -968,36 +939,29 @@ return 0; } -static int iwl_mvm_link_switch_phy_ctx(struct iwl_mvm *mvm, - struct ieee80211_vif *vif, - struct iwl_mvm_phy_ctxt *new_phy_ctxt) +static int iwl_mvm_mld_roc_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif) { - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); - int ret = 0; + int ret; lockdep_assert_held(&mvm->mutex); - /* Inorder to change the phy_ctx of a link, the link needs to be - * inactive. Therefore, first deactivate the link, then change its - * phy_ctx, and then activate it again. - */ - ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, - LINK_CONTEXT_MODIFY_ACTIVE, false); - if (WARN(ret, "Failed to deactivate link\n")) + /* The PHY context ID might have changed so need to set it */ + ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, 0, false); + if (WARN(ret, "Failed to set PHY context ID\n")) return ret; - iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); - - mvmvif->deflink.phy_ctxt = new_phy_ctxt; + ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, + LINK_CONTEXT_MODIFY_ACTIVE | + LINK_CONTEXT_MODIFY_RATES_INFO, + true); - ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, 0, false); - if (WARN(ret, "Failed to deactivate link\n")) + if (WARN(ret, "Failed linking P2P_DEVICE\n")) return ret; - ret = iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, - LINK_CONTEXT_MODIFY_ACTIVE, true); - WARN(ret, "Failed binding P2P_DEVICE\n"); - return ret; + /* The station and queue allocation must be done only after the linking + * is done, as otherwise the FW might incorrectly configure its state. + */ + return iwl_mvm_mld_add_bcast_sta(mvm, vif, &vif->bss_conf); } static int iwl_mvm_mld_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, @@ -1006,7 +970,7 @@ { static const struct iwl_mvm_roc_ops ops = { .add_aux_sta_for_hs20 = iwl_mvm_mld_add_aux_sta, - .switch_phy_ctxt = iwl_mvm_link_switch_phy_ctx, + .link = iwl_mvm_mld_roc_link, }; return iwl_mvm_roc_common(hw, vif, channel, duration, type, &ops); @@ -1089,9 +1053,6 @@ } } - if (err) - goto out_err; - err = 0; if (new_links == 0) { mvmvif->link[0] = &mvmvif->deflink; diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/pcie/trans.c linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/pcie/trans.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/pcie/trans.c @@ -1263,6 +1263,7 @@ if (test_and_clear_bit(STATUS_DEVICE_ENABLED, &trans->status)) { IWL_DEBUG_INFO(trans, "DEVICE_ENABLED bit was set and is now cleared\n"); + iwl_pcie_synchronize_irqs(trans); iwl_pcie_rx_napi_sync(trans); iwl_pcie_tx_stop(trans); iwl_pcie_rx_stop(trans); diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c linux-aws-6.5-6.5.0/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c @@ -921,6 +921,14 @@ while (tlv_buf_left >= sizeof(*tlv_rxba)) { tlv_type = le16_to_cpu(tlv_rxba->header.type); tlv_len = le16_to_cpu(tlv_rxba->header.len); + if (size_add(sizeof(tlv_rxba->header), tlv_len) > tlv_buf_left) { + mwifiex_dbg(priv->adapter, WARN, + "TLV size (%zu) overflows event_buf buf_left=%d\n", + size_add(sizeof(tlv_rxba->header), tlv_len), + tlv_buf_left); + return; + } + if (tlv_type != TLV_TYPE_RXBA_SYNC) { mwifiex_dbg(priv->adapter, ERROR, "Wrong TLV id=0x%x\n", tlv_type); @@ -929,6 +937,14 @@ tlv_seq_num = le16_to_cpu(tlv_rxba->seq_num); tlv_bitmap_len = le16_to_cpu(tlv_rxba->bitmap_len); + if (size_add(sizeof(*tlv_rxba), tlv_bitmap_len) > tlv_buf_left) { + mwifiex_dbg(priv->adapter, WARN, + "TLV size (%zu) overflows event_buf buf_left=%d\n", + size_add(sizeof(*tlv_rxba), tlv_bitmap_len), + tlv_buf_left); + return; + } + mwifiex_dbg(priv->adapter, INFO, "%pM tid=%d seq_num=%d bitmap_len=%d\n", tlv_rxba->mac, tlv_rxba->tid, tlv_seq_num, diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/dma.c linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/dma.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/dma.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/dma.c @@ -330,9 +330,6 @@ if (e->txwi == DMA_DUMMY_DATA) e->txwi = NULL; - if (e->skb == DMA_DUMMY_DATA) - e->skb = NULL; - *prev_e = *e; memset(e, 0, sizeof(*e)); } diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c @@ -151,23 +151,6 @@ return; } - /* error path */ - if (e->skb == DMA_DUMMY_DATA) { - struct mt76_connac_txp_common *txp; - struct mt76_txwi_cache *t; - u16 token; - - txp = mt76_connac_txwi_to_txp(mdev, e->txwi); - if (is_mt76_fw_txp(mdev)) - token = le16_to_cpu(txp->fw.token); - else - token = le16_to_cpu(txp->hw.msdu_id[0]) & - ~MT_MSDU_ID_VALID; - - t = mt76_token_put(mdev, token); - e->skb = t ? t->skb : NULL; - } - if (e->skb) mt76_tx_complete_skb(mdev, e->wcid, e->skb); } diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/main.c linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/main.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -646,11 +646,13 @@ mt7915_update_bss_color(hw, vif, &info->he_bss_color); if (changed & (BSS_CHANGED_BEACON | - BSS_CHANGED_BEACON_ENABLED | - BSS_CHANGED_UNSOL_BCAST_PROBE_RESP | - BSS_CHANGED_FILS_DISCOVERY)) + BSS_CHANGED_BEACON_ENABLED)) mt7915_mcu_add_beacon(hw, vif, info->enable_beacon, changed); + if (changed & (BSS_CHANGED_UNSOL_BCAST_PROBE_RESP | + BSS_CHANGED_FILS_DISCOVERY)) + mt7915_mcu_add_inband_discov(dev, vif, changed); + if (set_bss_info == 0) mt7915_mcu_add_bss_info(phy, vif, false); if (set_sta == 0) diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -1012,13 +1012,13 @@ struct ieee80211_sta *sta, bool bfee) { struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; - int tx_ant = hweight8(phy->mt76->chainmask) - 1; + int sts = hweight16(phy->mt76->chainmask); if (vif->type != NL80211_IFTYPE_STATION && vif->type != NL80211_IFTYPE_AP) return false; - if (!bfee && tx_ant < 2) + if (!bfee && sts < 2) return false; if (sta->deflink.he_cap.has_he) { @@ -1879,10 +1879,9 @@ memcpy(buf + MT_TXD_SIZE, skb->data, skb->len); } -static void -mt7915_mcu_beacon_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vif, - struct sk_buff *rskb, struct bss_info_bcn *bcn, - u32 changed) +int +mt7915_mcu_add_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vif, + u32 changed) { #define OFFLOAD_TX_MODE_SU BIT(0) #define OFFLOAD_TX_MODE_MU BIT(1) @@ -1892,14 +1891,27 @@ struct cfg80211_chan_def *chandef = &mvif->phy->mt76->chandef; enum nl80211_band band = chandef->chan->band; struct mt76_wcid *wcid = &dev->mt76.global_wcid; + struct bss_info_bcn *bcn; struct bss_info_inband_discovery *discov; struct ieee80211_tx_info *info; - struct sk_buff *skb = NULL; - struct tlv *tlv; + struct sk_buff *rskb, *skb = NULL; + struct tlv *tlv, *sub_tlv; bool ext_phy = phy != &dev->phy; u8 *buf, interval; int len; + if (vif->bss_conf.nontransmitted) + return 0; + + rskb = __mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76, NULL, + MT7915_MAX_BSS_OFFLOAD_SIZE); + if (IS_ERR(rskb)) + return PTR_ERR(rskb); + + tlv = mt76_connac_mcu_add_tlv(rskb, BSS_INFO_OFFLOAD, sizeof(*bcn)); + bcn = (struct bss_info_bcn *)tlv; + bcn->enable = true; + if (changed & BSS_CHANGED_FILS_DISCOVERY && vif->bss_conf.fils_discovery.max_interval) { interval = vif->bss_conf.fils_discovery.max_interval; @@ -1910,27 +1922,29 @@ skb = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif); } - if (!skb) - return; + if (!skb) { + dev_kfree_skb(rskb); + return -EINVAL; + } info = IEEE80211_SKB_CB(skb); info->control.vif = vif; info->band = band; - info->hw_queue |= FIELD_PREP(MT_TX_HW_QUEUE_PHY, ext_phy); len = sizeof(*discov) + MT_TXD_SIZE + skb->len; len = (len & 0x3) ? ((len | 0x3) + 1) : len; - if (len > (MT7915_MAX_BSS_OFFLOAD_SIZE - rskb->len)) { + if (skb->len > MT7915_MAX_BEACON_SIZE) { dev_err(dev->mt76.dev, "inband discovery size limit exceed\n"); + dev_kfree_skb(rskb); dev_kfree_skb(skb); - return; + return -EINVAL; } - tlv = mt7915_mcu_add_nested_subtlv(rskb, BSS_INFO_BCN_DISCOV, - len, &bcn->sub_ntlv, &bcn->len); - discov = (struct bss_info_inband_discovery *)tlv; + sub_tlv = mt7915_mcu_add_nested_subtlv(rskb, BSS_INFO_BCN_DISCOV, + len, &bcn->sub_ntlv, &bcn->len); + discov = (struct bss_info_inband_discovery *)sub_tlv; discov->tx_mode = OFFLOAD_TX_MODE_SU; /* 0: UNSOL PROBE RESP, 1: FILS DISCOV */ discov->tx_type = !!(changed & BSS_CHANGED_FILS_DISCOVERY); @@ -1938,13 +1952,16 @@ discov->prob_rsp_len = cpu_to_le16(MT_TXD_SIZE + skb->len); discov->enable = true; - buf = (u8 *)tlv + sizeof(*discov); + buf = (u8 *)sub_tlv + sizeof(*discov); mt7915_mac_write_txwi(&dev->mt76, (__le32 *)buf, skb, wcid, 0, NULL, 0, changed); memcpy(buf + MT_TXD_SIZE, skb->data, skb->len); dev_kfree_skb(skb); + + return mt76_mcu_skb_send_msg(&phy->dev->mt76, rskb, + MCU_EXT_CMD(BSS_INFO_UPDATE), true); } int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif, @@ -1977,11 +1994,14 @@ goto out; skb = ieee80211_beacon_get_template(hw, vif, &offs, 0); - if (!skb) + if (!skb) { + dev_kfree_skb(rskb); return -EINVAL; + } - if (skb->len > MT7915_MAX_BEACON_SIZE - MT_TXD_SIZE) { + if (skb->len > MT7915_MAX_BEACON_SIZE) { dev_err(dev->mt76.dev, "Bcn size limit exceed\n"); + dev_kfree_skb(rskb); dev_kfree_skb(skb); return -EINVAL; } @@ -1994,11 +2014,6 @@ mt7915_mcu_beacon_cont(dev, vif, rskb, skb, bcn, &offs); dev_kfree_skb(skb); - if (changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP || - changed & BSS_CHANGED_FILS_DISCOVERY) - mt7915_mcu_beacon_inband_discov(dev, vif, rskb, - bcn, changed); - out: return mt76_mcu_skb_send_msg(&phy->dev->mt76, rskb, MCU_EXT_CMD(BSS_INFO_UPDATE), true); @@ -2687,10 +2702,10 @@ if (mt76_connac_spe_idx(phy->mt76->antenna_mask)) req.tx_path_num = fls(phy->mt76->antenna_mask); - if (cmd == MCU_EXT_CMD(SET_RX_PATH) || - dev->mt76.hw->conf.flags & IEEE80211_CONF_MONITOR) + if (phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR) req.switch_reason = CH_SWITCH_NORMAL; - else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) + else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL || + phy->mt76->hw->conf.flags & IEEE80211_CONF_IDLE) req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD; else if (!cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef, NL80211_IFTYPE_AP)) diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h --- linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h @@ -505,6 +505,8 @@ bool add); int mt7915_mcu_update_bss_color(struct mt7915_dev *dev, struct ieee80211_vif *vif, struct cfg80211_he_bss_color *he_bss_color); +int mt7915_mcu_add_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vif, + u32 changed); int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int enable, u32 changed); int mt7915_mcu_add_obss_spr(struct mt7915_phy *phy, struct ieee80211_vif *vif, diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/mac.c linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/mac.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/mac.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/mac.c @@ -611,7 +611,9 @@ case IEEE80211_STA_RX_BW_160: status->bw = RATE_INFO_BW_160; break; + /* rxv reports bw 320-1 and 320-2 separately */ case IEEE80211_STA_RX_BW_320: + case IEEE80211_STA_RX_BW_320 + 1: status->bw = RATE_INFO_BW_320; break; default: @@ -1168,11 +1170,9 @@ } txp->fw.token = cpu_to_le16(id); - if (test_bit(MT_WCID_FLAG_4ADDR, &wcid->flags)) - txp->fw.rept_wds_wcid = cpu_to_le16(wcid->idx); - else - txp->fw.rept_wds_wcid = cpu_to_le16(0xfff); - tx_info->skb = DMA_DUMMY_DATA; + txp->fw.rept_wds_wcid = cpu_to_le16(sta ? wcid->idx : 0xfff); + + tx_info->skb = NULL; /* pass partial skb header to fw */ tx_info->buf[1].len = MT_CT_PARSE_LEN; @@ -1228,7 +1228,7 @@ if (likely(t->skb->protocol != cpu_to_be16(ETH_P_PAE))) mt7996_tx_check_aggr(sta, txwi); } else { - wcid_idx = le32_get_bits(txwi[1], MT_TXD1_WLAN_IDX); + wcid_idx = le32_get_bits(txwi[9], MT_TXD9_WLAN_IDX); } __mt76_tx_complete_skb(mdev, wcid_idx, t->skb, free_list); diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -1916,7 +1916,7 @@ bcn->bcc_ie_pos = cpu_to_le16(offset - 3); } - buf = (u8 *)bcn + sizeof(*bcn) - MAX_BEACON_SIZE; + buf = (u8 *)bcn + sizeof(*bcn); mt7996_mac_write_txwi(dev, (__le32 *)buf, skb, wcid, NULL, 0, 0, BSS_CHANGED_BEACON); @@ -1934,26 +1934,22 @@ struct sk_buff *skb, *rskb; struct tlv *tlv; struct bss_bcn_content_tlv *bcn; + int len; rskb = __mt7996_mcu_alloc_bss_req(&dev->mt76, &mvif->mt76, - MT7996_BEACON_UPDATE_SIZE); + MT7996_MAX_BSS_OFFLOAD_SIZE); if (IS_ERR(rskb)) return PTR_ERR(rskb); - tlv = mt7996_mcu_add_uni_tlv(rskb, - UNI_BSS_INFO_BCN_CONTENT, sizeof(*bcn)); - bcn = (struct bss_bcn_content_tlv *)tlv; - bcn->enable = en; - - if (!en) - goto out; - skb = ieee80211_beacon_get_template(hw, vif, &offs, 0); - if (!skb) + if (!skb) { + dev_kfree_skb(rskb); return -EINVAL; + } - if (skb->len > MAX_BEACON_SIZE - MT_TXD_SIZE) { + if (skb->len > MT7996_MAX_BEACON_SIZE) { dev_err(dev->mt76.dev, "Bcn size limit exceed\n"); + dev_kfree_skb(rskb); dev_kfree_skb(skb); return -EINVAL; } @@ -1961,11 +1957,18 @@ info = IEEE80211_SKB_CB(skb); info->hw_queue |= FIELD_PREP(MT_TX_HW_QUEUE_PHY, phy->mt76->band_idx); + len = sizeof(*bcn) + MT_TXD_SIZE + skb->len; + tlv = mt7996_mcu_add_uni_tlv(rskb, UNI_BSS_INFO_BCN_CONTENT, len); + bcn = (struct bss_bcn_content_tlv *)tlv; + bcn->enable = en; + if (!en) + goto out; + mt7996_mcu_beacon_cont(dev, vif, rskb, skb, bcn, &offs); /* TODO: subtag - 11v MBSSID */ mt7996_mcu_beacon_cntdwn(vif, rskb, skb, &offs); - dev_kfree_skb(skb); out: + dev_kfree_skb(skb); return mt76_mcu_skb_send_msg(&phy->dev->mt76, rskb, MCU_WMWA_UNI_CMD(BSS_INFO_UPDATE), true); } @@ -1986,9 +1989,13 @@ struct sk_buff *rskb, *skb = NULL; struct tlv *tlv; u8 *buf, interval; + int len; + + if (vif->bss_conf.nontransmitted) + return 0; rskb = __mt7996_mcu_alloc_bss_req(&dev->mt76, &mvif->mt76, - MT7996_INBAND_FRAME_SIZE); + MT7996_MAX_BSS_OFFLOAD_SIZE); if (IS_ERR(rskb)) return PTR_ERR(rskb); @@ -2002,11 +2009,14 @@ skb = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif); } - if (!skb) + if (!skb) { + dev_kfree_skb(rskb); return -EINVAL; + } - if (skb->len > MAX_INBAND_FRAME_SIZE - MT_TXD_SIZE) { + if (skb->len > MT7996_MAX_BEACON_SIZE) { dev_err(dev->mt76.dev, "inband discovery size limit exceed\n"); + dev_kfree_skb(rskb); dev_kfree_skb(skb); return -EINVAL; } @@ -2016,7 +2026,9 @@ info->band = band; info->hw_queue |= FIELD_PREP(MT_TX_HW_QUEUE_PHY, phy->mt76->band_idx); - tlv = mt7996_mcu_add_uni_tlv(rskb, UNI_BSS_INFO_OFFLOAD, sizeof(*discov)); + len = sizeof(*discov) + MT_TXD_SIZE + skb->len; + + tlv = mt7996_mcu_add_uni_tlv(rskb, UNI_BSS_INFO_OFFLOAD, len); discov = (struct bss_inband_discovery_tlv *)tlv; discov->tx_mode = OFFLOAD_TX_MODE_SU; @@ -2027,7 +2039,7 @@ discov->enable = true; discov->wcid = cpu_to_le16(MT7996_WTBL_RESERVED); - buf = (u8 *)tlv + sizeof(*discov) - MAX_INBAND_FRAME_SIZE; + buf = (u8 *)tlv + sizeof(*discov); mt7996_mac_write_txwi(dev, (__le32 *)buf, skb, wcid, NULL, 0, 0, changed); @@ -2580,7 +2592,7 @@ e = (struct edca *)tlv; e->set = WMM_PARAM_SET; - e->queue = ac + mvif->mt76.wmm_idx * MT7996_MAX_WMM_SETS; + e->queue = ac; e->aifs = q->aifs; e->txop = cpu_to_le16(q->txop); @@ -2861,10 +2873,10 @@ .channel_band = ch_band[chandef->chan->band], }; - if (tag == UNI_CHANNEL_RX_PATH || - dev->mt76.hw->conf.flags & IEEE80211_CONF_MONITOR) + if (phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR) req.switch_reason = CH_SWITCH_NORMAL; - else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) + else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL || + phy->mt76->hw->conf.flags & IEEE80211_CONF_IDLE) req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD; else if (!cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef, NL80211_IFTYPE_AP)) @@ -3208,8 +3220,8 @@ tlv = mt7996_mcu_add_uni_tlv(skb, action, sizeof(*req_mod_en)); req_mod_en = (struct bf_mod_en_ctrl *)tlv; - req_mod_en->bf_num = 2; - req_mod_en->bf_bitmap = GENMASK(0, 0); + req_mod_en->bf_num = 3; + req_mod_en->bf_bitmap = GENMASK(2, 0); break; } default: @@ -3449,7 +3461,9 @@ int cmd) { struct { - u8 _rsv[4]; + /* fixed field */ + u8 bss; + u8 _rsv[3]; __le16 tag; __le16 len; @@ -3467,7 +3481,7 @@ u8 exponent; u8 is_ap; u8 agrt_params; - u8 __rsv2[135]; + u8 __rsv2[23]; } __packed req = { .tag = cpu_to_le16(UNI_CMD_TWT_ARGT_UPDATE), .len = cpu_to_le16(sizeof(req) - 4), @@ -3477,6 +3491,7 @@ .flowid = flow->id, .peer_id = cpu_to_le16(flow->wcid), .duration = flow->duration, + .bss = mvif->mt76.idx, .bss_idx = mvif->mt76.idx, .start_tsf = cpu_to_le64(flow->tsf), .mantissa = flow->mantissa, diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/realtek/rtw88/usb.c linux-aws-6.5-6.5.0/drivers/net/wireless/realtek/rtw88/usb.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/realtek/rtw88/usb.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/realtek/rtw88/usb.c @@ -628,8 +628,7 @@ for (i = 0; i < RTW_USB_RXCB_NUM; i++) { rxcb = &rtwusb->rx_cb[i]; - if (rxcb->rx_urb) - usb_kill_urb(rxcb->rx_urb); + usb_kill_urb(rxcb->rx_urb); } } @@ -640,10 +639,8 @@ for (i = 0; i < RTW_USB_RXCB_NUM; i++) { rxcb = &rtwusb->rx_cb[i]; - if (rxcb->rx_urb) { - usb_kill_urb(rxcb->rx_urb); - usb_free_urb(rxcb->rx_urb); - } + usb_kill_urb(rxcb->rx_urb); + usb_free_urb(rxcb->rx_urb); } } diff -u linux-aws-6.5-6.5.0/drivers/net/wireless/virtual/mac80211_hwsim.c linux-aws-6.5-6.5.0/drivers/net/wireless/virtual/mac80211_hwsim.c --- linux-aws-6.5-6.5.0/drivers/net/wireless/virtual/mac80211_hwsim.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -3170,7 +3170,7 @@ u32 sset, u8 *data) { if (sset == ETH_SS_STATS) - memcpy(data, *mac80211_hwsim_gstrings_stats, + memcpy(data, mac80211_hwsim_gstrings_stats, sizeof(mac80211_hwsim_gstrings_stats)); } diff -u linux-aws-6.5-6.5.0/drivers/nvme/host/core.c linux-aws-6.5-6.5.0/drivers/nvme/host/core.c --- linux-aws-6.5-6.5.0/drivers/nvme/host/core.c +++ linux-aws-6.5-6.5.0/drivers/nvme/host/core.c @@ -2026,6 +2026,13 @@ if (ret) return ret; + if (id->ncap == 0) { + /* namespace not allocated or attached */ + info->is_removed = true; + ret = -ENODEV; + goto error; + } + blk_mq_freeze_queue(ns->disk->queue); lbaf = nvme_lbaf_index(id->flbas); ns->lba_shift = id->lbaf[lbaf].ds; @@ -2083,6 +2090,8 @@ set_bit(NVME_NS_READY, &ns->flags); ret = 0; } + +error: kfree(id); return ret; } diff -u linux-aws-6.5-6.5.0/drivers/nvme/host/pci.c linux-aws-6.5-6.5.0/drivers/nvme/host/pci.c --- linux-aws-6.5-6.5.0/drivers/nvme/host/pci.c +++ linux-aws-6.5-6.5.0/drivers/nvme/host/pci.c @@ -2903,6 +2903,18 @@ if ((dmi_match(DMI_BOARD_VENDOR, "LENOVO")) && dmi_match(DMI_BOARD_NAME, "LNVNB161216")) return NVME_QUIRK_SIMPLE_SUSPEND; + } else if (pdev->vendor == 0x2646 && (pdev->device == 0x2263 || + pdev->device == 0x500f)) { + /* + * Exclude some Kingston NV1 and A2000 devices from + * NVME_QUIRK_SIMPLE_SUSPEND. Do a full suspend to save a + * lot fo energy with s2idle sleep on some TUXEDO platforms. + */ + if (dmi_match(DMI_BOARD_NAME, "NS5X_NS7XAU") || + dmi_match(DMI_BOARD_NAME, "NS5x_7xAU") || + dmi_match(DMI_BOARD_NAME, "NS5x_7xPU") || + dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1")) + return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND; } return 0; @@ -2933,7 +2945,9 @@ dev->dev = get_device(&pdev->dev); quirks |= check_vendor_combination_bug(pdev); - if (!noacpi && acpi_storage_d3(&pdev->dev)) { + if (!noacpi && + !(quirks & NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND) && + acpi_storage_d3(&pdev->dev)) { /* * Some systems use a bios work around to ask for D3 on * platforms that support kernel managed suspend. @@ -3329,7 +3343,8 @@ { PCI_VDEVICE(INTEL, 0x0a54), /* Intel P4500/P4600 */ .driver_data = NVME_QUIRK_STRIPE_SIZE | NVME_QUIRK_DEALLOCATE_ZEROES | - NVME_QUIRK_IGNORE_DEV_SUBNQN, }, + NVME_QUIRK_IGNORE_DEV_SUBNQN | + NVME_QUIRK_BOGUS_NID, }, { PCI_VDEVICE(INTEL, 0x0a55), /* Dell Express Flash P4600 */ .driver_data = NVME_QUIRK_STRIPE_SIZE | NVME_QUIRK_DEALLOCATE_ZEROES, }, diff -u linux-aws-6.5-6.5.0/drivers/of/dynamic.c linux-aws-6.5-6.5.0/drivers/of/dynamic.c --- linux-aws-6.5-6.5.0/drivers/of/dynamic.c +++ linux-aws-6.5-6.5.0/drivers/of/dynamic.c @@ -104,8 +104,9 @@ * * Returns the new state of a device based on the notifier used. * - * Return: 0 on device going from enabled to disabled, 1 on device - * going from disabled to enabled and -1 on no change. + * Return: OF_RECONFIG_CHANGE_REMOVE on device going from enabled to + * disabled, OF_RECONFIG_CHANGE_ADD on device going from disabled to + * enabled and OF_RECONFIG_NO_CHANGE on no change. */ int of_reconfig_get_state_change(unsigned long action, struct of_reconfig_data *pr) { diff -u linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pcie-qcom-ep.c linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pcie-qcom-ep.c --- linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pcie-qcom-ep.c +++ linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pcie-qcom-ep.c @@ -121,6 +121,7 @@ /* ELBI registers */ #define ELBI_SYS_STTS 0x08 +#define ELBI_CS2_ENABLE 0xa4 /* DBI registers */ #define DBI_CON_STATUS 0x44 @@ -253,6 +254,21 @@ disable_irq(pcie_ep->perst_irq); } +static void qcom_pcie_dw_write_dbi2(struct dw_pcie *pci, void __iomem *base, + u32 reg, size_t size, u32 val) +{ + struct qcom_pcie_ep *pcie_ep = to_pcie_ep(pci); + int ret; + + writel(1, pcie_ep->elbi + ELBI_CS2_ENABLE); + + ret = dw_pcie_write(pci->dbi_base2 + reg, size, val); + if (ret) + dev_err(pci->dev, "Failed to write DBI2 register (0x%x): %d\n", reg, ret); + + writel(0, pcie_ep->elbi + ELBI_CS2_ENABLE); +} + static int qcom_pcie_enable_resources(struct qcom_pcie_ep *pcie_ep) { int ret; @@ -451,6 +467,7 @@ .link_up = qcom_pcie_dw_link_up, .start_link = qcom_pcie_dw_start_link, .stop_link = qcom_pcie_dw_stop_link, + .write_dbi2 = qcom_pcie_dw_write_dbi2, }; static int qcom_pcie_ep_get_io_resources(struct platform_device *pdev, diff -u linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pcie-tegra194.c linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pcie-tegra194.c --- linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pcie-tegra194.c +++ linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pcie-tegra194.c @@ -9,6 +9,7 @@ * Author: Vidya Sagar */ +#include #include #include #include @@ -347,8 +348,7 @@ */ val = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA); if (val & PCI_EXP_LNKSTA_LBMS) { - current_link_width = (val & PCI_EXP_LNKSTA_NLW) >> - PCI_EXP_LNKSTA_NLW_SHIFT; + current_link_width = FIELD_GET(PCI_EXP_LNKSTA_NLW, val); if (pcie->init_link_width > current_link_width) { dev_warn(pci->dev, "PCIe link is bad, width reduced\n"); val = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + @@ -761,8 +761,7 @@ val_w = dw_pcie_readw_dbi(&pcie->pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA); - pcie->init_link_width = (val_w & PCI_EXP_LNKSTA_NLW) >> - PCI_EXP_LNKSTA_NLW_SHIFT; + pcie->init_link_width = FIELD_GET(PCI_EXP_LNKSTA_NLW, val_w); val_w = dw_pcie_readw_dbi(&pcie->pci, pcie->pcie_cap_base + PCI_EXP_LNKCTL); @@ -921,7 +920,7 @@ /* Configure Max lane width from DT */ val = dw_pcie_readl_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKCAP); val &= ~PCI_EXP_LNKCAP_MLW; - val |= (pcie->num_lanes << PCI_EXP_LNKSTA_NLW_SHIFT); + val |= FIELD_PREP(PCI_EXP_LNKCAP_MLW, pcie->num_lanes); dw_pcie_writel_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKCAP, val); /* Clear Slot Clock Configuration bit if SRNS configuration */ diff -u linux-aws-6.5-6.5.0/drivers/pci/controller/vmd.c linux-aws-6.5-6.5.0/drivers/pci/controller/vmd.c --- linux-aws-6.5-6.5.0/drivers/pci/controller/vmd.c +++ linux-aws-6.5-6.5.0/drivers/pci/controller/vmd.c @@ -525,8 +525,7 @@ base = vmd->cfgbar + PCIE_ECAM_OFFSET(bus, PCI_DEVFN(dev, 0), 0); - hdr_type = readb(base + PCI_HEADER_TYPE) & - PCI_HEADER_TYPE_MASK; + hdr_type = readb(base + PCI_HEADER_TYPE); functions = (hdr_type & 0x80) ? 8 : 1; for (fn = 0; fn < functions; fn++) { diff -u linux-aws-6.5-6.5.0/drivers/pci/pci.c linux-aws-6.5-6.5.0/drivers/pci/pci.c --- linux-aws-6.5-6.5.0/drivers/pci/pci.c +++ linux-aws-6.5-6.5.0/drivers/pci/pci.c @@ -732,15 +732,18 @@ { u16 vsec = 0; u32 header; + int ret; if (vendor != dev->vendor) return 0; while ((vsec = pci_find_next_ext_capability(dev, vsec, PCI_EXT_CAP_ID_VNDR))) { - if (pci_read_config_dword(dev, vsec + PCI_VNDR_HEADER, - &header) == PCIBIOS_SUCCESSFUL && - PCI_VNDR_HEADER_ID(header) == cap) + ret = pci_read_config_dword(dev, vsec + PCI_VNDR_HEADER, &header); + if (ret != PCIBIOS_SUCCESSFUL) + continue; + + if (PCI_VNDR_HEADER_ID(header) == cap) return vsec; } @@ -3743,14 +3746,14 @@ return 0; pci_read_config_dword(pdev, pos + PCI_REBAR_CAP, &cap); - cap &= PCI_REBAR_CAP_SIZES; + cap = FIELD_GET(PCI_REBAR_CAP_SIZES, cap); /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */ if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f && - bar == 0 && cap == 0x7000) - cap = 0x3f000; + bar == 0 && cap == 0x700) + return 0x3f00; - return cap >> 4; + return cap; } EXPORT_SYMBOL(pci_rebar_get_possible_sizes); @@ -6252,8 +6255,7 @@ pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &lnksta); next_speed = pcie_link_speed[lnksta & PCI_EXP_LNKSTA_CLS]; - next_width = (lnksta & PCI_EXP_LNKSTA_NLW) >> - PCI_EXP_LNKSTA_NLW_SHIFT; + next_width = FIELD_GET(PCI_EXP_LNKSTA_NLW, lnksta); next_bw = next_width * PCIE_SPEED2MBS_ENC(next_speed); @@ -6325,7 +6327,7 @@ pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnkcap); if (lnkcap) - return (lnkcap & PCI_EXP_LNKCAP_MLW) >> 4; + return FIELD_GET(PCI_EXP_LNKCAP_MLW, lnkcap); return PCIE_LNK_WIDTH_UNKNOWN; } diff -u linux-aws-6.5-6.5.0/drivers/pci/pcie/aer.c linux-aws-6.5-6.5.0/drivers/pci/pcie/aer.c --- linux-aws-6.5-6.5.0/drivers/pci/pcie/aer.c +++ linux-aws-6.5-6.5.0/drivers/pci/pcie/aer.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include "../pci.h" @@ -1010,6 +1011,15 @@ continue; } cper_print_aer(pdev, entry.severity, entry.regs); + /* + * Memory for aer_capability_regs(entry.regs) is being allocated from the + * ghes_estatus_pool to protect it from overwriting when multiple sections + * are present in the error status. Thus free the same after processing + * the data. + */ + ghes_estatus_pool_region_free((unsigned long)entry.regs, + sizeof(struct aer_capability_regs)); + if (entry.severity == AER_NONFATAL) pcie_do_recovery(pdev, pci_channel_io_normal, aer_root_reset); diff -u linux-aws-6.5-6.5.0/drivers/pci/pcie/aspm.c linux-aws-6.5-6.5.0/drivers/pci/pcie/aspm.c --- linux-aws-6.5-6.5.0/drivers/pci/pcie/aspm.c +++ linux-aws-6.5-6.5.0/drivers/pci/pcie/aspm.c @@ -1060,7 +1060,8 @@ if (state & PCIE_LINK_STATE_L0S) link->aspm_disable |= ASPM_STATE_L0S; if (state & PCIE_LINK_STATE_L1) - link->aspm_disable |= ASPM_STATE_L1; + /* L1 PM substates require L1 */ + link->aspm_disable |= ASPM_STATE_L1 | ASPM_STATE_L1SS; if (state & PCIE_LINK_STATE_L1_1) link->aspm_disable |= ASPM_STATE_L1_1; if (state & PCIE_LINK_STATE_L1_2) @@ -1259,6 +1260,8 @@ link->aspm_disable &= ~ASPM_STATE_L1; } else { link->aspm_disable |= state; + if (state & ASPM_STATE_L1) + link->aspm_disable |= ASPM_STATE_L1SS; } pcie_config_aspm_link(link, policy_to_aspm_state(link)); diff -u linux-aws-6.5-6.5.0/drivers/pci/probe.c linux-aws-6.5-6.5.0/drivers/pci/probe.c --- linux-aws-6.5-6.5.0/drivers/pci/probe.c +++ linux-aws-6.5-6.5.0/drivers/pci/probe.c @@ -1653,15 +1653,15 @@ static bool pci_ext_cfg_is_aliased(struct pci_dev *dev) { #ifdef CONFIG_PCI_QUIRKS - int pos; + int pos, ret; u32 header, tmp; pci_read_config_dword(dev, PCI_VENDOR_ID, &header); for (pos = PCI_CFG_SPACE_SIZE; pos < PCI_CFG_SPACE_EXP_SIZE; pos += PCI_CFG_SPACE_SIZE) { - if (pci_read_config_dword(dev, pos, &tmp) != PCIBIOS_SUCCESSFUL - || header != tmp) + ret = pci_read_config_dword(dev, pos, &tmp); + if ((ret != PCIBIOS_SUCCESSFUL) || (header != tmp)) return false; } diff -u linux-aws-6.5-6.5.0/drivers/pci/quirks.c linux-aws-6.5-6.5.0/drivers/pci/quirks.c --- linux-aws-6.5-6.5.0/drivers/pci/quirks.c +++ linux-aws-6.5-6.5.0/drivers/pci/quirks.c @@ -703,7 +703,7 @@ /* * In the AMD NL platform, this device ([1022:7912]) has a class code of * PCI_CLASS_SERIAL_USB_XHCI (0x0c0330), which means the xhci driver will - * claim it. + * claim it. The same applies on the VanGogh platform device ([1022:163a]). * * But the dwc3 driver is a more specific driver for this device, and we'd * prefer to use it instead of xhci. To prevent xhci from claiming the @@ -711,7 +711,7 @@ * defines as "USB device (not host controller)". The dwc3 driver can then * claim it based on its Vendor and Device ID. */ -static void quirk_amd_nl_class(struct pci_dev *pdev) +static void quirk_amd_dwc_class(struct pci_dev *pdev) { u32 class = pdev->class; @@ -721,7 +721,9 @@ class, pdev->class); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB, - quirk_amd_nl_class); + quirk_amd_dwc_class); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VANGOGH_USB, + quirk_amd_dwc_class); /* * Synopsys USB 3.x host HAPS platform has a class code of @@ -5396,7 +5398,7 @@ */ static void quirk_intel_qat_vf_cap(struct pci_dev *pdev) { - int pos, i = 0; + int pos, i = 0, ret; u8 next_cap; u16 reg16, *cap; struct pci_cap_saved_state *state; @@ -5442,8 +5444,8 @@ pdev->pcie_mpss = reg16 & PCI_EXP_DEVCAP_PAYLOAD; pdev->cfg_size = PCI_CFG_SPACE_EXP_SIZE; - if (pci_read_config_dword(pdev, PCI_CFG_SPACE_SIZE, &status) != - PCIBIOS_SUCCESSFUL || (status == 0xffffffff)) + ret = pci_read_config_dword(pdev, PCI_CFG_SPACE_SIZE, &status); + if ((ret != PCIBIOS_SUCCESSFUL) || (PCI_POSSIBLE_ERROR(status))) pdev->cfg_size = PCI_CFG_SPACE_SIZE; if (pci_find_saved_cap(pdev, PCI_CAP_ID_EXP)) @@ -5520,6 +5522,12 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, 0x0422, quirk_no_ext_tags); #ifdef CONFIG_PCI_ATS +static void quirk_no_ats(struct pci_dev *pdev) +{ + pci_info(pdev, "disabling ATS\n"); + pdev->ats_cap = 0; +} + /* * Some devices require additional driver setup to enable ATS. Don't use * ATS for those devices as ATS will be enabled before the driver has had a @@ -5533,14 +5541,10 @@ (pdev->subsystem_device == 0xce19 || pdev->subsystem_device == 0xcc10 || pdev->subsystem_device == 0xcc08)) - goto no_ats; - else - return; + quirk_no_ats(pdev); + } else { + quirk_no_ats(pdev); } - -no_ats: - pci_info(pdev, "disabling ATS\n"); - pdev->ats_cap = 0; } /* AMD Stoney platform GPU */ @@ -5563,6 +5567,25 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x734f, quirk_amd_harvest_no_ats); /* AMD Raven platform iGPU */ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x15d8, quirk_amd_harvest_no_ats); + +/* + * Intel IPU E2000 revisions before C0 implement incorrect endianness + * in ATS Invalidate Request message body. Disable ATS for those devices. + */ +static void quirk_intel_e2000_no_ats(struct pci_dev *pdev) +{ + if (pdev->revision < 0x20) + quirk_no_ats(pdev); +} +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1451, quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1452, quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1453, quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1454, quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1455, quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1457, quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1459, quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145a, quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145c, quirk_intel_e2000_no_ats); #endif /* CONFIG_PCI_ATS */ /* Freescale PCIe doesn't support MSI in RC mode */ @@ -6155,0 +6179,12 @@ + +/* + * Devices known to require a longer delay before first config space access + * after reset recovery or resume from D3cold: + * + * VideoPropulsion (aka Genroco) Torrent QN16e MPEG QAM Modulator + */ +static void pci_fixup_d3cold_delay_1sec(struct pci_dev *pdev) +{ + pdev->d3cold_delay = 1000; +} +DECLARE_PCI_FIXUP_FINAL(0x5555, 0x0004, pci_fixup_d3cold_delay_1sec); diff -u linux-aws-6.5-6.5.0/drivers/perf/arm-cmn.c linux-aws-6.5-6.5.0/drivers/perf/arm-cmn.c --- linux-aws-6.5-6.5.0/drivers/perf/arm-cmn.c +++ linux-aws-6.5-6.5.0/drivers/perf/arm-cmn.c @@ -110,7 +110,9 @@ #define CMN_DTM_PMEVCNTSR 0x240 -#define CMN_DTM_UNIT_INFO 0x0910 +#define CMN650_DTM_UNIT_INFO 0x0910 +#define CMN_DTM_UNIT_INFO 0x0960 +#define CMN_DTM_UNIT_INFO_DTC_DOMAIN GENMASK_ULL(1, 0) #define CMN_DTM_NUM_COUNTERS 4 /* Want more local counters? Why not replicate the whole DTM! Ugh... */ @@ -2007,6 +2009,16 @@ return 0; } +static unsigned int arm_cmn_dtc_domain(struct arm_cmn *cmn, void __iomem *xp_region) +{ + int offset = CMN_DTM_UNIT_INFO; + + if (cmn->part == PART_CMN650 || cmn->part == PART_CI700) + offset = CMN650_DTM_UNIT_INFO; + + return FIELD_GET(CMN_DTM_UNIT_INFO_DTC_DOMAIN, readl_relaxed(xp_region + offset)); +} + static void arm_cmn_init_node_info(struct arm_cmn *cmn, u32 offset, struct arm_cmn_node *node) { int level; @@ -2138,7 +2150,7 @@ if (cmn->part == PART_CMN600) xp->dtc = 0xf; else - xp->dtc = 1 << readl_relaxed(xp_region + CMN_DTM_UNIT_INFO); + xp->dtc = 1 << arm_cmn_dtc_domain(cmn, xp_region); xp->dtm = dtm - cmn->dtms; arm_cmn_init_dtm(dtm++, xp, 0); diff -u linux-aws-6.5-6.5.0/drivers/platform/chrome/cros_ec_lpc.c linux-aws-6.5-6.5.0/drivers/platform/chrome/cros_ec_lpc.c --- linux-aws-6.5-6.5.0/drivers/platform/chrome/cros_ec_lpc.c +++ linux-aws-6.5-6.5.0/drivers/platform/chrome/cros_ec_lpc.c @@ -549,22 +549,36 @@ static int cros_ec_lpc_prepare(struct device *dev) { struct cros_ec_device *ec_dev = dev_get_drvdata(dev); - - return cros_ec_suspend(ec_dev); + return cros_ec_suspend_prepare(ec_dev); } static void cros_ec_lpc_complete(struct device *dev) { struct cros_ec_device *ec_dev = dev_get_drvdata(dev); - cros_ec_resume(ec_dev); + cros_ec_resume_complete(ec_dev); +} + +static int cros_ec_lpc_suspend_late(struct device *dev) +{ + struct cros_ec_device *ec_dev = dev_get_drvdata(dev); + + return cros_ec_suspend_late(ec_dev); +} + +static int cros_ec_lpc_resume_early(struct device *dev) +{ + struct cros_ec_device *ec_dev = dev_get_drvdata(dev); + + return cros_ec_resume_early(ec_dev); } #endif static const struct dev_pm_ops cros_ec_lpc_pm_ops = { #ifdef CONFIG_PM_SLEEP .prepare = cros_ec_lpc_prepare, - .complete = cros_ec_lpc_complete + .complete = cros_ec_lpc_complete, #endif + SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_lpc_suspend_late, cros_ec_lpc_resume_early) }; static struct platform_driver cros_ec_lpc_driver = { diff -u linux-aws-6.5-6.5.0/drivers/platform/mellanox/mlxbf-pmc.c linux-aws-6.5-6.5.0/drivers/platform/mellanox/mlxbf-pmc.c --- linux-aws-6.5-6.5.0/drivers/platform/mellanox/mlxbf-pmc.c +++ linux-aws-6.5-6.5.0/drivers/platform/mellanox/mlxbf-pmc.c @@ -1202,6 +1202,8 @@ attr->dev_attr.show = mlxbf_pmc_event_list_show; attr->nr = blk_num; attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, "event_list"); + if (!attr->dev_attr.attr.name) + return -ENOMEM; pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr; attr = NULL; @@ -1214,6 +1216,8 @@ attr->nr = blk_num; attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, "enable"); + if (!attr->dev_attr.attr.name) + return -ENOMEM; pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; attr = NULL; } @@ -1240,6 +1244,8 @@ attr->nr = blk_num; attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, "counter%d", j); + if (!attr->dev_attr.attr.name) + return -ENOMEM; pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; attr = NULL; @@ -1251,6 +1257,8 @@ attr->nr = blk_num; attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, "event%d", j); + if (!attr->dev_attr.attr.name) + return -ENOMEM; pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; attr = NULL; } @@ -1283,6 +1291,8 @@ attr->nr = blk_num; attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, events[j].evt_name); + if (!attr->dev_attr.attr.name) + return -ENOMEM; pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr; attr = NULL; i++; @@ -1311,6 +1321,8 @@ pmc->block[blk_num].block_attr_grp.attrs = pmc->block[blk_num].block_attr; pmc->block[blk_num].block_attr_grp.name = devm_kasprintf( dev, GFP_KERNEL, pmc->block_name[blk_num]); + if (!pmc->block[blk_num].block_attr_grp.name) + return -ENOMEM; pmc->groups[blk_num] = &pmc->block[blk_num].block_attr_grp; return 0; @@ -1442,6 +1454,8 @@ pmc->hwmon_dev = devm_hwmon_device_register_with_groups( dev, "bfperf", pmc, pmc->groups); + if (IS_ERR(pmc->hwmon_dev)) + return PTR_ERR(pmc->hwmon_dev); platform_set_drvdata(pdev, pmc); return 0; diff -u linux-aws-6.5-6.5.0/drivers/platform/mellanox/mlxbf-tmfifo.c linux-aws-6.5-6.5.0/drivers/platform/mellanox/mlxbf-tmfifo.c --- linux-aws-6.5-6.5.0/drivers/platform/mellanox/mlxbf-tmfifo.c +++ linux-aws-6.5-6.5.0/drivers/platform/mellanox/mlxbf-tmfifo.c @@ -607,24 +607,25 @@ if (vring->cur_len + sizeof(u64) <= len) { /* The whole word. */ - if (!IS_VRING_DROP(vring)) { - if (is_rx) + if (is_rx) { + if (!IS_VRING_DROP(vring)) memcpy(addr + vring->cur_len, &data, sizeof(u64)); - else - memcpy(&data, addr + vring->cur_len, - sizeof(u64)); + } else { + memcpy(&data, addr + vring->cur_len, + sizeof(u64)); } vring->cur_len += sizeof(u64); } else { /* Leftover bytes. */ - if (!IS_VRING_DROP(vring)) { - if (is_rx) + if (is_rx) { + if (!IS_VRING_DROP(vring)) memcpy(addr + vring->cur_len, &data, len - vring->cur_len); - else - memcpy(&data, addr + vring->cur_len, - len - vring->cur_len); + } else { + data = 0; + memcpy(&data, addr + vring->cur_len, + len - vring->cur_len); } vring->cur_len = len; } diff -u linux-aws-6.5-6.5.0/drivers/platform/x86/Kconfig linux-aws-6.5-6.5.0/drivers/platform/x86/Kconfig --- linux-aws-6.5-6.5.0/drivers/platform/x86/Kconfig +++ linux-aws-6.5-6.5.0/drivers/platform/x86/Kconfig @@ -263,6 +263,7 @@ depends on RFKILL || RFKILL = n depends on HOTPLUG_PCI depends on ACPI_VIDEO || ACPI_VIDEO = n + depends on SERIO_I8042 || SERIO_I8042 = n select INPUT_SPARSEKMAP select LEDS_CLASS select NEW_LEDS @@ -279,7 +280,6 @@ config ASUS_NB_WMI tristate "Asus Notebook WMI Driver" depends on ASUS_WMI - depends on SERIO_I8042 || SERIO_I8042 = n help This is a driver for newer Asus notebooks. It adds extra features like wireless radio and bluetooth control, leds, hotkeys, backlight... diff -u linux-aws-6.5-6.5.0/drivers/platform/x86/asus-nb-wmi.c linux-aws-6.5-6.5.0/drivers/platform/x86/asus-nb-wmi.c --- linux-aws-6.5-6.5.0/drivers/platform/x86/asus-nb-wmi.c +++ linux-aws-6.5-6.5.0/drivers/platform/x86/asus-nb-wmi.c @@ -501,8 +501,6 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver) { - int ret; - quirks = &quirk_asus_unknown; dmi_check_system(asus_quirks); @@ -517,20 +515,14 @@ if (tablet_mode_sw != -1) quirks->tablet_switch_mode = tablet_mode_sw; - - if (quirks->i8042_filter) { - ret = i8042_install_filter(quirks->i8042_filter); - if (ret) { - pr_warn("Unable to install key filter\n"); - return; - } - pr_info("Using i8042 filter function for receiving events\n"); - } } static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } }, { KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } }, + { KE_KEY, 0x2a, { KEY_SELECTIVE_SCREENSHOT } }, + { KE_IGNORE, 0x2b, }, /* PrintScreen (also send via PS/2) on newer models */ + { KE_IGNORE, 0x2c, }, /* CapsLock (also send via PS/2) on newer models */ { KE_KEY, 0x30, { KEY_VOLUMEUP } }, { KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, { KE_KEY, 0x32, { KEY_MUTE } }, diff -u linux-aws-6.5-6.5.0/drivers/powercap/intel_rapl_common.c linux-aws-6.5-6.5.0/drivers/powercap/intel_rapl_common.c --- linux-aws-6.5-6.5.0/drivers/powercap/intel_rapl_common.c +++ linux-aws-6.5-6.5.0/drivers/powercap/intel_rapl_common.c @@ -892,7 +892,7 @@ return -EINVAL; if (rd->rpl[pl].locked) { - pr_warn("%s:%s:%s locked by BIOS\n", rd->rp->name, rd->name, pl_names[pl]); + pr_debug("%s:%s:%s locked by BIOS\n", rd->rp->name, rd->name, pl_names[pl]); return -EACCES; } diff -u linux-aws-6.5-6.5.0/drivers/ptp/ptp_clock.c linux-aws-6.5-6.5.0/drivers/ptp/ptp_clock.c --- linux-aws-6.5-6.5.0/drivers/ptp/ptp_clock.c +++ linux-aws-6.5-6.5.0/drivers/ptp/ptp_clock.c @@ -56,10 +56,11 @@ dst->t.sec = seconds; dst->t.nsec = remainder; + /* Both WRITE_ONCE() are paired with READ_ONCE() in queue_cnt() */ if (!queue_free(queue)) - queue->head = (queue->head + 1) % PTP_MAX_TIMESTAMPS; + WRITE_ONCE(queue->head, (queue->head + 1) % PTP_MAX_TIMESTAMPS); - queue->tail = (queue->tail + 1) % PTP_MAX_TIMESTAMPS; + WRITE_ONCE(queue->tail, (queue->tail + 1) % PTP_MAX_TIMESTAMPS); spin_unlock_irqrestore(&queue->lock, flags); } diff -u linux-aws-6.5-6.5.0/drivers/regulator/core.c linux-aws-6.5-6.5.0/drivers/regulator/core.c --- linux-aws-6.5-6.5.0/drivers/regulator/core.c +++ linux-aws-6.5-6.5.0/drivers/regulator/core.c @@ -5724,15 +5724,11 @@ mutex_lock(®ulator_list_mutex); regulator_ena_gpio_free(rdev); mutex_unlock(®ulator_list_mutex); - put_device(&rdev->dev); - rdev = NULL; clean: if (dangling_of_gpiod) gpiod_put(config->ena_gpiod); - if (rdev && rdev->dev.of_node) - of_node_put(rdev->dev.of_node); - kfree(rdev); kfree(config); + put_device(&rdev->dev); rinse: if (dangling_cfg_gpiod) gpiod_put(cfg->ena_gpiod); diff -u linux-aws-6.5-6.5.0/drivers/regulator/mt6358-regulator.c linux-aws-6.5-6.5.0/drivers/regulator/mt6358-regulator.c --- linux-aws-6.5-6.5.0/drivers/regulator/mt6358-regulator.c +++ linux-aws-6.5-6.5.0/drivers/regulator/mt6358-regulator.c @@ -688,12 +688,18 @@ const struct mt6358_regulator_info *mt6358_info; int i, max_regulator, ret; - if (mt6397->chip_id == MT6366_CHIP_ID) { - max_regulator = MT6366_MAX_REGULATOR; - mt6358_info = mt6366_regulators; - } else { + switch (mt6397->chip_id) { + case MT6358_CHIP_ID: max_regulator = MT6358_MAX_REGULATOR; mt6358_info = mt6358_regulators; + break; + case MT6366_CHIP_ID: + max_regulator = MT6366_MAX_REGULATOR; + mt6358_info = mt6366_regulators; + break; + default: + dev_err(&pdev->dev, "unsupported chip ID: %d\n", mt6397->chip_id); + return -EINVAL; } ret = mt6358_sync_vcn33_setting(&pdev->dev); diff -u linux-aws-6.5-6.5.0/drivers/s390/crypto/ap_bus.c linux-aws-6.5-6.5.0/drivers/s390/crypto/ap_bus.c --- linux-aws-6.5-6.5.0/drivers/s390/crypto/ap_bus.c +++ linux-aws-6.5-6.5.0/drivers/s390/crypto/ap_bus.c @@ -1039,6 +1039,10 @@ void ap_bus_force_rescan(void) { + /* Only trigger AP bus scans after the initial scan is done */ + if (atomic64_read(&ap_scan_bus_count) <= 0) + return; + /* processing a asynchronous bus rescan */ del_timer(&ap_config_timer); queue_work(system_long_wq, &ap_scan_work); @@ -1882,15 +1886,18 @@ } /* get it and thus adjust reference counter */ get_device(dev); - if (decfg) + if (decfg) { AP_DBF_INFO("%s(%d,%d) new (decfg) queue dev created\n", __func__, ac->id, dom); - else if (chkstop) + } else if (chkstop) { AP_DBF_INFO("%s(%d,%d) new (chkstop) queue dev created\n", __func__, ac->id, dom); - else + } else { + /* nudge the queue's state machine */ + ap_queue_init_state(aq); AP_DBF_INFO("%s(%d,%d) new queue dev created\n", __func__, ac->id, dom); + } goto put_dev_and_continue; } /* handle state changes on already existing queue device */ @@ -1912,10 +1919,8 @@ } else if (!chkstop && aq->chkstop) { /* checkstop off */ aq->chkstop = false; - if (aq->dev_state > AP_DEV_STATE_UNINITIATED) { - aq->dev_state = AP_DEV_STATE_OPERATING; - aq->sm_state = AP_SM_STATE_RESET_START; - } + if (aq->dev_state > AP_DEV_STATE_UNINITIATED) + _ap_queue_init_state(aq); spin_unlock_bh(&aq->lock); AP_DBF_DBG("%s(%d,%d) queue dev checkstop off\n", __func__, ac->id, dom); @@ -1939,10 +1944,8 @@ } else if (!decfg && !aq->config) { /* config on this queue device */ aq->config = true; - if (aq->dev_state > AP_DEV_STATE_UNINITIATED) { - aq->dev_state = AP_DEV_STATE_OPERATING; - aq->sm_state = AP_SM_STATE_RESET_START; - } + if (aq->dev_state > AP_DEV_STATE_UNINITIATED) + _ap_queue_init_state(aq); spin_unlock_bh(&aq->lock); AP_DBF_DBG("%s(%d,%d) queue dev config on\n", __func__, ac->id, dom); diff -u linux-aws-6.5-6.5.0/drivers/s390/crypto/ap_bus.h linux-aws-6.5-6.5.0/drivers/s390/crypto/ap_bus.h --- linux-aws-6.5-6.5.0/drivers/s390/crypto/ap_bus.h +++ linux-aws-6.5-6.5.0/drivers/s390/crypto/ap_bus.h @@ -302,6 +302,7 @@ void ap_queue_prepare_remove(struct ap_queue *aq); void ap_queue_remove(struct ap_queue *aq); void ap_queue_init_state(struct ap_queue *aq); +void _ap_queue_init_state(struct ap_queue *aq); struct ap_card *ap_card_create(int id, int queue_depth, int raw_type, int comp_type, unsigned int functions, int ml); diff -u linux-aws-6.5-6.5.0/drivers/s390/net/Kconfig linux-aws-6.5-6.5.0/drivers/s390/net/Kconfig --- linux-aws-6.5-6.5.0/drivers/s390/net/Kconfig +++ linux-aws-6.5-6.5.0/drivers/s390/net/Kconfig @@ -104,10 +104,11 @@ config ISM tristate "Support for ISM vPCI Adapter" depends on PCI + imply SMC default n help Select this option if you want to use the Internal Shared Memory - vPCI Adapter. + vPCI Adapter. The adapter can be used with the SMC network protocol. To compile as a module choose M. The module name is ism. If unsure, choose N. diff -u linux-aws-6.5-6.5.0/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c linux-aws-6.5-6.5.0/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c --- linux-aws-6.5-6.5.0/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ linux-aws-6.5-6.5.0/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -4861,6 +4861,12 @@ hisi_hba->debugfs_bist_linkrate = SAS_LINK_RATE_1_5_GBPS; } +static void debugfs_exit_v3_hw(struct hisi_hba *hisi_hba) +{ + debugfs_remove_recursive(hisi_hba->debugfs_dir); + hisi_hba->debugfs_dir = NULL; +} + static void debugfs_init_v3_hw(struct hisi_hba *hisi_hba) { struct device *dev = hisi_hba->dev; @@ -4884,18 +4890,13 @@ for (i = 0; i < hisi_sas_debugfs_dump_count; i++) { if (debugfs_alloc_v3_hw(hisi_hba, i)) { - debugfs_remove_recursive(hisi_hba->debugfs_dir); + debugfs_exit_v3_hw(hisi_hba); dev_dbg(dev, "failed to init debugfs!\n"); break; } } } -static void debugfs_exit_v3_hw(struct hisi_hba *hisi_hba) -{ - debugfs_remove_recursive(hisi_hba->debugfs_dir); -} - static int hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) { diff -u linux-aws-6.5-6.5.0/drivers/scsi/megaraid/megaraid_sas_base.c linux-aws-6.5-6.5.0/drivers/scsi/megaraid/megaraid_sas_base.c --- linux-aws-6.5-6.5.0/drivers/scsi/megaraid/megaraid_sas_base.c +++ linux-aws-6.5-6.5.0/drivers/scsi/megaraid/megaraid_sas_base.c @@ -263,13 +263,13 @@ * Fusion registers could intermittently return all zeroes. * This behavior is transient in nature and subsequent reads will * return valid value. As a workaround in driver, retry readl for - * upto three times until a non-zero value is read. + * up to thirty times until a non-zero value is read. */ if (instance->adapter_type == AERO_SERIES) { do { ret_val = readl(addr); i++; - } while (ret_val == 0 && i < 3); + } while (ret_val == 0 && i < 30); return ret_val; } else { return readl(addr); diff -u linux-aws-6.5-6.5.0/drivers/scsi/mpt3sas/mpt3sas_base.c linux-aws-6.5-6.5.0/drivers/scsi/mpt3sas/mpt3sas_base.c --- linux-aws-6.5-6.5.0/drivers/scsi/mpt3sas/mpt3sas_base.c +++ linux-aws-6.5-6.5.0/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -223,8 +223,8 @@ for (i = 0 ; i < 30 ; i++) { ret_val = readl(addr); - if (ret_val == 0) - continue; + if (ret_val != 0) + break; } return ret_val; diff -u linux-aws-6.5-6.5.0/drivers/scsi/qla2xxx/qla_os.c linux-aws-6.5-6.5.0/drivers/scsi/qla2xxx/qla_os.c --- linux-aws-6.5-6.5.0/drivers/scsi/qla2xxx/qla_os.c +++ linux-aws-6.5-6.5.0/drivers/scsi/qla2xxx/qla_os.c @@ -1835,8 +1835,16 @@ } spin_lock_irqsave(qp->qp_lock_ptr, *flags); - if (ret_cmd && blk_mq_request_started(scsi_cmd_to_rq(cmd))) - sp->done(sp, res); + switch (sp->type) { + case SRB_SCSI_CMD: + if (ret_cmd && blk_mq_request_started(scsi_cmd_to_rq(cmd))) + sp->done(sp, res); + break; + default: + if (ret_cmd) + sp->done(sp, res); + break; + } } else { sp->done(sp, res); } diff -u linux-aws-6.5-6.5.0/drivers/scsi/sd.c linux-aws-6.5-6.5.0/drivers/scsi/sd.c --- linux-aws-6.5-6.5.0/drivers/scsi/sd.c +++ linux-aws-6.5-6.5.0/drivers/scsi/sd.c @@ -221,7 +221,8 @@ return sysfs_emit(buf, "%u\n", sdp->manage_system_start_stop && - sdp->manage_runtime_start_stop); + sdp->manage_runtime_start_stop && + sdp->manage_shutdown); } static DEVICE_ATTR_RO(manage_start_stop); @@ -288,4 +289,33 @@ static DEVICE_ATTR_RW(manage_runtime_start_stop); +static ssize_t manage_shutdown_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct scsi_disk *sdkp = to_scsi_disk(dev); + struct scsi_device *sdp = sdkp->device; + + return sysfs_emit(buf, "%u\n", sdp->manage_shutdown); +} + +static ssize_t manage_shutdown_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct scsi_disk *sdkp = to_scsi_disk(dev); + struct scsi_device *sdp = sdkp->device; + bool v; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + + if (kstrtobool(buf, &v)) + return -EINVAL; + + sdp->manage_shutdown = v; + + return count; +} +static DEVICE_ATTR_RW(manage_shutdown); + static ssize_t allow_restart_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -619,6 +649,7 @@ &dev_attr_manage_start_stop.attr, &dev_attr_manage_system_start_stop.attr, &dev_attr_manage_runtime_start_stop.attr, + &dev_attr_manage_shutdown.attr, &dev_attr_protection_type.attr, &dev_attr_protection_mode.attr, &dev_attr_app_tag_own.attr, @@ -1650,24 +1681,21 @@ return disk_changed ? DISK_EVENT_MEDIA_CHANGE : 0; } -static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) +static int sd_sync_cache(struct scsi_disk *sdkp) { int retries, res; struct scsi_device *sdp = sdkp->device; const int timeout = sdp->request_queue->rq_timeout * SD_FLUSH_TIMEOUT_MULTIPLIER; - struct scsi_sense_hdr my_sshdr; + struct scsi_sense_hdr sshdr; const struct scsi_exec_args exec_args = { .req_flags = BLK_MQ_REQ_PM, - /* caller might not be interested in sense, but we need it */ - .sshdr = sshdr ? : &my_sshdr, + .sshdr = &sshdr, }; if (!scsi_device_online(sdp)) return -ENODEV; - sshdr = exec_args.sshdr; - for (retries = 3; retries > 0; --retries) { unsigned char cmd[16] = { 0 }; @@ -1692,15 +1720,23 @@ return res; if (scsi_status_is_check_condition(res) && - scsi_sense_valid(sshdr)) { - sd_print_sense_hdr(sdkp, sshdr); + scsi_sense_valid(&sshdr)) { + sd_print_sense_hdr(sdkp, &sshdr); /* we need to evaluate the error return */ - if (sshdr->asc == 0x3a || /* medium not present */ - sshdr->asc == 0x20 || /* invalid command */ - (sshdr->asc == 0x74 && sshdr->ascq == 0x71)) /* drive is password locked */ + if (sshdr.asc == 0x3a || /* medium not present */ + sshdr.asc == 0x20 || /* invalid command */ + (sshdr.asc == 0x74 && sshdr.ascq == 0x71)) /* drive is password locked */ /* this is no error here */ return 0; + /* + * This drive doesn't support sync and there's not much + * we can do because this is called during shutdown + * or suspend so just return success so those operations + * can proceed. + */ + if (sshdr.sense_key == ILLEGAL_REQUEST) + return 0; } switch (host_byte(res)) { @@ -3855,11 +3891,13 @@ if (sdkp->WCE && sdkp->media_present) { sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n"); - sd_sync_cache(sdkp, NULL); + sd_sync_cache(sdkp); } - if (system_state != SYSTEM_RESTART && - sdkp->device->manage_system_start_stop) { + if ((system_state != SYSTEM_RESTART && + sdkp->device->manage_system_start_stop) || + (system_state == SYSTEM_POWER_OFF && + sdkp->device->manage_shutdown)) { sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); sd_start_stop_device(sdkp, 0); } @@ -3874,7 +3912,6 @@ static int sd_suspend_common(struct device *dev, bool runtime) { struct scsi_disk *sdkp = dev_get_drvdata(dev); - struct scsi_sense_hdr sshdr; int ret = 0; if (!sdkp) /* E.g.: runtime suspend following sd_remove() */ @@ -3883,24 +3920,13 @@ if (sdkp->WCE && sdkp->media_present) { if (!sdkp->device->silence_suspend) sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n"); - ret = sd_sync_cache(sdkp, &sshdr); - - if (ret) { - /* ignore OFFLINE device */ - if (ret == -ENODEV) - return 0; + ret = sd_sync_cache(sdkp); + /* ignore OFFLINE device */ + if (ret == -ENODEV) + return 0; - if (!scsi_sense_valid(&sshdr) || - sshdr.sense_key != ILLEGAL_REQUEST) - return ret; - - /* - * sshdr.sense_key == ILLEGAL_REQUEST means this drive - * doesn't support sync. There's not much to do and - * suspend shouldn't fail. - */ - ret = 0; - } + if (ret) + return ret; } if (sd_do_start_stop(sdkp->device, runtime)) { @@ -3959,8 +3985,15 @@ static int sd_resume_system(struct device *dev) { - if (pm_runtime_suspended(dev)) + if (pm_runtime_suspended(dev)) { + struct scsi_disk *sdkp = dev_get_drvdata(dev); + struct scsi_device *sdp = sdkp ? sdkp->device : NULL; + + if (sdp && sdp->force_runtime_start_on_system_start) + pm_request_resume(dev); + return 0; + } return sd_resume(dev, false); } diff -u linux-aws-6.5-6.5.0/drivers/spi/spi-nxp-fspi.c linux-aws-6.5-6.5.0/drivers/spi/spi-nxp-fspi.c --- linux-aws-6.5-6.5.0/drivers/spi/spi-nxp-fspi.c +++ linux-aws-6.5-6.5.0/drivers/spi/spi-nxp-fspi.c @@ -760,7 +760,7 @@ f->memmap_len = len > NXP_FSPI_MIN_IOMAP ? len : NXP_FSPI_MIN_IOMAP; - f->ahb_addr = ioremap_wc(f->memmap_phy + f->memmap_start, + f->ahb_addr = ioremap(f->memmap_phy + f->memmap_start, f->memmap_len); if (!f->ahb_addr) { diff -u linux-aws-6.5-6.5.0/drivers/thunderbolt/switch.c linux-aws-6.5-6.5.0/drivers/thunderbolt/switch.c --- linux-aws-6.5-6.5.0/drivers/thunderbolt/switch.c +++ linux-aws-6.5-6.5.0/drivers/thunderbolt/switch.c @@ -1082,7 +1082,7 @@ * Only set bonding if the link was not already bonded. This * avoids the lane adapter to re-enter bonding state. */ - if (width == TB_LINK_WIDTH_SINGLE) { + if (width == TB_LINK_WIDTH_SINGLE && !tb_is_upstream_port(port)) { ret = tb_port_set_lane_bonding(port, true); if (ret) goto err_lane1; diff -u linux-aws-6.5-6.5.0/drivers/tty/n_gsm.c linux-aws-6.5-6.5.0/drivers/tty/n_gsm.c --- linux-aws-6.5-6.5.0/drivers/tty/n_gsm.c +++ linux-aws-6.5-6.5.0/drivers/tty/n_gsm.c @@ -4058,6 +4058,8 @@ static int gsm_modem_update(struct gsm_dlci *dlci, u8 brk) { + if (dlci->gsm->dead) + return -EL2HLT; if (dlci->adaption == 2) { /* Send convergence layer type 2 empty data frame. */ gsm_modem_upd_via_data(dlci, brk); diff -u linux-aws-6.5-6.5.0/drivers/tty/serial/8250/8250_omap.c linux-aws-6.5-6.5.0/drivers/tty/serial/8250/8250_omap.c --- linux-aws-6.5-6.5.0/drivers/tty/serial/8250/8250_omap.c +++ linux-aws-6.5-6.5.0/drivers/tty/serial/8250/8250_omap.c @@ -915,7 +915,7 @@ if (priv->habit & UART_HAS_RHR_IT_DIS) { reg = serial_in(p, UART_OMAP_IER2); reg &= ~UART_OMAP_IER2_RHR_IT_DIS; - serial_out(p, UART_OMAP_IER2, UART_OMAP_IER2_RHR_IT_DIS); + serial_out(p, UART_OMAP_IER2, reg); } dmaengine_tx_status(rxchan, cookie, &state); @@ -1061,7 +1061,7 @@ if (priv->habit & UART_HAS_RHR_IT_DIS) { reg = serial_in(p, UART_OMAP_IER2); reg |= UART_OMAP_IER2_RHR_IT_DIS; - serial_out(p, UART_OMAP_IER2, UART_OMAP_IER2_RHR_IT_DIS); + serial_out(p, UART_OMAP_IER2, reg); } dma_async_issue_pending(dma->rxchan); @@ -1283,10 +1283,12 @@ status = serial_port_in(port, UART_LSR); - if (priv->habit & UART_HAS_EFR2) - am654_8250_handle_rx_dma(up, iir, status); - else - status = omap_8250_handle_rx_dma(up, iir, status); + if ((iir & 0x3f) != UART_IIR_THRI) { + if (priv->habit & UART_HAS_EFR2) + am654_8250_handle_rx_dma(up, iir, status); + else + status = omap_8250_handle_rx_dma(up, iir, status); + } serial8250_modem_status(up); if (status & UART_LSR_THRE && up->dma->tx_err) { diff -u linux-aws-6.5-6.5.0/drivers/tty/serial/sc16is7xx.c linux-aws-6.5-6.5.0/drivers/tty/serial/sc16is7xx.c --- linux-aws-6.5-6.5.0/drivers/tty/serial/sc16is7xx.c +++ linux-aws-6.5-6.5.0/drivers/tty/serial/sc16is7xx.c @@ -486,6 +486,7 @@ case SC16IS7XX_TXLVL_REG: case SC16IS7XX_RXLVL_REG: case SC16IS7XX_IOSTATE_REG: + case SC16IS7XX_IOCONTROL_REG: return true; default: break; @@ -765,6 +766,18 @@ case SC16IS7XX_IIR_RTOI_SRC: case SC16IS7XX_IIR_XOFFI_SRC: rxlen = sc16is7xx_port_read(port, SC16IS7XX_RXLVL_REG); + + /* + * There is a silicon bug that makes the chip report a + * time-out interrupt but no data in the FIFO. This is + * described in errata section 18.1.4. + * + * When this happens, read one byte from the FIFO to + * clear the interrupt. + */ + if (iir == SC16IS7XX_IIR_RTOI_SRC && !rxlen) + rxlen = 1; + if (rxlen) sc16is7xx_handle_rx(port, rxlen, iir); break; @@ -1552,6 +1565,10 @@ goto out_ports; } + ret = uart_get_rs485_mode(&s->p[i].port); + if (ret) + goto out_ports; + /* Disable all interrupts */ sc16is7xx_port_write(&s->p[i].port, SC16IS7XX_IER_REG, 0); /* Disable TX/RX */ diff -u linux-aws-6.5-6.5.0/drivers/tty/serial/serial_core.c linux-aws-6.5-6.5.0/drivers/tty/serial/serial_core.c --- linux-aws-6.5-6.5.0/drivers/tty/serial/serial_core.c +++ linux-aws-6.5-6.5.0/drivers/tty/serial/serial_core.c @@ -147,7 +147,7 @@ /* Increment the runtime PM usage count for the active check below */ err = pm_runtime_get(&port_dev->dev); - if (err < 0) { + if (err < 0 && err != -EINPROGRESS) { pm_runtime_put_noidle(&port_dev->dev); return; } diff -u linux-aws-6.5-6.5.0/drivers/ufs/core/ufshcd.c linux-aws-6.5-6.5.0/drivers/ufs/core/ufshcd.c --- linux-aws-6.5-6.5.0/drivers/ufs/core/ufshcd.c +++ linux-aws-6.5-6.5.0/drivers/ufs/core/ufshcd.c @@ -3665,7 +3665,7 @@ */ ret = utf16s_to_utf8s(uc_str->uc, uc_str->len - QUERY_DESC_HDR_SIZE, - UTF16_BIG_ENDIAN, str, ascii_len); + UTF16_BIG_ENDIAN, str, ascii_len - 1); /* replace non-printable or non-ASCII characters with spaces */ for (i = 0; i < ret; i++) @@ -8798,7 +8798,8 @@ if (ret) goto out; - if (hba->quirks & UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH) { + if (!hba->pm_op_in_progress && + (hba->quirks & UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH)) { /* Reset the device and controller before doing reinit */ ufshcd_device_reset(hba); ufshcd_hba_stop(hba); diff -u linux-aws-6.5-6.5.0/drivers/usb/chipidea/host.c linux-aws-6.5-6.5.0/drivers/usb/chipidea/host.c --- linux-aws-6.5-6.5.0/drivers/usb/chipidea/host.c +++ linux-aws-6.5-6.5.0/drivers/usb/chipidea/host.c @@ -30,8 +30,7 @@ }; struct ci_hdrc_dma_aligned_buffer { - void *kmalloc_ptr; - void *old_xfer_buffer; + void *original_buffer; u8 data[]; }; @@ -380,59 +379,52 @@ return 0; } -static void ci_hdrc_free_dma_aligned_buffer(struct urb *urb) +static void ci_hdrc_free_dma_aligned_buffer(struct urb *urb, bool copy_back) { struct ci_hdrc_dma_aligned_buffer *temp; - size_t length; if (!(urb->transfer_flags & URB_ALIGNED_TEMP_BUFFER)) return; + urb->transfer_flags &= ~URB_ALIGNED_TEMP_BUFFER; temp = container_of(urb->transfer_buffer, struct ci_hdrc_dma_aligned_buffer, data); + urb->transfer_buffer = temp->original_buffer; + + if (copy_back && usb_urb_dir_in(urb)) { + size_t length; - if (usb_urb_dir_in(urb)) { if (usb_pipeisoc(urb->pipe)) length = urb->transfer_buffer_length; else length = urb->actual_length; - memcpy(temp->old_xfer_buffer, temp->data, length); + memcpy(temp->original_buffer, temp->data, length); } - urb->transfer_buffer = temp->old_xfer_buffer; - kfree(temp->kmalloc_ptr); - urb->transfer_flags &= ~URB_ALIGNED_TEMP_BUFFER; + kfree(temp); } static int ci_hdrc_alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags) { - struct ci_hdrc_dma_aligned_buffer *temp, *kmalloc_ptr; - const unsigned int ci_hdrc_usb_dma_align = 32; - size_t kmalloc_size; + struct ci_hdrc_dma_aligned_buffer *temp; - if (urb->num_sgs || urb->sg || urb->transfer_buffer_length == 0 || - !((uintptr_t)urb->transfer_buffer & (ci_hdrc_usb_dma_align - 1))) + if (urb->num_sgs || urb->sg || urb->transfer_buffer_length == 0) + return 0; + if (IS_ALIGNED((uintptr_t)urb->transfer_buffer, 4) + && IS_ALIGNED(urb->transfer_buffer_length, 4)) return 0; - /* Allocate a buffer with enough padding for alignment */ - kmalloc_size = urb->transfer_buffer_length + - sizeof(struct ci_hdrc_dma_aligned_buffer) + - ci_hdrc_usb_dma_align - 1; - - kmalloc_ptr = kmalloc(kmalloc_size, mem_flags); - if (!kmalloc_ptr) + temp = kmalloc(sizeof(*temp) + ALIGN(urb->transfer_buffer_length, 4), mem_flags); + if (!temp) return -ENOMEM; - /* Position our struct dma_aligned_buffer such that data is aligned */ - temp = PTR_ALIGN(kmalloc_ptr + 1, ci_hdrc_usb_dma_align) - 1; - temp->kmalloc_ptr = kmalloc_ptr; - temp->old_xfer_buffer = urb->transfer_buffer; if (usb_urb_dir_out(urb)) memcpy(temp->data, urb->transfer_buffer, urb->transfer_buffer_length); - urb->transfer_buffer = temp->data; + temp->original_buffer = urb->transfer_buffer; + urb->transfer_buffer = temp->data; urb->transfer_flags |= URB_ALIGNED_TEMP_BUFFER; return 0; @@ -449,7 +441,7 @@ ret = usb_hcd_map_urb_for_dma(hcd, urb, mem_flags); if (ret) - ci_hdrc_free_dma_aligned_buffer(urb); + ci_hdrc_free_dma_aligned_buffer(urb, false); return ret; } @@ -457,7 +449,7 @@ static void ci_hdrc_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) { usb_hcd_unmap_urb_for_dma(hcd, urb); - ci_hdrc_free_dma_aligned_buffer(urb); + ci_hdrc_free_dma_aligned_buffer(urb, true); } #ifdef CONFIG_PM_SLEEP diff -u linux-aws-6.5-6.5.0/drivers/usb/dwc3/core.c linux-aws-6.5-6.5.0/drivers/usb/dwc3/core.c --- linux-aws-6.5-6.5.0/drivers/usb/dwc3/core.c +++ linux-aws-6.5-6.5.0/drivers/usb/dwc3/core.c @@ -1094,6 +1094,111 @@ } } +static void dwc3_config_threshold(struct dwc3 *dwc) +{ + u32 reg; + u8 rx_thr_num; + u8 rx_maxburst; + u8 tx_thr_num; + u8 tx_maxburst; + + /* + * Must config both number of packets and max burst settings to enable + * RX and/or TX threshold. + */ + if (!DWC3_IP_IS(DWC3) && dwc->dr_mode == USB_DR_MODE_HOST) { + rx_thr_num = dwc->rx_thr_num_pkt_prd; + rx_maxburst = dwc->rx_max_burst_prd; + tx_thr_num = dwc->tx_thr_num_pkt_prd; + tx_maxburst = dwc->tx_max_burst_prd; + + if (rx_thr_num && rx_maxburst) { + reg = dwc3_readl(dwc->regs, DWC3_GRXTHRCFG); + reg |= DWC31_RXTHRNUMPKTSEL_PRD; + + reg &= ~DWC31_RXTHRNUMPKT_PRD(~0); + reg |= DWC31_RXTHRNUMPKT_PRD(rx_thr_num); + + reg &= ~DWC31_MAXRXBURSTSIZE_PRD(~0); + reg |= DWC31_MAXRXBURSTSIZE_PRD(rx_maxburst); + + dwc3_writel(dwc->regs, DWC3_GRXTHRCFG, reg); + } + + if (tx_thr_num && tx_maxburst) { + reg = dwc3_readl(dwc->regs, DWC3_GTXTHRCFG); + reg |= DWC31_TXTHRNUMPKTSEL_PRD; + + reg &= ~DWC31_TXTHRNUMPKT_PRD(~0); + reg |= DWC31_TXTHRNUMPKT_PRD(tx_thr_num); + + reg &= ~DWC31_MAXTXBURSTSIZE_PRD(~0); + reg |= DWC31_MAXTXBURSTSIZE_PRD(tx_maxburst); + + dwc3_writel(dwc->regs, DWC3_GTXTHRCFG, reg); + } + } + + rx_thr_num = dwc->rx_thr_num_pkt; + rx_maxburst = dwc->rx_max_burst; + tx_thr_num = dwc->tx_thr_num_pkt; + tx_maxburst = dwc->tx_max_burst; + + if (DWC3_IP_IS(DWC3)) { + if (rx_thr_num && rx_maxburst) { + reg = dwc3_readl(dwc->regs, DWC3_GRXTHRCFG); + reg |= DWC3_GRXTHRCFG_PKTCNTSEL; + + reg &= ~DWC3_GRXTHRCFG_RXPKTCNT(~0); + reg |= DWC3_GRXTHRCFG_RXPKTCNT(rx_thr_num); + + reg &= ~DWC3_GRXTHRCFG_MAXRXBURSTSIZE(~0); + reg |= DWC3_GRXTHRCFG_MAXRXBURSTSIZE(rx_maxburst); + + dwc3_writel(dwc->regs, DWC3_GRXTHRCFG, reg); + } + + if (tx_thr_num && tx_maxburst) { + reg = dwc3_readl(dwc->regs, DWC3_GTXTHRCFG); + reg |= DWC3_GTXTHRCFG_PKTCNTSEL; + + reg &= ~DWC3_GTXTHRCFG_TXPKTCNT(~0); + reg |= DWC3_GTXTHRCFG_TXPKTCNT(tx_thr_num); + + reg &= ~DWC3_GTXTHRCFG_MAXTXBURSTSIZE(~0); + reg |= DWC3_GTXTHRCFG_MAXTXBURSTSIZE(tx_maxburst); + + dwc3_writel(dwc->regs, DWC3_GTXTHRCFG, reg); + } + } else { + if (rx_thr_num && rx_maxburst) { + reg = dwc3_readl(dwc->regs, DWC3_GRXTHRCFG); + reg |= DWC31_GRXTHRCFG_PKTCNTSEL; + + reg &= ~DWC31_GRXTHRCFG_RXPKTCNT(~0); + reg |= DWC31_GRXTHRCFG_RXPKTCNT(rx_thr_num); + + reg &= ~DWC31_GRXTHRCFG_MAXRXBURSTSIZE(~0); + reg |= DWC31_GRXTHRCFG_MAXRXBURSTSIZE(rx_maxburst); + + dwc3_writel(dwc->regs, DWC3_GRXTHRCFG, reg); + } + + if (tx_thr_num && tx_maxburst) { + reg = dwc3_readl(dwc->regs, DWC3_GTXTHRCFG); + reg |= DWC31_GTXTHRCFG_PKTCNTSEL; + + reg &= ~DWC31_GTXTHRCFG_TXPKTCNT(~0); + reg |= DWC31_GTXTHRCFG_TXPKTCNT(tx_thr_num); + + reg &= ~DWC31_GTXTHRCFG_MAXTXBURSTSIZE(~0); + reg |= DWC31_GTXTHRCFG_MAXTXBURSTSIZE(tx_maxburst); + + dwc3_writel(dwc->regs, DWC3_GTXTHRCFG, reg); + } + } +} + /** * dwc3_core_init - Low-level initialization of DWC3 Core * @dwc: Pointer to our controller context structure @@ -1246,42 +1351,7 @@ dwc3_writel(dwc->regs, DWC3_GUCTL1, reg); } - /* - * Must config both number of packets and max burst settings to enable - * RX and/or TX threshold. - */ - if (!DWC3_IP_IS(DWC3) && dwc->dr_mode == USB_DR_MODE_HOST) { - u8 rx_thr_num = dwc->rx_thr_num_pkt_prd; - u8 rx_maxburst = dwc->rx_max_burst_prd; - u8 tx_thr_num = dwc->tx_thr_num_pkt_prd; - u8 tx_maxburst = dwc->tx_max_burst_prd; - - if (rx_thr_num && rx_maxburst) { - reg = dwc3_readl(dwc->regs, DWC3_GRXTHRCFG); - reg |= DWC31_RXTHRNUMPKTSEL_PRD; - - reg &= ~DWC31_RXTHRNUMPKT_PRD(~0); - reg |= DWC31_RXTHRNUMPKT_PRD(rx_thr_num); - - reg &= ~DWC31_MAXRXBURSTSIZE_PRD(~0); - reg |= DWC31_MAXRXBURSTSIZE_PRD(rx_maxburst); - - dwc3_writel(dwc->regs, DWC3_GRXTHRCFG, reg); - } - - if (tx_thr_num && tx_maxburst) { - reg = dwc3_readl(dwc->regs, DWC3_GTXTHRCFG); - reg |= DWC31_TXTHRNUMPKTSEL_PRD; - - reg &= ~DWC31_TXTHRNUMPKT_PRD(~0); - reg |= DWC31_TXTHRNUMPKT_PRD(tx_thr_num); - - reg &= ~DWC31_MAXTXBURSTSIZE_PRD(~0); - reg |= DWC31_MAXTXBURSTSIZE_PRD(tx_maxburst); - - dwc3_writel(dwc->regs, DWC3_GTXTHRCFG, reg); - } - } + dwc3_config_threshold(dwc); return 0; @@ -1417,6 +1487,10 @@ u8 lpm_nyet_threshold; u8 tx_de_emphasis; u8 hird_threshold; + u8 rx_thr_num_pkt = 0; + u8 rx_max_burst = 0; + u8 tx_thr_num_pkt = 0; + u8 tx_max_burst = 0; u8 rx_thr_num_pkt_prd = 0; u8 rx_max_burst_prd = 0; u8 tx_thr_num_pkt_prd = 0; @@ -1479,6 +1553,14 @@ "snps,usb2-lpm-disable"); dwc->usb2_gadget_lpm_disable = device_property_read_bool(dev, "snps,usb2-gadget-lpm-disable"); + device_property_read_u8(dev, "snps,rx-thr-num-pkt", + &rx_thr_num_pkt); + device_property_read_u8(dev, "snps,rx-max-burst", + &rx_max_burst); + device_property_read_u8(dev, "snps,tx-thr-num-pkt", + &tx_thr_num_pkt); + device_property_read_u8(dev, "snps,tx-max-burst", + &tx_max_burst); device_property_read_u8(dev, "snps,rx-thr-num-pkt-prd", &rx_thr_num_pkt_prd); device_property_read_u8(dev, "snps,rx-max-burst-prd", @@ -1560,6 +1642,12 @@ dwc->hird_threshold = hird_threshold; + dwc->rx_thr_num_pkt = rx_thr_num_pkt; + dwc->rx_max_burst = rx_max_burst; + + dwc->tx_thr_num_pkt = tx_thr_num_pkt; + dwc->tx_max_burst = tx_max_burst; + dwc->rx_thr_num_pkt_prd = rx_thr_num_pkt_prd; dwc->rx_max_burst_prd = rx_max_burst_prd; @@ -1918,6 +2006,8 @@ pm_runtime_put(dev); + dma_set_max_seg_size(dev, UINT_MAX); + return 0; err_exit_debugfs: diff -u linux-aws-6.5-6.5.0/drivers/usb/gadget/function/f_ncm.c linux-aws-6.5-6.5.0/drivers/usb/gadget/function/f_ncm.c --- linux-aws-6.5-6.5.0/drivers/usb/gadget/function/f_ncm.c +++ linux-aws-6.5-6.5.0/drivers/usb/gadget/function/f_ncm.c @@ -1425,7 +1425,7 @@ struct usb_composite_dev *cdev = c->cdev; struct f_ncm *ncm = func_to_ncm(f); struct usb_string *us; - int status; + int status = 0; struct usb_ep *ep; struct f_ncm_opts *ncm_opts; @@ -1443,22 +1443,17 @@ f->os_desc_table[0].os_desc = &ncm_opts->ncm_os_desc; } - /* - * in drivers/usb/gadget/configfs.c:configfs_composite_bind() - * configurations are bound in sequence with list_for_each_entry, - * in each configuration its functions are bound in sequence - * with list_for_each_entry, so we assume no race condition - * with regard to ncm_opts->bound access - */ - if (!ncm_opts->bound) { - mutex_lock(&ncm_opts->lock); - gether_set_gadget(ncm_opts->net, cdev->gadget); + mutex_lock(&ncm_opts->lock); + gether_set_gadget(ncm_opts->net, cdev->gadget); + if (!ncm_opts->bound) status = gether_register_netdev(ncm_opts->net); - mutex_unlock(&ncm_opts->lock); - if (status) - goto fail; - ncm_opts->bound = true; - } + mutex_unlock(&ncm_opts->lock); + + if (status) + goto fail; + + ncm_opts->bound = true; + us = usb_gstrings_attach(cdev, ncm_strings, ARRAY_SIZE(ncm_string_defs)); if (IS_ERR(us)) { diff -u linux-aws-6.5-6.5.0/drivers/usb/gadget/udc/core.c linux-aws-6.5-6.5.0/drivers/usb/gadget/udc/core.c --- linux-aws-6.5-6.5.0/drivers/usb/gadget/udc/core.c +++ linux-aws-6.5-6.5.0/drivers/usb/gadget/udc/core.c @@ -1635,8 +1635,6 @@ dev_dbg(&udc->dev, "unbinding gadget driver [%s]\n", driver->function); - kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE); - udc->allow_connect = false; cancel_work_sync(&udc->vbus_work); mutex_lock(&udc->connect_lock); @@ -1656,6 +1654,8 @@ driver->is_bound = false; udc->driver = NULL; mutex_unlock(&udc_lock); + + kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE); } /* ------------------------------------------------------------------------- */ diff -u linux-aws-6.5-6.5.0/drivers/usb/misc/onboard_usb_hub.c linux-aws-6.5-6.5.0/drivers/usb/misc/onboard_usb_hub.c --- linux-aws-6.5-6.5.0/drivers/usb/misc/onboard_usb_hub.c +++ linux-aws-6.5-6.5.0/drivers/usb/misc/onboard_usb_hub.c @@ -412,6 +412,8 @@ { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2412) }, /* USB2412 USB 2.0 */ { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */ { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2517) }, /* USB2517 USB 2.0 */ + { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2744) }, /* USB5744 USB 2.0 */ + { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x5744) }, /* USB5744 USB 3.0 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x0414) }, /* RTS5414 USB 3.2 */ diff -u linux-aws-6.5-6.5.0/drivers/usb/misc/onboard_usb_hub.h linux-aws-6.5-6.5.0/drivers/usb/misc/onboard_usb_hub.h --- linux-aws-6.5-6.5.0/drivers/usb/misc/onboard_usb_hub.h +++ linux-aws-6.5-6.5.0/drivers/usb/misc/onboard_usb_hub.h @@ -14,6 +14,10 @@ .reset_us = 1, }; +static const struct onboard_hub_pdata microchip_usb5744_data = { + .reset_us = 0, +}; + static const struct onboard_hub_pdata realtek_rts5411_data = { .reset_us = 0, }; @@ -38,6 +42,8 @@ { .compatible = "usb424,2412", .data = µchip_usb424_data, }, { .compatible = "usb424,2514", .data = µchip_usb424_data, }, { .compatible = "usb424,2517", .data = µchip_usb424_data, }, + { .compatible = "usb424,2744", .data = µchip_usb5744_data, }, + { .compatible = "usb424,5744", .data = µchip_usb5744_data, }, { .compatible = "usb451,8140", .data = &ti_tusb8041_data, }, { .compatible = "usb451,8142", .data = &ti_tusb8041_data, }, { .compatible = "usb5e3,608", .data = &genesys_gl850g_data, }, diff -u linux-aws-6.5-6.5.0/drivers/usb/serial/option.c linux-aws-6.5-6.5.0/drivers/usb/serial/option.c --- linux-aws-6.5-6.5.0/drivers/usb/serial/option.c +++ linux-aws-6.5-6.5.0/drivers/usb/serial/option.c @@ -203,6 +203,9 @@ #define DELL_PRODUCT_5829E_ESIM 0x81e4 #define DELL_PRODUCT_5829E 0x81e6 +#define DELL_PRODUCT_FM101R_ESIM 0x8213 +#define DELL_PRODUCT_FM101R 0x8215 + #define KYOCERA_VENDOR_ID 0x0c88 #define KYOCERA_PRODUCT_KPC650 0x17da #define KYOCERA_PRODUCT_KPC680 0x180a @@ -606,6 +609,8 @@ #define UNISOC_VENDOR_ID 0x1782 /* TOZED LT70-C based on UNISOC SL8563 uses UNISOC's vendor ID */ #define TOZED_PRODUCT_LT70C 0x4055 +/* Luat Air72*U series based on UNISOC UIS8910 uses UNISOC's vendor ID */ +#define LUAT_PRODUCT_AIR720U 0x4e00 /* Device flags */ @@ -1108,6 +1113,8 @@ .driver_info = RSVD(0) | RSVD(6) }, { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5829E_ESIM), .driver_info = RSVD(0) | RSVD(6) }, + { USB_DEVICE_INTERFACE_CLASS(DELL_VENDOR_ID, DELL_PRODUCT_FM101R, 0xff) }, + { USB_DEVICE_INTERFACE_CLASS(DELL_VENDOR_ID, DELL_PRODUCT_FM101R_ESIM, 0xff) }, { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, @@ -1290,6 +1297,7 @@ .driver_info = NCTRL(0) | RSVD(3) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1033, 0xff), /* Telit LE910C1-EUX (ECM) */ .driver_info = NCTRL(0) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1035, 0xff) }, /* Telit LE910C4-WWX (ECM) */ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0), .driver_info = RSVD(0) | RSVD(1) | NCTRL(2) | RSVD(3) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG1), @@ -1540,7 +1548,8 @@ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff), .driver_info = RSVD(4) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0189, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0189, 0xff, 0xff, 0xff), + .driver_info = RSVD(4) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0191, 0xff, 0xff, 0xff), /* ZTE EuFi890 */ .driver_info = RSVD(4) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0196, 0xff, 0xff, 0xff) }, @@ -2243,6 +2252,7 @@ .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, { USB_DEVICE(0x1782, 0x4d10) }, /* Fibocom L610 (AT mode) */ { USB_DEVICE_INTERFACE_CLASS(0x1782, 0x4d11, 0xff) }, /* Fibocom L610 (ECM/RNDIS mode) */ + { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x0001, 0xff, 0xff, 0xff) }, /* Fibocom L716-EU (ECM/RNDIS mode) */ { USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */ .driver_info = RSVD(4) | RSVD(5) }, { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */ @@ -2262,8 +2272,10 @@ { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */ { USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) }, { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x30) }, + { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x40) }, { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) }, { } /* Terminating entry */ }; MODULE_DEVICE_TABLE(usb, option_ids); diff -u linux-aws-6.5-6.5.0/drivers/usb/typec/tcpm/tcpm.c linux-aws-6.5-6.5.0/drivers/usb/typec/tcpm/tcpm.c --- linux-aws-6.5-6.5.0/drivers/usb/typec/tcpm/tcpm.c +++ linux-aws-6.5-6.5.0/drivers/usb/typec/tcpm/tcpm.c @@ -1625,6 +1625,9 @@ if (PD_VDO_VID(p[0]) != USB_SID_PD) break; + if (IS_ERR_OR_NULL(port->partner)) + break; + if (PD_VDO_SVDM_VER(p[0]) < svdm_version) { typec_partner_set_svdm_version(port->partner, PD_VDO_SVDM_VER(p[0])); @@ -3970,6 +3973,8 @@ port->potential_contaminant = ((port->enter_state == SRC_ATTACH_WAIT && port->state == SRC_UNATTACHED) || (port->enter_state == SNK_ATTACH_WAIT && + port->state == SNK_UNATTACHED) || + (port->enter_state == SNK_DEBOUNCED && port->state == SNK_UNATTACHED)); port->enter_state = port->state; @@ -5450,6 +5455,15 @@ if (port->bist_request == BDO_MODE_TESTDATA && port->tcpc->set_bist_data) port->tcpc->set_bist_data(port->tcpc, false); + switch (port->state) { + case ERROR_RECOVERY: + case PORT_RESET: + case PORT_RESET_WAIT_OFF: + return; + default: + break; + } + if (port->ams != NONE_AMS) port->ams = NONE_AMS; if (port->hard_reset_count < PD_N_HARD_RESET_COUNT) diff -u linux-aws-6.5-6.5.0/drivers/xen/events/events_base.c linux-aws-6.5-6.5.0/drivers/xen/events/events_base.c --- linux-aws-6.5-6.5.0/drivers/xen/events/events_base.c +++ linux-aws-6.5-6.5.0/drivers/xen/events/events_base.c @@ -168,6 +168,8 @@ /* IRQ <-> IPI mapping */ static DEFINE_PER_CPU(int [XEN_NR_IPIS], ipi_to_irq) = {[0 ... XEN_NR_IPIS-1] = -1}; +/* Cache for IPI event channels - needed for hot cpu unplug (avoid RCU usage). */ +static DEFINE_PER_CPU(evtchn_port_t [XEN_NR_IPIS], ipi_to_evtchn) = {[0 ... XEN_NR_IPIS-1] = 0}; /* Event channel distribution data */ static atomic_t channels_on_cpu[NR_CPUS]; @@ -370,6 +372,7 @@ info->u.ipi = ipi; per_cpu(ipi_to_irq, cpu)[ipi] = irq; + per_cpu(ipi_to_evtchn, cpu)[ipi] = evtchn; return xen_irq_info_common_setup(info, irq, IRQT_IPI, evtchn, 0); } @@ -613,7 +616,9 @@ spin_lock_irqsave(&eoi->eoi_list_lock, flags); - if (list_empty(&eoi->eoi_list)) { + elem = list_first_entry_or_null(&eoi->eoi_list, struct irq_info, + eoi_list); + if (!elem || info->eoi_time < elem->eoi_time) { list_add(&info->eoi_list, &eoi->eoi_list); mod_delayed_work_on(info->eoi_cpu, system_wq, &eoi->delayed, delay); @@ -993,6 +998,7 @@ break; case IRQT_IPI: per_cpu(ipi_to_irq, cpu)[ipi_from_irq(irq)] = -1; + per_cpu(ipi_to_evtchn, cpu)[ipi_from_irq(irq)] = 0; break; case IRQT_EVTCHN: dev = info->u.interdomain; @@ -1643,7 +1649,7 @@ void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector) { - int irq; + evtchn_port_t evtchn; #ifdef CONFIG_X86 if (unlikely(vector == XEN_NMI_VECTOR)) { @@ -1654,9 +1660,9 @@ return; } #endif - irq = per_cpu(ipi_to_irq, cpu)[vector]; - BUG_ON(irq < 0); - notify_remote_via_irq(irq); + evtchn = per_cpu(ipi_to_evtchn, cpu)[vector]; + BUG_ON(evtchn == 0); + notify_remote_via_evtchn(evtchn); } struct evtchn_loop_ctrl { @@ -1714,7 +1720,7 @@ generic_handle_irq(irq); } -static int __xen_evtchn_do_upcall(void) +int xen_evtchn_do_upcall(void) { struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); int ret = vcpu_info->evtchn_upcall_pending ? IRQ_HANDLED : IRQ_NONE; @@ -1752,24 +1758,7 @@ return ret; } - -void xen_evtchn_do_upcall(struct pt_regs *regs) -{ - struct pt_regs *old_regs = set_irq_regs(regs); - - irq_enter(); - - __xen_evtchn_do_upcall(); - - irq_exit(); - set_irq_regs(old_regs); -} - -int xen_hvm_evtchn_do_upcall(void) -{ - return __xen_evtchn_do_upcall(); -} -EXPORT_SYMBOL_GPL(xen_hvm_evtchn_do_upcall); +EXPORT_SYMBOL_GPL(xen_evtchn_do_upcall); /* Rebind a new event channel to an existing irq. */ void rebind_evtchn_irq(evtchn_port_t evtchn, int irq) diff -u linux-aws-6.5-6.5.0/drivers/xen/xenbus/xenbus_probe.c linux-aws-6.5-6.5.0/drivers/xen/xenbus/xenbus_probe.c --- linux-aws-6.5-6.5.0/drivers/xen/xenbus/xenbus_probe.c +++ linux-aws-6.5-6.5.0/drivers/xen/xenbus/xenbus_probe.c @@ -1092,7 +1092,7 @@ if (err < 0) { pr_err("xenstore_late_init couldn't bind irq err=%d\n", err); - return err; + goto out_error; } xs_init_irq = err; diff -u linux-aws-6.5-6.5.0/fs/btrfs/block-group.c linux-aws-6.5-6.5.0/fs/btrfs/block-group.c --- linux-aws-6.5-6.5.0/fs/btrfs/block-group.c +++ linux-aws-6.5-6.5.0/fs/btrfs/block-group.c @@ -2587,7 +2587,7 @@ btrfs_set_dev_extent_chunk_offset(leaf, extent, chunk_offset); btrfs_set_dev_extent_length(leaf, extent, num_bytes); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); out: btrfs_free_path(path); return ret; @@ -3011,7 +3011,7 @@ cache->global_root_id); btrfs_set_stack_block_group_flags(&bgi, cache->flags); write_extent_buffer(leaf, &bgi, bi, sizeof(bgi)); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); fail: btrfs_release_path(path); /* diff -u linux-aws-6.5-6.5.0/fs/btrfs/delayed-inode.c linux-aws-6.5-6.5.0/fs/btrfs/delayed-inode.c --- linux-aws-6.5-6.5.0/fs/btrfs/delayed-inode.c +++ linux-aws-6.5-6.5.0/fs/btrfs/delayed-inode.c @@ -1030,7 +1030,7 @@ struct btrfs_inode_item); write_extent_buffer(leaf, &node->inode_item, (unsigned long)inode_item, sizeof(struct btrfs_inode_item)); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); if (!test_bit(BTRFS_DELAYED_NODE_DEL_IREF, &node->flags)) goto out; diff -u linux-aws-6.5-6.5.0/fs/btrfs/disk-io.c linux-aws-6.5-6.5.0/fs/btrfs/disk-io.c --- linux-aws-6.5-6.5.0/fs/btrfs/disk-io.c +++ linux-aws-6.5-6.5.0/fs/btrfs/disk-io.c @@ -872,7 +872,7 @@ } root->node = leaf; - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); root->commit_root = btrfs_root_node(root); set_bit(BTRFS_ROOT_TRACK_DIRTY, &root->state); @@ -947,7 +947,7 @@ root->node = leaf; - btrfs_mark_buffer_dirty(root->node); + btrfs_mark_buffer_dirty(trans, root->node); btrfs_tree_unlock(root->node); return 0; @@ -3152,6 +3152,7 @@ goto fail_alloc; } + btrfs_info(fs_info, "first mount of filesystem %pU", disk_super->fsid); /* * Verify the type first, if that or the checksum value are * corrupted, we'll find out @@ -4426,7 +4427,8 @@ btrfs_close_devices(fs_info->fs_devices); } -void btrfs_mark_buffer_dirty(struct extent_buffer *buf) +void btrfs_mark_buffer_dirty(struct btrfs_trans_handle *trans, + struct extent_buffer *buf) { struct btrfs_fs_info *fs_info = buf->fs_info; u64 transid = btrfs_header_generation(buf); @@ -4440,10 +4442,14 @@ if (unlikely(test_bit(EXTENT_BUFFER_UNMAPPED, &buf->bflags))) return; #endif + /* This is an active transaction (its state < TRANS_STATE_UNBLOCKED). */ + ASSERT(trans->transid == fs_info->generation); btrfs_assert_tree_write_locked(buf); - if (transid != fs_info->generation) + if (transid != fs_info->generation) { WARN(1, KERN_CRIT "btrfs transid mismatch buffer %llu, found %llu running %llu\n", buf->start, transid, fs_info->generation); + btrfs_abort_transaction(trans, -EUCLEAN); + } set_extent_buffer_dirty(buf); #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY /* diff -u linux-aws-6.5-6.5.0/fs/btrfs/extent-tree.c linux-aws-6.5-6.5.0/fs/btrfs/extent-tree.c --- linux-aws-6.5-6.5.0/fs/btrfs/extent-tree.c +++ linux-aws-6.5-6.5.0/fs/btrfs/extent-tree.c @@ -187,8 +187,10 @@ num_refs = btrfs_extent_refs(leaf, ei); extent_flags = btrfs_extent_flags(leaf, ei); } else { - ret = -EINVAL; - btrfs_print_v0_err(fs_info); + ret = -EUCLEAN; + btrfs_err(fs_info, + "unexpected extent item size, has %u expect >= %zu", + item_size, sizeof(*ei)); if (trans) btrfs_abort_transaction(trans, ret); else @@ -594,7 +596,7 @@ btrfs_set_extent_data_ref_count(leaf, ref, num_refs); } } - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); ret = 0; fail: btrfs_release_path(path); @@ -624,12 +626,12 @@ ref2 = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_shared_data_ref); num_refs = btrfs_shared_data_ref_count(leaf, ref2); - } else if (unlikely(key.type == BTRFS_EXTENT_REF_V0_KEY)) { - btrfs_print_v0_err(trans->fs_info); - btrfs_abort_transaction(trans, -EINVAL); - return -EINVAL; } else { - BUG(); + btrfs_err(trans->fs_info, + "unrecognized backref key (%llu %u %llu)", + key.objectid, key.type, key.offset); + btrfs_abort_transaction(trans, -EUCLEAN); + return -EUCLEAN; } BUG_ON(num_refs < refs_to_drop); @@ -642,7 +644,7 @@ btrfs_set_extent_data_ref_count(leaf, ref1, num_refs); else if (key.type == BTRFS_SHARED_DATA_REF_KEY) btrfs_set_shared_data_ref_count(leaf, ref2, num_refs); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); } return ret; } @@ -660,7 +662,6 @@ leaf = path->nodes[0]; btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); - BUG_ON(key.type == BTRFS_EXTENT_REF_V0_KEY); if (iref) { /* * If type is invalid, we should have bailed out earlier than @@ -881,8 +882,10 @@ leaf = path->nodes[0]; item_size = btrfs_item_size(leaf, path->slots[0]); if (unlikely(item_size < sizeof(*ei))) { - err = -EINVAL; - btrfs_print_v0_err(fs_info); + err = -EUCLEAN; + btrfs_err(fs_info, + "unexpected extent item size, has %llu expect >= %zu", + item_size, sizeof(*ei)); btrfs_abort_transaction(trans, err); goto out; } @@ -994,7 +997,7 @@ * helper to add new inline back ref */ static noinline_for_stack -void setup_inline_extent_backref(struct btrfs_fs_info *fs_info, +void setup_inline_extent_backref(struct btrfs_trans_handle *trans, struct btrfs_path *path, struct btrfs_extent_inline_ref *iref, u64 parent, u64 root_objectid, @@ -1017,7 +1020,7 @@ type = extent_ref_type(parent, owner); size = btrfs_extent_inline_ref_size(type); - btrfs_extend_item(path, size); + btrfs_extend_item(trans, path, size); ei = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_item); refs = btrfs_extent_refs(leaf, ei); @@ -1051,7 +1054,7 @@ } else { btrfs_set_extent_inline_ref_offset(leaf, iref, root_objectid); } - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); } static int lookup_extent_backref(struct btrfs_trans_handle *trans, @@ -1084,7 +1087,9 @@ /* * helper to update/remove inline back ref */ -static noinline_for_stack int update_inline_extent_backref(struct btrfs_path *path, +static noinline_for_stack int update_inline_extent_backref( + struct btrfs_trans_handle *trans, + struct btrfs_path *path, struct btrfs_extent_inline_ref *iref, int refs_to_mod, struct btrfs_delayed_extent_op *extent_op) @@ -1192,9 +1197,9 @@ memmove_extent_buffer(leaf, ptr, ptr + size, end - ptr - size); item_size -= size; - btrfs_truncate_item(path, item_size, 1); + btrfs_truncate_item(trans, path, item_size, 1); } - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); return 0; } @@ -1224,9 +1229,10 @@ bytenr, num_bytes, root_objectid, path->slots[0]); return -EUCLEAN; } - ret = update_inline_extent_backref(path, iref, refs_to_add, extent_op); + ret = update_inline_extent_backref(trans, path, iref, + refs_to_add, extent_op); } else if (ret == -ENOENT) { - setup_inline_extent_backref(trans->fs_info, path, iref, parent, + setup_inline_extent_backref(trans, path, iref, parent, root_objectid, owner, offset, refs_to_add, extent_op); ret = 0; @@ -1244,7 +1250,8 @@ BUG_ON(!is_data && refs_to_drop != 1); if (iref) - ret = update_inline_extent_backref(path, iref, -refs_to_drop, NULL); + ret = update_inline_extent_backref(trans, path, iref, + -refs_to_drop, NULL); else if (is_data) ret = remove_extent_data_ref(trans, root, path, refs_to_drop); else @@ -1528,7 +1535,7 @@ if (extent_op) __run_delayed_extent_op(extent_op, leaf, item); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); /* now insert the actual backref */ @@ -1683,8 +1690,10 @@ item_size = btrfs_item_size(leaf, path->slots[0]); if (unlikely(item_size < sizeof(*ei))) { - err = -EINVAL; - btrfs_print_v0_err(fs_info); + err = -EUCLEAN; + btrfs_err(fs_info, + "unexpected extent item size, has %u expect >= %zu", + item_size, sizeof(*ei)); btrfs_abort_transaction(trans, err); goto out; } @@ -1692,7 +1701,7 @@ ei = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_item); __run_delayed_extent_op(extent_op, leaf, ei); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); out: btrfs_free_path(path); return err; @@ -1715,12 +1724,12 @@ parent = ref->parent; ref_root = ref->root; - if (node->ref_mod != 1) { + if (unlikely(node->ref_mod != 1)) { btrfs_err(trans->fs_info, - "btree block(%llu) has %d references rather than 1: action %d ref_root %llu parent %llu", + "btree block %llu has %d references rather than 1: action %d ref_root %llu parent %llu", node->bytenr, node->ref_mod, node->action, ref_root, parent); - return -EIO; + return -EUCLEAN; } if (node->action == BTRFS_ADD_DELAYED_REF && insert_reserved) { BUG_ON(!extent_op || !extent_op->update_flags); @@ -3113,8 +3122,10 @@ leaf = path->nodes[0]; item_size = btrfs_item_size(leaf, extent_slot); if (unlikely(item_size < sizeof(*ei))) { - ret = -EINVAL; - btrfs_print_v0_err(info); + ret = -EUCLEAN; + btrfs_err(trans->fs_info, + "unexpected extent item size, has %u expect >= %zu", + item_size, sizeof(*ei)); btrfs_abort_transaction(trans, ret); goto out; } @@ -3164,7 +3175,7 @@ } } else { btrfs_set_extent_refs(leaf, ei, refs); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); } if (found_extent) { ret = remove_extent_backref(trans, extent_root, path, @@ -4672,7 +4683,7 @@ btrfs_set_extent_data_ref_count(leaf, ref, ref_mod); } - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); btrfs_free_path(path); return alloc_reserved_extent(trans, ins->objectid, ins->offset); @@ -4747,7 +4758,7 @@ btrfs_set_extent_inline_ref_offset(leaf, iref, ref->root); } - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_free_path(path); return alloc_reserved_extent(trans, node->bytenr, fs_info->nodesize); diff -u linux-aws-6.5-6.5.0/fs/btrfs/extent_io.c linux-aws-6.5-6.5.0/fs/btrfs/extent_io.c --- linux-aws-6.5-6.5.0/fs/btrfs/extent_io.c +++ linux-aws-6.5-6.5.0/fs/btrfs/extent_io.c @@ -724,8 +724,8 @@ * the array will be skipped * * Return: 0 if all pages were able to be allocated; - * -ENOMEM otherwise, and the caller is responsible for freeing all - * non-null page pointers in the array. + * -ENOMEM otherwise, the partially allocated pages would be freed and + * the array slots zeroed */ int btrfs_alloc_page_array(unsigned int nr_pages, struct page **page_array) { @@ -744,8 +744,13 @@ * though alloc_pages_bulk_array() falls back to alloc_page() * if it could not bulk-allocate. So we must be out of memory. */ - if (allocated == last) + if (allocated == last) { + for (int i = 0; i < allocated; i++) { + __free_page(page_array[i]); + page_array[i] = NULL; + } return -ENOMEM; + } memalloc_retry_wait(GFP_NOFS); } diff -u linux-aws-6.5-6.5.0/fs/btrfs/file-item.c linux-aws-6.5-6.5.0/fs/btrfs/file-item.c --- linux-aws-6.5-6.5.0/fs/btrfs/file-item.c +++ linux-aws-6.5-6.5.0/fs/btrfs/file-item.c @@ -194,7 +194,7 @@ btrfs_set_file_extent_encryption(leaf, item, 0); btrfs_set_file_extent_other_encoding(leaf, item, 0); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); out: btrfs_free_path(path); return ret; @@ -811,11 +811,12 @@ * This calls btrfs_truncate_item with the correct args based on the overlap, * and fixes up the key as required. */ -static noinline void truncate_one_csum(struct btrfs_fs_info *fs_info, +static noinline void truncate_one_csum(struct btrfs_trans_handle *trans, struct btrfs_path *path, struct btrfs_key *key, u64 bytenr, u64 len) { + struct btrfs_fs_info *fs_info = trans->fs_info; struct extent_buffer *leaf; const u32 csum_size = fs_info->csum_size; u64 csum_end; @@ -836,7 +837,7 @@ */ u32 new_size = (bytenr - key->offset) >> blocksize_bits; new_size *= csum_size; - btrfs_truncate_item(path, new_size, 1); + btrfs_truncate_item(trans, path, new_size, 1); } else if (key->offset >= bytenr && csum_end > end_byte && end_byte > key->offset) { /* @@ -848,10 +849,10 @@ u32 new_size = (csum_end - end_byte) >> blocksize_bits; new_size *= csum_size; - btrfs_truncate_item(path, new_size, 0); + btrfs_truncate_item(trans, path, new_size, 0); key->offset = end_byte; - btrfs_set_item_key_safe(fs_info, path, key); + btrfs_set_item_key_safe(trans, path, key); } else { BUG(); } @@ -994,7 +995,7 @@ key.offset = end_byte - 1; } else { - truncate_one_csum(fs_info, path, &key, bytenr, len); + truncate_one_csum(trans, path, &key, bytenr, len); if (key.offset < bytenr) break; } @@ -1202,7 +1203,7 @@ diff /= csum_size; diff *= csum_size; - btrfs_extend_item(path, diff); + btrfs_extend_item(trans, path, diff); ret = 0; goto csum; } @@ -1249,7 +1250,7 @@ ins_size /= csum_size; total_bytes += ins_size * fs_info->sectorsize; - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); if (total_bytes < sums->len) { btrfs_release_path(path); cond_resched(); diff -u linux-aws-6.5-6.5.0/fs/btrfs/file.c linux-aws-6.5-6.5.0/fs/btrfs/file.c --- linux-aws-6.5-6.5.0/fs/btrfs/file.c +++ linux-aws-6.5-6.5.0/fs/btrfs/file.c @@ -368,7 +368,7 @@ btrfs_set_file_extent_offset(leaf, fi, extent_offset); btrfs_set_file_extent_num_bytes(leaf, fi, extent_end - args->start); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); if (update_refs && disk_bytenr > 0) { btrfs_init_generic_ref(&ref, @@ -405,13 +405,13 @@ memcpy(&new_key, &key, sizeof(new_key)); new_key.offset = args->end; - btrfs_set_item_key_safe(fs_info, path, &new_key); + btrfs_set_item_key_safe(trans, path, &new_key); extent_offset += args->end - key.offset; btrfs_set_file_extent_offset(leaf, fi, extent_offset); btrfs_set_file_extent_num_bytes(leaf, fi, extent_end - args->end); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); if (update_refs && disk_bytenr > 0) args->bytes_found += args->end - key.offset; break; @@ -431,7 +431,7 @@ btrfs_set_file_extent_num_bytes(leaf, fi, args->start - key.offset); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); if (update_refs && disk_bytenr > 0) args->bytes_found += extent_end - args->start; if (args->end == extent_end) @@ -536,7 +536,8 @@ if (btrfs_comp_cpu_keys(&key, &slot_key) > 0) path->slots[0]++; } - btrfs_setup_item_for_insert(root, path, &key, args->extent_item_size); + btrfs_setup_item_for_insert(trans, root, path, &key, + args->extent_item_size); args->extent_inserted = true; } @@ -593,7 +594,6 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, struct btrfs_inode *inode, u64 start, u64 end) { - struct btrfs_fs_info *fs_info = trans->fs_info; struct btrfs_root *root = inode->root; struct extent_buffer *leaf; struct btrfs_path *path; @@ -664,7 +664,7 @@ ino, bytenr, orig_offset, &other_start, &other_end)) { new_key.offset = end; - btrfs_set_item_key_safe(fs_info, path, &new_key); + btrfs_set_item_key_safe(trans, path, &new_key); fi = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_file_extent_item); btrfs_set_file_extent_generation(leaf, fi, @@ -679,7 +679,7 @@ trans->transid); btrfs_set_file_extent_num_bytes(leaf, fi, end - other_start); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); goto out; } } @@ -698,7 +698,7 @@ trans->transid); path->slots[0]++; new_key.offset = start; - btrfs_set_item_key_safe(fs_info, path, &new_key); + btrfs_set_item_key_safe(trans, path, &new_key); fi = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_file_extent_item); @@ -708,7 +708,7 @@ other_end - start); btrfs_set_file_extent_offset(leaf, fi, start - orig_offset); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); goto out; } } @@ -742,7 +742,7 @@ btrfs_set_file_extent_offset(leaf, fi, split - orig_offset); btrfs_set_file_extent_num_bytes(leaf, fi, extent_end - split); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_init_generic_ref(&ref, BTRFS_ADD_DELAYED_REF, bytenr, num_bytes, 0); @@ -814,7 +814,7 @@ btrfs_set_file_extent_type(leaf, fi, BTRFS_FILE_EXTENT_REG); btrfs_set_file_extent_generation(leaf, fi, trans->transid); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); } else { fi = btrfs_item_ptr(leaf, del_slot - 1, struct btrfs_file_extent_item); @@ -823,7 +823,7 @@ btrfs_set_file_extent_generation(leaf, fi, trans->transid); btrfs_set_file_extent_num_bytes(leaf, fi, extent_end - key.offset); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); ret = btrfs_del_items(trans, root, path, del_slot, del_nr); if (ret < 0) { @@ -2103,7 +2103,7 @@ btrfs_set_file_extent_ram_bytes(leaf, fi, num_bytes); btrfs_set_file_extent_offset(leaf, fi, 0); btrfs_set_file_extent_generation(leaf, fi, trans->transid); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); goto out; } @@ -2111,7 +2111,7 @@ u64 num_bytes; key.offset = offset; - btrfs_set_item_key_safe(fs_info, path, &key); + btrfs_set_item_key_safe(trans, path, &key); fi = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_file_extent_item); num_bytes = btrfs_file_extent_num_bytes(leaf, fi) + end - @@ -2120,7 +2120,7 @@ btrfs_set_file_extent_ram_bytes(leaf, fi, num_bytes); btrfs_set_file_extent_offset(leaf, fi, 0); btrfs_set_file_extent_generation(leaf, fi, trans->transid); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); goto out; } btrfs_release_path(path); @@ -2272,7 +2272,7 @@ btrfs_set_file_extent_num_bytes(leaf, extent, replace_len); if (extent_info->is_new_extent) btrfs_set_file_extent_generation(leaf, extent, trans->transid); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); ret = btrfs_inode_set_file_extent_range(inode, extent_info->file_offset, diff -u linux-aws-6.5-6.5.0/fs/btrfs/inode.c linux-aws-6.5-6.5.0/fs/btrfs/inode.c --- linux-aws-6.5-6.5.0/fs/btrfs/inode.c +++ linux-aws-6.5-6.5.0/fs/btrfs/inode.c @@ -573,7 +573,7 @@ kunmap_local(kaddr); put_page(page); } - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); /* @@ -3072,7 +3072,7 @@ btrfs_item_ptr_offset(leaf, path->slots[0]), sizeof(struct btrfs_file_extent_item)); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); /* @@ -4134,7 +4134,7 @@ struct btrfs_inode_item); fill_inode_item(trans, leaf, inode_item, &inode->vfs_inode); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_set_inode_last_trans(trans, inode); ret = 0; failed: @@ -6476,7 +6476,7 @@ } } - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); /* * We don't need the path anymore, plus inheriting properties, adding * ACLs, security xattrs, orphan item or adding the link, will result in @@ -7142,8 +7142,15 @@ int ret; alloc_hint = get_extent_allocation_hint(inode, start, len); +again: ret = btrfs_reserve_extent(root, len, len, fs_info->sectorsize, 0, alloc_hint, &ins, 1, 1); + if (ret == -EAGAIN) { + ASSERT(btrfs_is_zoned(fs_info)); + wait_on_bit_io(&inode->root->fs_info->flags, BTRFS_FS_NEED_ZONE_FINISH, + TASK_UNINTERRUPTIBLE); + goto again; + } if (ret) return ERR_PTR(ret); @@ -9630,7 +9637,7 @@ ptr = btrfs_file_extent_inline_start(ei); write_extent_buffer(leaf, symname, ptr, name_len); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_free_path(path); d_instantiate_new(dentry, inode); diff -u linux-aws-6.5-6.5.0/fs/btrfs/ioctl.c linux-aws-6.5-6.5.0/fs/btrfs/ioctl.c --- linux-aws-6.5-6.5.0/fs/btrfs/ioctl.c +++ linux-aws-6.5-6.5.0/fs/btrfs/ioctl.c @@ -663,7 +663,7 @@ goto out; } - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); inode_item = &root_item->inode; btrfs_set_stack_inode_generation(inode_item, 1); @@ -1528,7 +1528,7 @@ static noinline int copy_to_sk(struct btrfs_path *path, struct btrfs_key *key, struct btrfs_ioctl_search_key *sk, - size_t *buf_size, + u64 *buf_size, char __user *ubuf, unsigned long *sk_offset, int *num_found) @@ -1660,7 +1660,7 @@ static noinline int search_ioctl(struct inode *inode, struct btrfs_ioctl_search_key *sk, - size_t *buf_size, + u64 *buf_size, char __user *ubuf) { struct btrfs_fs_info *info = btrfs_sb(inode->i_sb); @@ -1733,7 +1733,7 @@ struct btrfs_ioctl_search_args __user *uargs = argp; struct btrfs_ioctl_search_key sk; int ret; - size_t buf_size; + u64 buf_size; if (!capable(CAP_SYS_ADMIN)) return -EPERM; @@ -1763,8 +1763,8 @@ struct btrfs_ioctl_search_args_v2 __user *uarg = argp; struct btrfs_ioctl_search_args_v2 args; int ret; - size_t buf_size; - const size_t buf_limit = SZ_16M; + u64 buf_size; + const u64 buf_limit = SZ_16M; if (!capable(CAP_SYS_ADMIN)) return -EPERM; @@ -2947,7 +2947,7 @@ btrfs_cpu_key_to_disk(&disk_key, &new_root->root_key); btrfs_set_dir_item_key(path->nodes[0], di, &disk_key); - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); btrfs_release_path(path); btrfs_set_fs_incompat(fs_info, DEFAULT_SUBVOL); @@ -2978,7 +2978,7 @@ static long btrfs_ioctl_space_info(struct btrfs_fs_info *fs_info, void __user *arg) { - struct btrfs_ioctl_space_args space_args; + struct btrfs_ioctl_space_args space_args = { 0 }; struct btrfs_ioctl_space_info space; struct btrfs_ioctl_space_info *dest; struct btrfs_ioctl_space_info *dest_orig; @@ -4338,7 +4338,7 @@ if (compat) { #if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT) - struct btrfs_ioctl_send_args_32 args32; + struct btrfs_ioctl_send_args_32 args32 = { 0 }; ret = copy_from_user(&args32, argp, sizeof(args32)); if (ret) @@ -4351,6 +4351,7 @@ arg->clone_sources = compat_ptr(args32.clone_sources); arg->parent_root = args32.parent_root; arg->flags = args32.flags; + arg->version = args32.version; memcpy(arg->reserved, args32.reserved, sizeof(args32.reserved)); #else diff -u linux-aws-6.5-6.5.0/fs/btrfs/relocation.c linux-aws-6.5-6.5.0/fs/btrfs/relocation.c --- linux-aws-6.5-6.5.0/fs/btrfs/relocation.c +++ linux-aws-6.5-6.5.0/fs/btrfs/relocation.c @@ -466,6 +466,7 @@ * cached. */ static noinline_for_stack struct btrfs_backref_node *build_backref_tree( + struct btrfs_trans_handle *trans, struct reloc_control *rc, struct btrfs_key *node_key, int level, u64 bytenr) { @@ -499,8 +500,8 @@ /* Breadth-first search to build backref cache */ do { - ret = btrfs_backref_add_tree_node(cache, path, iter, node_key, - cur); + ret = btrfs_backref_add_tree_node(trans, cache, path, iter, + node_key, cur); if (ret < 0) { err = ret; goto out; @@ -1180,7 +1181,7 @@ } } if (dirty) - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); if (inode) btrfs_add_delayed_iput(BTRFS_I(inode)); return ret; @@ -1373,13 +1374,13 @@ */ btrfs_set_node_blockptr(parent, slot, new_bytenr); btrfs_set_node_ptr_generation(parent, slot, new_ptr_gen); - btrfs_mark_buffer_dirty(parent); + btrfs_mark_buffer_dirty(trans, parent); btrfs_set_node_blockptr(path->nodes[level], path->slots[level], old_bytenr); btrfs_set_node_ptr_generation(path->nodes[level], path->slots[level], old_ptr_gen); - btrfs_mark_buffer_dirty(path->nodes[level]); + btrfs_mark_buffer_dirty(trans, path->nodes[level]); btrfs_init_generic_ref(&ref, BTRFS_ADD_DELAYED_REF, old_bytenr, blocksize, path->nodes[level]->start); @@ -2516,7 +2517,7 @@ node->eb->start); btrfs_set_node_ptr_generation(upper->eb, slot, trans->transid); - btrfs_mark_buffer_dirty(upper->eb); + btrfs_mark_buffer_dirty(trans, upper->eb); btrfs_init_generic_ref(&ref, BTRFS_ADD_DELAYED_REF, node->eb->start, blocksize, @@ -2803,7 +2804,7 @@ /* Do tree relocation */ rbtree_postorder_for_each_entry_safe(block, next, blocks, rb_node) { - node = build_backref_tree(rc, &block->key, + node = build_backref_tree(trans, rc, &block->key, block->level, block->bytenr); if (IS_ERR(node)) { err = PTR_ERR(node); @@ -3256,12 +3257,13 @@ if (type == BTRFS_TREE_BLOCK_REF_KEY) owner = btrfs_extent_inline_ref_offset(eb, iref); } - } else if (unlikely(item_size == sizeof(struct btrfs_extent_item_v0))) { - btrfs_print_v0_err(eb->fs_info); - btrfs_handle_fs_error(eb->fs_info, -EINVAL, NULL); - return -EINVAL; } else { - BUG(); + btrfs_print_leaf(eb); + btrfs_err(rc->block_group->fs_info, + "unrecognized tree backref at tree block %llu slot %u", + eb->start, path->slots[0]); + btrfs_release_path(path); + return -EUCLEAN; } btrfs_release_path(path); @@ -3831,7 +3833,7 @@ btrfs_set_inode_mode(leaf, item, S_IFREG | 0600); btrfs_set_inode_flags(leaf, item, BTRFS_INODE_NOCOMPRESS | BTRFS_INODE_PREALLOC); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); out: btrfs_free_path(path); return ret; diff -u linux-aws-6.5-6.5.0/fs/btrfs/scrub.c linux-aws-6.5-6.5.0/fs/btrfs/scrub.c --- linux-aws-6.5-6.5.0/fs/btrfs/scrub.c +++ linux-aws-6.5-6.5.0/fs/btrfs/scrub.c @@ -1803,6 +1803,9 @@ */ ASSERT(sctx->cur_stripe < SCRUB_TOTAL_STRIPES); + /* @found_logical_ret must be specified. */ + ASSERT(found_logical_ret); + stripe = &sctx->stripes[sctx->cur_stripe]; scrub_reset_stripe(stripe); ret = scrub_find_fill_first_stripe(bg, &sctx->extent_path, @@ -1811,8 +1814,7 @@ /* Either >0 as no more extents or <0 for error. */ if (ret) return ret; - if (found_logical_ret) - *found_logical_ret = stripe->logical; + *found_logical_ret = stripe->logical; sctx->cur_stripe++; /* We filled one group, submit it. */ @@ -2037,7 +2039,7 @@ path.skip_locking = 1; /* Go through each extent items inside the logical range */ while (cur_logical < logical_end) { - u64 found_logical; + u64 found_logical = U64_MAX; u64 cur_physical = physical + cur_logical - logical_start; /* Canceled? */ @@ -2072,6 +2074,8 @@ if (ret < 0) break; + /* queue_scrub_stripe() returned 0, @found_logical must be updated. */ + ASSERT(found_logical != U64_MAX); cur_logical = found_logical + BTRFS_STRIPE_LEN; /* Don't hold CPU for too long time */ diff -u linux-aws-6.5-6.5.0/fs/btrfs/super.c linux-aws-6.5-6.5.0/fs/btrfs/super.c --- linux-aws-6.5-6.5.0/fs/btrfs/super.c +++ linux-aws-6.5-6.5.0/fs/btrfs/super.c @@ -79,7 +79,10 @@ static void btrfs_put_super(struct super_block *sb) { - close_ctree(btrfs_sb(sb)); + struct btrfs_fs_info *fs_info = btrfs_sb(sb); + + btrfs_info(fs_info, "last unmount of filesystem %pU", fs_info->fs_devices->fsid); + close_ctree(fs_info); } enum { diff -u linux-aws-6.5-6.5.0/fs/btrfs/transaction.c linux-aws-6.5-6.5.0/fs/btrfs/transaction.c --- linux-aws-6.5-6.5.0/fs/btrfs/transaction.c +++ linux-aws-6.5-6.5.0/fs/btrfs/transaction.c @@ -625,14 +625,14 @@ reloc_reserved = true; } - ret = btrfs_block_rsv_add(fs_info, rsv, num_bytes, flush); + ret = btrfs_reserve_metadata_bytes(fs_info, rsv, num_bytes, flush); if (ret) goto reserve_fail; if (delayed_refs_bytes) { - btrfs_migrate_to_delayed_refs_rsv(fs_info, rsv, - delayed_refs_bytes); + btrfs_migrate_to_delayed_refs_rsv(fs_info, delayed_refs_bytes); num_bytes -= delayed_refs_bytes; } + btrfs_block_rsv_add_bytes(rsv, num_bytes, true); if (rsv->space_info->force_alloc) do_chunk_alloc = true; diff -u linux-aws-6.5-6.5.0/fs/btrfs/volumes.c linux-aws-6.5-6.5.0/fs/btrfs/volumes.c --- linux-aws-6.5-6.5.0/fs/btrfs/volumes.c +++ linux-aws-6.5-6.5.0/fs/btrfs/volumes.c @@ -1908,7 +1908,7 @@ ptr = btrfs_device_fsid(dev_item); write_extent_buffer(leaf, trans->fs_info->fs_devices->metadata_uuid, ptr, BTRFS_FSID_SIZE); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); ret = 0; out: @@ -2613,7 +2613,7 @@ if (device->fs_devices->seeding) { btrfs_set_device_generation(leaf, dev_item, device->generation); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); } path->slots[0]++; @@ -2911,7 +2911,7 @@ btrfs_device_get_disk_total_bytes(device)); btrfs_set_device_bytes_used(leaf, dev_item, btrfs_device_get_bytes_used(device)); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); out: btrfs_free_path(path); @@ -3061,15 +3061,16 @@ read_unlock(&em_tree->lock); if (!em) { - btrfs_crit(fs_info, "unable to find logical %llu length %llu", + btrfs_crit(fs_info, + "unable to find chunk map for logical %llu length %llu", logical, length); return ERR_PTR(-EINVAL); } - if (em->start > logical || em->start + em->len < logical) { + if (em->start > logical || em->start + em->len <= logical) { btrfs_crit(fs_info, - "found a bad mapping, wanted %llu-%llu, found %llu-%llu", - logical, length, em->start, em->start + em->len); + "found a bad chunk map, wanted %llu-%llu, found %llu-%llu", + logical, logical + length, em->start, em->start + em->len); free_extent_map(em); return ERR_PTR(-EINVAL); } @@ -3499,7 +3500,7 @@ btrfs_set_balance_flags(leaf, item, bctl->flags); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); out: btrfs_free_path(path); err = btrfs_commit_transaction(trans); @@ -5125,7 +5126,7 @@ ASSERT(space_info); ctl->max_chunk_size = READ_ONCE(space_info->chunk_size); - ctl->max_stripe_size = ctl->max_chunk_size; + ctl->max_stripe_size = min_t(u64, ctl->max_chunk_size, SZ_1G); if (ctl->type & BTRFS_BLOCK_GROUP_SYSTEM) ctl->devs_max = min_t(int, ctl->devs_max, BTRFS_MAX_DEVS_SYS_CHUNK); @@ -7513,7 +7514,7 @@ for (i = 0; i < BTRFS_DEV_STAT_VALUES_MAX; i++) btrfs_set_dev_stats_value(eb, ptr, i, btrfs_dev_stat_read(device, i)); - btrfs_mark_buffer_dirty(eb); + btrfs_mark_buffer_dirty(trans, eb); out: btrfs_free_path(path); diff -u linux-aws-6.5-6.5.0/fs/ceph/mds_client.c linux-aws-6.5-6.5.0/fs/ceph/mds_client.c --- linux-aws-6.5-6.5.0/fs/ceph/mds_client.c +++ linux-aws-6.5-6.5.0/fs/ceph/mds_client.c @@ -868,8 +868,8 @@ if (!d_same_name(udentry, pdentry, &dname)) goto next; + found = dget_dlock(udentry); spin_unlock(&udentry->d_lock); - found = dget(udentry); break; next: spin_unlock(&udentry->d_lock); diff -u linux-aws-6.5-6.5.0/fs/erofs/zdata.c linux-aws-6.5-6.5.0/fs/erofs/zdata.c --- linux-aws-6.5-6.5.0/fs/erofs/zdata.c +++ linux-aws-6.5-6.5.0/fs/erofs/zdata.c @@ -805,6 +805,7 @@ return PTR_ERR(pcl); spin_lock_init(&pcl->obj.lockref.lock); + pcl->obj.lockref.count = 1; /* one ref for this request */ pcl->algorithmformat = map->m_algorithmformat; pcl->length = 0; pcl->partial = true; diff -u linux-aws-6.5-6.5.0/fs/ext4/ext4.h linux-aws-6.5-6.5.0/fs/ext4/ext4.h --- linux-aws-6.5-6.5.0/fs/ext4/ext4.h +++ linux-aws-6.5-6.5.0/fs/ext4/ext4.h @@ -1674,7 +1674,8 @@ /* * Barrier between writepages ops and changing any inode's JOURNAL_DATA - * or EXTENTS flag. + * or EXTENTS flag or between writepages ops and changing DELALLOC or + * DIOREAD_NOLOCK mount options on remount. */ struct percpu_rw_semaphore s_writepages_rwsem; struct dax_device *s_daxdev; diff -u linux-aws-6.5-6.5.0/fs/ext4/extents_status.c linux-aws-6.5-6.5.0/fs/ext4/extents_status.c --- linux-aws-6.5-6.5.0/fs/ext4/extents_status.c +++ linux-aws-6.5-6.5.0/fs/ext4/extents_status.c @@ -152,8 +152,9 @@ static int es_reclaim_extents(struct ext4_inode_info *ei, int *nr_to_scan); static int __es_shrink(struct ext4_sb_info *sbi, int nr_to_scan, struct ext4_inode_info *locked_ei); -static void __revise_pending(struct inode *inode, ext4_lblk_t lblk, - ext4_lblk_t len); +static int __revise_pending(struct inode *inode, ext4_lblk_t lblk, + ext4_lblk_t len, + struct pending_reservation **prealloc); int __init ext4_init_es(void) { @@ -448,6 +449,19 @@ spin_unlock(&sbi->s_es_lock); } +static inline struct pending_reservation *__alloc_pending(bool nofail) +{ + if (!nofail) + return kmem_cache_alloc(ext4_pending_cachep, GFP_ATOMIC); + + return kmem_cache_zalloc(ext4_pending_cachep, GFP_KERNEL | __GFP_NOFAIL); +} + +static inline void __free_pending(struct pending_reservation *pr) +{ + kmem_cache_free(ext4_pending_cachep, pr); +} + /* * Returns true if we cannot fail to allocate memory for this extent_status * entry and cannot reclaim it until its status changes. @@ -836,11 +850,12 @@ { struct extent_status newes; ext4_lblk_t end = lblk + len - 1; - int err1 = 0; - int err2 = 0; + int err1 = 0, err2 = 0, err3 = 0; struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); struct extent_status *es1 = NULL; struct extent_status *es2 = NULL; + struct pending_reservation *pr = NULL; + bool revise_pending = false; if (EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY) return; @@ -868,11 +883,17 @@ ext4_es_insert_extent_check(inode, &newes); + revise_pending = sbi->s_cluster_ratio > 1 && + test_opt(inode->i_sb, DELALLOC) && + (status & (EXTENT_STATUS_WRITTEN | + EXTENT_STATUS_UNWRITTEN)); retry: if (err1 && !es1) es1 = __es_alloc_extent(true); if ((err1 || err2) && !es2) es2 = __es_alloc_extent(true); + if ((err1 || err2 || err3) && revise_pending && !pr) + pr = __alloc_pending(true); write_lock(&EXT4_I(inode)->i_es_lock); err1 = __es_remove_extent(inode, lblk, end, NULL, es1); @@ -897,13 +918,18 @@ es2 = NULL; } - if (sbi->s_cluster_ratio > 1 && test_opt(inode->i_sb, DELALLOC) && - (status & EXTENT_STATUS_WRITTEN || - status & EXTENT_STATUS_UNWRITTEN)) - __revise_pending(inode, lblk, len); + if (revise_pending) { + err3 = __revise_pending(inode, lblk, len, &pr); + if (err3 != 0) + goto error; + if (pr) { + __free_pending(pr); + pr = NULL; + } + } error: write_unlock(&EXT4_I(inode)->i_es_lock); - if (err1 || err2) + if (err1 || err2 || err3) goto retry; ext4_es_print_tree(inode); @@ -1311,7 +1337,7 @@ rc->ndelonly--; node = rb_next(&pr->rb_node); rb_erase(&pr->rb_node, &tree->root); - kmem_cache_free(ext4_pending_cachep, pr); + __free_pending(pr); if (!node) break; pr = rb_entry(node, struct pending_reservation, @@ -1405,8 +1431,8 @@ } } if (count_reserved) - count_rsvd(inode, lblk, orig_es.es_len - len1 - len2, - &orig_es, &rc); + count_rsvd(inode, orig_es.es_lblk + len1, + orig_es.es_len - len1 - len2, &orig_es, &rc); goto out_get_reserved; } @@ -1907,11 +1933,13 @@ * * @inode - file containing the cluster * @lblk - logical block in the cluster to be added + * @prealloc - preallocated pending entry * * Returns 0 on successful insertion and -ENOMEM on failure. If the * pending reservation is already in the set, returns successfully. */ -static int __insert_pending(struct inode *inode, ext4_lblk_t lblk) +static int __insert_pending(struct inode *inode, ext4_lblk_t lblk, + struct pending_reservation **prealloc) { struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); struct ext4_pending_tree *tree = &EXT4_I(inode)->i_pending_tree; @@ -1937,10 +1965,15 @@ } } - pr = kmem_cache_alloc(ext4_pending_cachep, GFP_ATOMIC); - if (pr == NULL) { - ret = -ENOMEM; - goto out; + if (likely(*prealloc == NULL)) { + pr = __alloc_pending(false); + if (!pr) { + ret = -ENOMEM; + goto out; + } + } else { + pr = *prealloc; + *prealloc = NULL; } pr->lclu = lclu; @@ -1970,7 +2003,7 @@ if (pr != NULL) { tree = &EXT4_I(inode)->i_pending_tree; rb_erase(&pr->rb_node, &tree->root); - kmem_cache_free(ext4_pending_cachep, pr); + __free_pending(pr); } } @@ -2029,10 +2062,10 @@ bool allocated) { struct extent_status newes; - int err1 = 0; - int err2 = 0; + int err1 = 0, err2 = 0, err3 = 0; struct extent_status *es1 = NULL; struct extent_status *es2 = NULL; + struct pending_reservation *pr = NULL; if (EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY) return; @@ -2052,6 +2085,8 @@ es1 = __es_alloc_extent(true); if ((err1 || err2) && !es2) es2 = __es_alloc_extent(true); + if ((err1 || err2 || err3) && allocated && !pr) + pr = __alloc_pending(true); write_lock(&EXT4_I(inode)->i_es_lock); err1 = __es_remove_extent(inode, lblk, lblk, NULL, es1); @@ -2074,11 +2109,18 @@ es2 = NULL; } - if (allocated) - __insert_pending(inode, lblk); + if (allocated) { + err3 = __insert_pending(inode, lblk, &pr); + if (err3 != 0) + goto error; + if (pr) { + __free_pending(pr); + pr = NULL; + } + } error: write_unlock(&EXT4_I(inode)->i_es_lock); - if (err1 || err2) + if (err1 || err2 || err3) goto retry; ext4_es_print_tree(inode); @@ -2184,21 +2226,24 @@ * @inode - file containing the range * @lblk - logical block defining the start of range * @len - length of range in blocks + * @prealloc - preallocated pending entry * * Used after a newly allocated extent is added to the extents status tree. * Requires that the extents in the range have either written or unwritten * status. Must be called while holding i_es_lock. */ -static void __revise_pending(struct inode *inode, ext4_lblk_t lblk, - ext4_lblk_t len) +static int __revise_pending(struct inode *inode, ext4_lblk_t lblk, + ext4_lblk_t len, + struct pending_reservation **prealloc) { struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); ext4_lblk_t end = lblk + len - 1; ext4_lblk_t first, last; bool f_del = false, l_del = false; + int ret = 0; if (len == 0) - return; + return 0; /* * Two cases - block range within single cluster and block range @@ -2219,7 +2264,9 @@ f_del = __es_scan_range(inode, &ext4_es_is_delonly, first, lblk - 1); if (f_del) { - __insert_pending(inode, first); + ret = __insert_pending(inode, first, prealloc); + if (ret < 0) + goto out; } else { last = EXT4_LBLK_CMASK(sbi, end) + sbi->s_cluster_ratio - 1; @@ -2227,9 +2274,11 @@ l_del = __es_scan_range(inode, &ext4_es_is_delonly, end + 1, last); - if (l_del) - __insert_pending(inode, last); - else + if (l_del) { + ret = __insert_pending(inode, last, prealloc); + if (ret < 0) + goto out; + } else __remove_pending(inode, last); } } else { @@ -2239,16 +2288,22 @@ first, lblk - 1); - if (f_del) - __insert_pending(inode, first); - else + if (f_del) { + ret = __insert_pending(inode, first, prealloc); + if (ret < 0) + goto out; + } else __remove_pending(inode, first); last = EXT4_LBLK_CMASK(sbi, end) + sbi->s_cluster_ratio - 1; if (last != end) l_del = __es_scan_range(inode, &ext4_es_is_delonly, end + 1, last); - if (l_del) - __insert_pending(inode, last); - else + if (l_del) { + ret = __insert_pending(inode, last, prealloc); + if (ret < 0) + goto out; + } else __remove_pending(inode, last); } +out: + return ret; } diff -u linux-aws-6.5-6.5.0/fs/ext4/file.c linux-aws-6.5-6.5.0/fs/ext4/file.c --- linux-aws-6.5-6.5.0/fs/ext4/file.c +++ linux-aws-6.5-6.5.0/fs/ext4/file.c @@ -306,80 +306,38 @@ } static ssize_t ext4_handle_inode_extension(struct inode *inode, loff_t offset, - ssize_t written, size_t count) + ssize_t count) { handle_t *handle; - bool truncate = false; - u8 blkbits = inode->i_blkbits; - ext4_lblk_t written_blk, end_blk; - int ret; - - /* - * Note that EXT4_I(inode)->i_disksize can get extended up to - * inode->i_size while the I/O was running due to writeback of delalloc - * blocks. But, the code in ext4_iomap_alloc() is careful to use - * zeroed/unwritten extents if this is possible; thus we won't leave - * uninitialized blocks in a file even if we didn't succeed in writing - * as much as we intended. - */ - WARN_ON_ONCE(i_size_read(inode) < EXT4_I(inode)->i_disksize); - if (offset + count <= EXT4_I(inode)->i_disksize) { - /* - * We need to ensure that the inode is removed from the orphan - * list if it has been added prematurely, due to writeback of - * delalloc blocks. - */ - if (!list_empty(&EXT4_I(inode)->i_orphan) && inode->i_nlink) { - handle = ext4_journal_start(inode, EXT4_HT_INODE, 2); - - if (IS_ERR(handle)) { - ext4_orphan_del(NULL, inode); - return PTR_ERR(handle); - } - - ext4_orphan_del(handle, inode); - ext4_journal_stop(handle); - } - - return written; - } - - if (written < 0) - goto truncate; + lockdep_assert_held_write(&inode->i_rwsem); handle = ext4_journal_start(inode, EXT4_HT_INODE, 2); - if (IS_ERR(handle)) { - written = PTR_ERR(handle); - goto truncate; - } + if (IS_ERR(handle)) + return PTR_ERR(handle); - if (ext4_update_inode_size(inode, offset + written)) { - ret = ext4_mark_inode_dirty(handle, inode); + if (ext4_update_inode_size(inode, offset + count)) { + int ret = ext4_mark_inode_dirty(handle, inode); if (unlikely(ret)) { - written = ret; ext4_journal_stop(handle); - goto truncate; + return ret; } } - /* - * We may need to truncate allocated but not written blocks beyond EOF. - */ - written_blk = ALIGN(offset + written, 1 << blkbits); - end_blk = ALIGN(offset + count, 1 << blkbits); - if (written_blk < end_blk && ext4_can_truncate(inode)) - truncate = true; - - /* - * Remove the inode from the orphan list if it has been extended and - * everything went OK. - */ - if (!truncate && inode->i_nlink) + if (inode->i_nlink) ext4_orphan_del(handle, inode); ext4_journal_stop(handle); - if (truncate) { -truncate: + return count; +} + +/* + * Clean up the inode after DIO or DAX extending write has completed and the + * inode size has been updated using ext4_handle_inode_extension(). + */ +static void ext4_inode_extension_cleanup(struct inode *inode, ssize_t count) +{ + lockdep_assert_held_write(&inode->i_rwsem); + if (count < 0) { ext4_truncate_failed_write(inode); /* * If the truncate operation failed early, then the inode may @@ -388,9 +346,28 @@ */ if (inode->i_nlink) ext4_orphan_del(NULL, inode); + return; } + /* + * If i_disksize got extended due to writeback of delalloc blocks while + * the DIO was running we could fail to cleanup the orphan list in + * ext4_handle_inode_extension(). Do it now. + */ + if (!list_empty(&EXT4_I(inode)->i_orphan) && inode->i_nlink) { + handle_t *handle = ext4_journal_start(inode, EXT4_HT_INODE, 2); - return written; + if (IS_ERR(handle)) { + /* + * The write has successfully completed. Not much to + * do with the error here so just cleanup the orphan + * list and hope for the best. + */ + ext4_orphan_del(NULL, inode); + return; + } + ext4_orphan_del(handle, inode); + ext4_journal_stop(handle); + } } static int ext4_dio_write_end_io(struct kiocb *iocb, ssize_t size, @@ -399,31 +376,22 @@ loff_t pos = iocb->ki_pos; struct inode *inode = file_inode(iocb->ki_filp); + if (!error && size && flags & IOMAP_DIO_UNWRITTEN) + error = ext4_convert_unwritten_extents(NULL, inode, pos, size); if (error) return error; - - if (size && flags & IOMAP_DIO_UNWRITTEN) { - error = ext4_convert_unwritten_extents(NULL, inode, pos, size); - if (error < 0) - return error; - } /* - * If we are extending the file, we have to update i_size here before - * page cache gets invalidated in iomap_dio_rw(). Otherwise racing - * buffered reads could zero out too much from page cache pages. Update - * of on-disk size will happen later in ext4_dio_write_iter() where - * we have enough information to also perform orphan list handling etc. - * Note that we perform all extending writes synchronously under - * i_rwsem held exclusively so i_size update is safe here in that case. - * If the write was not extending, we cannot see pos > i_size here - * because operations reducing i_size like truncate wait for all - * outstanding DIO before updating i_size. + * Note that EXT4_I(inode)->i_disksize can get extended up to + * inode->i_size while the I/O was running due to writeback of delalloc + * blocks. But the code in ext4_iomap_alloc() is careful to use + * zeroed/unwritten extents if this is possible; thus we won't leave + * uninitialized blocks in a file even if we didn't succeed in writing + * as much as we intended. */ - pos += size; - if (pos > i_size_read(inode)) - i_size_write(inode, pos); - - return 0; + WARN_ON_ONCE(i_size_read(inode) < READ_ONCE(EXT4_I(inode)->i_disksize)); + if (pos + size <= READ_ONCE(EXT4_I(inode)->i_disksize)) + return size; + return ext4_handle_inode_extension(inode, pos, size); } static const struct iomap_dio_ops ext4_dio_write_ops = { @@ -569,18 +537,20 @@ return ext4_buffered_write_iter(iocb, from); } + /* + * Prevent inline data from being created since we are going to allocate + * blocks for DIO. We know the inode does not currently have inline data + * because ext4_should_use_dio() checked for it, but we have to clear + * the state flag before the write checks because a lock cycle could + * introduce races with other writers. + */ + ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); + ret = ext4_dio_write_checks(iocb, from, &ilock_shared, &extend, &unwritten, &dio_flags); if (ret <= 0) return ret; - /* - * Make sure inline data cannot be created anymore since we are going - * to allocate blocks for DIO. We know the inode does not have any - * inline data now because ext4_dio_supported() checked for that. - */ - ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); - offset = iocb->ki_pos; count = ret; @@ -606,9 +576,16 @@ dio_flags, NULL, 0); if (ret == -ENOTBLK) ret = 0; - - if (extend) - ret = ext4_handle_inode_extension(inode, offset, ret, count); + if (extend) { + /* + * We always perform extending DIO write synchronously so by + * now the IO is completed and ext4_handle_inode_extension() + * was called. Cleanup the inode in case of error or race with + * writeback of delalloc blocks. + */ + WARN_ON_ONCE(ret == -EIOCBQUEUED); + ext4_inode_extension_cleanup(inode, ret); + } out: if (ilock_shared) @@ -689,8 +666,10 @@ ret = dax_iomap_rw(iocb, from, &ext4_iomap_ops); - if (extend) - ret = ext4_handle_inode_extension(inode, offset, ret, count); + if (extend) { + ret = ext4_handle_inode_extension(inode, offset, ret); + ext4_inode_extension_cleanup(inode, ret); + } out: inode_unlock(inode); if (ret > 0) diff -u linux-aws-6.5-6.5.0/fs/f2fs/data.c linux-aws-6.5-6.5.0/fs/f2fs/data.c --- linux-aws-6.5-6.5.0/fs/f2fs/data.c +++ linux-aws-6.5-6.5.0/fs/f2fs/data.c @@ -2341,8 +2341,10 @@ f2fs_wait_on_block_writeback(inode, blkaddr); if (f2fs_load_compressed_page(sbi, page, blkaddr)) { - if (atomic_dec_and_test(&dic->remaining_pages)) + if (atomic_dec_and_test(&dic->remaining_pages)) { f2fs_decompress_cluster(dic, true); + break; + } continue; } @@ -3020,7 +3022,8 @@ { int ret = 0; int done = 0, retry = 0; - struct page *pages[F2FS_ONSTACK_PAGES]; + struct page *pages_local[F2FS_ONSTACK_PAGES]; + struct page **pages = pages_local; struct folio_batch fbatch; struct f2fs_sb_info *sbi = F2FS_M_SB(mapping); struct bio *bio = NULL; @@ -3044,6 +3047,7 @@ #endif int nr_folios, p, idx; int nr_pages; + unsigned int max_pages = F2FS_ONSTACK_PAGES; pgoff_t index; pgoff_t end; /* Inclusive */ pgoff_t done_index; @@ -3053,6 +3057,15 @@ int submitted = 0; int i; +#ifdef CONFIG_F2FS_FS_COMPRESSION + if (f2fs_compressed_file(inode) && + 1 << cc.log_cluster_size > F2FS_ONSTACK_PAGES) { + pages = f2fs_kzalloc(sbi, sizeof(struct page *) << + cc.log_cluster_size, GFP_NOFS | __GFP_NOFAIL); + max_pages = 1 << cc.log_cluster_size; + } +#endif + folio_batch_init(&fbatch); if (get_dirty_pages(mapping->host) <= @@ -3098,7 +3111,7 @@ add_more: pages[nr_pages] = folio_page(folio, idx); folio_get(folio); - if (++nr_pages == F2FS_ONSTACK_PAGES) { + if (++nr_pages == max_pages) { index = folio->index + idx + 1; folio_batch_release(&fbatch); goto write; @@ -3281,6 +3294,11 @@ if (bio) f2fs_submit_merged_ipu_write(sbi, &bio, NULL); +#ifdef CONFIG_F2FS_FS_COMPRESSION + if (pages != pages_local) + kfree(pages); +#endif + return ret; } diff -u linux-aws-6.5-6.5.0/fs/f2fs/file.c linux-aws-6.5-6.5.0/fs/f2fs/file.c --- linux-aws-6.5-6.5.0/fs/f2fs/file.c +++ linux-aws-6.5-6.5.0/fs/f2fs/file.c @@ -3258,6 +3258,7 @@ return -EOPNOTSUPP; map.m_lblk = 0; + map.m_pblk = 0; map.m_next_pgofs = NULL; map.m_next_extent = &m_next_extent; map.m_seg_type = NO_CHECK_TYPE; @@ -4005,6 +4006,15 @@ F2FS_I(inode)->i_compress_algorithm = option.algorithm; F2FS_I(inode)->i_log_cluster_size = option.log_cluster_size; F2FS_I(inode)->i_cluster_size = BIT(option.log_cluster_size); + /* Set default level */ + if (F2FS_I(inode)->i_compress_algorithm == COMPRESS_ZSTD) + F2FS_I(inode)->i_compress_level = F2FS_ZSTD_DEFAULT_CLEVEL; + else + F2FS_I(inode)->i_compress_level = 0; + /* Adjust mount option level */ + if (option.algorithm == F2FS_OPTION(sbi).compress_algorithm && + F2FS_OPTION(sbi).compress_level) + F2FS_I(inode)->i_compress_level = F2FS_OPTION(sbi).compress_level; f2fs_mark_inode_dirty_sync(inode, true); if (!f2fs_is_compress_backend_ready(inode)) diff -u linux-aws-6.5-6.5.0/fs/f2fs/super.c linux-aws-6.5-6.5.0/fs/f2fs/super.c --- linux-aws-6.5-6.5.0/fs/f2fs/super.c +++ linux-aws-6.5-6.5.0/fs/f2fs/super.c @@ -547,6 +547,29 @@ } #ifdef CONFIG_F2FS_FS_COMPRESSION +static bool is_compress_extension_exist(struct f2fs_sb_info *sbi, + const char *new_ext, bool is_ext) +{ + unsigned char (*ext)[F2FS_EXTENSION_LEN]; + int ext_cnt; + int i; + + if (is_ext) { + ext = F2FS_OPTION(sbi).extensions; + ext_cnt = F2FS_OPTION(sbi).compress_ext_cnt; + } else { + ext = F2FS_OPTION(sbi).noextensions; + ext_cnt = F2FS_OPTION(sbi).nocompress_ext_cnt; + } + + for (i = 0; i < ext_cnt; i++) { + if (!strcasecmp(new_ext, ext[i])) + return true; + } + + return false; +} + /* * 1. The same extension name cannot not appear in both compress and non-compress extension * at the same time. @@ -1149,6 +1172,11 @@ return -EINVAL; } + if (is_compress_extension_exist(sbi, name, true)) { + kfree(name); + break; + } + strcpy(ext[ext_cnt], name); F2FS_OPTION(sbi).compress_ext_cnt++; kfree(name); @@ -1173,6 +1201,11 @@ return -EINVAL; } + if (is_compress_extension_exist(sbi, name, false)) { + kfree(name); + break; + } + strcpy(noext[noext_cnt], name); F2FS_OPTION(sbi).nocompress_ext_cnt++; kfree(name); @@ -1629,7 +1662,7 @@ f2fs_wait_on_all_pages(sbi, F2FS_WB_CP_DATA); - if (err) { + if (err || f2fs_cp_error(sbi)) { truncate_inode_pages_final(NODE_MAPPING(sbi)); truncate_inode_pages_final(META_MAPPING(sbi)); } diff -u linux-aws-6.5-6.5.0/fs/jbd2/recovery.c linux-aws-6.5-6.5.0/fs/jbd2/recovery.c --- linux-aws-6.5-6.5.0/fs/jbd2/recovery.c +++ linux-aws-6.5-6.5.0/fs/jbd2/recovery.c @@ -289,6 +289,8 @@ journal_superblock_t * sb; struct recovery_info info; + errseq_t wb_err; + struct address_space *mapping; memset(&info, 0, sizeof(info)); sb = journal->j_superblock; @@ -306,6 +308,9 @@ return 0; } + wb_err = 0; + mapping = journal->j_fs_dev->bd_inode->i_mapping; + errseq_check_and_advance(&mapping->wb_err, &wb_err); err = do_one_pass(journal, &info, PASS_SCAN); if (!err) err = do_one_pass(journal, &info, PASS_REVOKE); @@ -329,6 +334,9 @@ err2 = sync_blockdev(journal->j_fs_dev); if (!err) err = err2; + err2 = errseq_check_and_advance(&mapping->wb_err, &wb_err); + if (!err) + err = err2; /* Make sure all replayed data is on permanent storage */ if (journal->j_flags & JBD2_BARRIER) { err2 = blkdev_issue_flush(journal->j_fs_dev); diff -u linux-aws-6.5-6.5.0/fs/jfs/jfs_dmap.c linux-aws-6.5-6.5.0/fs/jfs/jfs_dmap.c --- linux-aws-6.5-6.5.0/fs/jfs/jfs_dmap.c +++ linux-aws-6.5-6.5.0/fs/jfs/jfs_dmap.c @@ -87,7 +87,7 @@ static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks); static int dbFindBits(u32 word, int l2nb); static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno); -static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx); +static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl); static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, int nblocks); static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno, @@ -180,7 +180,8 @@ bmp->db_nfree = le64_to_cpu(dbmp_le->dn_nfree); bmp->db_l2nbperpage = le32_to_cpu(dbmp_le->dn_l2nbperpage); - if (bmp->db_l2nbperpage > L2PSIZE - L2MINBLOCKSIZE) { + if (bmp->db_l2nbperpage > L2PSIZE - L2MINBLOCKSIZE || + bmp->db_l2nbperpage < 0) { err = -EINVAL; goto err_release_metapage; } @@ -194,6 +195,12 @@ bmp->db_maxlevel = le32_to_cpu(dbmp_le->dn_maxlevel); bmp->db_maxag = le32_to_cpu(dbmp_le->dn_maxag); bmp->db_agpref = le32_to_cpu(dbmp_le->dn_agpref); + if (bmp->db_maxag >= MAXAG || bmp->db_maxag < 0 || + bmp->db_agpref >= MAXAG || bmp->db_agpref < 0) { + err = -EINVAL; + goto err_release_metapage; + } + bmp->db_aglevel = le32_to_cpu(dbmp_le->dn_aglevel); bmp->db_agheight = le32_to_cpu(dbmp_le->dn_agheight); bmp->db_agwidth = le32_to_cpu(dbmp_le->dn_agwidth); @@ -1710,7 +1717,7 @@ * dbFindLeaf() returns the index of the leaf at which * free space was found. */ - rc = dbFindLeaf((dmtree_t *) dcp, l2nb, &leafidx); + rc = dbFindLeaf((dmtree_t *) dcp, l2nb, &leafidx, true); /* release the buffer. */ @@ -1957,7 +1964,7 @@ * free space. if sufficient free space is found, dbFindLeaf() * returns the index of the leaf at which free space was found. */ - if (dbFindLeaf((dmtree_t *) & dp->tree, l2nb, &leafidx)) + if (dbFindLeaf((dmtree_t *) &dp->tree, l2nb, &leafidx, false)) return -ENOSPC; if (leafidx < 0) @@ -2921,14 +2928,18 @@ * leafidx - return pointer to be set to the index of the leaf * describing at least l2nb free blocks if sufficient * free blocks are found. + * is_ctl - determines if the tree is of type ctl * * RETURN VALUES: * 0 - success * -ENOSPC - insufficient free blocks. */ -static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx) +static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl) { int ti, n = 0, k, x = 0; + int max_size; + + max_size = is_ctl ? CTLTREESIZE : TREESIZE; /* first check the root of the tree to see if there is * sufficient free space. @@ -2949,6 +2960,8 @@ /* sufficient free space found. move to the next * level (or quit if this is the last level). */ + if (x + n > max_size) + return -ENOSPC; if (l2nb <= tp->dmt_stree[x + n]) break; } diff -u linux-aws-6.5-6.5.0/fs/jfs/jfs_imap.c linux-aws-6.5-6.5.0/fs/jfs/jfs_imap.c --- linux-aws-6.5-6.5.0/fs/jfs/jfs_imap.c +++ linux-aws-6.5-6.5.0/fs/jfs/jfs_imap.c @@ -1320,7 +1320,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip) { int rc, ino, iagno, addext, extno, bitno, sword; - int nwords, rem, i, agno; + int nwords, rem, i, agno, dn_numag; u32 mask, inosmap, extsmap; struct inode *ipimap; struct metapage *mp; @@ -1356,6 +1356,9 @@ /* get the ag number of this iag */ agno = BLKTOAG(JFS_IP(pip)->agstart, JFS_SBI(pip->i_sb)); + dn_numag = JFS_SBI(pip->i_sb)->bmap->db_numag; + if (agno < 0 || agno > dn_numag) + return -EIO; if (atomic_read(&JFS_SBI(pip->i_sb)->bmap->db_active[agno])) { /* diff -u linux-aws-6.5-6.5.0/fs/nfs/flexfilelayout/flexfilelayout.c linux-aws-6.5-6.5.0/fs/nfs/flexfilelayout/flexfilelayout.c --- linux-aws-6.5-6.5.0/fs/nfs/flexfilelayout/flexfilelayout.c +++ linux-aws-6.5-6.5.0/fs/nfs/flexfilelayout/flexfilelayout.c @@ -2520,9 +2520,9 @@ return i; } -static int -ff_layout_prepare_layoutstats(struct nfs42_layoutstat_args *args) +static int ff_layout_prepare_layoutstats(struct nfs42_layoutstat_args *args) { + struct pnfs_layout_hdr *lo; struct nfs4_flexfile_layout *ff_layout; const int dev_count = PNFS_LAYOUTSTATS_MAXDEV; @@ -2533,11 +2533,14 @@ return -ENOMEM; spin_lock(&args->inode->i_lock); - ff_layout = FF_LAYOUT_FROM_HDR(NFS_I(args->inode)->layout); - args->num_dev = ff_layout_mirror_prepare_stats(&ff_layout->generic_hdr, - &args->devinfo[0], - dev_count, - NFS4_FF_OP_LAYOUTSTATS); + lo = NFS_I(args->inode)->layout; + if (lo && pnfs_layout_is_valid(lo)) { + ff_layout = FF_LAYOUT_FROM_HDR(lo); + args->num_dev = ff_layout_mirror_prepare_stats( + &ff_layout->generic_hdr, &args->devinfo[0], dev_count, + NFS4_FF_OP_LAYOUTSTATS); + } else + args->num_dev = 0; spin_unlock(&args->inode->i_lock); if (!args->num_dev) { kfree(args->devinfo); diff -u linux-aws-6.5-6.5.0/fs/nfs/nfs42proc.c linux-aws-6.5-6.5.0/fs/nfs/nfs42proc.c --- linux-aws-6.5-6.5.0/fs/nfs/nfs42proc.c +++ linux-aws-6.5-6.5.0/fs/nfs/nfs42proc.c @@ -81,7 +81,8 @@ if (status == 0) { if (nfs_should_remove_suid(inode)) { spin_lock(&inode->i_lock); - nfs_set_cache_invalid(inode, NFS_INO_INVALID_MODE); + nfs_set_cache_invalid(inode, + NFS_INO_REVAL_FORCED | NFS_INO_INVALID_MODE); spin_unlock(&inode->i_lock); } status = nfs_post_op_update_inode_force_wcc(inode, diff -u linux-aws-6.5-6.5.0/fs/nfs/nfs4proc.c linux-aws-6.5-6.5.0/fs/nfs/nfs4proc.c --- linux-aws-6.5-6.5.0/fs/nfs/nfs4proc.c +++ linux-aws-6.5-6.5.0/fs/nfs/nfs4proc.c @@ -5621,7 +5621,7 @@ msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE]; nfs4_init_sequence(&hdr->args.seq_args, &hdr->res.seq_res, 0, 0); - nfs4_state_protect_write(server->nfs_client, clnt, msg, hdr); + nfs4_state_protect_write(hdr->ds_clp ? hdr->ds_clp : server->nfs_client, clnt, msg, hdr); } static void nfs4_proc_commit_rpc_prepare(struct rpc_task *task, struct nfs_commit_data *data) @@ -5662,7 +5662,8 @@ data->res.server = server; msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT]; nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1, 0); - nfs4_state_protect(server->nfs_client, NFS_SP4_MACH_CRED_COMMIT, clnt, msg); + nfs4_state_protect(data->ds_clp ? data->ds_clp : server->nfs_client, + NFS_SP4_MACH_CRED_COMMIT, clnt, msg); } static int _nfs4_proc_commit(struct file *dst, struct nfs_commitargs *args, @@ -8870,8 +8871,6 @@ /* Save the EXCHANGE_ID verifier session trunk tests */ memcpy(clp->cl_confirm.data, argp->verifier.data, sizeof(clp->cl_confirm.data)); - if (resp->flags & EXCHGID4_FLAG_USE_PNFS_DS) - set_bit(NFS_CS_DS, &clp->cl_flags); out: trace_nfs4_exchange_id(clp, status); rpc_put_task(task); @@ -8936,6 +8935,7 @@ sp4_how = (adata->clp->cl_sp4_flags == 0 ? SP4_NONE : SP4_MACH_CRED); +try_again: /* Test connection for session trunking. Async exchange_id call */ task = nfs4_run_exchange_id(adata->clp, adata->cred, sp4_how, xprt); if (IS_ERR(task)) @@ -8948,11 +8948,15 @@ if (status == 0) rpc_clnt_xprt_switch_add_xprt(clnt, xprt); - else if (rpc_clnt_xprt_switch_has_addr(clnt, + else if (status != -NFS4ERR_DELAY && rpc_clnt_xprt_switch_has_addr(clnt, (struct sockaddr *)&xprt->addr)) rpc_clnt_xprt_switch_remove_xprt(clnt, xprt); rpc_put_task(task); + if (status == -NFS4ERR_DELAY) { + ssleep(1); + goto try_again; + } } EXPORT_SYMBOL_GPL(nfs4_test_session_trunk); diff -u linux-aws-6.5-6.5.0/fs/nfs/write.c linux-aws-6.5-6.5.0/fs/nfs/write.c --- linux-aws-6.5-6.5.0/fs/nfs/write.c +++ linux-aws-6.5-6.5.0/fs/nfs/write.c @@ -788,6 +788,8 @@ */ static void nfs_inode_remove_request(struct nfs_page *req) { + struct nfs_inode *nfsi = NFS_I(nfs_page_to_inode(req)); + if (nfs_page_group_sync_on_bit(req, PG_REMOVE)) { struct folio *folio = nfs_page_to_folio(req->wb_head); struct address_space *mapping = folio_file_mapping(folio); @@ -802,8 +804,8 @@ } if (test_and_clear_bit(PG_INODE_REF, &req->wb_flags)) { + atomic_long_dec(&nfsi->nrequests); nfs_release_request(req); - atomic_long_dec(&NFS_I(nfs_page_to_inode(req))->nrequests); } } diff -u linux-aws-6.5-6.5.0/fs/overlayfs/copy_up.c linux-aws-6.5-6.5.0/fs/overlayfs/copy_up.c --- linux-aws-6.5-6.5.0/fs/overlayfs/copy_up.c +++ linux-aws-6.5-6.5.0/fs/overlayfs/copy_up.c @@ -337,7 +337,7 @@ { struct iattr attr = { .ia_valid = - ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIME_SET, + ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIME_SET | ATTR_CTIME, .ia_atime = stat->atime, .ia_mtime = stat->mtime, }; diff -u linux-aws-6.5-6.5.0/fs/overlayfs/super.c linux-aws-6.5-6.5.0/fs/overlayfs/super.c --- linux-aws-6.5-6.5.0/fs/overlayfs/super.c +++ linux-aws-6.5-6.5.0/fs/overlayfs/super.c @@ -1467,7 +1467,7 @@ ovl_trusted_xattr_handlers; sb->s_fs_info = ofs; sb->s_flags |= SB_POSIXACL; - sb->s_iflags |= SB_I_SKIP_SYNC | SB_I_IMA_UNVERIFIABLE_SIGNATURE; + sb->s_iflags |= SB_I_SKIP_SYNC; err = -ENOMEM; root_dentry = ovl_get_root(sb, ctx->upper.dentry, oe); diff -u linux-aws-6.5-6.5.0/fs/quota/dquot.c linux-aws-6.5-6.5.0/fs/quota/dquot.c --- linux-aws-6.5-6.5.0/fs/quota/dquot.c +++ linux-aws-6.5-6.5.0/fs/quota/dquot.c @@ -2403,6 +2403,20 @@ if (sb_has_quota_loaded(sb, type)) return -EBUSY; + /* + * Quota files should never be encrypted. They should be thought of as + * filesystem metadata, not user data. New-style internal quota files + * cannot be encrypted by users anyway, but old-style external quota + * files could potentially be incorrectly created in an encrypted + * directory, hence this explicit check. Some reasons why encrypted + * quota files don't work include: (1) some filesystems that support + * encryption don't handle it in their quota_read and quota_write, and + * (2) cleaning up encrypted quota files at unmount would need special + * consideration, as quota files are cleaned up later than user files. + */ + if (IS_ENCRYPTED(inode)) + return -EINVAL; + dqopt->files[type] = igrab(inode); if (!dqopt->files[type]) return -EIO; diff -u linux-aws-6.5-6.5.0/fs/smb/client/cached_dir.c linux-aws-6.5-6.5.0/fs/smb/client/cached_dir.c --- linux-aws-6.5-6.5.0/fs/smb/client/cached_dir.c +++ linux-aws-6.5-6.5.0/fs/smb/client/cached_dir.c @@ -15,10 +15,12 @@ static struct cached_fid *init_cached_dir(const char *path); static void free_cached_dir(struct cached_fid *cfid); static void smb2_close_cached_fid(struct kref *ref); +static void cfids_laundromat_worker(struct work_struct *work); static struct cached_fid *find_or_create_cached_dir(struct cached_fids *cfids, const char *path, - bool lookup_only) + bool lookup_only, + __u32 max_cached_dirs) { struct cached_fid *cfid; @@ -30,7 +32,7 @@ * fully cached or it may be in the process of * being deleted due to a lease break. */ - if (!cfid->has_lease) { + if (!cfid->time || !cfid->has_lease) { spin_unlock(&cfids->cfid_list_lock); return NULL; } @@ -43,7 +45,7 @@ spin_unlock(&cfids->cfid_list_lock); return NULL; } - if (cfids->num_entries >= MAX_CACHED_FIDS) { + if (cfids->num_entries >= max_cached_dirs) { spin_unlock(&cfids->cfid_list_lock); return NULL; } @@ -145,7 +147,7 @@ const char *npath; if (tcon == NULL || tcon->cfids == NULL || tcon->nohandlecache || - is_smb1_server(tcon->ses->server)) + is_smb1_server(tcon->ses->server) || (dir_cache_timeout == 0)) return -EOPNOTSUPP; ses = tcon->ses; @@ -162,21 +164,24 @@ if (!utf16_path) return -ENOMEM; - cfid = find_or_create_cached_dir(cfids, path, lookup_only); + cfid = find_or_create_cached_dir(cfids, path, lookup_only, tcon->max_cached_dirs); if (cfid == NULL) { kfree(utf16_path); return -ENOENT; } /* - * At this point we either have a lease already and we can just - * return it. If not we are guaranteed to be the only thread accessing - * this cfid. + * Return cached fid if it has a lease. Otherwise, it is either a new + * entry or laundromat worker removed it from @cfids->entries. Caller + * will put last reference if the latter. */ + spin_lock(&cfids->cfid_list_lock); if (cfid->has_lease) { + spin_unlock(&cfids->cfid_list_lock); *ret_cfid = cfid; kfree(utf16_path); return 0; } + spin_unlock(&cfids->cfid_list_lock); /* * Skip any prefix paths in @path as lookup_positive_unlocked() ends up @@ -188,9 +193,19 @@ npath = path_no_prefix(cifs_sb, path); if (IS_ERR(npath)) { rc = PTR_ERR(npath); - kfree(utf16_path); - return rc; + goto out; + } + + if (!npath[0]) { + dentry = dget(cifs_sb->root); + } else { + dentry = path_to_dentry(cifs_sb, npath); + if (IS_ERR(dentry)) { + rc = -ENOENT; + goto out; + } } + cfid->dentry = dentry; /* * We do not hold the lock for the open because in case @@ -244,6 +259,15 @@ smb2_set_related(&rqst[1]); + /* + * Set @cfid->has_lease to true before sending out compounded request so + * its lease reference can be put in cached_dir_lease_break() due to a + * potential lease break right after the request is sent or while @cfid + * is still being cached. Concurrent processes won't be to use it yet + * due to @cfid->time being zero. + */ + cfid->has_lease = true; + rc = compound_send_recv(xid, ses, server, flags, 2, rqst, resp_buftype, rsp_iov); @@ -258,6 +282,8 @@ cfid->tcon = tcon; cfid->is_open = true; + spin_lock(&cfids->cfid_list_lock); + o_rsp = (struct smb2_create_rsp *)rsp_iov[0].iov_base; oparms.fid->persistent_fid = o_rsp->PersistentFileId; oparms.fid->volatile_fid = o_rsp->VolatileFileId; @@ -265,18 +291,25 @@ oparms.fid->mid = le64_to_cpu(o_rsp->hdr.MessageId); #endif /* CIFS_DEBUG2 */ - if (o_rsp->OplockLevel != SMB2_OPLOCK_LEVEL_LEASE) + rc = -EINVAL; + if (o_rsp->OplockLevel != SMB2_OPLOCK_LEVEL_LEASE) { + spin_unlock(&cfids->cfid_list_lock); goto oshr_free; + } smb2_parse_contexts(server, o_rsp, &oparms.fid->epoch, oparms.fid->lease_key, &oplock, NULL, NULL); - if (!(oplock & SMB2_LEASE_READ_CACHING_HE)) + if (!(oplock & SMB2_LEASE_READ_CACHING_HE)) { + spin_unlock(&cfids->cfid_list_lock); goto oshr_free; + } qi_rsp = (struct smb2_query_info_rsp *)rsp_iov[1].iov_base; - if (le32_to_cpu(qi_rsp->OutputBufferLength) < sizeof(struct smb2_file_all_info)) + if (le32_to_cpu(qi_rsp->OutputBufferLength) < sizeof(struct smb2_file_all_info)) { + spin_unlock(&cfids->cfid_list_lock); goto oshr_free; + } if (!smb2_validate_and_copy_iov( le16_to_cpu(qi_rsp->OutputBufferOffset), sizeof(struct smb2_file_all_info), @@ -284,57 +317,49 @@ (char *)&cfid->file_all_info)) cfid->file_all_info_is_valid = true; - if (!npath[0]) - dentry = dget(cifs_sb->root); - else { - dentry = path_to_dentry(cifs_sb, npath); - if (IS_ERR(dentry)) { - rc = -ENOENT; - goto oshr_free; - } - } - cfid->dentry = dentry; cfid->time = jiffies; - cfid->has_lease = true; + spin_unlock(&cfids->cfid_list_lock); + /* At this point the directory handle is fully cached */ + rc = 0; oshr_free: - kfree(utf16_path); SMB2_open_free(&rqst[0]); SMB2_query_info_free(&rqst[1]); free_rsp_buf(resp_buftype[0], rsp_iov[0].iov_base); free_rsp_buf(resp_buftype[1], rsp_iov[1].iov_base); - spin_lock(&cfids->cfid_list_lock); - if (rc && !cfid->has_lease) { + if (rc) { + spin_lock(&cfids->cfid_list_lock); if (cfid->on_list) { list_del(&cfid->entry); cfid->on_list = false; cfids->num_entries--; } - rc = -ENOENT; - } - spin_unlock(&cfids->cfid_list_lock); - if (!rc && !cfid->has_lease) { - /* - * We are guaranteed to have two references at this point. - * One for the caller and one for a potential lease. - * Release the Lease-ref so that the directory will be closed - * when the caller closes the cached handle. - */ - kref_put(&cfid->refcount, smb2_close_cached_fid); + if (cfid->has_lease) { + /* + * We are guaranteed to have two references at this + * point. One for the caller and one for a potential + * lease. Release the Lease-ref so that the directory + * will be closed when the caller closes the cached + * handle. + */ + cfid->has_lease = false; + spin_unlock(&cfids->cfid_list_lock); + kref_put(&cfid->refcount, smb2_close_cached_fid); + goto out; + } + spin_unlock(&cfids->cfid_list_lock); } +out: if (rc) { if (cfid->is_open) SMB2_close(0, cfid->tcon, cfid->fid.persistent_fid, cfid->fid.volatile_fid); free_cached_dir(cfid); - cfid = NULL; - } - - if (rc == 0) { + } else { *ret_cfid = cfid; atomic_inc(&tcon->num_remote_opens); } - + kfree(utf16_path); return rc; } @@ -451,6 +476,9 @@ struct cached_fid *cfid, *q; LIST_HEAD(entry); + if (cfids == NULL) + return; + spin_lock(&cfids->cfid_list_lock); list_for_each_entry_safe(cfid, q, &cfids->entries, entry) { list_move(&cfid->entry, &entry); @@ -568,53 +596,51 @@ kfree(cfid); } -static int -cifs_cfids_laundromat_thread(void *p) +static void cfids_laundromat_worker(struct work_struct *work) { - struct cached_fids *cfids = p; + struct cached_fids *cfids; struct cached_fid *cfid, *q; - struct list_head entry; + LIST_HEAD(entry); - while (!kthread_should_stop()) { - ssleep(1); - INIT_LIST_HEAD(&entry); - if (kthread_should_stop()) - return 0; - spin_lock(&cfids->cfid_list_lock); - list_for_each_entry_safe(cfid, q, &cfids->entries, entry) { - if (time_after(jiffies, cfid->time + HZ * 30)) { - list_del(&cfid->entry); - list_add(&cfid->entry, &entry); - cfids->num_entries--; - } - } - spin_unlock(&cfids->cfid_list_lock); + cfids = container_of(work, struct cached_fids, laundromat_work.work); - list_for_each_entry_safe(cfid, q, &entry, entry) { + spin_lock(&cfids->cfid_list_lock); + list_for_each_entry_safe(cfid, q, &cfids->entries, entry) { + if (cfid->time && + time_after(jiffies, cfid->time + HZ * dir_cache_timeout)) { cfid->on_list = false; - list_del(&cfid->entry); + list_move(&cfid->entry, &entry); + cfids->num_entries--; + /* To prevent race with smb2_cached_lease_break() */ + kref_get(&cfid->refcount); + } + } + spin_unlock(&cfids->cfid_list_lock); + + list_for_each_entry_safe(cfid, q, &entry, entry) { + list_del(&cfid->entry); + /* + * Cancel and wait for the work to finish in case we are racing + * with it. + */ + cancel_work_sync(&cfid->lease_break); + if (cfid->has_lease) { /* - * Cancel, and wait for the work to finish in - * case we are racing with it. + * Our lease has not yet been cancelled from the server + * so we need to drop the reference. */ - cancel_work_sync(&cfid->lease_break); - if (cfid->has_lease) { - /* - * We lease has not yet been cancelled from - * the server so we need to drop the reference. - */ - spin_lock(&cfids->cfid_list_lock); - cfid->has_lease = false; - spin_unlock(&cfids->cfid_list_lock); - kref_put(&cfid->refcount, smb2_close_cached_fid); - } + spin_lock(&cfids->cfid_list_lock); + cfid->has_lease = false; + spin_unlock(&cfids->cfid_list_lock); + kref_put(&cfid->refcount, smb2_close_cached_fid); } + /* Drop the extra reference opened above */ + kref_put(&cfid->refcount, smb2_close_cached_fid); } - - return 0; + queue_delayed_work(cifsiod_wq, &cfids->laundromat_work, + dir_cache_timeout * HZ); } - struct cached_fids *init_cached_dirs(void) { struct cached_fids *cfids; @@ -625,19 +651,10 @@ spin_lock_init(&cfids->cfid_list_lock); INIT_LIST_HEAD(&cfids->entries); - /* - * since we're in a cifs function already, we know that - * this will succeed. No need for try_module_get(). - */ - __module_get(THIS_MODULE); - cfids->laundromat = kthread_run(cifs_cfids_laundromat_thread, - cfids, "cifsd-cfid-laundromat"); - if (IS_ERR(cfids->laundromat)) { - cifs_dbg(VFS, "Failed to start cfids laundromat thread.\n"); - kfree(cfids); - module_put(THIS_MODULE); - return NULL; - } + INIT_DELAYED_WORK(&cfids->laundromat_work, cfids_laundromat_worker); + queue_delayed_work(cifsiod_wq, &cfids->laundromat_work, + dir_cache_timeout * HZ); + return cfids; } @@ -650,11 +667,10 @@ struct cached_fid *cfid, *q; LIST_HEAD(entry); - if (cfids->laundromat) { - kthread_stop(cfids->laundromat); - cfids->laundromat = NULL; - module_put(THIS_MODULE); - } + if (cfids == NULL) + return; + + cancel_delayed_work_sync(&cfids->laundromat_work); spin_lock(&cfids->cfid_list_lock); list_for_each_entry_safe(cfid, q, &cfids->entries, entry) { diff -u linux-aws-6.5-6.5.0/fs/smb/client/cifsglob.h linux-aws-6.5-6.5.0/fs/smb/client/cifsglob.h --- linux-aws-6.5-6.5.0/fs/smb/client/cifsglob.h +++ linux-aws-6.5-6.5.0/fs/smb/client/cifsglob.h @@ -951,6 +951,8 @@ struct list_head iface_head; struct kref refcount; size_t speed; + size_t weight_fulfilled; + unsigned int num_channels; unsigned int rdma_capable : 1; unsigned int rss_capable : 1; unsigned int is_active : 1; /* unset if non existent */ @@ -1192,6 +1194,7 @@ __u32 max_chunks; __u32 max_bytes_chunk; __u32 max_bytes_copy; + __u32 max_cached_dirs; #ifdef CONFIG_CIFS_FSCACHE u64 resource_id; /* server resource id */ struct fscache_volume *fscache; /* cookie for share */ @@ -1913,7 +1916,7 @@ * cifsInodeInfo->lock_sem cifsInodeInfo->llist cifs_init_once * ->can_cache_brlcks * cifsInodeInfo->deferred_lock cifsInodeInfo->deferred_closes cifsInodeInfo_alloc - * cached_fid->fid_mutex cifs_tcon->crfid tconInfoAlloc + * cached_fid->fid_mutex cifs_tcon->crfid tcon_info_alloc * cifsFileInfo->fh_mutex cifsFileInfo cifs_new_fileinfo * cifsFileInfo->file_info_lock cifsFileInfo->count cifs_new_fileinfo * ->invalidHandle initiate_cifs_search @@ -1987,6 +1990,7 @@ extern unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */ extern unsigned int cifs_min_small; /* min size of small buf pool */ extern unsigned int cifs_max_pending; /* MAX requests at once to server*/ +extern unsigned int dir_cache_timeout; /* max time for directory lease caching of dir */ extern bool disable_legacy_dialects; /* forbid vers=1.0 and vers=2.0 mounts */ extern atomic_t mid_count; @@ -2111,6 +2115,7 @@ unsigned int len, skip; unsigned int nents = 0; unsigned long addr; + size_t data_size; int i, j; /* @@ -2126,17 +2131,21 @@ * rqst[1+].rq_iov[0+] data to be encrypted/decrypted */ for (i = 0; i < num_rqst; i++) { + data_size = iov_iter_count(&rqst[i].rq_iter); + /* We really don't want a mixture of pinned and unpinned pages * in the sglist. It's hard to keep track of which is what. * Instead, we convert to a BVEC-type iterator higher up. */ - if (WARN_ON_ONCE(user_backed_iter(&rqst[i].rq_iter))) + if (data_size && + WARN_ON_ONCE(user_backed_iter(&rqst[i].rq_iter))) return -EIO; /* We also don't want to have any extra refs or pins to clean * up in the sglist. */ - if (WARN_ON_ONCE(iov_iter_extract_will_pin(&rqst[i].rq_iter))) + if (data_size && + WARN_ON_ONCE(iov_iter_extract_will_pin(&rqst[i].rq_iter))) return -EIO; for (j = 0; j < rqst[i].rq_nvec; j++) { @@ -2152,7 +2161,8 @@ } skip = 0; } - nents += iov_iter_npages(&rqst[i].rq_iter, INT_MAX); + if (data_size) + nents += iov_iter_npages(&rqst[i].rq_iter, INT_MAX); } nents += DIV_ROUND_UP(offset_in_page(sig) + SMB2_SIGNATURE_SIZE, PAGE_SIZE); return nents; diff -u linux-aws-6.5-6.5.0/fs/smb/client/connect.c linux-aws-6.5-6.5.0/fs/smb/client/connect.c --- linux-aws-6.5-6.5.0/fs/smb/client/connect.c +++ linux-aws-6.5-6.5.0/fs/smb/client/connect.c @@ -156,13 +156,14 @@ /* If server is a channel, select the primary channel */ pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server; - spin_lock(&pserver->srv_lock); + /* if we need to signal just this channel */ if (!all_channels) { - pserver->tcpStatus = CifsNeedReconnect; - spin_unlock(&pserver->srv_lock); + spin_lock(&server->srv_lock); + if (server->tcpStatus != CifsExiting) + server->tcpStatus = CifsNeedReconnect; + spin_unlock(&server->srv_lock); return; } - spin_unlock(&pserver->srv_lock); spin_lock(&cifs_tcp_ses_lock); list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) { @@ -1882,7 +1883,8 @@ } } - tcon = tconInfoAlloc(); + /* no need to setup directory caching on IPC share, so pass in false */ + tcon = tcon_info_alloc(false); if (tcon == NULL) return -ENOMEM; @@ -2032,6 +2034,12 @@ } } + /* we now account for primary channel in iface->refcount */ + if (ses->chans[0].iface) { + kref_put(&ses->chans[0].iface->refcount, release_iface); + ses->chans[0].server = NULL; + } + sesInfoFree(ses); cifs_put_tcp_session(server, 0); } @@ -2473,8 +2481,9 @@ static struct cifs_tcon * cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx) { - int rc, xid; struct cifs_tcon *tcon; + bool nohandlecache; + int rc, xid; tcon = cifs_find_tcon(ses, ctx); if (tcon) { @@ -2492,11 +2501,17 @@ goto out_fail; } - tcon = tconInfoAlloc(); + if (ses->server->dialect >= SMB20_PROT_ID && + (ses->server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING)) + nohandlecache = ctx->nohandlecache; + else + nohandlecache = true; + tcon = tcon_info_alloc(!nohandlecache); if (tcon == NULL) { rc = -ENOMEM; goto out_fail; } + tcon->nohandlecache = nohandlecache; if (ctx->snapshot_time) { if (ses->server->vals->protocol_id == 0) { @@ -2657,10 +2672,7 @@ tcon->retry = ctx->retry; tcon->nocase = ctx->nocase; tcon->broken_sparse_sup = ctx->no_sparse; - if (ses->server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING) - tcon->nohandlecache = ctx->nohandlecache; - else - tcon->nohandlecache = true; + tcon->max_cached_dirs = ctx->max_cached_dirs; tcon->nodelete = ctx->nodelete; tcon->local_lease = ctx->local_lease; INIT_LIST_HEAD(&tcon->pending_opens); @@ -3844,8 +3856,12 @@ is_binding = !CIFS_ALL_CHANS_NEED_RECONNECT(ses); spin_unlock(&ses->chan_lock); - if (!is_binding) + if (!is_binding) { ses->ses_status = SES_IN_SETUP; + + /* force iface_list refresh */ + ses->iface_last_update = 0; + } spin_unlock(&ses->ses_lock); /* update ses ip_addr only for primary chan */ diff -u linux-aws-6.5-6.5.0/fs/smb/client/fs_context.c linux-aws-6.5-6.5.0/fs/smb/client/fs_context.c --- linux-aws-6.5-6.5.0/fs/smb/client/fs_context.c +++ linux-aws-6.5-6.5.0/fs/smb/client/fs_context.c @@ -150,6 +150,7 @@ fsparam_u32("closetimeo", Opt_closetimeo), fsparam_u32("echo_interval", Opt_echo_interval), fsparam_u32("max_credits", Opt_max_credits), + fsparam_u32("max_cached_dirs", Opt_max_cached_dirs), fsparam_u32("handletimeout", Opt_handletimeout), fsparam_u64("snapshot", Opt_snapshot), fsparam_u32("max_channels", Opt_max_channels), @@ -1165,6 +1166,14 @@ if (result.uint_32 > 1) ctx->multichannel = true; break; + case Opt_max_cached_dirs: + if (result.uint_32 < 1) { + cifs_errorf(fc, "%s: Invalid max_cached_dirs, needs to be 1 or more\n", + __func__); + goto cifs_parse_mount_err; + } + ctx->max_cached_dirs = result.uint_32; + break; case Opt_handletimeout: ctx->handle_timeout = result.uint_32; if (ctx->handle_timeout > SMB3_MAX_HANDLE_TIMEOUT) { @@ -1593,7 +1602,7 @@ ctx->acregmax = CIFS_DEF_ACTIMEO; ctx->acdirmax = CIFS_DEF_ACTIMEO; ctx->closetimeo = SMB3_DEF_DCLOSETIMEO; - + ctx->max_cached_dirs = MAX_CACHED_FIDS; /* Most clients set timeout to 0, allows server to use its default */ ctx->handle_timeout = 0; /* See MS-SMB2 spec section 2.2.14.2.12 */ diff -u linux-aws-6.5-6.5.0/fs/smb/client/inode.c linux-aws-6.5-6.5.0/fs/smb/client/inode.c --- linux-aws-6.5-6.5.0/fs/smb/client/inode.c +++ linux-aws-6.5-6.5.0/fs/smb/client/inode.c @@ -567,6 +567,10 @@ cifs_dbg(FYI, "Symlink\n"); fattr->cf_mode |= S_IFLNK; fattr->cf_dtype = DT_LNK; + } else if (memcmp("LnxFIFO", pbuf, 8) == 0) { + cifs_dbg(FYI, "FIFO\n"); + fattr->cf_mode |= S_IFIFO; + fattr->cf_dtype = DT_FIFO; } else { fattr->cf_mode |= S_IFREG; /* file? */ fattr->cf_dtype = DT_REG; @@ -738,7 +742,7 @@ fattr->cf_dtype = DT_BLK; } else if (symlink || reparse_tag == IO_REPARSE_TAG_SYMLINK || reparse_tag == IO_REPARSE_TAG_NFS) { - fattr->cf_mode = S_IFLNK; + fattr->cf_mode = S_IFLNK | cifs_sb->ctx->file_mode; fattr->cf_dtype = DT_LNK; } else if (fattr->cf_cifsattrs & ATTR_DIRECTORY) { fattr->cf_mode = S_IFDIR | cifs_sb->ctx->dir_mode; @@ -770,6 +774,8 @@ } if (S_ISLNK(fattr->cf_mode)) { + if (likely(data->symlink_target)) + fattr->cf_eof = strnlen(data->symlink_target, PATH_MAX); fattr->cf_symlink_target = data->symlink_target; data->symlink_target = NULL; } diff -u linux-aws-6.5-6.5.0/fs/smb/client/misc.c linux-aws-6.5-6.5.0/fs/smb/client/misc.c --- linux-aws-6.5-6.5.0/fs/smb/client/misc.c +++ linux-aws-6.5-6.5.0/fs/smb/client/misc.c @@ -113,18 +113,22 @@ } struct cifs_tcon * -tconInfoAlloc(void) +tcon_info_alloc(bool dir_leases_enabled) { struct cifs_tcon *ret_buf; ret_buf = kzalloc(sizeof(*ret_buf), GFP_KERNEL); if (!ret_buf) return NULL; - ret_buf->cfids = init_cached_dirs(); - if (!ret_buf->cfids) { - kfree(ret_buf); - return NULL; + + if (dir_leases_enabled == true) { + ret_buf->cfids = init_cached_dirs(); + if (!ret_buf->cfids) { + kfree(ret_buf); + return NULL; + } } + /* else ret_buf->cfids is already set to NULL above */ atomic_inc(&tconInfoAllocCount); ret_buf->status = TID_NEW; diff -u linux-aws-6.5-6.5.0/fs/smb/client/smb2ops.c linux-aws-6.5-6.5.0/fs/smb/client/smb2ops.c --- linux-aws-6.5-6.5.0/fs/smb/client/smb2ops.c +++ linux-aws-6.5-6.5.0/fs/smb/client/smb2ops.c @@ -756,6 +756,7 @@ unsigned int ret_data_len = 0; struct network_interface_info_ioctl_rsp *out_buf = NULL; struct cifs_ses *ses = tcon->ses; + struct TCP_Server_Info *pserver; /* do not query too frequently */ if (ses->iface_last_update && @@ -780,6 +781,11 @@ if (rc) goto out; + /* check if iface is still active */ + pserver = ses->chans[0].server; + if (pserver && !cifs_chan_is_iface_active(ses, pserver)) + cifs_chan_update_iface(ses, pserver); + out: kfree(out_buf); return rc; @@ -2834,6 +2840,8 @@ usleep_range(512, 2048); } while (++retry_count < 5); + if (!rc && !dfs_rsp) + rc = -EIO; if (rc) { if (!is_retryable_error(rc) && rc != -ENOENT && rc != -EOPNOTSUPP) cifs_tcon_dbg(VFS, "%s: ioctl error: rc=%d\n", __func__, rc); @@ -3424,6 +3432,7 @@ struct inode *inode = file_inode(file); struct cifsInodeInfo *cifsi = CIFS_I(inode); struct cifsFileInfo *cfile = file->private_data; + unsigned long long new_size; long rc; unsigned int xid; __le64 eof; @@ -3454,10 +3463,15 @@ /* * do we also need to change the size of the file? */ - if (keep_size == false && i_size_read(inode) < offset + len) { - eof = cpu_to_le64(offset + len); + new_size = offset + len; + if (keep_size == false && (unsigned long long)i_size_read(inode) < new_size) { + eof = cpu_to_le64(new_size); rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid, cfile->fid.volatile_fid, cfile->pid, &eof); + if (rc >= 0) { + truncate_setsize(inode, new_size); + fscache_resize_cookie(cifs_inode_cookie(inode), new_size); + } } zero_range_exit: @@ -3852,6 +3866,9 @@ if (rc < 0) goto out_2; + truncate_setsize(inode, old_eof + len); + fscache_resize_cookie(cifs_inode_cookie(inode), i_size_read(inode)); + rc = smb2_copychunk_range(xid, cfile, cfile, off, count, off + len); if (rc < 0) goto out_2; @@ -5214,7 +5231,7 @@ * over SMB2/SMB3 and Samba will do this with SMB3.1.1 POSIX Extensions */ - if (!S_ISCHR(mode) && !S_ISBLK(mode)) + if (!S_ISCHR(mode) && !S_ISBLK(mode) && !S_ISFIFO(mode)) return rc; cifs_dbg(FYI, "sfu compat create special file\n"); @@ -5262,6 +5279,12 @@ pdev->minor = cpu_to_le64(MINOR(dev)); rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms, &bytes_written, iov, 1); + } else if (S_ISFIFO(mode)) { + memcpy(pdev->type, "LnxFIFO", 8); + pdev->major = 0; + pdev->minor = 0; + rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms, + &bytes_written, iov, 1); } tcon->ses->server->ops->close(xid, tcon, &fid); d_drop(dentry); diff -u linux-aws-6.5-6.5.0/fs/smb/client/smb2pdu.c linux-aws-6.5-6.5.0/fs/smb/client/smb2pdu.c --- linux-aws-6.5-6.5.0/fs/smb/client/smb2pdu.c +++ linux-aws-6.5-6.5.0/fs/smb/client/smb2pdu.c @@ -3871,7 +3871,7 @@ goto done; /* allocate a dummy tcon struct used for reconnect */ - tcon = tconInfoAlloc(); + tcon = tcon_info_alloc(false); if (!tcon) { resched = true; list_for_each_entry_safe(ses, ses2, &tmp_ses_list, rlist) { diff -u linux-aws-6.5-6.5.0/fs/smb/client/transport.c linux-aws-6.5-6.5.0/fs/smb/client/transport.c --- linux-aws-6.5-6.5.0/fs/smb/client/transport.c +++ linux-aws-6.5-6.5.0/fs/smb/client/transport.c @@ -76,7 +76,7 @@ return temp; } -static void __release_mid(struct kref *refcount) +void __release_mid(struct kref *refcount) { struct mid_q_entry *midEntry = container_of(refcount, struct mid_q_entry, refcount); @@ -156,15 +156,6 @@ mempool_free(midEntry, cifs_mid_poolp); } -void release_mid(struct mid_q_entry *mid) -{ - struct TCP_Server_Info *server = mid->server; - - spin_lock(&server->mid_lock); - kref_put(&mid->refcount, __release_mid); - spin_unlock(&server->mid_lock); -} - void delete_mid(struct mid_q_entry *mid) { diff -u linux-aws-6.5-6.5.0/fs/smb/server/smb2pdu.c linux-aws-6.5-6.5.0/fs/smb/server/smb2pdu.c --- linux-aws-6.5-6.5.0/fs/smb/server/smb2pdu.c +++ linux-aws-6.5-6.5.0/fs/smb/server/smb2pdu.c @@ -2309,7 +2309,8 @@ rc = 0; } else { rc = ksmbd_vfs_setxattr(idmap, path, attr_name, value, - le16_to_cpu(eabuf->EaValueLength), 0); + le16_to_cpu(eabuf->EaValueLength), + 0, true); if (rc < 0) { ksmbd_debug(SMB, "ksmbd_vfs_setxattr is failed(%d)\n", @@ -2372,7 +2373,7 @@ return -EBADF; } - rc = ksmbd_vfs_setxattr(idmap, path, xattr_stream_name, NULL, 0, 0); + rc = ksmbd_vfs_setxattr(idmap, path, xattr_stream_name, NULL, 0, 0, false); if (rc < 0) pr_err("Failed to store XATTR stream name :%d\n", rc); return 0; @@ -2447,7 +2448,7 @@ da.flags = XATTR_DOSINFO_ATTRIB | XATTR_DOSINFO_CREATE_TIME | XATTR_DOSINFO_ITIME; - rc = ksmbd_vfs_set_dos_attrib_xattr(mnt_idmap(path->mnt), path, &da); + rc = ksmbd_vfs_set_dos_attrib_xattr(mnt_idmap(path->mnt), path, &da, false); if (rc) ksmbd_debug(SMB, "failed to store file attribute into xattr\n"); } @@ -2537,7 +2538,7 @@ sizeof(struct create_sd_buf_req)) return -EINVAL; return set_info_sec(work->conn, work->tcon, path, &sd_buf->ntsd, - le32_to_cpu(sd_buf->ccontext.DataLength), true); + le32_to_cpu(sd_buf->ccontext.DataLength), true, false); } static void ksmbd_acls_fattr(struct smb_fattr *fattr, @@ -3080,7 +3081,8 @@ idmap, &path, pntsd, - pntsd_size); + pntsd_size, + false); kfree(pntsd); if (rc) pr_err("failed to store ntacl in xattr : %d\n", @@ -3156,12 +3158,6 @@ if (req->CreateOptions & FILE_DELETE_ON_CLOSE_LE) ksmbd_fd_set_delete_on_close(fp, file_info); - if (need_truncate) { - rc = smb2_create_truncate(&path); - if (rc) - goto err_out; - } - if (req->CreateContextsOffset) { struct create_alloc_size_req *az_req; @@ -3330,11 +3326,12 @@ } err_out: - if (file_present || created) { - inode_unlock(d_inode(parent_path.dentry)); - path_put(&path); - path_put(&parent_path); - } + if (file_present || created) + ksmbd_vfs_kern_path_unlock(&parent_path, &path); + + if (fp && need_truncate) + rc = smb2_create_truncate(&fp->filp->f_path); + ksmbd_revert_fsids(work); err_out1: @@ -5522,7 +5519,7 @@ rc = ksmbd_vfs_setxattr(file_mnt_idmap(fp->filp), &fp->filp->f_path, xattr_stream_name, - NULL, 0, 0); + NULL, 0, 0, true); if (rc < 0) { pr_err("failed to store stream name in xattr: %d\n", rc); @@ -5615,11 +5612,9 @@ if (rc) rc = -EINVAL; out: - if (file_present) { - inode_unlock(d_inode(parent_path.dentry)); - path_put(&path); - path_put(&parent_path); - } + if (file_present) + ksmbd_vfs_kern_path_unlock(&parent_path, &path); + if (!IS_ERR(link_name)) kfree(link_name); kfree(pathname); @@ -5686,7 +5681,8 @@ da.flags = XATTR_DOSINFO_ATTRIB | XATTR_DOSINFO_CREATE_TIME | XATTR_DOSINFO_ITIME; - rc = ksmbd_vfs_set_dos_attrib_xattr(idmap, &filp->f_path, &da); + rc = ksmbd_vfs_set_dos_attrib_xattr(idmap, &filp->f_path, &da, + true); if (rc) ksmbd_debug(SMB, "failed to restore file attribute in EA\n"); @@ -5998,7 +5994,7 @@ fp->saccess |= FILE_SHARE_DELETE_LE; return set_info_sec(fp->conn, fp->tcon, &fp->filp->f_path, pntsd, - buf_len, false); + buf_len, false, true); } /** @@ -7545,7 +7541,8 @@ da.attr = le32_to_cpu(fp->f_ci->m_fattr); ret = ksmbd_vfs_set_dos_attrib_xattr(idmap, - &fp->filp->f_path, &da); + &fp->filp->f_path, + &da, true); if (ret) fp->f_ci->m_fattr = old_fattr; } diff -u linux-aws-6.5-6.5.0/include/acpi/acpi_bus.h linux-aws-6.5-6.5.0/include/acpi/acpi_bus.h --- linux-aws-6.5-6.5.0/include/acpi/acpi_bus.h +++ linux-aws-6.5-6.5.0/include/acpi/acpi_bus.h @@ -533,6 +533,7 @@ int acpi_bus_init_power(struct acpi_device *device); int acpi_device_fix_up_power(struct acpi_device *device); void acpi_device_fix_up_power_extended(struct acpi_device *adev); +void acpi_device_fix_up_power_children(struct acpi_device *adev); int acpi_bus_update_power(acpi_handle handle, int *state_p); int acpi_device_update_power(struct acpi_device *device, int *state_p); bool acpi_bus_power_manageable(acpi_handle handle); diff -u linux-aws-6.5-6.5.0/include/linux/bpf.h linux-aws-6.5-6.5.0/include/linux/bpf.h --- linux-aws-6.5-6.5.0/include/linux/bpf.h +++ linux-aws-6.5-6.5.0/include/linux/bpf.h @@ -890,10 +890,14 @@ aux->ctx_field_size = size; } +static bool bpf_is_ldimm64(const struct bpf_insn *insn) +{ + return insn->code == (BPF_LD | BPF_IMM | BPF_DW); +} + static inline bool bpf_pseudo_func(const struct bpf_insn *insn) { - return insn->code == (BPF_LD | BPF_IMM | BPF_DW) && - insn->src_reg == BPF_PSEUDO_FUNC; + return bpf_is_ldimm64(insn) && insn->src_reg == BPF_PSEUDO_FUNC; } struct bpf_prog_ops { @@ -1016,6 +1020,11 @@ */ #define BPF_TRAMP_F_SHARE_IPMODIFY BIT(6) +/* Indicate that current trampoline is in a tail call context. Then, it has to + * cache and restore tail_call_cnt to avoid infinite tail call loop. + */ +#define BPF_TRAMP_F_TAIL_CALL_CTX BIT(7) + /* Each call __bpf_prog_enter + call bpf_func + call __bpf_prog_exit is ~50 * bytes on x86. */ diff -u linux-aws-6.5-6.5.0/include/linux/dma-fence.h linux-aws-6.5-6.5.0/include/linux/dma-fence.h --- linux-aws-6.5-6.5.0/include/linux/dma-fence.h +++ linux-aws-6.5-6.5.0/include/linux/dma-fence.h @@ -499,6 +499,21 @@ } /** + * dma_fence_is_later_or_same - return true if f1 is later or same as f2 + * @f1: the first fence from the same context + * @f2: the second fence from the same context + * + * Returns true if f1 is chronologically later than f2 or the same fence. Both + * fences must be from the same context, since a seqno is not re-used across + * contexts. + */ +static inline bool dma_fence_is_later_or_same(struct dma_fence *f1, + struct dma_fence *f2) +{ + return f1 == f2 || dma_fence_is_later(f1, f2); +} + +/** * dma_fence_later - return the chronologically later fence * @f1: the first fence from the same context * @f2: the second fence from the same context diff -u linux-aws-6.5-6.5.0/include/linux/fs.h linux-aws-6.5-6.5.0/include/linux/fs.h --- linux-aws-6.5-6.5.0/include/linux/fs.h +++ linux-aws-6.5-6.5.0/include/linux/fs.h @@ -1505,7 +1505,50 @@ kgid_has_mapping(fs_userns, kgid); } -extern struct timespec64 current_time(struct inode *inode); +struct timespec64 current_time(struct inode *inode); +struct timespec64 inode_set_ctime_current(struct inode *inode); + +/** + * inode_get_ctime - fetch the current ctime from the inode + * @inode: inode from which to fetch ctime + * + * Grab the current ctime from the inode and return it. + */ +static inline struct timespec64 inode_get_ctime(const struct inode *inode) +{ + return inode->i_ctime; +} + +/** + * inode_set_ctime_to_ts - set the ctime in the inode + * @inode: inode in which to set the ctime + * @ts: value to set in the ctime field + * + * Set the ctime in @inode to @ts + */ +static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode, + struct timespec64 ts) +{ + inode->i_ctime = ts; + return ts; +} + +/** + * inode_set_ctime - set the ctime in the inode + * @inode: inode in which to set the ctime + * @sec: tv_sec value to set + * @nsec: tv_nsec value to set + * + * Set the ctime in @inode to { @sec, @nsec } + */ +static inline struct timespec64 inode_set_ctime(struct inode *inode, + time64_t sec, long nsec) +{ + struct timespec64 ts = { .tv_sec = sec, + .tv_nsec = nsec }; + + return inode_set_ctime_to_ts(inode, ts); +} /* * Snapshotting support. diff -u linux-aws-6.5-6.5.0/include/linux/hid.h linux-aws-6.5-6.5.0/include/linux/hid.h --- linux-aws-6.5-6.5.0/include/linux/hid.h +++ linux-aws-6.5-6.5.0/include/linux/hid.h @@ -656,6 +656,7 @@ struct list_head debug_list; spinlock_t debug_list_lock; wait_queue_head_t debug_wait; + struct kref ref; unsigned int id; /* system unique id */ @@ -664,6 +665,8 @@ #endif /* CONFIG_BPF */ }; +void hiddev_free(struct kref *ref); + #define to_hid_device(pdev) \ container_of(pdev, struct hid_device, dev) diff -u linux-aws-6.5-6.5.0/include/linux/irq.h linux-aws-6.5-6.5.0/include/linux/irq.h --- linux-aws-6.5-6.5.0/include/linux/irq.h +++ linux-aws-6.5-6.5.0/include/linux/irq.h @@ -215,8 +215,6 @@ * IRQD_SINGLE_TARGET - IRQ allows only a single affinity target * IRQD_DEFAULT_TRIGGER_SET - Expected trigger already been set * IRQD_CAN_RESERVE - Can use reservation mode - * IRQD_MSI_NOMASK_QUIRK - Non-maskable MSI quirk for affinity change - * required * IRQD_HANDLE_ENFORCE_IRQCTX - Enforce that handle_irq_*() is only invoked * from actual interrupt context. * IRQD_AFFINITY_ON_ACTIVATE - Affinity is set on activation. Don't call @@ -247,11 +245,10 @@ IRQD_SINGLE_TARGET = BIT(24), IRQD_DEFAULT_TRIGGER_SET = BIT(25), IRQD_CAN_RESERVE = BIT(26), - IRQD_MSI_NOMASK_QUIRK = BIT(27), - IRQD_HANDLE_ENFORCE_IRQCTX = BIT(28), - IRQD_AFFINITY_ON_ACTIVATE = BIT(29), - IRQD_IRQ_ENABLED_ON_SUSPEND = BIT(30), - IRQD_RESEND_WHEN_IN_PROGRESS = BIT(31), + IRQD_HANDLE_ENFORCE_IRQCTX = BIT(27), + IRQD_AFFINITY_ON_ACTIVATE = BIT(28), + IRQD_IRQ_ENABLED_ON_SUSPEND = BIT(29), + IRQD_RESEND_WHEN_IN_PROGRESS = BIT(30), }; #define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors) @@ -426,21 +423,6 @@ return __irqd_to_state(d) & IRQD_CAN_RESERVE; } -static inline void irqd_set_msi_nomask_quirk(struct irq_data *d) -{ - __irqd_to_state(d) |= IRQD_MSI_NOMASK_QUIRK; -} - -static inline void irqd_clr_msi_nomask_quirk(struct irq_data *d) -{ - __irqd_to_state(d) &= ~IRQD_MSI_NOMASK_QUIRK; -} - -static inline bool irqd_msi_nomask_quirk(struct irq_data *d) -{ - return __irqd_to_state(d) & IRQD_MSI_NOMASK_QUIRK; -} - static inline void irqd_set_affinity_on_activate(struct irq_data *d) { __irqd_to_state(d) |= IRQD_AFFINITY_ON_ACTIVATE; diff -u linux-aws-6.5-6.5.0/include/linux/lsm_hook_defs.h linux-aws-6.5-6.5.0/include/linux/lsm_hook_defs.h --- linux-aws-6.5-6.5.0/include/linux/lsm_hook_defs.h +++ linux-aws-6.5-6.5.0/include/linux/lsm_hook_defs.h @@ -48,7 +48,7 @@ LSM_HOOK(int, 0, syslog, int type) LSM_HOOK(int, 0, settime, const struct timespec64 *ts, const struct timezone *tz) -LSM_HOOK(int, 0, vm_enough_memory, struct mm_struct *mm, long pages) +LSM_HOOK(int, 1, vm_enough_memory, struct mm_struct *mm, long pages) LSM_HOOK(int, 0, bprm_creds_for_exec, struct linux_binprm *bprm) LSM_HOOK(int, 0, bprm_creds_from_file, struct linux_binprm *bprm, struct file *file) LSM_HOOK(int, 0, bprm_check_security, struct linux_binprm *bprm) @@ -273,7 +273,7 @@ LSM_HOOK(void, LSM_RET_VOID, inode_invalidate_secctx, struct inode *inode) LSM_HOOK(int, 0, inode_notifysecctx, struct inode *inode, void *ctx, u32 ctxlen) LSM_HOOK(int, 0, inode_setsecctx, struct dentry *dentry, void *ctx, u32 ctxlen) -LSM_HOOK(int, 0, inode_getsecctx, struct inode *inode, void **ctx, +LSM_HOOK(int, -EOPNOTSUPP, inode_getsecctx, struct inode *inode, void **ctx, u32 *ctxlen) #if defined(CONFIG_SECURITY) && defined(CONFIG_WATCH_QUEUE) diff -u linux-aws-6.5-6.5.0/include/linux/pci.h linux-aws-6.5-6.5.0/include/linux/pci.h --- linux-aws-6.5-6.5.0/include/linux/pci.h +++ linux-aws-6.5-6.5.0/include/linux/pci.h @@ -1627,6 +1627,8 @@ u16 entry; /* Driver uses to specify entry, OS writes */ }; +struct msi_domain_template; + #ifdef CONFIG_PCI_MSI int pci_msi_vec_count(struct pci_dev *dev); void pci_disable_msi(struct pci_dev *dev); @@ -1659,6 +1661,11 @@ void pci_free_irq_vectors(struct pci_dev *dev); int pci_irq_vector(struct pci_dev *dev, unsigned int nr); const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev, int vec); +bool pci_create_ims_domain(struct pci_dev *pdev, const struct msi_domain_template *template, + unsigned int hwsize, void *data); +struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev, union msi_instance_cookie *icookie, + const struct irq_affinity_desc *affdesc); +void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map); #else static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; } @@ -1722,6 +1729,25 @@ { return cpu_possible_mask; } + +static inline bool pci_create_ims_domain(struct pci_dev *pdev, + const struct msi_domain_template *template, + unsigned int hwsize, void *data) +{ return false; } + +static inline struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev, + union msi_instance_cookie *icookie, + const struct irq_affinity_desc *affdesc) +{ + struct msi_map map = { .index = -ENOSYS, }; + + return map; +} + +static inline void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map) +{ +} + #endif /** @@ -2616,14 +2642,6 @@ void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type); #endif -struct msi_domain_template; - -bool pci_create_ims_domain(struct pci_dev *pdev, const struct msi_domain_template *template, - unsigned int hwsize, void *data); -struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev, union msi_instance_cookie *icookie, - const struct irq_affinity_desc *affdesc); -void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map); - #include #define pci_printk(level, pdev, fmt, arg...) \ diff -u linux-aws-6.5-6.5.0/include/linux/pci_ids.h linux-aws-6.5-6.5.0/include/linux/pci_ids.h --- linux-aws-6.5-6.5.0/include/linux/pci_ids.h +++ linux-aws-6.5-6.5.0/include/linux/pci_ids.h @@ -180,6 +180,8 @@ #define PCI_DEVICE_ID_BERKOM_A4T 0xffa4 #define PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO 0xffa8 +#define PCI_VENDOR_ID_ITTIM 0x0b48 + #define PCI_VENDOR_ID_COMPAQ 0x0e11 #define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508 #define PCI_DEVICE_ID_COMPAQ_TACHYON 0xa0fc @@ -579,6 +581,7 @@ #define PCI_DEVICE_ID_AMD_1AH_M00H_DF_F3 0x12c3 #define PCI_DEVICE_ID_AMD_1AH_M20H_DF_F3 0x16fb #define PCI_DEVICE_ID_AMD_MI200_DF_F3 0x14d3 +#define PCI_DEVICE_ID_AMD_VANGOGH_USB 0x163a #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 #define PCI_DEVICE_ID_AMD_LANCE 0x2000 #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 diff -u linux-aws-6.5-6.5.0/include/linux/perf_event.h linux-aws-6.5-6.5.0/include/linux/perf_event.h --- linux-aws-6.5-6.5.0/include/linux/perf_event.h +++ linux-aws-6.5-6.5.0/include/linux/perf_event.h @@ -843,11 +843,11 @@ }; /* - * ,-----------------------[1:n]----------------------. - * V V - * perf_event_context <-[1:n]-> perf_event_pmu_context <--- perf_event - * ^ ^ | | - * `--------[1:n]---------' `-[n:1]-> pmu <-[1:n]-' + * ,-----------------------[1:n]------------------------. + * V V + * perf_event_context <-[1:n]-> perf_event_pmu_context <-[1:n]- perf_event + * | | + * `--[n:1]-> pmu <-[1:n]--' * * * struct perf_event_pmu_context lifetime is refcount based and RCU freed @@ -865,6 +865,9 @@ * ctx->mutex pinning the configuration. Since we hold a reference on * group_leader (through the filedesc) it can't go away, therefore it's * associated pmu_ctx must exist and cannot change due to ctx->mutex. + * + * perf_event holds a refcount on perf_event_context + * perf_event holds a refcount on perf_event_pmu_context */ struct perf_event_pmu_context { struct pmu *pmu; @@ -879,6 +882,7 @@ unsigned int embedded : 1; unsigned int nr_events; + unsigned int nr_cgroups; atomic_t refcount; /* event <-> epc */ struct rcu_head rcu_head; diff -u linux-aws-6.5-6.5.0/include/linux/trace_events.h linux-aws-6.5-6.5.0/include/linux/trace_events.h --- linux-aws-6.5-6.5.0/include/linux/trace_events.h +++ linux-aws-6.5-6.5.0/include/linux/trace_events.h @@ -492,6 +492,7 @@ EVENT_FILE_FL_TRIGGER_COND_BIT, EVENT_FILE_FL_PID_FILTER_BIT, EVENT_FILE_FL_WAS_ENABLED_BIT, + EVENT_FILE_FL_FREED_BIT, }; extern struct trace_event_file *trace_get_event_file(const char *instance, @@ -630,6 +631,7 @@ * TRIGGER_COND - When set, one or more triggers has an associated filter * PID_FILTER - When set, the event is filtered based on pid * WAS_ENABLED - Set when enabled to know to clear trace on module removal + * FREED - File descriptor is freed, all fields should be considered invalid */ enum { EVENT_FILE_FL_ENABLED = (1 << EVENT_FILE_FL_ENABLED_BIT), @@ -643,6 +645,7 @@ EVENT_FILE_FL_TRIGGER_COND = (1 << EVENT_FILE_FL_TRIGGER_COND_BIT), EVENT_FILE_FL_PID_FILTER = (1 << EVENT_FILE_FL_PID_FILTER_BIT), EVENT_FILE_FL_WAS_ENABLED = (1 << EVENT_FILE_FL_WAS_ENABLED_BIT), + EVENT_FILE_FL_FREED = (1 << EVENT_FILE_FL_FREED_BIT), }; struct trace_event_file { @@ -671,6 +674,7 @@ * caching and such. Which is mostly OK ;-) */ unsigned long flags; + atomic_t ref; /* ref count for opened files */ atomic_t sm_ref; /* soft-mode reference counter */ atomic_t tm_ref; /* trigger-mode reference counter */ }; diff -u linux-aws-6.5-6.5.0/include/net/bluetooth/hci.h linux-aws-6.5-6.5.0/include/net/bluetooth/hci.h --- linux-aws-6.5-6.5.0/include/net/bluetooth/hci.h +++ linux-aws-6.5-6.5.0/include/net/bluetooth/hci.h @@ -1,6 +1,7 @@ /* BlueZ - Bluetooth protocol stack for Linux Copyright (C) 2000-2001 Qualcomm Incorporated + Copyright 2023 NXP Written 2000,2001 by Maxim Krasnyansky @@ -672,6 +673,8 @@ #define HCI_TX_POWER_INVALID 127 #define HCI_RSSI_INVALID 127 +#define HCI_SYNC_HANDLE_INVALID 0xffff + #define HCI_ROLE_MASTER 0x00 #define HCI_ROLE_SLAVE 0x01 diff -u linux-aws-6.5-6.5.0/include/net/bluetooth/hci_core.h linux-aws-6.5-6.5.0/include/net/bluetooth/hci_core.h --- linux-aws-6.5-6.5.0/include/net/bluetooth/hci_core.h +++ linux-aws-6.5-6.5.0/include/net/bluetooth/hci_core.h @@ -350,7 +350,9 @@ struct list_head list; struct mutex lock; - char name[8]; + struct ida unset_handle_ida; + + const char *name; unsigned long flags; __u16 id; __u8 bus; @@ -978,6 +980,8 @@ HCI_CONN_CREATE_CIS, HCI_CONN_BIG_SYNC, HCI_CONN_BIG_SYNC_FAILED, + HCI_CONN_PA_SYNC, + HCI_CONN_PA_SYNC_FAILED, }; static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) @@ -1301,7 +1305,7 @@ if (c->type != ISO_LINK) continue; - if (handle == c->iso_qos.bcast.big) { + if (handle != BT_ISO_QOS_BIG_UNSET && handle == c->iso_qos.bcast.big) { rcu_read_unlock(); return c; } @@ -1312,6 +1316,52 @@ return NULL; } +static inline struct hci_conn * +hci_conn_hash_lookup_pa_sync_big_handle(struct hci_dev *hdev, __u8 big) +{ + struct hci_conn_hash *h = &hdev->conn_hash; + struct hci_conn *c; + + rcu_read_lock(); + + list_for_each_entry_rcu(c, &h->list, list) { + if (c->type != ISO_LINK || + !test_bit(HCI_CONN_PA_SYNC, &c->flags)) + continue; + + if (c->iso_qos.bcast.big == big) { + rcu_read_unlock(); + return c; + } + } + rcu_read_unlock(); + + return NULL; +} + +static inline struct hci_conn * +hci_conn_hash_lookup_pa_sync_handle(struct hci_dev *hdev, __u16 sync_handle) +{ + struct hci_conn_hash *h = &hdev->conn_hash; + struct hci_conn *c; + + rcu_read_lock(); + + list_for_each_entry_rcu(c, &h->list, list) { + if (c->type != ISO_LINK || + !test_bit(HCI_CONN_PA_SYNC, &c->flags)) + continue; + + if (c->sync_handle == sync_handle) { + rcu_read_unlock(); + return c; + } + } + rcu_read_unlock(); + + return NULL; +} + static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev, __u8 type, __u16 state) { @@ -1381,7 +1431,9 @@ int hci_conn_check_create_cis(struct hci_conn *conn); struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst, - u8 role); + u8 role, u16 handle); +struct hci_conn *hci_conn_add_unset(struct hci_dev *hdev, int type, + bdaddr_t *dst, u8 role); void hci_conn_del(struct hci_conn *conn); void hci_conn_hash_flush(struct hci_dev *hdev); void hci_conn_check_pending(struct hci_dev *hdev); @@ -1415,7 +1467,8 @@ __u8 data_len, __u8 *data); int hci_pa_create_sync(struct hci_dev *hdev, bdaddr_t *dst, __u8 dst_type, __u8 sid, struct bt_iso_qos *qos); -int hci_le_big_create_sync(struct hci_dev *hdev, struct bt_iso_qos *qos, +int hci_le_big_create_sync(struct hci_dev *hdev, struct hci_conn *hcon, + struct bt_iso_qos *qos, __u16 sync_handle, __u8 num_bis, __u8 bis[]); int hci_conn_check_link_mode(struct hci_conn *conn); int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); @@ -1426,6 +1479,7 @@ void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active); void hci_conn_failed(struct hci_conn *conn, u8 status); +u8 hci_conn_set_handle(struct hci_conn *conn, u16 handle); /* * hci_conn_get() and hci_conn_put() are used to control the life-time of an diff -u linux-aws-6.5-6.5.0/include/net/bluetooth/hci_sync.h linux-aws-6.5-6.5.0/include/net/bluetooth/hci_sync.h --- linux-aws-6.5-6.5.0/include/net/bluetooth/hci_sync.h +++ linux-aws-6.5-6.5.0/include/net/bluetooth/hci_sync.h @@ -5,6 +5,9 @@ * Copyright (C) 2021 Intel Corporation */ +#define UINT_PTR(_handle) ((void *)((uintptr_t)_handle)) +#define PTR_UINT(_ptr) ((uintptr_t)((void *)_ptr)) + typedef int (*hci_cmd_sync_work_func_t)(struct hci_dev *hdev, void *data); typedef void (*hci_cmd_sync_work_destroy_t)(struct hci_dev *hdev, void *data, int err); diff -u linux-aws-6.5-6.5.0/include/net/cfg80211.h linux-aws-6.5-6.5.0/include/net/cfg80211.h --- linux-aws-6.5-6.5.0/include/net/cfg80211.h +++ linux-aws-6.5-6.5.0/include/net/cfg80211.h @@ -5827,6 +5827,16 @@ */ void wiphy_work_cancel(struct wiphy *wiphy, struct wiphy_work *work); +/** + * wiphy_work_flush - flush previously queued work + * @wiphy: the wiphy, for debug purposes + * @work: the work to flush, this can be %NULL to flush all work + * + * Flush the work (i.e. run it if pending). This must be called + * under the wiphy mutex acquired by wiphy_lock(). + */ +void wiphy_work_flush(struct wiphy *wiphy, struct wiphy_work *work); + struct wiphy_delayed_work { struct wiphy_work work; struct wiphy *wiphy; @@ -5871,6 +5881,17 @@ struct wiphy_delayed_work *dwork); /** + * wiphy_delayed_work_flush - flush previously queued delayed work + * @wiphy: the wiphy, for debug purposes + * @work: the work to flush + * + * Flush the work (i.e. run it if pending). This must be called + * under the wiphy mutex acquired by wiphy_lock(). + */ +void wiphy_delayed_work_flush(struct wiphy *wiphy, + struct wiphy_delayed_work *dwork); + +/** * struct wireless_dev - wireless device state * * For netdevs, this structure must be allocated by the driver diff -u linux-aws-6.5-6.5.0/include/net/ip_fib.h linux-aws-6.5-6.5.0/include/net/ip_fib.h --- linux-aws-6.5-6.5.0/include/net/ip_fib.h +++ linux-aws-6.5-6.5.0/include/net/ip_fib.h @@ -154,6 +154,7 @@ int fib_nhs; bool fib_nh_is_v6; bool nh_updated; + bool pfsrc_removed; struct nexthop *nh; struct rcu_head rcu; struct fib_nh fib_nh[]; diff -u linux-aws-6.5-6.5.0/include/net/neighbour.h linux-aws-6.5-6.5.0/include/net/neighbour.h --- linux-aws-6.5-6.5.0/include/net/neighbour.h +++ linux-aws-6.5-6.5.0/include/net/neighbour.h @@ -162,7 +162,7 @@ struct rcu_head rcu; struct net_device *dev; netdevice_tracker dev_tracker; - u8 primary_key[0]; + u8 primary_key[]; } __randomize_layout; struct neigh_ops { diff -u linux-aws-6.5-6.5.0/include/net/netfilter/nf_tables.h linux-aws-6.5-6.5.0/include/net/netfilter/nf_tables.h --- linux-aws-6.5-6.5.0/include/net/netfilter/nf_tables.h +++ linux-aws-6.5-6.5.0/include/net/netfilter/nf_tables.h @@ -178,9 +178,9 @@ return *(__force __be32 *)sreg; } -static inline void nft_reg_store64(u32 *dreg, u64 val) +static inline void nft_reg_store64(u64 *dreg, u64 val) { - put_unaligned(val, (u64 *)dreg); + put_unaligned(val, dreg); } static inline u64 nft_reg_load64(const u32 *sreg) diff -u linux-aws-6.5-6.5.0/include/net/sock.h linux-aws-6.5-6.5.0/include/net/sock.h --- linux-aws-6.5-6.5.0/include/net/sock.h +++ linux-aws-6.5-6.5.0/include/net/sock.h @@ -336,7 +336,7 @@ * @sk_cgrp_data: cgroup data for this cgroup * @sk_memcg: this socket's memory cgroup association * @sk_write_pending: a write to stream socket waits to start - * @sk_wait_pending: number of threads blocked on this socket + * @sk_disconnects: number of disconnect operations performed on this sock * @sk_state_change: callback to indicate change in the state of the sock * @sk_data_ready: callback to indicate there is data to be processed * @sk_write_space: callback to indicate there is bf sending space available @@ -429,7 +429,7 @@ unsigned int sk_napi_id; #endif int sk_rcvbuf; - int sk_wait_pending; + int sk_disconnects; struct sk_filter __rcu *sk_filter; union { @@ -1189,8 +1189,7 @@ } #define sk_wait_event(__sk, __timeo, __condition, __wait) \ - ({ int __rc; \ - __sk->sk_wait_pending++; \ + ({ int __rc, __dis = __sk->sk_disconnects; \ release_sock(__sk); \ __rc = __condition; \ if (!__rc) { \ @@ -1200,8 +1199,7 @@ } \ sched_annotate_sleep(); \ lock_sock(__sk); \ - __sk->sk_wait_pending--; \ - __rc = __condition; \ + __rc = __dis == __sk->sk_disconnects ? __condition : -EPIPE; \ __rc; \ }) @@ -2008,21 +2006,33 @@ /* sk_tx_queue_mapping accept only upto a 16-bit value */ if (WARN_ON_ONCE((unsigned short)tx_queue >= USHRT_MAX)) return; - sk->sk_tx_queue_mapping = tx_queue; + /* Paired with READ_ONCE() in sk_tx_queue_get() and + * other WRITE_ONCE() because socket lock might be not held. + */ + WRITE_ONCE(sk->sk_tx_queue_mapping, tx_queue); } #define NO_QUEUE_MAPPING USHRT_MAX static inline void sk_tx_queue_clear(struct sock *sk) { - sk->sk_tx_queue_mapping = NO_QUEUE_MAPPING; + /* Paired with READ_ONCE() in sk_tx_queue_get() and + * other WRITE_ONCE() because socket lock might be not held. + */ + WRITE_ONCE(sk->sk_tx_queue_mapping, NO_QUEUE_MAPPING); } static inline int sk_tx_queue_get(const struct sock *sk) { - if (sk && sk->sk_tx_queue_mapping != NO_QUEUE_MAPPING) - return sk->sk_tx_queue_mapping; + if (sk) { + /* Paired with WRITE_ONCE() in sk_tx_queue_clear() + * and sk_tx_queue_set(). + */ + int val = READ_ONCE(sk->sk_tx_queue_mapping); + if (val != NO_QUEUE_MAPPING) + return val; + } return -1; } @@ -2171,7 +2181,7 @@ if (ndst != dst) { rcu_assign_pointer(sk->sk_dst_cache, ndst); sk_tx_queue_clear(sk); - sk->sk_dst_pending_confirm = 0; + WRITE_ONCE(sk->sk_dst_pending_confirm, 0); } } } @@ -2188,7 +2198,7 @@ struct dst_entry *old_dst; sk_tx_queue_clear(sk); - sk->sk_dst_pending_confirm = 0; + WRITE_ONCE(sk->sk_dst_pending_confirm, 0); old_dst = rcu_dereference_protected(sk->sk_dst_cache, lockdep_sock_is_held(sk)); rcu_assign_pointer(sk->sk_dst_cache, dst); @@ -2201,7 +2211,7 @@ struct dst_entry *old_dst; sk_tx_queue_clear(sk); - sk->sk_dst_pending_confirm = 0; + WRITE_ONCE(sk->sk_dst_pending_confirm, 0); old_dst = xchg((__force struct dst_entry **)&sk->sk_dst_cache, dst); dst_release(old_dst); } diff -u linux-aws-6.5-6.5.0/include/net/tcp.h linux-aws-6.5-6.5.0/include/net/tcp.h --- linux-aws-6.5-6.5.0/include/net/tcp.h +++ linux-aws-6.5-6.5.0/include/net/tcp.h @@ -142,6 +142,9 @@ #define TCP_RTO_MAX ((unsigned)(120*HZ)) #define TCP_RTO_MIN ((unsigned)(HZ/5)) #define TCP_TIMEOUT_MIN (2U) /* Min timeout for TCP timers in jiffies */ + +#define TCP_TIMEOUT_MIN_US (2*USEC_PER_MSEC) /* Min TCP timeout in microsecs */ + #define TCP_TIMEOUT_INIT ((unsigned)(1*HZ)) /* RFC6298 2.1 initial RTO value */ #define TCP_TIMEOUT_FALLBACK ((unsigned)(3*HZ)) /* RFC 1122 initial RTO value, now * used as a fallback RTO for the @@ -802,7 +805,7 @@ } /* Convert a nsec timestamp into TCP TSval timestamp (ms based currently) */ -static inline u32 tcp_ns_to_ts(u64 ns) +static inline u64 tcp_ns_to_ts(u64 ns) { return div_u64(ns, NSEC_PER_SEC / TCP_TS_HZ); } @@ -1455,17 +1458,22 @@ return tcp_win_from_space(sk, READ_ONCE(sk->sk_rcvbuf)); } -static inline void tcp_adjust_rcv_ssthresh(struct sock *sk) +static inline void __tcp_adjust_rcv_ssthresh(struct sock *sk, u32 new_ssthresh) { int unused_mem = sk_unused_reserved_mem(sk); struct tcp_sock *tp = tcp_sk(sk); - tp->rcv_ssthresh = min(tp->rcv_ssthresh, 4U * tp->advmss); + tp->rcv_ssthresh = min(tp->rcv_ssthresh, new_ssthresh); if (unused_mem) tp->rcv_ssthresh = max_t(u32, tp->rcv_ssthresh, tcp_win_from_space(sk, unused_mem)); } +static inline void tcp_adjust_rcv_ssthresh(struct sock *sk) +{ + __tcp_adjust_rcv_ssthresh(sk, 4U * tcp_sk(sk)->advmss); +} + void tcp_cleanup_rbuf(struct sock *sk, int copied); void __tcp_cleanup_rbuf(struct sock *sk, int copied); diff -u linux-aws-6.5-6.5.0/include/scsi/scsi_device.h linux-aws-6.5-6.5.0/include/scsi/scsi_device.h --- linux-aws-6.5-6.5.0/include/scsi/scsi_device.h +++ linux-aws-6.5-6.5.0/include/scsi/scsi_device.h @@ -162,8 +162,30 @@ * core. */ unsigned int eh_timeout; /* Error handling timeout */ - bool manage_system_start_stop; /* Let HLD (sd) manage system start/stop */ - bool manage_runtime_start_stop; /* Let HLD (sd) manage runtime start/stop */ + /* + * If true, let the high-level device driver (sd) manage the device + * power state for system suspend/resume (suspend to RAM and + * hibernation) operations. + */ + unsigned manage_system_start_stop:1; + + /* + * If true, let the high-level device driver (sd) manage the device + * power state for runtime device suspand and resume operations. + */ + unsigned manage_runtime_start_stop:1; + + /* + * If true, let the high-level device driver (sd) manage the device + * power state for system shutdown (power off) operations. + */ + unsigned manage_shutdown:1; + + /* + * If set and if the device is runtime suspended, ask the high-level + * device driver (sd) to force a runtime resume of the device. + */ + unsigned force_runtime_start_on_system_start:1; unsigned removable:1; unsigned changed:1; /* Data invalid due to media change */ diff -u linux-aws-6.5-6.5.0/include/uapi/linux/prctl.h linux-aws-6.5-6.5.0/include/uapi/linux/prctl.h --- linux-aws-6.5-6.5.0/include/uapi/linux/prctl.h +++ linux-aws-6.5-6.5.0/include/uapi/linux/prctl.h @@ -283,7 +283,8 @@ /* Memory deny write / execute */ #define PR_SET_MDWE 65 -# define PR_MDWE_REFUSE_EXEC_GAIN 1 +# define PR_MDWE_REFUSE_EXEC_GAIN (1UL << 0) +# define PR_MDWE_NO_INHERIT (1UL << 1) #define PR_GET_MDWE 66 diff -u linux-aws-6.5-6.5.0/include/uapi/linux/stddef.h linux-aws-6.5-6.5.0/include/uapi/linux/stddef.h --- linux-aws-6.5-6.5.0/include/uapi/linux/stddef.h +++ linux-aws-6.5-6.5.0/include/uapi/linux/stddef.h @@ -27,7 +27,7 @@ union { \ struct { MEMBERS } ATTRS; \ struct TAG { MEMBERS } ATTRS NAME; \ - } + } ATTRS #ifdef __cplusplus /* sizeof(struct{}) is 1 in C++, not 0, can't use C version of the macro. */ diff -u linux-aws-6.5-6.5.0/include/xen/events.h linux-aws-6.5-6.5.0/include/xen/events.h --- linux-aws-6.5-6.5.0/include/xen/events.h +++ linux-aws-6.5-6.5.0/include/xen/events.h @@ -108,8 +108,7 @@ evtchn_port_t evtchn_from_irq(unsigned irq); int xen_set_callback_via(uint64_t via); -void xen_evtchn_do_upcall(struct pt_regs *regs); -int xen_hvm_evtchn_do_upcall(void); +int xen_evtchn_do_upcall(void); /* Bind a pirq for a physical interrupt to an irq. */ int xen_bind_pirq_gsi_to_irq(unsigned gsi, diff -u linux-aws-6.5-6.5.0/io_uring/fdinfo.c linux-aws-6.5-6.5.0/io_uring/fdinfo.c --- linux-aws-6.5-6.5.0/io_uring/fdinfo.c +++ linux-aws-6.5-6.5.0/io_uring/fdinfo.c @@ -145,13 +145,8 @@ if (has_lock && (ctx->flags & IORING_SETUP_SQPOLL)) { struct io_sq_data *sq = ctx->sq_data; - if (mutex_trylock(&sq->lock)) { - if (sq->thread) { - sq_pid = task_pid_nr(sq->thread); - sq_cpu = task_cpu(sq->thread); - } - mutex_unlock(&sq->lock); - } + sq_pid = sq->task_pid; + sq_cpu = sq->sq_cpu; } seq_printf(m, "SqThread:\t%d\n", sq_pid); diff -u linux-aws-6.5-6.5.0/io_uring/fs.c linux-aws-6.5-6.5.0/io_uring/fs.c --- linux-aws-6.5-6.5.0/io_uring/fs.c +++ linux-aws-6.5-6.5.0/io_uring/fs.c @@ -254,7 +254,7 @@ newf = u64_to_user_ptr(READ_ONCE(sqe->addr2)); lnk->flags = READ_ONCE(sqe->hardlink_flags); - lnk->oldpath = getname(oldf); + lnk->oldpath = getname_uflags(oldf, lnk->flags); if (IS_ERR(lnk->oldpath)) return PTR_ERR(lnk->oldpath); diff -u linux-aws-6.5-6.5.0/io_uring/io_uring.c linux-aws-6.5-6.5.0/io_uring/io_uring.c --- linux-aws-6.5-6.5.0/io_uring/io_uring.c +++ linux-aws-6.5-6.5.0/io_uring/io_uring.c @@ -1600,6 +1600,7 @@ if (!(ctx->flags & IORING_SETUP_IOPOLL)) return; + percpu_ref_get(&ctx->refs); mutex_lock(&ctx->uring_lock); while (!wq_list_empty(&ctx->iopoll_list)) { /* let it sleep and repeat later if can't complete a request */ @@ -1617,6 +1618,7 @@ } } mutex_unlock(&ctx->uring_lock); + percpu_ref_put(&ctx->refs); } static int io_iopoll_check(struct io_ring_ctx *ctx, long min) @@ -2691,6 +2693,7 @@ { struct page **page_array; unsigned int nr_pages; + void *page_addr; int ret, i; *npages = 0; @@ -2712,27 +2715,29 @@ io_pages_free(&page_array, ret > 0 ? ret : 0); return ret < 0 ? ERR_PTR(ret) : ERR_PTR(-EFAULT); } - /* - * Should be a single page. If the ring is small enough that we can - * use a normal page, that is fine. If we need multiple pages, then - * userspace should use a huge page. That's the only way to guarantee - * that we get contigious memory, outside of just being lucky or - * (currently) having low memory fragmentation. - */ - if (page_array[0] != page_array[ret - 1]) - goto err; - /* - * Can't support mapping user allocated ring memory on 32-bit archs - * where it could potentially reside in highmem. Just fail those with - * -EINVAL, just like we did on kernels that didn't support this - * feature. - */ + page_addr = page_address(page_array[0]); for (i = 0; i < nr_pages; i++) { - if (PageHighMem(page_array[i])) { - ret = -EINVAL; + ret = -EINVAL; + + /* + * Can't support mapping user allocated ring memory on 32-bit + * archs where it could potentially reside in highmem. Just + * fail those with -EINVAL, just like we did on kernels that + * didn't support this feature. + */ + if (PageHighMem(page_array[i])) goto err; - } + + /* + * No support for discontig pages for now, should either be a + * single normal page, or a huge page. Later on we can add + * support for remapping discontig pages, for now we will + * just fail them with EINVAL. + */ + if (page_address(page_array[i]) != page_addr) + goto err; + page_addr += PAGE_SIZE; } *pages = page_array; @@ -3135,12 +3140,7 @@ init_completion(&exit.completion); init_task_work(&exit.task_work, io_tctx_exit_cb); exit.ctx = ctx; - /* - * Some may use context even when all refs and requests have been put, - * and they are free to do so while still holding uring_lock or - * completion_lock, see io_req_task_submit(). Apart from other work, - * this lock/unlock section also waits them to finish. - */ + mutex_lock(&ctx->uring_lock); while (!list_empty(&ctx->tctx_list)) { WARN_ON_ONCE(time_after(jiffies, timeout)); @@ -3435,25 +3435,27 @@ struct page *page; void *ptr; - /* Don't allow mmap if the ring was setup without it */ - if (ctx->flags & IORING_SETUP_NO_MMAP) - return ERR_PTR(-EINVAL); - switch (offset & IORING_OFF_MMAP_MASK) { case IORING_OFF_SQ_RING: case IORING_OFF_CQ_RING: + /* Don't allow mmap if the ring was setup without it */ + if (ctx->flags & IORING_SETUP_NO_MMAP) + return ERR_PTR(-EINVAL); ptr = ctx->rings; break; case IORING_OFF_SQES: + /* Don't allow mmap if the ring was setup without it */ + if (ctx->flags & IORING_SETUP_NO_MMAP) + return ERR_PTR(-EINVAL); ptr = ctx->sq_sqes; break; case IORING_OFF_PBUF_RING: { unsigned int bgid; bgid = (offset & ~IORING_OFF_MMAP_MASK) >> IORING_OFF_PBUF_SHIFT; - mutex_lock(&ctx->uring_lock); + rcu_read_lock(); ptr = io_pbuf_get_address(ctx, bgid); - mutex_unlock(&ctx->uring_lock); + rcu_read_unlock(); if (!ptr) return ERR_PTR(-EINVAL); break; diff -u linux-aws-6.5-6.5.0/io_uring/kbuf.c linux-aws-6.5-6.5.0/io_uring/kbuf.c --- linux-aws-6.5-6.5.0/io_uring/kbuf.c +++ linux-aws-6.5-6.5.0/io_uring/kbuf.c @@ -19,33 +19,54 @@ #define BGID_ARRAY 64 +/* BIDs are addressed by a 16-bit field in a CQE */ +#define MAX_BIDS_PER_BGID (1 << 16) + struct io_provide_buf { struct file *file; __u64 addr; __u32 len; __u32 bgid; - __u16 nbufs; + __u32 nbufs; __u16 bid; }; struct io_buf_free { struct hlist_node list; void *mem; + size_t size; + int inuse; }; +static struct io_buffer_list *__io_buffer_get_list(struct io_ring_ctx *ctx, + struct io_buffer_list *bl, + unsigned int bgid) +{ + if (bl && bgid < BGID_ARRAY) + return &bl[bgid]; + + return xa_load(&ctx->io_bl_xa, bgid); +} + static inline struct io_buffer_list *io_buffer_get_list(struct io_ring_ctx *ctx, unsigned int bgid) { - if (ctx->io_bl && bgid < BGID_ARRAY) - return &ctx->io_bl[bgid]; + lockdep_assert_held(&ctx->uring_lock); - return xa_load(&ctx->io_bl_xa, bgid); + return __io_buffer_get_list(ctx, ctx->io_bl, bgid); } static int io_buffer_add_list(struct io_ring_ctx *ctx, struct io_buffer_list *bl, unsigned int bgid) { + /* + * Store buffer group ID and finally mark the list as visible. + * The normal lookup doesn't care about the visibility as we're + * always under the ->uring_lock, but the RCU lookup from mmap does. + */ bl->bgid = bgid; + smp_store_release(&bl->is_ready, 1); + if (bgid < BGID_ARRAY) return 0; @@ -196,21 +217,40 @@ static __cold int io_init_bl_list(struct io_ring_ctx *ctx) { + struct io_buffer_list *bl; int i; - ctx->io_bl = kcalloc(BGID_ARRAY, sizeof(struct io_buffer_list), - GFP_KERNEL); - if (!ctx->io_bl) + bl = kcalloc(BGID_ARRAY, sizeof(struct io_buffer_list), GFP_KERNEL); + if (!bl) return -ENOMEM; for (i = 0; i < BGID_ARRAY; i++) { - INIT_LIST_HEAD(&ctx->io_bl[i].buf_list); - ctx->io_bl[i].bgid = i; + INIT_LIST_HEAD(&bl[i].buf_list); + bl[i].bgid = i; } + smp_store_release(&ctx->io_bl, bl); return 0; } +/* + * Mark the given mapped range as free for reuse + */ +static void io_kbuf_mark_free(struct io_ring_ctx *ctx, struct io_buffer_list *bl) +{ + struct io_buf_free *ibf; + + hlist_for_each_entry(ibf, &ctx->io_buf_list, list) { + if (bl->buf_ring == ibf->mem) { + ibf->inuse = 0; + return; + } + } + + /* can't happen... */ + WARN_ON_ONCE(1); +} + static int __io_remove_buffers(struct io_ring_ctx *ctx, struct io_buffer_list *bl, unsigned nbufs) { @@ -227,6 +267,7 @@ * io_kbuf_list_free() will free the page(s) at * ->release() time. */ + io_kbuf_mark_free(ctx, bl); bl->buf_ring = NULL; bl->is_mmap = 0; } else if (bl->buf_nr_pages) { @@ -275,7 +316,7 @@ xa_for_each(&ctx->io_bl_xa, index, bl) { xa_erase(&ctx->io_bl_xa, bl->bgid); __io_remove_buffers(ctx, bl, -1U); - kfree(bl); + kfree_rcu(bl, rcu); } while (!list_empty(&ctx->io_buffers_pages)) { @@ -297,7 +338,7 @@ return -EINVAL; tmp = READ_ONCE(sqe->fd); - if (!tmp || tmp > USHRT_MAX) + if (!tmp || tmp > MAX_BIDS_PER_BGID) return -EINVAL; memset(p, 0, sizeof(*p)); @@ -340,7 +381,7 @@ return -EINVAL; tmp = READ_ONCE(sqe->fd); - if (!tmp || tmp > USHRT_MAX) + if (!tmp || tmp > MAX_BIDS_PER_BGID) return -E2BIG; p->nbufs = tmp; p->addr = READ_ONCE(sqe->addr); @@ -360,7 +401,7 @@ tmp = READ_ONCE(sqe->off); if (tmp > USHRT_MAX) return -E2BIG; - if (tmp + p->nbufs >= USHRT_MAX) + if (tmp + p->nbufs > MAX_BIDS_PER_BGID) return -EINVAL; p->bid = tmp; return 0; @@ -460,7 +501,16 @@ INIT_LIST_HEAD(&bl->buf_list); ret = io_buffer_add_list(ctx, bl, p->bgid); if (ret) { - kfree(bl); + /* + * Doesn't need rcu free as it was never visible, but + * let's keep it consistent throughout. Also can't + * be a lower indexed array group, as adding one + * where lookup failed cannot happen. + */ + if (p->bgid >= BGID_ARRAY) + kfree_rcu(bl, rcu); + else + WARN_ON_ONCE(1); goto err; } } @@ -531,6 +581,34 @@ return -EINVAL; } +/* + * See if we have a suitable region that we can reuse, rather than allocate + * both a new io_buf_free and mem region again. We leave it on the list as + * even a reused entry will need freeing at ring release. + */ +static struct io_buf_free *io_lookup_buf_free_entry(struct io_ring_ctx *ctx, + size_t ring_size) +{ + struct io_buf_free *ibf, *best = NULL; + size_t best_dist; + + hlist_for_each_entry(ibf, &ctx->io_buf_list, list) { + size_t dist; + + if (ibf->inuse || ibf->size < ring_size) + continue; + dist = ibf->size - ring_size; + if (!best || dist < best_dist) { + best = ibf; + if (!dist) + break; + best_dist = dist; + } + } + + return best; +} + static int io_alloc_pbuf_ring(struct io_ring_ctx *ctx, struct io_uring_buf_reg *reg, struct io_buffer_list *bl) @@ -540,20 +618,26 @@ void *ptr; ring_size = reg->ring_entries * sizeof(struct io_uring_buf_ring); - ptr = io_mem_alloc(ring_size); - if (!ptr) - return -ENOMEM; - /* Allocate and store deferred free entry */ - ibf = kmalloc(sizeof(*ibf), GFP_KERNEL_ACCOUNT); + /* Reuse existing entry, if we can */ + ibf = io_lookup_buf_free_entry(ctx, ring_size); if (!ibf) { - io_mem_free(ptr); - return -ENOMEM; + ptr = io_mem_alloc(ring_size); + if (IS_ERR(ptr)) + return PTR_ERR(ptr); + + /* Allocate and store deferred free entry */ + ibf = kmalloc(sizeof(*ibf), GFP_KERNEL_ACCOUNT); + if (!ibf) { + io_mem_free(ptr); + return -ENOMEM; + } + ibf->mem = ptr; + ibf->size = ring_size; + hlist_add_head(&ibf->list, &ctx->io_buf_list); } - ibf->mem = ptr; - hlist_add_head(&ibf->list, &ctx->io_buf_list); - - bl->buf_ring = ptr; + ibf->inuse = 1; + bl->buf_ring = ibf->mem; bl->is_mapped = 1; bl->is_mmap = 1; return 0; @@ -565,6 +649,8 @@ struct io_buffer_list *bl, *free_bl = NULL; int ret; + lockdep_assert_held(&ctx->uring_lock); + if (copy_from_user(®, arg, sizeof(reg))) return -EFAULT; @@ -619,7 +705,7 @@ return 0; } - kfree(free_bl); + kfree_rcu(free_bl, rcu); return ret; } @@ -628,6 +714,8 @@ struct io_uring_buf_reg reg; struct io_buffer_list *bl; + lockdep_assert_held(&ctx->uring_lock); + if (copy_from_user(®, arg, sizeof(reg))) return -EFAULT; if (reg.resv[0] || reg.resv[1] || reg.resv[2]) @@ -644,7 +732,7 @@ __io_remove_buffers(ctx, bl, -1U); if (bl->bgid >= BGID_ARRAY) { xa_erase(&ctx->io_bl_xa, bl->bgid); - kfree(bl); + kfree_rcu(bl, rcu); } return 0; } @@ -653,9 +741,17 @@ { struct io_buffer_list *bl; - bl = io_buffer_get_list(ctx, bgid); + bl = __io_buffer_get_list(ctx, smp_load_acquire(&ctx->io_bl), bgid); + if (!bl || !bl->is_mmap) return NULL; + /* + * Ensure the list is fully setup. Only strictly needed for RCU lookup + * via mmap, and in that case only for the array indexed groups. For + * the xarray lookups, it's either visible and ready, or not at all. + */ + if (!smp_load_acquire(&bl->is_ready)) + return NULL; return bl->buf_ring; } diff -u linux-aws-6.5-6.5.0/io_uring/kbuf.h linux-aws-6.5-6.5.0/io_uring/kbuf.h --- linux-aws-6.5-6.5.0/io_uring/kbuf.h +++ linux-aws-6.5-6.5.0/io_uring/kbuf.h @@ -15,6 +15,7 @@ struct page **buf_pages; struct io_uring_buf_ring *buf_ring; }; + struct rcu_head rcu; }; __u16 bgid; @@ -28,6 +29,8 @@ __u8 is_mapped; /* ring mapped provided buffers, but mmap'ed by application */ __u8 is_mmap; + /* bl is visible from an RCU point of view for lookup */ + __u8 is_ready; }; struct io_buffer { diff -u linux-aws-6.5-6.5.0/io_uring/net.c linux-aws-6.5-6.5.0/io_uring/net.c --- linux-aws-6.5-6.5.0/io_uring/net.c +++ linux-aws-6.5-6.5.0/io_uring/net.c @@ -1461,16 +1461,6 @@ int ret; bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK; - if (connect->in_progress) { - struct socket *socket; - - ret = -ENOTSOCK; - socket = sock_from_file(req->file); - if (socket) - ret = sock_error(socket->sk); - goto out; - } - if (req_has_async_data(req)) { io = req->async_data; } else { @@ -1490,9 +1480,7 @@ && force_nonblock) { if (ret == -EINPROGRESS) { connect->in_progress = true; - return -EAGAIN; - } - if (ret == -ECONNABORTED) { + } else if (ret == -ECONNABORTED) { if (connect->seen_econnaborted) goto out; connect->seen_econnaborted = true; @@ -1506,6 +1494,16 @@ memcpy(req->async_data, &__io, sizeof(__io)); return -EAGAIN; } + if (connect->in_progress) { + /* + * At least bluetooth will return -EBADFD on a re-connect + * attempt, and it's (supposedly) also valid to get -EISCONN + * which means the previous result is good. For both of these, + * grab the sock_error() and use that for the completion. + */ + if (ret == -EBADFD || ret == -EISCONN) + ret = sock_error(sock_from_file(req->file)->sk); + } if (ret == -ERESTARTSYS) ret = -EINTR; out: diff -u linux-aws-6.5-6.5.0/io_uring/rsrc.c linux-aws-6.5-6.5.0/io_uring/rsrc.c --- linux-aws-6.5-6.5.0/io_uring/rsrc.c +++ linux-aws-6.5-6.5.0/io_uring/rsrc.c @@ -1261,7 +1261,7 @@ */ const struct bio_vec *bvec = imu->bvec; - if (offset <= bvec->bv_len) { + if (offset < bvec->bv_len) { /* * Note, huge pages buffers consists of one large * bvec entry and should always go this way. The other diff -u linux-aws-6.5-6.5.0/io_uring/sqpoll.c linux-aws-6.5-6.5.0/io_uring/sqpoll.c --- linux-aws-6.5-6.5.0/io_uring/sqpoll.c +++ linux-aws-6.5-6.5.0/io_uring/sqpoll.c @@ -214,6 +214,7 @@ did_sig = get_signal(&ksig); cond_resched(); mutex_lock(&sqd->lock); + sqd->sq_cpu = raw_smp_processor_id(); } return did_sig || test_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state); } @@ -229,10 +230,15 @@ snprintf(buf, sizeof(buf), "iou-sqp-%d", sqd->task_pid); set_task_comm(current, buf); - if (sqd->sq_cpu != -1) + /* reset to our pid after we've set task_comm, for fdinfo */ + sqd->task_pid = current->pid; + + if (sqd->sq_cpu != -1) { set_cpus_allowed_ptr(current, cpumask_of(sqd->sq_cpu)); - else + } else { set_cpus_allowed_ptr(current, cpu_online_mask); + sqd->sq_cpu = raw_smp_processor_id(); + } mutex_lock(&sqd->lock); while (1) { @@ -261,6 +267,7 @@ mutex_unlock(&sqd->lock); cond_resched(); mutex_lock(&sqd->lock); + sqd->sq_cpu = raw_smp_processor_id(); } continue; } @@ -294,6 +301,7 @@ mutex_unlock(&sqd->lock); schedule(); mutex_lock(&sqd->lock); + sqd->sq_cpu = raw_smp_processor_id(); } list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) atomic_andnot(IORING_SQ_NEED_WAKEUP, diff -u linux-aws-6.5-6.5.0/kernel/bpf/core.c linux-aws-6.5-6.5.0/kernel/bpf/core.c --- linux-aws-6.5-6.5.0/kernel/bpf/core.c +++ linux-aws-6.5-6.5.0/kernel/bpf/core.c @@ -613,7 +613,11 @@ if (val < ksym->start) return -1; - if (val >= ksym->end) + /* Ensure that we detect return addresses as part of the program, when + * the final instruction is a call for a program part of the stack + * trace. Therefore, do val > ksym->end instead of val >= ksym->end. + */ + if (val > ksym->end) return 1; return 0; diff -u linux-aws-6.5-6.5.0/kernel/bpf/helpers.c linux-aws-6.5-6.5.0/kernel/bpf/helpers.c --- linux-aws-6.5-6.5.0/kernel/bpf/helpers.c +++ linux-aws-6.5-6.5.0/kernel/bpf/helpers.c @@ -1174,13 +1174,6 @@ ret = -EBUSY; goto out; } - if (!atomic64_read(&map->usercnt)) { - /* maps with timers must be either held by user space - * or pinned in bpffs. - */ - ret = -EPERM; - goto out; - } /* allocate hrtimer via map_kmalloc to use memcg accounting */ t = bpf_map_kmalloc_node(map, sizeof(*t), GFP_ATOMIC, map->numa_node); if (!t) { @@ -1193,7 +1186,21 @@ rcu_assign_pointer(t->callback_fn, NULL); hrtimer_init(&t->timer, clockid, HRTIMER_MODE_REL_SOFT); t->timer.function = bpf_timer_cb; - timer->timer = t; + WRITE_ONCE(timer->timer, t); + /* Guarantee the order between timer->timer and map->usercnt. So + * when there are concurrent uref release and bpf timer init, either + * bpf_timer_cancel_and_free() called by uref release reads a no-NULL + * timer or atomic64_read() below returns a zero usercnt. + */ + smp_mb(); + if (!atomic64_read(&map->usercnt)) { + /* maps with timers must be either held by user space + * or pinned in bpffs. + */ + WRITE_ONCE(timer->timer, NULL); + kfree(t); + ret = -EPERM; + } out: __bpf_spin_unlock_irqrestore(&timer->lock); return ret; @@ -1368,7 +1375,7 @@ /* The subsequent bpf_timer_start/cancel() helpers won't be able to use * this timer, since it won't be initialized. */ - timer->timer = NULL; + WRITE_ONCE(timer->timer, NULL); out: __bpf_spin_unlock_irqrestore(&timer->lock); if (!t) @@ -2167,7 +2174,12 @@ __bpf_kfunc long bpf_task_under_cgroup(struct task_struct *task, struct cgroup *ancestor) { - return task_under_cgroup_hierarchy(task, ancestor); + long ret; + + rcu_read_lock(); + ret = task_under_cgroup_hierarchy(task, ancestor); + rcu_read_unlock(); + return ret; } #endif /* CONFIG_CGROUPS */ diff -u linux-aws-6.5-6.5.0/kernel/bpf/trampoline.c linux-aws-6.5-6.5.0/kernel/bpf/trampoline.c --- linux-aws-6.5-6.5.0/kernel/bpf/trampoline.c +++ linux-aws-6.5-6.5.0/kernel/bpf/trampoline.c @@ -415,8 +415,8 @@ goto out; } - /* clear all bits except SHARE_IPMODIFY */ - tr->flags &= BPF_TRAMP_F_SHARE_IPMODIFY; + /* clear all bits except SHARE_IPMODIFY and TAIL_CALL_CTX */ + tr->flags &= (BPF_TRAMP_F_SHARE_IPMODIFY | BPF_TRAMP_F_TAIL_CALL_CTX); if (tlinks[BPF_TRAMP_FEXIT].nr_links || tlinks[BPF_TRAMP_MODIFY_RETURN].nr_links) { diff -u linux-aws-6.5-6.5.0/kernel/bpf/verifier.c linux-aws-6.5-6.5.0/kernel/bpf/verifier.c --- linux-aws-6.5-6.5.0/kernel/bpf/verifier.c +++ linux-aws-6.5-6.5.0/kernel/bpf/verifier.c @@ -1513,7 +1513,8 @@ if (state->in_async_callback_fn) verbose(env, " async_cb"); verbose(env, "\n"); - mark_verifier_state_clean(env); + if (!print_all) + mark_verifier_state_clean(env); } static inline u32 vlog_alignment(u32 pos) @@ -3192,12 +3193,29 @@ /* Backtrack one insn at a time. If idx is not at the top of recorded * history then previous instruction came from straight line execution. + * Return -ENOENT if we exhausted all instructions within given state. + * + * It's legal to have a bit of a looping with the same starting and ending + * insn index within the same state, e.g.: 3->4->5->3, so just because current + * instruction index is the same as state's first_idx doesn't mean we are + * done. If there is still some jump history left, we should keep going. We + * need to take into account that we might have a jump history between given + * state's parent and itself, due to checkpointing. In this case, we'll have + * history entry recording a jump from last instruction of parent state and + * first instruction of given state. */ static int get_prev_insn_idx(struct bpf_verifier_state *st, int i, u32 *history) { u32 cnt = *history; + if (i == st->first_insn_idx) { + if (cnt == 0) + return -ENOENT; + if (cnt == 1 && st->jmp_history[0].idx == i) + return -ENOENT; + } + if (cnt && st->jmp_history[cnt - 1].idx == i) { i = st->jmp_history[cnt - 1].prev_idx; (*history)--; @@ -3418,7 +3436,12 @@ if (class == BPF_ALU || class == BPF_ALU64) { if (!bt_is_reg_set(bt, dreg)) return 0; - if (opcode == BPF_MOV) { + if (opcode == BPF_END || opcode == BPF_NEG) { + /* sreg is reserved and unused + * dreg still need precision before this insn + */ + return 0; + } else if (opcode == BPF_MOV) { if (BPF_SRC(insn->code) == BPF_X) { /* dreg = sreg * dreg needs precision after this insn @@ -4072,10 +4095,10 @@ * Nothing to be tracked further in the parent state. */ return 0; - if (i == first_idx) - break; subseq_idx = i; i = get_prev_insn_idx(st, i, &history); + if (i == -ENOENT) + break; if (i >= env->prog->len) { /* This can happen if backtracking reached insn 0 * and there are still reg_mask or stack_mask @@ -4350,7 +4373,7 @@ insn->imm != 0 && env->bpf_capable) { struct bpf_reg_state fake_reg = {}; - __mark_reg_known(&fake_reg, (u32)insn->imm); + __mark_reg_known(&fake_reg, insn->imm); fake_reg.type = SCALAR_VALUE; save_register_state(state, spi, &fake_reg, size); } else if (reg && is_spillable_regtype(reg->type)) { @@ -11029,6 +11052,10 @@ break; } case KF_ARG_PTR_TO_CALLBACK: + if (reg->type != PTR_TO_FUNC) { + verbose(env, "arg%d expected pointer to func\n", i); + return -EINVAL; + } meta->subprogno = reg->subprogno; break; case KF_ARG_PTR_TO_REFCOUNTED_KPTR: @@ -13911,6 +13938,8 @@ !sanitize_speculative_path(env, insn, *insn_idx + 1, *insn_idx)) return -EFAULT; + if (env->log.level & BPF_LOG_LEVEL) + print_insn_state(env, this_branch->frame[this_branch->curframe]); *insn_idx += insn->off; return 0; } else if (pred == 0) { @@ -13923,6 +13952,8 @@ *insn_idx + insn->off + 1, *insn_idx)) return -EFAULT; + if (env->log.level & BPF_LOG_LEVEL) + print_insn_state(env, this_branch->frame[this_branch->curframe]); return 0; } @@ -14554,15 +14585,16 @@ struct bpf_verifier_env *env, bool visit_callee) { - int ret; + int ret, insn_sz; - ret = push_insn(t, t + 1, FALLTHROUGH, env, false); + insn_sz = bpf_is_ldimm64(&insns[t]) ? 2 : 1; + ret = push_insn(t, t + insn_sz, FALLTHROUGH, env, false); if (ret) return ret; - mark_prune_point(env, t + 1); + mark_prune_point(env, t + insn_sz); /* when we exit from subprog, we need to record non-linear history */ - mark_jmp_point(env, t + 1); + mark_jmp_point(env, t + insn_sz); if (visit_callee) { mark_prune_point(env, t); @@ -14584,15 +14616,17 @@ static int visit_insn(int t, struct bpf_verifier_env *env) { struct bpf_insn *insns = env->prog->insnsi, *insn = &insns[t]; - int ret; + int ret, insn_sz; if (bpf_pseudo_func(insn)) return visit_func_call_insn(t, insns, env, true); /* All non-branch instructions have a single fall-through edge. */ if (BPF_CLASS(insn->code) != BPF_JMP && - BPF_CLASS(insn->code) != BPF_JMP32) - return push_insn(t, t + 1, FALLTHROUGH, env, false); + BPF_CLASS(insn->code) != BPF_JMP32) { + insn_sz = bpf_is_ldimm64(insn) ? 2 : 1; + return push_insn(t, t + insn_sz, FALLTHROUGH, env, false); + } switch (BPF_OP(insn->code)) { case BPF_EXIT: @@ -14706,11 +14740,21 @@ } for (i = 0; i < insn_cnt; i++) { + struct bpf_insn *insn = &env->prog->insnsi[i]; + if (insn_state[i] != EXPLORED) { verbose(env, "unreachable insn %d\n", i); ret = -EINVAL; goto err_free; } + if (bpf_is_ldimm64(insn)) { + if (insn_state[i + 1] != 0) { + verbose(env, "jump into the middle of ldimm64 insn %d\n", i); + ret = -EINVAL; + goto err_free; + } + i++; /* skip second half of ldimm64 */ + } } ret = 0; /* cfg looks good */ @@ -19384,6 +19428,9 @@ if (!tr) return -ENOMEM; + if (tgt_prog && tgt_prog->aux->tail_call_reachable) + tr->flags = BPF_TRAMP_F_TAIL_CALL_CTX; + prog->aux->dst_trampoline = tr; return 0; } diff -u linux-aws-6.5-6.5.0/kernel/cpu.c linux-aws-6.5-6.5.0/kernel/cpu.c --- linux-aws-6.5-6.5.0/kernel/cpu.c +++ linux-aws-6.5-6.5.0/kernel/cpu.c @@ -625,9 +625,31 @@ } early_param("nosmt", smt_cmdline_disable); -static inline bool cpu_smt_allowed(unsigned int cpu) +/* + * For Archicture supporting partial SMT states check if the thread is allowed. + * Otherwise this has already been checked through cpu_smt_max_threads when + * setting the SMT level. + */ +static inline bool cpu_smt_thread_allowed(unsigned int cpu) +{ +#ifdef CONFIG_SMT_NUM_THREADS_DYNAMIC + return topology_smt_thread_allowed(cpu); +#else + return true; +#endif +} + +static inline bool cpu_bootable(unsigned int cpu) { - if (cpu_smt_control == CPU_SMT_ENABLED) + if (cpu_smt_control == CPU_SMT_ENABLED && cpu_smt_thread_allowed(cpu)) + return true; + + /* All CPUs are bootable if controls are not configured */ + if (cpu_smt_control == CPU_SMT_NOT_IMPLEMENTED) + return true; + + /* All CPUs are bootable if CPU is not SMT capable */ + if (cpu_smt_control == CPU_SMT_NOT_SUPPORTED) return true; if (topology_is_primary_thread(cpu)) @@ -650,22 +672,8 @@ } EXPORT_SYMBOL_GPL(cpu_smt_possible); -static inline bool cpuhp_smt_aware(void) -{ - return topology_smt_supported(); -} - -static inline const struct cpumask *cpuhp_get_primary_thread_mask(void) -{ - return cpu_primary_thread_mask; -} #else -static inline bool cpu_smt_allowed(unsigned int cpu) { return true; } -static inline bool cpuhp_smt_aware(void) { return false; } -static inline const struct cpumask *cpuhp_get_primary_thread_mask(void) -{ - return cpu_present_mask; -} +static inline bool cpu_bootable(unsigned int cpu) { return true; } #endif static inline enum cpuhp_state @@ -768,10 +776,10 @@ * SMT soft disabling on X86 requires to bring the CPU out of the * BIOS 'wait for SIPI' state in order to set the CR4.MCE bit. The * CPU marked itself as booted_once in notify_cpu_starting() so the - * cpu_smt_allowed() check will now return false if this is not the + * cpu_bootable() check will now return false if this is not the * primary sibling. */ - if (!cpu_smt_allowed(cpu)) + if (!cpu_bootable(cpu)) return -ECANCELED; return 0; } @@ -1495,11 +1503,14 @@ /* * Ensure that the control task does not run on the to be offlined * CPU to prevent a deadlock against cfs_b->period_timer. + * Also keep at least one housekeeping cpu onlined to avoid generating + * an empty sched_domain span. */ - cpu = cpumask_any_but(cpu_online_mask, cpu); - if (cpu >= nr_cpu_ids) - return -EBUSY; - return work_on_cpu(cpu, __cpu_down_maps_locked, &work); + for_each_cpu_and(cpu, cpu_online_mask, housekeeping_cpumask(HK_TYPE_DOMAIN)) { + if (cpu != work.cpu) + return work_on_cpu(cpu, __cpu_down_maps_locked, &work); + } + return -EBUSY; } static int cpu_down(unsigned int cpu, enum cpuhp_state target) @@ -1721,7 +1732,7 @@ err = -EBUSY; goto out; } - if (!cpu_smt_allowed(cpu)) { + if (!cpu_bootable(cpu)) { err = -EPERM; goto out; } @@ -1815,6 +1826,16 @@ } early_param("cpuhp.parallel", parallel_bringup_parse_param); +static inline bool cpuhp_smt_aware(void) +{ + return topology_smt_supported(); +} + +static inline const struct cpumask *cpuhp_get_primary_thread_mask(void) +{ + return cpu_primary_thread_mask; +} + /* * On architectures which have enabled parallel bringup this invokes all BP * prepare states for each of the to be onlined APs first. The last state @@ -2068,7 +2089,7 @@ [CPUHP_HRTIMERS_PREPARE] = { .name = "hrtimers:prepare", .startup.single = hrtimers_prepare_cpu, - .teardown.single = hrtimers_dead_cpu, + .teardown.single = NULL, }, [CPUHP_SMPCFD_PREPARE] = { .name = "smpcfd:prepare", @@ -2160,6 +2181,12 @@ .startup.single = NULL, .teardown.single = smpcfd_dying_cpu, }, + [CPUHP_AP_HRTIMERS_DYING] = { + .name = "hrtimers:dying", + .startup.single = NULL, + .teardown.single = hrtimers_cpu_dying, + }, + /* Entry state on starting. Interrupts enabled from here on. Transient * state for synchronsization */ [CPUHP_AP_ONLINE] = { @@ -2648,6 +2675,12 @@ for_each_online_cpu(cpu) { if (topology_is_primary_thread(cpu)) continue; + /* + * Disable can be called with CPU_SMT_ENABLED when changing + * from a higher to lower number of SMT threads per core. + */ + if (ctrlval == CPU_SMT_ENABLED && cpu_smt_thread_allowed(cpu)) + continue; ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE); if (ret) break; @@ -2682,6 +2715,8 @@ /* Skip online CPUs and CPUs on offline nodes */ if (cpu_online(cpu) || !node_online(cpu_to_node(cpu))) continue; + if (!cpu_smt_thread_allowed(cpu)) + continue; ret = _cpu_up(cpu, 0, CPUHP_ONLINE); if (ret) break; diff -u linux-aws-6.5-6.5.0/kernel/events/core.c linux-aws-6.5-6.5.0/kernel/events/core.c --- linux-aws-6.5-6.5.0/kernel/events/core.c +++ linux-aws-6.5-6.5.0/kernel/events/core.c @@ -375,6 +375,7 @@ EVENT_TIME = 0x4, /* see ctx_resched() for details */ EVENT_CPU = 0x8, + EVENT_CGROUP = 0x10, EVENT_ALL = EVENT_FLEXIBLE | EVENT_PINNED, }; @@ -689,20 +690,26 @@ ___p; \ }) -static void perf_ctx_disable(struct perf_event_context *ctx) +static void perf_ctx_disable(struct perf_event_context *ctx, bool cgroup) { struct perf_event_pmu_context *pmu_ctx; - list_for_each_entry(pmu_ctx, &ctx->pmu_ctx_list, pmu_ctx_entry) + list_for_each_entry(pmu_ctx, &ctx->pmu_ctx_list, pmu_ctx_entry) { + if (cgroup && !pmu_ctx->nr_cgroups) + continue; perf_pmu_disable(pmu_ctx->pmu); + } } -static void perf_ctx_enable(struct perf_event_context *ctx) +static void perf_ctx_enable(struct perf_event_context *ctx, bool cgroup) { struct perf_event_pmu_context *pmu_ctx; - list_for_each_entry(pmu_ctx, &ctx->pmu_ctx_list, pmu_ctx_entry) + list_for_each_entry(pmu_ctx, &ctx->pmu_ctx_list, pmu_ctx_entry) { + if (cgroup && !pmu_ctx->nr_cgroups) + continue; perf_pmu_enable(pmu_ctx->pmu); + } } static void ctx_sched_out(struct perf_event_context *ctx, enum event_type_t event_type); @@ -861,9 +868,9 @@ return; perf_ctx_lock(cpuctx, cpuctx->task_ctx); - perf_ctx_disable(&cpuctx->ctx); + perf_ctx_disable(&cpuctx->ctx, true); - ctx_sched_out(&cpuctx->ctx, EVENT_ALL); + ctx_sched_out(&cpuctx->ctx, EVENT_ALL|EVENT_CGROUP); /* * must not be done before ctxswout due * to update_cgrp_time_from_cpuctx() in @@ -875,9 +882,9 @@ * perf_cgroup_set_timestamp() in ctx_sched_in() * to not have to pass task around */ - ctx_sched_in(&cpuctx->ctx, EVENT_ALL); + ctx_sched_in(&cpuctx->ctx, EVENT_ALL|EVENT_CGROUP); - perf_ctx_enable(&cpuctx->ctx); + perf_ctx_enable(&cpuctx->ctx, true); perf_ctx_unlock(cpuctx, cpuctx->task_ctx); } @@ -970,6 +977,8 @@ if (!is_cgroup_event(event)) return; + event->pmu_ctx->nr_cgroups++; + /* * Because cgroup events are always per-cpu events, * @ctx == &cpuctx->ctx. @@ -990,6 +999,8 @@ if (!is_cgroup_event(event)) return; + event->pmu_ctx->nr_cgroups--; + /* * Because cgroup events are always per-cpu events, * @ctx == &cpuctx->ctx. @@ -2709,9 +2720,9 @@ event_type &= EVENT_ALL; - perf_ctx_disable(&cpuctx->ctx); + perf_ctx_disable(&cpuctx->ctx, false); if (task_ctx) { - perf_ctx_disable(task_ctx); + perf_ctx_disable(task_ctx, false); task_ctx_sched_out(task_ctx, event_type); } @@ -2729,9 +2740,9 @@ perf_event_sched_in(cpuctx, task_ctx); - perf_ctx_enable(&cpuctx->ctx); + perf_ctx_enable(&cpuctx->ctx, false); if (task_ctx) - perf_ctx_enable(task_ctx); + perf_ctx_enable(task_ctx, false); } void perf_pmu_resched(struct pmu *pmu) @@ -3276,6 +3287,9 @@ struct perf_cpu_context *cpuctx = this_cpu_ptr(&perf_cpu_context); struct perf_event_pmu_context *pmu_ctx; int is_active = ctx->is_active; + bool cgroup = event_type & EVENT_CGROUP; + + event_type &= ~EVENT_CGROUP; lockdep_assert_held(&ctx->lock); @@ -3322,8 +3336,11 @@ is_active ^= ctx->is_active; /* changed bits */ - list_for_each_entry(pmu_ctx, &ctx->pmu_ctx_list, pmu_ctx_entry) + list_for_each_entry(pmu_ctx, &ctx->pmu_ctx_list, pmu_ctx_entry) { + if (cgroup && !pmu_ctx->nr_cgroups) + continue; __pmu_ctx_sched_out(pmu_ctx, is_active); + } } /* @@ -3514,7 +3531,7 @@ raw_spin_lock_nested(&next_ctx->lock, SINGLE_DEPTH_NESTING); if (context_equiv(ctx, next_ctx)) { - perf_ctx_disable(ctx); + perf_ctx_disable(ctx, false); /* PMIs are disabled; ctx->nr_pending is stable. */ if (local_read(&ctx->nr_pending) || @@ -3534,7 +3551,7 @@ perf_ctx_sched_task_cb(ctx, false); perf_event_swap_task_ctx_data(ctx, next_ctx); - perf_ctx_enable(ctx); + perf_ctx_enable(ctx, false); /* * RCU_INIT_POINTER here is safe because we've not @@ -3558,13 +3575,13 @@ if (do_switch) { raw_spin_lock(&ctx->lock); - perf_ctx_disable(ctx); + perf_ctx_disable(ctx, false); inside_switch: perf_ctx_sched_task_cb(ctx, false); task_ctx_sched_out(ctx, EVENT_ALL); - perf_ctx_enable(ctx); + perf_ctx_enable(ctx, false); raw_spin_unlock(&ctx->lock); } } @@ -3850,47 +3867,32 @@ return 0; } -static void ctx_pinned_sched_in(struct perf_event_context *ctx, struct pmu *pmu) +static void pmu_groups_sched_in(struct perf_event_context *ctx, + struct perf_event_groups *groups, + struct pmu *pmu) { - struct perf_event_pmu_context *pmu_ctx; int can_add_hw = 1; - - if (pmu) { - visit_groups_merge(ctx, &ctx->pinned_groups, - smp_processor_id(), pmu, - merge_sched_in, &can_add_hw); - } else { - list_for_each_entry(pmu_ctx, &ctx->pmu_ctx_list, pmu_ctx_entry) { - can_add_hw = 1; - visit_groups_merge(ctx, &ctx->pinned_groups, - smp_processor_id(), pmu_ctx->pmu, - merge_sched_in, &can_add_hw); - } - } + visit_groups_merge(ctx, groups, smp_processor_id(), pmu, + merge_sched_in, &can_add_hw); } -static void ctx_flexible_sched_in(struct perf_event_context *ctx, struct pmu *pmu) +static void ctx_groups_sched_in(struct perf_event_context *ctx, + struct perf_event_groups *groups, + bool cgroup) { struct perf_event_pmu_context *pmu_ctx; - int can_add_hw = 1; - if (pmu) { - visit_groups_merge(ctx, &ctx->flexible_groups, - smp_processor_id(), pmu, - merge_sched_in, &can_add_hw); - } else { - list_for_each_entry(pmu_ctx, &ctx->pmu_ctx_list, pmu_ctx_entry) { - can_add_hw = 1; - visit_groups_merge(ctx, &ctx->flexible_groups, - smp_processor_id(), pmu_ctx->pmu, - merge_sched_in, &can_add_hw); - } + list_for_each_entry(pmu_ctx, &ctx->pmu_ctx_list, pmu_ctx_entry) { + if (cgroup && !pmu_ctx->nr_cgroups) + continue; + pmu_groups_sched_in(ctx, groups, pmu_ctx->pmu); } } -static void __pmu_ctx_sched_in(struct perf_event_context *ctx, struct pmu *pmu) +static void __pmu_ctx_sched_in(struct perf_event_context *ctx, + struct pmu *pmu) { - ctx_flexible_sched_in(ctx, pmu); + pmu_groups_sched_in(ctx, &ctx->flexible_groups, pmu); } static void @@ -3898,6 +3900,9 @@ { struct perf_cpu_context *cpuctx = this_cpu_ptr(&perf_cpu_context); int is_active = ctx->is_active; + bool cgroup = event_type & EVENT_CGROUP; + + event_type &= ~EVENT_CGROUP; lockdep_assert_held(&ctx->lock); @@ -3930,11 +3935,11 @@ * in order to give them the best chance of going on. */ if (is_active & EVENT_PINNED) - ctx_pinned_sched_in(ctx, NULL); + ctx_groups_sched_in(ctx, &ctx->pinned_groups, cgroup); /* Then walk through the lower prio flexible groups */ if (is_active & EVENT_FLEXIBLE) - ctx_flexible_sched_in(ctx, NULL); + ctx_groups_sched_in(ctx, &ctx->flexible_groups, cgroup); } static void perf_event_context_sched_in(struct task_struct *task) @@ -3949,11 +3954,11 @@ if (cpuctx->task_ctx == ctx) { perf_ctx_lock(cpuctx, ctx); - perf_ctx_disable(ctx); + perf_ctx_disable(ctx, false); perf_ctx_sched_task_cb(ctx, true); - perf_ctx_enable(ctx); + perf_ctx_enable(ctx, false); perf_ctx_unlock(cpuctx, ctx); goto rcu_unlock; } @@ -3966,7 +3971,7 @@ if (!ctx->nr_events) goto unlock; - perf_ctx_disable(ctx); + perf_ctx_disable(ctx, false); /* * We want to keep the following priority order: * cpu pinned (that don't need to move), task pinned, @@ -3976,7 +3981,7 @@ * events, no need to flip the cpuctx's events around. */ if (!RB_EMPTY_ROOT(&ctx->pinned_groups.tree)) { - perf_ctx_disable(&cpuctx->ctx); + perf_ctx_disable(&cpuctx->ctx, false); ctx_sched_out(&cpuctx->ctx, EVENT_FLEXIBLE); } @@ -3985,9 +3990,9 @@ perf_ctx_sched_task_cb(cpuctx->task_ctx, true); if (!RB_EMPTY_ROOT(&ctx->pinned_groups.tree)) - perf_ctx_enable(&cpuctx->ctx); + perf_ctx_enable(&cpuctx->ctx, false); - perf_ctx_enable(ctx); + perf_ctx_enable(ctx, false); unlock: perf_ctx_unlock(cpuctx, ctx); @@ -4841,6 +4846,11 @@ void *task_ctx_data = NULL; if (!ctx->task) { + /* + * perf_pmu_migrate_context() / __perf_pmu_install_event() + * relies on the fact that find_get_pmu_context() cannot fail + * for CPU contexts. + */ struct perf_cpu_pmu_context *cpc; cpc = per_cpu_ptr(pmu->cpu_pmu_context, event->cpu); @@ -12916,6 +12926,9 @@ int cpu, struct perf_event *event) { struct perf_event_pmu_context *epc; + struct perf_event_context *old_ctx = event->ctx; + + get_ctx(ctx); /* normally find_get_context() */ event->cpu = cpu; epc = find_get_pmu_context(pmu, ctx, event); @@ -12924,6 +12937,11 @@ if (event->state >= PERF_EVENT_STATE_OFF) event->state = PERF_EVENT_STATE_INACTIVE; perf_install_in_context(ctx, event, cpu); + + /* + * Now that event->ctx is updated and visible, put the old ctx. + */ + put_ctx(old_ctx); } static void __perf_pmu_install(struct perf_event_context *ctx, @@ -12962,6 +12980,10 @@ struct perf_event_context *src_ctx, *dst_ctx; LIST_HEAD(events); + /* + * Since per-cpu context is persistent, no need to grab an extra + * reference. + */ src_ctx = &per_cpu_ptr(&perf_cpu_context, src_cpu)->ctx; dst_ctx = &per_cpu_ptr(&perf_cpu_context, dst_cpu)->ctx; @@ -13416,7 +13438,8 @@ !perf_get_aux_event(child_ctr, leader)) return -EINVAL; } - leader->group_generation = parent_event->group_generation; + if (leader) + leader->group_generation = parent_event->group_generation; return 0; } diff -u linux-aws-6.5-6.5.0/kernel/fork.c linux-aws-6.5-6.5.0/kernel/fork.c --- linux-aws-6.5-6.5.0/kernel/fork.c +++ linux-aws-6.5-6.5.0/kernel/fork.c @@ -1298,7 +1298,7 @@ hugetlb_count_init(mm); if (current->mm) { - mm->flags = current->mm->flags & MMF_INIT_MASK; + mm->flags = mmf_init_flags(current->mm->flags); mm->def_flags = current->mm->def_flags & VM_INIT_DEF_MASK; } else { mm->flags = default_dump_filter; diff -u linux-aws-6.5-6.5.0/kernel/locking/lockdep.c linux-aws-6.5-6.5.0/kernel/locking/lockdep.c --- linux-aws-6.5-6.5.0/kernel/locking/lockdep.c +++ linux-aws-6.5-6.5.0/kernel/locking/lockdep.c @@ -3497,7 +3497,8 @@ size = chain_block_size(curr); if (likely(size >= req)) { del_chain_block(0, size, chain_block_next(curr)); - add_chain_block(curr + req, size - req); + if (size > req) + add_chain_block(curr + req, size - req); return curr; } } diff -u linux-aws-6.5-6.5.0/kernel/module/decompress.c linux-aws-6.5-6.5.0/kernel/module/decompress.c --- linux-aws-6.5-6.5.0/kernel/module/decompress.c +++ linux-aws-6.5-6.5.0/kernel/module/decompress.c @@ -100,7 +100,7 @@ s.next_in = buf + gzip_hdr_len; s.avail_in = size - gzip_hdr_len; - s.workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); + s.workspace = kvmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); if (!s.workspace) return -ENOMEM; @@ -138,7 +138,7 @@ out_inflate_end: zlib_inflateEnd(&s); out: - kfree(s.workspace); + kvfree(s.workspace); return retval; } #elif defined(CONFIG_MODULE_COMPRESS_XZ) @@ -241,7 +241,7 @@ } wksp_size = zstd_dstream_workspace_bound(header.windowSize); - wksp = vmalloc(wksp_size); + wksp = kvmalloc(wksp_size, GFP_KERNEL); if (!wksp) { retval = -ENOMEM; goto out; @@ -284,7 +284,7 @@ retval = new_size; out: - vfree(wksp); + kvfree(wksp); return retval; } #else diff -u linux-aws-6.5-6.5.0/kernel/sched/core.c linux-aws-6.5-6.5.0/kernel/sched/core.c --- linux-aws-6.5-6.5.0/kernel/sched/core.c +++ linux-aws-6.5-6.5.0/kernel/sched/core.c @@ -2644,9 +2644,11 @@ * it. */ WARN_ON_ONCE(!pending->stop_pending); + preempt_disable(); task_rq_unlock(rq, p, &rf); stop_one_cpu_nowait(task_cpu(p), migration_cpu_stop, &pending->arg, &pending->stop_work); + preempt_enable(); return 0; } out: @@ -2966,12 +2968,13 @@ complete = true; } + preempt_disable(); task_rq_unlock(rq, p, rf); - if (push_task) { stop_one_cpu_nowait(rq->cpu, push_cpu_stop, p, &rq->push_work); } + preempt_enable(); if (complete) complete_all(&pending->done); @@ -3037,12 +3040,13 @@ if (flags & SCA_MIGRATE_ENABLE) p->migration_flags &= ~MDF_PUSH; + preempt_disable(); task_rq_unlock(rq, p, rf); - if (!stop_pending) { stop_one_cpu_nowait(cpu_of(rq), migration_cpu_stop, &pending->arg, &pending->stop_work); } + preempt_enable(); if (flags & SCA_MIGRATE_ENABLE) return 0; @@ -5373,8 +5377,6 @@ /* switch_mm_cid() requires the memory barriers above. */ switch_mm_cid(rq, prev, next); - rq->clock_update_flags &= ~(RQCF_ACT_SKIP|RQCF_REQ_SKIP); - prepare_lock_switch(rq, next, rf); /* Here we just switch the register state and the stack. */ @@ -6630,6 +6632,7 @@ /* Promote REQ to ACT */ rq->clock_update_flags <<= 1; update_rq_clock(rq); + rq->clock_update_flags = RQCF_UPDATED; switch_count = &prev->nivcsw; @@ -6709,8 +6712,6 @@ /* Also unlocks the rq: */ rq = context_switch(rq, prev, next, &rf); } else { - rq->clock_update_flags &= ~(RQCF_ACT_SKIP|RQCF_REQ_SKIP); - rq_unpin_lock(rq, &rf); __balance_callbacks(rq); raw_spin_rq_unlock_irq(rq); @@ -9508,9 +9509,11 @@ * Temporarily drop rq->lock such that we can wake-up the stop task. * Both preemption and IRQs are still disabled. */ + preempt_disable(); raw_spin_rq_unlock(rq); stop_one_cpu_nowait(rq->cpu, __balance_push_cpu_stop, push_task, this_cpu_ptr(&push_work)); + preempt_enable(); /* * At this point need_resched() is true and we'll take the loop in * schedule(). The next pick is obviously going to be the stop task diff -u linux-aws-6.5-6.5.0/kernel/sched/fair.c linux-aws-6.5-6.5.0/kernel/sched/fair.c --- linux-aws-6.5-6.5.0/kernel/sched/fair.c +++ linux-aws-6.5-6.5.0/kernel/sched/fair.c @@ -4348,22 +4348,6 @@ return max(task_util(p), _task_util_est(p)); } -#ifdef CONFIG_UCLAMP_TASK -static inline unsigned long uclamp_task_util(struct task_struct *p, - unsigned long uclamp_min, - unsigned long uclamp_max) -{ - return clamp(task_util_est(p), uclamp_min, uclamp_max); -} -#else -static inline unsigned long uclamp_task_util(struct task_struct *p, - unsigned long uclamp_min, - unsigned long uclamp_max) -{ - return task_util_est(p); -} -#endif - static inline void util_est_enqueue(struct cfs_rq *cfs_rq, struct task_struct *p) { @@ -4654,7 +4638,7 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) { - return true; + return !cfs_rq->nr_running; } #define UPDATE_TG 0x0 @@ -7554,7 +7538,7 @@ target = prev_cpu; sync_entity_load_avg(&p->se); - if (!uclamp_task_util(p, p_util_min, p_util_max)) + if (!task_util_est(p) && p_util_min == 0) goto unlock; eenv_task_busy_time(&eenv, p, prev_cpu); @@ -7562,11 +7546,10 @@ for (; pd; pd = pd->next) { unsigned long util_min = p_util_min, util_max = p_util_max; unsigned long cpu_cap, cpu_thermal_cap, util; - unsigned long cur_delta, max_spare_cap = 0; + long prev_spare_cap = -1, max_spare_cap = -1; unsigned long rq_util_min, rq_util_max; - unsigned long prev_spare_cap = 0; + unsigned long cur_delta, base_energy; int max_spare_cap_cpu = -1; - unsigned long base_energy; int fits, max_fits = -1; cpumask_and(cpus, perf_domain_span(pd), cpu_online_mask); @@ -7629,7 +7612,7 @@ prev_spare_cap = cpu_cap; prev_fits = fits; } else if ((fits > max_fits) || - ((fits == max_fits) && (cpu_cap > max_spare_cap))) { + ((fits == max_fits) && ((long)cpu_cap > max_spare_cap))) { /* * Find the CPU with the maximum spare capacity * among the remaining CPUs in the performance @@ -7641,7 +7624,7 @@ } } - if (max_spare_cap_cpu < 0 && prev_spare_cap == 0) + if (max_spare_cap_cpu < 0 && prev_spare_cap < 0) continue; eenv_pd_busy_time(&eenv, cpus, p); @@ -7649,7 +7632,7 @@ base_energy = compute_energy(&eenv, pd, cpus, p, -1); /* Evaluate the energy impact of using prev_cpu. */ - if (prev_spare_cap > 0) { + if (prev_spare_cap > -1) { prev_delta = compute_energy(&eenv, pd, cpus, p, prev_cpu); /* CPU utilization has changed */ @@ -11003,13 +10986,15 @@ busiest->push_cpu = this_cpu; active_balance = 1; } - raw_spin_rq_unlock_irqrestore(busiest, flags); + preempt_disable(); + raw_spin_rq_unlock_irqrestore(busiest, flags); if (active_balance) { stop_one_cpu_nowait(cpu_of(busiest), active_load_balance_cpu_stop, busiest, &busiest->active_balance_work); } + preempt_enable(); } } else { sd->nr_balance_failed = 0; diff -u linux-aws-6.5-6.5.0/kernel/sched/rt.c linux-aws-6.5-6.5.0/kernel/sched/rt.c --- linux-aws-6.5-6.5.0/kernel/sched/rt.c +++ linux-aws-6.5-6.5.0/kernel/sched/rt.c @@ -2109,9 +2109,11 @@ */ push_task = get_push_task(rq); if (push_task) { + preempt_disable(); raw_spin_rq_unlock(rq); stop_one_cpu_nowait(rq->cpu, push_cpu_stop, push_task, &rq->push_work); + preempt_enable(); raw_spin_rq_lock(rq); } @@ -2448,9 +2450,11 @@ double_unlock_balance(this_rq, src_rq); if (push_task) { + preempt_disable(); raw_spin_rq_unlock(this_rq); stop_one_cpu_nowait(src_rq->cpu, push_cpu_stop, push_task, &src_rq->push_work); + preempt_enable(); raw_spin_rq_lock(this_rq); } } diff -u linux-aws-6.5-6.5.0/kernel/sys.c linux-aws-6.5-6.5.0/kernel/sys.c --- linux-aws-6.5-6.5.0/kernel/sys.c +++ linux-aws-6.5-6.5.0/kernel/sys.c @@ -2383,19 +2383,45 @@ } #endif /* CONFIG_ANON_VMA_NAME */ +static inline unsigned long get_current_mdwe(void) +{ + unsigned long ret = 0; + + if (test_bit(MMF_HAS_MDWE, ¤t->mm->flags)) + ret |= PR_MDWE_REFUSE_EXEC_GAIN; + if (test_bit(MMF_HAS_MDWE_NO_INHERIT, ¤t->mm->flags)) + ret |= PR_MDWE_NO_INHERIT; + + return ret; +} + static inline int prctl_set_mdwe(unsigned long bits, unsigned long arg3, unsigned long arg4, unsigned long arg5) { + unsigned long current_bits; + if (arg3 || arg4 || arg5) return -EINVAL; - if (bits & ~(PR_MDWE_REFUSE_EXEC_GAIN)) + if (bits & ~(PR_MDWE_REFUSE_EXEC_GAIN | PR_MDWE_NO_INHERIT)) return -EINVAL; + /* NO_INHERIT only makes sense with REFUSE_EXEC_GAIN */ + if (bits & PR_MDWE_NO_INHERIT && !(bits & PR_MDWE_REFUSE_EXEC_GAIN)) + return -EINVAL; + + /* PARISC cannot allow mdwe as it needs writable stacks */ + if (IS_ENABLED(CONFIG_PARISC)) + return -EINVAL; + + current_bits = get_current_mdwe(); + if (current_bits && current_bits != bits) + return -EPERM; /* Cannot unset the flags */ + + if (bits & PR_MDWE_NO_INHERIT) + set_bit(MMF_HAS_MDWE_NO_INHERIT, ¤t->mm->flags); if (bits & PR_MDWE_REFUSE_EXEC_GAIN) set_bit(MMF_HAS_MDWE, ¤t->mm->flags); - else if (test_bit(MMF_HAS_MDWE, ¤t->mm->flags)) - return -EPERM; /* Cannot unset the flag */ return 0; } @@ -2405,9 +2431,7 @@ { if (arg2 || arg3 || arg4 || arg5) return -EINVAL; - - return test_bit(MMF_HAS_MDWE, ¤t->mm->flags) ? - PR_MDWE_REFUSE_EXEC_GAIN : 0; + return get_current_mdwe(); } static int prctl_get_auxv(void __user *addr, unsigned long len) diff -u linux-aws-6.5-6.5.0/kernel/trace/ring_buffer.c linux-aws-6.5-6.5.0/kernel/trace/ring_buffer.c --- linux-aws-6.5-6.5.0/kernel/trace/ring_buffer.c +++ linux-aws-6.5-6.5.0/kernel/trace/ring_buffer.c @@ -644,8 +644,8 @@ *cnt = rb_time_cnt(top); - /* If top and bottom counts don't match, this interrupted a write */ - if (*cnt != rb_time_cnt(bottom)) + /* If top and msb counts don't match, this interrupted a write */ + if (*cnt != rb_time_cnt(msb)) return false; /* The shift to msb will lose its cnt bits */ @@ -3039,23 +3039,20 @@ local_read(&bpage->write) & ~RB_WRITE_MASK; unsigned long event_length = rb_event_length(event); + /* + * For the before_stamp to be different than the write_stamp + * to make sure that the next event adds an absolute + * value and does not rely on the saved write stamp, which + * is now going to be bogus. + */ + rb_time_set(&cpu_buffer->before_stamp, 0); + /* Something came in, can't discard */ if (!rb_time_cmpxchg(&cpu_buffer->write_stamp, write_stamp, write_stamp - delta)) return false; /* - * It's possible that the event time delta is zero - * (has the same time stamp as the previous event) - * in which case write_stamp and before_stamp could - * be the same. In such a case, force before_stamp - * to be different than write_stamp. It doesn't - * matter what it is, as long as its different. - */ - if (!delta) - rb_time_set(&cpu_buffer->before_stamp, 0); - - /* * If an event were to come in now, it would see that the * write_stamp and the before_stamp are different, and assume * that this event just added itself before updating diff -u linux-aws-6.5-6.5.0/kernel/trace/trace.c linux-aws-6.5-6.5.0/kernel/trace/trace.c --- linux-aws-6.5-6.5.0/kernel/trace/trace.c +++ linux-aws-6.5-6.5.0/kernel/trace/trace.c @@ -2359,13 +2359,7 @@ return global_trace.stop_count; } -/** - * tracing_start - quick start of the tracer - * - * If tracing is enabled but was stopped by tracing_stop, - * this will start the tracer back up. - */ -void tracing_start(void) +static void tracing_start_tr(struct trace_array *tr) { struct trace_buffer *buffer; unsigned long flags; @@ -2373,119 +2367,83 @@ if (tracing_disabled) return; - raw_spin_lock_irqsave(&global_trace.start_lock, flags); - if (--global_trace.stop_count) { - if (global_trace.stop_count < 0) { + raw_spin_lock_irqsave(&tr->start_lock, flags); + if (--tr->stop_count) { + if (WARN_ON_ONCE(tr->stop_count < 0)) { /* Someone screwed up their debugging */ - WARN_ON_ONCE(1); - global_trace.stop_count = 0; + tr->stop_count = 0; } goto out; } /* Prevent the buffers from switching */ - arch_spin_lock(&global_trace.max_lock); + arch_spin_lock(&tr->max_lock); - buffer = global_trace.array_buffer.buffer; + buffer = tr->array_buffer.buffer; if (buffer) ring_buffer_record_enable(buffer); #ifdef CONFIG_TRACER_MAX_TRACE - buffer = global_trace.max_buffer.buffer; + buffer = tr->max_buffer.buffer; if (buffer) ring_buffer_record_enable(buffer); #endif - arch_spin_unlock(&global_trace.max_lock); - - out: - raw_spin_unlock_irqrestore(&global_trace.start_lock, flags); -} - -static void tracing_start_tr(struct trace_array *tr) -{ - struct trace_buffer *buffer; - unsigned long flags; - - if (tracing_disabled) - return; - - /* If global, we need to also start the max tracer */ - if (tr->flags & TRACE_ARRAY_FL_GLOBAL) - return tracing_start(); - - raw_spin_lock_irqsave(&tr->start_lock, flags); - - if (--tr->stop_count) { - if (tr->stop_count < 0) { - /* Someone screwed up their debugging */ - WARN_ON_ONCE(1); - tr->stop_count = 0; - } - goto out; - } - - buffer = tr->array_buffer.buffer; - if (buffer) - ring_buffer_record_enable(buffer); + arch_spin_unlock(&tr->max_lock); out: raw_spin_unlock_irqrestore(&tr->start_lock, flags); } /** - * tracing_stop - quick stop of the tracer + * tracing_start - quick start of the tracer * - * Light weight way to stop tracing. Use in conjunction with - * tracing_start. + * If tracing is enabled but was stopped by tracing_stop, + * this will start the tracer back up. */ -void tracing_stop(void) +void tracing_start(void) + +{ + return tracing_start_tr(&global_trace); +} + +static void tracing_stop_tr(struct trace_array *tr) { struct trace_buffer *buffer; unsigned long flags; - raw_spin_lock_irqsave(&global_trace.start_lock, flags); - if (global_trace.stop_count++) + raw_spin_lock_irqsave(&tr->start_lock, flags); + if (tr->stop_count++) goto out; /* Prevent the buffers from switching */ - arch_spin_lock(&global_trace.max_lock); + arch_spin_lock(&tr->max_lock); - buffer = global_trace.array_buffer.buffer; + buffer = tr->array_buffer.buffer; if (buffer) ring_buffer_record_disable(buffer); #ifdef CONFIG_TRACER_MAX_TRACE - buffer = global_trace.max_buffer.buffer; + buffer = tr->max_buffer.buffer; if (buffer) ring_buffer_record_disable(buffer); #endif - arch_spin_unlock(&global_trace.max_lock); + arch_spin_unlock(&tr->max_lock); out: - raw_spin_unlock_irqrestore(&global_trace.start_lock, flags); + raw_spin_unlock_irqrestore(&tr->start_lock, flags); } -static void tracing_stop_tr(struct trace_array *tr) +/** + * tracing_stop - quick stop of the tracer + * + * Light weight way to stop tracing. Use in conjunction with + * tracing_start. + */ +void tracing_stop(void) { - struct trace_buffer *buffer; - unsigned long flags; - - /* If global, we need to also stop the max tracer */ - if (tr->flags & TRACE_ARRAY_FL_GLOBAL) - return tracing_stop(); - - raw_spin_lock_irqsave(&tr->start_lock, flags); - if (tr->stop_count++) - goto out; - - buffer = tr->array_buffer.buffer; - if (buffer) - ring_buffer_record_disable(buffer); - - out: - raw_spin_unlock_irqrestore(&tr->start_lock, flags); + return tracing_stop_tr(&global_trace); } static int trace_save_cmdline(struct task_struct *tsk) @@ -2769,8 +2727,11 @@ for_each_tracing_cpu(cpu) { page = alloc_pages_node(cpu_to_node(cpu), GFP_KERNEL | __GFP_NORETRY, 0); - if (!page) - goto failed; + /* This is just an optimization and can handle failures */ + if (!page) { + pr_err("Failed to allocate event buffer\n"); + break; + } event = page_address(page); memset(event, 0, sizeof(*event)); @@ -2784,10 +2745,6 @@ WARN_ON_ONCE(1); preempt_enable(); } - - return; - failed: - trace_buffered_event_disable(); } static void enable_trace_buffered_event(void *data) @@ -2822,11 +2779,9 @@ if (--trace_buffered_event_ref) return; - preempt_disable(); /* For each CPU, set the buffer as used. */ - smp_call_function_many(tracing_buffer_mask, - disable_trace_buffered_event, NULL, 1); - preempt_enable(); + on_each_cpu_mask(tracing_buffer_mask, disable_trace_buffered_event, + NULL, true); /* Wait for all current users to finish */ synchronize_rcu(); @@ -2835,17 +2790,19 @@ free_page((unsigned long)per_cpu(trace_buffered_event, cpu)); per_cpu(trace_buffered_event, cpu) = NULL; } + /* - * Make sure trace_buffered_event is NULL before clearing - * trace_buffered_event_cnt. + * Wait for all CPUs that potentially started checking if they can use + * their event buffer only after the previous synchronize_rcu() call and + * they still read a valid pointer from trace_buffered_event. It must be + * ensured they don't see cleared trace_buffered_event_cnt else they + * could wrongly decide to use the pointed-to buffer which is now freed. */ - smp_wmb(); + synchronize_rcu(); - preempt_disable(); - /* Do the work on each cpu */ - smp_call_function_many(tracing_buffer_mask, - enable_trace_buffered_event, NULL, 1); - preempt_enable(); + /* For each CPU, relinquish the buffer */ + on_each_cpu_mask(tracing_buffer_mask, enable_trace_buffered_event, NULL, + true); } static struct trace_buffer *temp_buffer; @@ -5000,6 +4957,20 @@ if (ret) return ret; + mutex_lock(&event_mutex); + + /* Fail if the file is marked for removal */ + if (file->flags & EVENT_FILE_FL_FREED) { + trace_array_put(file->tr); + ret = -ENODEV; + } else { + event_file_get(file); + } + + mutex_unlock(&event_mutex); + if (ret) + return ret; + filp->private_data = inode->i_private; return 0; @@ -5010,6 +4981,7 @@ struct trace_event_file *file = inode->i_private; trace_array_put(file->tr); + event_file_put(file); return 0; } @@ -6345,6 +6317,15 @@ per_cpu_ptr(buf->data, cpu)->entries = val; } +static void update_buffer_entries(struct array_buffer *buf, int cpu) +{ + if (cpu == RING_BUFFER_ALL_CPUS) { + set_buffer_entries(buf, ring_buffer_size(buf->buffer, 0)); + } else { + per_cpu_ptr(buf->data, cpu)->entries = ring_buffer_size(buf->buffer, cpu); + } +} + #ifdef CONFIG_TRACER_MAX_TRACE /* resize @tr's buffer to the size of @size_tr's entries */ static int resize_buffer_duplicate_size(struct array_buffer *trace_buf, @@ -6389,13 +6370,15 @@ if (!tr->array_buffer.buffer) return 0; + /* Do not allow tracing while resizng ring buffer */ + tracing_stop_tr(tr); + ret = ring_buffer_resize(tr->array_buffer.buffer, size, cpu); if (ret < 0) - return ret; + goto out_start; #ifdef CONFIG_TRACER_MAX_TRACE - if (!(tr->flags & TRACE_ARRAY_FL_GLOBAL) || - !tr->current_trace->use_max_tr) + if (!tr->current_trace->use_max_tr) goto out; ret = ring_buffer_resize(tr->max_buffer.buffer, size, cpu); @@ -6420,22 +6403,17 @@ WARN_ON(1); tracing_disabled = 1; } - return ret; + goto out_start; } - if (cpu == RING_BUFFER_ALL_CPUS) - set_buffer_entries(&tr->max_buffer, size); - else - per_cpu_ptr(tr->max_buffer.data, cpu)->entries = size; + update_buffer_entries(&tr->max_buffer, cpu); out: #endif /* CONFIG_TRACER_MAX_TRACE */ - if (cpu == RING_BUFFER_ALL_CPUS) - set_buffer_entries(&tr->array_buffer, size); - else - per_cpu_ptr(tr->array_buffer.data, cpu)->entries = size; - + update_buffer_entries(&tr->array_buffer, cpu); + out_start: + tracing_start_tr(tr); return ret; } diff -u linux-aws-6.5-6.5.0/kernel/trace/trace.h linux-aws-6.5-6.5.0/kernel/trace/trace.h --- linux-aws-6.5-6.5.0/kernel/trace/trace.h +++ linux-aws-6.5-6.5.0/kernel/trace/trace.h @@ -1656,6 +1656,9 @@ char *glob, struct event_trigger_data *trigger_data); +extern void event_file_get(struct trace_event_file *file); +extern void event_file_put(struct trace_event_file *file); + /** * struct event_trigger_ops - callbacks for trace event triggers * diff -u linux-aws-6.5-6.5.0/kernel/trace/trace_events.c linux-aws-6.5-6.5.0/kernel/trace/trace_events.c --- linux-aws-6.5-6.5.0/kernel/trace/trace_events.c +++ linux-aws-6.5-6.5.0/kernel/trace/trace_events.c @@ -990,26 +990,38 @@ } } -static void remove_event_file_dir(struct trace_event_file *file) +void event_file_get(struct trace_event_file *file) { - struct dentry *dir = file->dir; - struct dentry *child; + atomic_inc(&file->ref); +} - if (dir) { - spin_lock(&dir->d_lock); /* probably unneeded */ - list_for_each_entry(child, &dir->d_subdirs, d_child) { - if (d_really_is_positive(child)) /* probably unneeded */ - d_inode(child)->i_private = NULL; - } - spin_unlock(&dir->d_lock); +void event_file_put(struct trace_event_file *file) +{ + if (WARN_ON_ONCE(!atomic_read(&file->ref))) { + if (file->flags & EVENT_FILE_FL_FREED) + kmem_cache_free(file_cachep, file); + return; + } - tracefs_remove(dir); + if (atomic_dec_and_test(&file->ref)) { + /* Count should only go to zero when it is freed */ + if (WARN_ON_ONCE(!(file->flags & EVENT_FILE_FL_FREED))) + return; + kmem_cache_free(file_cachep, file); } +} + +static void remove_event_file_dir(struct trace_event_file *file) +{ + struct dentry *dir = file->dir; + + tracefs_remove(dir); list_del(&file->list); remove_subsystem(file->system); free_event_filter(file->filter); - kmem_cache_free(file_cachep, file); + file->flags |= EVENT_FILE_FL_FREED; + event_file_put(file); } /* @@ -1382,7 +1394,7 @@ flags = file->flags; mutex_unlock(&event_mutex); - if (!file) + if (!file || flags & EVENT_FILE_FL_FREED) return -ENODEV; if (flags & EVENT_FILE_FL_ENABLED && @@ -1420,7 +1432,7 @@ ret = -ENODEV; mutex_lock(&event_mutex); file = event_file_data(filp); - if (likely(file)) + if (likely(file && !(file->flags & EVENT_FILE_FL_FREED))) ret = ftrace_event_enable_disable(file, val); mutex_unlock(&event_mutex); break; @@ -1694,7 +1706,7 @@ mutex_lock(&event_mutex); file = event_file_data(filp); - if (file) + if (file && !(file->flags & EVENT_FILE_FL_FREED)) print_event_filter(file, s); mutex_unlock(&event_mutex); @@ -2777,6 +2789,7 @@ update_event_fields(call, map[i]); } } + cond_resched(); } up_write(&trace_event_sem); } @@ -2809,6 +2822,7 @@ atomic_set(&file->tm_ref, 0); INIT_LIST_HEAD(&file->triggers); list_add(&file->list, &tr->events); + event_file_get(file); return file; } diff -u linux-aws-6.5-6.5.0/kernel/trace/trace_events_synth.c linux-aws-6.5-6.5.0/kernel/trace/trace_events_synth.c --- linux-aws-6.5-6.5.0/kernel/trace/trace_events_synth.c +++ linux-aws-6.5-6.5.0/kernel/trace/trace_events_synth.c @@ -452,7 +452,7 @@ #ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE if ((unsigned long)str_val < TASK_SIZE) - ret = strncpy_from_user_nofault(str_field, str_val, STR_VAR_LEN_MAX); + ret = strncpy_from_user_nofault(str_field, (const void __user *)str_val, STR_VAR_LEN_MAX); else #endif ret = strncpy_from_kernel_nofault(str_field, str_val, STR_VAR_LEN_MAX); diff -u linux-aws-6.5-6.5.0/kernel/watchdog.c linux-aws-6.5-6.5.0/kernel/watchdog.c --- linux-aws-6.5-6.5.0/kernel/watchdog.c +++ linux-aws-6.5-6.5.0/kernel/watchdog.c @@ -283,6 +283,13 @@ static DEFINE_PER_CPU(bool, softlockup_touch_sync); static unsigned long soft_lockup_nmi_warn; +static int __init softlockup_panic_setup(char *str) +{ + softlockup_panic = simple_strtoul(str, NULL, 0); + return 1; +} +__setup("softlockup_panic=", softlockup_panic_setup); + static int __init nowatchdog_setup(char *str) { watchdog_user_enabled = 0; diff -u linux-aws-6.5-6.5.0/kernel/workqueue.c linux-aws-6.5-6.5.0/kernel/workqueue.c --- linux-aws-6.5-6.5.0/kernel/workqueue.c +++ linux-aws-6.5-6.5.0/kernel/workqueue.c @@ -1596,9 +1596,6 @@ pr_warn_once("workqueue: round-robin CPU selection forced, expect performance impact\n"); } - if (cpumask_empty(wq_unbound_cpumask)) - return cpu; - new_cpu = __this_cpu_read(wq_rr_cpu_last); new_cpu = cpumask_next_and(new_cpu, wq_unbound_cpumask, cpu_online_mask); if (unlikely(new_cpu >= nr_cpu_ids)) { @@ -5571,50 +5568,54 @@ } /** - * work_on_cpu - run a function in thread context on a particular cpu + * work_on_cpu_key - run a function in thread context on a particular cpu * @cpu: the cpu to run on * @fn: the function to run * @arg: the function arg + * @key: The lock class key for lock debugging purposes * * It is up to the caller to ensure that the cpu doesn't go offline. * The caller must not hold any locks which would prevent @fn from completing. * * Return: The value @fn returns. */ -long work_on_cpu(int cpu, long (*fn)(void *), void *arg) +long work_on_cpu_key(int cpu, long (*fn)(void *), + void *arg, struct lock_class_key *key) { struct work_for_cpu wfc = { .fn = fn, .arg = arg }; - INIT_WORK_ONSTACK(&wfc.work, work_for_cpu_fn); + INIT_WORK_ONSTACK_KEY(&wfc.work, work_for_cpu_fn, key); schedule_work_on(cpu, &wfc.work); flush_work(&wfc.work); destroy_work_on_stack(&wfc.work); return wfc.ret; } -EXPORT_SYMBOL_GPL(work_on_cpu); +EXPORT_SYMBOL_GPL(work_on_cpu_key); /** - * work_on_cpu_safe - run a function in thread context on a particular cpu + * work_on_cpu_safe_key - run a function in thread context on a particular cpu * @cpu: the cpu to run on * @fn: the function to run * @arg: the function argument + * @key: The lock class key for lock debugging purposes * * Disables CPU hotplug and calls work_on_cpu(). The caller must not hold * any locks which would prevent @fn from completing. * * Return: The value @fn returns. */ -long work_on_cpu_safe(int cpu, long (*fn)(void *), void *arg) +long work_on_cpu_safe_key(int cpu, long (*fn)(void *), + void *arg, struct lock_class_key *key) { long ret = -ENODEV; cpus_read_lock(); if (cpu_online(cpu)) - ret = work_on_cpu(cpu, fn, arg); + ret = work_on_cpu_key(cpu, fn, arg, key); cpus_read_unlock(); return ret; } -EXPORT_SYMBOL_GPL(work_on_cpu_safe); +EXPORT_SYMBOL_GPL(work_on_cpu_safe_key); #endif /* CONFIG_SMP */ #ifdef CONFIG_FREEZER @@ -6397,6 +6398,17 @@ #endif /* CONFIG_WQ_WATCHDOG */ +static void __init restrict_unbound_cpumask(const char *name, const struct cpumask *mask) +{ + if (!cpumask_intersects(wq_unbound_cpumask, mask)) { + pr_warn("workqueue: Restricting unbound_cpumask (%*pb) with %s (%*pb) leaves no CPU, ignoring\n", + cpumask_pr_args(wq_unbound_cpumask), name, cpumask_pr_args(mask)); + return; + } + + cpumask_and(wq_unbound_cpumask, wq_unbound_cpumask, mask); +} + static void __init wq_numa_init(void) { cpumask_var_t *tbl; @@ -6459,8 +6471,9 @@ BUILD_BUG_ON(__alignof__(struct pool_workqueue) < __alignof__(long long)); BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL)); - cpumask_copy(wq_unbound_cpumask, housekeeping_cpumask(HK_TYPE_WQ)); - cpumask_and(wq_unbound_cpumask, wq_unbound_cpumask, housekeeping_cpumask(HK_TYPE_DOMAIN)); + cpumask_copy(wq_unbound_cpumask, cpu_possible_mask); + restrict_unbound_cpumask("HK_TYPE_WQ", housekeeping_cpumask(HK_TYPE_WQ)); + restrict_unbound_cpumask("HK_TYPE_DOMAIN", housekeeping_cpumask(HK_TYPE_DOMAIN)); pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); diff -u linux-aws-6.5-6.5.0/lib/maple_tree.c linux-aws-6.5-6.5.0/lib/maple_tree.c --- linux-aws-6.5-6.5.0/lib/maple_tree.c +++ linux-aws-6.5-6.5.0/lib/maple_tree.c @@ -5729,7 +5729,7 @@ /* Internal nodes */ nr_nodes += DIV_ROUND_UP(nr_nodes, nonleaf_cap); /* Add working room for split (2 nodes) + new parents */ - mas_node_count(mas, nr_nodes + 3); + mas_node_count_gfp(mas, nr_nodes + 3, GFP_KERNEL); /* Detect if allocations run out */ mas->mas_flags |= MA_STATE_PREALLOC; diff -u linux-aws-6.5-6.5.0/lib/test_maple_tree.c linux-aws-6.5-6.5.0/lib/test_maple_tree.c --- linux-aws-6.5-6.5.0/lib/test_maple_tree.c +++ linux-aws-6.5-6.5.0/lib/test_maple_tree.c @@ -9,6 +9,7 @@ #include #include +#include #define MTREE_ALLOC_MAX 0x2000000000000Ul #define CONFIG_MAPLE_SEARCH @@ -1714,17 +1715,21 @@ void *val; MA_STATE(mas, mt, 0, 0); MA_STATE(newmas, mt, 0, 0); + struct rw_semaphore newmt_lock; + + init_rwsem(&newmt_lock); for (i = 0; i <= nr_entries; i++) mtree_store_range(mt, i*10, i*10 + 5, xa_mk_value(i), GFP_KERNEL); mt_set_non_kernel(99999); - mt_init_flags(&newmt, MT_FLAGS_ALLOC_RANGE); + mt_init_flags(&newmt, MT_FLAGS_ALLOC_RANGE | MT_FLAGS_LOCK_EXTERN); + mt_set_external_lock(&newmt, &newmt_lock); newmas.tree = &newmt; mas_reset(&newmas); mas_reset(&mas); - mas_lock(&newmas); + down_write(&newmt_lock); mas.index = 0; mas.last = 0; if (mas_expected_entries(&newmas, nr_entries)) { @@ -1739,10 +1744,10 @@ } rcu_read_unlock(); mas_destroy(&newmas); - mas_unlock(&newmas); mt_validate(&newmt); mt_set_non_kernel(0); - mtree_destroy(&newmt); + __mt_destroy(&newmt); + up_write(&newmt_lock); } static noinline void __init check_iteration(struct maple_tree *mt) @@ -1853,6 +1858,10 @@ void *val; MA_STATE(mas, mt, 0, 0); MA_STATE(newmas, mt, 0, 0); + struct rw_semaphore newmt_lock; + + init_rwsem(&newmt_lock); + mt_set_external_lock(&newmt, &newmt_lock); for (i = 0; i <= nr_entries; i++) mtree_store_range(mt, i*10, i*10 + 5, @@ -1867,7 +1876,7 @@ mas.index = 0; mas.last = 0; rcu_read_lock(); - mas_lock(&newmas); + down_write(&newmt_lock); if (mas_expected_entries(&newmas, nr_entries)) { printk("OOM!"); BUG_ON(1); @@ -1878,11 +1887,11 @@ mas_store(&newmas, val); } mas_destroy(&newmas); - mas_unlock(&newmas); rcu_read_unlock(); mt_validate(&newmt); mt_set_non_kernel(0); - mtree_destroy(&newmt); + __mt_destroy(&newmt); + up_write(&newmt_lock); } } #endif @@ -2489,6 +2498,10 @@ void *tmp; MA_STATE(mas, mt, 0, 0); MA_STATE(newmas, &newmt, 0, 0); + struct rw_semaphore newmt_lock; + + init_rwsem(&newmt_lock); + mt_set_external_lock(&newmt, &newmt_lock); if (!zero_start) i = 1; @@ -2498,9 +2511,9 @@ mtree_store_range(mt, i*10, (i+1)*10 - gap, xa_mk_value(i), GFP_KERNEL); - mt_init_flags(&newmt, MT_FLAGS_ALLOC_RANGE); + mt_init_flags(&newmt, MT_FLAGS_ALLOC_RANGE | MT_FLAGS_LOCK_EXTERN); mt_set_non_kernel(99999); - mas_lock(&newmas); + down_write(&newmt_lock); ret = mas_expected_entries(&newmas, nr_entries); mt_set_non_kernel(0); MT_BUG_ON(mt, ret != 0); @@ -2513,9 +2526,9 @@ } rcu_read_unlock(); mas_destroy(&newmas); - mas_unlock(&newmas); - mtree_destroy(&newmt); + __mt_destroy(&newmt); + up_write(&newmt_lock); } /* Duplicate many sizes of trees. Mainly to test expected entry values */ diff -u linux-aws-6.5-6.5.0/mm/memcontrol.c linux-aws-6.5-6.5.0/mm/memcontrol.c --- linux-aws-6.5-6.5.0/mm/memcontrol.c +++ linux-aws-6.5-6.5.0/mm/memcontrol.c @@ -2868,7 +2868,8 @@ * Moreover, it should not come from DMA buffer and is not readily * reclaimable. So those GFP bits should be masked off. */ -#define OBJCGS_CLEAR_MASK (__GFP_DMA | __GFP_RECLAIMABLE | __GFP_ACCOUNT) +#define OBJCGS_CLEAR_MASK (__GFP_DMA | __GFP_RECLAIMABLE | \ + __GFP_ACCOUNT | __GFP_NOFAIL) /* * mod_objcg_mlstate() may be called with irq enabled, so diff -u linux-aws-6.5-6.5.0/mm/mempolicy.c linux-aws-6.5-6.5.0/mm/mempolicy.c --- linux-aws-6.5-6.5.0/mm/mempolicy.c +++ linux-aws-6.5-6.5.0/mm/mempolicy.c @@ -131,22 +131,26 @@ static struct mempolicy preferred_node_policy[MAX_NUMNODES]; /** - * numa_map_to_online_node - Find closest online node + * numa_nearest_node - Find nearest node by state * @node: Node id to start the search + * @state: State to filter the search * - * Lookup the next closest node by distance if @nid is not online. + * Lookup the closest node by distance if @nid is not in state. * - * Return: this @node if it is online, otherwise the closest node by distance + * Return: this @node if it is in state, otherwise the closest node by distance */ -int numa_map_to_online_node(int node) +int numa_nearest_node(int node, unsigned int state) { int min_dist = INT_MAX, dist, n, min_node; - if (node == NUMA_NO_NODE || node_online(node)) + if (state >= NR_NODE_STATES) + return -EINVAL; + + if (node == NUMA_NO_NODE || node_state(node, state)) return node; min_node = node; - for_each_online_node(n) { + for_each_node_state(n, state) { dist = node_distance(node, n); if (dist < min_dist) { min_dist = dist; @@ -156,7 +160,7 @@ return min_node; } -EXPORT_SYMBOL_GPL(numa_map_to_online_node); +EXPORT_SYMBOL_GPL(numa_nearest_node); struct mempolicy *get_task_policy(struct task_struct *p) { @@ -1543,8 +1547,10 @@ * the home node for vmas we already updated before. */ old = vma_policy(vma); - if (!old) + if (!old) { + prev = vma; continue; + } if (old->mode != MPOL_BIND && old->mode != MPOL_PREFERRED_MANY) { err = -EOPNOTSUPP; break; diff -u linux-aws-6.5-6.5.0/mm/mmap.c linux-aws-6.5-6.5.0/mm/mmap.c --- linux-aws-6.5-6.5.0/mm/mmap.c +++ linux-aws-6.5-6.5.0/mm/mmap.c @@ -600,11 +600,12 @@ * dup_anon_vma() - Helper function to duplicate anon_vma * @dst: The destination VMA * @src: The source VMA + * @dup: Pointer to the destination VMA when successful. * * Returns: 0 on success. */ static inline int dup_anon_vma(struct vm_area_struct *dst, - struct vm_area_struct *src) + struct vm_area_struct *src, struct vm_area_struct **dup) { /* * Easily overlooked: when mprotect shifts the boundary, make sure the @@ -612,9 +613,15 @@ * anon pages imported. */ if (src->anon_vma && !dst->anon_vma) { + int ret; + vma_start_write(dst); dst->anon_vma = src->anon_vma; - return anon_vma_clone(dst, src); + ret = anon_vma_clone(dst, src); + if (ret) + return ret; + + *dup = dst; } return 0; @@ -641,6 +648,7 @@ unsigned long start, unsigned long end, pgoff_t pgoff, struct vm_area_struct *next) { + struct vm_area_struct *anon_dup = NULL; bool remove_next = false; struct vma_prepare vp; @@ -648,7 +656,7 @@ int ret; remove_next = true; - ret = dup_anon_vma(vma, next); + ret = dup_anon_vma(vma, next, &anon_dup); if (ret) return ret; } @@ -680,6 +688,8 @@ return 0; nomem: + if (anon_dup) + unlink_anon_vmas(anon_dup); return -ENOMEM; } @@ -878,6 +888,7 @@ { struct vm_area_struct *curr, *next, *res; struct vm_area_struct *vma, *adjust, *remove, *remove2; + struct vm_area_struct *anon_dup = NULL; struct vma_prepare vp; pgoff_t vma_pgoff; int err = 0; @@ -942,16 +953,16 @@ is_mergeable_anon_vma(prev->anon_vma, next->anon_vma, NULL)) { remove = next; /* case 1 */ vma_end = next->vm_end; - err = dup_anon_vma(prev, next); + err = dup_anon_vma(prev, next, &anon_dup); if (curr) { /* case 6 */ remove = curr; remove2 = next; if (!next->anon_vma) - err = dup_anon_vma(prev, curr); + err = dup_anon_vma(prev, curr, &anon_dup); } } else if (merge_prev) { /* case 2 */ if (curr) { - err = dup_anon_vma(prev, curr); + err = dup_anon_vma(prev, curr, &anon_dup); if (end == curr->vm_end) { /* case 7 */ remove = curr; } else { /* case 5 */ @@ -965,7 +976,7 @@ vma_end = addr; adjust = next; adj_start = -(prev->vm_end - addr); - err = dup_anon_vma(next, prev); + err = dup_anon_vma(next, prev, &anon_dup); } else { /* * Note that cases 3 and 8 are the ONLY ones where prev @@ -978,17 +989,17 @@ if (curr) { /* case 8 */ vma_pgoff = curr->vm_pgoff; remove = curr; - err = dup_anon_vma(next, curr); + err = dup_anon_vma(next, curr, &anon_dup); } } } /* Error in anon_vma clone. */ if (err) - return NULL; + goto anon_vma_fail; if (vma_iter_prealloc(vmi)) - return NULL; + goto prealloc_fail; init_multi_vma_prep(&vp, vma, adjust, remove, remove2); VM_WARN_ON(vp.anon_vma && adjust && adjust->anon_vma && @@ -1021,6 +1032,15 @@ khugepaged_enter_vma(res, vm_flags); return res; + +prealloc_fail: + if (anon_dup) + unlink_anon_vmas(anon_dup); + +anon_vma_fail: + vma_iter_set(vmi, addr); + vma_iter_load(vmi); + return NULL; } /* @@ -3131,13 +3151,13 @@ if (!len) return 0; - if (mmap_write_lock_killable(mm)) - return -EINTR; - /* Until we need other flags, refuse anything except VM_EXEC. */ if ((flags & (~VM_EXEC)) != 0) return -EINVAL; + if (mmap_write_lock_killable(mm)) + return -EINTR; + ret = check_brk_limits(addr, len); if (ret) goto limits_failed; diff -u linux-aws-6.5-6.5.0/mm/page_alloc.c linux-aws-6.5-6.5.0/mm/page_alloc.c --- linux-aws-6.5-6.5.0/mm/page_alloc.c +++ linux-aws-6.5-6.5.0/mm/page_alloc.c @@ -6528,6 +6528,7 @@ next_page = page; current_buddy = page + size; } + page = next_page; if (set_page_guard(zone, current_buddy, high, migratetype)) continue; @@ -6535,7 +6536,6 @@ if (current_buddy != target) { add_to_free_list(current_buddy, zone, high, migratetype); set_buddy_order(current_buddy, high); - page = next_page; } } } diff -u linux-aws-6.5-6.5.0/mm/slab_common.c linux-aws-6.5-6.5.0/mm/slab_common.c --- linux-aws-6.5-6.5.0/mm/slab_common.c +++ linux-aws-6.5-6.5.0/mm/slab_common.c @@ -864,11 +864,13 @@ static unsigned int __kmalloc_minalign(void) { + unsigned int minalign = dma_get_cache_alignment(); + #ifdef CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC if (io_tlb_default_mem.nslabs) - return ARCH_KMALLOC_MINALIGN; + minalign = ARCH_KMALLOC_MINALIGN; #endif - return dma_get_cache_alignment(); + return max(minalign, arch_slab_minalign()); } void __init diff -u linux-aws-6.5-6.5.0/net/9p/trans_fd.c linux-aws-6.5-6.5.0/net/9p/trans_fd.c --- linux-aws-6.5-6.5.0/net/9p/trans_fd.c +++ linux-aws-6.5-6.5.0/net/9p/trans_fd.c @@ -832,14 +832,21 @@ goto out_free_ts; if (!(ts->rd->f_mode & FMODE_READ)) goto out_put_rd; - /* prevent workers from hanging on IO when fd is a pipe */ - ts->rd->f_flags |= O_NONBLOCK; + /* Prevent workers from hanging on IO when fd is a pipe. + * It's technically possible for userspace or concurrent mounts to + * modify this flag concurrently, which will likely result in a + * broken filesystem. However, just having bad flags here should + * not crash the kernel or cause any other sort of bug, so mark this + * particular data race as intentional so that tooling (like KCSAN) + * can allow it and detect further problems. + */ + data_race(ts->rd->f_flags |= O_NONBLOCK); ts->wr = fget(wfd); if (!ts->wr) goto out_put_rd; if (!(ts->wr->f_mode & FMODE_WRITE)) goto out_put_wr; - ts->wr->f_flags |= O_NONBLOCK; + data_race(ts->wr->f_flags |= O_NONBLOCK); client->trans = ts; client->status = Connected; diff -u linux-aws-6.5-6.5.0/net/bluetooth/hci_conn.c linux-aws-6.5-6.5.0/net/bluetooth/hci_conn.c --- linux-aws-6.5-6.5.0/net/bluetooth/hci_conn.c +++ linux-aws-6.5-6.5.0/net/bluetooth/hci_conn.c @@ -153,6 +153,9 @@ hci_conn_hash_del(hdev, conn); + if (HCI_CONN_HANDLE_UNSET(conn->handle)) + ida_free(&hdev->unset_handle_ida, conn->handle); + if (conn->cleanup) conn->cleanup(conn); @@ -169,13 +172,11 @@ hdev->notify(hdev, HCI_NOTIFY_CONN_DEL); } - hci_conn_del_sysfs(conn); - debugfs_remove_recursive(conn->debugfs); - hci_dev_put(hdev); + hci_conn_del_sysfs(conn); - hci_conn_put(conn); + hci_dev_put(hdev); } static void hci_acl_create_connection(struct hci_conn *conn) @@ -734,6 +735,7 @@ }; int count; bool big_term; + bool pa_sync_term; bool big_sync_term; }; @@ -807,7 +809,10 @@ if (d->big_sync_term) hci_le_big_terminate_sync(hdev, d->big); - return hci_le_pa_terminate_sync(hdev, d->sync_handle); + if (d->pa_sync_term) + return hci_le_pa_terminate_sync(hdev, d->sync_handle); + + return 0; } static int hci_le_big_terminate(struct hci_dev *hdev, u8 big, struct hci_conn *conn) @@ -823,6 +828,7 @@ d->big = big; d->sync_handle = conn->sync_handle; + d->pa_sync_term = test_and_clear_bit(HCI_CONN_PA_SYNC, &conn->flags); d->big_sync_term = test_and_clear_bit(HCI_CONN_BIG_SYNC, &conn->flags); ret = hci_cmd_sync_queue(hdev, big_terminate_sync, d, @@ -874,7 +880,7 @@ static int remove_cig_sync(struct hci_dev *hdev, void *data) { - u8 handle = PTR_ERR(data); + u8 handle = PTR_UINT(data); return hci_le_remove_cig_sync(hdev, handle); } @@ -883,7 +889,8 @@ { bt_dev_dbg(hdev, "handle 0x%2.2x", handle); - return hci_cmd_sync_queue(hdev, remove_cig_sync, ERR_PTR(handle), NULL); + return hci_cmd_sync_queue(hdev, remove_cig_sync, UINT_PTR(handle), + NULL); } static void find_cis(struct hci_conn *conn, void *data) @@ -924,31 +931,18 @@ hci_le_remove_cig(hdev, conn->iso_qos.ucast.cig); } -static u16 hci_conn_hash_alloc_unset(struct hci_dev *hdev) +static int hci_conn_hash_alloc_unset(struct hci_dev *hdev) { - struct hci_conn_hash *h = &hdev->conn_hash; - struct hci_conn *c; - u16 handle = HCI_CONN_HANDLE_MAX + 1; - - rcu_read_lock(); - - list_for_each_entry_rcu(c, &h->list, list) { - /* Find the first unused handle */ - if (handle == 0xffff || c->handle != handle) - break; - handle++; - } - rcu_read_unlock(); - - return handle; + return ida_alloc_range(&hdev->unset_handle_ida, HCI_CONN_HANDLE_MAX + 1, + U16_MAX, GFP_ATOMIC); } struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst, - u8 role) + u8 role, u16 handle) { struct hci_conn *conn; - BT_DBG("%s dst %pMR", hdev->name, dst); + bt_dev_dbg(hdev, "dst %pMR handle 0x%4.4x", dst, handle); conn = kzalloc(sizeof(*conn), GFP_KERNEL); if (!conn) @@ -956,7 +950,7 @@ bacpy(&conn->dst, dst); bacpy(&conn->src, &hdev->bdaddr); - conn->handle = hci_conn_hash_alloc_unset(hdev); + conn->handle = handle; conn->hdev = hdev; conn->type = type; conn->role = role; @@ -969,6 +963,7 @@ conn->rssi = HCI_RSSI_INVALID; conn->tx_power = HCI_TX_POWER_INVALID; conn->max_tx_power = HCI_TX_POWER_INVALID; + conn->sync_handle = HCI_SYNC_HANDLE_INVALID; set_bit(HCI_CONN_POWER_SAVE, &conn->flags); conn->disc_timeout = HCI_DISCONN_TIMEOUT; @@ -1040,6 +1035,20 @@ return conn; } +struct hci_conn *hci_conn_add_unset(struct hci_dev *hdev, int type, + bdaddr_t *dst, u8 role) +{ + int handle; + + bt_dev_dbg(hdev, "dst %pMR", dst); + + handle = hci_conn_hash_alloc_unset(hdev); + if (unlikely(handle < 0)) + return NULL; + + return hci_conn_add(hdev, type, dst, role, handle); +} + static void hci_conn_cleanup_child(struct hci_conn *conn, u8 reason) { if (!reason) @@ -1248,9 +1257,44 @@ hci_conn_del(conn); } +/* This function requires the caller holds hdev->lock */ +u8 hci_conn_set_handle(struct hci_conn *conn, u16 handle) +{ + struct hci_dev *hdev = conn->hdev; + + bt_dev_dbg(hdev, "hcon %p handle 0x%4.4x", conn, handle); + + if (conn->handle == handle) + return 0; + + if (handle > HCI_CONN_HANDLE_MAX) { + bt_dev_err(hdev, "Invalid handle: 0x%4.4x > 0x%4.4x", + handle, HCI_CONN_HANDLE_MAX); + return HCI_ERROR_INVALID_PARAMETERS; + } + + /* If abort_reason has been sent it means the connection is being + * aborted and the handle shall not be changed. + */ + if (conn->abort_reason) + return conn->abort_reason; + + if (HCI_CONN_HANDLE_UNSET(conn->handle)) + ida_free(&hdev->unset_handle_ida, conn->handle); + + conn->handle = handle; + + return 0; +} + static void create_le_conn_complete(struct hci_dev *hdev, void *data, int err) { - struct hci_conn *conn = data; + struct hci_conn *conn; + u16 handle = PTR_UINT(data); + + conn = hci_conn_hash_lookup_handle(hdev, handle); + if (!conn) + return; bt_dev_dbg(hdev, "err %d", err); @@ -1275,10 +1319,17 @@ static int hci_connect_le_sync(struct hci_dev *hdev, void *data) { - struct hci_conn *conn = data; + struct hci_conn *conn; + u16 handle = PTR_UINT(data); + + conn = hci_conn_hash_lookup_handle(hdev, handle); + if (!conn) + return 0; bt_dev_dbg(hdev, "conn %p", conn); + conn->state = BT_CONNECT; + return hci_le_create_conn_sync(hdev, conn); } @@ -1337,7 +1388,7 @@ if (conn) { bacpy(&conn->dst, dst); } else { - conn = hci_conn_add(hdev, LE_LINK, dst, role); + conn = hci_conn_add_unset(hdev, LE_LINK, dst, role); if (!conn) return ERR_PTR(-ENOMEM); hci_conn_hold(conn); @@ -1348,10 +1399,10 @@ conn->sec_level = BT_SECURITY_LOW; conn->conn_timeout = conn_timeout; - conn->state = BT_CONNECT; clear_bit(HCI_CONN_SCANNING, &conn->flags); - err = hci_cmd_sync_queue(hdev, hci_connect_le_sync, conn, + err = hci_cmd_sync_queue(hdev, hci_connect_le_sync, + UINT_PTR(conn->handle), create_le_conn_complete); if (err) { hci_conn_del(conn); @@ -1508,7 +1559,7 @@ memcmp(conn->le_per_adv_data, base, base_len))) return ERR_PTR(-EADDRINUSE); - conn = hci_conn_add(hdev, ISO_LINK, dst, HCI_ROLE_MASTER); + conn = hci_conn_add_unset(hdev, ISO_LINK, dst, HCI_ROLE_MASTER); if (!conn) return ERR_PTR(-ENOMEM); @@ -1552,7 +1603,7 @@ BT_DBG("requesting refresh of dst_addr"); - conn = hci_conn_add(hdev, LE_LINK, dst, HCI_ROLE_MASTER); + conn = hci_conn_add_unset(hdev, LE_LINK, dst, HCI_ROLE_MASTER); if (!conn) return ERR_PTR(-ENOMEM); @@ -1589,9 +1640,18 @@ return ERR_PTR(-EOPNOTSUPP); } + /* Reject outgoing connection to device with same BD ADDR against + * CVE-2020-26555 + */ + if (!bacmp(&hdev->bdaddr, dst)) { + bt_dev_dbg(hdev, "Reject connection with same BD_ADDR %pMR\n", + dst); + return ERR_PTR(-ECONNREFUSED); + } + acl = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst); if (!acl) { - acl = hci_conn_add(hdev, ACL_LINK, dst, HCI_ROLE_MASTER); + acl = hci_conn_add_unset(hdev, ACL_LINK, dst, HCI_ROLE_MASTER); if (!acl) return ERR_PTR(-ENOMEM); } @@ -1651,7 +1711,7 @@ sco = hci_conn_hash_lookup_ba(hdev, type, dst); if (!sco) { - sco = hci_conn_add(hdev, type, dst, HCI_ROLE_MASTER); + sco = hci_conn_add_unset(hdev, type, dst, HCI_ROLE_MASTER); if (!sco) { hci_conn_drop(acl); return ERR_PTR(-ENOMEM); @@ -1719,7 +1779,7 @@ static int set_cig_params_sync(struct hci_dev *hdev, void *data) { - u8 cig_id = PTR_ERR(data); + u8 cig_id = PTR_UINT(data); struct hci_conn *conn; struct bt_iso_qos *qos; struct iso_cig_params pdu; @@ -1829,7 +1889,7 @@ done: if (hci_cmd_sync_queue(hdev, set_cig_params_sync, - ERR_PTR(qos->ucast.cig), NULL) < 0) + UINT_PTR(qos->ucast.cig), NULL) < 0) return false; return true; @@ -1843,7 +1903,7 @@ cis = hci_conn_hash_lookup_cis(hdev, dst, dst_type, qos->ucast.cig, qos->ucast.cis); if (!cis) { - cis = hci_conn_add(hdev, ISO_LINK, dst, HCI_ROLE_MASTER); + cis = hci_conn_add_unset(hdev, ISO_LINK, dst, HCI_ROLE_MASTER); if (!cis) return ERR_PTR(-ENOMEM); cis->cleanup = cis_cleanup; @@ -2078,7 +2138,8 @@ return hci_cmd_sync_queue(hdev, create_pa_sync, cp, create_pa_complete); } -int hci_le_big_create_sync(struct hci_dev *hdev, struct bt_iso_qos *qos, +int hci_le_big_create_sync(struct hci_dev *hdev, struct hci_conn *hcon, + struct bt_iso_qos *qos, __u16 sync_handle, __u8 num_bis, __u8 bis[]) { struct _packed { @@ -2094,6 +2155,9 @@ if (err) return err; + if (hcon) + hcon->iso_qos.bcast.big = qos->bcast.big; + memset(&pdu, 0, sizeof(pdu)); pdu.cp.handle = qos->bcast.big; pdu.cp.sync_handle = cpu_to_le16(sync_handle); @@ -2364,34 +2428,41 @@ if (!test_bit(HCI_CONN_AUTH, &conn->flags)) goto auth; - /* An authenticated FIPS approved combination key has sufficient - * security for security level 4. */ - if (conn->key_type == HCI_LK_AUTH_COMBINATION_P256 && - sec_level == BT_SECURITY_FIPS) - goto encrypt; - - /* An authenticated combination key has sufficient security for - security level 3. */ - if ((conn->key_type == HCI_LK_AUTH_COMBINATION_P192 || - conn->key_type == HCI_LK_AUTH_COMBINATION_P256) && - sec_level == BT_SECURITY_HIGH) - goto encrypt; - - /* An unauthenticated combination key has sufficient security for - security level 1 and 2. */ - if ((conn->key_type == HCI_LK_UNAUTH_COMBINATION_P192 || - conn->key_type == HCI_LK_UNAUTH_COMBINATION_P256) && - (sec_level == BT_SECURITY_MEDIUM || sec_level == BT_SECURITY_LOW)) - goto encrypt; - - /* A combination key has always sufficient security for the security - levels 1 or 2. High security level requires the combination key - is generated using maximum PIN code length (16). - For pre 2.1 units. */ - if (conn->key_type == HCI_LK_COMBINATION && - (sec_level == BT_SECURITY_MEDIUM || sec_level == BT_SECURITY_LOW || - conn->pin_length == 16)) - goto encrypt; + switch (conn->key_type) { + case HCI_LK_AUTH_COMBINATION_P256: + /* An authenticated FIPS approved combination key has + * sufficient security for security level 4 or lower. + */ + if (sec_level <= BT_SECURITY_FIPS) + goto encrypt; + break; + case HCI_LK_AUTH_COMBINATION_P192: + /* An authenticated combination key has sufficient security for + * security level 3 or lower. + */ + if (sec_level <= BT_SECURITY_HIGH) + goto encrypt; + break; + case HCI_LK_UNAUTH_COMBINATION_P192: + case HCI_LK_UNAUTH_COMBINATION_P256: + /* An unauthenticated combination key has sufficient security + * for security level 2 or lower. + */ + if (sec_level <= BT_SECURITY_MEDIUM) + goto encrypt; + break; + case HCI_LK_COMBINATION: + /* A combination key has always sufficient security for the + * security levels 2 or lower. High security level requires the + * combination key is generated using maximum PIN code length + * (16). For pre 2.1 units. + */ + if (sec_level <= BT_SECURITY_MEDIUM || conn->pin_length == 16) + goto encrypt; + break; + default: + break; + } auth: if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) @@ -2836,7 +2907,7 @@ static int abort_conn_sync(struct hci_dev *hdev, void *data) { struct hci_conn *conn; - u16 handle = PTR_ERR(data); + u16 handle = PTR_UINT(data); conn = hci_conn_hash_lookup_handle(hdev, handle); if (!conn) @@ -2862,6 +2933,9 @@ /* If the connection is pending check the command opcode since that * might be blocking on hci_cmd_sync_work while waiting its respective * event so we need to hci_cmd_sync_cancel to cancel it. + * + * hci_connect_le serializes the connection attempts so only one + * connection can be in BT_CONNECT at time. */ if (conn->state == BT_CONNECT && hdev->req_status == HCI_REQ_PEND) { switch (hci_skb_event(hdev->sent_cmd)) { @@ -2874,5 +2948,5 @@ } - return hci_cmd_sync_queue(hdev, abort_conn_sync, ERR_PTR(conn->handle), + return hci_cmd_sync_queue(hdev, abort_conn_sync, UINT_PTR(conn->handle), NULL); } diff -u linux-aws-6.5-6.5.0/net/bluetooth/hci_core.c linux-aws-6.5-6.5.0/net/bluetooth/hci_core.c --- linux-aws-6.5-6.5.0/net/bluetooth/hci_core.c +++ linux-aws-6.5-6.5.0/net/bluetooth/hci_core.c @@ -2535,6 +2535,8 @@ mutex_init(&hdev->lock); mutex_init(&hdev->req_lock); + ida_init(&hdev->unset_handle_ida); + INIT_LIST_HEAD(&hdev->mesh_pending); INIT_LIST_HEAD(&hdev->mgmt_pending); INIT_LIST_HEAD(&hdev->reject_list); @@ -2617,7 +2619,11 @@ if (id < 0) return id; - snprintf(hdev->name, sizeof(hdev->name), "hci%d", id); + error = dev_set_name(&hdev->dev, "hci%u", id); + if (error) + return error; + + hdev->name = dev_name(&hdev->dev); hdev->id = id; BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); @@ -2639,8 +2645,6 @@ if (!IS_ERR_OR_NULL(bt_debugfs)) hdev->debugfs = debugfs_create_dir(hdev->name, bt_debugfs); - dev_set_name(&hdev->dev, "%s", hdev->name); - error = device_add(&hdev->dev); if (error < 0) goto err_wqueue; @@ -2787,6 +2791,7 @@ hci_codec_list_clear(&hdev->local_codecs); hci_dev_unlock(hdev); + ida_destroy(&hdev->unset_handle_ida); ida_simple_remove(&hci_index_ida, hdev->id); kfree_skb(hdev->sent_cmd); kfree_skb(hdev->recv_event); diff -u linux-aws-6.5-6.5.0/net/bluetooth/hci_event.c linux-aws-6.5-6.5.0/net/bluetooth/hci_event.c --- linux-aws-6.5-6.5.0/net/bluetooth/hci_event.c +++ linux-aws-6.5-6.5.0/net/bluetooth/hci_event.c @@ -26,6 +26,8 @@ /* Bluetooth HCI event handling. */ #include +#include +#include #include #include @@ -2333,8 +2335,8 @@ } } else { if (!conn) { - conn = hci_conn_add(hdev, ACL_LINK, &cp->bdaddr, - HCI_ROLE_MASTER); + conn = hci_conn_add_unset(hdev, ACL_LINK, &cp->bdaddr, + HCI_ROLE_MASTER); if (!conn) bt_dev_err(hdev, "no memory for new connection"); } @@ -3149,8 +3151,8 @@ hci_bdaddr_list_lookup_with_flags(&hdev->accept_list, &ev->bdaddr, BDADDR_BREDR)) { - conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr, - HCI_ROLE_SLAVE); + conn = hci_conn_add_unset(hdev, ev->link_type, + &ev->bdaddr, HCI_ROLE_SLAVE); if (!conn) { bt_dev_err(hdev, "no memory for new conn"); goto unlock; @@ -3180,13 +3182,9 @@ } if (!status) { - conn->handle = __le16_to_cpu(ev->handle); - if (conn->handle > HCI_CONN_HANDLE_MAX) { - bt_dev_err(hdev, "Invalid handle: 0x%4.4x > 0x%4.4x", - conn->handle, HCI_CONN_HANDLE_MAX); - status = HCI_ERROR_INVALID_PARAMETERS; + status = hci_conn_set_handle(conn, __le16_to_cpu(ev->handle)); + if (status) goto done; - } if (conn->type == ACL_LINK) { conn->state = BT_CONFIG; @@ -3272,6 +3270,16 @@ bt_dev_dbg(hdev, "bdaddr %pMR type 0x%x", &ev->bdaddr, ev->link_type); + /* Reject incoming connection from device with same BD ADDR against + * CVE-2020-26555 + */ + if (hdev && !bacmp(&hdev->bdaddr, &ev->bdaddr)) { + bt_dev_dbg(hdev, "Reject connection with same BD_ADDR %pMR\n", + &ev->bdaddr); + hci_reject_conn(hdev, &ev->bdaddr); + return; + } + mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type, &flags); @@ -3309,8 +3317,8 @@ conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); if (!conn) { - conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr, - HCI_ROLE_SLAVE); + conn = hci_conn_add_unset(hdev, ev->link_type, &ev->bdaddr, + HCI_ROLE_SLAVE); if (!conn) { bt_dev_err(hdev, "no memory for new connection"); goto unlock; @@ -3869,11 +3877,9 @@ if (conn->state != BT_BOUND && conn->state != BT_CONNECT) continue; - conn->handle = __le16_to_cpu(rp->handle[i]); + if (hci_conn_set_handle(conn, __le16_to_cpu(rp->handle[i]))) + continue; - bt_dev_dbg(hdev, "%p handle 0x%4.4x parent %p", conn, - conn->handle, conn->parent); - if (conn->state == BT_CONNECT) pending = true; } @@ -4725,6 +4731,15 @@ if (!conn) goto unlock; + /* Ignore NULL link key against CVE-2020-26555 */ + if (!crypto_memneq(ev->link_key, ZERO_KEY, HCI_LINK_KEY_SIZE)) { + bt_dev_dbg(hdev, "Ignore NULL link key (ZERO KEY) for %pMR", + &ev->bdaddr); + hci_disconnect(conn, HCI_ERROR_AUTH_FAILURE); + hci_conn_drop(conn); + goto unlock; + } + hci_conn_hold(conn); conn->disc_timeout = HCI_DISCONN_TIMEOUT; hci_conn_drop(conn); @@ -5036,11 +5051,8 @@ switch (status) { case 0x00: - conn->handle = __le16_to_cpu(ev->handle); - if (conn->handle > HCI_CONN_HANDLE_MAX) { - bt_dev_err(hdev, "Invalid handle: 0x%4.4x > 0x%4.4x", - conn->handle, HCI_CONN_HANDLE_MAX); - status = HCI_ERROR_INVALID_PARAMETERS; + status = hci_conn_set_handle(conn, __le16_to_cpu(ev->handle)); + if (status) { conn->state = BT_CLOSED; break; } @@ -5260,8 +5272,8 @@ * available, then do not declare that OOB data is * present. */ - if (!memcmp(data->rand256, ZERO_KEY, 16) || - !memcmp(data->hash256, ZERO_KEY, 16)) + if (!crypto_memneq(data->rand256, ZERO_KEY, 16) || + !crypto_memneq(data->hash256, ZERO_KEY, 16)) return 0x00; return 0x02; @@ -5271,8 +5283,8 @@ * not supported by the hardware, then check that if * P-192 data values are present. */ - if (!memcmp(data->rand192, ZERO_KEY, 16) || - !memcmp(data->hash192, ZERO_KEY, 16)) + if (!crypto_memneq(data->rand192, ZERO_KEY, 16) || + !crypto_memneq(data->hash192, ZERO_KEY, 16)) return 0x00; return 0x01; @@ -5289,7 +5301,7 @@ hci_dev_lock(hdev); conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); - if (!conn) + if (!conn || !hci_conn_ssp_enabled(conn)) goto unlock; hci_conn_hold(conn); @@ -5536,7 +5548,7 @@ hci_dev_lock(hdev); conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); - if (!conn) + if (!conn || !hci_conn_ssp_enabled(conn)) goto unlock; /* Reset the authentication requirement to unknown */ @@ -5855,7 +5867,7 @@ if (status) goto unlock; - conn = hci_conn_add(hdev, LE_LINK, bdaddr, role); + conn = hci_conn_add_unset(hdev, LE_LINK, bdaddr, role); if (!conn) { bt_dev_err(hdev, "no memory for new connection"); goto unlock; @@ -5917,17 +5929,11 @@ conn->dst_type = ev_bdaddr_type(hdev, conn->dst_type, NULL); - if (handle > HCI_CONN_HANDLE_MAX) { - bt_dev_err(hdev, "Invalid handle: 0x%4.4x > 0x%4.4x", handle, - HCI_CONN_HANDLE_MAX); - status = HCI_ERROR_INVALID_PARAMETERS; - } - /* All connection failure handling is taken care of by the * hci_conn_failed function which is triggered by the HCI * request completion callbacks used for connecting. */ - if (status) + if (status || hci_conn_set_handle(conn, handle)) goto unlock; /* Drop the connection if it has been aborted */ @@ -5951,7 +5957,6 @@ mgmt_device_connected(hdev, conn, NULL, 0); conn->sec_level = BT_SECURITY_LOW; - conn->handle = handle; conn->state = BT_CONFIG; /* Store current advertising instance as connection advertising instance @@ -6566,20 +6571,38 @@ struct hci_ev_le_pa_sync_established *ev = data; int mask = hdev->link_mode; __u8 flags = 0; + struct hci_conn *pa_sync; bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); - if (ev->status) - return; - hci_dev_lock(hdev); hci_dev_clear_flag(hdev, HCI_PA_SYNC); mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ISO_LINK, &flags); - if (!(mask & HCI_LM_ACCEPT)) + if (!(mask & HCI_LM_ACCEPT)) { hci_le_pa_term_sync(hdev, ev->handle); + goto unlock; + } + + if (!(flags & HCI_PROTO_DEFER)) + goto unlock; + + if (ev->status) { + /* Add connection to indicate the failed PA sync event */ + pa_sync = hci_conn_add_unset(hdev, ISO_LINK, BDADDR_ANY, + HCI_ROLE_SLAVE); + + if (!pa_sync) + goto unlock; + + set_bit(HCI_CONN_PA_SYNC_FAILED, &pa_sync->flags); + + /* Notify iso layer */ + hci_connect_cfm(pa_sync, ev->status); + } +unlock: hci_dev_unlock(hdev); } @@ -6946,12 +6969,12 @@ cis = hci_conn_hash_lookup_handle(hdev, cis_handle); if (!cis) { - cis = hci_conn_add(hdev, ISO_LINK, &acl->dst, HCI_ROLE_SLAVE); + cis = hci_conn_add(hdev, ISO_LINK, &acl->dst, HCI_ROLE_SLAVE, + cis_handle); if (!cis) { hci_le_reject_cis(hdev, ev->cis_handle); goto unlock; } - cis->handle = cis_handle; } cis->iso_qos.ucast.cig = ev->cig_id; @@ -6968,12 +6991,20 @@ hci_dev_unlock(hdev); } +static int hci_iso_term_big_sync(struct hci_dev *hdev, void *data) +{ + u8 handle = PTR_UINT(data); + + return hci_le_terminate_big_sync(hdev, handle, + HCI_ERROR_LOCAL_HOST_TERM); +} + static void hci_le_create_big_complete_evt(struct hci_dev *hdev, void *data, struct sk_buff *skb) { struct hci_evt_le_create_big_complete *ev = data; struct hci_conn *conn; - __u8 bis_idx = 0; + __u8 i = 0; BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); @@ -6991,7 +7022,9 @@ conn->iso_qos.bcast.big != ev->handle) continue; - conn->handle = __le16_to_cpu(ev->bis_handle[bis_idx++]); + if (hci_conn_set_handle(conn, + __le16_to_cpu(ev->bis_handle[i++]))) + continue; if (!ev->status) { conn->state = BT_CONNECTED; @@ -7010,16 +7043,17 @@ rcu_read_lock(); } - if (!ev->status && !bis_idx) + rcu_read_unlock(); + + if (!ev->status && !i) /* If no BISes have been connected for the BIG, * terminate. This is in case all bound connections * have been closed before the BIG creation * has completed. */ - hci_le_terminate_big_sync(hdev, ev->handle, - HCI_ERROR_LOCAL_HOST_TERM); + hci_cmd_sync_queue(hdev, hci_iso_term_big_sync, + UINT_PTR(ev->handle), NULL); - rcu_read_unlock(); hci_dev_unlock(hdev); } @@ -7028,6 +7062,7 @@ { struct hci_evt_le_big_sync_estabilished *ev = data; struct hci_conn *bis; + struct hci_conn *pa_sync; int i; bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); @@ -7038,6 +7073,15 @@ hci_dev_lock(hdev); + if (!ev->status) { + pa_sync = hci_conn_hash_lookup_pa_sync_big_handle(hdev, ev->handle); + if (pa_sync) + /* Also mark the BIG sync established event on the + * associated PA sync hcon + */ + set_bit(HCI_CONN_BIG_SYNC, &pa_sync->flags); + } + for (i = 0; i < ev->num_bis; i++) { u16 handle = le16_to_cpu(ev->bis[i]); __le32 interval; @@ -7045,12 +7089,15 @@ bis = hci_conn_hash_lookup_handle(hdev, handle); if (!bis) { bis = hci_conn_add(hdev, ISO_LINK, BDADDR_ANY, - HCI_ROLE_SLAVE); + HCI_ROLE_SLAVE, handle); if (!bis) continue; - bis->handle = handle; } + if (ev->status != 0x42) + /* Mark PA sync as established */ + set_bit(HCI_CONN_PA_SYNC, &bis->flags); + bis->iso_qos.bcast.big = ev->handle; memset(&interval, 0, sizeof(interval)); memcpy(&interval, ev->latency, sizeof(ev->latency)); @@ -7087,15 +7134,42 @@ struct hci_evt_le_big_info_adv_report *ev = data; int mask = hdev->link_mode; __u8 flags = 0; + struct hci_conn *pa_sync; bt_dev_dbg(hdev, "sync_handle 0x%4.4x", le16_to_cpu(ev->sync_handle)); hci_dev_lock(hdev); mask |= hci_proto_connect_ind(hdev, BDADDR_ANY, ISO_LINK, &flags); - if (!(mask & HCI_LM_ACCEPT)) + if (!(mask & HCI_LM_ACCEPT)) { hci_le_pa_term_sync(hdev, ev->sync_handle); + goto unlock; + } + + if (!(flags & HCI_PROTO_DEFER)) + goto unlock; + + pa_sync = hci_conn_hash_lookup_pa_sync_handle + (hdev, + le16_to_cpu(ev->sync_handle)); + + if (pa_sync) + goto unlock; + /* Add connection to indicate the PA sync event */ + pa_sync = hci_conn_add_unset(hdev, ISO_LINK, BDADDR_ANY, + HCI_ROLE_SLAVE); + + if (!pa_sync) + goto unlock; + + pa_sync->sync_handle = le16_to_cpu(ev->sync_handle); + set_bit(HCI_CONN_PA_SYNC, &pa_sync->flags); + + /* Notify iso layer */ + hci_connect_cfm(pa_sync, 0x00); + +unlock: hci_dev_unlock(hdev); } diff -u linux-aws-6.5-6.5.0/net/bluetooth/hci_sync.c linux-aws-6.5-6.5.0/net/bluetooth/hci_sync.c --- linux-aws-6.5-6.5.0/net/bluetooth/hci_sync.c +++ linux-aws-6.5-6.5.0/net/bluetooth/hci_sync.c @@ -151,7 +151,7 @@ struct sk_buff *skb; int err = 0; - bt_dev_dbg(hdev, "Opcode 0x%4x", opcode); + bt_dev_dbg(hdev, "Opcode 0x%4.4x", opcode); hci_req_init(&req, hdev); @@ -247,7 +247,7 @@ skb = __hci_cmd_sync_sk(hdev, opcode, plen, param, event, timeout, sk); if (IS_ERR(skb)) { if (!event) - bt_dev_err(hdev, "Opcode 0x%4x failed: %ld", opcode, + bt_dev_err(hdev, "Opcode 0x%4.4x failed: %ld", opcode, PTR_ERR(skb)); return PTR_ERR(skb); } @@ -5291,4 +5291,26 @@ return hci_le_connect_cancel_sync(hdev, conn, reason); + if (conn->type == ISO_LINK) { + /* BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E + * page 1857: + * + * If this command is issued for a CIS on the Central and the + * CIS is successfully terminated before being established, + * then an HCI_LE_CIS_Established event shall also be sent for + * this CIS with the Status Operation Cancelled by Host (0x44). + */ + if (test_bit(HCI_CONN_CREATE_CIS, &conn->flags)) + return hci_disconnect_sync(hdev, conn, reason); + + /* CIS with no Create CIS sent have nothing to cancel */ + if (bacmp(&conn->dst, BDADDR_ANY)) + return HCI_ERROR_LOCAL_HOST_TERM; + + /* There is no way to cancel a BIS without terminating the BIG + * which is done later on connection cleanup. + */ + return 0; + } + if (hdev->hci_ver < BLUETOOTH_VER_1_2) return 0; @@ -5316,11 +5338,27 @@ sizeof(cp), &cp, HCI_CMD_TIMEOUT); } +static int hci_le_reject_cis_sync(struct hci_dev *hdev, struct hci_conn *conn, + u8 reason) +{ + struct hci_cp_le_reject_cis cp; + + memset(&cp, 0, sizeof(cp)); + cp.handle = cpu_to_le16(conn->handle); + cp.reason = reason; + + return __hci_cmd_sync_status(hdev, HCI_OP_LE_REJECT_CIS, + sizeof(cp), &cp, HCI_CMD_TIMEOUT); +} + static int hci_reject_conn_sync(struct hci_dev *hdev, struct hci_conn *conn, u8 reason) { struct hci_cp_reject_conn_req cp; + if (conn->type == ISO_LINK) + return hci_le_reject_cis_sync(hdev, conn, reason); + if (conn->type == SCO_LINK || conn->type == ESCO_LINK) return hci_reject_sco_sync(hdev, conn, reason); @@ -5336,6 +5374,7 @@ { int err = 0; u16 handle = conn->handle; + bool disconnect = false; struct hci_conn *c; switch (conn->state) { @@ -5350,27 +5389,31 @@ err = hci_reject_conn_sync(hdev, conn, reason); break; case BT_OPEN: - /* Cleanup bises that failed to be established */ - if (test_and_clear_bit(HCI_CONN_BIG_SYNC_FAILED, &conn->flags)) { - hci_dev_lock(hdev); + hci_dev_lock(hdev); + + /* Cleanup bis or pa sync connections */ + if (test_and_clear_bit(HCI_CONN_BIG_SYNC_FAILED, &conn->flags) || + test_and_clear_bit(HCI_CONN_PA_SYNC_FAILED, &conn->flags)) { hci_conn_failed(conn, reason); - hci_dev_unlock(hdev); + } else if (test_bit(HCI_CONN_PA_SYNC, &conn->flags) || + test_bit(HCI_CONN_BIG_SYNC, &conn->flags)) { + conn->state = BT_CLOSED; + hci_disconn_cfm(conn, reason); + hci_conn_del(conn); } - break; - default: - hci_dev_lock(hdev); - conn->state = BT_CLOSED; - hci_disconn_cfm(conn, reason); - hci_conn_del(conn); + hci_dev_unlock(hdev); return 0; + case BT_BOUND: + break; + default: + disconnect = true; + break; } hci_dev_lock(hdev); - /* Check if the connection hasn't been cleanup while waiting - * commands to complete. - */ + /* Check if the connection has been cleaned up concurrently */ c = hci_conn_hash_lookup_handle(hdev, handle); if (!c || c != conn) { err = 0; @@ -5382,7 +5425,13 @@ * or in case of LE it was still scanning so it can be cleanup * safely. */ - hci_conn_failed(conn, reason); + if (disconnect) { + conn->state = BT_CLOSED; + hci_disconn_cfm(conn, reason); + hci_conn_del(conn); + } else { + hci_conn_failed(conn, reason); + } unlock: hci_dev_unlock(hdev); @@ -6511,7 +6560,7 @@ static int _update_adv_data_sync(struct hci_dev *hdev, void *data) { - u8 instance = PTR_ERR(data); + u8 instance = PTR_UINT(data); return hci_update_adv_data_sync(hdev, instance); } @@ -6521,3 +6570,3 @@ return hci_cmd_sync_queue(hdev, _update_adv_data_sync, - ERR_PTR(instance), NULL); + UINT_PTR(instance), NULL); } diff -u linux-aws-6.5-6.5.0/net/bluetooth/iso.c linux-aws-6.5-6.5.0/net/bluetooth/iso.c --- linux-aws-6.5-6.5.0/net/bluetooth/iso.c +++ linux-aws-6.5-6.5.0/net/bluetooth/iso.c @@ -51,6 +51,7 @@ /* iso_pinfo flags values */ enum { BT_SK_BIG_SYNC, + BT_SK_PA_SYNC, }; struct iso_pinfo { @@ -75,6 +76,9 @@ static bool check_ucast_qos(struct bt_iso_qos *qos); static bool check_bcast_qos(struct bt_iso_qos *qos); +static bool iso_match_sid(struct sock *sk, void *data); +static bool iso_match_sync_handle(struct sock *sk, void *data); +static void iso_sock_disconn(struct sock *sk); /* ---- ISO timers ---- */ #define ISO_CONN_TIMEOUT (HZ * 40) @@ -601,6 +605,15 @@ iso_sock_kill(sk); } + /* If listening socket stands for a PA sync connection, + * properly disconnect the hcon and socket. + */ + if (iso_pi(parent)->conn && iso_pi(parent)->conn->hcon && + test_bit(HCI_CONN_PA_SYNC, &iso_pi(parent)->conn->hcon->flags)) { + iso_sock_disconn(parent); + return; + } + parent->sk_state = BT_CLOSED; sock_set_flag(parent, SOCK_ZAPPED); } @@ -622,16 +635,14 @@ sock_put(sk); } -static void iso_conn_defer_reject(struct hci_conn *conn) +static void iso_sock_disconn(struct sock *sk) { - struct hci_cp_le_reject_cis cp; - - BT_DBG("conn %p", conn); - - memset(&cp, 0, sizeof(cp)); - cp.handle = cpu_to_le16(conn->handle); - cp.reason = HCI_ERROR_REJ_BAD_ADDR; - hci_send_cmd(conn->hdev, HCI_OP_LE_REJECT_CIS, sizeof(cp), &cp); + sk->sk_state = BT_DISCONN; + iso_sock_set_timer(sk, ISO_DISCONN_TIMEOUT); + iso_conn_lock(iso_pi(sk)->conn); + hci_conn_drop(iso_pi(sk)->conn->hcon); + iso_pi(sk)->conn->hcon = NULL; + iso_conn_unlock(iso_pi(sk)->conn); } static void __iso_sock_close(struct sock *sk) @@ -645,22 +656,19 @@ case BT_CONNECTED: case BT_CONFIG: - if (iso_pi(sk)->conn->hcon) { - sk->sk_state = BT_DISCONN; - iso_sock_set_timer(sk, ISO_DISCONN_TIMEOUT); - iso_conn_lock(iso_pi(sk)->conn); - hci_conn_drop(iso_pi(sk)->conn->hcon); - iso_pi(sk)->conn->hcon = NULL; - iso_conn_unlock(iso_pi(sk)->conn); - } else { + if (iso_pi(sk)->conn->hcon) + iso_sock_disconn(sk); + else iso_chan_del(sk, ECONNRESET); - } break; case BT_CONNECT2: - if (iso_pi(sk)->conn->hcon) - iso_conn_defer_reject(iso_pi(sk)->conn->hcon); - iso_chan_del(sk, ECONNRESET); + if (iso_pi(sk)->conn->hcon && + (test_bit(HCI_CONN_PA_SYNC, &iso_pi(sk)->conn->hcon->flags) || + test_bit(HCI_CONN_PA_SYNC_FAILED, &iso_pi(sk)->conn->hcon->flags))) + iso_sock_disconn(sk); + else + iso_chan_del(sk, ECONNRESET); break; case BT_CONNECT: /* In case of DEFER_SETUP the hcon would be bound to CIG which @@ -1176,6 +1184,29 @@ hci_send_cmd(hdev, HCI_OP_LE_ACCEPT_CIS, sizeof(cp), &cp); } +static void iso_conn_big_sync(struct sock *sk) +{ + int err; + struct hci_dev *hdev; + + hdev = hci_get_route(&iso_pi(sk)->dst, &iso_pi(sk)->src, + iso_pi(sk)->src_type); + + if (!hdev) + return; + + if (!test_and_set_bit(BT_SK_BIG_SYNC, &iso_pi(sk)->flags)) { + err = hci_le_big_create_sync(hdev, iso_pi(sk)->conn->hcon, + &iso_pi(sk)->qos, + iso_pi(sk)->sync_handle, + iso_pi(sk)->bc_num_bis, + iso_pi(sk)->bc_bis); + if (err) + bt_dev_err(hdev, "hci_le_big_create_sync: %d", + err); + } +} + static int iso_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, int flags) { @@ -1188,8 +1219,14 @@ lock_sock(sk); switch (sk->sk_state) { case BT_CONNECT2: - iso_conn_defer_accept(pi->conn->hcon); - sk->sk_state = BT_CONFIG; + if (pi->conn->hcon && + test_bit(HCI_CONN_PA_SYNC, &pi->conn->hcon->flags)) { + iso_conn_big_sync(sk); + sk->sk_state = BT_LISTEN; + } else { + iso_conn_defer_accept(pi->conn->hcon); + sk->sk_state = BT_CONFIG; + } release_sock(sk); return 0; case BT_CONNECT: @@ -1532,11 +1569,18 @@ return ev->handle == iso_pi(sk)->qos.bcast.big; } +static bool iso_match_pa_sync_flag(struct sock *sk, void *data) +{ + return test_bit(BT_SK_PA_SYNC, &iso_pi(sk)->flags); +} + static void iso_conn_ready(struct iso_conn *conn) { - struct sock *parent; + struct sock *parent = NULL; struct sock *sk = conn->sk; - struct hci_ev_le_big_sync_estabilished *ev; + struct hci_ev_le_big_sync_estabilished *ev = NULL; + struct hci_ev_le_pa_sync_established *ev2 = NULL; + struct hci_evt_le_big_info_adv_report *ev3 = NULL; struct hci_conn *hcon; BT_DBG("conn %p", conn); @@ -1548,15 +1592,38 @@ if (!hcon) return; - ev = hci_recv_event_data(hcon->hdev, - HCI_EVT_LE_BIG_SYNC_ESTABILISHED); - if (ev) + if (test_bit(HCI_CONN_BIG_SYNC, &hcon->flags) || + test_bit(HCI_CONN_BIG_SYNC_FAILED, &hcon->flags)) { + ev = hci_recv_event_data(hcon->hdev, + HCI_EVT_LE_BIG_SYNC_ESTABILISHED); + + /* Get reference to PA sync parent socket, if it exists */ parent = iso_get_sock_listen(&hcon->src, &hcon->dst, - iso_match_big, ev); - else + iso_match_pa_sync_flag, NULL); + if (!parent && ev) + parent = iso_get_sock_listen(&hcon->src, + &hcon->dst, + iso_match_big, ev); + } else if (test_bit(HCI_CONN_PA_SYNC_FAILED, &hcon->flags)) { + ev2 = hci_recv_event_data(hcon->hdev, + HCI_EV_LE_PA_SYNC_ESTABLISHED); + if (ev2) + parent = iso_get_sock_listen(&hcon->src, + &hcon->dst, + iso_match_sid, ev2); + } else if (test_bit(HCI_CONN_PA_SYNC, &hcon->flags)) { + ev3 = hci_recv_event_data(hcon->hdev, + HCI_EVT_LE_BIG_INFO_ADV_REPORT); + if (ev3) + parent = iso_get_sock_listen(&hcon->src, + &hcon->dst, + iso_match_sync_handle, ev3); + } + + if (!parent) parent = iso_get_sock_listen(&hcon->src, - BDADDR_ANY, NULL, NULL); + BDADDR_ANY, NULL, NULL); if (!parent) return; @@ -1573,11 +1640,17 @@ iso_sock_init(sk, parent); bacpy(&iso_pi(sk)->src, &hcon->src); - iso_pi(sk)->src_type = hcon->src_type; + + /* Convert from HCI to three-value type */ + if (hcon->src_type == ADDR_LE_DEV_PUBLIC) + iso_pi(sk)->src_type = BDADDR_LE_PUBLIC; + else + iso_pi(sk)->src_type = BDADDR_LE_RANDOM; /* If hcon has no destination address (BDADDR_ANY) it means it - * was created by HCI_EV_LE_BIG_SYNC_ESTABILISHED so we need to - * initialize using the parent socket destination address. + * was created by HCI_EV_LE_BIG_SYNC_ESTABILISHED or + * HCI_EV_LE_PA_SYNC_ESTABLISHED so we need to initialize using + * the parent socket destination address. */ if (!bacmp(&hcon->dst, BDADDR_ANY)) { bacpy(&hcon->dst, &iso_pi(parent)->dst); @@ -1585,13 +1658,23 @@ hcon->sync_handle = iso_pi(parent)->sync_handle; } + if (ev3) { + iso_pi(sk)->qos = iso_pi(parent)->qos; + iso_pi(sk)->qos.bcast.encryption = ev3->encryption; + hcon->iso_qos = iso_pi(sk)->qos; + iso_pi(sk)->bc_num_bis = iso_pi(parent)->bc_num_bis; + memcpy(iso_pi(sk)->bc_bis, iso_pi(parent)->bc_bis, ISO_MAX_NUM_BIS); + set_bit(BT_SK_PA_SYNC, &iso_pi(sk)->flags); + } + bacpy(&iso_pi(sk)->dst, &hcon->dst); iso_pi(sk)->dst_type = hcon->dst_type; hci_conn_hold(hcon); iso_chan_add(conn, sk, parent); - if (ev && ((struct hci_evt_le_big_sync_estabilished *)ev)->status) { + if ((ev && ((struct hci_evt_le_big_sync_estabilished *)ev)->status) || + (ev2 && ev2->status)) { /* Trigger error signal on child socket */ sk->sk_err = ECONNREFUSED; sk->sk_error_report(sk); @@ -1649,7 +1732,7 @@ if (ev1) { sk = iso_get_sock_listen(&hdev->bdaddr, bdaddr, iso_match_sid, ev1); - if (sk) + if (sk && !ev1->status) iso_pi(sk)->sync_handle = le16_to_cpu(ev1->handle); goto done; @@ -1657,16 +1740,21 @@ ev2 = hci_recv_event_data(hdev, HCI_EVT_LE_BIG_INFO_ADV_REPORT); if (ev2) { + /* Try to get PA sync listening socket, if it exists */ sk = iso_get_sock_listen(&hdev->bdaddr, bdaddr, - iso_match_sync_handle, ev2); + iso_match_pa_sync_flag, NULL); + if (!sk) + sk = iso_get_sock_listen(&hdev->bdaddr, bdaddr, + iso_match_sync_handle, ev2); if (sk) { int err; if (ev2->num_bis < iso_pi(sk)->bc_num_bis) iso_pi(sk)->bc_num_bis = ev2->num_bis; - if (!test_and_set_bit(BT_SK_BIG_SYNC, &iso_pi(sk)->flags)) { - err = hci_le_big_create_sync(hdev, + if (!test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags) && + !test_and_set_bit(BT_SK_BIG_SYNC, &iso_pi(sk)->flags)) { + err = hci_le_big_create_sync(hdev, NULL, &iso_pi(sk)->qos, iso_pi(sk)->sync_handle, iso_pi(sk)->bc_num_bis, @@ -1718,12 +1806,13 @@ BT_DBG("hcon %p bdaddr %pMR status %d", hcon, &hcon->dst, status); - /* Similar to the success case, if HCI_CONN_BIG_SYNC_FAILED is set, - * queue the failed bis connection into the accept queue of the - * listening socket and wake up userspace, to inform the user about - * the BIG sync failed event. + /* Similar to the success case, if HCI_CONN_BIG_SYNC_FAILED or + * HCI_CONN_PA_SYNC_FAILED is set, queue the failed connection + * into the accept queue of the listening socket and wake up + * userspace, to inform the user about the event. */ - if (!status || test_bit(HCI_CONN_BIG_SYNC_FAILED, &hcon->flags)) { + if (!status || test_bit(HCI_CONN_BIG_SYNC_FAILED, &hcon->flags) || + test_bit(HCI_CONN_PA_SYNC_FAILED, &hcon->flags)) { struct iso_conn *conn; conn = iso_conn_add(hcon); diff -u linux-aws-6.5-6.5.0/net/core/dev.c linux-aws-6.5-6.5.0/net/core/dev.c --- linux-aws-6.5-6.5.0/net/core/dev.c +++ linux-aws-6.5-6.5.0/net/core/dev.c @@ -343,7 +343,6 @@ static void __netdev_name_node_alt_destroy(struct netdev_name_node *name_node) { list_del(&name_node->list); - netdev_name_node_del(name_node); kfree(name_node->name); netdev_name_node_free(name_node); } @@ -362,6 +361,8 @@ if (name_node == dev->name_node || name_node->dev != dev) return -EINVAL; + netdev_name_node_del(name_node); + synchronize_rcu(); __netdev_name_node_alt_destroy(name_node); return 0; @@ -378,6 +379,7 @@ /* Device list insertion */ static void list_netdevice(struct net_device *dev) { + struct netdev_name_node *name_node; struct net *net = dev_net(dev); ASSERT_RTNL(); @@ -389,6 +391,9 @@ dev_index_hash(net, dev->ifindex)); write_unlock(&dev_base_lock); + netdev_for_each_altname(dev, name_node) + netdev_name_node_add(net, name_node); + dev_base_seq_inc(net); } @@ -397,8 +402,13 @@ */ static void unlist_netdevice(struct net_device *dev, bool lock) { + struct netdev_name_node *name_node; + ASSERT_RTNL(); + netdev_for_each_altname(dev, name_node) + netdev_name_node_del(name_node); + /* Unlink dev from the device chain */ if (lock) write_lock(&dev_base_lock); @@ -1078,7 +1088,8 @@ for_each_netdev(net, d) { struct netdev_name_node *name_node; - list_for_each_entry(name_node, &d->name_node->list, list) { + + netdev_for_each_altname(d, name_node) { if (!sscanf(name_node->name, name, &i)) continue; if (i < 0 || i >= max_netdevices) @@ -1115,6 +1126,26 @@ return -ENFILE; } +static int dev_prep_valid_name(struct net *net, struct net_device *dev, + const char *want_name, char *out_name) +{ + int ret; + + if (!dev_valid_name(want_name)) + return -EINVAL; + + if (strchr(want_name, '%')) { + ret = __dev_alloc_name(net, want_name, out_name); + return ret < 0 ? ret : 0; + } else if (netdev_name_in_use(net, want_name)) { + return -EEXIST; + } else if (out_name != want_name) { + strscpy(out_name, want_name, IFNAMSIZ); + } + + return 0; +} + static int dev_alloc_name_ns(struct net *net, struct net_device *dev, const char *name) @@ -1152,19 +1183,13 @@ static int dev_get_valid_name(struct net *net, struct net_device *dev, const char *name) { - BUG_ON(!net); - - if (!dev_valid_name(name)) - return -EINVAL; - - if (strchr(name, '%')) - return dev_alloc_name_ns(net, dev, name); - else if (netdev_name_in_use(net, name)) - return -EEXIST; - else if (dev->name != name) - strscpy(dev->name, name, IFNAMSIZ); + char buf[IFNAMSIZ]; + int ret; - return 0; + ret = dev_prep_valid_name(net, dev, name, buf); + if (ret >= 0) + strscpy(dev->name, buf, IFNAMSIZ); + return ret; } /** @@ -9939,6 +9964,54 @@ } EXPORT_SYMBOL(netif_tx_stop_all_queues); +static int netdev_do_alloc_pcpu_stats(struct net_device *dev) +{ + void __percpu *v; + + /* Drivers implementing ndo_get_peer_dev must support tstat + * accounting, so that skb_do_redirect() can bump the dev's + * RX stats upon network namespace switch. + */ + if (dev->netdev_ops->ndo_get_peer_dev && + dev->pcpu_stat_type != NETDEV_PCPU_STAT_TSTATS) + return -EOPNOTSUPP; + + switch (dev->pcpu_stat_type) { + case NETDEV_PCPU_STAT_NONE: + return 0; + case NETDEV_PCPU_STAT_LSTATS: + v = dev->lstats = netdev_alloc_pcpu_stats(struct pcpu_lstats); + break; + case NETDEV_PCPU_STAT_TSTATS: + v = dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); + break; + case NETDEV_PCPU_STAT_DSTATS: + v = dev->dstats = netdev_alloc_pcpu_stats(struct pcpu_dstats); + break; + default: + return -EINVAL; + } + + return v ? 0 : -ENOMEM; +} + +static void netdev_do_free_pcpu_stats(struct net_device *dev) +{ + switch (dev->pcpu_stat_type) { + case NETDEV_PCPU_STAT_NONE: + return; + case NETDEV_PCPU_STAT_LSTATS: + free_percpu(dev->lstats); + break; + case NETDEV_PCPU_STAT_TSTATS: + free_percpu(dev->tstats); + break; + case NETDEV_PCPU_STAT_DSTATS: + free_percpu(dev->dstats); + break; + } +} + /** * register_netdevice() - register a network device * @dev: device to register @@ -9999,11 +10072,15 @@ goto err_uninit; } + ret = netdev_do_alloc_pcpu_stats(dev); + if (ret) + goto err_uninit; + ret = -EBUSY; if (!dev->ifindex) dev->ifindex = dev_new_index(net); else if (__dev_get_by_index(net, dev->ifindex)) - goto err_uninit; + goto err_free_pcpu; /* Transfer changeable features to wanted_features and enable * software offloads (GSO and GRO). @@ -10106,6 +10183,8 @@ err_uninit_notify: call_netdevice_notifiers(NETDEV_PRE_UNINIT, dev); +err_free_pcpu: + netdev_do_free_pcpu_stats(dev); err_uninit: if (dev->netdev_ops->ndo_uninit) dev->netdev_ops->ndo_uninit(dev); @@ -10358,6 +10437,7 @@ WARN_ON(rcu_access_pointer(dev->ip_ptr)); WARN_ON(rcu_access_pointer(dev->ip6_ptr)); + netdev_do_free_pcpu_stats(dev); if (dev->priv_destructor) dev->priv_destructor(dev); if (dev->needs_free_netdev) @@ -10949,7 +11029,9 @@ int __dev_change_net_namespace(struct net_device *dev, struct net *net, const char *pat, int new_ifindex) { + struct netdev_name_node *name_node; struct net *net_old = dev_net(dev); + char new_name[IFNAMSIZ] = {}; int err, new_nsid; ASSERT_RTNL(); @@ -10976,10 +11058,15 @@ /* We get here if we can't use the current device name */ if (!pat) goto out; - err = dev_get_valid_name(net, dev, pat); + err = dev_prep_valid_name(net, dev, pat, new_name); if (err < 0) goto out; } + /* Check that none of the altnames conflicts. */ + err = -EEXIST; + netdev_for_each_altname(dev, name_node) + if (netdev_name_in_use(net, name_node->name)) + goto out; /* Check that new_ifindex isn't used yet. */ err = -EBUSY; @@ -11044,6 +11131,9 @@ kobject_uevent(&dev->dev.kobj, KOBJ_ADD); netdev_adjacent_add_links(dev); + if (new_name[0]) /* Rename the netdev to prepared name */ + strscpy(dev->name, new_name, IFNAMSIZ); + /* Fixup kobjects */ err = device_rename(&dev->dev, dev->name); WARN_ON(err); diff -u linux-aws-6.5-6.5.0/net/core/filter.c linux-aws-6.5-6.5.0/net/core/filter.c --- linux-aws-6.5-6.5.0/net/core/filter.c +++ linux-aws-6.5-6.5.0/net/core/filter.c @@ -2489,6 +2489,7 @@ net_eq(net, dev_net(dev)))) goto out_drop; skb->dev = dev; + dev_sw_netstats_rx_add(dev, skb->len); return -EAGAIN; } return flags & BPF_F_NEIGH ? @@ -2590,6 +2591,22 @@ return 0; } +static void sk_msg_reset_curr(struct sk_msg *msg) +{ + u32 i = msg->sg.start; + u32 len = 0; + + do { + len += sk_msg_elem(msg, i)->length; + sk_msg_iter_var_next(i); + if (len >= msg->sg.size) + break; + } while (i != msg->sg.end); + + msg->sg.curr = i; + msg->sg.copybreak = 0; +} + static const struct bpf_func_proto bpf_msg_cork_bytes_proto = { .func = bpf_msg_cork_bytes, .gpl_only = false, @@ -2709,6 +2726,7 @@ msg->sg.end - shift + NR_MSG_FRAG_IDS : msg->sg.end - shift; out: + sk_msg_reset_curr(msg); msg->data = sg_virt(&msg->sg.data[first_sge]) + start - offset; msg->data_end = msg->data + bytes; return 0; @@ -2845,6 +2863,7 @@ msg->sg.data[new] = rsge; } + sk_msg_reset_curr(msg); sk_msg_compute_data_pointers(msg); return 0; } @@ -3013,6 +3032,7 @@ sk_mem_uncharge(msg->sk, len - pop); msg->sg.size -= (len - pop); + sk_msg_reset_curr(msg); sk_msg_compute_data_pointers(msg); return 0; } diff -u linux-aws-6.5-6.5.0/net/core/neighbour.c linux-aws-6.5-6.5.0/net/core/neighbour.c --- linux-aws-6.5-6.5.0/net/core/neighbour.c +++ linux-aws-6.5-6.5.0/net/core/neighbour.c @@ -251,7 +251,8 @@ static int neigh_forced_gc(struct neigh_table *tbl) { - int max_clean = atomic_read(&tbl->gc_entries) - tbl->gc_thresh2; + int max_clean = atomic_read(&tbl->gc_entries) - + READ_ONCE(tbl->gc_thresh2); unsigned long tref = jiffies - 5 * HZ; struct neighbour *n, *tmp; int shrunk = 0; @@ -280,7 +281,7 @@ } } - tbl->last_flush = jiffies; + WRITE_ONCE(tbl->last_flush, jiffies); write_unlock_bh(&tbl->lock); @@ -464,17 +465,17 @@ { struct neighbour *n = NULL; unsigned long now = jiffies; - int entries; + int entries, gc_thresh3; if (exempt_from_gc) goto do_alloc; entries = atomic_inc_return(&tbl->gc_entries) - 1; - if (entries >= tbl->gc_thresh3 || - (entries >= tbl->gc_thresh2 && - time_after(now, tbl->last_flush + 5 * HZ))) { - if (!neigh_forced_gc(tbl) && - entries >= tbl->gc_thresh3) { + gc_thresh3 = READ_ONCE(tbl->gc_thresh3); + if (entries >= gc_thresh3 || + (entries >= READ_ONCE(tbl->gc_thresh2) && + time_after(now, READ_ONCE(tbl->last_flush) + 5 * HZ))) { + if (!neigh_forced_gc(tbl) && entries >= gc_thresh3) { net_info_ratelimited("%s: neighbor table overflow!\n", tbl->id); NEIGH_CACHE_STAT_INC(tbl, table_fulls); @@ -955,13 +956,14 @@ if (time_after(jiffies, tbl->last_rand + 300 * HZ)) { struct neigh_parms *p; - tbl->last_rand = jiffies; + + WRITE_ONCE(tbl->last_rand, jiffies); list_for_each_entry(p, &tbl->parms_list, list) p->reachable_time = neigh_rand_reach_time(NEIGH_VAR(p, BASE_REACHABLE_TIME)); } - if (atomic_read(&tbl->entries) < tbl->gc_thresh1) + if (atomic_read(&tbl->entries) < READ_ONCE(tbl->gc_thresh1)) goto out; for (i = 0 ; i < (1 << nht->hash_shift); i++) { @@ -2167,15 +2169,16 @@ ndtmsg->ndtm_pad2 = 0; if (nla_put_string(skb, NDTA_NAME, tbl->id) || - nla_put_msecs(skb, NDTA_GC_INTERVAL, tbl->gc_interval, NDTA_PAD) || - nla_put_u32(skb, NDTA_THRESH1, tbl->gc_thresh1) || - nla_put_u32(skb, NDTA_THRESH2, tbl->gc_thresh2) || - nla_put_u32(skb, NDTA_THRESH3, tbl->gc_thresh3)) + nla_put_msecs(skb, NDTA_GC_INTERVAL, READ_ONCE(tbl->gc_interval), + NDTA_PAD) || + nla_put_u32(skb, NDTA_THRESH1, READ_ONCE(tbl->gc_thresh1)) || + nla_put_u32(skb, NDTA_THRESH2, READ_ONCE(tbl->gc_thresh2)) || + nla_put_u32(skb, NDTA_THRESH3, READ_ONCE(tbl->gc_thresh3))) goto nla_put_failure; { unsigned long now = jiffies; - long flush_delta = now - tbl->last_flush; - long rand_delta = now - tbl->last_rand; + long flush_delta = now - READ_ONCE(tbl->last_flush); + long rand_delta = now - READ_ONCE(tbl->last_rand); struct neigh_hash_table *nht; struct ndt_config ndc = { .ndtc_key_len = tbl->key_len, @@ -2183,7 +2186,7 @@ .ndtc_entries = atomic_read(&tbl->entries), .ndtc_last_flush = jiffies_to_msecs(flush_delta), .ndtc_last_rand = jiffies_to_msecs(rand_delta), - .ndtc_proxy_qlen = tbl->proxy_queue.qlen, + .ndtc_proxy_qlen = READ_ONCE(tbl->proxy_queue.qlen), }; rcu_read_lock(); @@ -2206,17 +2209,17 @@ struct neigh_statistics *st; st = per_cpu_ptr(tbl->stats, cpu); - ndst.ndts_allocs += st->allocs; - ndst.ndts_destroys += st->destroys; - ndst.ndts_hash_grows += st->hash_grows; - ndst.ndts_res_failed += st->res_failed; - ndst.ndts_lookups += st->lookups; - ndst.ndts_hits += st->hits; - ndst.ndts_rcv_probes_mcast += st->rcv_probes_mcast; - ndst.ndts_rcv_probes_ucast += st->rcv_probes_ucast; - ndst.ndts_periodic_gc_runs += st->periodic_gc_runs; - ndst.ndts_forced_gc_runs += st->forced_gc_runs; - ndst.ndts_table_fulls += st->table_fulls; + ndst.ndts_allocs += READ_ONCE(st->allocs); + ndst.ndts_destroys += READ_ONCE(st->destroys); + ndst.ndts_hash_grows += READ_ONCE(st->hash_grows); + ndst.ndts_res_failed += READ_ONCE(st->res_failed); + ndst.ndts_lookups += READ_ONCE(st->lookups); + ndst.ndts_hits += READ_ONCE(st->hits); + ndst.ndts_rcv_probes_mcast += READ_ONCE(st->rcv_probes_mcast); + ndst.ndts_rcv_probes_ucast += READ_ONCE(st->rcv_probes_ucast); + ndst.ndts_periodic_gc_runs += READ_ONCE(st->periodic_gc_runs); + ndst.ndts_forced_gc_runs += READ_ONCE(st->forced_gc_runs); + ndst.ndts_table_fulls += READ_ONCE(st->table_fulls); } if (nla_put_64bit(skb, NDTA_STATS, sizeof(ndst), &ndst, @@ -2445,16 +2448,16 @@ goto errout_tbl_lock; if (tb[NDTA_THRESH1]) - tbl->gc_thresh1 = nla_get_u32(tb[NDTA_THRESH1]); + WRITE_ONCE(tbl->gc_thresh1, nla_get_u32(tb[NDTA_THRESH1])); if (tb[NDTA_THRESH2]) - tbl->gc_thresh2 = nla_get_u32(tb[NDTA_THRESH2]); + WRITE_ONCE(tbl->gc_thresh2, nla_get_u32(tb[NDTA_THRESH2])); if (tb[NDTA_THRESH3]) - tbl->gc_thresh3 = nla_get_u32(tb[NDTA_THRESH3]); + WRITE_ONCE(tbl->gc_thresh3, nla_get_u32(tb[NDTA_THRESH3])); if (tb[NDTA_GC_INTERVAL]) - tbl->gc_interval = nla_get_msecs(tb[NDTA_GC_INTERVAL]); + WRITE_ONCE(tbl->gc_interval, nla_get_msecs(tb[NDTA_GC_INTERVAL])); err = 0; diff -u linux-aws-6.5-6.5.0/net/core/skbuff.c linux-aws-6.5-6.5.0/net/core/skbuff.c --- linux-aws-6.5-6.5.0/net/core/skbuff.c +++ linux-aws-6.5-6.5.0/net/core/skbuff.c @@ -4185,6 +4185,7 @@ unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, unsigned int to, struct ts_config *config) { + unsigned int patlen = config->ops->get_pattern_len(config); struct ts_state state; unsigned int ret; @@ -4196,7 +4197,7 @@ skb_prepare_seq_read(skb, from, to, TS_SKB_CB(&state)); ret = textsearch_find(config, &state); - return (ret <= to - from ? ret : UINT_MAX); + return (ret + patlen <= to - from ? ret : UINT_MAX); } EXPORT_SYMBOL(skb_find_text); diff -u linux-aws-6.5-6.5.0/net/core/skmsg.c linux-aws-6.5-6.5.0/net/core/skmsg.c --- linux-aws-6.5-6.5.0/net/core/skmsg.c +++ linux-aws-6.5-6.5.0/net/core/skmsg.c @@ -826,6 +826,8 @@ if (psock->sk_redir) sock_put(psock->sk_redir); + if (psock->sk_pair) + sock_put(psock->sk_pair); sock_put(psock->sk); kfree(psock); } diff -u linux-aws-6.5-6.5.0/net/core/sock.c linux-aws-6.5-6.5.0/net/core/sock.c --- linux-aws-6.5-6.5.0/net/core/sock.c +++ linux-aws-6.5-6.5.0/net/core/sock.c @@ -600,7 +600,7 @@ INDIRECT_CALL_INET(dst->ops->check, ip6_dst_check, ipv4_dst_check, dst, cookie) == NULL) { sk_tx_queue_clear(sk); - sk->sk_dst_pending_confirm = 0; + WRITE_ONCE(sk->sk_dst_pending_confirm, 0); RCU_INIT_POINTER(sk->sk_dst_cache, NULL); dst_release(dst); return NULL; diff -u linux-aws-6.5-6.5.0/net/dccp/ipv4.c linux-aws-6.5-6.5.0/net/dccp/ipv4.c --- linux-aws-6.5-6.5.0/net/dccp/ipv4.c +++ linux-aws-6.5-6.5.0/net/dccp/ipv4.c @@ -630,9 +630,6 @@ if (dccp_parse_options(sk, dreq, skb)) goto drop_and_free; - if (security_inet_conn_request(sk, skb, req)) - goto drop_and_free; - ireq = inet_rsk(req); sk_rcv_saddr_set(req_to_sk(req), ip_hdr(skb)->daddr); sk_daddr_set(req_to_sk(req), ip_hdr(skb)->saddr); @@ -640,6 +637,9 @@ ireq->ireq_family = AF_INET; ireq->ir_iif = READ_ONCE(sk->sk_bound_dev_if); + if (security_inet_conn_request(sk, skb, req)) + goto drop_and_free; + /* * Step 3: Process LISTEN state * diff -u linux-aws-6.5-6.5.0/net/dccp/ipv6.c linux-aws-6.5-6.5.0/net/dccp/ipv6.c --- linux-aws-6.5-6.5.0/net/dccp/ipv6.c +++ linux-aws-6.5-6.5.0/net/dccp/ipv6.c @@ -360,15 +360,15 @@ if (dccp_parse_options(sk, dreq, skb)) goto drop_and_free; - if (security_inet_conn_request(sk, skb, req)) - goto drop_and_free; - ireq = inet_rsk(req); ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr; ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr; ireq->ireq_family = AF_INET6; ireq->ir_mark = inet_request_mark(sk, skb); + if (security_inet_conn_request(sk, skb, req)) + goto drop_and_free; + if (ipv6_opt_accepted(sk, skb, IP6CB(skb)) || np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) { diff -u linux-aws-6.5-6.5.0/net/handshake/netlink.c linux-aws-6.5-6.5.0/net/handshake/netlink.c --- linux-aws-6.5-6.5.0/net/handshake/netlink.c +++ linux-aws-6.5-6.5.0/net/handshake/netlink.c @@ -87,29 +87,6 @@ } EXPORT_SYMBOL(handshake_genl_put); -/* - * dup() a kernel socket for use as a user space file descriptor - * in the current process. The kernel socket must have an - * instatiated struct file. - * - * Implicit argument: "current()" - */ -static int handshake_dup(struct socket *sock) -{ - struct file *file; - int newfd; - - file = get_file(sock->file); - newfd = get_unused_fd_flags(O_CLOEXEC); - if (newfd < 0) { - fput(file); - return newfd; - } - - fd_install(newfd, file); - return newfd; -} - int handshake_nl_accept_doit(struct sk_buff *skb, struct genl_info *info) { struct net *net = sock_net(skb->sk); @@ -133,17 +110,20 @@ goto out_status; sock = req->hr_sk->sk_socket; - fd = handshake_dup(sock); + fd = get_unused_fd_flags(O_CLOEXEC); if (fd < 0) { err = fd; goto out_complete; } + err = req->hr_proto->hp_accept(req, info, fd); if (err) { - fput(sock->file); + put_unused_fd(fd); goto out_complete; } + fd_install(fd, get_file(sock->file)); + trace_handshake_cmd_accept(net, req, req->hr_sk, fd); return 0; diff -u linux-aws-6.5-6.5.0/net/hsr/hsr_forward.c linux-aws-6.5-6.5.0/net/hsr/hsr_forward.c --- linux-aws-6.5-6.5.0/net/hsr/hsr_forward.c +++ linux-aws-6.5-6.5.0/net/hsr/hsr_forward.c @@ -342,9 +342,7 @@ skb = skb_copy_expand(frame->skb_std, 0, skb_tailroom(frame->skb_std) + HSR_HLEN, GFP_ATOMIC); - prp_fill_rct(skb, frame, port); - - return skb; + return prp_fill_rct(skb, frame, port); } static void hsr_deliver_master(struct sk_buff *skb, struct net_device *dev, diff -u linux-aws-6.5-6.5.0/net/ipv4/fib_semantics.c linux-aws-6.5-6.5.0/net/ipv4/fib_semantics.c --- linux-aws-6.5-6.5.0/net/ipv4/fib_semantics.c +++ linux-aws-6.5-6.5.0/net/ipv4/fib_semantics.c @@ -1325,15 +1325,18 @@ unsigned char scope) { struct fib_nh *nh; + __be32 saddr; if (nhc->nhc_family != AF_INET) return inet_select_addr(nhc->nhc_dev, 0, scope); nh = container_of(nhc, struct fib_nh, nh_common); - nh->nh_saddr = inet_select_addr(nh->fib_nh_dev, nh->fib_nh_gw4, scope); - nh->nh_saddr_genid = atomic_read(&net->ipv4.dev_addr_genid); + saddr = inet_select_addr(nh->fib_nh_dev, nh->fib_nh_gw4, scope); - return nh->nh_saddr; + WRITE_ONCE(nh->nh_saddr, saddr); + WRITE_ONCE(nh->nh_saddr_genid, atomic_read(&net->ipv4.dev_addr_genid)); + + return saddr; } __be32 fib_result_prefsrc(struct net *net, struct fib_result *res) @@ -1347,8 +1350,9 @@ struct fib_nh *nh; nh = container_of(nhc, struct fib_nh, nh_common); - if (nh->nh_saddr_genid == atomic_read(&net->ipv4.dev_addr_genid)) - return nh->nh_saddr; + if (READ_ONCE(nh->nh_saddr_genid) == + atomic_read(&net->ipv4.dev_addr_genid)) + return READ_ONCE(nh->nh_saddr); } return fib_info_update_nhc_saddr(net, nhc, res->fi->fib_scope); @@ -1887,6 +1891,7 @@ continue; if (fi->fib_prefsrc == local) { fi->fib_flags |= RTNH_F_DEAD; + fi->pfsrc_removed = true; ret++; } } diff -u linux-aws-6.5-6.5.0/net/ipv4/fib_trie.c linux-aws-6.5-6.5.0/net/ipv4/fib_trie.c --- linux-aws-6.5-6.5.0/net/ipv4/fib_trie.c +++ linux-aws-6.5-6.5.0/net/ipv4/fib_trie.c @@ -2027,6 +2027,7 @@ int fib_table_flush(struct net *net, struct fib_table *tb, bool flush_all) { struct trie *t = (struct trie *)tb->tb_data; + struct nl_info info = { .nl_net = net }; struct key_vector *pn = t->kv; unsigned long cindex = 1; struct hlist_node *tmp; @@ -2089,6 +2090,9 @@ fib_notify_alias_delete(net, n->key, &n->leaf, fa, NULL); + if (fi->pfsrc_removed) + rtmsg_fib(RTM_DELROUTE, htonl(n->key), fa, + KEYLENGTH - fa->fa_slen, tb->tb_id, &info, 0); hlist_del_rcu(&fa->fa_list); fib_release_info(fa->fa_info); alias_free_mem_rcu(fa); diff -u linux-aws-6.5-6.5.0/net/ipv4/inet_hashtables.c linux-aws-6.5-6.5.0/net/ipv4/inet_hashtables.c --- linux-aws-6.5-6.5.0/net/ipv4/inet_hashtables.c +++ linux-aws-6.5-6.5.0/net/ipv4/inet_hashtables.c @@ -148,8 +148,14 @@ const struct sock *sk) { #if IS_ENABLED(CONFIG_IPV6) - if (sk->sk_family != tb2->family) - return false; + if (sk->sk_family != tb2->family) { + if (sk->sk_family == AF_INET) + return ipv6_addr_v4mapped(&tb2->v6_rcv_saddr) && + tb2->v6_rcv_saddr.s6_addr32[3] == sk->sk_rcv_saddr; + + return ipv6_addr_v4mapped(&sk->sk_v6_rcv_saddr) && + sk->sk_v6_rcv_saddr.s6_addr32[3] == tb2->rcv_saddr; + } if (sk->sk_family == AF_INET6) return ipv6_addr_equal(&tb2->v6_rcv_saddr, @@ -725,12 +731,12 @@ if (err) goto unlock; } + sock_set_flag(sk, SOCK_RCU_FREE); if (IS_ENABLED(CONFIG_IPV6) && sk->sk_reuseport && sk->sk_family == AF_INET6) __sk_nulls_add_node_tail_rcu(sk, &ilb2->nulls_head); else __sk_nulls_add_node_rcu(sk, &ilb2->nulls_head); - sock_set_flag(sk, SOCK_RCU_FREE); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); unlock: spin_unlock(&ilb2->lock); @@ -799,19 +805,7 @@ tb->l3mdev != l3mdev) return false; -#if IS_ENABLED(CONFIG_IPV6) - if (sk->sk_family != tb->family) { - if (sk->sk_family == AF_INET) - return ipv6_addr_v4mapped(&tb->v6_rcv_saddr) && - tb->v6_rcv_saddr.s6_addr32[3] == sk->sk_rcv_saddr; - - return false; - } - - if (sk->sk_family == AF_INET6) - return ipv6_addr_equal(&tb->v6_rcv_saddr, &sk->sk_v6_rcv_saddr); -#endif - return tb->rcv_saddr == sk->sk_rcv_saddr; + return inet_bind2_bucket_addr_match(tb, sk); } bool inet_bind2_bucket_match_addr_any(const struct inet_bind2_bucket *tb, const struct net *net, diff -u linux-aws-6.5-6.5.0/net/ipv4/route.c linux-aws-6.5-6.5.0/net/ipv4/route.c --- linux-aws-6.5-6.5.0/net/ipv4/route.c +++ linux-aws-6.5-6.5.0/net/ipv4/route.c @@ -780,7 +780,7 @@ goto reject_redirect; } - n = __ipv4_neigh_lookup(rt->dst.dev, new_gw); + n = __ipv4_neigh_lookup(rt->dst.dev, (__force u32)new_gw); if (!n) n = neigh_create(&arp_tbl, &new_gw, rt->dst.dev); if (!IS_ERR(n)) { diff -u linux-aws-6.5-6.5.0/net/ipv4/tcp.c linux-aws-6.5-6.5.0/net/ipv4/tcp.c --- linux-aws-6.5-6.5.0/net/ipv4/tcp.c +++ linux-aws-6.5-6.5.0/net/ipv4/tcp.c @@ -829,7 +829,9 @@ */ if (!skb_queue_empty(&sk->sk_receive_queue)) break; - sk_wait_data(sk, &timeo, NULL); + ret = sk_wait_data(sk, &timeo, NULL); + if (ret < 0) + break; if (signal_pending(current)) { ret = sock_intr_errno(timeo); break; @@ -923,10 +925,11 @@ return mss_now; } -/* In some cases, both sendmsg() could have added an skb to the write queue, - * but failed adding payload on it. We need to remove it to consume less +/* In some cases, sendmsg() could have added an skb to the write queue, + * but failed adding payload on it. We need to remove it to consume less * memory, but more importantly be able to generate EPOLLOUT for Edge Trigger - * epoll() users. + * epoll() users. Another reason is that tcp_write_xmit() does not like + * finding an empty skb in the write queue. */ void tcp_remove_empty_skb(struct sock *sk) { @@ -1284,6 +1287,7 @@ wait_for_space: set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); + tcp_remove_empty_skb(sk); if (copied) tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH, size_goal); @@ -2442,7 +2446,11 @@ __sk_flush_backlog(sk); } else { tcp_cleanup_rbuf(sk, copied); - sk_wait_data(sk, &timeo, last); + err = sk_wait_data(sk, &timeo, last); + if (err < 0) { + err = copied ? : err; + goto out; + } } if ((flags & MSG_PEEK) && @@ -2966,12 +2974,6 @@ int old_state = sk->sk_state; u32 seq; - /* Deny disconnect if other threads are blocked in sk_wait_event() - * or inet_wait_for_connect(). - */ - if (sk->sk_wait_pending) - return -EBUSY; - if (old_state != TCP_CLOSE) tcp_set_state(sk, TCP_CLOSE); @@ -3367,9 +3369,25 @@ return -EINVAL; tp->window_clamp = 0; } else { - tp->window_clamp = val < SOCK_MIN_RCVBUF / 2 ? - SOCK_MIN_RCVBUF / 2 : val; - tp->rcv_ssthresh = min(tp->rcv_wnd, tp->window_clamp); + u32 new_rcv_ssthresh, old_window_clamp = tp->window_clamp; + u32 new_window_clamp = val < SOCK_MIN_RCVBUF / 2 ? + SOCK_MIN_RCVBUF / 2 : val; + + if (new_window_clamp == old_window_clamp) + return 0; + + tp->window_clamp = new_window_clamp; + if (new_window_clamp < old_window_clamp) { + /* need to apply the reserved mem provisioning only + * when shrinking the window clamp + */ + __tcp_adjust_rcv_ssthresh(sk, tp->window_clamp); + + } else { + new_rcv_ssthresh = min(tp->rcv_wnd, tp->window_clamp); + tp->rcv_ssthresh = max(new_rcv_ssthresh, + tp->rcv_ssthresh); + } } return 0; } diff -u linux-aws-6.5-6.5.0/net/ipv4/tcp_bpf.c linux-aws-6.5-6.5.0/net/ipv4/tcp_bpf.c --- linux-aws-6.5-6.5.0/net/ipv4/tcp_bpf.c +++ linux-aws-6.5-6.5.0/net/ipv4/tcp_bpf.c @@ -307,6 +307,10 @@ } data = tcp_msg_wait_data(sk, psock, timeo); + if (data < 0) { + copied = data; + goto unlock; + } if (data && !sk_psock_queue_empty(psock)) goto msg_bytes_ready; copied = -EAGAIN; @@ -317,6 +321,8 @@ tcp_rcv_space_adjust(sk); if (copied > 0) __tcp_cleanup_rbuf(sk, copied); + +unlock: release_sock(sk); sk_psock_put(sk, psock); return copied; @@ -351,6 +357,10 @@ timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT); data = tcp_msg_wait_data(sk, psock, timeo); + if (data < 0) { + ret = data; + goto unlock; + } if (data) { if (!sk_psock_queue_empty(psock)) goto msg_bytes_ready; @@ -361,6 +371,8 @@ copied = -EAGAIN; } ret = copied; + +unlock: release_sock(sk); sk_psock_put(sk, psock); return ret; diff -u linux-aws-6.5-6.5.0/net/ipv4/tcp_input.c linux-aws-6.5-6.5.0/net/ipv4/tcp_input.c --- linux-aws-6.5-6.5.0/net/ipv4/tcp_input.c +++ linux-aws-6.5-6.5.0/net/ipv4/tcp_input.c @@ -2202,16 +2202,17 @@ * restore sanity to the SACK scoreboard. If the apparent reneging * persists until this RTO then we'll clear the SACK scoreboard. */ -static bool tcp_check_sack_reneging(struct sock *sk, int flag) +static bool tcp_check_sack_reneging(struct sock *sk, int *ack_flag) { - if (flag & FLAG_SACK_RENEGING && - flag & FLAG_SND_UNA_ADVANCED) { + if (*ack_flag & FLAG_SACK_RENEGING && + *ack_flag & FLAG_SND_UNA_ADVANCED) { struct tcp_sock *tp = tcp_sk(sk); unsigned long delay = max(usecs_to_jiffies(tp->srtt_us >> 4), msecs_to_jiffies(10)); inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, delay, TCP_RTO_MAX); + *ack_flag &= ~FLAG_SET_XMIT_TIMER; return true; } return false; @@ -2981,7 +2982,7 @@ tp->prior_ssthresh = 0; /* B. In all the states check for reneging SACKs. */ - if (tcp_check_sack_reneging(sk, flag)) + if (tcp_check_sack_reneging(sk, ack_flag)) return; /* C. Check consistency of the current state. */ @@ -3803,8 +3804,12 @@ * then we can probably ignore it. */ if (before(ack, prior_snd_una)) { + u32 max_window; + + /* do not accept ACK for bytes we never sent. */ + max_window = min_t(u64, tp->max_window, tp->bytes_acked); /* RFC 5961 5.2 [Blind Data Injection Attack].[Mitigation] */ - if (before(ack, prior_snd_una - tp->max_window)) { + if (before(ack, prior_snd_una - max_window)) { if (!(flag & FLAG_NO_CHALLENGE_ACK)) tcp_send_challenge_ack(sk); return -SKB_DROP_REASON_TCP_TOO_OLD_ACK; @@ -6433,22 +6438,23 @@ static void tcp_rcv_synrecv_state_fastopen(struct sock *sk) { + struct tcp_sock *tp = tcp_sk(sk); struct request_sock *req; /* If we are still handling the SYNACK RTO, see if timestamp ECR allows * undo. If peer SACKs triggered fast recovery, we can't undo here. */ - if (inet_csk(sk)->icsk_ca_state == TCP_CA_Loss) - tcp_try_undo_loss(sk, false); + if (inet_csk(sk)->icsk_ca_state == TCP_CA_Loss && !tp->packets_out) + tcp_try_undo_recovery(sk); /* Reset rtx states to prevent spurious retransmits_timed_out() */ - tcp_sk(sk)->retrans_stamp = 0; + tp->retrans_stamp = 0; inet_csk(sk)->icsk_retransmits = 0; /* Once we leave TCP_SYN_RECV or TCP_FIN_WAIT_1, * we no longer need req so release it. */ - req = rcu_dereference_protected(tcp_sk(sk)->fastopen_rsk, + req = rcu_dereference_protected(tp->fastopen_rsk, lockdep_sock_is_held(sk)); reqsk_fastopen_remove(sk, req, false); diff -u linux-aws-6.5-6.5.0/net/ipv4/tcp_output.c linux-aws-6.5-6.5.0/net/ipv4/tcp_output.c --- linux-aws-6.5-6.5.0/net/ipv4/tcp_output.c +++ linux-aws-6.5-6.5.0/net/ipv4/tcp_output.c @@ -1316,7 +1316,7 @@ skb->destructor = skb_is_tcp_pure_ack(skb) ? __sock_wfree : tcp_wfree; refcount_add(skb->truesize, &sk->sk_wmem_alloc); - skb_set_dst_pending_confirm(skb, sk->sk_dst_pending_confirm); + skb_set_dst_pending_confirm(skb, READ_ONCE(sk->sk_dst_pending_confirm)); /* Build TCP header and checksum it. */ th = (struct tcphdr *)skb->data; @@ -2527,6 +2527,18 @@ return true; } +static bool tcp_rtx_queue_empty_or_single_skb(const struct sock *sk) +{ + const struct rb_node *node = sk->tcp_rtx_queue.rb_node; + + /* No skb in the rtx queue. */ + if (!node) + return true; + + /* Only one skb in rtx queue. */ + return !node->rb_left && !node->rb_right; +} + /* TCP Small Queues : * Control number of packets in qdisc/devices to two packets / or ~1 ms. * (These limits are doubled for retransmits) @@ -2564,12 +2576,12 @@ limit += extra_bytes; } if (refcount_read(&sk->sk_wmem_alloc) > limit) { - /* Always send skb if rtx queue is empty. + /* Always send skb if rtx queue is empty or has one skb. * No need to wait for TX completion to call us back, * after softirq/tasklet schedule. * This helps when TX completions are delayed too much. */ - if (tcp_rtx_queue_empty(sk)) + if (tcp_rtx_queue_empty_or_single_skb(sk)) return false; set_bit(TSQ_THROTTLED, &sk->sk_tsq_flags); @@ -2773,7 +2785,7 @@ { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); - u32 timeout, rto_delta_us; + u32 timeout, timeout_us, rto_delta_us; int early_retrans; /* Don't do any loss probe on a Fast Open connection before 3WHS @@ -2797,11 +2809,12 @@ * sample is available then probe after TCP_TIMEOUT_INIT. */ if (tp->srtt_us) { - timeout = usecs_to_jiffies(tp->srtt_us >> 2); + timeout_us = tp->srtt_us >> 2; if (tp->packets_out == 1) - timeout += TCP_RTO_MIN; + timeout_us += tcp_rto_min_us(sk); else - timeout += TCP_TIMEOUT_MIN; + timeout_us += TCP_TIMEOUT_MIN_US; + timeout = usecs_to_jiffies(timeout_us); } else { timeout = TCP_TIMEOUT_INIT; } diff -u linux-aws-6.5-6.5.0/net/ipv4/udp.c linux-aws-6.5-6.5.0/net/ipv4/udp.c --- linux-aws-6.5-6.5.0/net/ipv4/udp.c +++ linux-aws-6.5-6.5.0/net/ipv4/udp.c @@ -744,7 +744,7 @@ iph->saddr, uh->source, skb->dev->ifindex, inet_sdif(skb), udptable, NULL); - if (!sk || udp_sk(sk)->encap_type) { + if (!sk || READ_ONCE(udp_sk(sk)->encap_type)) { /* No socket for error: try tunnels before discarding */ if (static_branch_unlikely(&udp_encap_needed_key)) { sk = __udp4_lib_err_encap(net, iph, uh, udptable, sk, skb, @@ -1080,7 +1080,7 @@ u8 tos, scope; __be16 dport; int err, is_udplite = IS_UDPLITE(sk); - int corkreq = READ_ONCE(up->corkflag) || msg->msg_flags&MSG_MORE; + int corkreq = udp_test_bit(CORK, sk) || msg->msg_flags & MSG_MORE; int (*getfrag)(void *, char *, int, int, int, struct sk_buff *); struct sk_buff *skb; struct ip_options_data opt_copy; @@ -1344,11 +1344,11 @@ struct sock *sk = sock->sk; struct udp_sock *up = udp_sk(sk); - if (!up->pending || READ_ONCE(up->corkflag)) + if (!up->pending || udp_test_bit(CORK, sk)) return; lock_sock(sk); - if (up->pending && !READ_ONCE(up->corkflag)) + if (up->pending && !udp_test_bit(CORK, sk)) udp_push_pending_frames(sk); release_sock(sk); } @@ -1897,7 +1897,7 @@ (struct sockaddr *)sin); } - if (udp_sk(sk)->gro_enabled) + if (udp_test_bit(GRO_ENABLED, sk)) udp_cmsg_recv(msg, sk, skb); if (inet->cmsg_flags) @@ -2110,7 +2110,8 @@ } nf_reset_ct(skb); - if (static_branch_unlikely(&udp_encap_needed_key) && up->encap_type) { + if (static_branch_unlikely(&udp_encap_needed_key) && + READ_ONCE(up->encap_type)) { int (*encap_rcv)(struct sock *sk, struct sk_buff *skb); /* @@ -2148,7 +2149,8 @@ /* * UDP-Lite specific tests, ignored on UDP sockets */ - if ((up->pcflag & UDPLITE_RECV_CC) && UDP_SKB_CB(skb)->partial_cov) { + if (udp_test_bit(UDPLITE_RECV_CC, sk) && UDP_SKB_CB(skb)->partial_cov) { + u16 pcrlen = READ_ONCE(up->pcrlen); /* * MIB statistics other than incrementing the error count are @@ -2161,7 +2163,7 @@ * delivery of packets with coverage values less than a value * provided by the application." */ - if (up->pcrlen == 0) { /* full coverage was set */ + if (pcrlen == 0) { /* full coverage was set */ net_dbg_ratelimited("UDPLite: partial coverage %d while full coverage %d requested\n", UDP_SKB_CB(skb)->cscov, skb->len); goto drop; @@ -2172,9 +2174,9 @@ * that it wants x while sender emits packets of smaller size y. * Therefore the above ...()->partial_cov statement is essential. */ - if (UDP_SKB_CB(skb)->cscov < up->pcrlen) { + if (UDP_SKB_CB(skb)->cscov < pcrlen) { net_dbg_ratelimited("UDPLite: coverage %d too small, need min %d\n", - UDP_SKB_CB(skb)->cscov, up->pcrlen); + UDP_SKB_CB(skb)->cscov, pcrlen); goto drop; } } @@ -2643,7 +2645,7 @@ if (encap_destroy) encap_destroy(sk); } - if (up->encap_enabled) + if (udp_test_bit(ENCAP_ENABLED, sk)) static_branch_dec(&udp_encap_needed_key); } } @@ -2683,9 +2685,9 @@ switch (optname) { case UDP_CORK: if (val != 0) { - WRITE_ONCE(up->corkflag, 1); + udp_set_bit(CORK, sk); } else { - WRITE_ONCE(up->corkflag, 0); + udp_clear_bit(CORK, sk); lock_sock(sk); push_pending_frames(sk); release_sock(sk); @@ -2700,17 +2702,17 @@ case UDP_ENCAP_ESPINUDP_NON_IKE: #if IS_ENABLED(CONFIG_IPV6) if (sk->sk_family == AF_INET6) - up->encap_rcv = ipv6_stub->xfrm6_udp_encap_rcv; + WRITE_ONCE(up->encap_rcv, + ipv6_stub->xfrm6_udp_encap_rcv); else #endif - up->encap_rcv = xfrm4_udp_encap_rcv; + WRITE_ONCE(up->encap_rcv, + xfrm4_udp_encap_rcv); #endif fallthrough; case UDP_ENCAP_L2TPINUDP: - up->encap_type = val; - lock_sock(sk); - udp_tunnel_encap_enable(sk->sk_socket); - release_sock(sk); + WRITE_ONCE(up->encap_type, val); + udp_tunnel_encap_enable(sk); break; default: err = -ENOPROTOOPT; @@ -2719,11 +2721,11 @@ break; case UDP_NO_CHECK6_TX: - up->no_check6_tx = valbool; + udp_set_no_check6_tx(sk, valbool); break; case UDP_NO_CHECK6_RX: - up->no_check6_rx = valbool; + udp_set_no_check6_rx(sk, valbool); break; case UDP_SEGMENT: @@ -2733,14 +2735,12 @@ break; case UDP_GRO: - lock_sock(sk); /* when enabling GRO, accept the related GSO packet type */ if (valbool) - udp_tunnel_encap_enable(sk->sk_socket); - up->gro_enabled = valbool; - up->accept_udp_l4 = valbool; - release_sock(sk); + udp_tunnel_encap_enable(sk); + udp_assign_bit(GRO_ENABLED, sk, valbool); + udp_assign_bit(ACCEPT_L4, sk, valbool); break; /* @@ -2755,8 +2755,8 @@ val = 8; else if (val > USHRT_MAX) val = USHRT_MAX; - up->pcslen = val; - up->pcflag |= UDPLITE_SEND_CC; + WRITE_ONCE(up->pcslen, val); + udp_set_bit(UDPLITE_SEND_CC, sk); break; /* The receiver specifies a minimum checksum coverage value. To make @@ -2769,8 +2769,8 @@ val = 8; else if (val > USHRT_MAX) val = USHRT_MAX; - up->pcrlen = val; - up->pcflag |= UDPLITE_RECV_CC; + WRITE_ONCE(up->pcrlen, val); + udp_set_bit(UDPLITE_RECV_CC, sk); break; default: @@ -2808,19 +2808,19 @@ switch (optname) { case UDP_CORK: - val = READ_ONCE(up->corkflag); + val = udp_test_bit(CORK, sk); break; case UDP_ENCAP: - val = up->encap_type; + val = READ_ONCE(up->encap_type); break; case UDP_NO_CHECK6_TX: - val = up->no_check6_tx; + val = udp_get_no_check6_tx(sk); break; case UDP_NO_CHECK6_RX: - val = up->no_check6_rx; + val = udp_get_no_check6_rx(sk); break; case UDP_SEGMENT: @@ -2828,17 +2828,17 @@ break; case UDP_GRO: - val = up->gro_enabled; + val = udp_test_bit(GRO_ENABLED, sk); break; /* The following two cannot be changed on UDP sockets, the return is * always 0 (which corresponds to the full checksum coverage of UDP). */ case UDPLITE_SEND_CSCOV: - val = up->pcslen; + val = READ_ONCE(up->pcslen); break; case UDPLITE_RECV_CSCOV: - val = up->pcrlen; + val = READ_ONCE(up->pcrlen); break; default: diff -u linux-aws-6.5-6.5.0/net/ipv6/ip6_output.c linux-aws-6.5-6.5.0/net/ipv6/ip6_output.c --- linux-aws-6.5-6.5.0/net/ipv6/ip6_output.c +++ linux-aws-6.5-6.5.0/net/ipv6/ip6_output.c @@ -162,7 +162,13 @@ int err; skb_mark_not_on_list(segs); - err = ip6_fragment(net, sk, segs, ip6_finish_output2); + /* Last GSO segment can be smaller than gso_size (and MTU). + * Adding a fragment header would produce an "atomic fragment", + * which is considered harmful (RFC-8021). Avoid that. + */ + err = segs->len > mtu ? + ip6_fragment(net, sk, segs, ip6_finish_output2) : + ip6_finish_output2(net, sk, segs); if (err && ret == 0) ret = err; } diff -u linux-aws-6.5-6.5.0/net/ipv6/udp.c linux-aws-6.5-6.5.0/net/ipv6/udp.c --- linux-aws-6.5-6.5.0/net/ipv6/udp.c +++ linux-aws-6.5-6.5.0/net/ipv6/udp.c @@ -446,7 +446,7 @@ (struct sockaddr *)sin6); } - if (udp_sk(sk)->gro_enabled) + if (udp_test_bit(GRO_ENABLED, sk)) udp_cmsg_recv(msg, sk, skb); if (np->rxopt.all) @@ -604,7 +604,7 @@ sk = __udp6_lib_lookup(net, daddr, uh->dest, saddr, uh->source, inet6_iif(skb), inet6_sdif(skb), udptable, NULL); - if (!sk || udp_sk(sk)->encap_type) { + if (!sk || READ_ONCE(udp_sk(sk)->encap_type)) { /* No socket for error: try tunnels before discarding */ if (static_branch_unlikely(&udpv6_encap_needed_key)) { sk = __udp6_lib_err_encap(net, hdr, offset, uh, @@ -721,7 +721,8 @@ } nf_reset_ct(skb); - if (static_branch_unlikely(&udpv6_encap_needed_key) && up->encap_type) { + if (static_branch_unlikely(&udpv6_encap_needed_key) && + READ_ONCE(up->encap_type)) { int (*encap_rcv)(struct sock *sk, struct sk_buff *skb); /* @@ -759,16 +760,17 @@ /* * UDP-Lite specific tests, ignored on UDP sockets (see net/ipv4/udp.c). */ - if ((up->pcflag & UDPLITE_RECV_CC) && UDP_SKB_CB(skb)->partial_cov) { + if (udp_test_bit(UDPLITE_RECV_CC, sk) && UDP_SKB_CB(skb)->partial_cov) { + u16 pcrlen = READ_ONCE(up->pcrlen); - if (up->pcrlen == 0) { /* full coverage was set */ + if (pcrlen == 0) { /* full coverage was set */ net_dbg_ratelimited("UDPLITE6: partial coverage %d while full coverage %d requested\n", UDP_SKB_CB(skb)->cscov, skb->len); goto drop; } - if (UDP_SKB_CB(skb)->cscov < up->pcrlen) { + if (UDP_SKB_CB(skb)->cscov < pcrlen) { net_dbg_ratelimited("UDPLITE6: coverage %d too small, need min %d\n", - UDP_SKB_CB(skb)->cscov, up->pcrlen); + UDP_SKB_CB(skb)->cscov, pcrlen); goto drop; } } @@ -891,7 +893,7 @@ /* If zero checksum and no_check is not on for * the socket then skip it. */ - if (!uh->check && !udp_sk(sk)->no_check6_rx) + if (!uh->check && !udp_get_no_check6_rx(sk)) continue; if (!first) { first = sk; @@ -1009,7 +1011,7 @@ if (unlikely(rcu_dereference(sk->sk_rx_dst) != dst)) udp6_sk_rx_dst_set(sk, dst); - if (!uh->check && !udp_sk(sk)->no_check6_rx) { + if (!uh->check && !udp_get_no_check6_rx(sk)) { if (refcounted) sock_put(sk); goto report_csum_error; @@ -1031,7 +1033,7 @@ /* Unicast */ sk = __udp6_lib_lookup_skb(skb, uh->source, uh->dest, udptable); if (sk) { - if (!uh->check && !udp_sk(sk)->no_check6_rx) + if (!uh->check && !udp_get_no_check6_rx(sk)) goto report_csum_error; return udp6_unicast_rcv_skb(sk, skb, uh); } @@ -1270,7 +1272,7 @@ kfree_skb(skb); return -EINVAL; } - if (udp_sk(sk)->no_check6_tx) { + if (udp_get_no_check6_tx(sk)) { kfree_skb(skb); return -EINVAL; } @@ -1291,7 +1293,7 @@ if (is_udplite) csum = udplite_csum(skb); - else if (udp_sk(sk)->no_check6_tx) { /* UDP csum disabled */ + else if (udp_get_no_check6_tx(sk)) { /* UDP csum disabled */ skb->ip_summed = CHECKSUM_NONE; goto send; } else if (skb->ip_summed == CHECKSUM_PARTIAL) { /* UDP hardware csum */ @@ -1361,7 +1363,7 @@ int addr_len = msg->msg_namelen; bool connected = false; int ulen = len; - int corkreq = READ_ONCE(up->corkflag) || msg->msg_flags&MSG_MORE; + int corkreq = udp_test_bit(CORK, sk) || msg->msg_flags & MSG_MORE; int err; int is_udplite = IS_UDPLITE(sk); int (*getfrag)(void *, char *, int, int, int, struct sk_buff *); @@ -1673,11 +1675,11 @@ struct sock *sk = sock->sk; struct udp_sock *up = udp_sk(sk); - if (!up->pending || READ_ONCE(up->corkflag)) + if (!up->pending || udp_test_bit(CORK, sk)) return; lock_sock(sk); - if (up->pending && !READ_ONCE(up->corkflag)) + if (up->pending && !udp_test_bit(CORK, sk)) udp_v6_push_pending_frames(sk); release_sock(sk); } @@ -1699,7 +1701,7 @@ if (encap_destroy) encap_destroy(sk); } - if (up->encap_enabled) { + if (udp_test_bit(ENCAP_ENABLED, sk)) { static_branch_dec(&udpv6_encap_needed_key); udp_encap_disable(); } diff -u linux-aws-6.5-6.5.0/net/ipv6/udplite.c linux-aws-6.5-6.5.0/net/ipv6/udplite.c --- linux-aws-6.5-6.5.0/net/ipv6/udplite.c +++ linux-aws-6.5-6.5.0/net/ipv6/udplite.c @@ -17,7 +17,6 @@ static int udplitev6_sk_init(struct sock *sk) { udpv6_init_sock(sk); - udp_sk(sk)->pcflag = UDPLITE_BIT; pr_warn_once("UDP-Lite is deprecated and scheduled to be removed in 2025, " "please contact the netdev mailing list\n"); return 0; diff -u linux-aws-6.5-6.5.0/net/mac80211/cfg.c linux-aws-6.5-6.5.0/net/mac80211/cfg.c --- linux-aws-6.5-6.5.0/net/mac80211/cfg.c +++ linux-aws-6.5-6.5.0/net/mac80211/cfg.c @@ -1860,7 +1860,8 @@ /* VHT can override some HT caps such as the A-MSDU max length */ if (params->vht_capa) ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, - params->vht_capa, link_sta); + params->vht_capa, NULL, + link_sta); if (params->he_capa) ieee80211_he_cap_ie_to_sta_he_cap(sdata, sband, @@ -3120,6 +3121,10 @@ else *dbm = sdata->vif.bss_conf.txpower; + /* INT_MIN indicates no power level was set yet */ + if (*dbm == INT_MIN) + return -EINVAL; + return 0; } diff -u linux-aws-6.5-6.5.0/net/mac80211/ieee80211_i.h linux-aws-6.5-6.5.0/net/mac80211/ieee80211_i.h --- linux-aws-6.5-6.5.0/net/mac80211/ieee80211_i.h +++ linux-aws-6.5-6.5.0/net/mac80211/ieee80211_i.h @@ -1406,7 +1406,7 @@ /* wowlan is enabled -- don't reconfig on resume */ bool wowlan; - struct work_struct radar_detected_work; + struct wiphy_work radar_detected_work; /* number of RX chains the hardware has */ u8 rx_chains; @@ -1483,14 +1483,14 @@ int hw_scan_ies_bufsize; struct cfg80211_scan_info scan_info; - struct work_struct sched_scan_stopped_work; + struct wiphy_work sched_scan_stopped_work; struct ieee80211_sub_if_data __rcu *sched_scan_sdata; struct cfg80211_sched_scan_request __rcu *sched_scan_req; u8 scan_addr[ETH_ALEN]; unsigned long leave_oper_channel_time; enum mac80211_scan_state next_scan_state; - struct delayed_work scan_work; + struct wiphy_delayed_work scan_work; struct ieee80211_sub_if_data __rcu *scan_sdata; /* For backward compatibility only -- do not use */ struct cfg80211_chan_def _oper_chandef; @@ -1583,9 +1583,9 @@ /* * Remain-on-channel support */ - struct delayed_work roc_work; + struct wiphy_delayed_work roc_work; struct list_head roc_list; - struct work_struct hw_roc_start, hw_roc_done; + struct wiphy_work hw_roc_start, hw_roc_done; unsigned long hw_roc_start_time; u64 roc_cookie_counter; @@ -1930,7 +1930,7 @@ u64 *changed); /* scan/BSS handling */ -void ieee80211_scan_work(struct work_struct *work); +void ieee80211_scan_work(struct wiphy *wiphy, struct wiphy_work *work); int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata, const u8 *ssid, u8 ssid_len, struct ieee80211_channel **channels, @@ -1963,7 +1963,8 @@ struct cfg80211_sched_scan_request *req); int ieee80211_request_sched_scan_stop(struct ieee80211_local *local); void ieee80211_sched_scan_end(struct ieee80211_local *local); -void ieee80211_sched_scan_stopped_work(struct work_struct *work); +void ieee80211_sched_scan_stopped_work(struct wiphy *wiphy, + struct wiphy_work *work); /* off-channel/mgmt-tx */ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local); @@ -2142,6 +2143,7 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, struct ieee80211_supported_band *sband, const struct ieee80211_vht_cap *vht_cap_ie, + const struct ieee80211_vht_cap *vht_cap_ie2, struct link_sta_info *link_sta); enum ieee80211_sta_rx_bandwidth ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta); @@ -2567,7 +2569,8 @@ void ieee80211_dfs_cac_timer(unsigned long data); void ieee80211_dfs_cac_timer_work(struct work_struct *work); void ieee80211_dfs_cac_cancel(struct ieee80211_local *local); -void ieee80211_dfs_radar_detected_work(struct work_struct *work); +void ieee80211_dfs_radar_detected_work(struct wiphy *wiphy, + struct wiphy_work *work); int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata, struct cfg80211_csa_settings *csa_settings); diff -u linux-aws-6.5-6.5.0/net/mac80211/mlme.c linux-aws-6.5-6.5.0/net/mac80211/mlme.c --- linux-aws-6.5-6.5.0/net/mac80211/mlme.c +++ linux-aws-6.5-6.5.0/net/mac80211/mlme.c @@ -4202,10 +4202,33 @@ elems->ht_cap_elem, link_sta); - if (elems->vht_cap_elem && !(link->u.mgd.conn_flags & IEEE80211_CONN_DISABLE_VHT)) + if (elems->vht_cap_elem && + !(link->u.mgd.conn_flags & IEEE80211_CONN_DISABLE_VHT)) { + const struct ieee80211_vht_cap *bss_vht_cap = NULL; + const struct cfg80211_bss_ies *ies; + + /* + * Cisco AP module 9115 with FW 17.3 has a bug and sends a + * too large maximum MPDU length in the association response + * (indicating 12k) that it cannot actually process ... + * Work around that. + */ + rcu_read_lock(); + ies = rcu_dereference(cbss->ies); + if (ies) { + const struct element *elem; + + elem = cfg80211_find_elem(WLAN_EID_VHT_CAPABILITY, + ies->data, ies->len); + if (elem && elem->datalen >= sizeof(*bss_vht_cap)) + bss_vht_cap = (const void *)elem->data; + } + ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, elems->vht_cap_elem, - link_sta); + bss_vht_cap, link_sta); + rcu_read_unlock(); + } if (elems->he_operation && !(link->u.mgd.conn_flags & IEEE80211_CONN_DISABLE_HE) && elems->he_cap) { diff -u linux-aws-6.5-6.5.0/net/mac80211/rx.c linux-aws-6.5-6.5.0/net/mac80211/rx.c --- linux-aws-6.5-6.5.0/net/mac80211/rx.c +++ linux-aws-6.5-6.5.0/net/mac80211/rx.c @@ -2112,7 +2112,7 @@ /* either the frame has been decrypted or will be dropped */ status->flag |= RX_FLAG_DECRYPTED; - if (unlikely(ieee80211_is_beacon(fc) && (result & RX_DROP_UNUSABLE) && + if (unlikely(ieee80211_is_beacon(fc) && RX_RES_IS_UNUSABLE(result) && rx->sdata->dev)) cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, skb->data, skb->len); @@ -2468,8 +2468,7 @@ /* drop unicast public action frames when using MPF */ if (is_unicast_ether_addr(mgmt->da) && - ieee80211_is_public_action((void *)rx->skb->data, - rx->skb->len)) + ieee80211_is_protected_dual_of_public_action(rx->skb)) return -EACCES; } diff -u linux-aws-6.5-6.5.0/net/mptcp/protocol.c linux-aws-6.5-6.5.0/net/mptcp/protocol.c --- linux-aws-6.5-6.5.0/net/mptcp/protocol.c +++ linux-aws-6.5-6.5.0/net/mptcp/protocol.c @@ -1233,6 +1233,8 @@ mptcp_do_fallback(ssk); } +#define MPTCP_MAX_GSO_SIZE (GSO_LEGACY_MAX_SIZE - (MAX_TCP_HEADER + 1)) + static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk, struct mptcp_data_frag *dfrag, struct mptcp_sendmsg_info *info) @@ -1259,6 +1261,8 @@ return -EAGAIN; /* compute send limit */ + if (unlikely(ssk->sk_gso_max_size > MPTCP_MAX_GSO_SIZE)) + ssk->sk_gso_max_size = MPTCP_MAX_GSO_SIZE; info->mss_now = tcp_send_mss(ssk, &info->size_goal, info->flags); copy = info->size_goal; @@ -1300,7 +1304,7 @@ if (copy == 0) { u64 snd_una = READ_ONCE(msk->snd_una); - if (snd_una != msk->snd_nxt) { + if (snd_una != msk->snd_nxt || tcp_write_queue_tail(ssk)) { tcp_remove_empty_skb(ssk); return 0; } @@ -1308,11 +1312,6 @@ zero_window_probe = true; data_seq = snd_una - 1; copy = 1; - - /* all mptcp-level data is acked, no skbs should be present into the - * ssk write queue - */ - WARN_ON_ONCE(reuse_skb); } copy = min_t(size_t, copy, info->limit - info->sent); @@ -1341,7 +1340,6 @@ if (reuse_skb) { TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_PSH; mpext->data_len += copy; - WARN_ON_ONCE(zero_window_probe); goto out; } @@ -2342,6 +2340,26 @@ #define MPTCP_CF_PUSH BIT(1) #define MPTCP_CF_FASTCLOSE BIT(2) +/* be sure to send a reset only if the caller asked for it, also + * clean completely the subflow status when the subflow reaches + * TCP_CLOSE state + */ +static void __mptcp_subflow_disconnect(struct sock *ssk, + struct mptcp_subflow_context *subflow, + unsigned int flags) +{ + if (((1 << ssk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)) || + (flags & MPTCP_CF_FASTCLOSE)) { + /* The MPTCP code never wait on the subflow sockets, TCP-level + * disconnect should never fail + */ + WARN_ON_ONCE(tcp_disconnect(ssk, 0)); + mptcp_subflow_ctx_reset(subflow); + } else { + tcp_shutdown(ssk, SEND_SHUTDOWN); + } +} + /* subflow sockets can be either outgoing (connect) or incoming * (accept). * @@ -2379,7 +2397,7 @@ lock_sock_nested(ssk, SINGLE_DEPTH_NESTING); if ((flags & MPTCP_CF_FASTCLOSE) && !__mptcp_check_fallback(msk)) { - /* be sure to force the tcp_disconnect() path, + /* be sure to force the tcp_close path * to generate the egress reset */ ssk->sk_lingertime = 0; @@ -2389,12 +2407,8 @@ need_push = (flags & MPTCP_CF_PUSH) && __mptcp_retransmit_pending_data(sk); if (!dispose_it) { - /* The MPTCP code never wait on the subflow sockets, TCP-level - * disconnect should never fail - */ - WARN_ON_ONCE(tcp_disconnect(ssk, 0)); + __mptcp_subflow_disconnect(ssk, subflow, flags); msk->subflow->state = SS_UNCONNECTED; - mptcp_subflow_ctx_reset(subflow); release_sock(ssk); goto out; @@ -3069,12 +3083,6 @@ { struct mptcp_sock *msk = mptcp_sk(sk); - /* Deny disconnect if other threads are blocked in sk_wait_event() - * or inet_wait_for_connect(). - */ - if (sk->sk_wait_pending) - return -EBUSY; - /* We are on the fastopen error path. We can't call straight into the * subflows cleanup code due to lock nesting (we are already under * msk->firstsocket lock). @@ -3145,7 +3153,6 @@ inet_sk(nsk)->pinet6 = mptcp_inet6_sk(nsk); #endif - nsk->sk_wait_pending = 0; __mptcp_init_sock(nsk); msk = mptcp_sk(nsk); reverted: --- linux-aws-6.5-6.5.0/net/ncsi/ncsi-aen.c +++ linux-aws-6.5-6.5.0.orig/net/ncsi/ncsi-aen.c @@ -89,11 +89,6 @@ if ((had_link == has_link) || chained) return 0; - if (had_link) - netif_carrier_off(ndp->ndev.dev); - else - netif_carrier_on(ndp->ndev.dev); - if (!ndp->multi_package && !nc->package->multi_channel) { if (had_link) { ndp->flags |= NCSI_DEV_RESHUFFLE; diff -u linux-aws-6.5-6.5.0/net/netfilter/ipset/ip_set_core.c linux-aws-6.5-6.5.0/net/netfilter/ipset/ip_set_core.c --- linux-aws-6.5-6.5.0/net/netfilter/ipset/ip_set_core.c +++ linux-aws-6.5-6.5.0/net/netfilter/ipset/ip_set_core.c @@ -61,6 +61,8 @@ ip_set_dereference((inst)->ip_set_list)[id] #define ip_set_ref_netlink(inst,id) \ rcu_dereference_raw((inst)->ip_set_list)[id] +#define ip_set_dereference_nfnl(p) \ + rcu_dereference_check(p, lockdep_nfnl_is_held(NFNL_SUBSYS_IPSET)) /* The set types are implemented in modules and registered set types * can be found in ip_set_type_list. Adding/deleting types is @@ -708,15 +710,10 @@ static struct ip_set * ip_set_rcu_get(struct net *net, ip_set_id_t index) { - struct ip_set *set; struct ip_set_net *inst = ip_set_pernet(net); - rcu_read_lock(); - /* ip_set_list itself needs to be protected */ - set = rcu_dereference(inst->ip_set_list)[index]; - rcu_read_unlock(); - - return set; + /* ip_set_list and the set pointer need to be protected */ + return ip_set_dereference_nfnl(inst->ip_set_list)[index]; } static inline void @@ -1397,6 +1394,9 @@ ip_set(inst, to_id) = from; write_unlock_bh(&ip_set_ref_lock); + /* Make sure all readers of the old set pointers are completed. */ + synchronize_rcu(); + return 0; } diff -u linux-aws-6.5-6.5.0/net/netfilter/nf_tables_api.c linux-aws-6.5-6.5.0/net/netfilter/nf_tables_api.c --- linux-aws-6.5-6.5.0/net/netfilter/nf_tables_api.c +++ linux-aws-6.5-6.5.0/net/netfilter/nf_tables_api.c @@ -805,7 +805,7 @@ static struct nft_table *nft_table_lookup_byhandle(const struct net *net, const struct nlattr *nla, - u8 genmask, u32 nlpid) + int family, u8 genmask, u32 nlpid) { struct nftables_pernet *nft_net; struct nft_table *table; @@ -813,6 +813,7 @@ nft_net = nft_pernet(net); list_for_each_entry(table, &nft_net->tables, list) { if (be64_to_cpu(nla_get_be64(nla)) == table->handle && + table->family == family && nft_active_genmask(table, genmask)) { if (nft_table_has_owner(table) && nlpid && table->nlpid != nlpid) @@ -1546,7 +1547,7 @@ if (nla[NFTA_TABLE_HANDLE]) { attr = nla[NFTA_TABLE_HANDLE]; - table = nft_table_lookup_byhandle(net, attr, genmask, + table = nft_table_lookup_byhandle(net, attr, family, genmask, NETLINK_CB(skb).portid); } else { attr = nla[NFTA_TABLE_NAME]; @@ -3465,10 +3466,6 @@ goto cont_skip; if (*idx < s_idx) goto cont; - if (*idx > s_idx) { - memset(&cb->args[1], 0, - sizeof(cb->args) - sizeof(cb->args[0])); - } if (prule) handle = prule->handle; else @@ -5553,7 +5550,6 @@ const struct nft_set_ext *ext = nft_set_elem_ext(set, elem->priv); unsigned char *b = skb_tail_pointer(skb); struct nlattr *nest; - u64 timeout = 0; nest = nla_nest_start_noflag(skb, NFTA_LIST_ELEM); if (nest == NULL) @@ -5589,15 +5585,11 @@ htonl(*nft_set_ext_flags(ext)))) goto nla_put_failure; - if (nft_set_ext_exists(ext, NFT_SET_EXT_TIMEOUT)) { - timeout = *nft_set_ext_timeout(ext); - if (nla_put_be64(skb, NFTA_SET_ELEM_TIMEOUT, - nf_jiffies64_to_msecs(timeout), - NFTA_SET_ELEM_PAD)) - goto nla_put_failure; - } else if (set->flags & NFT_SET_TIMEOUT) { - timeout = READ_ONCE(set->timeout); - } + if (nft_set_ext_exists(ext, NFT_SET_EXT_TIMEOUT) && + nla_put_be64(skb, NFTA_SET_ELEM_TIMEOUT, + nf_jiffies64_to_msecs(*nft_set_ext_timeout(ext)), + NFTA_SET_ELEM_PAD)) + goto nla_put_failure; if (nft_set_ext_exists(ext, NFT_SET_EXT_EXPIRATION)) { u64 expires, now = get_jiffies_64(); @@ -5612,9 +5604,6 @@ nf_jiffies64_to_msecs(expires), NFTA_SET_ELEM_PAD)) goto nla_put_failure; - - if (reset) - *nft_set_ext_expiration(ext) = now + timeout; } if (nft_set_ext_exists(ext, NFT_SET_EXT_USERDATA)) { @@ -7219,10 +7208,11 @@ if (err < 0) { NL_SET_BAD_ATTR(extack, attr); - break; + return err; } } - return err; + + return 0; } /* @@ -7617,6 +7607,16 @@ return -1; } +static void audit_log_obj_reset(const struct nft_table *table, + unsigned int base_seq, unsigned int nentries) +{ + char *buf = kasprintf(GFP_ATOMIC, "%s:%u", table->name, base_seq); + + audit_log_nfcfg(buf, table->family, nentries, + AUDIT_NFT_OP_OBJ_RESET, GFP_ATOMIC); + kfree(buf); +} + struct nft_obj_filter { char *table; u32 type; @@ -7631,8 +7631,10 @@ struct net *net = sock_net(skb->sk); int family = nfmsg->nfgen_family; struct nftables_pernet *nft_net; + unsigned int entries = 0; struct nft_object *obj; bool reset = false; + int rc = 0; if (NFNL_MSG_TYPE(cb->nlh->nlmsg_type) == NFT_MSG_GETOBJ_RESET) reset = true; @@ -7645,6 +7647,7 @@ if (family != NFPROTO_UNSPEC && family != table->family) continue; + entries = 0; list_for_each_entry_rcu(obj, &table->objects, list) { if (!nft_is_active(net, obj)) goto cont; @@ -7660,34 +7663,27 @@ filter->type != NFT_OBJECT_UNSPEC && obj->ops->type->type != filter->type) goto cont; - if (reset) { - char *buf = kasprintf(GFP_ATOMIC, - "%s:%u", - table->name, - nft_net->base_seq); - - audit_log_nfcfg(buf, - family, - obj->handle, - AUDIT_NFT_OP_OBJ_RESET, - GFP_ATOMIC); - kfree(buf); - } - - if (nf_tables_fill_obj_info(skb, net, NETLINK_CB(cb->skb).portid, - cb->nlh->nlmsg_seq, - NFT_MSG_NEWOBJ, - NLM_F_MULTI | NLM_F_APPEND, - table->family, table, - obj, reset) < 0) - goto done; + rc = nf_tables_fill_obj_info(skb, net, + NETLINK_CB(cb->skb).portid, + cb->nlh->nlmsg_seq, + NFT_MSG_NEWOBJ, + NLM_F_MULTI | NLM_F_APPEND, + table->family, table, + obj, reset); + if (rc < 0) + break; + + entries++; nl_dump_check_consistent(cb, nlmsg_hdr(skb)); cont: idx++; } + if (reset && entries) + audit_log_obj_reset(table, nft_net->base_seq, entries); + if (rc < 0) + break; } -done: rcu_read_unlock(); cb->args[0] = idx; @@ -7792,7 +7788,7 @@ audit_log_nfcfg(buf, family, - obj->handle, + 1, AUDIT_NFT_OP_OBJ_RESET, GFP_ATOMIC); kfree(buf); @@ -9642,16 +9638,14 @@ call_rcu(&trans->rcu, nft_trans_gc_trans_free); } -static struct nft_trans_gc *nft_trans_gc_catchall(struct nft_trans_gc *gc, - unsigned int gc_seq, - bool sync) +struct nft_trans_gc *nft_trans_gc_catchall_async(struct nft_trans_gc *gc, + unsigned int gc_seq) { - struct nft_set_elem_catchall *catchall, *next; + struct nft_set_elem_catchall *catchall; const struct nft_set *set = gc->set; - struct nft_set_elem *elem; struct nft_set_ext *ext; - list_for_each_entry_safe(catchall, next, &set->catchall_list, list) { + list_for_each_entry_rcu(catchall, &set->catchall_list, list) { ext = nft_set_elem_ext(set, catchall->elem); if (!nft_set_elem_expired(ext)) @@ -9661,35 +9655,44 @@ nft_set_elem_dead(ext); dead_elem: - if (sync) - gc = nft_trans_gc_queue_sync(gc, GFP_ATOMIC); - else - gc = nft_trans_gc_queue_async(gc, gc_seq, GFP_ATOMIC); - + gc = nft_trans_gc_queue_async(gc, gc_seq, GFP_ATOMIC); if (!gc) return NULL; - elem = catchall->elem; - if (sync) { - nft_setelem_data_deactivate(gc->net, gc->set, elem); - nft_setelem_catchall_destroy(catchall); - } - - nft_trans_gc_elem_add(gc, elem->priv); + nft_trans_gc_elem_add(gc, catchall->elem); } return gc; } -struct nft_trans_gc *nft_trans_gc_catchall_async(struct nft_trans_gc *gc, - unsigned int gc_seq) -{ - return nft_trans_gc_catchall(gc, gc_seq, false); -} - struct nft_trans_gc *nft_trans_gc_catchall_sync(struct nft_trans_gc *gc) { - return nft_trans_gc_catchall(gc, 0, true); + struct nft_set_elem_catchall *catchall, *next; + const struct nft_set *set = gc->set; + struct nft_set_elem elem; + struct nft_set_ext *ext; + + WARN_ON_ONCE(!lockdep_commit_lock_is_held(gc->net)); + + list_for_each_entry_safe(catchall, next, &set->catchall_list, list) { + ext = nft_set_elem_ext(set, catchall->elem); + + if (!nft_set_elem_expired(ext)) + continue; + + gc = nft_trans_gc_queue_sync(gc, GFP_KERNEL); + if (!gc) + return NULL; + + memset(&elem, 0, sizeof(elem)); + elem.priv = catchall->elem; + + nft_setelem_data_deactivate(gc->net, gc->set, &elem); + nft_setelem_catchall_destroy(catchall); + nft_trans_gc_elem_add(gc, elem.priv); + } + + return gc; } static void nf_tables_module_autoload_cleanup(struct net *net) diff -u linux-aws-6.5-6.5.0/net/netfilter/nft_exthdr.c linux-aws-6.5-6.5.0/net/netfilter/nft_exthdr.c --- linux-aws-6.5-6.5.0/net/netfilter/nft_exthdr.c +++ linux-aws-6.5-6.5.0/net/netfilter/nft_exthdr.c @@ -214,7 +214,7 @@ offset = i + priv->offset; if (priv->flags & NFT_EXTHDR_F_PRESENT) { - *dest = 1; + nft_reg_store8(dest, 1); } else { if (priv->len % NFT_REG32_SIZE) dest[priv->len / NFT_REG32_SIZE] = 0; @@ -461,7 +461,7 @@ type = bufp[0]; if (type == priv->type) { - *dest = 1; + nft_reg_store8(dest, 1); return; } diff -u linux-aws-6.5-6.5.0/net/netfilter/nft_meta.c linux-aws-6.5-6.5.0/net/netfilter/nft_meta.c --- linux-aws-6.5-6.5.0/net/netfilter/nft_meta.c +++ linux-aws-6.5-6.5.0/net/netfilter/nft_meta.c @@ -63,7 +63,7 @@ { switch (key) { case NFT_META_TIME_NS: - nft_reg_store64(dest, ktime_get_real_ns()); + nft_reg_store64((u64 *)dest, ktime_get_real_ns()); break; case NFT_META_TIME_DAY: nft_reg_store8(dest, nft_meta_weekday()); diff -u linux-aws-6.5-6.5.0/net/netfilter/nft_payload.c linux-aws-6.5-6.5.0/net/netfilter/nft_payload.c --- linux-aws-6.5-6.5.0/net/netfilter/nft_payload.c +++ linux-aws-6.5-6.5.0/net/netfilter/nft_payload.c @@ -179,7 +179,7 @@ switch (priv->base) { case NFT_PAYLOAD_LL_HEADER: - if (!skb_mac_header_was_set(skb)) + if (!skb_mac_header_was_set(skb) || skb_mac_header_len(skb) == 0) goto err; if (skb_vlan_tag_present(skb) && diff -u linux-aws-6.5-6.5.0/net/netfilter/nft_set_rbtree.c linux-aws-6.5-6.5.0/net/netfilter/nft_set_rbtree.c --- linux-aws-6.5-6.5.0/net/netfilter/nft_set_rbtree.c +++ linux-aws-6.5-6.5.0/net/netfilter/nft_set_rbtree.c @@ -568,6 +568,8 @@ nft_rbtree_interval_end(this)) { parent = parent->rb_right; continue; + } else if (nft_set_elem_expired(&rbe->ext)) { + break; } else if (!nft_set_elem_active(&rbe->ext, genmask)) { parent = parent->rb_left; continue; diff -u linux-aws-6.5-6.5.0/net/packet/af_packet.c linux-aws-6.5-6.5.0/net/packet/af_packet.c --- linux-aws-6.5-6.5.0/net/packet/af_packet.c +++ linux-aws-6.5-6.5.0/net/packet/af_packet.c @@ -4298,7 +4298,7 @@ struct sock *sk = sock->sk; if (sk) - atomic_inc(&pkt_sk(sk)->mapped); + atomic_long_inc(&pkt_sk(sk)->mapped); } static void packet_mm_close(struct vm_area_struct *vma) @@ -4308,7 +4308,7 @@ struct sock *sk = sock->sk; if (sk) - atomic_dec(&pkt_sk(sk)->mapped); + atomic_long_dec(&pkt_sk(sk)->mapped); } static const struct vm_operations_struct packet_mmap_ops = { @@ -4403,7 +4403,7 @@ err = -EBUSY; if (!closing) { - if (atomic_read(&po->mapped)) + if (atomic_long_read(&po->mapped)) goto out; if (packet_read_pending(rb)) goto out; @@ -4506,7 +4506,7 @@ err = -EBUSY; mutex_lock(&po->pg_vec_lock); - if (closing || atomic_read(&po->mapped) == 0) { + if (closing || atomic_long_read(&po->mapped) == 0) { err = 0; spin_lock_bh(&rb_queue->lock); swap(rb->pg_vec, pg_vec); @@ -4524,9 +4524,9 @@ po->prot_hook.func = (po->rx_ring.pg_vec) ? tpacket_rcv : packet_rcv; skb_queue_purge(rb_queue); - if (atomic_read(&po->mapped)) - pr_err("packet_mmap: vma is busy: %d\n", - atomic_read(&po->mapped)); + if (atomic_long_read(&po->mapped)) + pr_err("packet_mmap: vma is busy: %ld\n", + atomic_long_read(&po->mapped)); } mutex_unlock(&po->pg_vec_lock); @@ -4604,7 +4604,7 @@ } } - atomic_inc(&po->mapped); + atomic_long_inc(&po->mapped); vma->vm_ops = &packet_mmap_ops; err = 0; diff -u linux-aws-6.5-6.5.0/net/rfkill/core.c linux-aws-6.5-6.5.0/net/rfkill/core.c --- linux-aws-6.5-6.5.0/net/rfkill/core.c +++ linux-aws-6.5-6.5.0/net/rfkill/core.c @@ -48,6 +48,7 @@ bool persistent; bool polling_paused; bool suspended; + bool need_sync; const struct rfkill_ops *ops; void *data; @@ -367,6 +368,17 @@ rfkill_event(rfkill); } +static void rfkill_sync(struct rfkill *rfkill) +{ + lockdep_assert_held(&rfkill_global_mutex); + + if (!rfkill->need_sync) + return; + + rfkill_set_block(rfkill, rfkill_global_states[rfkill->type].cur); + rfkill->need_sync = false; +} + static void rfkill_update_global_state(enum rfkill_type type, bool blocked) { int i; @@ -729,6 +741,10 @@ { struct rfkill *rfkill = to_rfkill(dev); + mutex_lock(&rfkill_global_mutex); + rfkill_sync(rfkill); + mutex_unlock(&rfkill_global_mutex); + return sysfs_emit(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_SW) ? 1 : 0); } @@ -750,6 +766,7 @@ return -EINVAL; mutex_lock(&rfkill_global_mutex); + rfkill_sync(rfkill); rfkill_set_block(rfkill, state); mutex_unlock(&rfkill_global_mutex); @@ -782,6 +799,10 @@ { struct rfkill *rfkill = to_rfkill(dev); + mutex_lock(&rfkill_global_mutex); + rfkill_sync(rfkill); + mutex_unlock(&rfkill_global_mutex); + return sysfs_emit(buf, "%d\n", user_state_from_blocked(rfkill->state)); } @@ -804,6 +825,7 @@ return -EINVAL; mutex_lock(&rfkill_global_mutex); + rfkill_sync(rfkill); rfkill_set_block(rfkill, state == RFKILL_USER_STATE_SOFT_BLOCKED); mutex_unlock(&rfkill_global_mutex); @@ -1031,14 +1053,10 @@ static void rfkill_sync_work(struct work_struct *work) { - struct rfkill *rfkill; - bool cur; - - rfkill = container_of(work, struct rfkill, sync_work); + struct rfkill *rfkill = container_of(work, struct rfkill, sync_work); mutex_lock(&rfkill_global_mutex); - cur = rfkill_global_states[rfkill->type].cur; - rfkill_set_block(rfkill, cur); + rfkill_sync(rfkill); mutex_unlock(&rfkill_global_mutex); } @@ -1086,6 +1104,7 @@ round_jiffies_relative(POLL_INTERVAL)); if (!rfkill->persistent || rfkill_epo_lock_active) { + rfkill->need_sync = true; schedule_work(&rfkill->sync_work); } else { #ifdef CONFIG_RFKILL_INPUT @@ -1158,7 +1177,6 @@ init_waitqueue_head(&data->read_wait); mutex_lock(&rfkill_global_mutex); - mutex_lock(&data->mtx); /* * start getting events from elsewhere but hold mtx to get * startup events added first @@ -1168,11 +1186,13 @@ ev = kzalloc(sizeof(*ev), GFP_KERNEL); if (!ev) goto free; + rfkill_sync(rfkill); rfkill_fill_event(&ev->ev, rfkill, RFKILL_OP_ADD); + mutex_lock(&data->mtx); list_add_tail(&ev->list, &data->events); + mutex_unlock(&data->mtx); } list_add(&data->list, &rfkill_fds); - mutex_unlock(&data->mtx); mutex_unlock(&rfkill_global_mutex); file->private_data = data; @@ -1180,7 +1200,6 @@ return stream_open(inode, file); free: - mutex_unlock(&data->mtx); mutex_unlock(&rfkill_global_mutex); mutex_destroy(&data->mtx); list_for_each_entry_safe(ev, tmp, &data->events, list) diff -u linux-aws-6.5-6.5.0/net/sched/sch_hfsc.c linux-aws-6.5-6.5.0/net/sched/sch_hfsc.c --- linux-aws-6.5-6.5.0/net/sched/sch_hfsc.c +++ linux-aws-6.5-6.5.0/net/sched/sch_hfsc.c @@ -903,6 +903,14 @@ cl->cl_flags |= HFSC_USC; } +static void +hfsc_upgrade_rt(struct hfsc_class *cl) +{ + cl->cl_fsc = cl->cl_rsc; + rtsc_init(&cl->cl_virtual, &cl->cl_fsc, cl->cl_vt, cl->cl_total); + cl->cl_flags |= HFSC_FSC; +} + static const struct nla_policy hfsc_policy[TCA_HFSC_MAX + 1] = { [TCA_HFSC_RSC] = { .len = sizeof(struct tc_service_curve) }, [TCA_HFSC_FSC] = { .len = sizeof(struct tc_service_curve) }, @@ -1012,10 +1020,6 @@ if (parent == NULL) return -ENOENT; } - if (!(parent->cl_flags & HFSC_FSC) && parent != &q->root) { - NL_SET_ERR_MSG(extack, "Invalid parent - parent class must have FSC"); - return -EINVAL; - } if (classid == 0 || TC_H_MAJ(classid ^ sch->handle) != 0) return -EINVAL; @@ -1066,6 +1070,12 @@ cl->cf_tree = RB_ROOT; sch_tree_lock(sch); + /* Check if the inner class is a misconfigured 'rt' */ + if (!(parent->cl_flags & HFSC_FSC) && parent != &q->root) { + NL_SET_ERR_MSG(extack, + "Forced curve change on parent 'rt' to 'sc'"); + hfsc_upgrade_rt(parent); + } qdisc_class_hash_insert(&q->clhash, &cl->cl_common); list_add_tail(&cl->siblings, &parent->children); if (parent->level == 0) diff -u linux-aws-6.5-6.5.0/net/smc/af_smc.c linux-aws-6.5-6.5.0/net/smc/af_smc.c --- linux-aws-6.5-6.5.0/net/smc/af_smc.c +++ linux-aws-6.5-6.5.0/net/smc/af_smc.c @@ -275,7 +275,7 @@ if (!smc->use_fallback) { rc = smc_close_active(smc); - sock_set_flag(sk, SOCK_DEAD); + smc_sock_set_flag(sk, SOCK_DEAD); sk->sk_shutdown |= SHUTDOWN_MASK; } else { if (sk->sk_state != SMC_CLOSED) { @@ -598,8 +598,12 @@ struct smc_llc_qentry *qentry; int rc; - /* receive CONFIRM LINK request from server over RoCE fabric */ - qentry = smc_llc_wait(link->lgr, NULL, SMC_LLC_WAIT_TIME, + /* Receive CONFIRM LINK request from server over RoCE fabric. + * Increasing the client's timeout by twice as much as the server's + * timeout by default can temporarily avoid decline messages of + * both sides crossing or colliding + */ + qentry = smc_llc_wait(link->lgr, NULL, 2 * SMC_LLC_WAIT_TIME, SMC_LLC_CONFIRM_LINK); if (!qentry) { struct smc_clc_msg_decline dclc; @@ -717,7 +721,7 @@ int bufsize = smc_uncompress_bufsize(clc->d0.dmbe_size); smc->conn.peer_rmbe_idx = clc->d0.dmbe_idx; - smc->conn.peer_token = clc->d0.token; + smc->conn.peer_token = ntohll(clc->d0.token); /* msg header takes up space in the buffer */ smc->conn.peer_rmbe_size = bufsize - sizeof(struct smcd_cdc_msg); atomic_set(&smc->conn.peer_rmbe_space, smc->conn.peer_rmbe_size); @@ -1390,7 +1394,7 @@ if (rc) return rc; } - ini->ism_peer_gid[ini->ism_selected] = aclc->d0.gid; + ini->ism_peer_gid[ini->ism_selected] = ntohll(aclc->d0.gid); /* there is only one lgr role for SMC-D; use server lock */ mutex_lock(&smc_server_lgr_pending); @@ -1722,7 +1726,7 @@ if (new_clcsock) sock_release(new_clcsock); new_sk->sk_state = SMC_CLOSED; - sock_set_flag(new_sk, SOCK_DEAD); + smc_sock_set_flag(new_sk, SOCK_DEAD); sock_put(new_sk); /* final */ *new_smc = NULL; goto out; @@ -2335,7 +2339,7 @@ smc_find_ism_store_rc(rc, ini); return (!rc) ? 0 : ini->rc; } - return SMC_CLC_DECL_NOSMCDEV; + return prfx_rc; } /* listen worker: finish RDMA setup */ diff -u linux-aws-6.5-6.5.0/net/sunrpc/clnt.c linux-aws-6.5-6.5.0/net/sunrpc/clnt.c --- linux-aws-6.5-6.5.0/net/sunrpc/clnt.c +++ linux-aws-6.5-6.5.0/net/sunrpc/clnt.c @@ -111,7 +111,8 @@ pipefs_sb = rpc_get_sb_net(net); if (pipefs_sb) { - __rpc_clnt_remove_pipedir(clnt); + if (pipefs_sb == clnt->pipefs_sb) + __rpc_clnt_remove_pipedir(clnt); rpc_put_sb_net(net); } } @@ -151,6 +152,8 @@ { struct dentry *dentry; + clnt->pipefs_sb = pipefs_sb; + if (clnt->cl_program->pipe_dir_name != NULL) { dentry = rpc_setup_pipedir_sb(pipefs_sb, clnt); if (IS_ERR(dentry)) @@ -2169,6 +2172,7 @@ task->tk_status = 0; switch (status) { case -ECONNREFUSED: + case -ECONNRESET: /* A positive refusal suggests a rebind is needed. */ if (RPC_IS_SOFTCONN(task)) break; @@ -2177,7 +2181,6 @@ goto out_retry; } fallthrough; - case -ECONNRESET: case -ECONNABORTED: case -ENETDOWN: case -ENETUNREACH: @@ -2721,7 +2724,15 @@ out_verifier: trace_rpc_bad_verifier(task); - goto out_garbage; + switch (error) { + case -EPROTONOSUPPORT: + goto out_err; + case -EACCES: + /* Re-encode with a fresh cred */ + fallthrough; + default: + goto out_garbage; + } out_msg_denied: error = -EACCES; diff -u linux-aws-6.5-6.5.0/net/tls/tls_sw.c linux-aws-6.5-6.5.0/net/tls/tls_sw.c --- linux-aws-6.5-6.5.0/net/tls/tls_sw.c +++ linux-aws-6.5-6.5.0/net/tls/tls_sw.c @@ -1231,11 +1231,14 @@ lock_sock(sk); retry: + /* same checks as in tls_sw_push_pending_record() */ rec = ctx->open_rec; if (!rec) goto unlock; msg_pl = &rec->msg_plaintext; + if (msg_pl->sg.size == 0) + goto unlock; /* Check the BPF advisor and perform transmission. */ ret = bpf_exec_tx_verdict(msg_pl, sk, false, TLS_RECORD_TYPE_DATA, @@ -1290,6 +1293,7 @@ struct tls_context *tls_ctx = tls_get_ctx(sk); struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); DEFINE_WAIT_FUNC(wait, woken_wake_function); + int ret = 0; long timeo; timeo = sock_rcvtimeo(sk, nonblock); @@ -1301,6 +1305,9 @@ if (sk->sk_err) return sock_error(sk); + if (ret < 0) + return ret; + if (!skb_queue_empty(&sk->sk_receive_queue)) { tls_strp_check_rcv(&ctx->strp); if (tls_strp_msg_ready(ctx)) @@ -1319,10 +1326,10 @@ released = true; add_wait_queue(sk_sleep(sk), &wait); sk_set_bit(SOCKWQ_ASYNC_WAITDATA, sk); - sk_wait_event(sk, &timeo, - tls_strp_msg_ready(ctx) || - !sk_psock_queue_empty(psock), - &wait); + ret = sk_wait_event(sk, &timeo, + tls_strp_msg_ready(ctx) || + !sk_psock_queue_empty(psock), + &wait); sk_clear_bit(SOCKWQ_ASYNC_WAITDATA, sk); remove_wait_queue(sk_sleep(sk), &wait); @@ -1486,7 +1493,7 @@ */ aead_size = sizeof(*aead_req) + crypto_aead_reqsize(ctx->aead_recv); aead_size = ALIGN(aead_size, __alignof__(*dctx)); - mem = kmalloc(aead_size + struct_size(dctx, sg, n_sgin + n_sgout), + mem = kmalloc(aead_size + struct_size(dctx, sg, size_add(n_sgin, n_sgout)), sk->sk_allocation); if (!mem) { err = -ENOMEM; @@ -1847,13 +1854,11 @@ return sk_flush_backlog(sk); } -static int tls_rx_reader_lock(struct sock *sk, struct tls_sw_context_rx *ctx, - bool nonblock) +static int tls_rx_reader_acquire(struct sock *sk, struct tls_sw_context_rx *ctx, + bool nonblock) { long timeo; - int err; - - lock_sock(sk); + int ret; timeo = sock_rcvtimeo(sk, nonblock); @@ -1863,30 +1868,36 @@ ctx->reader_contended = 1; add_wait_queue(&ctx->wq, &wait); - sk_wait_event(sk, &timeo, - !READ_ONCE(ctx->reader_present), &wait); + ret = sk_wait_event(sk, &timeo, + !READ_ONCE(ctx->reader_present), &wait); remove_wait_queue(&ctx->wq, &wait); - if (timeo <= 0) { - err = -EAGAIN; - goto err_unlock; - } - if (signal_pending(current)) { - err = sock_intr_errno(timeo); - goto err_unlock; - } + if (timeo <= 0) + return -EAGAIN; + if (signal_pending(current)) + return sock_intr_errno(timeo); + if (ret < 0) + return ret; } WRITE_ONCE(ctx->reader_present, 1); return 0; +} -err_unlock: - release_sock(sk); +static int tls_rx_reader_lock(struct sock *sk, struct tls_sw_context_rx *ctx, + bool nonblock) +{ + int err; + + lock_sock(sk); + err = tls_rx_reader_acquire(sk, ctx, nonblock); + if (err) + release_sock(sk); return err; } -static void tls_rx_reader_unlock(struct sock *sk, struct tls_sw_context_rx *ctx) +static void tls_rx_reader_release(struct sock *sk, struct tls_sw_context_rx *ctx) { if (unlikely(ctx->reader_contended)) { if (wq_has_sleeper(&ctx->wq)) @@ -1898,6 +1909,11 @@ } WRITE_ONCE(ctx->reader_present, 0); +} + +static void tls_rx_reader_unlock(struct sock *sk, struct tls_sw_context_rx *ctx) +{ + tls_rx_reader_release(sk, ctx); release_sock(sk); } diff -u linux-aws-6.5-6.5.0/net/unix/af_unix.c linux-aws-6.5-6.5.0/net/unix/af_unix.c --- linux-aws-6.5-6.5.0/net/unix/af_unix.c +++ linux-aws-6.5-6.5.0/net/unix/af_unix.c @@ -212,8 +212,6 @@ } #endif /* CONFIG_SECURITY_NETWORK */ -#define unix_peer(sk) (unix_sk(sk)->peer) - static inline int unix_our_peer(struct sock *sk, struct sock *osk) { return unix_peer(osk) == sk; @@ -2553,15 +2551,16 @@ if (!(state->flags & MSG_PEEK)) WRITE_ONCE(u->oob_skb, NULL); - + else + skb_get(oob_skb); unix_state_unlock(sk); chunk = state->recv_actor(oob_skb, 0, chunk, state); - if (!(state->flags & MSG_PEEK)) { + if (!(state->flags & MSG_PEEK)) UNIXCB(oob_skb).consumed += 1; - kfree_skb(oob_skb); - } + + consume_skb(oob_skb); mutex_unlock(&u->iolock); diff -u linux-aws-6.5-6.5.0/net/wireless/core.c linux-aws-6.5-6.5.0/net/wireless/core.c --- linux-aws-6.5-6.5.0/net/wireless/core.c +++ linux-aws-6.5-6.5.0/net/wireless/core.c @@ -1049,7 +1049,8 @@ } EXPORT_SYMBOL(wiphy_rfkill_start_polling); -void cfg80211_process_wiphy_works(struct cfg80211_registered_device *rdev) +void cfg80211_process_wiphy_works(struct cfg80211_registered_device *rdev, + struct wiphy_work *end) { unsigned int runaway_limit = 100; unsigned long flags; @@ -1068,6 +1069,10 @@ wk->func(&rdev->wiphy, wk); spin_lock_irqsave(&rdev->wiphy_work_lock, flags); + + if (wk == end) + break; + if (WARN_ON(--runaway_limit == 0)) INIT_LIST_HEAD(&rdev->wiphy_work_list); } @@ -1118,7 +1123,7 @@ #endif /* surely nothing is reachable now, clean up work */ - cfg80211_process_wiphy_works(rdev); + cfg80211_process_wiphy_works(rdev, NULL); wiphy_unlock(&rdev->wiphy); rtnl_unlock(); @@ -1622,7 +1627,7 @@ list_add_tail(&work->entry, &rdev->wiphy_work_list); spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags); - schedule_work(&rdev->wiphy_work); + queue_work(system_unbound_wq, &rdev->wiphy_work); } EXPORT_SYMBOL_GPL(wiphy_work_queue); @@ -1640,6 +1645,21 @@ } EXPORT_SYMBOL_GPL(wiphy_work_cancel); +void wiphy_work_flush(struct wiphy *wiphy, struct wiphy_work *work) +{ + struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); + unsigned long flags; + bool run; + + spin_lock_irqsave(&rdev->wiphy_work_lock, flags); + run = !work || !list_empty(&work->entry); + spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags); + + if (run) + cfg80211_process_wiphy_works(rdev, work); +} +EXPORT_SYMBOL_GPL(wiphy_work_flush); + void wiphy_delayed_work_timer(struct timer_list *t) { struct wiphy_delayed_work *dwork = from_timer(dwork, t, timer); @@ -1672,6 +1692,16 @@ } EXPORT_SYMBOL_GPL(wiphy_delayed_work_cancel); +void wiphy_delayed_work_flush(struct wiphy *wiphy, + struct wiphy_delayed_work *dwork) +{ + lockdep_assert_held(&wiphy->mtx); + + del_timer_sync(&dwork->timer); + wiphy_work_flush(wiphy, &dwork->work); +} +EXPORT_SYMBOL_GPL(wiphy_delayed_work_flush); + static int __init cfg80211_init(void) { int err; diff -u linux-aws-6.5-6.5.0/net/wireless/core.h linux-aws-6.5-6.5.0/net/wireless/core.h --- linux-aws-6.5-6.5.0/net/wireless/core.h +++ linux-aws-6.5-6.5.0/net/wireless/core.h @@ -464,7 +464,8 @@ struct net_device *dev, enum nl80211_iftype ntype, struct vif_params *params); void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev); -void cfg80211_process_wiphy_works(struct cfg80211_registered_device *rdev); +void cfg80211_process_wiphy_works(struct cfg80211_registered_device *rdev, + struct wiphy_work *end); void cfg80211_process_wdev_events(struct wireless_dev *wdev); bool cfg80211_does_bw_fit_range(const struct ieee80211_freq_range *freq_range, diff -u linux-aws-6.5-6.5.0/net/wireless/mlme.c linux-aws-6.5-6.5.0/net/wireless/mlme.c --- linux-aws-6.5-6.5.0/net/wireless/mlme.c +++ linux-aws-6.5-6.5.0/net/wireless/mlme.c @@ -43,10 +43,11 @@ for (link_id = 0; link_id < ARRAY_SIZE(data->links); link_id++) { cr.links[link_id].status = data->links[link_id].status; + cr.links[link_id].bss = data->links[link_id].bss; + WARN_ON_ONCE(cr.links[link_id].status != WLAN_STATUS_SUCCESS && (!cr.ap_mld_addr || !cr.links[link_id].bss)); - cr.links[link_id].bss = data->links[link_id].bss; if (!cr.links[link_id].bss) continue; cr.links[link_id].bssid = data->links[link_id].bss->bssid; diff -u linux-aws-6.5-6.5.0/net/wireless/nl80211.c linux-aws-6.5-6.5.0/net/wireless/nl80211.c --- linux-aws-6.5-6.5.0/net/wireless/nl80211.c +++ linux-aws-6.5-6.5.0/net/wireless/nl80211.c @@ -5910,6 +5910,21 @@ nlmsg_free(msg); } +static int nl80211_validate_ap_phy_operation(struct cfg80211_ap_settings *params) +{ + struct ieee80211_channel *channel = params->chandef.chan; + + if ((params->he_cap || params->he_oper) && + (channel->flags & IEEE80211_CHAN_NO_HE)) + return -EOPNOTSUPP; + + if ((params->eht_cap || params->eht_oper) && + (channel->flags & IEEE80211_CHAN_NO_EHT)) + return -EOPNOTSUPP; + + return 0; +} + static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) { struct cfg80211_registered_device *rdev = info->user_ptr[0]; @@ -6179,6 +6194,10 @@ if (err) goto out_unlock; + err = nl80211_validate_ap_phy_operation(params); + if (err) + goto out_unlock; + if (info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS]) params->flags = nla_get_u32( info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS]); @@ -8483,7 +8502,7 @@ struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct net_device *dev = info->user_ptr[1]; struct wireless_dev *wdev = dev->ieee80211_ptr; - struct mesh_config cfg; + struct mesh_config cfg = {}; u32 mask; int err; diff -u linux-aws-6.5-6.5.0/scripts/gdb/linux/constants.py.in linux-aws-6.5-6.5.0/scripts/gdb/linux/constants.py.in --- linux-aws-6.5-6.5.0/scripts/gdb/linux/constants.py.in +++ linux-aws-6.5-6.5.0/scripts/gdb/linux/constants.py.in @@ -63,10 +63,11 @@ LX_GDBPARSED(IRQ_HIDDEN) /* linux/module.h */ -LX_GDBPARSED(MOD_TEXT) -LX_GDBPARSED(MOD_DATA) -LX_GDBPARSED(MOD_RODATA) -LX_GDBPARSED(MOD_RO_AFTER_INIT) +if IS_BUILTIN(CONFIG_MODULES): + LX_GDBPARSED(MOD_TEXT) + LX_GDBPARSED(MOD_DATA) + LX_GDBPARSED(MOD_RODATA) + LX_GDBPARSED(MOD_RO_AFTER_INIT) /* linux/mount.h */ LX_VALUE(MNT_NOSUID) diff -u linux-aws-6.5-6.5.0/scripts/mod/file2alias.c linux-aws-6.5-6.5.0/scripts/mod/file2alias.c --- linux-aws-6.5-6.5.0/scripts/mod/file2alias.c +++ linux-aws-6.5-6.5.0/scripts/mod/file2alias.c @@ -1348,13 +1348,13 @@ /* Looks like: tee:uuid */ static int do_tee_entry(const char *filename, void *symval, char *alias) { - DEF_FIELD(symval, tee_client_device_id, uuid); + DEF_FIELD_ADDR(symval, tee_client_device_id, uuid); sprintf(alias, "tee:%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", - uuid.b[0], uuid.b[1], uuid.b[2], uuid.b[3], uuid.b[4], - uuid.b[5], uuid.b[6], uuid.b[7], uuid.b[8], uuid.b[9], - uuid.b[10], uuid.b[11], uuid.b[12], uuid.b[13], uuid.b[14], - uuid.b[15]); + uuid->b[0], uuid->b[1], uuid->b[2], uuid->b[3], uuid->b[4], + uuid->b[5], uuid->b[6], uuid->b[7], uuid->b[8], uuid->b[9], + uuid->b[10], uuid->b[11], uuid->b[12], uuid->b[13], uuid->b[14], + uuid->b[15]); add_wildcard(alias); return 1; @@ -1401,10 +1401,10 @@ /* Looks like: ishtp:{guid} */ static int do_ishtp_entry(const char *filename, void *symval, char *alias) { - DEF_FIELD(symval, ishtp_device_id, guid); + DEF_FIELD_ADDR(symval, ishtp_device_id, guid); strcpy(alias, ISHTP_MODULE_PREFIX "{"); - add_guid(alias, guid); + add_guid(alias, *guid); strcat(alias, "}"); return 1; diff -u linux-aws-6.5-6.5.0/scripts/mod/modpost.c linux-aws-6.5-6.5.0/scripts/mod/modpost.c --- linux-aws-6.5-6.5.0/scripts/mod/modpost.c +++ linux-aws-6.5-6.5.0/scripts/mod/modpost.c @@ -1469,6 +1469,7 @@ return; for (rela = start; rela < stop; rela++) { + Elf_Sym *tsym; r.r_offset = TO_NATIVE(rela->r_offset); #if KERNEL_ELFCLASS == ELFCLASS64 if (elf->hdr->e_machine == EM_MIPS) { @@ -1485,7 +1486,8 @@ r.r_info = TO_NATIVE(rela->r_info); r_sym = ELF_R_SYM(r.r_info); #endif - r.r_addend = TO_NATIVE(rela->r_addend); + tsym = elf->symtab_start + r_sym; + r.r_addend = tsym->st_value + TO_NATIVE(rela->r_addend); switch (elf->hdr->e_machine) { case EM_RISCV: if (!strcmp("__ex_table", fromsec) && @@ -1499,7 +1501,7 @@ break; } - check_section_mismatch(mod, elf, elf->symtab_start + r_sym, + check_section_mismatch(mod, elf, tsym, fsecndx, fromsec, r.r_offset, r.r_addend); } } diff -u linux-aws-6.5-6.5.0/security/integrity/ima/ima_api.c linux-aws-6.5-6.5.0/security/integrity/ima/ima_api.c --- linux-aws-6.5-6.5.0/security/integrity/ima/ima_api.c +++ linux-aws-6.5-6.5.0/security/integrity/ima/ima_api.c @@ -243,6 +243,7 @@ { const char *audit_cause = "failed"; struct inode *inode = file_inode(file); + struct inode *real_inode = d_real_inode(file_dentry(file)); const char *filename = file->f_path.dentry->d_name.name; struct ima_max_digest_data hash; struct kstat stat; @@ -302,6 +303,10 @@ iint->ima_hash = tmpbuf; memcpy(iint->ima_hash, &hash, length); iint->version = i_version; + if (real_inode != inode) { + iint->real_ino = real_inode->i_ino; + iint->real_dev = real_inode->i_sb->s_dev; + } /* Possibly temporary failure due to type of read (eg. O_DIRECT) */ if (!result) diff -u linux-aws-6.5-6.5.0/security/integrity/ima/ima_main.c linux-aws-6.5-6.5.0/security/integrity/ima/ima_main.c --- linux-aws-6.5-6.5.0/security/integrity/ima/ima_main.c +++ linux-aws-6.5-6.5.0/security/integrity/ima/ima_main.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "ima.h" @@ -207,7 +208,7 @@ struct lsmblob *blob, char *buf, loff_t size, int mask, enum ima_hooks func) { - struct inode *inode = file_inode(file); + struct inode *backing_inode, *inode = file_inode(file); struct integrity_iint_cache *iint = NULL; struct ima_template_desc *template_desc = NULL; char *pathbuf = NULL; @@ -284,6 +285,19 @@ iint->measured_pcrs = 0; } + /* Detect and re-evaluate changes made to the backing file. */ + backing_inode = d_real_inode(file_dentry(file)); + if (backing_inode != inode && + (action & IMA_DO_MASK) && (iint->flags & IMA_DONE_MASK)) { + if (!IS_I_VERSION(backing_inode) || + backing_inode->i_sb->s_dev != iint->real_dev || + backing_inode->i_ino != iint->real_ino || + !inode_eq_iversion(backing_inode, iint->version)) { + iint->flags &= ~IMA_DONE_MASK; + iint->measured_pcrs = 0; + } + } + /* Determine if already appraised/measured based on bitmask * (IMA_MEASURE, IMA_MEASURED, IMA_XXXX_APPRAISE, IMA_XXXX_APPRAISED, * IMA_AUDIT, IMA_AUDITED) diff -u linux-aws-6.5-6.5.0/security/keys/trusted-keys/trusted_core.c linux-aws-6.5-6.5.0/security/keys/trusted-keys/trusted_core.c --- linux-aws-6.5-6.5.0/security/keys/trusted-keys/trusted_core.c +++ linux-aws-6.5-6.5.0/security/keys/trusted-keys/trusted_core.c @@ -358,17 +358,17 @@ if (!get_random) get_random = kernel_get_random; - static_call_update(trusted_key_seal, - trusted_key_sources[i].ops->seal); - static_call_update(trusted_key_unseal, - trusted_key_sources[i].ops->unseal); - static_call_update(trusted_key_get_random, - get_random); - trusted_key_exit = trusted_key_sources[i].ops->exit; - migratable = trusted_key_sources[i].ops->migratable; - ret = trusted_key_sources[i].ops->init(); - if (!ret) + if (!ret) { + static_call_update(trusted_key_seal, trusted_key_sources[i].ops->seal); + static_call_update(trusted_key_unseal, trusted_key_sources[i].ops->unseal); + static_call_update(trusted_key_get_random, get_random); + + trusted_key_exit = trusted_key_sources[i].ops->exit; + migratable = trusted_key_sources[i].ops->migratable; + } + + if (!ret || ret != -ENODEV) break; } diff -u linux-aws-6.5-6.5.0/sound/hda/intel-dsp-config.c linux-aws-6.5-6.5.0/sound/hda/intel-dsp-config.c --- linux-aws-6.5-6.5.0/sound/hda/intel-dsp-config.c +++ linux-aws-6.5-6.5.0/sound/hda/intel-dsp-config.c @@ -343,6 +343,12 @@ DMI_MATCH(DMI_SYS_VENDOR, "Google"), } }, + { + .ident = "Google firmware", + .matches = { + DMI_MATCH(DMI_BIOS_VERSION, "Google"), + } + }, {} } }, diff -u linux-aws-6.5-6.5.0/sound/pci/hda/cs35l41_hda.c linux-aws-6.5-6.5.0/sound/pci/hda/cs35l41_hda.c --- linux-aws-6.5-6.5.0/sound/pci/hda/cs35l41_hda.c +++ linux-aws-6.5-6.5.0/sound/pci/hda/cs35l41_hda.c @@ -1806,8 +1806,7 @@ ret = component_add(cs35l41->dev, &cs35l41_hda_comp_ops); if (ret) { dev_err(cs35l41->dev, "Register component failed: %d\n", ret); - pm_runtime_disable(cs35l41->dev); - goto err; + goto err_pm; } dev_info(cs35l41->dev, "Cirrus Logic CS35L41 (%x), Revision: %02X\n", regid, reg_revid); @@ -1815,6 +1814,7 @@ return 0; err_pm: + pm_runtime_dont_use_autosuspend(cs35l41->dev); pm_runtime_disable(cs35l41->dev); pm_runtime_put_noidle(cs35l41->dev); @@ -1834,6 +1834,7 @@ struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev); pm_runtime_get_sync(cs35l41->dev); + pm_runtime_dont_use_autosuspend(cs35l41->dev); pm_runtime_disable(cs35l41->dev); if (cs35l41->halo_initialized) diff -u linux-aws-6.5-6.5.0/sound/pci/hda/hda_intel.c linux-aws-6.5-6.5.0/sound/pci/hda/hda_intel.c --- linux-aws-6.5-6.5.0/sound/pci/hda/hda_intel.c +++ linux-aws-6.5-6.5.0/sound/pci/hda/hda_intel.c @@ -2230,6 +2230,8 @@ SND_PCI_QUIRK(0x17aa, 0x36a7, "Lenovo C50 All in one", 0), /* https://bugs.launchpad.net/bugs/1821663 */ SND_PCI_QUIRK(0x1631, 0xe017, "Packard Bell NEC IMEDIA 5204", 0), + /* KONTRON SinglePC may cause a stall at runtime resume */ + SND_PCI_QUIRK(0x1734, 0x1232, "KONTRON SinglePC", 0), {} }; #endif /* CONFIG_PM */ diff -u linux-aws-6.5-6.5.0/sound/pci/hda/patch_cs8409.c linux-aws-6.5-6.5.0/sound/pci/hda/patch_cs8409.c --- linux-aws-6.5-6.5.0/sound/pci/hda/patch_cs8409.c +++ linux-aws-6.5-6.5.0/sound/pci/hda/patch_cs8409.c @@ -1371,6 +1371,7 @@ spec->scodecs[CS8409_CODEC1] = &dolphin_cs42l42_1; spec->scodecs[CS8409_CODEC1]->codec = codec; spec->num_scodecs = 2; + spec->gen.suppress_vmaster = 1; codec->patch_ops = cs8409_dolphin_patch_ops; diff -u linux-aws-6.5-6.5.0/sound/pci/hda/patch_realtek.c linux-aws-6.5-6.5.0/sound/pci/hda/patch_realtek.c --- linux-aws-6.5-6.5.0/sound/pci/hda/patch_realtek.c +++ linux-aws-6.5-6.5.0/sound/pci/hda/patch_realtek.c @@ -1987,6 +1987,7 @@ ALC887_FIXUP_ASUS_AUDIO, ALC887_FIXUP_ASUS_HMIC, ALCS1200A_FIXUP_MIC_VREF, + ALC888VD_FIXUP_MIC_100VREF, }; static void alc889_fixup_coef(struct hda_codec *codec, @@ -2540,6 +2541,13 @@ {} } }, + [ALC888VD_FIXUP_MIC_100VREF] = { + .type = HDA_FIXUP_PINCTLS, + .v.pins = (const struct hda_pintbl[]) { + { 0x18, PIN_VREF100 }, /* headset mic */ + {} + } + }, }; static const struct snd_pci_quirk alc882_fixup_tbl[] = { @@ -2609,6 +2617,7 @@ SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), + SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF), SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD), SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), @@ -3256,6 +3265,7 @@ case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x10ec0257: case 0x19e58326: alc_write_coef_idx(codec, 0x48, 0x0); alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); @@ -3285,6 +3295,7 @@ case 0x10ec0230: case 0x10ec0236: case 0x10ec0256: + case 0x10ec0257: case 0x19e58326: alc_write_coef_idx(codec, 0x48, 0xd011); alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); @@ -6496,6 +6507,7 @@ case 0x10ec0236: case 0x10ec0255: case 0x10ec0256: + case 0x10ec0257: case 0x19e58326: alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); @@ -7098,6 +7110,24 @@ 0x0); /* Make sure 0x14 was disable */ } } +/* Fix none verb table of Headset Mic pin */ +static void alc_fixup_headset_mic(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + struct alc_spec *spec = codec->spec; + static const struct hda_pintbl pincfgs[] = { + { 0x19, 0x03a1103c }, + { } + }; + + switch (action) { + case HDA_FIXUP_ACT_PRE_PROBE: + snd_hda_apply_pincfgs(codec, pincfgs); + alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); + spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; + break; + } +} enum { @@ -7365,7 +7395,9 @@ ALC245_FIXUP_HP_X360_MUTE_LEDS, ALC287_FIXUP_THINKPAD_I2S_SPK, ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD, + ALC2XX_FIXUP_HEADSET_MIC, ALC289_FIXUP_DELL_CS35L41_SPI_2, + ALC294_FIXUP_CS35L41_I2C_2, }; /* A special fixup for Lenovo C940 and Yoga Duet 7; @@ -9485,6 +9517,14 @@ .chained = true, .chain_id = ALC289_FIXUP_DUAL_SPK }, + [ALC2XX_FIXUP_HEADSET_MIC] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc_fixup_headset_mic, + }, + [ALC294_FIXUP_CS35L41_I2C_2] = { + .type = HDA_FIXUP_FUNC, + .v.func = cs35l41_fixup_i2c_two, + }, }; static const struct snd_pci_quirk alc269_fixup_tbl[] = { @@ -9588,6 +9628,7 @@ SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK), SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), + SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2), SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), @@ -9736,6 +9777,7 @@ SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED), + SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), @@ -9761,6 +9803,7 @@ SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), + SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED), @@ -9770,6 +9813,7 @@ SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), @@ -9803,12 +9847,16 @@ SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK), SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), @@ -9830,6 +9878,7 @@ SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301V", ALC285_FIXUP_ASUS_HEADSET_MIC), SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK), + SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZV", ALC285_FIXUP_ASUS_HEADSET_MIC), SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2), SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), @@ -9838,6 +9887,7 @@ SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally RC71L_RC71L", ALC294_FIXUP_ASUS_ALLY), SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), + SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2), SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401), @@ -9846,12 +9896,17 @@ SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), + SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2), + SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2), SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2), SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), + SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2), + SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS), SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JI", ALC285_FIXUP_ASUS_HEADSET_MIC), @@ -9862,6 +9917,7 @@ SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2), + SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2), SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), @@ -10054,6 +10110,7 @@ SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), + SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7), @@ -10125,6 +10182,8 @@ SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10), SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK), SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0xf111, 0x0005, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), #if 0 /* Below is a quirk table taken from the old code. @@ -10703,22 +10762,6 @@ {0x12, 0x90a60130}, {0x17, 0x90170110}, {0x21, 0x03211020}), - SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, - {0x14, 0x90170110}, - {0x21, 0x04211020}), - SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, - {0x14, 0x90170110}, - {0x21, 0x04211030}), - SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, - ALC295_STANDARD_PINS, - {0x17, 0x21014020}, - {0x18, 0x21a19030}), - SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, - ALC295_STANDARD_PINS, - {0x17, 0x21014040}, - {0x18, 0x21a19050}), - SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, - ALC295_STANDARD_PINS), SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, ALC298_STANDARD_PINS, {0x17, 0x90170110}), @@ -10762,6 +10805,9 @@ SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, {0x19, 0x40000000}, {0x1b, 0x40000000}), + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, + {0x19, 0x40000000}, + {0x1b, 0x40000000}), SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, {0x19, 0x40000000}, {0x1a, 0x40000000}), @@ -10771,6 +10817,8 @@ SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, {0x19, 0x40000000}, {0x1a, 0x40000000}), + SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC, + {0x19, 0x40000000}), {} }; diff -u linux-aws-6.5-6.5.0/sound/soc/amd/yc/acp6x-mach.c linux-aws-6.5-6.5.0/sound/soc/amd/yc/acp6x-mach.c --- linux-aws-6.5-6.5.0/sound/soc/amd/yc/acp6x-mach.c +++ linux-aws-6.5-6.5.0/sound/soc/amd/yc/acp6x-mach.c @@ -286,6 +286,20 @@ { .driver_data = &acp6x_card, .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "E1504FA"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "E1504FA"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 B7ED"), } diff -u linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l41-lib.c linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l41-lib.c --- linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l41-lib.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l41-lib.c @@ -1244,7 +1244,7 @@ cs35l41_mdsync_down_seq[2].def = pwr_ctrl1; ret = regmap_multi_reg_write(regmap, cs35l41_mdsync_down_seq, ARRAY_SIZE(cs35l41_mdsync_down_seq)); - if (!enable) + if (ret || !enable) break; if (!pll_lock) diff -u linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l41.c linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l41.c --- linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l41.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l41.c @@ -386,10 +386,18 @@ struct cs35l41_private *cs35l41 = data; unsigned int status[4] = { 0, 0, 0, 0 }; unsigned int masks[4] = { 0, 0, 0, 0 }; - int ret = IRQ_NONE; unsigned int i; + int ret; - pm_runtime_get_sync(cs35l41->dev); + ret = pm_runtime_resume_and_get(cs35l41->dev); + if (ret < 0) { + dev_err(cs35l41->dev, + "pm_runtime_resume_and_get failed in %s: %d\n", + __func__, ret); + return IRQ_NONE; + } + + ret = IRQ_NONE; for (i = 0; i < ARRAY_SIZE(status); i++) { regmap_read(cs35l41->regmap, @@ -1273,6 +1281,8 @@ regmap_update_bits(cs35l41->regmap, CS35L41_IRQ1_MASK3, CS35L41_INT3_PLL_LOCK_MASK, 0 << CS35L41_INT3_PLL_LOCK_SHIFT); + init_completion(&cs35l41->pll_lock); + ret = devm_request_threaded_irq(cs35l41->dev, cs35l41->irq, NULL, cs35l41_irq, IRQF_ONESHOT | IRQF_SHARED | irq_pol, "cs35l41", cs35l41); @@ -1295,8 +1305,6 @@ if (ret < 0) goto err; - init_completion(&cs35l41->pll_lock); - pm_runtime_set_autosuspend_delay(cs35l41->dev, 3000); pm_runtime_use_autosuspend(cs35l41->dev); pm_runtime_mark_last_busy(cs35l41->dev); @@ -1320,6 +1328,7 @@ return 0; err_pm: + pm_runtime_dont_use_autosuspend(cs35l41->dev); pm_runtime_disable(cs35l41->dev); pm_runtime_put_noidle(cs35l41->dev); @@ -1336,6 +1345,7 @@ void cs35l41_remove(struct cs35l41_private *cs35l41) { pm_runtime_get_sync(cs35l41->dev); + pm_runtime_dont_use_autosuspend(cs35l41->dev); pm_runtime_disable(cs35l41->dev); regmap_write(cs35l41->regmap, CS35L41_IRQ1_MASK1, 0xFFFFFFFF); diff -u linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l56.c linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l56.c --- linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l56.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/cs35l56.c @@ -879,7 +879,7 @@ mutex_lock(&cs35l56->irq_lock); - init_completion(&cs35l56->init_completion); + reinit_completion(&cs35l56->init_completion); cs35l56_system_reset(cs35l56); diff -u linux-aws-6.5-6.5.0/sound/soc/codecs/cs42l42-sdw.c linux-aws-6.5-6.5.0/sound/soc/codecs/cs42l42-sdw.c --- linux-aws-6.5-6.5.0/sound/soc/codecs/cs42l42-sdw.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/cs42l42-sdw.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff -u linux-aws-6.5-6.5.0/sound/soc/codecs/hdmi-codec.c linux-aws-6.5-6.5.0/sound/soc/codecs/hdmi-codec.c --- linux-aws-6.5-6.5.0/sound/soc/codecs/hdmi-codec.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/hdmi-codec.c @@ -895,18 +895,13 @@ void *data) { struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); - int ret = -ENOTSUPP; if (hcp->hcd.ops->hook_plugged_cb) { hcp->jack = jack; - ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent, - hcp->hcd.data, - plugged_cb, - component->dev); - if (ret) - hcp->jack = NULL; + return 0; } - return ret; + + return -ENOTSUPP; } static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai) @@ -982,6 +977,21 @@ return ret; } +static int hdmi_probe(struct snd_soc_component *component) +{ + struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); + int ret = 0; + + if (hcp->hcd.ops->hook_plugged_cb) { + ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent, + hcp->hcd.data, + plugged_cb, + component->dev); + } + + return ret; +} + static void hdmi_remove(struct snd_soc_component *component) { struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); @@ -992,6 +1002,7 @@ } static const struct snd_soc_component_driver hdmi_driver = { + .probe = hdmi_probe, .remove = hdmi_remove, .dapm_widgets = hdmi_widgets, .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), diff -u linux-aws-6.5-6.5.0/sound/soc/codecs/wm_adsp.c linux-aws-6.5-6.5.0/sound/soc/codecs/wm_adsp.c --- linux-aws-6.5-6.5.0/sound/soc/codecs/wm_adsp.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/wm_adsp.c @@ -1443,12 +1443,12 @@ ret = wm_adsp_buffer_read(buf, caps->region_defs[i].base_offset, ®ion->base_addr); if (ret < 0) - return ret; + goto err; ret = wm_adsp_buffer_read(buf, caps->region_defs[i].size_offset, &offset); if (ret < 0) - return ret; + goto err; region->cumulative_size = offset; @@ -1459,6 +1459,10 @@ } return 0; + +err: + kfree(buf->regions); + return ret; } static void wm_adsp_buffer_clear(struct wm_adsp_compr_buf *buf) diff -u linux-aws-6.5-6.5.0/sound/soc/fsl/fsl_sai.c linux-aws-6.5-6.5.0/sound/soc/fsl/fsl_sai.c --- linux-aws-6.5-6.5.0/sound/soc/fsl/fsl_sai.c +++ linux-aws-6.5-6.5.0/sound/soc/fsl/fsl_sai.c @@ -674,6 +674,20 @@ FSL_SAI_CR3_TRCE_MASK, FSL_SAI_CR3_TRCE((dl_cfg[dl_cfg_idx].mask[tx] & trce_mask))); + /* + * When the TERE and FSD_MSTR enabled before configuring the word width + * There will be no frame sync clock issue, because word width impact + * the generation of frame sync clock. + * + * TERE enabled earlier only for i.MX8MP case for the hardware limitation, + * We need to disable FSD_MSTR before configuring word width, then enable + * FSD_MSTR bit for this specific case. + */ + if (sai->soc_data->mclk_with_tere && sai->mclk_direction_output && + !sai->is_consumer_mode) + regmap_update_bits(sai->regmap, FSL_SAI_xCR4(tx, ofs), + FSL_SAI_CR4_FSD_MSTR, 0); + regmap_update_bits(sai->regmap, FSL_SAI_xCR4(tx, ofs), FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK | FSL_SAI_CR4_CHMOD_MASK, @@ -681,6 +695,13 @@ regmap_update_bits(sai->regmap, FSL_SAI_xCR5(tx, ofs), FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); + + /* Enable FSD_MSTR after configuring word width */ + if (sai->soc_data->mclk_with_tere && sai->mclk_direction_output && + !sai->is_consumer_mode) + regmap_update_bits(sai->regmap, FSL_SAI_xCR4(tx, ofs), + FSL_SAI_CR4_FSD_MSTR, FSL_SAI_CR4_FSD_MSTR); + regmap_write(sai->regmap, FSL_SAI_xMR(tx), ~0UL - ((1 << min(channels, slots)) - 1)); diff -u linux-aws-6.5-6.5.0/sound/soc/intel/boards/sof_sdw.c linux-aws-6.5-6.5.0/sound/soc/intel/boards/sof_sdw.c --- linux-aws-6.5-6.5.0/sound/soc/intel/boards/sof_sdw.c +++ linux-aws-6.5-6.5.0/sound/soc/intel/boards/sof_sdw.c @@ -370,6 +370,16 @@ .callback = sof_sdw_quirk_cb, .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B14"), + }, + /* No Jack */ + .driver_data = (void *)SOF_SDW_TGL_HDMI, + }, + + { + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B29"), }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | diff -u linux-aws-6.5-6.5.0/sound/soc/sof/core.c linux-aws-6.5-6.5.0/sound/soc/sof/core.c --- linux-aws-6.5-6.5.0/sound/soc/sof/core.c +++ linux-aws-6.5-6.5.0/sound/soc/sof/core.c @@ -459,9 +459,10 @@ struct snd_sof_dev *sdev = dev_get_drvdata(dev); struct snd_sof_pdata *pdata = sdev->pdata; int ret; + bool aborted = false; if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)) - cancel_work_sync(&sdev->probe_work); + aborted = cancel_work_sync(&sdev->probe_work); /* * Unregister any registered client device first before IPC and debugfs @@ -487,6 +488,9 @@ snd_sof_free_debug(sdev); snd_sof_remove(sdev); sof_ops_free(sdev); + } else if (aborted) { + /* probe_work never ran */ + sof_ops_free(sdev); } /* release firmware */ diff -u linux-aws-6.5-6.5.0/sound/soc/sof/ipc4-topology.c linux-aws-6.5-6.5.0/sound/soc/sof/ipc4-topology.c --- linux-aws-6.5-6.5.0/sound/soc/sof/ipc4-topology.c +++ linux-aws-6.5-6.5.0/sound/soc/sof/ipc4-topology.c @@ -895,7 +895,8 @@ if (process->init_config == SOF_IPC4_MODULE_INIT_CONFIG_TYPE_BASE_CFG_WITH_EXT) { struct sof_ipc4_base_module_cfg_ext *base_cfg_ext; u32 ext_size = struct_size(base_cfg_ext, pin_formats, - swidget->num_input_pins + swidget->num_output_pins); + size_add(swidget->num_input_pins, + swidget->num_output_pins)); base_cfg_ext = kzalloc(ext_size, GFP_KERNEL); if (!base_cfg_ext) { diff -u linux-aws-6.5-6.5.0/sound/soc/sof/sof-audio.c linux-aws-6.5-6.5.0/sound/soc/sof/sof-audio.c --- linux-aws-6.5-6.5.0/sound/soc/sof/sof-audio.c +++ linux-aws-6.5-6.5.0/sound/soc/sof/sof-audio.c @@ -1032,6 +1032,13 @@ mach = snd_sof_machine_select(sdev); if (mach) { sof_pdata->machine = mach; + + if (sof_pdata->subsystem_id_set) { + mach->mach_params.subsystem_vendor = sof_pdata->subsystem_vendor; + mach->mach_params.subsystem_device = sof_pdata->subsystem_device; + mach->mach_params.subsystem_id_set = true; + } + snd_sof_set_mach_params(mach, sdev); return 0; } diff -u linux-aws-6.5-6.5.0/sound/usb/quirks.c linux-aws-6.5-6.5.0/sound/usb/quirks.c --- linux-aws-6.5-6.5.0/sound/usb/quirks.c +++ linux-aws-6.5-6.5.0/sound/usb/quirks.c @@ -2220,6 +2220,8 @@ QUIRK_FLAG_DSD_RAW), VENDOR_FLG(0x2ab6, /* T+A devices */ QUIRK_FLAG_DSD_RAW), + VENDOR_FLG(0x2afd, /* McIntosh Laboratory, Inc. */ + QUIRK_FLAG_DSD_RAW), VENDOR_FLG(0x2d87, /* Cayin device */ QUIRK_FLAG_DSD_RAW), VENDOR_FLG(0x3336, /* HEM devices */ diff -u linux-aws-6.5-6.5.0/tools/iio/iio_generic_buffer.c linux-aws-6.5-6.5.0/tools/iio/iio_generic_buffer.c --- linux-aws-6.5-6.5.0/tools/iio/iio_generic_buffer.c +++ linux-aws-6.5-6.5.0/tools/iio/iio_generic_buffer.c @@ -54,9 +54,12 @@ static unsigned int size_from_channelarray(struct iio_channel_info *channels, int num_channels) { unsigned int bytes = 0; - int i = 0; + int i = 0, max = 0; + unsigned int misalignment; while (i < num_channels) { + if (channels[i].bytes > max) + max = channels[i].bytes; if (bytes % channels[i].bytes == 0) channels[i].location = bytes; else @@ -66,6 +69,14 @@ bytes = channels[i].location + channels[i].bytes; i++; } + /* + * We want the data in next sample to also be properly aligned so + * we'll add padding at the end if needed. Adding padding only + * works for channel data which size is 2^n bytes. + */ + misalignment = bytes % max; + if (misalignment) + bytes += max - misalignment; return bytes; } diff -u linux-aws-6.5-6.5.0/tools/perf/Makefile.perf linux-aws-6.5-6.5.0/tools/perf/Makefile.perf --- linux-aws-6.5-6.5.0/tools/perf/Makefile.perf +++ linux-aws-6.5-6.5.0/tools/perf/Makefile.perf @@ -69,6 +69,10 @@ # Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support # for dwarf backtrace post unwind. # +# Define NO_LIBTRACEEVENT=1 if you don't want libtraceevent to be linked, +# this will remove multiple features and tools, such as 'perf trace', +# that need it to read tracefs event format files, etc. +# # Define NO_PERF_READ_VDSO32 if you do not want to build perf-read-vdso32 # for reading the 32-bit compatibility VDSO in 64-bit mode # diff -u linux-aws-6.5-6.5.0/tools/perf/builtin-lock.c linux-aws-6.5-6.5.0/tools/perf/builtin-lock.c --- linux-aws-6.5-6.5.0/tools/perf/builtin-lock.c +++ linux-aws-6.5-6.5.0/tools/perf/builtin-lock.c @@ -524,6 +524,7 @@ struct map *kmap; struct symbol *sym; u64 ip; + const char *arch = perf_env__arch(machine->env); if (list_empty(&callstack_filters)) return true; @@ -531,7 +532,21 @@ for (int i = 0; i < max_stack_depth; i++) { struct callstack_filter *filter; - if (!callstack || !callstack[i]) + /* + * In powerpc, the callchain saved by kernel always includes + * first three entries as the NIP (next instruction pointer), + * LR (link register), and the contents of LR save area in the + * second stack frame. In certain scenarios its possible to have + * invalid kernel instruction addresses in either LR or the second + * stack frame's LR. In that case, kernel will store that address as + * zero. + * + * The below check will continue to look into callstack, + * incase first or second callstack index entry has 0 + * address for powerpc. + */ + if (!callstack || (!callstack[i] && (strcmp(arch, "powerpc") || + (i != 1 && i != 2)))) break; ip = callstack[i]; diff -u linux-aws-6.5-6.5.0/tools/perf/pmu-events/arch/powerpc/power10/pmc.json linux-aws-6.5-6.5.0/tools/perf/pmu-events/arch/powerpc/power10/pmc.json --- linux-aws-6.5-6.5.0/tools/perf/pmu-events/arch/powerpc/power10/pmc.json +++ linux-aws-6.5-6.5.0/tools/perf/pmu-events/arch/powerpc/power10/pmc.json @@ -190,7 +190,7 @@ "BriefDescription": "Threshold counter exceeded a value of 128." }, { - "EventCode": "0x400FA", + "EventCode": "0x500FA", "EventName": "PM_RUN_INST_CMPL", "BriefDescription": "PowerPC instruction completed while the run latch is set." } diff -u linux-aws-6.5-6.5.0/tools/perf/util/dlfilter.c linux-aws-6.5-6.5.0/tools/perf/util/dlfilter.c --- linux-aws-6.5-6.5.0/tools/perf/util/dlfilter.c +++ linux-aws-6.5-6.5.0/tools/perf/util/dlfilter.c @@ -280,13 +280,21 @@ return &d->evsel->core.attr; } +static __s32 code_read(__u64 ip, struct map *map, struct machine *machine, void *buf, __u32 len) +{ + u64 offset = map__map_ip(map, ip); + + if (ip + len >= map__end(map)) + len = map__end(map) - ip; + + return dso__data_read_offset(map__dso(map), machine, offset, buf, len); +} + static __s32 dlfilter__object_code(void *ctx, __u64 ip, void *buf, __u32 len) { struct dlfilter *d = (struct dlfilter *)ctx; struct addr_location *al; struct addr_location a; - struct map *map; - u64 offset; __s32 ret; if (!d->ctx_valid) @@ -296,27 +304,17 @@ if (!al) return -1; - map = al->map; - - if (map && ip >= map__start(map) && ip < map__end(map) && + if (al->map && ip >= map__start(al->map) && ip < map__end(al->map) && machine__kernel_ip(d->machine, ip) == machine__kernel_ip(d->machine, d->sample->ip)) - goto have_map; + return code_read(ip, al->map, d->machine, buf, len); addr_location__init(&a); + thread__find_map_fb(al->thread, d->sample->cpumode, ip, &a); - if (!a.map) { - ret = -1; - goto out; - } - - map = a.map; -have_map: - offset = map__map_ip(map, ip); - if (ip + len >= map__end(map)) - len = map__end(map) - ip; - ret = dso__data_read_offset(map__dso(map), d->machine, offset, buf, len); -out: + ret = a.map ? code_read(ip, a.map, d->machine, buf, len) : -1; + addr_location__exit(&a); + return ret; } diff -u linux-aws-6.5-6.5.0/tools/perf/util/header.c linux-aws-6.5-6.5.0/tools/perf/util/header.c --- linux-aws-6.5-6.5.0/tools/perf/util/header.c +++ linux-aws-6.5-6.5.0/tools/perf/util/header.c @@ -746,20 +746,14 @@ * Do a first pass to count number of pmu to avoid lseek so this * works in pipe mode as well. */ - while ((pmu = perf_pmus__scan(pmu))) { - if (!pmu->name) - continue; + while ((pmu = perf_pmus__scan(pmu))) pmu_num++; - } ret = do_write(ff, &pmu_num, sizeof(pmu_num)); if (ret < 0) return ret; while ((pmu = perf_pmus__scan(pmu))) { - if (!pmu->name) - continue; - ret = do_write(ff, &pmu->type, sizeof(pmu->type)); if (ret < 0) return ret; diff -u linux-aws-6.5-6.5.0/tools/perf/util/parse-events.c linux-aws-6.5-6.5.0/tools/perf/util/parse-events.c --- linux-aws-6.5-6.5.0/tools/perf/util/parse-events.c +++ linux-aws-6.5-6.5.0/tools/perf/util/parse-events.c @@ -271,7 +271,7 @@ evsel->core.is_pmu_core = pmu ? pmu->is_core : false; evsel->auto_merge_stats = auto_merge_stats; evsel->pmu = pmu; - evsel->pmu_name = pmu && pmu->name ? strdup(pmu->name) : NULL; + evsel->pmu_name = pmu ? strdup(pmu->name) : NULL; if (name) evsel->name = strdup(name); @@ -446,9 +446,6 @@ if (parse_state->pmu_filter == NULL) return false; - if (pmu->name == NULL) - return true; - return strcmp(parse_state->pmu_filter, pmu->name) != 0; } @@ -793,13 +790,7 @@ parse_events_error__handle(parse_state->error, idx, strdup(errbuf), - strdup( -"Hint:\tValid config terms:\n" -" \tmap:[].value=[value]\n" -" \tmap:[].event=[event]\n" -"\n" -" \twhere is something like [0,3...5] or [all]\n" -" \t(add -v to see detail)")); + NULL); return err; } } @@ -1557,7 +1548,7 @@ } int parse_events_add_pmu(struct parse_events_state *parse_state, - struct list_head *list, char *name, + struct list_head *list, const char *name, struct list_head *head_config, bool auto_merge_stats) { diff -u linux-aws-6.5-6.5.0/tools/perf/util/parse-events.y linux-aws-6.5-6.5.0/tools/perf/util/parse-events.y --- linux-aws-6.5-6.5.0/tools/perf/util/parse-events.y +++ linux-aws-6.5-6.5.0/tools/perf/util/parse-events.y @@ -22,12 +22,6 @@ void parse_events_error(YYLTYPE *loc, void *parse_state, void *scanner, char const *msg); -#define ABORT_ON(val) \ -do { \ - if (val) \ - YYABORT; \ -} while (0) - #define PE_ABORT(val) \ do { \ if (val == -ENOMEM) \ @@ -70,8 +64,6 @@ %token PE_LEGACY_CACHE %token PE_PREFIX_MEM PE_PREFIX_RAW PE_PREFIX_GROUP %token PE_ERROR -%token PE_KERNEL_PMU_EVENT PE_PMU_EVENT_FAKE -%token PE_ARRAY_ALL PE_ARRAY_RANGE %token PE_DRV_CFG_TERM %token PE_TERM_HW %type PE_VALUE @@ -88,9 +80,8 @@ %type PE_MODIFIER_EVENT %type PE_MODIFIER_BP %type PE_EVENT_NAME -%type PE_KERNEL_PMU_EVENT PE_PMU_EVENT_FAKE %type PE_DRV_CFG_TERM -%type name_or_raw name_or_legacy +%type name_or_raw %destructor { free ($$); } %type event_term %destructor { parse_events_term__delete ($$); } @@ -117,10 +108,6 @@ %destructor { free_list_evsel ($$); } %type tracepoint_name %destructor { free ($$.sys); free ($$.event); } -%type array -%type array_term -%type array_terms -%destructor { free ($$.ranges); } %type PE_TERM_HW %destructor { free ($$.str); } @@ -135,7 +122,6 @@ char *sys; char *event; } tracepoint_name; - struct parse_events_array array; struct hardware_term { char *str; u64 num; @@ -326,7 +312,7 @@ } while ((pmu = perf_pmus__scan(pmu)) != NULL) { - char *name = pmu->name; + const char *name = pmu->name; if (parse_events__filter_pmu(parse_state, pmu)) continue; @@ -378,14 +364,2 @@ | -PE_KERNEL_PMU_EVENT sep_dc -{ - struct list_head *list; - int err; - - err = parse_events_multi_pmu_add(_parse_state, $1, NULL, &list); - free($1); - if (err < 0) - YYABORT; - $$ = list; -} -| PE_NAME sep_dc @@ -410,53 +384,2 @@ } -| -PE_KERNEL_PMU_EVENT opt_pmu_config -{ - struct list_head *list; - int err; - - /* frees $2 */ - err = parse_events_multi_pmu_add(_parse_state, $1, $2, &list); - free($1); - if (err < 0) - YYABORT; - $$ = list; -} -| -PE_PMU_EVENT_FAKE sep_dc -{ - struct list_head *list; - int err; - - list = alloc_list(); - if (!list) - YYABORT; - - err = parse_events_add_pmu(_parse_state, list, $1, /*head_config=*/NULL, - /*auto_merge_stats=*/false); - free($1); - if (err < 0) { - free(list); - YYABORT; - } - $$ = list; -} -| -PE_PMU_EVENT_FAKE opt_pmu_config -{ - struct list_head *list; - int err; - - list = alloc_list(); - if (!list) - YYABORT; - - err = parse_events_add_pmu(_parse_state, list, $1, $2, /*auto_merge_stats=*/false); - free($1); - parse_events_terms__delete($2); - if (err < 0) { - free(list); - YYABORT; - } - $$ = list; -} @@ -683,7 +606,9 @@ YYNOMEM; errno = 0; num = strtoull($1 + 1, NULL, 16); - ABORT_ON(errno); + /* Given the lexer will only give [a-fA-F0-9]+ a failure here should be impossible. */ + if (errno) + YYABORT; free($1); err = parse_events_add_numeric(_parse_state, list, PERF_TYPE_RAW, num, $2, /*wildcard=*/false); @@ -796,8 +721,6 @@ name_or_raw: PE_RAW | PE_NAME | PE_LEGACY_CACHE -name_or_legacy: PE_NAME | PE_LEGACY_CACHE - event_term: PE_RAW { @@ -812,7 +735,7 @@ $$ = term; } | -name_or_raw '=' name_or_legacy +name_or_raw '=' name_or_raw { struct parse_events_term *term; int err = parse_events_term__str(&term, PARSE_EVENTS__TERM_TYPE_USER, $1, $3, &@1, &@3); @@ -891,7 +814,7 @@ $$ = term; } | -PE_TERM '=' name_or_legacy +PE_TERM '=' name_or_raw { struct parse_events_term *term; int err = parse_events_term__str(&term, (int)$1, NULL, $3, &@1, &@3); @@ -951,29 +873,0 @@ -name_or_raw array '=' name_or_legacy -{ - struct parse_events_term *term; - int err = parse_events_term__str(&term, PARSE_EVENTS__TERM_TYPE_USER, $1, $4, &@1, &@4); - - if (err) { - free($1); - free($4); - free($2.ranges); - PE_ABORT(err); - } - term->array = $2; - $$ = term; -} -| -name_or_raw array '=' PE_VALUE -{ - struct parse_events_term *term; - int err = parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER, $1, $4, false, &@1, &@4); - - if (err) { - free($1); - free($2.ranges); - PE_ABORT(err); - } - term->array = $2; - $$ = term; -} -| @@ -994,65 +888,6 @@ $$ = term; } -array: -'[' array_terms ']' -{ - $$ = $2; -} -| -PE_ARRAY_ALL -{ - $$.nr_ranges = 0; - $$.ranges = NULL; -} - -array_terms: -array_terms ',' array_term -{ - struct parse_events_array new_array; - - new_array.nr_ranges = $1.nr_ranges + $3.nr_ranges; - new_array.ranges = realloc($1.ranges, - sizeof(new_array.ranges[0]) * - new_array.nr_ranges); - if (!new_array.ranges) - YYNOMEM; - memcpy(&new_array.ranges[$1.nr_ranges], $3.ranges, - $3.nr_ranges * sizeof(new_array.ranges[0])); - free($3.ranges); - $$ = new_array; -} -| -array_term - -array_term: -PE_VALUE -{ - struct parse_events_array array; - - array.nr_ranges = 1; - array.ranges = malloc(sizeof(array.ranges[0])); - if (!array.ranges) - YYNOMEM; - array.ranges[0].start = $1; - array.ranges[0].length = 1; - $$ = array; -} -| -PE_VALUE PE_ARRAY_RANGE PE_VALUE -{ - struct parse_events_array array; - - ABORT_ON($3 < $1); - array.nr_ranges = 1; - array.ranges = malloc(sizeof(array.ranges[0])); - if (!array.ranges) - YYNOMEM; - array.ranges[0].start = $1; - array.ranges[0].length = $3 - $1 + 1; - $$ = array; -} - sep_dc: ':' | sep_slash_slash_dc: '/' '/' | ':' | diff -u linux-aws-6.5-6.5.0/tools/perf/util/pmu.c linux-aws-6.5-6.5.0/tools/perf/util/pmu.c --- linux-aws-6.5-6.5.0/tools/perf/util/pmu.c +++ linux-aws-6.5-6.5.0/tools/perf/util/pmu.c @@ -29,7 +29,9 @@ #include "fncache.h" #include "util/evsel_config.h" -struct perf_pmu perf_pmu__fake; +struct perf_pmu perf_pmu__fake = { + .name = "fake", +}; /** * struct perf_pmu_format - Values from a format file read from @@ -840,13 +842,13 @@ return NULL; } -char * __weak +const char * __weak pmu_find_real_name(const char *name) { - return (char *)name; + return name; } -char * __weak +const char * __weak pmu_find_alias_name(const char *name __maybe_unused) { return NULL; @@ -866,8 +868,8 @@ LIST_HEAD(format); LIST_HEAD(aliases); __u32 type; - char *name = pmu_find_real_name(lookup_name); - char *alias_name; + const char *name = pmu_find_real_name(lookup_name); + const char *alias_name; /* * The pmu data we store & need consists of the pmu @@ -1710,7 +1712,7 @@ name ?: "N/A", buf, config_name, config); } -int perf_pmu__match(char *pattern, char *name, char *tok) +int perf_pmu__match(const char *pattern, const char *name, const char *tok) { if (!name) return -1; diff -u linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/Makefile linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/Makefile --- linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/Makefile +++ linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/Makefile @@ -7,12 +7,13 @@ nft_queue.sh nft_meta.sh nf_nat_edemux.sh \ ipip-conntrack-mtu.sh conntrack_tcp_unreplied.sh \ - conntrack_vrf.sh nft_synproxy.sh rpath.sh nft_audit.sh + conntrack_vrf.sh nft_synproxy.sh rpath.sh nft_audit.sh \ + conntrack_sctp_collision.sh xt_string.sh HOSTPKG_CONFIG := pkg-config CFLAGS += $(shell $(HOSTPKG_CONFIG) --cflags libmnl 2>/dev/null) LDLIBS += $(shell $(HOSTPKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl) -TEST_GEN_FILES = nf-queue connect_close audit_logread +TEST_GEN_FILES = nf-queue connect_close audit_logread sctp_collision include ../lib.mk diff -u linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/nft_audit.sh linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/nft_audit.sh --- linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/nft_audit.sh +++ linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/nft_audit.sh @@ -11,6 +11,12 @@ exit $SKIP_RC } +# Run everything in a separate network namespace +[ "${1}" != "run" ] && { unshare -n "${0}" run; exit $?; } + +# give other scripts a chance to finish - audit_logread sees all activity +sleep 1 + logfile=$(mktemp) rulefile=$(mktemp) echo "logging into $logfile" @@ -93,6 +99,12 @@ do_test 'nft add counter t2 c1; add counter t2 c2' \ 'table=t2 family=2 entries=2 op=nft_register_obj' +for ((i = 3; i <= 500; i++)); do + echo "add counter t2 c$i" +done >$rulefile +do_test "nft -f $rulefile" \ +'table=t2 family=2 entries=498 op=nft_register_obj' + # adding/updating quotas do_test 'nft add quota t1 q1 { 10 bytes }' \ @@ -101,6 +113,12 @@ do_test 'nft add quota t2 q1 { 10 bytes }; add quota t2 q2 { 10 bytes }' \ 'table=t2 family=2 entries=2 op=nft_register_obj' +for ((i = 3; i <= 500; i++)); do + echo "add quota t2 q$i { 10 bytes }" +done >$rulefile +do_test "nft -f $rulefile" \ +'table=t2 family=2 entries=498 op=nft_register_obj' + # changing the quota value triggers obj update path do_test 'nft add quota t1 q1 { 20 bytes }' \ 'table=t1 family=2 entries=1 op=nft_register_obj' @@ -150,6 +168,40 @@ do_test 'nft reset set t1 s' \ 'table=t1 family=2 entries=3 op=nft_reset_setelem' +# resetting counters + +do_test 'nft reset counter t1 c1' \ +'table=t1 family=2 entries=1 op=nft_reset_obj' + +do_test 'nft reset counters t1' \ +'table=t1 family=2 entries=1 op=nft_reset_obj' + +do_test 'nft reset counters t2' \ +'table=t2 family=2 entries=342 op=nft_reset_obj +table=t2 family=2 entries=158 op=nft_reset_obj' + +do_test 'nft reset counters' \ +'table=t1 family=2 entries=1 op=nft_reset_obj +table=t2 family=2 entries=341 op=nft_reset_obj +table=t2 family=2 entries=159 op=nft_reset_obj' + +# resetting quotas + +do_test 'nft reset quota t1 q1' \ +'table=t1 family=2 entries=1 op=nft_reset_obj' + +do_test 'nft reset quotas t1' \ +'table=t1 family=2 entries=1 op=nft_reset_obj' + +do_test 'nft reset quotas t2' \ +'table=t2 family=2 entries=315 op=nft_reset_obj +table=t2 family=2 entries=185 op=nft_reset_obj' + +do_test 'nft reset quotas' \ +'table=t1 family=2 entries=1 op=nft_reset_obj +table=t2 family=2 entries=314 op=nft_reset_obj +table=t2 family=2 entries=186 op=nft_reset_obj' + # deleting rules readarray -t handles < <(nft -a list chain t1 c1 | \ diff -u linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/Makefile linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/Makefile --- linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/Makefile +++ linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 +CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := resctrl_tests diff -u linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/resctrl.h linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/resctrl.h --- linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/resctrl.h +++ linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/resctrl.h @@ -1,5 +1,4 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#define _GNU_SOURCE #ifndef RESCTRL_H #define RESCTRL_H #include only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/ABI/testing/sysfs-bus-optee-devices +++ linux-aws-6.5-6.5.0/Documentation/ABI/testing/sysfs-bus-optee-devices @@ -6,3 +6,12 @@ OP-TEE bus provides reference to registered drivers under this directory. The matches Trusted Application (TA) driver and corresponding TA in secure OS. Drivers are free to create needed API under optee-ta- directory. + +What: /sys/bus/tee/devices/optee-ta-/need_supplicant +Date: November 2023 +KernelVersion: 6.7 +Contact: op-tee@lists.trustedfirmware.org +Description: + Allows to distinguish whether an OP-TEE based TA/device requires user-space + tee-supplicant to function properly or not. This attribute will be present for + devices which depend on tee-supplicant to be running. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/admin-guide/hw-vuln/srso.rst +++ linux-aws-6.5-6.5.0/Documentation/admin-guide/hw-vuln/srso.rst @@ -46,12 +46,22 @@ The processor is not vulnerable - * 'Vulnerable: no microcode': +* 'Vulnerable': + + The processor is vulnerable and no mitigations have been applied. + + * 'Vulnerable: No microcode': The processor is vulnerable, no microcode extending IBPB functionality to address the vulnerability has been applied. - * 'Mitigation: microcode': + * 'Vulnerable: Safe RET, no microcode': + + The "Safe RET" mitigation (see below) has been applied to protect the + kernel, but the IBPB-extending microcode has not been applied. User + space tasks may still be vulnerable. + + * 'Vulnerable: Microcode, no safe RET': Extended IBPB functionality microcode patch has been applied. It does not address User->Kernel and Guest->Host transitions protection but it @@ -72,11 +82,11 @@ (spec_rstack_overflow=microcode) - * 'Mitigation: safe RET': + * 'Mitigation: Safe RET': - Software-only mitigation. It complements the extended IBPB microcode - patch functionality by addressing User->Kernel and Guest->Host - transitions protection. + Combined microcode/software mitigation. It complements the + extended IBPB microcode patch functionality by addressing + User->Kernel and Guest->Host transitions protection. Selected by default or by spec_rstack_overflow=safe-ret @@ -129,7 +139,7 @@ microcode patch for one's system. This mitigation comes also at a performance cost. -Mitigation: safe RET +Mitigation: Safe RET -------------------- The mitigation works by ensuring all RET instructions speculate to only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/devicetree/bindings/interrupt-controller/qcom,mpm.yaml +++ linux-aws-6.5-6.5.0/Documentation/devicetree/bindings/interrupt-controller/qcom,mpm.yaml @@ -62,6 +62,9 @@ - description: MPM pin number - description: GIC SPI number for the MPM pin + '#power-domain-cells': + const: 0 + required: - compatible - reg @@ -93,4 +96,5 @@ <86 183>, <90 260>, <91 260>; + #power-domain-cells = <0>; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/devicetree/bindings/mfd/mt6397.txt +++ linux-aws-6.5-6.5.0/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -22,8 +22,9 @@ "mediatek,mt6323" for PMIC MT6323 "mediatek,mt6331" for PMIC MT6331 and MT6332 "mediatek,mt6357" for PMIC MT6357 - "mediatek,mt6358" for PMIC MT6358 and MT6366 + "mediatek,mt6358" for PMIC MT6358 "mediatek,mt6359" for PMIC MT6359 + "mediatek,mt6366", "mediatek,mt6358" for PMIC MT6366 "mediatek,mt6397" for PMIC MT6397 Optional subnodes: @@ -40,6 +41,7 @@ - compatible: "mediatek,mt6323-regulator" see ../regulator/mt6323-regulator.txt - compatible: "mediatek,mt6358-regulator" + - compatible: "mediatek,mt6366-regulator", "mediatek-mt6358-regulator" see ../regulator/mt6358-regulator.txt - compatible: "mediatek,mt6397-regulator" see ../regulator/mt6397-regulator.txt only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml +++ linux-aws-6.5-6.5.0/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml @@ -69,7 +69,7 @@ maxItems: 4 clocks: - minItems: 3 + minItems: 2 items: - description: Main peripheral bus clock, PCLK/HCLK - AHB Bus clock - description: SDC MMC clock, MCLK only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml +++ linux-aws-6.5-6.5.0/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml @@ -27,6 +27,27 @@ vdd3-supply: true + qcom,tune-usb2-disc-thres: + $ref: /schemas/types.yaml#/definitions/uint8 + description: High-Speed disconnect threshold + minimum: 0 + maximum: 7 + default: 0 + + qcom,tune-usb2-amplitude: + $ref: /schemas/types.yaml#/definitions/uint8 + description: High-Speed trasmit amplitude + minimum: 0 + maximum: 15 + default: 8 + + qcom,tune-usb2-preem: + $ref: /schemas/types.yaml#/definitions/uint8 + description: High-Speed TX pre-emphasis tuning + minimum: 0 + maximum: 7 + default: 5 + required: - compatible - reg only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/devicetree/bindings/serial/rs485.yaml +++ linux-aws-6.5-6.5.0/Documentation/devicetree/bindings/serial/rs485.yaml @@ -29,6 +29,10 @@ default: 0 maximum: 100 + rs485-rts-active-high: + description: drive RTS high when sending (this is the default). + $ref: /schemas/types.yaml#/definitions/flag + rs485-rts-active-low: description: drive RTS low when sending (default is high). $ref: /schemas/types.yaml#/definitions/flag only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/devicetree/bindings/serial/serial.yaml +++ linux-aws-6.5-6.5.0/Documentation/devicetree/bindings/serial/serial.yaml @@ -96,7 +96,7 @@ rts-gpios: false patternProperties: - "^bluetooth|gnss|gps|mcu$": + "^(bluetooth|gnss|gps|mcu)$": if: type: object then: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/devicetree/bindings/timer/renesas,rz-mtu3.yaml +++ linux-aws-6.5-6.5.0/Documentation/devicetree/bindings/timer/renesas,rz-mtu3.yaml @@ -169,27 +169,27 @@ - const: tgib0 - const: tgic0 - const: tgid0 - - const: tgiv0 + - const: tciv0 - const: tgie0 - const: tgif0 - const: tgia1 - const: tgib1 - - const: tgiv1 - - const: tgiu1 + - const: tciv1 + - const: tciu1 - const: tgia2 - const: tgib2 - - const: tgiv2 - - const: tgiu2 + - const: tciv2 + - const: tciu2 - const: tgia3 - const: tgib3 - const: tgic3 - const: tgid3 - - const: tgiv3 + - const: tciv3 - const: tgia4 - const: tgib4 - const: tgic4 - const: tgid4 - - const: tgiv4 + - const: tciv4 - const: tgiu5 - const: tgiv5 - const: tgiw5 @@ -197,18 +197,18 @@ - const: tgib6 - const: tgic6 - const: tgid6 - - const: tgiv6 + - const: tciv6 - const: tgia7 - const: tgib7 - const: tgic7 - const: tgid7 - - const: tgiv7 + - const: tciv7 - const: tgia8 - const: tgib8 - const: tgic8 - const: tgid8 - - const: tgiv8 - - const: tgiu8 + - const: tciv8 + - const: tciu8 clocks: maxItems: 1 @@ -285,16 +285,16 @@ , , ; - interrupt-names = "tgia0", "tgib0", "tgic0", "tgid0", "tgiv0", "tgie0", + interrupt-names = "tgia0", "tgib0", "tgic0", "tgid0", "tciv0", "tgie0", "tgif0", - "tgia1", "tgib1", "tgiv1", "tgiu1", - "tgia2", "tgib2", "tgiv2", "tgiu2", - "tgia3", "tgib3", "tgic3", "tgid3", "tgiv3", - "tgia4", "tgib4", "tgic4", "tgid4", "tgiv4", + "tgia1", "tgib1", "tciv1", "tciu1", + "tgia2", "tgib2", "tciv2", "tciu2", + "tgia3", "tgib3", "tgic3", "tgid3", "tciv3", + "tgia4", "tgib4", "tgic4", "tgid4", "tciv4", "tgiu5", "tgiv5", "tgiw5", - "tgia6", "tgib6", "tgic6", "tgid6", "tgiv6", - "tgia7", "tgib7", "tgic7", "tgid7", "tgiv7", - "tgia8", "tgib8", "tgic8", "tgid8", "tgiv8", "tgiu8"; + "tgia6", "tgib6", "tgic6", "tgid6", "tciv6", + "tgia7", "tgib7", "tgic7", "tgid7", "tciv7", + "tgia8", "tgib8", "tgic8", "tgid8", "tciv8", "tciu8"; clocks = <&cpg CPG_MOD R9A07G044_MTU_X_MCK_MTU3>; power-domains = <&cpg>; resets = <&cpg R9A07G044_MTU_X_PRESET_MTU3>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml +++ linux-aws-6.5-6.5.0/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml @@ -36,7 +36,11 @@ vdd-supply: description: - VDD power supply to the hub + 3V3 power supply to the hub + + vdd2-supply: + description: + 1V2 power supply to the hub peer-hub: $ref: /schemas/types.yaml#/definitions/phandle @@ -62,6 +66,7 @@ properties: reset-gpios: false vdd-supply: false + vdd2-supply: false peer-hub: false i2c-bus: false else: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/i2c/busses/i2c-i801.rst +++ linux-aws-6.5-6.5.0/Documentation/i2c/busses/i2c-i801.rst @@ -47,6 +47,7 @@ * Intel Alder Lake (PCH) * Intel Raptor Lake (PCH) * Intel Meteor Lake (SOC and PCH) + * Intel Birch Stream (SOC) Datasheets: Publicly available at the Intel website only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst +++ linux-aws-6.5-6.5.0/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst @@ -683,6 +683,12 @@ time protocol. - Error + * - `ptp_cq[i]_late_cqe` + - Number of times a CQE has been delivered on the PTP timestamping CQ when + the CQE was not expected since a certain amount of time had elapsed where + the device typically ensures not posting the CQE. + - Error + .. [#ring_global] The corresponding ring and global counters do not share the same name (i.e. do not follow the common naming scheme). only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/index.rst +++ linux-aws-6.5-6.5.0/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/index.rst @@ -13,7 +13,6 @@ :maxdepth: 2 kconfig - devlink switchdev tracepoints counters only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/networking/devlink/mlx5.rst +++ linux-aws-6.5-6.5.0/Documentation/networking/devlink/mlx5.rst @@ -18,6 +18,11 @@ * - ``enable_roce`` - driverinit - Type: Boolean + + If the device supports RoCE disablement, RoCE enablement state controls + device support for RoCE capability. Otherwise, the control occurs in the + driver stack. When RoCE is disabled at the driver level, only raw + ethernet QPs are supported. * - ``io_eq_size`` - driverinit - The range is between 64 and 4096. @@ -48,6 +53,9 @@ * ``smfs`` Software managed flow steering. In SMFS mode, the HW steering entities are created and manage through the driver without firmware intervention. + + SMFS mode is faster and provides better rule insertion rate compared to + default DMFS mode. * - ``fdb_large_groups`` - u32 - driverinit @@ -71,7 +79,24 @@ deprecated. Default: disabled + * - ``esw_port_metadata`` + - Boolean + - runtime + - When applicable, disabling eswitch metadata can increase packet rate up + to 20% depending on the use case and packet sizes. + + Eswitch port metadata state controls whether to internally tag packets + with metadata. Metadata tagging must be enabled for multi-port RoCE, + failover between representors and stacked devices. By default metadata is + enabled on the supported devices in E-switch. Metadata is applicable only + for E-switch in switchdev mode and users may disable it when NONE of the + below use cases will be in use: + 1. HCA is in Dual/multi-port RoCE mode. + 2. VF/SF representor bonding (Usually used for Live migration) + 3. Stacked devices + When metadata is disabled, the above use cases will fail to initialize if + users try to enable them. * - ``hairpin_num_queues`` - u32 - driverinit @@ -104,3 +129,160 @@ * - ``fw.version`` - stored, running - Three digit major.minor.subminor firmware version number. + +Health reporters +================ + +tx reporter +----------- +The tx reporter is responsible for reporting and recovering of the following three error scenarios: + +- tx timeout + Report on kernel tx timeout detection. + Recover by searching lost interrupts. +- tx error completion + Report on error tx completion. + Recover by flushing the tx queue and reset it. +- tx PTP port timestamping CQ unhealthy + Report too many CQEs never delivered on port ts CQ. + Recover by flushing and re-creating all PTP channels. + +tx reporter also support on demand diagnose callback, on which it provides +real time information of its send queues status. + +User commands examples: + +- Diagnose send queues status:: + + $ devlink health diagnose pci/0000:82:00.0 reporter tx + +.. note:: + This command has valid output only when interface is up, otherwise the command has empty output. + +- Show number of tx errors indicated, number of recover flows ended successfully, + is autorecover enabled and graceful period from last recover:: + + $ devlink health show pci/0000:82:00.0 reporter tx + +rx reporter +----------- +The rx reporter is responsible for reporting and recovering of the following two error scenarios: + +- rx queues' initialization (population) timeout + Population of rx queues' descriptors on ring initialization is done + in napi context via triggering an irq. In case of a failure to get + the minimum amount of descriptors, a timeout would occur, and + descriptors could be recovered by polling the EQ (Event Queue). +- rx completions with errors (reported by HW on interrupt context) + Report on rx completion error. + Recover (if needed) by flushing the related queue and reset it. + +rx reporter also supports on demand diagnose callback, on which it +provides real time information of its receive queues' status. + +- Diagnose rx queues' status and corresponding completion queue:: + + $ devlink health diagnose pci/0000:82:00.0 reporter rx + +.. note:: + This command has valid output only when interface is up. Otherwise, the command has empty output. + +- Show number of rx errors indicated, number of recover flows ended successfully, + is autorecover enabled, and graceful period from last recover:: + + $ devlink health show pci/0000:82:00.0 reporter rx + +fw reporter +----------- +The fw reporter implements `diagnose` and `dump` callbacks. +It follows symptoms of fw error such as fw syndrome by triggering +fw core dump and storing it into the dump buffer. +The fw reporter diagnose command can be triggered any time by the user to check +current fw status. + +User commands examples: + +- Check fw heath status:: + + $ devlink health diagnose pci/0000:82:00.0 reporter fw + +- Read FW core dump if already stored or trigger new one:: + + $ devlink health dump show pci/0000:82:00.0 reporter fw + +.. note:: + This command can run only on the PF which has fw tracer ownership, + running it on other PF or any VF will return "Operation not permitted". + +fw fatal reporter +----------------- +The fw fatal reporter implements `dump` and `recover` callbacks. +It follows fatal errors indications by CR-space dump and recover flow. +The CR-space dump uses vsc interface which is valid even if the FW command +interface is not functional, which is the case in most FW fatal errors. +The recover function runs recover flow which reloads the driver and triggers fw +reset if needed. +On firmware error, the health buffer is dumped into the dmesg. The log +level is derived from the error's severity (given in health buffer). + +User commands examples: + +- Run fw recover flow manually:: + + $ devlink health recover pci/0000:82:00.0 reporter fw_fatal + +- Read FW CR-space dump if already stored or trigger new one:: + + $ devlink health dump show pci/0000:82:00.1 reporter fw_fatal + +.. note:: + This command can run only on PF. + +vnic reporter +------------- +The vnic reporter implements only the `diagnose` callback. +It is responsible for querying the vnic diagnostic counters from fw and displaying +them in realtime. + +Description of the vnic counters: + +- total_q_under_processor_handle + number of queues in an error state due to + an async error or errored command. +- send_queue_priority_update_flow + number of QP/SQ priority/SL update events. +- cq_overrun + number of times CQ entered an error state due to an overflow. +- async_eq_overrun + number of times an EQ mapped to async events was overrun. + comp_eq_overrun number of times an EQ mapped to completion events was + overrun. +- quota_exceeded_command + number of commands issued and failed due to quota exceeded. +- invalid_command + number of commands issued and failed dues to any reason other than quota + exceeded. +- nic_receive_steering_discard + number of packets that completed RX flow + steering but were discarded due to a mismatch in flow table. +- generated_pkt_steering_fail + number of packets generated by the VNIC experiencing unexpected steering + failure (at any point in steering flow). +- handled_pkt_steering_fail + number of packets handled by the VNIC experiencing unexpected steering + failure (at any point in steering flow owned by the VNIC, including the FDB + for the eswitch owner). + +User commands examples: + +- Diagnose PF/VF vnic counters:: + + $ devlink health diagnose pci/0000:82:00.1 reporter vnic + +- Diagnose representor vnic counters (performed by supplying devlink port of the + representor, which can be obtained via devlink port command):: + + $ devlink health diagnose pci/0000:82:00.1/65537 reporter vnic + +.. note:: + This command can run over all interfaces such as PF/VF and representor ports. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/networking/representors.rst +++ linux-aws-6.5-6.5.0/Documentation/networking/representors.rst @@ -162,9 +162,11 @@ The representor netdevice should *not* directly refer to a PCIe device (e.g. through ``net_dev->dev.parent`` / ``SET_NETDEV_DEV()``), either of the representee or of the switchdev function. -Instead, it should implement the ``ndo_get_devlink_port()`` netdevice op, which -the kernel uses to provide the ``phys_switch_id`` and ``phys_port_name`` sysfs -nodes. (Some legacy drivers implement ``ndo_get_port_parent_id()`` and +Instead, the driver should use the ``SET_NETDEV_DEVLINK_PORT`` macro to +assign a devlink port instance to the netdevice before registering the +netdevice; the kernel uses the devlink port to provide the ``phys_switch_id`` +and ``phys_port_name`` sysfs nodes. +(Some legacy drivers implement ``ndo_get_port_parent_id()`` and ``ndo_get_phys_port_name()`` directly, but this is deprecated.) See :ref:`Documentation/networking/devlink/devlink-port.rst ` for the details of this API. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/rust/general-information.rst +++ linux-aws-6.5-6.5.0/Documentation/rust/general-information.rst @@ -29,7 +29,7 @@ To read the docs locally in your web browser, run e.g.:: - xdg-open rust/doc/kernel/index.html + xdg-open Documentation/output/rust/rustdoc/kernel/index.html To learn about how to write the documentation, please see coding-guidelines.rst. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/Documentation/rust/index.rst +++ linux-aws-6.5-6.5.0/Documentation/rust/index.rst @@ -6,6 +6,14 @@ Documentation related to Rust within the kernel. To start using Rust in the kernel, please read the quick-start.rst guide. +.. only:: rustdoc and html + + You can also browse `rustdoc documentation `_. + +.. only:: not rustdoc and html + + This documentation does not include rustdoc generated information. + .. toctree:: :maxdepth: 1 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/Kconfig +++ linux-aws-6.5-6.5.0/arch/Kconfig @@ -34,6 +34,9 @@ config HOTPLUG_SMT bool +config SMT_NUM_THREADS_DYNAMIC + bool + # Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL config HOTPLUG_CORE_SYNC bool only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm2711-rpi-400.dts @@ -36,9 +36,7 @@ gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; }; -&leds { - /delete-node/ led_act; -}; +/delete-node/ &led_act; &pm { /delete-property/ system-power-controller; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi @@ -181,5 +181,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm4708-luxul-xap-1510.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm4708-luxul-xap-1510.dts @@ -85,5 +85,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm4708-luxul-xwc-1000.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm4708-luxul-xwc-1000.dts @@ -88,5 +88,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm4708-netgear-r6250.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm4708-netgear-r6250.dts @@ -122,5 +122,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm4708-smartrg-sr400ac.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm4708-smartrg-sr400ac.dts @@ -145,6 +145,14 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47081-buffalo-wzr-600dhp2.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47081-buffalo-wzr-600dhp2.dts @@ -145,5 +145,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47081-luxul-xap-1410.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47081-luxul-xap-1410.dts @@ -81,5 +81,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47081-luxul-xwr-1200.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47081-luxul-xwr-1200.dts @@ -148,5 +148,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts @@ -227,6 +227,14 @@ label = "wan"; }; + port@5 { + status = "disabled"; + }; + + port@7 { + status = "disabled"; + }; + port@8 { label = "cpu"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-885l.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-885l.dts @@ -143,6 +143,14 @@ label = "wan"; }; + port@5 { + status = "disabled"; + }; + + port@7 { + status = "disabled"; + }; + port@8 { label = "cpu"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-890l.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-890l.dts @@ -191,6 +191,14 @@ label = "wan"; }; + port@5 { + status = "disabled"; + }; + + port@7 { + status = "disabled"; + }; + port@8 { label = "cpu"; phy-mode = "rgmii"; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47094-luxul-abr-4500.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47094-luxul-abr-4500.dts @@ -107,5 +107,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47094-luxul-xap-1610.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47094-luxul-xap-1610.dts @@ -83,5 +83,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47094-luxul-xbr-4500.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47094-luxul-xbr-4500.dts @@ -107,5 +107,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwc-2000.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwc-2000.dts @@ -75,5 +75,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3100.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3100.dts @@ -147,5 +147,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3150-v1.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3150-v1.dts @@ -122,5 +122,13 @@ port@5 { label = "cpu"; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm53015-meraki-mr26.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm53015-meraki-mr26.dts @@ -124,6 +124,14 @@ full-duplex; }; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm53016-meraki-mr32.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm53016-meraki-mr32.dts @@ -185,6 +185,14 @@ full-duplex; }; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/broadcom/bcm953012er.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/broadcom/bcm953012er.dts @@ -84,6 +84,14 @@ label = "cpu"; ethernet = <&gmac0>; }; + + port@7 { + status = "disabled"; + }; + + port@8 { + status = "disabled"; + }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/nxp/imx/imx6q-skov-reve-mi1010ait-1cp1.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/nxp/imx/imx6q-skov-reve-mi1010ait-1cp1.dts @@ -37,9 +37,9 @@ &clks { assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>, - <&clks IMX6QDL_CLK_LDB_DI1_SEL>; + <&clks IMX6QDL_CLK_LDB_DI1_SEL>, <&clks IMX6QDL_CLK_ENET_REF_SEL>; assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>, - <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>; + <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>, <&clk50m_phy>; }; &hdmi { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/nxp/imx/imx6ul-pico.dtsi +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/nxp/imx/imx6ul-pico.dtsi @@ -121,6 +121,8 @@ max-speed = <100>; interrupt-parent = <&gpio5>; interrupts = <6 IRQ_TYPE_LEVEL_LOW>; + clocks = <&clks IMX6UL_CLK_ENET_REF>; + clock-names = "rmii-ref"; }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/nxp/imx/imx7s.dtsi +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/nxp/imx/imx7s.dtsi @@ -454,7 +454,7 @@ }; gpt1: timer@302d0000 { - compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; + compatible = "fsl,imx7d-gpt", "fsl,imx6dl-gpt"; reg = <0x302d0000 0x10000>; interrupts = ; clocks = <&clks IMX7D_GPT1_ROOT_CLK>, @@ -463,7 +463,7 @@ }; gpt2: timer@302e0000 { - compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; + compatible = "fsl,imx7d-gpt", "fsl,imx6dl-gpt"; reg = <0x302e0000 0x10000>; interrupts = ; clocks = <&clks IMX7D_GPT2_ROOT_CLK>, @@ -473,7 +473,7 @@ }; gpt3: timer@302f0000 { - compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; + compatible = "fsl,imx7d-gpt", "fsl,imx6dl-gpt"; reg = <0x302f0000 0x10000>; interrupts = ; clocks = <&clks IMX7D_GPT3_ROOT_CLK>, @@ -483,7 +483,7 @@ }; gpt4: timer@30300000 { - compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; + compatible = "fsl,imx7d-gpt", "fsl,imx6dl-gpt"; reg = <0x30300000 0x10000>; interrupts = ; clocks = <&clks IMX7D_GPT4_ROOT_CLK>, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts @@ -8,6 +8,7 @@ #include "imx28-lwe.dtsi" / { + model = "Liebherr XEA board"; compatible = "lwn,imx28-xea", "fsl,imx28"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/qcom/qcom-apq8026-samsung-matisse-wifi.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/qcom/qcom-apq8026-samsung-matisse-wifi.dts @@ -45,11 +45,11 @@ event-hall-sensor { label = "Hall Effect Sensor"; - gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>; - interrupts = <&tlmm 110 IRQ_TYPE_EDGE_FALLING>; + gpios = <&tlmm 110 GPIO_ACTIVE_LOW>; linux,input-type = ; linux,code = ; debounce-interval = <15>; + linux,can-disable; wakeup-source; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/qcom/qcom-mdm9615.dtsi +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/qcom/qcom-mdm9615.dtsi @@ -46,14 +46,12 @@ }; }; - regulators { - vsdcc_fixed: vsdcc-regulator { - compatible = "regulator-fixed"; - regulator-name = "SDCC Power"; - regulator-min-microvolt = <2700000>; - regulator-max-microvolt = <2700000>; - regulator-always-on; - }; + vsdcc_fixed: vsdcc-regulator { + compatible = "regulator-fixed"; + regulator-name = "SDCC Power"; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <2700000>; + regulator-always-on; }; soc: soc { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/renesas/r8a7792-blanche.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/renesas/r8a7792-blanche.dts @@ -239,7 +239,7 @@ }; keyboard_pins: keyboard { - pins = "GP_3_10", "GP_3_11", "GP_3_12", "GP_3_15", "GP_11_02"; + pins = "GP_3_10", "GP_3_11", "GP_3_12", "GP_3_15", "GP_11_2"; bias-pull-up; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -64,7 +64,8 @@ compatible = "arm,armv7-timer"; interrupts = , , - ; + , + ; arm,cpu-registers-not-fw-configured; clock-frequency = <24000000>; }; @@ -233,7 +234,7 @@ compatible = "rockchip,rk3128-timer", "rockchip,rk3288-timer"; reg = <0x20044000 0x20>; interrupts = ; - clocks = <&cru PCLK_TIMER>, <&xin24m>; + clocks = <&cru PCLK_TIMER>, <&cru SCLK_TIMER0>; clock-names = "pclk", "timer"; }; @@ -241,7 +242,7 @@ compatible = "rockchip,rk3128-timer", "rockchip,rk3288-timer"; reg = <0x20044020 0x20>; interrupts = ; - clocks = <&cru PCLK_TIMER>, <&xin24m>; + clocks = <&cru PCLK_TIMER>, <&cru SCLK_TIMER1>; clock-names = "pclk", "timer"; }; @@ -249,7 +250,7 @@ compatible = "rockchip,rk3128-timer", "rockchip,rk3288-timer"; reg = <0x20044040 0x20>; interrupts = ; - clocks = <&cru PCLK_TIMER>, <&xin24m>; + clocks = <&cru PCLK_TIMER>, <&cru SCLK_TIMER2>; clock-names = "pclk", "timer"; }; @@ -257,7 +258,7 @@ compatible = "rockchip,rk3128-timer", "rockchip,rk3288-timer"; reg = <0x20044060 0x20>; interrupts = ; - clocks = <&cru PCLK_TIMER>, <&xin24m>; + clocks = <&cru PCLK_TIMER>, <&cru SCLK_TIMER3>; clock-names = "pclk", "timer"; }; @@ -265,7 +266,7 @@ compatible = "rockchip,rk3128-timer", "rockchip,rk3288-timer"; reg = <0x20044080 0x20>; interrupts = ; - clocks = <&cru PCLK_TIMER>, <&xin24m>; + clocks = <&cru PCLK_TIMER>, <&cru SCLK_TIMER4>; clock-names = "pclk", "timer"; }; @@ -273,7 +274,7 @@ compatible = "rockchip,rk3128-timer", "rockchip,rk3288-timer"; reg = <0x200440a0 0x20>; interrupts = ; - clocks = <&cru PCLK_TIMER>, <&xin24m>; + clocks = <&cru PCLK_TIMER>, <&cru SCLK_TIMER5>; clock-names = "pclk", "timer"; }; @@ -426,7 +427,7 @@ i2c0: i2c@20072000 { compatible = "rockchip,rk3128-i2c", "rockchip,rk3288-i2c"; - reg = <20072000 0x1000>; + reg = <0x20072000 0x1000>; interrupts = ; clock-names = "i2c"; clocks = <&cru PCLK_I2C0>; @@ -458,6 +459,7 @@ interrupts = , ; arm,pl330-broken-no-flushp; + arm,pl330-periph-burst; clocks = <&cru ACLK_DMAC>; clock-names = "apb_pclk"; #dma-cells = <1>; @@ -793,7 +795,7 @@ }; sdmmc_pwren: sdmmc-pwren { - rockchip,pins = <1 RK_PB6 1 &pcfg_pull_default>; + rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_default>; }; sdmmc_bus4: sdmmc-bus4 { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/ti/omap/am3517-evm.dts +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/ti/omap/am3517-evm.dts @@ -271,13 +271,6 @@ >; }; - leds_pins: leds-pins { - pinctrl-single,pins = < - OMAP3_WKUP_IOPAD(0x2a24, PIN_OUTPUT_PULLUP | MUX_MODE4) /* jtag_emu0.gpio_11 */ - OMAP3_WKUP_IOPAD(0x2a26, PIN_OUTPUT_PULLUP | MUX_MODE4) /* jtag_emu1.gpio_31 */ - >; - }; - mmc1_pins: mmc1-pins { pinctrl-single,pins = < OMAP3_CORE1_IOPAD(0x2144, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */ @@ -355,3 +348,12 @@ >; }; }; + +&omap3_pmx_wkup { + leds_pins: leds-pins { + pinctrl-single,pins = < + OMAP3_WKUP_IOPAD(0x2a24, PIN_OUTPUT_PULLUP | MUX_MODE4) /* jtag_emu0.gpio_11 */ + OMAP3_WKUP_IOPAD(0x2a26, PIN_OUTPUT_PULLUP | MUX_MODE4) /* jtag_emu1.gpio_31 */ + >; + }; +}; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/ti/omap/omap4-l4-abe.dtsi +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/ti/omap/omap4-l4-abe.dtsi @@ -109,6 +109,8 @@ reg = <0x0 0xff>, /* MPU private access */ <0x49022000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP4_MCBSP1_CLKCTRL 24>; + clock-names = "fck"; interrupts = ; interrupt-names = "common"; ti,buffer-size = <128>; @@ -142,6 +144,8 @@ reg = <0x0 0xff>, /* MPU private access */ <0x49024000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP4_MCBSP2_CLKCTRL 24>; + clock-names = "fck"; interrupts = ; interrupt-names = "common"; ti,buffer-size = <128>; @@ -175,6 +179,8 @@ reg = <0x0 0xff>, /* MPU private access */ <0x49026000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP4_MCBSP3_CLKCTRL 24>; + clock-names = "fck"; interrupts = ; interrupt-names = "common"; ti,buffer-size = <128>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/ti/omap/omap4-l4.dtsi +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/ti/omap/omap4-l4.dtsi @@ -2043,6 +2043,8 @@ compatible = "ti,omap4-mcbsp"; reg = <0x0 0xff>; /* L4 Interconnect */ reg-names = "mpu"; + clocks = <&l4_per_clkctrl OMAP4_MCBSP4_CLKCTRL 24>; + clock-names = "fck"; interrupts = ; interrupt-names = "common"; ti,buffer-size = <128>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/boot/dts/ti/omap/omap5-l4-abe.dtsi +++ linux-aws-6.5-6.5.0/arch/arm/boot/dts/ti/omap/omap5-l4-abe.dtsi @@ -109,6 +109,8 @@ reg = <0x0 0xff>, /* MPU private access */ <0x49022000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP5_MCBSP1_CLKCTRL 24>; + clock-names = "fck"; interrupts = ; interrupt-names = "common"; ti,buffer-size = <128>; @@ -142,6 +144,8 @@ reg = <0x0 0xff>, /* MPU private access */ <0x49024000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP5_MCBSP2_CLKCTRL 24>; + clock-names = "fck"; interrupts = ; interrupt-names = "common"; ti,buffer-size = <128>; @@ -175,6 +179,8 @@ reg = <0x0 0xff>, /* MPU private access */ <0x49026000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP5_MCBSP3_CLKCTRL 24>; + clock-names = "fck"; interrupts = ; interrupt-names = "common"; ti,buffer-size = <128>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/include/asm/arm_pmuv3.h +++ linux-aws-6.5-6.5.0/arch/arm/include/asm/arm_pmuv3.h @@ -23,6 +23,8 @@ #define PMUSERENR __ACCESS_CP15(c9, 0, c14, 0) #define PMINTENSET __ACCESS_CP15(c9, 0, c14, 1) #define PMINTENCLR __ACCESS_CP15(c9, 0, c14, 2) +#define PMCEID2 __ACCESS_CP15(c9, 0, c14, 4) +#define PMCEID3 __ACCESS_CP15(c9, 0, c14, 5) #define PMMIR __ACCESS_CP15(c9, 0, c14, 6) #define PMCCFILTR __ACCESS_CP15(c14, 0, c15, 7) @@ -150,21 +152,6 @@ return read_sysreg(PMCCNTR); } -static inline void write_pmxevcntr(u32 val) -{ - write_sysreg(val, PMXEVCNTR); -} - -static inline u32 read_pmxevcntr(void) -{ - return read_sysreg(PMXEVCNTR); -} - -static inline void write_pmxevtyper(u32 val) -{ - write_sysreg(val, PMXEVTYPER); -} - static inline void write_pmcntenset(u32 val) { write_sysreg(val, PMCNTENSET); @@ -205,16 +192,6 @@ write_sysreg(val, PMUSERENR); } -static inline u32 read_pmceid0(void) -{ - return read_sysreg(PMCEID0); -} - -static inline u32 read_pmceid1(void) -{ - return read_sysreg(PMCEID1); -} - static inline void kvm_set_pmu_events(u32 set, struct perf_event_attr *attr) {} static inline void kvm_clr_pmu_events(u32 clr) {} static inline bool kvm_pmu_counter_deferred(struct perf_event_attr *attr) @@ -229,6 +206,7 @@ /* PMU Version in DFR Register */ #define ARMV8_PMU_DFR_VER_NI 0 +#define ARMV8_PMU_DFR_VER_V3P1 0x4 #define ARMV8_PMU_DFR_VER_V3P4 0x5 #define ARMV8_PMU_DFR_VER_V3P5 0x6 #define ARMV8_PMU_DFR_VER_IMP_DEF 0xF @@ -249,4 +227,24 @@ return pmuver >= ARMV8_PMU_DFR_VER_V3P5; } +static inline u64 read_pmceid0(void) +{ + u64 val = read_sysreg(PMCEID0); + + if (read_pmuver() >= ARMV8_PMU_DFR_VER_V3P1) + val |= (u64)read_sysreg(PMCEID2) << 32; + + return val; +} + +static inline u64 read_pmceid1(void) +{ + u64 val = read_sysreg(PMCEID1); + + if (read_pmuver() >= ARMV8_PMU_DFR_VER_V3P1) + val |= (u64)read_sysreg(PMCEID3) << 32; + + return val; +} + #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/include/asm/dma.h +++ linux-aws-6.5-6.5.0/arch/arm/include/asm/dma.h @@ -12,6 +12,9 @@ extern phys_addr_t arm_dma_zone_size; \ arm_dma_zone_size && arm_dma_zone_size < (0x100000000ULL - PAGE_OFFSET) ? \ (PAGE_OFFSET + arm_dma_zone_size) : 0xffffffffUL; }) + +extern phys_addr_t arm_dma_limit; +#define ARCH_LOW_ADDRESS_LIMIT arm_dma_limit #endif #ifdef CONFIG_ISA_DMA_API only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/include/asm/exception.h +++ linux-aws-6.5-6.5.0/arch/arm/include/asm/exception.h @@ -10,10 +10,6 @@ #include -#ifdef CONFIG_FUNCTION_GRAPH_TRACER #define __exception_irq_entry __irq_entry -#else -#define __exception_irq_entry -#endif #endif /* __ASM_ARM_EXCEPTION_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/lib/memset.S +++ linux-aws-6.5-6.5.0/arch/arm/lib/memset.S @@ -17,6 +17,7 @@ ENTRY(mmioset) WEAK(memset) UNWIND( .fnstart ) + and r1, r1, #255 @ cast to unsigned char ands r3, r0, #3 @ 1 unaligned? mov ip, r0 @ preserve r0 as return value bne 6f @ 1 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/mach-imx/mmdc.c +++ linux-aws-6.5-6.5.0/arch/arm/mach-imx/mmdc.c @@ -501,6 +501,10 @@ name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "mmdc%d", ret); + if (!name) { + ret = -ENOMEM; + goto pmu_release_id; + } pmu_mmdc->mmdc_ipg_clk = mmdc_ipg_clk; pmu_mmdc->devtype_data = (struct fsl_mmdc_devtype_data *)of_id->data; @@ -523,9 +527,10 @@ pmu_register_err: pr_warn("MMDC Perf PMU failed (%d), disabled\n", ret); - ida_simple_remove(&mmdc_ida, pmu_mmdc->id); cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node); hrtimer_cancel(&pmu_mmdc->hrtimer); +pmu_release_id: + ida_simple_remove(&mmdc_ida, pmu_mmdc->id); pmu_free: kfree(pmu_mmdc); return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/mach-omap1/board-ams-delta.c +++ linux-aws-6.5-6.5.0/arch/arm/mach-omap1/board-ams-delta.c @@ -550,6 +550,7 @@ &ams_delta_nand_device, &ams_delta_lcd_device, &cx20442_codec_device, + &modem_nreset_device, }; static struct gpiod_lookup_table *ams_delta_gpio_tables[] __initdata = { @@ -782,26 +783,28 @@ { }, }; +static int ams_delta_modem_pm_activate(struct device *dev) +{ + modem_priv.regulator = regulator_get(dev, "RESET#"); + if (IS_ERR(modem_priv.regulator)) + return -EPROBE_DEFER; + + return 0; +} + +static struct dev_pm_domain ams_delta_modem_pm_domain = { + .activate = ams_delta_modem_pm_activate, +}; + static struct platform_device ams_delta_modem_device = { .name = "serial8250", .id = PLAT8250_DEV_PLATFORM1, .dev = { .platform_data = ams_delta_modem_ports, + .pm_domain = &ams_delta_modem_pm_domain, }, }; -static int __init modem_nreset_init(void) -{ - int err; - - err = platform_device_register(&modem_nreset_device); - if (err) - pr_err("Couldn't register the modem regulator device\n"); - - return err; -} - - /* * This function expects MODEM IRQ number already assigned to the port. * The MODEM device requires its RESET# pin kept high during probe. @@ -833,37 +836,6 @@ } arch_initcall_sync(ams_delta_modem_init); -static int __init late_init(void) -{ - int err; - - err = modem_nreset_init(); - if (err) - return err; - - /* - * Once the modem device is registered, the modem_nreset - * regulator can be requested on behalf of that device. - */ - modem_priv.regulator = regulator_get(&ams_delta_modem_device.dev, - "RESET#"); - if (IS_ERR(modem_priv.regulator)) { - err = PTR_ERR(modem_priv.regulator); - goto unregister; - } - return 0; - -unregister: - platform_device_unregister(&ams_delta_modem_device); - return err; -} - -static void __init ams_delta_init_late(void) -{ - omap1_init_late(); - late_init(); -} - static void __init ams_delta_map_io(void) { omap1_map_io(); @@ -877,7 +849,7 @@ .init_early = omap1_init_early, .init_irq = omap1_init_irq, .init_machine = ams_delta_init, - .init_late = ams_delta_init_late, + .init_late = omap1_init_late, .init_time = omap1_timer_init, .restart = omap1_restart, MACHINE_END only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/mach-omap1/timer32k.c +++ linux-aws-6.5-6.5.0/arch/arm/mach-omap1/timer32k.c @@ -176,17 +176,18 @@ return sync32k_cnt_reg ? readl_relaxed(sync32k_cnt_reg) : 0; } +static struct timespec64 persistent_ts; +static cycles_t cycles; +static unsigned int persistent_mult, persistent_shift; + /** * omap_read_persistent_clock64 - Return time from a persistent clock. + * @ts: &struct timespec64 for the returned time * * Reads the time from a source which isn't disabled during PM, the * 32k sync timer. Convert the cycles elapsed since last read into * nsecs and adds to a monotonically increasing timespec64. */ -static struct timespec64 persistent_ts; -static cycles_t cycles; -static unsigned int persistent_mult, persistent_shift; - static void omap_read_persistent_clock64(struct timespec64 *ts) { unsigned long long nsecs; @@ -206,10 +207,9 @@ /** * omap_init_clocksource_32k - setup and register counter 32k as a * kernel clocksource - * @pbase: base addr of counter_32k module - * @size: size of counter_32k to map + * @vbase: base addr of counter_32k module * - * Returns 0 upon success or negative error code upon failure. + * Returns: %0 upon success or negative error code upon failure. * */ static int __init omap_init_clocksource_32k(void __iomem *vbase) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm/xen/enlighten.c +++ linux-aws-6.5-6.5.0/arch/arm/xen/enlighten.c @@ -164,9 +164,6 @@ BUG_ON(err); per_cpu(xen_vcpu, cpu) = vcpup; - if (!xen_kernel_unmapped_at_usr()) - xen_setup_runstate_info(cpu); - after_register_vcpu_info: enable_percpu_irq(xen_events_irq, 0); return 0; @@ -207,7 +204,7 @@ static irqreturn_t xen_arm_callback(int irq, void *arg) { - xen_hvm_evtchn_do_upcall(); + xen_evtchn_do_upcall(); return IRQ_HANDLED; } @@ -487,7 +484,8 @@ * for secondary CPUs as they are brought up. * For uniformity we use VCPUOP_register_vcpu_info even on cpu0. */ - xen_vcpu_info = alloc_percpu(struct vcpu_info); + xen_vcpu_info = __alloc_percpu(sizeof(struct vcpu_info), + 1 << fls(sizeof(struct vcpu_info) - 1)); if (xen_vcpu_info == NULL) return -ENOMEM; @@ -523,9 +521,6 @@ return -EINVAL; } - if (!xen_kernel_unmapped_at_usr()) - xen_time_setup_guest(); - if (xen_initial_domain()) pvclock_gtod_register_notifier(&xen_pvclock_gtod_notifier); @@ -535,7 +530,13 @@ } early_initcall(xen_guest_init); -static int __init xen_pm_init(void) +static int xen_starting_runstate_cpu(unsigned int cpu) +{ + xen_setup_runstate_info(cpu); + return 0; +} + +static int __init xen_late_init(void) { if (!xen_domain()) return -ENODEV; @@ -548,9 +549,16 @@ do_settimeofday64(&ts); } - return 0; + if (xen_kernel_unmapped_at_usr()) + return 0; + + xen_time_setup_guest(); + + return cpuhp_setup_state(CPUHP_AP_ARM_XEN_RUNSTATE_STARTING, + "arm/xen_runstate:starting", + xen_starting_runstate_cpu, NULL); } -late_initcall(xen_pm_init); +late_initcall(xen_late_init); /* empty stubs */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi @@ -1186,26 +1186,34 @@ dma-coherent; }; - usb0: usb@3100000 { - status = "disabled"; - compatible = "snps,dwc3"; - reg = <0x0 0x3100000 0x0 0x10000>; - interrupts = <0 80 0x4>; /* Level high type */ - dr_mode = "host"; - snps,quirk-frame-length-adjustment = <0x20>; - snps,dis_rxdet_inp3_quirk; - snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>; - }; + bus: bus { + #address-cells = <2>; + #size-cells = <2>; + compatible = "simple-bus"; + ranges; + dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x00000000>; + + usb0: usb@3100000 { + compatible = "snps,dwc3"; + reg = <0x0 0x3100000 0x0 0x10000>; + interrupts = <0 80 0x4>; /* Level high type */ + dr_mode = "host"; + snps,quirk-frame-length-adjustment = <0x20>; + snps,dis_rxdet_inp3_quirk; + snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>; + status = "disabled"; + }; - usb1: usb@3110000 { - status = "disabled"; - compatible = "snps,dwc3"; - reg = <0x0 0x3110000 0x0 0x10000>; - interrupts = <0 81 0x4>; /* Level high type */ - dr_mode = "host"; - snps,quirk-frame-length-adjustment = <0x20>; - snps,dis_rxdet_inp3_quirk; - snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>; + usb1: usb@3110000 { + compatible = "snps,dwc3"; + reg = <0x0 0x3110000 0x0 0x10000>; + interrupts = <0 81 0x4>; /* Level high type */ + dr_mode = "host"; + snps,quirk-frame-length-adjustment = <0x20>; + snps,dis_rxdet_inp3_quirk; + snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>; + status = "disabled"; + }; }; ccn@4000000 { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/freescale/imx8-apalis-v1.1.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8-apalis-v1.1.dtsi @@ -82,12 +82,9 @@ pinctrl-0 = <&pinctrl_wifi_pdn>; gpio = <&lsio_gpio1 28 GPIO_ACTIVE_HIGH>; enable-active-high; + regulator-always-on; regulator-name = "wifi_pwrdn_fake_regulator"; regulator-settling-time-us = <100>; - - regulator-state-mem { - regulator-off-in-suspend; - }; }; reg_pcie_switch: regulator-pcie-switch { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/freescale/imx8-ss-lsio.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8-ss-lsio.dtsi @@ -36,7 +36,8 @@ <&pwm0_lpcg 1>; assigned-clocks = <&clk IMX_SC_R_PWM_0 IMX_SC_PM_CLK_PER>; assigned-clock-rates = <24000000>; - #pwm-cells = <2>; + #pwm-cells = <3>; + interrupts = ; status = "disabled"; }; @@ -48,7 +49,8 @@ <&pwm1_lpcg 1>; assigned-clocks = <&clk IMX_SC_R_PWM_1 IMX_SC_PM_CLK_PER>; assigned-clock-rates = <24000000>; - #pwm-cells = <2>; + #pwm-cells = <3>; + interrupts = ; status = "disabled"; }; @@ -60,7 +62,8 @@ <&pwm2_lpcg 1>; assigned-clocks = <&clk IMX_SC_R_PWM_2 IMX_SC_PM_CLK_PER>; assigned-clock-rates = <24000000>; - #pwm-cells = <2>; + #pwm-cells = <3>; + interrupts = ; status = "disabled"; }; @@ -72,7 +75,8 @@ <&pwm3_lpcg 1>; assigned-clocks = <&clk IMX_SC_R_PWM_3 IMX_SC_PM_CLK_PER>; assigned-clock-rates = <24000000>; - #pwm-cells = <2>; + #pwm-cells = <3>; + interrupts = ; status = "disabled"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/freescale/imx8mm.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mm.dtsi @@ -399,6 +399,7 @@ "pll8k", "pll11k", "clkext3"; dmas = <&sdma2 24 25 0x80000000>; dma-names = "rx"; + #sound-dai-cells = <0>; status = "disabled"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/freescale/imx8mn.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mn.dtsi @@ -371,6 +371,7 @@ "pll8k", "pll11k", "clkext3"; dmas = <&sdma2 24 25 0x80000000>; dma-names = "rx"; + #sound-dai-cells = <0>; status = "disabled"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -1457,6 +1457,7 @@ phys = <&usb3_phy0>, <&usb3_phy0>; phy-names = "usb2-phy", "usb3-phy"; power-domains = <&pgc_otg1>; + snps,parkmode-disable-ss-quirk; status = "disabled"; }; @@ -1488,6 +1489,7 @@ phys = <&usb3_phy1>, <&usb3_phy1>; phy-names = "usb2-phy", "usb3-phy"; power-domains = <&pgc_otg2>; + snps,parkmode-disable-ss-quirk; status = "disabled"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/freescale/imx8qm-ss-img.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx8qm-ss-img.dtsi @@ -8,5 +8,5 @@ }; &jpegenc { - compatible = "nxp,imx8qm-jpgdec", "nxp,imx8qxp-jpgenc"; + compatible = "nxp,imx8qm-jpgenc", "nxp,imx8qxp-jpgenc"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/freescale/imx93.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/freescale/imx93.dtsi @@ -146,7 +146,7 @@ #size-cells = <1>; ranges; - anomix_ns_gpr: syscon@44210000 { + aonmix_ns_gpr: syscon@44210000 { compatible = "fsl,imx93-aonmix-ns-syscfg", "syscon"; reg = <0x44210000 0x1000>; }; @@ -280,6 +280,7 @@ assigned-clock-parents = <&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>; assigned-clock-rates = <40000000>; fsl,clk-source = /bits/ 8 <0>; + fsl,stop-mode = <&aonmix_ns_gpr 0x14 0>; status = "disabled"; }; @@ -333,7 +334,7 @@ compatible = "fsl,imx93-src-slice"; reg = <0x44462400 0x400>, <0x44465800 0x400>; #power-domain-cells = <0>; - clocks = <&clk IMX93_CLK_MEDIA_AXI>, + clocks = <&clk IMX93_CLK_NIC_MEDIA_GATE>, <&clk IMX93_CLK_MEDIA_APB>; }; }; @@ -532,6 +533,7 @@ assigned-clock-parents = <&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>; assigned-clock-rates = <40000000>; fsl,clk-source = /bits/ 8 <0>; + fsl,stop-mode = <&wakeupmix_gpr 0x0c 2>; status = "disabled"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/marvell/cn9130-crb.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/marvell/cn9130-crb.dtsi @@ -120,7 +120,7 @@ "mpp59", "mpp60", "mpp61"; marvell,function = "sdio"; }; - cp0_spi0_pins: cp0-spi-pins-0 { + cp0_spi1_pins: cp0-spi-pins-1 { marvell,pins = "mpp13", "mpp14", "mpp15", "mpp16"; marvell,function = "spi1"; }; @@ -170,7 +170,7 @@ &cp0_spi1 { pinctrl-names = "default"; - pinctrl-0 = <&cp0_spi0_pins>; + pinctrl-0 = <&cp0_spi1_pins>; reg = <0x700680 0x50>, /* control */ <0x2000000 0x1000000>; /* CS0 */ status = "okay"; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/marvell/cn9130-db.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/marvell/cn9130-db.dtsi @@ -307,7 +307,7 @@ &cp0_spi1 { status = "disabled"; pinctrl-names = "default"; - pinctrl-0 = <&cp0_spi0_pins>; + pinctrl-0 = <&cp0_spi1_pins>; reg = <0x700680 0x50>; flash@0 { @@ -371,7 +371,7 @@ "mpp59", "mpp60", "mpp61"; marvell,function = "sdio"; }; - cp0_spi0_pins: cp0-spi-pins-0 { + cp0_spi1_pins: cp0-spi-pins-1 { marvell,pins = "mpp13", "mpp14", "mpp15", "mpp16"; marvell,function = "spi1"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts @@ -73,7 +73,7 @@ }; }; - memory { + memory@40000000 { reg = <0 0x40000000 0 0x40000000>; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts @@ -55,7 +55,7 @@ }; }; - memory { + memory@40000000 { reg = <0 0x40000000 0 0x20000000>; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts @@ -126,6 +126,7 @@ compatible = "sff,sfp"; i2c-bus = <&i2c_sfp1>; los-gpios = <&pio 46 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <3000>; mod-def0-gpios = <&pio 49 GPIO_ACTIVE_LOW>; tx-disable-gpios = <&pio 20 GPIO_ACTIVE_HIGH>; tx-fault-gpios = <&pio 7 GPIO_ACTIVE_HIGH>; @@ -137,6 +138,7 @@ i2c-bus = <&i2c_sfp2>; los-gpios = <&pio 31 GPIO_ACTIVE_HIGH>; mod-def0-gpios = <&pio 47 GPIO_ACTIVE_LOW>; + maximum-power-milliwatt = <3000>; tx-disable-gpios = <&pio 15 GPIO_ACTIVE_HIGH>; tx-fault-gpios = <&pio 48 GPIO_ACTIVE_HIGH>; }; @@ -150,16 +152,16 @@ trip = <&cpu_trip_active_high>; }; - cpu-active-low { + cpu-active-med { /* active: set fan to cooling level 1 */ cooling-device = <&fan 1 1>; - trip = <&cpu_trip_active_low>; + trip = <&cpu_trip_active_med>; }; - cpu-passive { - /* passive: set fan to cooling level 0 */ + cpu-active-low { + /* active: set fan to cooling level 0 */ cooling-device = <&fan 0 0>; - trip = <&cpu_trip_passive>; + trip = <&cpu_trip_active_low>; }; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt8173-evb.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8173-evb.dts @@ -44,7 +44,7 @@ id-gpio = <&pio 16 GPIO_ACTIVE_HIGH>; }; - usb_p1_vbus: regulator@0 { + usb_p1_vbus: regulator-usb-p1 { compatible = "regulator-fixed"; regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; @@ -53,7 +53,7 @@ enable-active-high; }; - usb_p0_vbus: regulator@1 { + usb_p0_vbus: regulator-usb-p0 { compatible = "regulator-fixed"; regulator-name = "vbus"; regulator-min-microvolt = <5000000>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt8183-evb.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8183-evb.dts @@ -31,14 +31,14 @@ #address-cells = <2>; #size-cells = <2>; ranges; - scp_mem_reserved: scp_mem_region { + scp_mem_reserved: memory@50000000 { compatible = "shared-dma-pool"; reg = <0 0x50000000 0 0x2900000>; no-map; }; }; - ntc@0 { + thermal-sensor { compatible = "murata,ncp03wf104"; pullup-uv = <1800000>; pullup-ohm = <390000>; @@ -155,8 +155,8 @@ }; &pio { - i2c_pins_0: i2c0{ - pins_i2c{ + i2c_pins_0: i2c0 { + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -164,8 +164,8 @@ }; }; - i2c_pins_1: i2c1{ - pins_i2c{ + i2c_pins_1: i2c1 { + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -173,8 +173,8 @@ }; }; - i2c_pins_2: i2c2{ - pins_i2c{ + i2c_pins_2: i2c2 { + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -182,8 +182,8 @@ }; }; - i2c_pins_3: i2c3{ - pins_i2c{ + i2c_pins_3: i2c3 { + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -191,8 +191,8 @@ }; }; - i2c_pins_4: i2c4{ - pins_i2c{ + i2c_pins_4: i2c4 { + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -200,8 +200,8 @@ }; }; - i2c_pins_5: i2c5{ - pins_i2c{ + i2c_pins_5: i2c5 { + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -209,8 +209,8 @@ }; }; - spi_pins_0: spi0{ - pins_spi{ + spi_pins_0: spi0 { + pins_spi { pinmux = , , , @@ -324,8 +324,8 @@ }; }; - spi_pins_1: spi1{ - pins_spi{ + spi_pins_1: spi1 { + pins_spi { pinmux = , , , @@ -334,8 +334,8 @@ }; }; - spi_pins_2: spi2{ - pins_spi{ + spi_pins_2: spi2 { + pins_spi { pinmux = , , , @@ -344,8 +344,8 @@ }; }; - spi_pins_3: spi3{ - pins_spi{ + spi_pins_3: spi3 { + pins_spi { pinmux = , , , @@ -354,8 +354,8 @@ }; }; - spi_pins_4: spi4{ - pins_spi{ + spi_pins_4: spi4 { + pins_spi { pinmux = , , , @@ -364,8 +364,8 @@ }; }; - spi_pins_5: spi5{ - pins_spi{ + spi_pins_5: spi5 { + pins_spi { pinmux = , , , only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi @@ -91,6 +91,8 @@ &dsi0 { status = "okay"; + /delete-property/#size-cells; + /delete-property/#address-cells; /delete-node/panel@0; ports { port { @@ -441,20 +443,20 @@ }; touchscreen_pins: touchscreen-pins { - touch_int_odl { + touch-int-odl { pinmux = ; input-enable; bias-pull-up; }; - touch_rst_l { + touch-rst-l { pinmux = ; output-high; }; }; trackpad_pins: trackpad-pins { - trackpad_int { + trackpad-int { pinmux = ; input-enable; bias-disable; /* pulled externally */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi @@ -108,7 +108,7 @@ #size-cells = <2>; ranges; - scp_mem_reserved: scp_mem_region { + scp_mem_reserved: memory@50000000 { compatible = "shared-dma-pool"; reg = <0 0x50000000 0 0x2900000>; no-map; @@ -432,7 +432,7 @@ &pio { aud_pins_default: audiopins { - pins_bus { + pins-bus { pinmux = , , , @@ -454,7 +454,7 @@ }; aud_pins_tdm_out_on: audiotdmouton { - pins_bus { + pins-bus { pinmux = , , , @@ -466,7 +466,7 @@ }; aud_pins_tdm_out_off: audiotdmoutoff { - pins_bus { + pins-bus { pinmux = , , , @@ -480,13 +480,13 @@ }; bt_pins: bt-pins { - pins_bt_en { + pins-bt-en { pinmux = ; output-low; }; }; - ec_ap_int_odl: ec_ap_int_odl { + ec_ap_int_odl: ec-ap-int-odl { pins1 { pinmux = ; input-enable; @@ -494,7 +494,7 @@ }; }; - h1_int_od_l: h1_int_od_l { + h1_int_od_l: h1-int-od-l { pins1 { pinmux = ; input-enable; @@ -502,7 +502,7 @@ }; i2c0_pins: i2c0 { - pins_bus { + pins-bus { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -511,7 +511,7 @@ }; i2c1_pins: i2c1 { - pins_bus { + pins-bus { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -520,7 +520,7 @@ }; i2c2_pins: i2c2 { - pins_bus { + pins-bus { pinmux = , ; bias-disable; @@ -529,7 +529,7 @@ }; i2c3_pins: i2c3 { - pins_bus { + pins-bus { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -538,7 +538,7 @@ }; i2c4_pins: i2c4 { - pins_bus { + pins-bus { pinmux = , ; bias-disable; @@ -547,7 +547,7 @@ }; i2c5_pins: i2c5 { - pins_bus { + pins-bus { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -556,7 +556,7 @@ }; i2c6_pins: i2c6 { - pins_bus { + pins-bus { pinmux = , ; bias-disable; @@ -564,7 +564,7 @@ }; mmc0_pins_default: mmc0-pins-default { - pins_cmd_dat { + pins-cmd-dat { pinmux = , , , @@ -579,13 +579,13 @@ mediatek,pull-up-adv = <01>; }; - pins_clk { + pins-clk { pinmux = ; drive-strength = ; mediatek,pull-down-adv = <10>; }; - pins_rst { + pins-rst { pinmux = ; drive-strength = ; mediatek,pull-down-adv = <01>; @@ -593,7 +593,7 @@ }; mmc0_pins_uhs: mmc0-pins-uhs { - pins_cmd_dat { + pins-cmd-dat { pinmux = , , , @@ -608,19 +608,19 @@ mediatek,pull-up-adv = <01>; }; - pins_clk { + pins-clk { pinmux = ; drive-strength = ; mediatek,pull-down-adv = <10>; }; - pins_ds { + pins-ds { pinmux = ; drive-strength = ; mediatek,pull-down-adv = <10>; }; - pins_rst { + pins-rst { pinmux = ; drive-strength = ; mediatek,pull-up-adv = <01>; @@ -628,7 +628,7 @@ }; mmc1_pins_default: mmc1-pins-default { - pins_cmd_dat { + pins-cmd-dat { pinmux = , , , @@ -638,7 +638,7 @@ mediatek,pull-up-adv = <10>; }; - pins_clk { + pins-clk { pinmux = ; input-enable; mediatek,pull-down-adv = <10>; @@ -646,7 +646,7 @@ }; mmc1_pins_uhs: mmc1-pins-uhs { - pins_cmd_dat { + pins-cmd-dat { pinmux = , , , @@ -657,7 +657,7 @@ mediatek,pull-up-adv = <10>; }; - pins_clk { + pins-clk { pinmux = ; drive-strength = ; mediatek,pull-down-adv = <10>; @@ -665,15 +665,15 @@ }; }; - panel_pins_default: panel_pins_default { - panel_reset { + panel_pins_default: panel-pins-default { + panel-reset { pinmux = ; output-low; bias-pull-up; }; }; - pwm0_pin_default: pwm0_pin_default { + pwm0_pin_default: pwm0-pin-default { pins1 { pinmux = ; output-high; @@ -685,14 +685,14 @@ }; scp_pins: scp { - pins_scp_uart { + pins-scp-uart { pinmux = , ; }; }; spi0_pins: spi0 { - pins_spi{ + pins-spi { pinmux = , , , @@ -702,7 +702,7 @@ }; spi1_pins: spi1 { - pins_spi{ + pins-spi { pinmux = , , , @@ -712,20 +712,20 @@ }; spi2_pins: spi2 { - pins_spi{ + pins-spi { pinmux = , , ; bias-disable; }; - pins_spi_mi { + pins-spi-mi { pinmux = ; mediatek,pull-down-adv = <00>; }; }; spi3_pins: spi3 { - pins_spi{ + pins-spi { pinmux = , , , @@ -735,7 +735,7 @@ }; spi4_pins: spi4 { - pins_spi{ + pins-spi { pinmux = , , , @@ -745,7 +745,7 @@ }; spi5_pins: spi5 { - pins_spi{ + pins-spi { pinmux = , , , @@ -755,63 +755,63 @@ }; uart0_pins_default: uart0-pins-default { - pins_rx { + pins-rx { pinmux = ; input-enable; bias-pull-up; }; - pins_tx { + pins-tx { pinmux = ; }; }; uart1_pins_default: uart1-pins-default { - pins_rx { + pins-rx { pinmux = ; input-enable; bias-pull-up; }; - pins_tx { + pins-tx { pinmux = ; }; - pins_rts { + pins-rts { pinmux = ; output-enable; }; - pins_cts { + pins-cts { pinmux = ; input-enable; }; }; uart1_pins_sleep: uart1-pins-sleep { - pins_rx { + pins-rx { pinmux = ; input-enable; bias-pull-up; }; - pins_tx { + pins-tx { pinmux = ; }; - pins_rts { + pins-rts { pinmux = ; output-enable; }; - pins_cts { + pins-cts { pinmux = ; input-enable; }; }; wifi_pins_pwrseq: wifi-pins-pwrseq { - pins_wifi_enable { + pins-wifi-enable { pinmux = ; output-low; }; }; wifi_pins_wakeup: wifi-pins-wakeup { - pins_wifi_wakeup { + pins-wifi-wakeup { pinmux = ; input-enable; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts @@ -193,7 +193,7 @@ &pio { i2c_pins_0: i2c0 { - pins_i2c{ + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -202,7 +202,7 @@ }; i2c_pins_1: i2c1 { - pins_i2c{ + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -211,7 +211,7 @@ }; i2c_pins_2: i2c2 { - pins_i2c{ + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -220,7 +220,7 @@ }; i2c_pins_3: i2c3 { - pins_i2c{ + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -229,7 +229,7 @@ }; i2c_pins_4: i2c4 { - pins_i2c{ + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; @@ -238,7 +238,7 @@ }; i2c_pins_5: i2c5 { - pins_i2c{ + pins_i2c { pinmux = , ; mediatek,pull-up-adv = <3>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt8183.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8183.dtsi @@ -1210,127 +1210,6 @@ nvmem-cell-names = "calibration-data"; }; - thermal_zones: thermal-zones { - cpu_thermal: cpu-thermal { - polling-delay-passive = <100>; - polling-delay = <500>; - thermal-sensors = <&thermal 0>; - sustainable-power = <5000>; - - trips { - threshold: trip-point0 { - temperature = <68000>; - hysteresis = <2000>; - type = "passive"; - }; - - target: trip-point1 { - temperature = <80000>; - hysteresis = <2000>; - type = "passive"; - }; - - cpu_crit: cpu-crit { - temperature = <115000>; - hysteresis = <2000>; - type = "critical"; - }; - }; - - cooling-maps { - map0 { - trip = <&target>; - cooling-device = <&cpu0 - THERMAL_NO_LIMIT - THERMAL_NO_LIMIT>, - <&cpu1 - THERMAL_NO_LIMIT - THERMAL_NO_LIMIT>, - <&cpu2 - THERMAL_NO_LIMIT - THERMAL_NO_LIMIT>, - <&cpu3 - THERMAL_NO_LIMIT - THERMAL_NO_LIMIT>; - contribution = <3072>; - }; - map1 { - trip = <&target>; - cooling-device = <&cpu4 - THERMAL_NO_LIMIT - THERMAL_NO_LIMIT>, - <&cpu5 - THERMAL_NO_LIMIT - THERMAL_NO_LIMIT>, - <&cpu6 - THERMAL_NO_LIMIT - THERMAL_NO_LIMIT>, - <&cpu7 - THERMAL_NO_LIMIT - THERMAL_NO_LIMIT>; - contribution = <1024>; - }; - }; - }; - - /* The tzts1 ~ tzts6 don't need to polling */ - /* The tzts1 ~ tzts6 don't need to thermal throttle */ - - tzts1: tzts1 { - polling-delay-passive = <0>; - polling-delay = <0>; - thermal-sensors = <&thermal 1>; - sustainable-power = <5000>; - trips {}; - cooling-maps {}; - }; - - tzts2: tzts2 { - polling-delay-passive = <0>; - polling-delay = <0>; - thermal-sensors = <&thermal 2>; - sustainable-power = <5000>; - trips {}; - cooling-maps {}; - }; - - tzts3: tzts3 { - polling-delay-passive = <0>; - polling-delay = <0>; - thermal-sensors = <&thermal 3>; - sustainable-power = <5000>; - trips {}; - cooling-maps {}; - }; - - tzts4: tzts4 { - polling-delay-passive = <0>; - polling-delay = <0>; - thermal-sensors = <&thermal 4>; - sustainable-power = <5000>; - trips {}; - cooling-maps {}; - }; - - tzts5: tzts5 { - polling-delay-passive = <0>; - polling-delay = <0>; - thermal-sensors = <&thermal 5>; - sustainable-power = <5000>; - trips {}; - cooling-maps {}; - }; - - tztsABB: tztsABB { - polling-delay-passive = <0>; - polling-delay = <0>; - thermal-sensors = <&thermal 6>; - sustainable-power = <5000>; - trips {}; - cooling-maps {}; - }; - }; - pwm0: pwm@1100e000 { compatible = "mediatek,mt8183-disp-pwm"; reg = <0 0x1100e000 0 0x1000>; @@ -2105,4 +1984,125 @@ power-domains = <&spm MT8183_POWER_DOMAIN_CAM>; }; }; + + thermal_zones: thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <100>; + polling-delay = <500>; + thermal-sensors = <&thermal 0>; + sustainable-power = <5000>; + + trips { + threshold: trip-point0 { + temperature = <68000>; + hysteresis = <2000>; + type = "passive"; + }; + + target: trip-point1 { + temperature = <80000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu_crit: cpu-crit { + temperature = <115000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&target>; + cooling-device = <&cpu0 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>, + <&cpu1 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>, + <&cpu2 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>, + <&cpu3 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>; + contribution = <3072>; + }; + map1 { + trip = <&target>; + cooling-device = <&cpu4 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>, + <&cpu5 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>, + <&cpu6 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>, + <&cpu7 + THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>; + contribution = <1024>; + }; + }; + }; + + /* The tzts1 ~ tzts6 don't need to polling */ + /* The tzts1 ~ tzts6 don't need to thermal throttle */ + + tzts1: tzts1 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&thermal 1>; + sustainable-power = <5000>; + trips {}; + cooling-maps {}; + }; + + tzts2: tzts2 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&thermal 2>; + sustainable-power = <5000>; + trips {}; + cooling-maps {}; + }; + + tzts3: tzts3 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&thermal 3>; + sustainable-power = <5000>; + trips {}; + cooling-maps {}; + }; + + tzts4: tzts4 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&thermal 4>; + sustainable-power = <5000>; + trips {}; + cooling-maps {}; + }; + + tzts5: tzts5 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&thermal 5>; + sustainable-power = <5000>; + trips {}; + cooling-maps {}; + }; + + tztsABB: tztsABB { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&thermal 6>; + sustainable-power = <5000>; + trips {}; + cooling-maps {}; + }; + }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt8186.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8186.dtsi @@ -924,7 +924,8 @@ reg = ; clocks = <&topckgen CLK_TOP_SENINF>, <&topckgen CLK_TOP_SENINF1>; - clock-names = "csirx_top0", "csirx_top1"; + clock-names = "subsys-csirx-top0", + "subsys-csirx-top1"; #power-domain-cells = <0>; }; @@ -942,7 +943,8 @@ reg = ; clocks = <&topckgen CLK_TOP_AUDIODSP>, <&topckgen CLK_TOP_ADSP_BUS>; - clock-names = "audioadsp", "adsp_bus"; + clock-names = "audioadsp", + "subsys-adsp-bus"; #address-cells = <1>; #size-cells = <0>; #power-domain-cells = <1>; @@ -975,8 +977,11 @@ <&mmsys CLK_MM_SMI_COMMON>, <&mmsys CLK_MM_SMI_GALS>, <&mmsys CLK_MM_SMI_IOMMU>; - clock-names = "disp", "mdp", "smi_infra", "smi_common", - "smi_gals", "smi_iommu"; + clock-names = "disp", "mdp", + "subsys-smi-infra", + "subsys-smi-common", + "subsys-smi-gals", + "subsys-smi-iommu"; mediatek,infracfg = <&infracfg_ao>; #address-cells = <1>; #size-cells = <0>; @@ -993,15 +998,17 @@ power-domain@MT8186_POWER_DOMAIN_CAM { reg = ; - clocks = <&topckgen CLK_TOP_CAM>, - <&topckgen CLK_TOP_SENINF>, + clocks = <&topckgen CLK_TOP_SENINF>, <&topckgen CLK_TOP_SENINF1>, <&topckgen CLK_TOP_SENINF2>, <&topckgen CLK_TOP_SENINF3>, + <&camsys CLK_CAM2MM_GALS>, <&topckgen CLK_TOP_CAMTM>, - <&camsys CLK_CAM2MM_GALS>; - clock-names = "cam-top", "cam0", "cam1", "cam2", - "cam3", "cam-tm", "gals"; + <&topckgen CLK_TOP_CAM>; + clock-names = "cam0", "cam1", "cam2", + "cam3", "gals", + "subsys-cam-tm", + "subsys-cam-top"; mediatek,infracfg = <&infracfg_ao>; #address-cells = <1>; #size-cells = <0>; @@ -1020,9 +1027,9 @@ power-domain@MT8186_POWER_DOMAIN_IMG { reg = ; - clocks = <&topckgen CLK_TOP_IMG1>, - <&imgsys1 CLK_IMG1_GALS_IMG1>; - clock-names = "img-top", "gals"; + clocks = <&imgsys1 CLK_IMG1_GALS_IMG1>, + <&topckgen CLK_TOP_IMG1>; + clock-names = "gals", "subsys-img-top"; mediatek,infracfg = <&infracfg_ao>; #address-cells = <1>; #size-cells = <0>; @@ -1041,8 +1048,11 @@ <&ipesys CLK_IPE_LARB20>, <&ipesys CLK_IPE_SMI_SUBCOM>, <&ipesys CLK_IPE_GALS_IPE>; - clock-names = "ipe-top", "ipe-larb0", "ipe-larb1", - "ipe-smi", "ipe-gals"; + clock-names = "subsys-ipe-top", + "subsys-ipe-larb0", + "subsys-ipe-larb1", + "subsys-ipe-smi", + "subsys-ipe-gals"; mediatek,infracfg = <&infracfg_ao>; #power-domain-cells = <0>; }; @@ -1061,7 +1071,9 @@ clocks = <&topckgen CLK_TOP_WPE>, <&wpesys CLK_WPE_SMI_LARB8_CK_EN>, <&wpesys CLK_WPE_SMI_LARB8_PCLK_EN>; - clock-names = "wpe0", "larb-ck", "larb-pclk"; + clock-names = "wpe0", + "subsys-larb-ck", + "subsys-larb-pclk"; mediatek,infracfg = <&infracfg_ao>; #power-domain-cells = <0>; }; @@ -1656,7 +1668,7 @@ #address-cells = <1>; #size-cells = <1>; - gpu_speedbin: gpu-speed-bin@59c { + gpu_speedbin: gpu-speedbin@59c { reg = <0x59c 0x4>; bits = <0 3>; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi @@ -362,7 +362,7 @@ pinctrl-0 = <&i2c7_pins>; pmic@34 { - #interrupt-cells = <1>; + #interrupt-cells = <2>; compatible = "mediatek,mt6360"; reg = <0x34>; interrupt-controller; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/nvidia/tegra234-p3767.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/nvidia/tegra234-p3767.dtsi @@ -28,7 +28,7 @@ flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <136000000>; + spi-max-frequency = <102000000>; spi-tx-bus-width = <4>; spi-rx-bus-width = <4>; }; @@ -42,7 +42,7 @@ mmc@3400000 { status = "okay"; bus-width = <4>; - cd-gpios = <&gpio TEGRA234_MAIN_GPIO(G, 7) GPIO_ACTIVE_HIGH>; + cd-gpios = <&gpio TEGRA234_MAIN_GPIO(G, 7) GPIO_ACTIVE_LOW>; disable-wp; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/ipq5332.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/ipq5332.dtsi @@ -135,7 +135,7 @@ reg = <0x0 0x4a800000 0x0 0x100000>; no-map; - hwlocks = <&tcsr_mutex 0>; + hwlocks = <&tcsr_mutex 3>; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/ipq6018.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/ipq6018.dtsi @@ -207,7 +207,7 @@ smem { compatible = "qcom,smem"; memory-region = <&smem_region>; - hwlocks = <&tcsr_mutex 0>; + hwlocks = <&tcsr_mutex 3>; }; soc: soc@0 { @@ -389,7 +389,7 @@ tcsr_mutex: hwlock@1905000 { compatible = "qcom,ipq6018-tcsr-mutex", "qcom,tcsr-mutex"; - reg = <0x0 0x01905000 0x0 0x1000>; + reg = <0x0 0x01905000 0x0 0x20000>; #hwlock-cells = <1>; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/ipq9574.dtsi @@ -174,7 +174,7 @@ smem@4aa00000 { compatible = "qcom,smem"; reg = <0x0 0x4aa00000 0x0 0x100000>; - hwlocks = <&tcsr_mutex 0>; + hwlocks = <&tcsr_mutex 3>; no-map; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8916.dtsi @@ -1805,7 +1805,7 @@ #size-cells = <1>; #iommu-cells = <1>; compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1"; - ranges = <0 0x01e20000 0x40000>; + ranges = <0 0x01e20000 0x20000>; reg = <0x01ef0000 0x3000>; clocks = <&gcc GCC_SMMU_CFG_CLK>, <&gcc GCC_APSS_TCU_CLK>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/msm8976.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8976.dtsi @@ -303,7 +303,7 @@ smp2p-modem { compatible = "qcom,smp2p"; interrupts = ; - qcom,ipc = <&apcs 8 13>; + qcom,ipc = <&apcs 8 14>; qcom,local-pid = <0>; qcom,remote-pid = <1>; @@ -326,7 +326,7 @@ smp2p-wcnss { compatible = "qcom,smp2p"; interrupts = ; - qcom,ipc = <&apcs 8 17>; + qcom,ipc = <&apcs 8 18>; qcom,local-pid = <0>; qcom,remote-pid = <4>; @@ -428,9 +428,9 @@ #address-cells = <1>; #size-cells = <0>; - qcom,ipc-1 = <&apcs 8 12>; + qcom,ipc-1 = <&apcs 8 13>; qcom,ipc-2 = <&apcs 8 9>; - qcom,ipc-3 = <&apcs 8 18>; + qcom,ipc-3 = <&apcs 8 19>; apps_smsm: apps@0 { reg = <0>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/msm8992-xiaomi-libra.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8992-xiaomi-libra.dts @@ -109,11 +109,6 @@ qcom,client-id = <1>; }; - audio_mem: audio@cb400000 { - reg = <0 0xcb000000 0 0x400000>; - no-mem; - }; - qseecom_mem: qseecom@cb400000 { reg = <0 0xcb400000 0 0x1c00000>; no-mem; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi @@ -11,26 +11,24 @@ #include / { - clocks { - divclk1_cdc: divclk1 { - compatible = "gpio-gate-clock"; - clocks = <&rpmcc RPM_SMD_DIV_CLK1>; - #clock-cells = <0>; - enable-gpios = <&pm8994_gpios 15 GPIO_ACTIVE_HIGH>; + divclk1_cdc: divclk1 { + compatible = "gpio-gate-clock"; + clocks = <&rpmcc RPM_SMD_DIV_CLK1>; + #clock-cells = <0>; + enable-gpios = <&pm8994_gpios 15 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&divclk1_default>; - }; + pinctrl-names = "default"; + pinctrl-0 = <&divclk1_default>; + }; - divclk4: divclk4 { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <32768>; - clock-output-names = "divclk4"; + divclk4: divclk4 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "divclk4"; - pinctrl-names = "default"; - pinctrl-0 = <&divclk4_pin_a>; - }; + pinctrl-names = "default"; + pinctrl-0 = <&divclk4_pin_a>; }; gpio-keys { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts @@ -13,7 +13,7 @@ compatible = "qcom,qrb2210-rb1", "qcom,qrb2210", "qcom,qcm2290"; aliases { - serial0 = &uart0; + serial0 = &uart4; sdhc1 = &sdhc_1; sdhc2 = &sdhc_2; }; @@ -94,7 +94,7 @@ }; /* UART connected to the Micro-USB port via a FTDI chip */ -&uart0 { +&uart4 { compatible = "qcom,geni-debug-uart"; status = "okay"; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sa8775p-pmics.dtsi @@ -173,7 +173,7 @@ compatible = "qcom,pmm8654au-gpio", "qcom,spmi-gpio"; reg = <0x8800>; gpio-controller; - gpio-ranges = <&pmm8654au_2_gpios 0 0 12>; + gpio-ranges = <&pmm8654au_1_gpios 0 0 12>; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi @@ -143,16 +143,20 @@ }; }; +&cpufreq_hw { + /delete-property/ interrupts-extended; /* reference to lmh_cluster[01] */ +}; + &psci { - /delete-node/ cpu0; - /delete-node/ cpu1; - /delete-node/ cpu2; - /delete-node/ cpu3; - /delete-node/ cpu4; - /delete-node/ cpu5; - /delete-node/ cpu6; - /delete-node/ cpu7; - /delete-node/ cpu-cluster0; + /delete-node/ power-domain-cpu0; + /delete-node/ power-domain-cpu1; + /delete-node/ power-domain-cpu2; + /delete-node/ power-domain-cpu3; + /delete-node/ power-domain-cpu4; + /delete-node/ power-domain-cpu5; + /delete-node/ power-domain-cpu6; + /delete-node/ power-domain-cpu7; + /delete-node/ power-domain-cluster; }; &cpus { @@ -275,6 +279,14 @@ &CLUSTER_SLEEP_0>; }; +&lmh_cluster0 { + status = "disabled"; +}; + +&lmh_cluster1 { + status = "disabled"; +}; + /* * Reserved memory changes * @@ -338,6 +350,8 @@ &apps_rsc { + /delete-property/ power-domains; + regulators-0 { compatible = "qcom,pm8998-rpmh-regulators"; qcom,pmic-id = "a"; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/sdm845-mtp.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sdm845-mtp.dts @@ -715,6 +715,8 @@ vdd-1.8-xo-supply = <&vreg_l7a_1p8>; vdd-1.3-rfa-supply = <&vreg_l17a_1p3>; vdd-3.3-ch0-supply = <&vreg_l25a_3p3>; + + qcom,snoc-host-cap-8bit-quirk; }; /* PINCTRL - additions to nodes defined in sdm845.dtsi */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/qcom/sm6125.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/qcom/sm6125.dtsi @@ -1204,7 +1204,7 @@ apps_smmu: iommu@c600000 { compatible = "qcom,sm6125-smmu-500", "qcom,smmu-500", "arm,mmu-500"; - reg = <0xc600000 0x80000>; + reg = <0x0c600000 0x80000>; interrupts = , , , only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts @@ -68,15 +68,17 @@ simple-audio-card,format = "i2s"; simple-audio-card,name = "Haikou,I2S-codec"; simple-audio-card,mclk-fs = <512>; + simple-audio-card,frame-master = <&sgtl5000_codec>; + simple-audio-card,bitclock-master = <&sgtl5000_codec>; - simple-audio-card,codec { - clocks = <&sgtl5000_clk>; + sgtl5000_codec: simple-audio-card,codec { sound-dai = <&sgtl5000>; + // Prevent the dai subsystem from overwriting the clock + // frequency. We are using a fixed-frequency oscillator. + system-clock-fixed; }; simple-audio-card,cpu { - bitclock-master; - frame-master; sound-dai = <&i2s0_8ch>; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/rockchip/rk3328.dtsi @@ -668,7 +668,7 @@ vdec: video-codec@ff360000 { compatible = "rockchip,rk3328-vdec", "rockchip,rk3399-vdec"; - reg = <0x0 0xff360000 0x0 0x400>; + reg = <0x0 0xff360000 0x0 0x480>; interrupts = ; clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>, <&cru SCLK_VDEC_CABAC>, <&cru SCLK_VDEC_CORE>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi @@ -493,6 +493,7 @@ &i2s0 { pinctrl-0 = <&i2s0_2ch_bus>; + pinctrl-1 = <&i2s0_2ch_bus_bclk_off>; rockchip,capture-channels = <2>; rockchip,playback-channels = <2>; status = "okay"; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -1082,7 +1082,9 @@ power-domain@RK3399_PD_VDU { reg = ; clocks = <&cru ACLK_VDU>, - <&cru HCLK_VDU>; + <&cru HCLK_VDU>, + <&cru SCLK_VDU_CA>, + <&cru SCLK_VDU_CORE>; pm_qos = <&qos_video_m1_r>, <&qos_video_m1_w>; #power-domain-cells = <0>; @@ -1358,7 +1360,7 @@ vdec: video-codec@ff660000 { compatible = "rockchip,rk3399-vdec"; - reg = <0x0 0xff660000 0x0 0x400>; + reg = <0x0 0xff660000 0x0 0x480>; interrupts = ; clocks = <&cru ACLK_VDU>, <&cru HCLK_VDU>, <&cru SCLK_VDU_CA>, <&cru SCLK_VDU_CORE>; @@ -2426,6 +2428,16 @@ <3 RK_PD1 1 &pcfg_pull_none>, <3 RK_PD2 1 &pcfg_pull_none>, <3 RK_PD3 1 &pcfg_pull_none>, + <3 RK_PD7 1 &pcfg_pull_none>, + <4 RK_PA0 1 &pcfg_pull_none>; + }; + + i2s0_2ch_bus_bclk_off: i2s0-2ch-bus-bclk-off { + rockchip,pins = + <3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>, + <3 RK_PD1 1 &pcfg_pull_none>, + <3 RK_PD2 1 &pcfg_pull_none>, + <3 RK_PD3 1 &pcfg_pull_none>, <3 RK_PD7 1 &pcfg_pull_none>, <4 RK_PA0 1 &pcfg_pull_none>; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/rockchip/rk3588s-pinctrl.dtsi +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/rockchip/rk3588s-pinctrl.dtsi @@ -369,7 +369,7 @@ emmc_data_strobe: emmc-data-strobe { rockchip,pins = /* emmc_data_strobe */ - <2 RK_PA2 1 &pcfg_pull_none>; + <2 RK_PA2 1 &pcfg_pull_down>; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts @@ -58,7 +58,7 @@ ramoops: ramoops@9ca00000 { compatible = "ramoops"; - reg = <0x00 0x9c700000 0x00 0x00100000>; + reg = <0x00 0x9ca00000 0x00 0x00100000>; record-size = <0x8000>; console-size = <0x8000>; ftrace-size = <0x00>; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +++ linux-aws-6.5-6.5.0/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts @@ -232,7 +232,7 @@ status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&main_i2c1_pins_default>; - clock-frequency = <400000>; + clock-frequency = <100000>; exp1: gpio@22 { compatible = "ti,tca6424"; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/include/asm/arm_pmuv3.h +++ linux-aws-6.5-6.5.0/arch/arm64/include/asm/arm_pmuv3.h @@ -46,12 +46,12 @@ ID_AA64DFR0_EL1_PMUVer_SHIFT); } -static inline void write_pmcr(u32 val) +static inline void write_pmcr(u64 val) { write_sysreg(val, pmcr_el0); } -static inline u32 read_pmcr(void) +static inline u64 read_pmcr(void) { return read_sysreg(pmcr_el0); } @@ -71,21 +71,6 @@ return read_sysreg(pmccntr_el0); } -static inline void write_pmxevcntr(u32 val) -{ - write_sysreg(val, pmxevcntr_el0); -} - -static inline u32 read_pmxevcntr(void) -{ - return read_sysreg(pmxevcntr_el0); -} - -static inline void write_pmxevtyper(u32 val) -{ - write_sysreg(val, pmxevtyper_el0); -} - static inline void write_pmcntenset(u32 val) { write_sysreg(val, pmcntenset_el0); @@ -106,7 +91,7 @@ write_sysreg(val, pmintenclr_el1); } -static inline void write_pmccfiltr(u32 val) +static inline void write_pmccfiltr(u64 val) { write_sysreg(val, pmccfiltr_el0); } @@ -126,12 +111,12 @@ write_sysreg(val, pmuserenr_el0); } -static inline u32 read_pmceid0(void) +static inline u64 read_pmceid0(void) { return read_sysreg(pmceid0_el0); } -static inline u32 read_pmceid1(void) +static inline u64 read_pmceid1(void) { return read_sysreg(pmceid1_el0); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/include/asm/setup.h +++ linux-aws-6.5-6.5.0/arch/arm64/include/asm/setup.h @@ -21,9 +21,22 @@ extern bool rodata_enabled; extern bool rodata_full; - if (arg && !strcmp(arg, "full")) { + if (!arg) + return false; + + if (!strcmp(arg, "full")) { + rodata_enabled = rodata_full = true; + return true; + } + + if (!strcmp(arg, "off")) { + rodata_enabled = rodata_full = false; + return true; + } + + if (!strcmp(arg, "on")) { rodata_enabled = true; - rodata_full = true; + rodata_full = false; return true; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/kvm/guest.c +++ linux-aws-6.5-6.5.0/arch/arm64/kvm/guest.c @@ -874,7 +874,7 @@ break; case ARM_CPU_IMP_APM: switch (part_number) { - case APM_CPU_PART_POTENZA: + case APM_CPU_PART_XGENE: return KVM_ARM_TARGET_XGENE_POTENZA; } break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/arm64/mm/pageattr.c +++ linux-aws-6.5-6.5.0/arch/arm64/mm/pageattr.c @@ -29,8 +29,8 @@ * * KFENCE pool requires page-granular mapping if initialized late. */ - return (rodata_enabled && rodata_full) || debug_pagealloc_enabled() || - arm64_kfence_can_set_direct_map(); + return rodata_full || debug_pagealloc_enabled() || + arm64_kfence_can_set_direct_map(); } static int change_page_range(pte_t *ptep, unsigned long addr, void *data) @@ -105,8 +105,7 @@ * If we are manipulating read-only permissions, apply the same * change to the linear mapping of the pages that back this VM area. */ - if (rodata_enabled && - rodata_full && (pgprot_val(set_mask) == PTE_RDONLY || + if (rodata_full && (pgprot_val(set_mask) == PTE_RDONLY || pgprot_val(clear_mask) == PTE_RDONLY)) { for (i = 0; i < area->nr_pages; i++) { __change_memory_common((u64)page_address(area->pages[i]), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/loongarch/include/asm/io.h +++ linux-aws-6.5-6.5.0/arch/loongarch/include/asm/io.h @@ -54,10 +54,9 @@ * @offset: bus address of the memory * @size: size of the resource to map */ -extern pgprot_t pgprot_wc; - #define ioremap_wc(offset, size) \ - ioremap_prot((offset), (size), pgprot_val(pgprot_wc)) + ioremap_prot((offset), (size), \ + pgprot_val(wc_enabled ? PAGE_KERNEL_WUC : PAGE_KERNEL_SUC)) #define ioremap_cache(offset, size) \ ioremap_prot((offset), (size), pgprot_val(PAGE_KERNEL)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/loongarch/include/asm/linkage.h +++ linux-aws-6.5-6.5.0/arch/loongarch/include/asm/linkage.h @@ -33,4 +33,12 @@ .cfi_endproc; \ SYM_END(name, SYM_T_FUNC) +#define SYM_CODE_START(name) \ + SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \ + .cfi_startproc; + +#define SYM_CODE_END(name) \ + .cfi_endproc; \ + SYM_END(name, SYM_T_NONE) + #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/loongarch/include/asm/percpu.h +++ linux-aws-6.5-6.5.0/arch/loongarch/include/asm/percpu.h @@ -32,7 +32,7 @@ #define __my_cpu_offset __my_cpu_offset #define PERCPU_OP(op, asm_op, c_op) \ -static inline unsigned long __percpu_##op(void *ptr, \ +static __always_inline unsigned long __percpu_##op(void *ptr, \ unsigned long val, int size) \ { \ unsigned long ret; \ @@ -63,7 +63,7 @@ PERCPU_OP(or, or, |) #undef PERCPU_OP -static inline unsigned long __percpu_read(void *ptr, int size) +static __always_inline unsigned long __percpu_read(void *ptr, int size) { unsigned long ret; @@ -100,7 +100,7 @@ return ret; } -static inline void __percpu_write(void *ptr, unsigned long val, int size) +static __always_inline void __percpu_write(void *ptr, unsigned long val, int size) { switch (size) { case 1: @@ -132,8 +132,8 @@ } } -static inline unsigned long __percpu_xchg(void *ptr, unsigned long val, - int size) +static __always_inline unsigned long __percpu_xchg(void *ptr, unsigned long val, + int size) { switch (size) { case 1: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/loongarch/include/asm/pgtable-bits.h +++ linux-aws-6.5-6.5.0/arch/loongarch/include/asm/pgtable-bits.h @@ -105,13 +105,15 @@ return __pgprot(prot); } +extern bool wc_enabled; + #define pgprot_writecombine pgprot_writecombine static inline pgprot_t pgprot_writecombine(pgprot_t _prot) { unsigned long prot = pgprot_val(_prot); - prot = (prot & ~_CACHE_MASK) | _CACHE_WUC; + prot = (prot & ~_CACHE_MASK) | (wc_enabled ? _CACHE_WUC : _CACHE_SUC); return __pgprot(prot); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/loongarch/kernel/entry.S +++ linux-aws-6.5-6.5.0/arch/loongarch/kernel/entry.S @@ -18,7 +18,7 @@ .text .cfi_sections .debug_frame .align 5 -SYM_FUNC_START(handle_syscall) +SYM_CODE_START(handle_syscall) csrrd t0, PERCPU_BASE_KS la.pcrel t1, kernelsp add.d t1, t1, t0 @@ -66,7 +66,7 @@ bl do_syscall RESTORE_ALL_AND_RET -SYM_FUNC_END(handle_syscall) +SYM_CODE_END(handle_syscall) _ASM_NOKPROBE(handle_syscall) SYM_CODE_START(ret_from_fork) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/loongarch/kernel/genex.S +++ linux-aws-6.5-6.5.0/arch/loongarch/kernel/genex.S @@ -31,7 +31,7 @@ 1: jr ra SYM_FUNC_END(__arch_cpu_idle) -SYM_FUNC_START(handle_vint) +SYM_CODE_START(handle_vint) BACKUP_T0T1 SAVE_ALL la_abs t1, __arch_cpu_idle @@ -46,11 +46,11 @@ la_abs t0, do_vint jirl ra, t0, 0 RESTORE_ALL_AND_RET -SYM_FUNC_END(handle_vint) +SYM_CODE_END(handle_vint) -SYM_FUNC_START(except_vec_cex) +SYM_CODE_START(except_vec_cex) b cache_parity_error -SYM_FUNC_END(except_vec_cex) +SYM_CODE_END(except_vec_cex) .macro build_prep_badv csrrd t0, LOONGARCH_CSR_BADV @@ -66,7 +66,7 @@ .macro BUILD_HANDLER exception handler prep .align 5 - SYM_FUNC_START(handle_\exception) + SYM_CODE_START(handle_\exception) 666: BACKUP_T0T1 SAVE_ALL @@ -76,7 +76,7 @@ jirl ra, t0, 0 668: RESTORE_ALL_AND_RET - SYM_FUNC_END(handle_\exception) + SYM_CODE_END(handle_\exception) SYM_DATA(unwind_hint_\exception, .word 668b - 666b) .endm @@ -93,7 +93,7 @@ BUILD_HANDLER watch watch none BUILD_HANDLER reserved reserved none /* others */ -SYM_FUNC_START(handle_sys) +SYM_CODE_START(handle_sys) la_abs t0, handle_syscall jr t0 -SYM_FUNC_END(handle_sys) +SYM_CODE_END(handle_sys) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/loongarch/kernel/setup.c +++ linux-aws-6.5-6.5.0/arch/loongarch/kernel/setup.c @@ -161,19 +161,19 @@ } #ifdef CONFIG_ARCH_WRITECOMBINE -pgprot_t pgprot_wc = PAGE_KERNEL_WUC; +bool wc_enabled = true; #else -pgprot_t pgprot_wc = PAGE_KERNEL_SUC; +bool wc_enabled = false; #endif -EXPORT_SYMBOL(pgprot_wc); +EXPORT_SYMBOL(wc_enabled); static int __init setup_writecombine(char *p) { if (!strcmp(p, "on")) - pgprot_wc = PAGE_KERNEL_WUC; + wc_enabled = true; else if (!strcmp(p, "off")) - pgprot_wc = PAGE_KERNEL_SUC; + wc_enabled = false; else pr_warn("Unknown writecombine setting \"%s\".\n", p); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/loongarch/mm/init.c +++ linux-aws-6.5-6.5.0/arch/loongarch/mm/init.c @@ -68,11 +68,11 @@ { void *vfrom, *vto; - vto = kmap_atomic(to); - vfrom = kmap_atomic(from); + vfrom = kmap_local_page(from); + vto = kmap_local_page(to); copy_page(vto, vfrom); - kunmap_atomic(vfrom); - kunmap_atomic(vto); + kunmap_local(vfrom); + kunmap_local(vto); /* Make sure this page is cleared on other CPU's too before using it */ smp_wmb(); } @@ -267,6 +267,7 @@ pgd_t invalid_pg_dir[_PTRS_PER_PGD] __page_aligned_bss; #ifndef __PAGETABLE_PUD_FOLDED pud_t invalid_pud_table[PTRS_PER_PUD] __page_aligned_bss; +EXPORT_SYMBOL(invalid_pud_table); #endif #ifndef __PAGETABLE_PMD_FOLDED pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned_bss; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/loongarch/mm/tlbex.S +++ linux-aws-6.5-6.5.0/arch/loongarch/mm/tlbex.S @@ -17,7 +17,7 @@ #define PTRS_PER_PTE_BITS (PAGE_SHIFT - 3) .macro tlb_do_page_fault, write - SYM_FUNC_START(tlb_do_page_fault_\write) + SYM_CODE_START(tlb_do_page_fault_\write) SAVE_ALL csrrd a2, LOONGARCH_CSR_BADV move a0, sp @@ -25,13 +25,13 @@ li.w a1, \write bl do_page_fault RESTORE_ALL_AND_RET - SYM_FUNC_END(tlb_do_page_fault_\write) + SYM_CODE_END(tlb_do_page_fault_\write) .endm tlb_do_page_fault 0 tlb_do_page_fault 1 -SYM_FUNC_START(handle_tlb_protect) +SYM_CODE_START(handle_tlb_protect) BACKUP_T0T1 SAVE_ALL move a0, sp @@ -41,9 +41,9 @@ la_abs t0, do_page_fault jirl ra, t0, 0 RESTORE_ALL_AND_RET -SYM_FUNC_END(handle_tlb_protect) +SYM_CODE_END(handle_tlb_protect) -SYM_FUNC_START(handle_tlb_load) +SYM_CODE_START(handle_tlb_load) csrwr t0, EXCEPTION_KS0 csrwr t1, EXCEPTION_KS1 csrwr ra, EXCEPTION_KS2 @@ -187,16 +187,16 @@ csrrd ra, EXCEPTION_KS2 la_abs t0, tlb_do_page_fault_0 jr t0 -SYM_FUNC_END(handle_tlb_load) +SYM_CODE_END(handle_tlb_load) -SYM_FUNC_START(handle_tlb_load_ptw) +SYM_CODE_START(handle_tlb_load_ptw) csrwr t0, LOONGARCH_CSR_KS0 csrwr t1, LOONGARCH_CSR_KS1 la_abs t0, tlb_do_page_fault_0 jr t0 -SYM_FUNC_END(handle_tlb_load_ptw) +SYM_CODE_END(handle_tlb_load_ptw) -SYM_FUNC_START(handle_tlb_store) +SYM_CODE_START(handle_tlb_store) csrwr t0, EXCEPTION_KS0 csrwr t1, EXCEPTION_KS1 csrwr ra, EXCEPTION_KS2 @@ -343,16 +343,16 @@ csrrd ra, EXCEPTION_KS2 la_abs t0, tlb_do_page_fault_1 jr t0 -SYM_FUNC_END(handle_tlb_store) +SYM_CODE_END(handle_tlb_store) -SYM_FUNC_START(handle_tlb_store_ptw) +SYM_CODE_START(handle_tlb_store_ptw) csrwr t0, LOONGARCH_CSR_KS0 csrwr t1, LOONGARCH_CSR_KS1 la_abs t0, tlb_do_page_fault_1 jr t0 -SYM_FUNC_END(handle_tlb_store_ptw) +SYM_CODE_END(handle_tlb_store_ptw) -SYM_FUNC_START(handle_tlb_modify) +SYM_CODE_START(handle_tlb_modify) csrwr t0, EXCEPTION_KS0 csrwr t1, EXCEPTION_KS1 csrwr ra, EXCEPTION_KS2 @@ -497,16 +497,16 @@ csrrd ra, EXCEPTION_KS2 la_abs t0, tlb_do_page_fault_1 jr t0 -SYM_FUNC_END(handle_tlb_modify) +SYM_CODE_END(handle_tlb_modify) -SYM_FUNC_START(handle_tlb_modify_ptw) +SYM_CODE_START(handle_tlb_modify_ptw) csrwr t0, LOONGARCH_CSR_KS0 csrwr t1, LOONGARCH_CSR_KS1 la_abs t0, tlb_do_page_fault_1 jr t0 -SYM_FUNC_END(handle_tlb_modify_ptw) +SYM_CODE_END(handle_tlb_modify_ptw) -SYM_FUNC_START(handle_tlb_refill) +SYM_CODE_START(handle_tlb_refill) csrwr t0, LOONGARCH_CSR_TLBRSAVE csrrd t0, LOONGARCH_CSR_PGD lddir t0, t0, 3 @@ -521,4 +521,4 @@ tlbfill csrrd t0, LOONGARCH_CSR_TLBRSAVE ertn -SYM_FUNC_END(handle_tlb_refill) +SYM_CODE_END(handle_tlb_refill) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/loongarch/net/bpf_jit.c +++ linux-aws-6.5-6.5.0/arch/loongarch/net/bpf_jit.c @@ -855,8 +855,6 @@ /* function return */ case BPF_JMP | BPF_EXIT: - emit_sext_32(ctx, regmap[BPF_REG_0], true); - if (i == ctx->prog->len - 1) break; @@ -907,14 +905,8 @@ } break; case BPF_DW: - if (is_signed_imm12(off)) { - emit_insn(ctx, ldd, dst, src, off); - } else if (is_signed_imm14(off)) { - emit_insn(ctx, ldptrd, dst, src, off); - } else { - move_imm(ctx, t1, off, is32); - emit_insn(ctx, ldxd, dst, src, t1); - } + move_imm(ctx, t1, off, is32); + emit_insn(ctx, ldxd, dst, src, t1); break; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/mips/Kconfig +++ linux-aws-6.5-6.5.0/arch/mips/Kconfig @@ -482,6 +482,7 @@ config MACH_LOONGSON64 bool "Loongson 64-bit family of machines" + select ARCH_DMA_DEFAULT_COHERENT select ARCH_SPARSEMEM_ENABLE select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO @@ -1273,6 +1274,7 @@ select CPU_SUPPORTS_MSA select CPU_DIEI_BROKEN if !LOONGSON3_ENHANCEMENT select CPU_MIPSR2_IRQ_VI + select DMA_NONCOHERENT select WEAK_ORDERING select WEAK_REORDERING_BEYOND_LLSC select MIPS_ASID_BITS_VARIABLE only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/mips/include/asm/mach-loongson64/boot_param.h +++ linux-aws-6.5-6.5.0/arch/mips/include/asm/mach-loongson64/boot_param.h @@ -14,7 +14,11 @@ #define ADAPTER_ROM 8 #define ACPI_TABLE 9 #define SMBIOS_TABLE 10 -#define MAX_MEMORY_TYPE 11 +#define UMA_VIDEO_RAM 11 +#define VUMA_VIDEO_RAM 12 +#define MAX_MEMORY_TYPE 13 + +#define MEM_SIZE_IS_IN_BYTES (1 << 31) #define LOONGSON3_BOOT_MEM_MAP_MAX 128 struct efi_memory_map_loongson { @@ -117,7 +121,8 @@ u64 pci_io_start_addr; u64 pci_io_end_addr; u64 pci_config_addr; - u32 dma_mask_bits; + u16 dma_mask_bits; + u16 dma_noncoherent; } __packed; struct interface_info { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/mips/kvm/mmu.c +++ linux-aws-6.5-6.5.0/arch/mips/kvm/mmu.c @@ -592,7 +592,7 @@ gfn_t gfn = gpa >> PAGE_SHIFT; int srcu_idx, err; kvm_pfn_t pfn; - pte_t *ptep, entry, old_pte; + pte_t *ptep, entry; bool writeable; unsigned long prot_bits; unsigned long mmu_seq; @@ -664,7 +664,6 @@ entry = pfn_pte(pfn, __pgprot(prot_bits)); /* Write the PTE */ - old_pte = *ptep; set_pte(ptep, entry); err = 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/mips/loongson64/env.c +++ linux-aws-6.5-6.5.0/arch/mips/loongson64/env.c @@ -13,6 +13,8 @@ * Copyright (C) 2009 Lemote Inc. * Author: Wu Zhangjin, wuzhangjin@gmail.com */ + +#include #include #include #include @@ -147,8 +149,14 @@ loongson_sysconf.dma_mask_bits = eirq_source->dma_mask_bits; if (loongson_sysconf.dma_mask_bits < 32 || - loongson_sysconf.dma_mask_bits > 64) + loongson_sysconf.dma_mask_bits > 64) { loongson_sysconf.dma_mask_bits = 32; + dma_default_coherent = true; + } else { + dma_default_coherent = !eirq_source->dma_noncoherent; + } + + pr_info("Firmware: Coherent DMA: %s\n", dma_default_coherent ? "on" : "off"); loongson_sysconf.restart_addr = boot_p->reset_system.ResetWarm; loongson_sysconf.poweroff_addr = boot_p->reset_system.Shutdown; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/mips/loongson64/init.c +++ linux-aws-6.5-6.5.0/arch/mips/loongson64/init.c @@ -49,8 +49,7 @@ void __init szmem(unsigned int node) { u32 i, mem_type; - static unsigned long num_physpages; - u64 node_id, node_psize, start_pfn, end_pfn, mem_start, mem_size; + phys_addr_t node_id, mem_start, mem_size; /* Otherwise come from DTB */ if (loongson_sysconf.fw_interface != LOONGSON_LEFI) @@ -64,30 +63,46 @@ mem_type = loongson_memmap->map[i].mem_type; mem_size = loongson_memmap->map[i].mem_size; - mem_start = loongson_memmap->map[i].mem_start; + + /* Memory size comes in MB if MEM_SIZE_IS_IN_BYTES not set */ + if (mem_size & MEM_SIZE_IS_IN_BYTES) + mem_size &= ~MEM_SIZE_IS_IN_BYTES; + else + mem_size = mem_size << 20; + + mem_start = (node_id << 44) | loongson_memmap->map[i].mem_start; switch (mem_type) { case SYSTEM_RAM_LOW: case SYSTEM_RAM_HIGH: - start_pfn = ((node_id << 44) + mem_start) >> PAGE_SHIFT; - node_psize = (mem_size << 20) >> PAGE_SHIFT; - end_pfn = start_pfn + node_psize; - num_physpages += node_psize; - pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx MB\n", - (u32)node_id, mem_type, mem_start, mem_size); - pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", - start_pfn, end_pfn, num_physpages); - memblock_add_node(PFN_PHYS(start_pfn), - PFN_PHYS(node_psize), node, + case UMA_VIDEO_RAM: + pr_info("Node %d, mem_type:%d\t[%pa], %pa bytes usable\n", + (u32)node_id, mem_type, &mem_start, &mem_size); + memblock_add_node(mem_start, mem_size, node, MEMBLOCK_NONE); break; case SYSTEM_RAM_RESERVED: - pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx MB\n", - (u32)node_id, mem_type, mem_start, mem_size); - memblock_reserve(((node_id << 44) + mem_start), mem_size << 20); + case VIDEO_ROM: + case ADAPTER_ROM: + case ACPI_TABLE: + case SMBIOS_TABLE: + pr_info("Node %d, mem_type:%d\t[%pa], %pa bytes reserved\n", + (u32)node_id, mem_type, &mem_start, &mem_size); + memblock_reserve(mem_start, mem_size); + break; + /* We should not reserve VUMA_VIDEO_RAM as it overlaps with MMIO */ + case VUMA_VIDEO_RAM: + default: + pr_info("Node %d, mem_type:%d\t[%pa], %pa bytes unhandled\n", + (u32)node_id, mem_type, &mem_start, &mem_size); break; } } + + /* Reserve vgabios if it comes from firmware */ + if (loongson_sysconf.vgabios_addr) + memblock_reserve(virt_to_phys((void *)loongson_sysconf.vgabios_addr), + SZ_256K); } #ifndef CONFIG_NUMA only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/Kconfig +++ linux-aws-6.5-6.5.0/arch/parisc/Kconfig @@ -107,9 +107,12 @@ default n config GENERIC_BUG - bool - default y + def_bool y depends on BUG + select GENERIC_BUG_RELATIVE_POINTERS if 64BIT + +config GENERIC_BUG_RELATIVE_POINTERS + bool config GENERIC_HWEIGHT bool only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/include/asm/alternative.h +++ linux-aws-6.5-6.5.0/arch/parisc/include/asm/alternative.h @@ -34,7 +34,8 @@ /* Alternative SMP implementation. */ #define ALTERNATIVE(cond, replacement) "!0:" \ - ".section .altinstructions, \"aw\" !" \ + ".section .altinstructions, \"a\" !" \ + ".align 4 !" \ ".word (0b-4-.) !" \ ".hword 1, " __stringify(cond) " !" \ ".word " __stringify(replacement) " !" \ @@ -44,7 +45,8 @@ /* to replace one single instructions by a new instruction */ #define ALTERNATIVE(from, to, cond, replacement)\ - .section .altinstructions, "aw" ! \ + .section .altinstructions, "a" ! \ + .align 4 ! \ .word (from - .) ! \ .hword (to - from)/4, cond ! \ .word replacement ! \ @@ -52,7 +54,8 @@ /* to replace multiple instructions by new code */ #define ALTERNATIVE_CODE(from, num_instructions, cond, new_instr_ptr)\ - .section .altinstructions, "aw" ! \ + .section .altinstructions, "a" ! \ + .align 4 ! \ .word (from - .) ! \ .hword -num_instructions, cond ! \ .word (new_instr_ptr - .) ! \ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/include/asm/assembly.h +++ linux-aws-6.5-6.5.0/arch/parisc/include/asm/assembly.h @@ -574,6 +574,7 @@ */ #define ASM_EXCEPTIONTABLE_ENTRY(fault_addr, except_addr) \ .section __ex_table,"aw" ! \ + .align 4 ! \ .word (fault_addr - .), (except_addr - .) ! \ .previous only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/include/asm/bug.h +++ linux-aws-6.5-6.5.0/arch/parisc/include/asm/bug.h @@ -17,24 +17,27 @@ #define PARISC_BUG_BREAK_ASM "break 0x1f, 0x1fff" #define PARISC_BUG_BREAK_INSN 0x03ffe01f /* PARISC_BUG_BREAK_ASM */ -#if defined(CONFIG_64BIT) -#define ASM_WORD_INSN ".dword\t" +#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS +# define __BUG_REL(val) ".word " __stringify(val) " - ." #else -#define ASM_WORD_INSN ".word\t" +# define __BUG_REL(val) ".word " __stringify(val) #endif + #ifdef CONFIG_DEBUG_BUGVERBOSE #define BUG() \ do { \ asm volatile("\n" \ "1:\t" PARISC_BUG_BREAK_ASM "\n" \ - "\t.pushsection __bug_table,\"aw\"\n" \ - "2:\t" ASM_WORD_INSN "1b, %c0\n" \ - "\t.short %c1, %c2\n" \ - "\t.org 2b+%c3\n" \ + "\t.pushsection __bug_table,\"a\"\n" \ + "\t.align 4\n" \ + "2:\t" __BUG_REL(1b) "\n" \ + "\t" __BUG_REL(%c0) "\n" \ + "\t.short %1, %2\n" \ + "\t.blockz %3-2*4-2*2\n" \ "\t.popsection" \ : : "i" (__FILE__), "i" (__LINE__), \ - "i" (0), "i" (sizeof(struct bug_entry)) ); \ + "i" (0), "i" (sizeof(struct bug_entry)) ); \ unreachable(); \ } while(0) @@ -51,10 +54,12 @@ do { \ asm volatile("\n" \ "1:\t" PARISC_BUG_BREAK_ASM "\n" \ - "\t.pushsection __bug_table,\"aw\"\n" \ - "2:\t" ASM_WORD_INSN "1b, %c0\n" \ - "\t.short %c1, %c2\n" \ - "\t.org 2b+%c3\n" \ + "\t.pushsection __bug_table,\"a\"\n" \ + "\t.align 4\n" \ + "2:\t" __BUG_REL(1b) "\n" \ + "\t" __BUG_REL(%c0) "\n" \ + "\t.short %1, %2\n" \ + "\t.blockz %3-2*4-2*2\n" \ "\t.popsection" \ : : "i" (__FILE__), "i" (__LINE__), \ "i" (BUGFLAG_WARNING|(flags)), \ @@ -65,10 +70,11 @@ do { \ asm volatile("\n" \ "1:\t" PARISC_BUG_BREAK_ASM "\n" \ - "\t.pushsection __bug_table,\"aw\"\n" \ - "2:\t" ASM_WORD_INSN "1b\n" \ - "\t.short %c0\n" \ - "\t.org 2b+%c1\n" \ + "\t.pushsection __bug_table,\"a\"\n" \ + "\t.align 4\n" \ + "2:\t" __BUG_REL(1b) "\n" \ + "\t.short %0\n" \ + "\t.blockz %1-4-2\n" \ "\t.popsection" \ : : "i" (BUGFLAG_WARNING|(flags)), \ "i" (sizeof(struct bug_entry)) ); \ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/include/asm/jump_label.h +++ linux-aws-6.5-6.5.0/arch/parisc/include/asm/jump_label.h @@ -15,10 +15,12 @@ asm_volatile_goto("1:\n\t" "nop\n\t" ".pushsection __jump_table, \"aw\"\n\t" + ".align %1\n\t" ".word 1b - ., %l[l_yes] - .\n\t" __stringify(ASM_ULONG_INSN) " %c0 - .\n\t" ".popsection\n\t" - : : "i" (&((char *)key)[branch]) : : l_yes); + : : "i" (&((char *)key)[branch]), "i" (sizeof(long)) + : : l_yes); return false; l_yes: @@ -30,10 +32,12 @@ asm_volatile_goto("1:\n\t" "b,n %l[l_yes]\n\t" ".pushsection __jump_table, \"aw\"\n\t" + ".align %1\n\t" ".word 1b - ., %l[l_yes] - .\n\t" __stringify(ASM_ULONG_INSN) " %c0 - .\n\t" ".popsection\n\t" - : : "i" (&((char *)key)[branch]) : : l_yes); + : : "i" (&((char *)key)[branch]), "i" (sizeof(long)) + : : l_yes); return false; l_yes: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/include/asm/uaccess.h +++ linux-aws-6.5-6.5.0/arch/parisc/include/asm/uaccess.h @@ -41,6 +41,7 @@ #define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\ ".section __ex_table,\"aw\"\n" \ + ".align 4\n" \ ".word (" #fault_addr " - .), (" #except_addr " - .)\n\t" \ ".previous\n" only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/include/uapi/asm/errno.h +++ linux-aws-6.5-6.5.0/arch/parisc/include/uapi/asm/errno.h @@ -75,7 +75,6 @@ /* We now return you to your regularly scheduled HPUX. */ -#define ENOSYM 215 /* symbol does not exist in executable */ #define ENOTSOCK 216 /* Socket operation on non-socket */ #define EDESTADDRREQ 217 /* Destination address required */ #define EMSGSIZE 218 /* Message too long */ @@ -101,7 +100,6 @@ #define ETIMEDOUT 238 /* Connection timed out */ #define ECONNREFUSED 239 /* Connection refused */ #define EREFUSED ECONNREFUSED /* for HP's NFS apparently */ -#define EREMOTERELEASE 240 /* Remote peer released connection */ #define EHOSTDOWN 241 /* Host is down */ #define EHOSTUNREACH 242 /* No route to host */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/include/uapi/asm/pdc.h +++ linux-aws-6.5-6.5.0/arch/parisc/include/uapi/asm/pdc.h @@ -472,6 +472,7 @@ unsigned long arch_rev; unsigned long pot_key; unsigned long curr_key; + unsigned long width; /* default of PSW_W bit (1=enabled) */ }; struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/kernel/entry.S +++ linux-aws-6.5-6.5.0/arch/parisc/kernel/entry.S @@ -36,6 +36,24 @@ .level 2.0 #endif +/* + * We need seven instructions after a TLB insert for it to take effect. + * The PA8800/PA8900 processors are an exception and need 12 instructions. + * The RFI changes both IAOQ_Back and IAOQ_Front, so it counts as one. + */ +#ifdef CONFIG_64BIT +#define NUM_PIPELINE_INSNS 12 +#else +#define NUM_PIPELINE_INSNS 7 +#endif + + /* Insert num nops */ + .macro insert_nops num + .rept \num + nop + .endr + .endm + /* Get aligned page_table_lock address for this mm from cr28/tr4 */ .macro get_ptl reg mfctl %cr28,\reg @@ -415,24 +433,20 @@ 3: .endm - /* Release page_table_lock without reloading lock address. - We use an ordered store to ensure all prior accesses are - performed prior to releasing the lock. */ - .macro ptl_unlock0 spc,tmp,tmp2 + /* Release page_table_lock if for user space. We use an ordered + store to ensure all prior accesses are performed prior to + releasing the lock. Note stw may not be executed, so we + provide one extra nop when CONFIG_TLB_PTLOCK is defined. */ + .macro ptl_unlock spc,tmp,tmp2 #ifdef CONFIG_TLB_PTLOCK -98: ldi __ARCH_SPIN_LOCK_UNLOCKED_VAL, \tmp2 +98: get_ptl \tmp + ldi __ARCH_SPIN_LOCK_UNLOCKED_VAL, \tmp2 or,COND(=) %r0,\spc,%r0 stw,ma \tmp2,0(\tmp) 99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP) -#endif - .endm - - /* Release page_table_lock. */ - .macro ptl_unlock1 spc,tmp,tmp2 -#ifdef CONFIG_TLB_PTLOCK -98: get_ptl \tmp - ptl_unlock0 \spc,\tmp,\tmp2 -99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP) + insert_nops NUM_PIPELINE_INSNS - 4 +#else + insert_nops NUM_PIPELINE_INSNS - 1 #endif .endm @@ -461,13 +475,13 @@ * to a CPU TLB 4k PFN (4k => 12 bits to shift) */ #define PAGE_ADD_SHIFT (PAGE_SHIFT-12) #define PAGE_ADD_HUGE_SHIFT (REAL_HPAGE_SHIFT-12) + #define PFN_START_BIT (63-ASM_PFN_PTE_SHIFT+(63-58)-PAGE_ADD_SHIFT) /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ .macro convert_for_tlb_insert20 pte,tmp #ifdef CONFIG_HUGETLB_PAGE copy \pte,\tmp - extrd,u \tmp,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\ - 64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte + extrd,u \tmp,PFN_START_BIT,PFN_START_BIT+1,\pte depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\ (63-58)+PAGE_ADD_SHIFT,\pte @@ -475,8 +489,7 @@ depdi _HUGE_PAGE_SIZE_ENCODING_DEFAULT,63,\ (63-58)+PAGE_ADD_HUGE_SHIFT,\pte #else /* Huge pages disabled */ - extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\ - 64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte + extrd,u \pte,PFN_START_BIT,PFN_START_BIT+1,\pte depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\ (63-58)+PAGE_ADD_SHIFT,\pte #endif @@ -1124,7 +1137,7 @@ idtlbt pte,prot - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1133,6 +1146,7 @@ idtlbt pte,prot + insert_nops NUM_PIPELINE_INSNS - 1 rfir nop @@ -1150,7 +1164,7 @@ idtlbt pte,prot - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1159,6 +1173,7 @@ idtlbt pte,prot + insert_nops NUM_PIPELINE_INSNS - 1 rfir nop @@ -1184,7 +1199,7 @@ mtsp t1, %sr1 /* Restore sr1 */ - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1194,6 +1209,7 @@ idtlba pte,(va) idtlbp prot,(va) + insert_nops NUM_PIPELINE_INSNS - 1 rfir nop @@ -1217,7 +1233,7 @@ mtsp t1, %sr1 /* Restore sr1 */ - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1227,6 +1243,7 @@ idtlba pte,(va) idtlbp prot,(va) + insert_nops NUM_PIPELINE_INSNS - 1 rfir nop @@ -1246,7 +1263,7 @@ idtlbt pte,prot - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1255,6 +1272,7 @@ idtlbt pte,prot + insert_nops NUM_PIPELINE_INSNS - 1 rfir nop @@ -1274,7 +1292,7 @@ idtlbt pte,prot - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1283,6 +1301,7 @@ idtlbt pte,prot + insert_nops NUM_PIPELINE_INSNS - 1 rfir nop @@ -1319,7 +1338,7 @@ iitlbt pte,prot - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1343,7 +1362,7 @@ iitlbt pte,prot - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1352,6 +1371,7 @@ iitlbt pte,prot + insert_nops NUM_PIPELINE_INSNS - 1 rfir nop @@ -1377,7 +1397,7 @@ mtsp t1, %sr1 /* Restore sr1 */ - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1401,7 +1421,7 @@ mtsp t1, %sr1 /* Restore sr1 */ - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1411,6 +1431,7 @@ iitlba pte,(%sr0, va) iitlbp prot,(%sr0, va) + insert_nops NUM_PIPELINE_INSNS - 1 rfir nop @@ -1431,7 +1452,7 @@ iitlbt pte,prot - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1451,7 +1472,7 @@ iitlbt pte,prot - ptl_unlock1 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1460,6 +1481,7 @@ iitlbt pte,prot + insert_nops NUM_PIPELINE_INSNS - 1 rfir nop @@ -1481,7 +1503,7 @@ idtlbt pte,prot - ptl_unlock0 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop #else @@ -1507,7 +1529,7 @@ mtsp t1, %sr1 /* Restore sr1 */ - ptl_unlock0 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop @@ -1527,7 +1549,7 @@ idtlbt pte,prot - ptl_unlock0 spc,t0,t1 + ptl_unlock spc,t0,t1 rfir nop #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/kernel/head.S +++ linux-aws-6.5-6.5.0/arch/parisc/kernel/head.S @@ -70,9 +70,8 @@ stw,ma %arg2,4(%r1) stw,ma %arg3,4(%r1) -#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20) - /* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU - * and halt kernel if we detect a PA1.x CPU. */ +#if defined(CONFIG_PA20) + /* check for 64-bit capable CPU as required by current kernel */ ldi 32,%r10 mtctl %r10,%cr11 .level 2.0 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/parisc/kernel/vmlinux.lds.S +++ linux-aws-6.5-6.5.0/arch/parisc/kernel/vmlinux.lds.S @@ -130,6 +130,7 @@ RO_DATA(8) /* unwind info */ + . = ALIGN(4); .PARISC.unwind : { __start___unwind = .; *(.PARISC.unwind) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/Kconfig +++ linux-aws-6.5-6.5.0/arch/powerpc/Kconfig @@ -917,7 +917,7 @@ default "6" if PPC32 && PPC_64K_PAGES range 4 10 if PPC32 && PPC_256K_PAGES default "4" if PPC32 && PPC_256K_PAGES - range 10 10 + range 10 12 default "10" help The kernel page allocator limits the size of maximal physically only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/include/asm/nohash/32/pte-40x.h +++ linux-aws-6.5-6.5.0/arch/powerpc/include/asm/nohash/32/pte-40x.h @@ -69,9 +69,6 @@ #define _PTE_NONE_MASK 0 -/* Until my rework is finished, 40x still needs atomic PTE updates */ -#define PTE_ATOMIC_UPDATES 1 - #define _PAGE_BASE_NC (_PAGE_PRESENT | _PAGE_ACCESSED) #define _PAGE_BASE (_PAGE_BASE_NC) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/kernel/fpu.S +++ linux-aws-6.5-6.5.0/arch/powerpc/kernel/fpu.S @@ -23,6 +23,15 @@ #include #ifdef CONFIG_VSX +#define __REST_1FPVSR(n,c,base) \ +BEGIN_FTR_SECTION \ + b 2f; \ +END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ + REST_FPR(n,base); \ + b 3f; \ +2: REST_VSR(n,c,base); \ +3: + #define __REST_32FPVSRS(n,c,base) \ BEGIN_FTR_SECTION \ b 2f; \ @@ -41,9 +50,11 @@ 2: SAVE_32VSRS(n,c,base); \ 3: #else +#define __REST_1FPVSR(n,b,base) REST_FPR(n, base) #define __REST_32FPVSRS(n,b,base) REST_32FPRS(n, base) #define __SAVE_32FPVSRS(n,b,base) SAVE_32FPRS(n, base) #endif +#define REST_1FPVSR(n,c,base) __REST_1FPVSR(n,__REG_##c,__REG_##base) #define REST_32FPVSRS(n,c,base) __REST_32FPVSRS(n,__REG_##c,__REG_##base) #define SAVE_32FPVSRS(n,c,base) __SAVE_32FPVSRS(n,__REG_##c,__REG_##base) @@ -67,6 +78,7 @@ SAVE_32FPVSRS(0, R4, R3) mffs fr0 stfd fr0,FPSTATE_FPSCR(r3) + REST_1FPVSR(0, R4, R3) blr EXPORT_SYMBOL(store_fp_state) @@ -138,4 +150,5 @@ 2: SAVE_32FPVSRS(0, R4, R6) mffs fr0 stfd fr0,FPSTATE_FPSCR(r6) + REST_1FPVSR(0, R4, R6) blr only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/kernel/head_85xx.S +++ linux-aws-6.5-6.5.0/arch/powerpc/kernel/head_85xx.S @@ -396,7 +396,7 @@ #ifdef CONFIG_PPC_FPU FP_UNAVAILABLE_EXCEPTION #else - EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, unknown_exception) + EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, emulation_assist_interrupt) #endif /* System Call Interrupt */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/kernel/process.c +++ linux-aws-6.5-6.5.0/arch/powerpc/kernel/process.c @@ -1198,11 +1198,11 @@ usermsr = current->thread.regs->msr; + /* Caller has enabled FP/VEC/VSX/TM in MSR */ if (usermsr & MSR_FP) - save_fpu(current); - + __giveup_fpu(current); if (usermsr & MSR_VEC) - save_altivec(current); + __giveup_altivec(current); #ifdef CONFIG_PPC_TRANSACTIONAL_MEM if (usermsr & MSR_TM) { @@ -2258,6 +2258,22 @@ return ret; } +static bool empty_user_regs(struct pt_regs *regs, struct task_struct *tsk) +{ + unsigned long stack_page; + + // A non-empty pt_regs should never have a zero MSR or TRAP value. + if (regs->msr || regs->trap) + return false; + + // Check it sits at the very base of the stack + stack_page = (unsigned long)task_stack_page(tsk); + if ((unsigned long)(regs + 1) != stack_page + THREAD_SIZE) + return false; + + return true; +} + static int kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH; void __no_sanitize_address show_stack(struct task_struct *tsk, @@ -2322,9 +2338,13 @@ lr = regs->link; printk("%s--- interrupt: %lx at %pS\n", loglvl, regs->trap, (void *)regs->nip); - __show_regs(regs); - printk("%s--- interrupt: %lx\n", - loglvl, regs->trap); + + // Detect the case of an empty pt_regs at the very base + // of the stack and suppress showing it in full. + if (!empty_user_regs(regs, tsk)) { + __show_regs(regs); + printk("%s--- interrupt: %lx\n", loglvl, regs->trap); + } firstframe = 1; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/kernel/trace/ftrace_mprofile.S +++ linux-aws-6.5-6.5.0/arch/powerpc/kernel/trace/ftrace_mprofile.S @@ -62,7 +62,7 @@ .endif /* Save previous stack pointer (r1) */ - addi r8, r1, SWITCH_FRAME_SIZE + addi r8, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE PPC_STL r8, GPR1(r1) .if \allregs == 1 @@ -182,7 +182,7 @@ mflr r3 mtctr r3 REST_GPR(3, r1) - addi r1, r1, SWITCH_FRAME_SIZE + addi r1, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE mtlr r0 bctr #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/kernel/vector.S +++ linux-aws-6.5-6.5.0/arch/powerpc/kernel/vector.S @@ -33,6 +33,7 @@ mfvscr v0 li r4, VRSTATE_VSCR stvx v0, r4, r3 + lvx v0, 0, r3 blr EXPORT_SYMBOL(store_vr_state) @@ -109,6 +110,7 @@ mfvscr v0 li r4,VRSTATE_VSCR stvx v0,r4,r7 + lvx v0,0,r7 blr #ifdef CONFIG_VSX only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/lib/qspinlock.c +++ linux-aws-6.5-6.5.0/arch/powerpc/lib/qspinlock.c @@ -406,6 +406,9 @@ if ((yield_count & 1) == 0) goto yield_prev; /* owner vcpu is running */ + if (get_owner_cpu(READ_ONCE(lock->val)) != yield_cpu) + goto yield_prev; /* re-sample lock owner */ + spin_end(); preempted = true; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/mm/mem.c +++ linux-aws-6.5-6.5.0/arch/powerpc/mm/mem.c @@ -288,7 +288,6 @@ #endif high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); - set_max_mapnr(max_pfn); kasan_late_init(); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/perf/core-book3s.c +++ linux-aws-6.5-6.5.0/arch/powerpc/perf/core-book3s.c @@ -1371,8 +1371,7 @@ /* * Disable instruction sampling if it was enabled */ - if (cpuhw->mmcr.mmcra & MMCRA_SAMPLE_ENABLE) - val &= ~MMCRA_SAMPLE_ENABLE; + val &= ~MMCRA_SAMPLE_ENABLE; /* Disable BHRB via mmcra (BHRBRD) for p10 */ if (ppmu->flags & PPMU_ARCH_31) @@ -1383,7 +1382,7 @@ * instruction sampling or BHRB. */ if (val != mmcra) { - mtspr(SPRN_MMCRA, mmcra); + mtspr(SPRN_MMCRA, val); mb(); isync(); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/perf/imc-pmu.c +++ linux-aws-6.5-6.5.0/arch/powerpc/perf/imc-pmu.c @@ -51,7 +51,7 @@ * core and trace-imc */ static struct imc_pmu_ref imc_global_refc = { - .lock = __SPIN_LOCK_INITIALIZER(imc_global_refc.lock), + .lock = __SPIN_LOCK_UNLOCKED(imc_global_refc.lock), .id = 0, .refc = 0, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/platforms/book3s/vas-api.c +++ linux-aws-6.5-6.5.0/arch/powerpc/platforms/book3s/vas-api.c @@ -4,6 +4,8 @@ * Copyright (C) 2019 Haren Myneni, IBM Corp */ +#define pr_fmt(fmt) "vas-api: " fmt + #include #include #include @@ -78,7 +80,7 @@ task_ref->mm = get_task_mm(current); if (!task_ref->mm) { put_pid(task_ref->pid); - pr_err("VAS: pid(%d): mm_struct is not found\n", + pr_err("pid(%d): mm_struct is not found\n", current->pid); return -EPERM; } @@ -235,8 +237,7 @@ rc = kill_pid_info(SIGSEGV, &info, pid); rcu_read_unlock(); - pr_devel("%s(): pid %d kill_proc_info() rc %d\n", __func__, - pid_vnr(pid), rc); + pr_devel("pid %d kill_proc_info() rc %d\n", pid_vnr(pid), rc); } void vas_dump_crb(struct coprocessor_request_block *crb) @@ -294,7 +295,7 @@ rc = copy_from_user(&uattr, uptr, sizeof(uattr)); if (rc) { - pr_err("%s(): copy_from_user() returns %d\n", __func__, rc); + pr_err("copy_from_user() returns %d\n", rc); return -EFAULT; } @@ -311,7 +312,7 @@ txwin = cp_inst->coproc->vops->open_win(uattr.vas_id, uattr.flags, cp_inst->coproc->cop_type); if (IS_ERR(txwin)) { - pr_err("%s() VAS window open failed, %ld\n", __func__, + pr_err_ratelimited("VAS window open failed rc=%ld\n", PTR_ERR(txwin)); return PTR_ERR(txwin); } @@ -405,8 +406,7 @@ * window is not opened. Shouldn't expect this error. */ if (!cp_inst || !cp_inst->txwin) { - pr_err("%s(): Unexpected fault on paste address with TX window closed\n", - __func__); + pr_err("Unexpected fault on paste address with TX window closed\n"); return VM_FAULT_SIGBUS; } @@ -421,8 +421,7 @@ * issue NX request. */ if (txwin->task_ref.vma != vmf->vma) { - pr_err("%s(): No previous mapping with paste address\n", - __func__); + pr_err("No previous mapping with paste address\n"); return VM_FAULT_SIGBUS; } @@ -481,19 +480,19 @@ txwin = cp_inst->txwin; if ((vma->vm_end - vma->vm_start) > PAGE_SIZE) { - pr_debug("%s(): size 0x%zx, PAGE_SIZE 0x%zx\n", __func__, + pr_debug("size 0x%zx, PAGE_SIZE 0x%zx\n", (vma->vm_end - vma->vm_start), PAGE_SIZE); return -EINVAL; } /* Ensure instance has an open send window */ if (!txwin) { - pr_err("%s(): No send window open?\n", __func__); + pr_err("No send window open?\n"); return -EINVAL; } if (!cp_inst->coproc->vops || !cp_inst->coproc->vops->paste_addr) { - pr_err("%s(): VAS API is not registered\n", __func__); + pr_err("VAS API is not registered\n"); return -EACCES; } @@ -510,14 +509,14 @@ */ mutex_lock(&txwin->task_ref.mmap_mutex); if (txwin->status != VAS_WIN_ACTIVE) { - pr_err("%s(): Window is not active\n", __func__); + pr_err("Window is not active\n"); rc = -EACCES; goto out; } paste_addr = cp_inst->coproc->vops->paste_addr(txwin); if (!paste_addr) { - pr_err("%s(): Window paste address failed\n", __func__); + pr_err("Window paste address failed\n"); rc = -EINVAL; goto out; } @@ -533,8 +532,8 @@ rc = remap_pfn_range(vma, vma->vm_start, pfn + vma->vm_pgoff, vma->vm_end - vma->vm_start, prot); - pr_devel("%s(): paste addr %llx at %lx, rc %d\n", __func__, - paste_addr, vma->vm_start, rc); + pr_devel("paste addr %llx at %lx, rc %d\n", paste_addr, + vma->vm_start, rc); txwin->task_ref.vma = vma; vma->vm_ops = &vas_vm_ops; @@ -609,8 +608,7 @@ goto err; } - pr_devel("%s: Added dev [%d,%d]\n", __func__, MAJOR(devno), - MINOR(devno)); + pr_devel("Added dev [%d,%d]\n", MAJOR(devno), MINOR(devno)); return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/platforms/powernv/opal-prd.c +++ linux-aws-6.5-6.5.0/arch/powerpc/platforms/powernv/opal-prd.c @@ -24,13 +24,20 @@ #include +struct opal_prd_msg { + union { + struct opal_prd_msg_header header; + DECLARE_FLEX_ARRAY(u8, data); + }; +}; + /* * The msg member must be at the end of the struct, as it's followed by the * message data. */ struct opal_prd_msg_queue_item { - struct list_head list; - struct opal_prd_msg_header msg; + struct list_head list; + struct opal_prd_msg msg; }; static struct device_node *prd_node; @@ -156,7 +163,7 @@ int rc; /* we need at least a header's worth of data */ - if (count < sizeof(item->msg)) + if (count < sizeof(item->msg.header)) return -EINVAL; if (*ppos) @@ -186,7 +193,7 @@ return -EINTR; } - size = be16_to_cpu(item->msg.size); + size = be16_to_cpu(item->msg.header.size); if (size > count) { err = -EINVAL; goto err_requeue; @@ -352,7 +359,7 @@ if (!item) return -ENOMEM; - memcpy(&item->msg, msg->params, msg_size); + memcpy(&item->msg.data, msg->params, msg_size); spin_lock_irqsave(&opal_prd_msg_queue_lock, flags); list_add_tail(&item->list, &opal_prd_msg_queue); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/platforms/pseries/iommu.c +++ linux-aws-6.5-6.5.0/arch/powerpc/platforms/pseries/iommu.c @@ -916,7 +916,8 @@ return 0; } -static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift) +static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift, + bool *direct_mapping) { struct dma_win *window; const struct dynamic_dma_window_prop *dma64; @@ -929,6 +930,7 @@ dma64 = window->prop; *dma_addr = be64_to_cpu(dma64->dma_base); *window_shift = be32_to_cpu(dma64->window_shift); + *direct_mapping = window->direct; found = true; break; } @@ -1272,10 +1274,8 @@ mutex_lock(&dma_win_init_mutex); - if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len)) { - direct_mapping = (len >= max_ram_len); + if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len, &direct_mapping)) goto out_unlock; - } /* * If we already went through this for a previous function of only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/platforms/pseries/vas.c +++ linux-aws-6.5-6.5.0/arch/powerpc/platforms/pseries/vas.c @@ -340,7 +340,7 @@ if (atomic_inc_return(&cop_feat_caps->nr_used_credits) > atomic_read(&cop_feat_caps->nr_total_credits)) { - pr_err("Credits are not available to allocate window\n"); + pr_err_ratelimited("Credits are not available to allocate window\n"); rc = -EINVAL; goto out; } @@ -423,7 +423,7 @@ put_vas_user_win_ref(&txwin->vas_win.task_ref); rc = -EBUSY; - pr_err("No credit is available to allocate window\n"); + pr_err_ratelimited("No credit is available to allocate window\n"); out_free: /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/powerpc/sysdev/xive/native.c +++ linux-aws-6.5-6.5.0/arch/powerpc/sysdev/xive/native.c @@ -802,7 +802,7 @@ if (out_qpage) *out_qpage = be64_to_cpu(qpage); if (out_qsize) - *out_qsize = be32_to_cpu(qsize); + *out_qsize = be64_to_cpu(qsize); if (out_qeoi_page) *out_qeoi_page = be64_to_cpu(qeoi_page); if (out_escalate_irq) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/Kconfig.socs +++ linux-aws-6.5-6.5.0/arch/riscv/Kconfig.socs @@ -29,6 +29,7 @@ bool "StarFive SoCs" select PINCTRL select RESET_CONTROLLER + select ARM_AMBA help This enables support for StarFive SoC platform hardware. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/boot/Makefile +++ linux-aws-6.5-6.5.0/arch/riscv/boot/Makefile @@ -17,6 +17,7 @@ KCOV_INSTRUMENT := n OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S +OBJCOPYFLAGS_loader.bin :=-O binary OBJCOPYFLAGS_xipImage :=-O binary -R .note -R .note.gnu.build-id -R .comment -S targets := Image Image.* loader loader.o loader.lds loader.bin only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi +++ linux-aws-6.5-6.5.0/arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi @@ -30,7 +30,6 @@ cpu0_intc: interrupt-controller { compatible = "riscv,cpu-intc"; interrupt-controller; - #address-cells = <0>; #interrupt-cells = <1>; }; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/boot/dts/thead/th1520.dtsi +++ linux-aws-6.5-6.5.0/arch/riscv/boot/dts/thead/th1520.dtsi @@ -139,6 +139,7 @@ interrupt-parent = <&plic>; #address-cells = <2>; #size-cells = <2>; + dma-noncoherent; ranges; plic: interrupt-controller@ffd8000000 { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/include/asm/asm-prototypes.h +++ linux-aws-6.5-6.5.0/arch/riscv/include/asm/asm-prototypes.h @@ -25,7 +25,6 @@ DECLARE_DO_ERROR_INFO(do_trap_ecall_m); DECLARE_DO_ERROR_INFO(do_trap_break); -asmlinkage unsigned long get_overflow_stack(void); asmlinkage void handle_bad_stack(struct pt_regs *regs); asmlinkage void do_page_fault(struct pt_regs *regs); asmlinkage void do_irq(struct pt_regs *regs); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/include/asm/asm.h +++ linux-aws-6.5-6.5.0/arch/riscv/include/asm/asm.h @@ -82,6 +82,28 @@ .endr .endm +#ifdef CONFIG_SMP +#ifdef CONFIG_32BIT +#define PER_CPU_OFFSET_SHIFT 2 +#else +#define PER_CPU_OFFSET_SHIFT 3 +#endif + +.macro asm_per_cpu dst sym tmp + REG_L \tmp, TASK_TI_CPU_NUM(tp) + slli \tmp, \tmp, PER_CPU_OFFSET_SHIFT + la \dst, __per_cpu_offset + add \dst, \dst, \tmp + REG_L \tmp, 0(\dst) + la \dst, \sym + add \dst, \dst, \tmp +.endm +#else /* CONFIG_SMP */ +.macro asm_per_cpu dst sym tmp + la \dst, \sym +.endm +#endif /* CONFIG_SMP */ + /* save all GPs except x1 ~ x5 */ .macro save_from_x6_to_x31 REG_S x6, PT_T1(sp) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/include/asm/hwprobe.h +++ linux-aws-6.5-6.5.0/arch/riscv/include/asm/hwprobe.h @@ -10,4 +10,9 @@ #define RISCV_HWPROBE_MAX_KEY 5 +static inline bool riscv_hwprobe_key_is_valid(__s64 key) +{ + return key >= 0 && key <= RISCV_HWPROBE_MAX_KEY; +} + #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/include/asm/page.h +++ linux-aws-6.5-6.5.0/arch/riscv/include/asm/page.h @@ -33,8 +33,8 @@ #define PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL) #endif /* - * By default, CONFIG_PAGE_OFFSET value corresponds to SV48 address space so - * define the PAGE_OFFSET value for SV39. + * By default, CONFIG_PAGE_OFFSET value corresponds to SV57 address space so + * define the PAGE_OFFSET value for SV48 and SV39. */ #define PAGE_OFFSET_L4 _AC(0xffffaf8000000000, UL) #define PAGE_OFFSET_L3 _AC(0xffffffd800000000, UL) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/include/asm/thread_info.h +++ linux-aws-6.5-6.5.0/arch/riscv/include/asm/thread_info.h @@ -34,9 +34,6 @@ #ifndef __ASSEMBLY__ -extern long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE / sizeof(long)]; -extern unsigned long spin_shadow_stack; - #include #include only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/include/asm/vdso/processor.h +++ linux-aws-6.5-6.5.0/arch/riscv/include/asm/vdso/processor.h @@ -14,7 +14,7 @@ __asm__ __volatile__ ("div %0, %0, zero" : "=r" (dummy)); #endif -#ifdef __riscv_zihintpause +#ifdef CONFIG_TOOLCHAIN_HAS_ZIHINTPAUSE /* * Reduce instruction retirement. * This assumes the PC changes. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/kernel/asm-offsets.c +++ linux-aws-6.5-6.5.0/arch/riscv/kernel/asm-offsets.c @@ -39,6 +39,7 @@ OFFSET(TASK_TI_KERNEL_SP, task_struct, thread_info.kernel_sp); OFFSET(TASK_TI_USER_SP, task_struct, thread_info.user_sp); + OFFSET(TASK_TI_CPU_NUM, task_struct, thread_info.cpu); OFFSET(TASK_THREAD_F0, task_struct, thread.fstate.f[0]); OFFSET(TASK_THREAD_F1, task_struct, thread.fstate.f[1]); OFFSET(TASK_THREAD_F2, task_struct, thread.fstate.f[2]); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/kernel/cpu.c +++ linux-aws-6.5-6.5.0/arch/riscv/kernel/cpu.c @@ -88,13 +88,14 @@ */ int riscv_of_parent_hartid(struct device_node *node, unsigned long *hartid) { - int rc; - for (; node; node = node->parent) { if (of_device_is_compatible(node, "riscv")) { - rc = riscv_of_processor_hartid(node, hartid); - if (!rc) - return 0; + *hartid = (unsigned long)of_get_cpu_hwid(node, 0); + if (*hartid == ~0UL) { + pr_warn("Found CPU without hart ID\n"); + return -ENODEV; + } + return 0; } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/kernel/entry.S +++ linux-aws-6.5-6.5.0/arch/riscv/kernel/entry.S @@ -10,9 +10,13 @@ #include #include #include +#include #include #include #include +#include + + .section .irqentry.text, "ax" SYM_CODE_START(handle_exception) /* @@ -170,67 +174,15 @@ #ifdef CONFIG_VMAP_STACK SYM_CODE_START_LOCAL(handle_kernel_stack_overflow) - /* - * Takes the psuedo-spinlock for the shadow stack, in case multiple - * harts are concurrently overflowing their kernel stacks. We could - * store any value here, but since we're overflowing the kernel stack - * already we only have SP to use as a scratch register. So we just - * swap in the address of the spinlock, as that's definately non-zero. - * - * Pairs with a store_release in handle_bad_stack(). - */ -1: la sp, spin_shadow_stack - REG_AMOSWAP_AQ sp, sp, (sp) - bnez sp, 1b - - la sp, shadow_stack - addi sp, sp, SHADOW_OVERFLOW_STACK_SIZE - - //save caller register to shadow stack - addi sp, sp, -(PT_SIZE_ON_STACK) - REG_S x1, PT_RA(sp) - REG_S x5, PT_T0(sp) - REG_S x6, PT_T1(sp) - REG_S x7, PT_T2(sp) - REG_S x10, PT_A0(sp) - REG_S x11, PT_A1(sp) - REG_S x12, PT_A2(sp) - REG_S x13, PT_A3(sp) - REG_S x14, PT_A4(sp) - REG_S x15, PT_A5(sp) - REG_S x16, PT_A6(sp) - REG_S x17, PT_A7(sp) - REG_S x28, PT_T3(sp) - REG_S x29, PT_T4(sp) - REG_S x30, PT_T5(sp) - REG_S x31, PT_T6(sp) - - la ra, restore_caller_reg - tail get_overflow_stack - -restore_caller_reg: - //save per-cpu overflow stack - REG_S a0, -8(sp) - //restore caller register from shadow_stack - REG_L x1, PT_RA(sp) - REG_L x5, PT_T0(sp) - REG_L x6, PT_T1(sp) - REG_L x7, PT_T2(sp) - REG_L x10, PT_A0(sp) - REG_L x11, PT_A1(sp) - REG_L x12, PT_A2(sp) - REG_L x13, PT_A3(sp) - REG_L x14, PT_A4(sp) - REG_L x15, PT_A5(sp) - REG_L x16, PT_A6(sp) - REG_L x17, PT_A7(sp) - REG_L x28, PT_T3(sp) - REG_L x29, PT_T4(sp) - REG_L x30, PT_T5(sp) - REG_L x31, PT_T6(sp) + /* we reach here from kernel context, sscratch must be 0 */ + csrrw x31, CSR_SCRATCH, x31 + asm_per_cpu sp, overflow_stack, x31 + li x31, OVERFLOW_STACK_SIZE + add sp, sp, x31 + /* zero out x31 again and restore x31 */ + xor x31, x31, x31 + csrrw x31, CSR_SCRATCH, x31 - //load per-cpu overflow stack - REG_L sp, -8(sp) addi sp, sp, -(PT_SIZE_ON_STACK) //save context to overflow stack only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/kernel/probes/simulate-insn.c +++ linux-aws-6.5-6.5.0/arch/riscv/kernel/probes/simulate-insn.c @@ -24,7 +24,7 @@ unsigned long val) { if (index == 0) - return false; + return true; else if (index <= 31) *((unsigned long *)regs + index) = val; else only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/kernel/probes/uprobes.c +++ linux-aws-6.5-6.5.0/arch/riscv/kernel/probes/uprobes.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "decode-insn.h" @@ -17,6 +18,11 @@ #endif } +bool is_trap_insn(uprobe_opcode_t *insn) +{ + return riscv_insn_is_ebreak(*insn) || riscv_insn_is_c_ebreak(*insn); +} + unsigned long uprobe_get_swbp_addr(struct pt_regs *regs) { return instruction_pointer(regs); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/kernel/traps_misaligned.c +++ linux-aws-6.5-6.5.0/arch/riscv/kernel/traps_misaligned.c @@ -342,16 +342,14 @@ } else if ((insn & INSN_MASK_C_SD) == INSN_MATCH_C_SD) { len = 8; val.data_ulong = GET_RS2S(insn, regs); - } else if ((insn & INSN_MASK_C_SDSP) == INSN_MATCH_C_SDSP && - ((insn >> SH_RD) & 0x1f)) { + } else if ((insn & INSN_MASK_C_SDSP) == INSN_MATCH_C_SDSP) { len = 8; val.data_ulong = GET_RS2C(insn, regs); #endif } else if ((insn & INSN_MASK_C_SW) == INSN_MATCH_C_SW) { len = 4; val.data_ulong = GET_RS2S(insn, regs); - } else if ((insn & INSN_MASK_C_SWSP) == INSN_MATCH_C_SWSP && - ((insn >> SH_RD) & 0x1f)) { + } else if ((insn & INSN_MASK_C_SWSP) == INSN_MATCH_C_SWSP) { len = 4; val.data_ulong = GET_RS2C(insn, regs); } else { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/kernel/vdso/hwprobe.c +++ linux-aws-6.5-6.5.0/arch/riscv/kernel/vdso/hwprobe.c @@ -37,7 +37,7 @@ /* This is something we can handle, fill out the pairs. */ while (p < end) { - if (p->key <= RISCV_HWPROBE_MAX_KEY) { + if (riscv_hwprobe_key_is_valid(p->key)) { p->value = avd->all_cpu_hwprobe_values[p->key]; } else { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/riscv/mm/ptdump.c +++ linux-aws-6.5-6.5.0/arch/riscv/mm/ptdump.c @@ -384,6 +384,9 @@ kernel_ptd_info.base_addr = KERN_VIRT_START; + pg_level[1].name = pgtable_l5_enabled ? "P4D" : "PGD"; + pg_level[2].name = pgtable_l4_enabled ? "PUD" : "PGD"; + for (i = 0; i < ARRAY_SIZE(pg_level); i++) for (j = 0; j < ARRAY_SIZE(pte_bits); j++) pg_level[i].mask |= pte_bits[j].mask; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/s390/boot/vmem.c +++ linux-aws-6.5-6.5.0/arch/s390/boot/vmem.c @@ -57,6 +57,7 @@ pmd_t pmd_z = __pmd(__pa(kasan_early_shadow_pte) | _SEGMENT_ENTRY); pud_t pud_z = __pud(__pa(kasan_early_shadow_pmd) | _REGION3_ENTRY); p4d_t p4d_z = __p4d(__pa(kasan_early_shadow_pud) | _REGION2_ENTRY); + unsigned long memgap_start = 0; unsigned long untracked_end; unsigned long start, end; int i; @@ -101,8 +102,12 @@ * +- shadow end ----+---------+- shadow end ---+ */ - for_each_physmem_usable_range(i, &start, &end) + for_each_physmem_usable_range(i, &start, &end) { kasan_populate(start, end, POPULATE_KASAN_MAP_SHADOW); + if (memgap_start && physmem_info.info_source == MEM_DETECT_DIAG260) + kasan_populate(memgap_start, start, POPULATE_KASAN_ZERO_SHADOW); + memgap_start = end; + } if (IS_ENABLED(CONFIG_KASAN_VMALLOC)) { untracked_end = VMALLOC_START; /* shallowly populate kasan shadow for vmalloc and modules */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/s390/mm/page-states.c +++ linux-aws-6.5-6.5.0/arch/s390/mm/page-states.c @@ -121,7 +121,7 @@ continue; if (!pud_folded(*pud)) { page = phys_to_page(pud_val(*pud)); - for (i = 0; i < 3; i++) + for (i = 0; i < 4; i++) set_bit(PG_arch_1, &page[i].flags); } mark_kernel_pmd(pud, addr, next); @@ -142,7 +142,7 @@ continue; if (!p4d_folded(*p4d)) { page = phys_to_page(p4d_val(*p4d)); - for (i = 0; i < 3; i++) + for (i = 0; i < 4; i++) set_bit(PG_arch_1, &page[i].flags); } mark_kernel_pud(p4d, addr, next); @@ -164,7 +164,7 @@ continue; if (!pgd_folded(*pgd)) { page = phys_to_page(pgd_val(*pgd)); - for (i = 0; i < 3; i++) + for (i = 0; i < 4; i++) set_bit(PG_arch_1, &page[i].flags); } mark_kernel_p4d(pgd, addr, next); @@ -181,6 +181,12 @@ return; /* Mark pages used in kernel page tables */ mark_kernel_pgd(); + page = virt_to_page(&swapper_pg_dir); + for (i = 0; i < 4; i++) + set_bit(PG_arch_1, &page[i].flags); + page = virt_to_page(&invalid_pg_dir); + for (i = 0; i < 4; i++) + set_bit(PG_arch_1, &page[i].flags); /* Set all kernel pages not used for page tables to stable/no-dat */ for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/s390/mm/pgtable.c +++ linux-aws-6.5-6.5.0/arch/s390/mm/pgtable.c @@ -756,7 +756,7 @@ pte_clear(mm, addr, ptep); } if (reset) - pgste_val(pgste) &= ~_PGSTE_GPS_USAGE_MASK; + pgste_val(pgste) &= ~(_PGSTE_GPS_USAGE_MASK | _PGSTE_GPS_NODAT); pgste_set_unlock(ptep, pgste); preempt_enable(); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/s390/mm/vmem.c +++ linux-aws-6.5-6.5.0/arch/s390/mm/vmem.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -46,8 +47,11 @@ unsigned long *table; table = vmem_alloc_pages(CRST_ALLOC_ORDER); - if (table) - crst_table_init(table, val); + if (!table) + return NULL; + crst_table_init(table, val); + if (slab_is_available()) + arch_set_page_dat(virt_to_page(table), CRST_ALLOC_ORDER); return table; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/s390/pci/pci_dma.c +++ linux-aws-6.5-6.5.0/arch/s390/pci/pci_dma.c @@ -564,6 +564,17 @@ s->dma_length = 0; } } + +static unsigned long *bitmap_vzalloc(size_t bits, gfp_t flags) +{ + size_t n = BITS_TO_LONGS(bits); + size_t bytes; + + if (unlikely(check_mul_overflow(n, sizeof(unsigned long), &bytes))) + return NULL; + + return vzalloc(bytes); +} int zpci_dma_init_device(struct zpci_dev *zdev) { @@ -604,13 +615,13 @@ zdev->end_dma - zdev->start_dma + 1); zdev->end_dma = zdev->start_dma + zdev->iommu_size - 1; zdev->iommu_pages = zdev->iommu_size >> PAGE_SHIFT; - zdev->iommu_bitmap = vzalloc(zdev->iommu_pages / 8); + zdev->iommu_bitmap = bitmap_vzalloc(zdev->iommu_pages, GFP_KERNEL); if (!zdev->iommu_bitmap) { rc = -ENOMEM; goto free_dma_table; } if (!s390_iommu_strict) { - zdev->lazy_bitmap = vzalloc(zdev->iommu_pages / 8); + zdev->lazy_bitmap = bitmap_vzalloc(zdev->iommu_pages, GFP_KERNEL); if (!zdev->lazy_bitmap) { rc = -ENOMEM; goto free_bitmap; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/sh/Kconfig.debug +++ linux-aws-6.5-6.5.0/arch/sh/Kconfig.debug @@ -22,6 +22,17 @@ every function call and will therefore incur a major performance hit. Most users should say N. +config EARLY_PRINTK + bool "Early printk" + depends on SH_STANDARD_BIOS + help + Say Y here to redirect kernel printk messages to the serial port + used by the SH-IPL bootloader, starting very early in the boot + process and ending when the kernel's serial console is initialised. + This option is only useful while porting the kernel to a new machine, + when the kernel may crash or hang before the serial console is + initialised. If unsure, say N. + config 4KSTACKS bool "Use 4Kb for kernel stacks instead of 8Kb" depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/sparc/lib/checksum_32.S +++ linux-aws-6.5-6.5.0/arch/sparc/lib/checksum_32.S @@ -453,5 +453,5 @@ * we only bother with faults on loads... */ cc_fault: - ret + retl clr %o0 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/coco/tdx/tdcall.S +++ linux-aws-6.5-6.5.0/arch/x86/coco/tdx/tdcall.S @@ -195,6 +195,7 @@ xor %r10d, %r10d xor %r11d, %r11d xor %rdi, %rdi + xor %rsi, %rsi xor %rdx, %rdx /* Restore callee-saved GPRs as mandated by the x86_64 ABI */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/coco/tdx/tdx.c +++ linux-aws-6.5-6.5.0/arch/x86/coco/tdx/tdx.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/crypto/sha1_ssse3_glue.c +++ linux-aws-6.5-6.5.0/arch/x86/crypto/sha1_ssse3_glue.c @@ -24,8 +24,17 @@ #include #include #include +#include #include +static const struct x86_cpu_id module_cpu_ids[] = { + X86_MATCH_FEATURE(X86_FEATURE_AVX2, NULL), + X86_MATCH_FEATURE(X86_FEATURE_AVX, NULL), + X86_MATCH_FEATURE(X86_FEATURE_SSSE3, NULL), + {} +}; +MODULE_DEVICE_TABLE(x86cpu, module_cpu_ids); + static int sha1_update(struct shash_desc *desc, const u8 *data, unsigned int len, sha1_block_fn *sha1_xform) { @@ -301,6 +310,9 @@ static int __init sha1_ssse3_mod_init(void) { + if (!x86_match_cpu(module_cpu_ids)) + return -ENODEV; + if (register_sha1_ssse3()) goto fail; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/crypto/sha256_ssse3_glue.c +++ linux-aws-6.5-6.5.0/arch/x86/crypto/sha256_ssse3_glue.c @@ -38,11 +38,20 @@ #include #include #include +#include #include asmlinkage void sha256_transform_ssse3(struct sha256_state *state, const u8 *data, int blocks); +static const struct x86_cpu_id module_cpu_ids[] = { + X86_MATCH_FEATURE(X86_FEATURE_AVX2, NULL), + X86_MATCH_FEATURE(X86_FEATURE_AVX, NULL), + X86_MATCH_FEATURE(X86_FEATURE_SSSE3, NULL), + {} +}; +MODULE_DEVICE_TABLE(x86cpu, module_cpu_ids); + static int _sha256_update(struct shash_desc *desc, const u8 *data, unsigned int len, sha256_block_fn *sha256_xform) { @@ -366,6 +375,9 @@ static int __init sha256_ssse3_mod_init(void) { + if (!x86_match_cpu(module_cpu_ids)) + return -ENODEV; + if (register_sha256_ssse3()) goto fail; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/entry/common.c +++ linux-aws-6.5-6.5.0/arch/x86/entry/common.c @@ -25,6 +25,7 @@ #include #endif +#include #include #include #include @@ -96,6 +97,10 @@ return (int)regs->orig_ax; } +#ifdef CONFIG_IA32_EMULATION +bool __ia32_enabled __ro_after_init = true; +#endif + /* * Invoke a 32-bit syscall. Called with IRQs on in CONTEXT_KERNEL. */ @@ -115,7 +120,96 @@ } } -/* Handles int $0x80 */ +#ifdef CONFIG_IA32_EMULATION +static __always_inline bool int80_is_external(void) +{ + const unsigned int offs = (0x80 / 32) * 0x10; + const u32 bit = BIT(0x80 % 32); + + /* The local APIC on XENPV guests is fake */ + if (cpu_feature_enabled(X86_FEATURE_XENPV)) + return false; + + /* + * If vector 0x80 is set in the APIC ISR then this is an external + * interrupt. Either from broken hardware or injected by a VMM. + * + * Note: In guest mode this is only valid for secure guests where + * the secure module fully controls the vAPIC exposed to the guest. + */ + return apic_read(APIC_ISR + offs) & bit; +} + +/** + * int80_emulation - 32-bit legacy syscall entry + * + * This entry point can be used by 32-bit and 64-bit programs to perform + * 32-bit system calls. Instances of INT $0x80 can be found inline in + * various programs and libraries. It is also used by the vDSO's + * __kernel_vsyscall fallback for hardware that doesn't support a faster + * entry method. Restarted 32-bit system calls also fall back to INT + * $0x80 regardless of what instruction was originally used to do the + * system call. + * + * This is considered a slow path. It is not used by most libc + * implementations on modern hardware except during process startup. + * + * The arguments for the INT $0x80 based syscall are on stack in the + * pt_regs structure: + * eax: system call number + * ebx, ecx, edx, esi, edi, ebp: arg1 - arg 6 + */ +DEFINE_IDTENTRY_RAW(int80_emulation) +{ + int nr; + + /* Kernel does not use INT $0x80! */ + if (unlikely(!user_mode(regs))) { + irqentry_enter(regs); + instrumentation_begin(); + panic("Unexpected external interrupt 0x80\n"); + } + + /* + * Establish kernel context for instrumentation, including for + * int80_is_external() below which calls into the APIC driver. + * Identical for soft and external interrupts. + */ + enter_from_user_mode(regs); + + instrumentation_begin(); + add_random_kstack_offset(); + + /* Validate that this is a soft interrupt to the extent possible */ + if (unlikely(int80_is_external())) + panic("Unexpected external interrupt 0x80\n"); + + /* + * The low level idtentry code pushed -1 into regs::orig_ax + * and regs::ax contains the syscall number. + * + * User tracing code (ptrace or signal handlers) might assume + * that the regs::orig_ax contains a 32-bit number on invoking + * a 32-bit syscall. + * + * Establish the syscall convention by saving the 32bit truncated + * syscall number in regs::orig_ax and by invalidating regs::ax. + */ + regs->orig_ax = regs->ax & GENMASK(31, 0); + regs->ax = -ENOSYS; + + nr = syscall_32_enter(regs); + + local_irq_enable(); + nr = syscall_enter_from_user_mode_work(regs, nr); + do_syscall_32_irqs_on(regs, nr); + + instrumentation_end(); + syscall_exit_to_user_mode(regs); +} +#else /* CONFIG_IA32_EMULATION */ + +/* Handles int $0x80 on a 32bit kernel */ __visible noinstr void do_int80_syscall_32(struct pt_regs *regs) { int nr = syscall_32_enter(regs); @@ -134,6 +228,7 @@ instrumentation_end(); syscall_exit_to_user_mode(regs); } +#endif /* !CONFIG_IA32_EMULATION */ static noinstr bool __do_fast_syscall_32(struct pt_regs *regs) { @@ -294,7 +389,7 @@ inc_irq_stat(irq_hv_callback_count); - xen_hvm_evtchn_do_upcall(); + xen_evtchn_do_upcall(); set_irq_regs(old_regs); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/entry/entry_64_compat.S +++ linux-aws-6.5-6.5.0/arch/x86/entry/entry_64_compat.S @@ -276,80 +276,3 @@ ANNOTATE_NOENDBR int3 SYM_CODE_END(entry_SYSCALL_compat) - -/* - * 32-bit legacy system call entry. - * - * 32-bit x86 Linux system calls traditionally used the INT $0x80 - * instruction. INT $0x80 lands here. - * - * This entry point can be used by 32-bit and 64-bit programs to perform - * 32-bit system calls. Instances of INT $0x80 can be found inline in - * various programs and libraries. It is also used by the vDSO's - * __kernel_vsyscall fallback for hardware that doesn't support a faster - * entry method. Restarted 32-bit system calls also fall back to INT - * $0x80 regardless of what instruction was originally used to do the - * system call. - * - * This is considered a slow path. It is not used by most libc - * implementations on modern hardware except during process startup. - * - * Arguments: - * eax system call number - * ebx arg1 - * ecx arg2 - * edx arg3 - * esi arg4 - * edi arg5 - * ebp arg6 - */ -SYM_CODE_START(entry_INT80_compat) - UNWIND_HINT_ENTRY - ENDBR - /* - * Interrupts are off on entry. - */ - ASM_CLAC /* Do this early to minimize exposure */ - ALTERNATIVE "swapgs", "", X86_FEATURE_XENPV - - /* - * User tracing code (ptrace or signal handlers) might assume that - * the saved RAX contains a 32-bit number when we're invoking a 32-bit - * syscall. Just in case the high bits are nonzero, zero-extend - * the syscall number. (This could almost certainly be deleted - * with no ill effects.) - */ - movl %eax, %eax - - /* switch to thread stack expects orig_ax and rdi to be pushed */ - pushq %rax /* pt_regs->orig_ax */ - - /* Need to switch before accessing the thread stack. */ - SWITCH_TO_KERNEL_CR3 scratch_reg=%rax - - /* In the Xen PV case we already run on the thread stack. */ - ALTERNATIVE "", "jmp .Lint80_keep_stack", X86_FEATURE_XENPV - - movq %rsp, %rax - movq PER_CPU_VAR(pcpu_hot + X86_top_of_stack), %rsp - - pushq 5*8(%rax) /* regs->ss */ - pushq 4*8(%rax) /* regs->rsp */ - pushq 3*8(%rax) /* regs->eflags */ - pushq 2*8(%rax) /* regs->cs */ - pushq 1*8(%rax) /* regs->ip */ - pushq 0*8(%rax) /* regs->orig_ax */ -.Lint80_keep_stack: - - PUSH_AND_CLEAR_REGS rax=$-ENOSYS - UNWIND_HINT_REGS - - cld - - IBRS_ENTER - UNTRAIN_RET - - movq %rsp, %rdi - call do_int80_syscall_32 - jmp swapgs_restore_regs_and_return_to_usermode -SYM_CODE_END(entry_INT80_compat) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/fpu/api.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/fpu/api.h @@ -148,7 +148,8 @@ static inline void fpu_sync_guest_vmexit_xfd_state(void) { } #endif -extern void fpu_copy_guest_fpstate_to_uabi(struct fpu_guest *gfpu, void *buf, unsigned int size, u32 pkru); +extern void fpu_copy_guest_fpstate_to_uabi(struct fpu_guest *gfpu, void *buf, + unsigned int size, u64 xfeatures, u32 pkru); extern int fpu_copy_uabi_to_guest_fpstate(struct fpu_guest *gfpu, const void *buf, u64 xcr0, u32 *vpkru); static inline void fpstate_set_confidential(struct fpu_guest *gfpu) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/i8259.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/i8259.h @@ -69,6 +69,8 @@ void (*make_irq)(unsigned int irq); }; +void legacy_pic_pcat_compat(void); + extern struct legacy_pic *legacy_pic; extern struct legacy_pic null_legacy_pic; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/ia32.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/ia32.h @@ -68,6 +68,27 @@ #endif -#endif /* CONFIG_IA32_EMULATION */ +extern bool __ia32_enabled; + +static inline bool ia32_enabled(void) +{ + return __ia32_enabled; +} + +static inline void ia32_disable(void) +{ + __ia32_enabled = false; +} + +#else /* !CONFIG_IA32_EMULATION */ + +static inline bool ia32_enabled(void) +{ + return IS_ENABLED(CONFIG_X86_32); +} + +static inline void ia32_disable(void) {} + +#endif #endif /* _ASM_X86_IA32_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/idtentry.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/idtentry.h @@ -569,6 +569,10 @@ DECLARE_IDTENTRY_RAW(X86_TRAP_BP, exc_int3); DECLARE_IDTENTRY_RAW_ERRORCODE(X86_TRAP_PF, exc_page_fault); +#if defined(CONFIG_IA32_EMULATION) +DECLARE_IDTENTRY_RAW(IA32_SYSCALL_VECTOR, int80_emulation); +#endif + #ifdef CONFIG_X86_MCE #ifdef CONFIG_X86_64 DECLARE_IDTENTRY_MCE(X86_TRAP_MC, exc_machine_check); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/intel-family.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/intel-family.h @@ -27,6 +27,7 @@ * _X - regular server parts * _D - micro server parts * _N,_P - other mobile parts + * _H - premium mobile parts * _S - other client parts * * Historical OPTDIFFs: @@ -125,6 +126,7 @@ #define INTEL_FAM6_LUNARLAKE_M 0xBD +#define INTEL_FAM6_ARROWLAKE_H 0xC5 #define INTEL_FAM6_ARROWLAKE 0xC6 /* "Small Core" Processors (Atom/E-Core) */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/kvm-x86-ops.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/kvm-x86-ops.h @@ -108,6 +108,7 @@ KVM_X86_OP_OPTIONAL(vcpu_unblocking) KVM_X86_OP_OPTIONAL(pi_update_irte) KVM_X86_OP_OPTIONAL(pi_start_assignment) +KVM_X86_OP_OPTIONAL(apicv_pre_state_restore) KVM_X86_OP_OPTIONAL(apicv_post_state_restore) KVM_X86_OP_OPTIONAL_RET0(dy_apicv_has_pending_interrupt) KVM_X86_OP_OPTIONAL(set_hv_timer) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/nospec-branch.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/nospec-branch.h @@ -271,7 +271,7 @@ .Lskip_rsb_\@: .endm -#ifdef CONFIG_CPU_UNRET_ENTRY +#if defined(CONFIG_CPU_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO) #define CALL_UNTRAIN_RET "call entry_untrain_ret" #else #define CALL_UNTRAIN_RET "" @@ -312,7 +312,7 @@ .macro UNTRAIN_RET_FROM_CALL #if defined(CONFIG_CPU_UNRET_ENTRY) || defined(CONFIG_CPU_IBPB_ENTRY) || \ - defined(CONFIG_CALL_DEPTH_TRACKING) + defined(CONFIG_CALL_DEPTH_TRACKING) || defined(CONFIG_CPU_SRSO) VALIDATE_UNRET_END ALTERNATIVE_3 "", \ CALL_UNTRAIN_RET, X86_FEATURE_UNRET, \ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/numa.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/numa.h @@ -12,13 +12,6 @@ #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) -/* - * Too small node sizes may confuse the VM badly. Usually they - * result from BIOS bugs. So dont recognize nodes as standalone - * NUMA entities that have less than this amount of RAM listed: - */ -#define NODE_MIN_SIZE (4*1024*1024) - extern int numa_off; /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/proto.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/proto.h @@ -32,10 +32,6 @@ void entry_SYSCALL_compat_safe_stack(void); void entry_SYSRETL_compat_unsafe_stack(void); void entry_SYSRETL_compat_end(void); -void entry_INT80_compat(void); -#ifdef CONFIG_XEN_PV -void xen_entry_INT80_compat(void); -#endif #endif void x86_configure_nx(void); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/sparsemem.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/sparsemem.h @@ -37,6 +37,8 @@ #define phys_to_target_node phys_to_target_node extern int memory_add_physaddr_to_nid(u64 start); #define memory_add_physaddr_to_nid memory_add_physaddr_to_nid +extern int numa_fill_memblks(u64 start, u64 end); +#define numa_fill_memblks numa_fill_memblks #endif #endif /* __ASSEMBLY__ */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/svm.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/svm.h @@ -268,6 +268,7 @@ AVIC_IPI_FAILURE_TARGET_NOT_RUNNING, AVIC_IPI_FAILURE_INVALID_TARGET, AVIC_IPI_FAILURE_INVALID_BACKING_PAGE, + AVIC_IPI_FAILURE_INVALID_IPI_VECTOR, }; #define AVIC_PHYSICAL_MAX_INDEX_MASK GENMASK_ULL(8, 0) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/include/asm/uaccess.h +++ linux-aws-6.5-6.5.0/arch/x86/include/asm/uaccess.h @@ -496,7 +496,7 @@ #define copy_mc_to_kernel copy_mc_to_kernel unsigned long __must_check -copy_mc_to_user(void *to, const void *from, unsigned len); +copy_mc_to_user(void __user *to, const void *from, unsigned len); #endif /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/acpi/boot.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/acpi/boot.c @@ -148,6 +148,9 @@ pr_debug("Local APIC address 0x%08x\n", madt->address); } + if (madt->flags & ACPI_MADT_PCAT_COMPAT) + legacy_pic_pcat_compat(); + /* ACPI 6.3 and newer support the online capable bit. */ if (acpi_gbl_FADT.header.revision > 6 || (acpi_gbl_FADT.header.revision == 6 && only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/apic/apic.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/apic/apic.c @@ -36,6 +36,8 @@ #include #include +#include + #include #include #include @@ -2408,6 +2410,15 @@ { unsigned int cpu; + /* + * XEN/PV provides either none or useless topology information. + * Pretend that all vCPUs are primary threads. + */ + if (xen_pv_domain()) { + cpumask_copy(&__cpu_primary_thread_mask, cpu_possible_mask); + return 0; + } + for (cpu = 0; cpu < nr_logical_cpuids; cpu++) cpu_mark_primary_thread(cpu, cpuid_to_apicid[cpu]); return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/apic/msi.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/apic/msi.c @@ -55,14 +55,14 @@ * caused by the non-atomic update of the address/data pair. * * Direct update is possible when: - * - The MSI is maskable (remapped MSI does not use this code path)). - * The quirk bit is not set in this case. + * - The MSI is maskable (remapped MSI does not use this code path). + * The reservation mode bit is set in this case. * - The new vector is the same as the old vector * - The old vector is MANAGED_IRQ_SHUTDOWN_VECTOR (interrupt starts up) * - The interrupt is not yet started up * - The new destination CPU is the same as the old destination CPU */ - if (!irqd_msi_nomask_quirk(irqd) || + if (!irqd_can_reserve(irqd) || cfg->vector == old_cfg.vector || old_cfg.vector == MANAGED_IRQ_SHUTDOWN_VECTOR || !irqd_is_started(irqd) || @@ -215,8 +215,6 @@ if (WARN_ON_ONCE(domain != real_parent)) return false; info->chip->irq_set_affinity = msi_set_affinity; - /* See msi_set_affinity() for the gory details */ - info->flags |= MSI_FLAG_NOMASK_QUIRK; break; case DOMAIN_BUS_DMAR: case DOMAIN_BUS_AMDVI: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/cpu/hygon.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/cpu/hygon.c @@ -86,8 +86,12 @@ if (!err) c->x86_coreid_bits = get_count_order(c->x86_max_cores); - /* Socket ID is ApicId[6] for these processors. */ - c->phys_proc_id = c->apicid >> APICID_SOCKET_ID_BIT; + /* + * Socket ID is ApicId[6] for the processors with model <= 0x3 + * when running on host. + */ + if (!boot_cpu_has(X86_FEATURE_HYPERVISOR) && c->x86_model <= 0x3) + c->phys_proc_id = c->apicid >> APICID_SOCKET_ID_BIT; cacheinfo_hygon_init_llc_id(c, cpu); } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/fpu/core.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/fpu/core.c @@ -369,14 +369,15 @@ EXPORT_SYMBOL_GPL(fpu_swap_kvm_fpstate); void fpu_copy_guest_fpstate_to_uabi(struct fpu_guest *gfpu, void *buf, - unsigned int size, u32 pkru) + unsigned int size, u64 xfeatures, u32 pkru) { struct fpstate *kstate = gfpu->fpstate; union fpregs_state *ustate = buf; struct membuf mb = { .p = buf, .left = size }; if (cpu_feature_enabled(X86_FEATURE_XSAVE)) { - __copy_xstate_to_uabi_buf(mb, kstate, pkru, XSTATE_COPY_XSAVE); + __copy_xstate_to_uabi_buf(mb, kstate, xfeatures, pkru, + XSTATE_COPY_XSAVE); } else { memcpy(&ustate->fxsave, &kstate->regs.fxsave, sizeof(ustate->fxsave)); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/fpu/xstate.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/fpu/xstate.c @@ -1053,6 +1053,7 @@ * __copy_xstate_to_uabi_buf - Copy kernel saved xstate to a UABI buffer * @to: membuf descriptor * @fpstate: The fpstate buffer from which to copy + * @xfeatures: The mask of xfeatures to save (XSAVE mode only) * @pkru_val: The PKRU value to store in the PKRU component * @copy_mode: The requested copy mode * @@ -1063,7 +1064,8 @@ * It supports partial copy but @to.pos always starts from zero. */ void __copy_xstate_to_uabi_buf(struct membuf to, struct fpstate *fpstate, - u32 pkru_val, enum xstate_copy_mode copy_mode) + u64 xfeatures, u32 pkru_val, + enum xstate_copy_mode copy_mode) { const unsigned int off_mxcsr = offsetof(struct fxregs_state, mxcsr); struct xregs_state *xinit = &init_fpstate.regs.xsave; @@ -1087,7 +1089,7 @@ break; case XSTATE_COPY_XSAVE: - header.xfeatures &= fpstate->user_xfeatures; + header.xfeatures &= fpstate->user_xfeatures & xfeatures; break; } @@ -1189,6 +1191,7 @@ enum xstate_copy_mode copy_mode) { __copy_xstate_to_uabi_buf(to, tsk->thread.fpu.fpstate, + tsk->thread.fpu.fpstate->user_xfeatures, tsk->thread.pkru, copy_mode); } @@ -1540,10 +1543,7 @@ fpregs_restore_userregs(); newfps->xfeatures = curfps->xfeatures | xfeatures; - - if (!guest_fpu) - newfps->user_xfeatures = curfps->user_xfeatures | xfeatures; - + newfps->user_xfeatures = curfps->user_xfeatures | xfeatures; newfps->xfd = curfps->xfd & ~xfeatures; /* Do the final updates within the locked region */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/fpu/xstate.h +++ linux-aws-6.5-6.5.0/arch/x86/kernel/fpu/xstate.h @@ -43,7 +43,8 @@ struct membuf; extern void __copy_xstate_to_uabi_buf(struct membuf to, struct fpstate *fpstate, - u32 pkru_val, enum xstate_copy_mode copy_mode); + u64 xfeatures, u32 pkru_val, + enum xstate_copy_mode copy_mode); extern void copy_xstate_to_uabi_buf(struct membuf to, struct task_struct *tsk, enum xstate_copy_mode mode); extern int copy_uabi_from_kernel_to_xstate(struct fpstate *fpstate, const void *kbuf, u32 *pkru); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/head64.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/head64.c @@ -80,7 +80,7 @@ * while the kernel still uses a direct mapping. */ static struct desc_ptr startup_gdt_descr = { - .size = sizeof(startup_gdt), + .size = sizeof(startup_gdt)-1, .address = 0, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/i8259.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/i8259.c @@ -32,6 +32,7 @@ */ static void init_8259A(int auto_eoi); +static bool pcat_compat __ro_after_init; static int i8259A_auto_eoi; DEFINE_RAW_SPINLOCK(i8259A_lock); @@ -301,15 +302,32 @@ static int probe_8259A(void) { + unsigned char new_val, probe_val = ~(1 << PIC_CASCADE_IR); unsigned long flags; - unsigned char probe_val = ~(1 << PIC_CASCADE_IR); - unsigned char new_val; + + /* + * If MADT has the PCAT_COMPAT flag set, then do not bother probing + * for the PIC. Some BIOSes leave the PIC uninitialized and probing + * fails. + * + * Right now this causes problems as quite some code depends on + * nr_legacy_irqs() > 0 or has_legacy_pic() == true. This is silly + * when the system has an IO/APIC because then PIC is not required + * at all, except for really old machines where the timer interrupt + * must be routed through the PIC. So just pretend that the PIC is + * there and let legacy_pic->init() initialize it for nothing. + * + * Alternatively this could just try to initialize the PIC and + * repeat the probe, but for cases where there is no PIC that's + * just pointless. + */ + if (pcat_compat) + return nr_legacy_irqs(); + /* - * Check to see if we have a PIC. - * Mask all except the cascade and read - * back the value we just wrote. If we don't - * have a PIC, we will read 0xff as opposed to the - * value we wrote. + * Check to see if we have a PIC. Mask all except the cascade and + * read back the value we just wrote. If we don't have a PIC, we + * will read 0xff as opposed to the value we wrote. */ raw_spin_lock_irqsave(&i8259A_lock, flags); @@ -431,5 +449,9 @@ return 0; } - device_initcall(i8259A_init_ops); + +void __init legacy_pic_pcat_compat(void) +{ + pcat_compat = true; +} only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/idt.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/idt.c @@ -117,7 +117,7 @@ SYSG(X86_TRAP_OF, asm_exc_overflow), #if defined(CONFIG_IA32_EMULATION) - SYSG(IA32_SYSCALL_VECTOR, entry_INT80_compat), + SYSG(IA32_SYSCALL_VECTOR, asm_int80_emulation), #elif defined(CONFIG_X86_32) SYSG(IA32_SYSCALL_VECTOR, entry_INT80_32), #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/nmi.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/nmi.c @@ -507,12 +507,13 @@ } this_cpu_write(nmi_state, NMI_EXECUTING); this_cpu_write(nmi_cr2, read_cr2()); + +nmi_restart: if (IS_ENABLED(CONFIG_NMI_CHECK_CPU)) { WRITE_ONCE(nsp->idt_seq, nsp->idt_seq + 1); WARN_ON_ONCE(!(nsp->idt_seq & 0x1)); WRITE_ONCE(nsp->recv_jiffies, jiffies); } -nmi_restart: /* * Needs to happen before DR7 is accessed, because the hypervisor can @@ -548,16 +549,16 @@ if (unlikely(this_cpu_read(nmi_cr2) != read_cr2())) write_cr2(this_cpu_read(nmi_cr2)); - if (this_cpu_dec_return(nmi_state)) - goto nmi_restart; - - if (user_mode(regs)) - mds_user_clear_cpu_buffers(); if (IS_ENABLED(CONFIG_NMI_CHECK_CPU)) { WRITE_ONCE(nsp->idt_seq, nsp->idt_seq + 1); WARN_ON_ONCE(nsp->idt_seq & 0x1); WRITE_ONCE(nsp->recv_jiffies, jiffies); } + if (this_cpu_dec_return(nmi_state)) + goto nmi_restart; + + if (user_mode(regs)) + mds_user_clear_cpu_buffers(); } #if IS_ENABLED(CONFIG_KVM_INTEL) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kernel/tsc_sync.c +++ linux-aws-6.5-6.5.0/arch/x86/kernel/tsc_sync.c @@ -15,6 +15,7 @@ * ( The serial nature of the boot logic and the CPU hotplug lock * protects against more than 2 CPUs entering this code. ) */ +#include #include #include #include @@ -342,6 +343,13 @@ return (cpumask_weight(topology_core_cpumask(cpu)) > 1) ? 2 : 20; } +static void tsc_sync_mark_tsc_unstable(struct work_struct *work) +{ + mark_tsc_unstable("check_tsc_sync_source failed"); +} + +static DECLARE_WORK(tsc_sync_work, tsc_sync_mark_tsc_unstable); + /* * The freshly booted CPU initiates this via an async SMP function call. */ @@ -395,7 +403,7 @@ "turning off TSC clock.\n", max_warp); if (random_warps) pr_warn("TSC warped randomly between CPUs\n"); - mark_tsc_unstable("check_tsc_sync_source failed"); + schedule_work(&tsc_sync_work); } /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kvm/cpuid.c +++ linux-aws-6.5-6.5.0/arch/x86/kvm/cpuid.c @@ -326,14 +326,6 @@ vcpu->arch.guest_supported_xcr0 = cpuid_get_supported_xcr0(vcpu->arch.cpuid_entries, vcpu->arch.cpuid_nent); - /* - * FP+SSE can always be saved/restored via KVM_{G,S}ET_XSAVE, even if - * XSAVE/XCRO are not exposed to the guest, and even if XSAVE isn't - * supported by the host. - */ - vcpu->arch.guest_fpu.fpstate->user_xfeatures = vcpu->arch.guest_supported_xcr0 | - XFEATURE_MASK_FPSSE; - kvm_update_pv_runtime(vcpu); vcpu->arch.maxphyaddr = cpuid_query_maxphyaddr(vcpu); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kvm/hyperv.c +++ linux-aws-6.5-6.5.0/arch/x86/kvm/hyperv.c @@ -727,10 +727,12 @@ stimer_cleanup(stimer); stimer->count = count; - if (stimer->count == 0) - stimer->config.enable = 0; - else if (stimer->config.auto_enable) - stimer->config.enable = 1; + if (!host) { + if (stimer->count == 0) + stimer->config.enable = 0; + else if (stimer->config.auto_enable) + stimer->config.enable = 1; + } if (stimer->config.enable) stimer_mark_pending(stimer, false); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kvm/lapic.c +++ linux-aws-6.5-6.5.0/arch/x86/kvm/lapic.c @@ -2423,22 +2423,22 @@ void kvm_apic_write_nodecode(struct kvm_vcpu *vcpu, u32 offset) { struct kvm_lapic *apic = vcpu->arch.apic; - u64 val; /* - * ICR is a single 64-bit register when x2APIC is enabled. For legacy - * xAPIC, ICR writes need to go down the common (slightly slower) path - * to get the upper half from ICR2. + * ICR is a single 64-bit register when x2APIC is enabled, all others + * registers hold 32-bit values. For legacy xAPIC, ICR writes need to + * go down the common path to get the upper half from ICR2. + * + * Note, using the write helpers may incur an unnecessary write to the + * virtual APIC state, but KVM needs to conditionally modify the value + * in certain cases, e.g. to clear the ICR busy bit. The cost of extra + * conditional branches is likely a wash relative to the cost of the + * maybe-unecessary write, and both are in the noise anyways. */ - if (apic_x2apic_mode(apic) && offset == APIC_ICR) { - val = kvm_lapic_get_reg64(apic, APIC_ICR); - kvm_apic_send_ipi(apic, (u32)val, (u32)(val >> 32)); - trace_kvm_apic_write(APIC_ICR, val); - } else { - /* TODO: optimize to just emulate side effect w/o one more write */ - val = kvm_lapic_get_reg(apic, offset); - kvm_lapic_reg_write(apic, offset, (u32)val); - } + if (apic_x2apic_mode(apic) && offset == APIC_ICR) + kvm_x2apic_icr_write(apic, kvm_lapic_get_reg64(apic, APIC_ICR)); + else + kvm_lapic_reg_write(apic, offset, kvm_lapic_get_reg(apic, offset)); } EXPORT_SYMBOL_GPL(kvm_apic_write_nodecode); @@ -2649,6 +2649,8 @@ u64 msr_val; int i; + static_call_cond(kvm_x86_apicv_pre_state_restore)(vcpu); + if (!init_event) { msr_val = APIC_DEFAULT_PHYS_BASE | MSR_IA32_APICBASE_ENABLE; if (kvm_vcpu_is_reset_bsp(vcpu)) @@ -2738,13 +2740,17 @@ { u32 reg = kvm_lapic_get_reg(apic, lvt_type); int vector, mode, trig_mode; + int r; if (kvm_apic_hw_enabled(apic) && !(reg & APIC_LVT_MASKED)) { vector = reg & APIC_VECTOR_MASK; mode = reg & APIC_MODE_MASK; trig_mode = reg & APIC_LVT_LEVEL_TRIGGER; - return __apic_accept_irq(apic, mode, vector, 1, trig_mode, - NULL); + + r = __apic_accept_irq(apic, mode, vector, 1, trig_mode, NULL); + if (r && lvt_type == APIC_LVTPC) + kvm_lapic_set_reg(apic, APIC_LVTPC, reg | APIC_LVT_MASKED); + return r; } return 0; } @@ -2956,6 +2962,8 @@ struct kvm_lapic *apic = vcpu->arch.apic; int r; + static_call_cond(kvm_x86_apicv_pre_state_restore)(vcpu); + kvm_lapic_set_base(vcpu, vcpu->arch.apic_base); /* set SPIV separately to get count of SW disabled APICs right */ apic_set_spiv(apic, *((u32 *)(s->regs + APIC_SPIV))); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kvm/pmu.h +++ linux-aws-6.5-6.5.0/arch/x86/kvm/pmu.h @@ -74,6 +74,12 @@ return counter & pmc_bitmask(pmc); } +static inline void pmc_write_counter(struct kvm_pmc *pmc, u64 val) +{ + pmc->counter += val - pmc_read_counter(pmc); + pmc->counter &= pmc_bitmask(pmc); +} + static inline void pmc_release_perf_event(struct kvm_pmc *pmc) { if (pmc->perf_event) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kvm/svm/pmu.c +++ linux-aws-6.5-6.5.0/arch/x86/kvm/svm/pmu.c @@ -160,7 +160,7 @@ /* MSR_PERFCTRn */ pmc = get_gp_pmc_amd(pmu, msr, PMU_TYPE_COUNTER); if (pmc) { - pmc->counter += data - pmc_read_counter(pmc); + pmc_write_counter(pmc, data); pmc_update_sample_period(pmc); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/kvm/vmx/pmu_intel.c +++ linux-aws-6.5-6.5.0/arch/x86/kvm/vmx/pmu_intel.c @@ -406,11 +406,11 @@ if (!msr_info->host_initiated && !(msr & MSR_PMC_FULL_WIDTH_BIT)) data = (s64)(s32)data; - pmc->counter += data - pmc_read_counter(pmc); + pmc_write_counter(pmc, data); pmc_update_sample_period(pmc); break; } else if ((pmc = get_fixed_pmc(pmu, msr))) { - pmc->counter += data - pmc_read_counter(pmc); + pmc_write_counter(pmc, data); pmc_update_sample_period(pmc); break; } else if ((pmc = get_gp_pmc(pmu, msr, MSR_P6_EVNTSEL0))) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/lib/copy_mc.c +++ linux-aws-6.5-6.5.0/arch/x86/lib/copy_mc.c @@ -70,23 +70,23 @@ } EXPORT_SYMBOL_GPL(copy_mc_to_kernel); -unsigned long __must_check copy_mc_to_user(void *dst, const void *src, unsigned len) +unsigned long __must_check copy_mc_to_user(void __user *dst, const void *src, unsigned len) { unsigned long ret; if (copy_mc_fragile_enabled) { __uaccess_begin(); - ret = copy_mc_fragile(dst, src, len); + ret = copy_mc_fragile((__force void *)dst, src, len); __uaccess_end(); return ret; } if (static_cpu_has(X86_FEATURE_ERMS)) { __uaccess_begin(); - ret = copy_mc_enhanced_fast_string(dst, src, len); + ret = copy_mc_enhanced_fast_string((__force void *)dst, src, len); __uaccess_end(); return ret; } - return copy_user_generic(dst, src, len); + return copy_user_generic((__force void *)dst, src, len); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/mm/numa.c +++ linux-aws-6.5-6.5.0/arch/x86/mm/numa.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -601,13 +602,6 @@ if (start >= end) continue; - /* - * Don't confuse VM with a node that doesn't have the - * minimum amount of memory: - */ - if (end && (end - start) < NODE_MIN_SIZE) - continue; - alloc_node_data(nid); } @@ -961,4 +955,83 @@ return nid; } EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); + +static int __init cmp_memblk(const void *a, const void *b) +{ + const struct numa_memblk *ma = *(const struct numa_memblk **)a; + const struct numa_memblk *mb = *(const struct numa_memblk **)b; + + return ma->start - mb->start; +} + +static struct numa_memblk *numa_memblk_list[NR_NODE_MEMBLKS] __initdata; + +/** + * numa_fill_memblks - Fill gaps in numa_meminfo memblks + * @start: address to begin fill + * @end: address to end fill + * + * Find and extend numa_meminfo memblks to cover the @start-@end + * physical address range, such that the first memblk includes + * @start, the last memblk includes @end, and any gaps in between + * are filled. + * + * RETURNS: + * 0 : Success + * NUMA_NO_MEMBLK : No memblk exists in @start-@end range + */ + +int __init numa_fill_memblks(u64 start, u64 end) +{ + struct numa_memblk **blk = &numa_memblk_list[0]; + struct numa_meminfo *mi = &numa_meminfo; + int count = 0; + u64 prev_end; + + /* + * Create a list of pointers to numa_meminfo memblks that + * overlap start, end. Exclude (start == bi->end) since + * end addresses in both a CFMWS range and a memblk range + * are exclusive. + * + * This list of pointers is used to make in-place changes + * that fill out the numa_meminfo memblks. + */ + for (int i = 0; i < mi->nr_blks; i++) { + struct numa_memblk *bi = &mi->blk[i]; + + if (start < bi->end && end >= bi->start) { + blk[count] = &mi->blk[i]; + count++; + } + } + if (!count) + return NUMA_NO_MEMBLK; + + /* Sort the list of pointers in memblk->start order */ + sort(&blk[0], count, sizeof(blk[0]), cmp_memblk, NULL); + + /* Make sure the first/last memblks include start/end */ + blk[0]->start = min(blk[0]->start, start); + blk[count - 1]->end = max(blk[count - 1]->end, end); + + /* + * Fill any gaps by tracking the previous memblks + * end address and backfilling to it if needed. + */ + prev_end = blk[0]->end; + for (int i = 1; i < count; i++) { + struct numa_memblk *curr = blk[i]; + + if (prev_end >= curr->start) { + if (prev_end < curr->end) + prev_end = curr->end; + } else { + curr->start = prev_end; + prev_end = curr->end; + } + } + return 0; +} + #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/net/bpf_jit_comp.c +++ linux-aws-6.5-6.5.0/arch/x86/net/bpf_jit_comp.c @@ -963,6 +963,10 @@ #define INSN_SZ_DIFF (((addrs[i] - addrs[i - 1]) - (prog - temp))) +/* mov rax, qword ptr [rbp - rounded_stack_depth - 8] */ +#define RESTORE_TAIL_CALL_CNT(stack) \ + EMIT3_off32(0x48, 0x8B, 0x85, -round_up(stack, 8) - 8) + static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, u8 *rw_image, int oldproglen, struct jit_context *ctx, bool jmp_padding) { @@ -1538,9 +1542,7 @@ func = (u8 *) __bpf_call_base + imm32; if (tail_call_reachable) { - /* mov rax, qword ptr [rbp - rounded_stack_depth - 8] */ - EMIT3_off32(0x48, 0x8B, 0x85, - -round_up(bpf_prog->aux->stack_depth, 8) - 8); + RESTORE_TAIL_CALL_CNT(bpf_prog->aux->stack_depth); if (!imm32) return -EINVAL; offs = 7 + x86_call_depth_emit_accounting(&prog, func); @@ -1857,59 +1859,177 @@ return proglen; } -static void save_regs(const struct btf_func_model *m, u8 **prog, int nr_regs, - int stack_size) +static void clean_stack_garbage(const struct btf_func_model *m, + u8 **pprog, int nr_stack_slots, + int stack_size) { - int i, j, arg_size; - bool next_same_struct = false; + int arg_size, off; + u8 *prog; + + /* Generally speaking, the compiler will pass the arguments + * on-stack with "push" instruction, which will take 8-byte + * on the stack. In this case, there won't be garbage values + * while we copy the arguments from origin stack frame to current + * in BPF_DW. + * + * However, sometimes the compiler will only allocate 4-byte on + * the stack for the arguments. For now, this case will only + * happen if there is only one argument on-stack and its size + * not more than 4 byte. In this case, there will be garbage + * values on the upper 4-byte where we store the argument on + * current stack frame. + * + * arguments on origin stack: + * + * stack_arg_1(4-byte) xxx(4-byte) + * + * what we copy: + * + * stack_arg_1(8-byte): stack_arg_1(origin) xxx + * + * and the xxx is the garbage values which we should clean here. + */ + if (nr_stack_slots != 1) + return; + + /* the size of the last argument */ + arg_size = m->arg_size[m->nr_args - 1]; + if (arg_size <= 4) { + off = -(stack_size - 4); + prog = *pprog; + /* mov DWORD PTR [rbp + off], 0 */ + if (!is_imm8(off)) + EMIT2_off32(0xC7, 0x85, off); + else + EMIT3(0xC7, 0x45, off); + EMIT(0, 4); + *pprog = prog; + } +} + +/* get the count of the regs that are used to pass arguments */ +static int get_nr_used_regs(const struct btf_func_model *m) +{ + int i, arg_regs, nr_used_regs = 0; + + for (i = 0; i < min_t(int, m->nr_args, MAX_BPF_FUNC_ARGS); i++) { + arg_regs = (m->arg_size[i] + 7) / 8; + if (nr_used_regs + arg_regs <= 6) + nr_used_regs += arg_regs; + + if (nr_used_regs >= 6) + break; + } + + return nr_used_regs; +} + +static void save_args(const struct btf_func_model *m, u8 **prog, + int stack_size, bool for_call_origin) +{ + int arg_regs, first_off = 0, nr_regs = 0, nr_stack_slots = 0; + int i, j; /* Store function arguments to stack. * For a function that accepts two pointers the sequence will be: * mov QWORD PTR [rbp-0x10],rdi * mov QWORD PTR [rbp-0x8],rsi */ - for (i = 0, j = 0; i < min(nr_regs, 6); i++) { - /* The arg_size is at most 16 bytes, enforced by the verifier. */ - arg_size = m->arg_size[j]; - if (arg_size > 8) { - arg_size = 8; - next_same_struct = !next_same_struct; - } + for (i = 0; i < min_t(int, m->nr_args, MAX_BPF_FUNC_ARGS); i++) { + arg_regs = (m->arg_size[i] + 7) / 8; - emit_stx(prog, bytes_to_bpf_size(arg_size), - BPF_REG_FP, - i == 5 ? X86_REG_R9 : BPF_REG_1 + i, - -(stack_size - i * 8)); + /* According to the research of Yonghong, struct members + * should be all in register or all on the stack. + * Meanwhile, the compiler will pass the argument on regs + * if the remaining regs can hold the argument. + * + * Disorder of the args can happen. For example: + * + * struct foo_struct { + * long a; + * int b; + * }; + * int foo(char, char, char, char, char, struct foo_struct, + * char); + * + * the arg1-5,arg7 will be passed by regs, and arg6 will + * by stack. + */ + if (nr_regs + arg_regs > 6) { + /* copy function arguments from origin stack frame + * into current stack frame. + * + * The starting address of the arguments on-stack + * is: + * rbp + 8(push rbp) + + * 8(return addr of origin call) + + * 8(return addr of the caller) + * which means: rbp + 24 + */ + for (j = 0; j < arg_regs; j++) { + emit_ldx(prog, BPF_DW, BPF_REG_0, BPF_REG_FP, + nr_stack_slots * 8 + 0x18); + emit_stx(prog, BPF_DW, BPF_REG_FP, BPF_REG_0, + -stack_size); + + if (!nr_stack_slots) + first_off = stack_size; + stack_size -= 8; + nr_stack_slots++; + } + } else { + /* Only copy the arguments on-stack to current + * 'stack_size' and ignore the regs, used to + * prepare the arguments on-stack for orign call. + */ + if (for_call_origin) { + nr_regs += arg_regs; + continue; + } - j = next_same_struct ? j : j + 1; + /* copy the arguments from regs into stack */ + for (j = 0; j < arg_regs; j++) { + emit_stx(prog, BPF_DW, BPF_REG_FP, + nr_regs == 5 ? X86_REG_R9 : BPF_REG_1 + nr_regs, + -stack_size); + stack_size -= 8; + nr_regs++; + } + } } + + clean_stack_garbage(m, prog, nr_stack_slots, first_off); } -static void restore_regs(const struct btf_func_model *m, u8 **prog, int nr_regs, +static void restore_regs(const struct btf_func_model *m, u8 **prog, int stack_size) { - int i, j, arg_size; - bool next_same_struct = false; + int i, j, arg_regs, nr_regs = 0; /* Restore function arguments from stack. * For a function that accepts two pointers the sequence will be: * EMIT4(0x48, 0x8B, 0x7D, 0xF0); mov rdi,QWORD PTR [rbp-0x10] * EMIT4(0x48, 0x8B, 0x75, 0xF8); mov rsi,QWORD PTR [rbp-0x8] + * + * The logic here is similar to what we do in save_args() */ - for (i = 0, j = 0; i < min(nr_regs, 6); i++) { - /* The arg_size is at most 16 bytes, enforced by the verifier. */ - arg_size = m->arg_size[j]; - if (arg_size > 8) { - arg_size = 8; - next_same_struct = !next_same_struct; + for (i = 0; i < min_t(int, m->nr_args, MAX_BPF_FUNC_ARGS); i++) { + arg_regs = (m->arg_size[i] + 7) / 8; + if (nr_regs + arg_regs <= 6) { + for (j = 0; j < arg_regs; j++) { + emit_ldx(prog, BPF_DW, + nr_regs == 5 ? X86_REG_R9 : BPF_REG_1 + nr_regs, + BPF_REG_FP, + -stack_size); + stack_size -= 8; + nr_regs++; + } + } else { + stack_size -= 8 * arg_regs; } - emit_ldx(prog, bytes_to_bpf_size(arg_size), - i == 5 ? X86_REG_R9 : BPF_REG_1 + i, - BPF_REG_FP, - -(stack_size - i * 8)); - - j = next_same_struct ? j : j + 1; + if (nr_regs >= 6) + break; } } @@ -1938,7 +2058,10 @@ /* arg1: mov rdi, progs[i] */ emit_mov_imm64(&prog, BPF_REG_1, (long) p >> 32, (u32) (long) p); /* arg2: lea rsi, [rbp - ctx_cookie_off] */ - EMIT4(0x48, 0x8D, 0x75, -run_ctx_off); + if (!is_imm8(-run_ctx_off)) + EMIT3_off32(0x48, 0x8D, 0xB5, -run_ctx_off); + else + EMIT4(0x48, 0x8D, 0x75, -run_ctx_off); if (emit_rsb_call(&prog, bpf_trampoline_enter(p), prog)) return -EINVAL; @@ -1954,7 +2077,10 @@ emit_nops(&prog, 2); /* arg1: lea rdi, [rbp - stack_size] */ - EMIT4(0x48, 0x8D, 0x7D, -stack_size); + if (!is_imm8(-stack_size)) + EMIT3_off32(0x48, 0x8D, 0xBD, -stack_size); + else + EMIT4(0x48, 0x8D, 0x7D, -stack_size); /* arg2: progs[i]->insnsi for interpreter */ if (!p->jited) emit_mov_imm64(&prog, BPF_REG_2, @@ -1984,7 +2110,10 @@ /* arg2: mov rsi, rbx <- start time in nsec */ emit_mov_reg(&prog, true, BPF_REG_2, BPF_REG_6); /* arg3: lea rdx, [rbp - run_ctx_off] */ - EMIT4(0x48, 0x8D, 0x55, -run_ctx_off); + if (!is_imm8(-run_ctx_off)) + EMIT3_off32(0x48, 0x8D, 0x95, -run_ctx_off); + else + EMIT4(0x48, 0x8D, 0x55, -run_ctx_off); if (emit_rsb_call(&prog, bpf_trampoline_exit(p), prog)) return -EINVAL; @@ -2136,7 +2265,7 @@ void *func_addr) { int i, ret, nr_regs = m->nr_args, stack_size = 0; - int regs_off, nregs_off, ip_off, run_ctx_off; + int regs_off, nregs_off, ip_off, run_ctx_off, arg_stack_off, rbx_off; struct bpf_tramp_links *fentry = &tlinks[BPF_TRAMP_FENTRY]; struct bpf_tramp_links *fexit = &tlinks[BPF_TRAMP_FEXIT]; struct bpf_tramp_links *fmod_ret = &tlinks[BPF_TRAMP_MODIFY_RETURN]; @@ -2150,8 +2279,10 @@ if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG) nr_regs += (m->arg_size[i] + 7) / 8 - 1; - /* x86-64 supports up to 6 arguments. 7+ can be added in the future */ - if (nr_regs > 6) + /* x86-64 supports up to MAX_BPF_FUNC_ARGS arguments. 1-6 + * are passed through regs, the remains are through stack. + */ + if (nr_regs > MAX_BPF_FUNC_ARGS) return -ENOTSUPP; /* Generated trampoline stack layout: @@ -2170,7 +2301,15 @@ * * RBP - ip_off [ traced function ] BPF_TRAMP_F_IP_ARG flag * + * RBP - rbx_off [ rbx value ] always + * * RBP - run_ctx_off [ bpf_tramp_run_ctx ] + * + * [ stack_argN ] BPF_TRAMP_F_CALL_ORIG + * [ ... ] + * [ stack_arg2 ] + * RBP - arg_stack_off [ stack_arg1 ] + * RSP [ tail_call_cnt ] BPF_TRAMP_F_TAIL_CALL_CTX */ /* room for return value of orig_call or fentry prog */ @@ -2190,9 +2329,26 @@ ip_off = stack_size; + stack_size += 8; + rbx_off = stack_size; + stack_size += (sizeof(struct bpf_tramp_run_ctx) + 7) & ~0x7; run_ctx_off = stack_size; + if (nr_regs > 6 && (flags & BPF_TRAMP_F_CALL_ORIG)) { + /* the space that used to pass arguments on-stack */ + stack_size += (nr_regs - get_nr_used_regs(m)) * 8; + /* make sure the stack pointer is 16-byte aligned if we + * need pass arguments on stack, which means + * [stack_size + 8(rbp) + 8(rip) + 8(origin rip)] + * should be 16-byte aligned. Following code depend on + * that stack_size is already 8-byte aligned. + */ + stack_size += (stack_size % 16) ? 0 : 8; + } + + arg_stack_off = stack_size; + if (flags & BPF_TRAMP_F_SKIP_FRAME) { /* skip patched call instruction and point orig_call to actual * body of the kernel function. @@ -2212,8 +2368,16 @@ x86_call_depth_emit_accounting(&prog, NULL); EMIT1(0x55); /* push rbp */ EMIT3(0x48, 0x89, 0xE5); /* mov rbp, rsp */ - EMIT4(0x48, 0x83, 0xEC, stack_size); /* sub rsp, stack_size */ - EMIT1(0x53); /* push rbx */ + if (!is_imm8(stack_size)) + /* sub rsp, stack_size */ + EMIT3_off32(0x48, 0x81, 0xEC, stack_size); + else + /* sub rsp, stack_size */ + EMIT4(0x48, 0x83, 0xEC, stack_size); + if (flags & BPF_TRAMP_F_TAIL_CALL_CTX) + EMIT1(0x50); /* push rax */ + /* mov QWORD PTR [rbp - rbx_off], rbx */ + emit_stx(&prog, BPF_DW, BPF_REG_FP, BPF_REG_6, -rbx_off); /* Store number of argument registers of the traced function: * mov rax, nr_regs @@ -2231,7 +2395,7 @@ emit_stx(&prog, BPF_DW, BPF_REG_FP, BPF_REG_0, -ip_off); } - save_regs(m, &prog, nr_regs, regs_off); + save_args(m, &prog, regs_off, false); if (flags & BPF_TRAMP_F_CALL_ORIG) { /* arg1: mov rdi, im */ @@ -2261,11 +2425,18 @@ } if (flags & BPF_TRAMP_F_CALL_ORIG) { - restore_regs(m, &prog, nr_regs, regs_off); + restore_regs(m, &prog, regs_off); + save_args(m, &prog, arg_stack_off, true); + + if (flags & BPF_TRAMP_F_TAIL_CALL_CTX) + /* Before calling the original function, restore the + * tail_call_cnt from stack to rax. + */ + RESTORE_TAIL_CALL_CNT(stack_size); if (flags & BPF_TRAMP_F_ORIG_STACK) { - emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, 8); - EMIT2(0xff, 0xd0); /* call *rax */ + emit_ldx(&prog, BPF_DW, BPF_REG_6, BPF_REG_FP, 8); + EMIT2(0xff, 0xd3); /* call *rbx */ } else { /* call original function */ if (emit_rsb_call(&prog, orig_call, prog)) { @@ -2302,7 +2473,7 @@ } if (flags & BPF_TRAMP_F_RESTORE_REGS) - restore_regs(m, &prog, nr_regs, regs_off); + restore_regs(m, &prog, regs_off); /* This needs to be done regardless. If there were fmod_ret programs, * the return value is only updated on the stack and still needs to be @@ -2316,12 +2487,17 @@ ret = -EINVAL; goto cleanup; } - } + } else if (flags & BPF_TRAMP_F_TAIL_CALL_CTX) + /* Before running the original function, restore the + * tail_call_cnt from stack to rax. + */ + RESTORE_TAIL_CALL_CNT(stack_size); + /* restore return value of orig_call or fentry prog back into RAX */ if (save_ret) emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, -8); - EMIT1(0x5B); /* pop rbx */ + emit_ldx(&prog, BPF_DW, BPF_REG_6, BPF_REG_FP, -rbx_off); EMIT1(0xC9); /* leave */ if (flags & BPF_TRAMP_F_SKIP_FRAME) /* skip our return address and return to parent */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/pci/fixup.c +++ linux-aws-6.5-6.5.0/arch/x86/pci/fixup.c @@ -3,9 +3,11 @@ * Exceptions for specific devices. Usually work-arounds for fatal design flaws. */ +#include #include #include #include +#include #include #include #include @@ -904,3 +906,60 @@ } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x5ad6, chromeos_save_apl_pci_l1ss_capability); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, 0x5ad6, chromeos_fixup_apl_pci_l1ss_capability); + +#ifdef CONFIG_SUSPEND +/* + * Root Ports on some AMD SoCs advertise PME_Support for D3hot and D3cold, but + * if the SoC is put into a hardware sleep state by the amd-pmc driver, the + * Root Ports don't generate wakeup interrupts for USB devices. + * + * When suspending, remove D3hot and D3cold from the PME_Support advertised + * by the Root Port so we don't use those states if we're expecting wakeup + * interrupts. Restore the advertised PME_Support when resuming. + */ +static void amd_rp_pme_suspend(struct pci_dev *dev) +{ + struct pci_dev *rp; + + /* + * PM_SUSPEND_ON means we're doing runtime suspend, which means + * amd-pmc will not be involved so PMEs during D3 work as advertised. + * + * The PMEs *do* work if amd-pmc doesn't put the SoC in the hardware + * sleep state, but we assume amd-pmc is always present. + */ + if (pm_suspend_target_state == PM_SUSPEND_ON) + return; + + rp = pcie_find_root_port(dev); + if (!rp->pm_cap) + return; + + rp->pme_support &= ~((PCI_PM_CAP_PME_D3hot|PCI_PM_CAP_PME_D3cold) >> + PCI_PM_CAP_PME_SHIFT); + dev_info_once(&rp->dev, "quirk: disabling D3cold for suspend\n"); +} + +static void amd_rp_pme_resume(struct pci_dev *dev) +{ + struct pci_dev *rp; + u16 pmc; + + rp = pcie_find_root_port(dev); + if (!rp->pm_cap) + return; + + pci_read_config_word(rp, rp->pm_cap + PCI_PM_PMC, &pmc); + rp->pme_support = FIELD_GET(PCI_PM_CAP_PME_MASK, pmc); +} +/* Rembrandt (yellow_carp) */ +DECLARE_PCI_FIXUP_SUSPEND(PCI_VENDOR_ID_AMD, 0x162e, amd_rp_pme_suspend); +DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, 0x162e, amd_rp_pme_resume); +DECLARE_PCI_FIXUP_SUSPEND(PCI_VENDOR_ID_AMD, 0x162f, amd_rp_pme_suspend); +DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, 0x162f, amd_rp_pme_resume); +/* Phoenix (pink_sardine) */ +DECLARE_PCI_FIXUP_SUSPEND(PCI_VENDOR_ID_AMD, 0x1668, amd_rp_pme_suspend); +DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, 0x1668, amd_rp_pme_resume); +DECLARE_PCI_FIXUP_SUSPEND(PCI_VENDOR_ID_AMD, 0x1669, amd_rp_pme_suspend); +DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, 0x1669, amd_rp_pme_resume); +#endif /* CONFIG_SUSPEND */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/xen/enlighten.c +++ linux-aws-6.5-6.5.0/arch/x86/xen/enlighten.c @@ -32,10 +32,13 @@ * &HYPERVISOR_shared_info->vcpu_info[cpu]. See xen_hvm_init_shared_info * and xen_vcpu_setup for details. By default it points to share_info->vcpu_info * but during boot it is switched to point to xen_vcpu_info. - * The pointer is used in __xen_evtchn_do_upcall to acknowledge pending events. + * The pointer is used in xen_evtchn_do_upcall to acknowledge pending events. + * Make sure that xen_vcpu_info doesn't cross a page boundary by making it + * cache-line aligned (the struct is guaranteed to have a size of 64 bytes, + * which matches the cache line size of 64-bit x86 processors). */ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); -DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info); +DEFINE_PER_CPU_ALIGNED(struct vcpu_info, xen_vcpu_info); /* Linux <-> Xen vCPU id mapping */ DEFINE_PER_CPU(uint32_t, xen_vcpu_id); @@ -160,6 +163,7 @@ int err; struct vcpu_info *vcpup; + BUILD_BUG_ON(sizeof(*vcpup) > SMP_CACHE_BYTES); BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info); /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/xen/enlighten_pv.c +++ linux-aws-6.5-6.5.0/arch/x86/xen/enlighten_pv.c @@ -678,7 +678,7 @@ TRAP_ENTRY(exc_int3, false ), TRAP_ENTRY(exc_overflow, false ), #ifdef CONFIG_IA32_EMULATION - { entry_INT80_compat, xen_entry_INT80_compat, false }, + TRAP_ENTRY(int80_emulation, false ), #endif TRAP_ENTRY(exc_page_fault, false ), TRAP_ENTRY(exc_divide_error, false ), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/arch/x86/xen/xen-asm.S +++ linux-aws-6.5-6.5.0/arch/x86/xen/xen-asm.S @@ -156,7 +156,7 @@ #endif /* CONFIG_X86_MCE */ xen_pv_trap asm_exc_simd_coprocessor_error #ifdef CONFIG_IA32_EMULATION -xen_pv_trap entry_INT80_compat +xen_pv_trap asm_int80_emulation #endif xen_pv_trap asm_exc_xen_unknown_trap xen_pv_trap asm_exc_xen_hypervisor_callback only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/block/bdev.c +++ linux-aws-6.5-6.5.0/block/bdev.c @@ -442,6 +442,8 @@ void bdev_add(struct block_device *bdev, dev_t dev) { + if (bdev_stable_writes(bdev)) + mapping_set_stable_writes(bdev->bd_inode->i_mapping); bdev->bd_dev = dev; bdev->bd_inode->i_rdev = dev; bdev->bd_inode->i_ino = dev; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/block/blk-cgroup.h +++ linux-aws-6.5-6.5.0/block/blk-cgroup.h @@ -249,8 +249,6 @@ { struct blkcg_gq *blkg; - WARN_ON_ONCE(!rcu_read_lock_held()); - if (blkcg == &blkcg_root) return q->root_blkg; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/block/blk-core.c +++ linux-aws-6.5-6.5.0/block/blk-core.c @@ -500,8 +500,8 @@ if (op_is_write(bio_op(bio)) && bdev_read_only(bio->bi_bdev)) { if (op_is_flush(bio->bi_opf) && !bio_sectors(bio)) return; - pr_warn("Trying to write to read-only block-device %pg\n", - bio->bi_bdev); + pr_warn_ratelimited("Trying to write to read-only block-device %pg\n", + bio->bi_bdev); /* Older lvm-tools actually trigger this */ } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/crypto/asymmetric_keys/Kconfig +++ linux-aws-6.5-6.5.0/crypto/asymmetric_keys/Kconfig @@ -76,7 +76,7 @@ signed PE binary. config FIPS_SIGNATURE_SELFTEST - bool "Run FIPS selftests on the X.509+PKCS7 signature verification" + tristate "Run FIPS selftests on the X.509+PKCS7 signature verification" help This option causes some selftests to be run on the signature verification code, using some built in data. This is required @@ -84,5 +84,6 @@ depends on KEYS depends on ASYMMETRIC_KEY_TYPE depends on PKCS7_MESSAGE_PARSER=X509_CERTIFICATE_PARSER + depends on X509_CERTIFICATE_PARSER endif # ASYMMETRIC_KEY_TYPE only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/crypto/asymmetric_keys/Makefile +++ linux-aws-6.5-6.5.0/crypto/asymmetric_keys/Makefile @@ -22,7 +22,8 @@ x509_cert_parser.o \ x509_loader.o \ x509_public_key.o -x509_key_parser-$(CONFIG_FIPS_SIGNATURE_SELFTEST) += selftest.o +obj-$(CONFIG_FIPS_SIGNATURE_SELFTEST) += x509_selftest.o +x509_selftest-y += selftest.o $(obj)/x509_cert_parser.o: \ $(obj)/x509.asn1.h \ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/crypto/asymmetric_keys/public_key.c +++ linux-aws-6.5-6.5.0/crypto/asymmetric_keys/public_key.c @@ -81,14 +81,13 @@ * RSA signatures usually use EMSA-PKCS1-1_5 [RFC3447 sec 8.2]. */ if (strcmp(encoding, "pkcs1") == 0) { + *sig = op == kernel_pkey_sign || + op == kernel_pkey_verify; if (!hash_algo) { - *sig = false; n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME, "pkcs1pad(%s)", pkey->pkey_algo); } else { - *sig = op == kernel_pkey_sign || - op == kernel_pkey_verify; n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME, "pkcs1pad(%s,%s)", pkey->pkey_algo, hash_algo); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/crypto/asymmetric_keys/selftest.c +++ linux-aws-6.5-6.5.0/crypto/asymmetric_keys/selftest.c @@ -4,10 +4,11 @@ * Written by David Howells (dhowells@redhat.com) */ -#include +#include #include +#include #include -#include +#include #include "x509_parser.h" struct certs_test { @@ -175,7 +176,7 @@ TEST(certs_selftest_1_data, certs_selftest_1_pkcs7), }; -int __init fips_signature_selftest(void) +static int __init fips_signature_selftest(void) { struct key *keyring; int ret, i; @@ -222,3 +223,9 @@ key_put(keyring); return 0; } + +late_initcall(fips_signature_selftest); + +MODULE_DESCRIPTION("X.509 self tests"); +MODULE_AUTHOR("Red Hat, Inc."); +MODULE_LICENSE("GPL"); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/crypto/asymmetric_keys/x509_parser.h +++ linux-aws-6.5-6.5.0/crypto/asymmetric_keys/x509_parser.h @@ -41,15 +41,6 @@ }; /* - * selftest.c - */ -#ifdef CONFIG_FIPS_SIGNATURE_SELFTEST -extern int __init fips_signature_selftest(void); -#else -static inline int fips_signature_selftest(void) { return 0; } -#endif - -/* * x509_cert_parser.c */ extern void x509_free_certificate(struct x509_certificate *cert); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/crypto/pcrypt.c +++ linux-aws-6.5-6.5.0/crypto/pcrypt.c @@ -117,6 +117,8 @@ err = padata_do_parallel(ictx->psenc, padata, &ctx->cb_cpu); if (!err) return -EINPROGRESS; + if (err == -EBUSY) + return -EAGAIN; return err; } @@ -164,6 +166,8 @@ err = padata_do_parallel(ictx->psdec, padata, &ctx->cb_cpu); if (!err) return -EINPROGRESS; + if (err == -EBUSY) + return -EAGAIN; return err; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/accel/habanalabs/gaudi2/gaudi2.c +++ linux-aws-6.5-6.5.0/drivers/accel/habanalabs/gaudi2/gaudi2.c @@ -8149,11 +8149,11 @@ eng_id[num_of_eng] = razwi_info[i].eng_id; base[num_of_eng] = razwi_info[i].rtr_ctrl; if (!num_of_eng) - str_size += snprintf(eng_name + str_size, + str_size += scnprintf(eng_name + str_size, PSOC_RAZWI_ENG_STR_SIZE - str_size, "%s", razwi_info[i].eng_name); else - str_size += snprintf(eng_name + str_size, + str_size += scnprintf(eng_name + str_size, PSOC_RAZWI_ENG_STR_SIZE - str_size, " or %s", razwi_info[i].eng_name); num_of_eng++; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/accel/ivpu/ivpu_drv.c +++ linux-aws-6.5-6.5.0/drivers/accel/ivpu/ivpu_drv.c @@ -303,7 +303,7 @@ } if (!ret) - ivpu_info(vdev, "VPU ready message received successfully\n"); + ivpu_dbg(vdev, PM, "VPU ready message received successfully\n"); else ivpu_hw_diagnose_failure(vdev); @@ -343,14 +343,19 @@ return 0; } -int ivpu_shutdown(struct ivpu_device *vdev) +void ivpu_prepare_for_reset(struct ivpu_device *vdev) { - int ret; - ivpu_hw_irq_disable(vdev); disable_irq(vdev->irq); ivpu_ipc_disable(vdev); ivpu_mmu_disable(vdev); +} + +int ivpu_shutdown(struct ivpu_device *vdev) +{ + int ret; + + ivpu_prepare_for_reset(vdev); ret = ivpu_hw_power_down(vdev); if (ret) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/accel/ivpu/ivpu_drv.h +++ linux-aws-6.5-6.5.0/drivers/accel/ivpu/ivpu_drv.h @@ -144,6 +144,7 @@ int ivpu_boot(struct ivpu_device *vdev); int ivpu_shutdown(struct ivpu_device *vdev); +void ivpu_prepare_for_reset(struct ivpu_device *vdev); static inline bool ivpu_is_mtl(struct ivpu_device *vdev) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/accel/ivpu/ivpu_hw.h +++ linux-aws-6.5-6.5.0/drivers/accel/ivpu/ivpu_hw.h @@ -13,6 +13,7 @@ int (*power_up)(struct ivpu_device *vdev); int (*boot_fw)(struct ivpu_device *vdev); int (*power_down)(struct ivpu_device *vdev); + int (*reset)(struct ivpu_device *vdev); bool (*is_idle)(struct ivpu_device *vdev); void (*wdt_disable)(struct ivpu_device *vdev); void (*diagnose_failure)(struct ivpu_device *vdev); @@ -90,6 +91,13 @@ return vdev->hw->ops->power_down(vdev); }; +static inline int ivpu_hw_reset(struct ivpu_device *vdev) +{ + ivpu_dbg(vdev, PM, "HW reset\n"); + + return vdev->hw->ops->reset(vdev); +}; + static inline void ivpu_hw_wdt_disable(struct ivpu_device *vdev) { vdev->hw->ops->wdt_disable(vdev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/accel/ivpu/ivpu_hw_mtl.c +++ linux-aws-6.5-6.5.0/drivers/accel/ivpu/ivpu_hw_mtl.c @@ -953,9 +953,6 @@ if (status == 0) return 0; - /* Disable global interrupt before handling local buttress interrupts */ - REGB_WR32(MTL_BUTTRESS_GLOBAL_INT_MASK, 0x1); - if (REG_TEST_FLD(MTL_BUTTRESS_INTERRUPT_STAT, FREQ_CHANGE, status)) ivpu_dbg(vdev, IRQ, "FREQ_CHANGE irq: %08x", REGB_RD32(MTL_BUTTRESS_CURRENT_PLL)); @@ -986,9 +983,6 @@ else REGB_WR32(MTL_BUTTRESS_INTERRUPT_STAT, status); - /* Re-enable global interrupt */ - REGB_WR32(MTL_BUTTRESS_GLOBAL_INT_MASK, 0x0); - if (schedule_recovery) ivpu_pm_schedule_recovery(vdev); @@ -1000,9 +994,14 @@ struct ivpu_device *vdev = ptr; u32 ret_irqv, ret_irqb; + REGB_WR32(MTL_BUTTRESS_GLOBAL_INT_MASK, 0x1); + ret_irqv = ivpu_hw_mtl_irqv_handler(vdev, irq); ret_irqb = ivpu_hw_mtl_irqb_handler(vdev, irq); + /* Re-enable global interrupts to re-trigger MSI for pending interrupts */ + REGB_WR32(MTL_BUTTRESS_GLOBAL_INT_MASK, 0x0); + return IRQ_RETVAL(ret_irqb | ret_irqv); } @@ -1041,6 +1040,7 @@ .power_up = ivpu_hw_mtl_power_up, .is_idle = ivpu_hw_mtl_is_idle, .power_down = ivpu_hw_mtl_power_down, + .reset = ivpu_hw_mtl_reset, .boot_fw = ivpu_hw_mtl_boot_fw, .wdt_disable = ivpu_hw_mtl_wdt_disable, .diagnose_failure = ivpu_hw_mtl_diagnose_failure, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/accel/ivpu/ivpu_pm.c +++ linux-aws-6.5-6.5.0/drivers/accel/ivpu/ivpu_pm.c @@ -260,7 +260,8 @@ ivpu_dbg(vdev, PM, "Pre-reset..\n"); atomic_set(&vdev->pm->in_reset, 1); - ivpu_shutdown(vdev); + ivpu_prepare_for_reset(vdev); + ivpu_hw_reset(vdev); ivpu_pm_prepare_cold_boot(vdev); ivpu_jobs_abort_all(vdev); ivpu_dbg(vdev, PM, "Pre-reset done.\n"); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/acpi/acpi_fpdt.c +++ linux-aws-6.5-6.5.0/drivers/acpi/acpi_fpdt.c @@ -194,12 +194,19 @@ record_header = (void *)subtable_header + offset; offset += record_header->length; + if (!record_header->length) { + pr_err(FW_BUG "Zero-length record found in FPTD.\n"); + result = -EINVAL; + goto err; + } + switch (record_header->type) { case RECORD_S3_RESUME: if (subtable_type != SUBTABLE_S3PT) { pr_err(FW_BUG "Invalid record %d for subtable %s\n", record_header->type, signature); - return -EINVAL; + result = -EINVAL; + goto err; } if (record_resume) { pr_err("Duplicate resume performance record found.\n"); @@ -208,7 +215,7 @@ record_resume = (struct resume_performance_record *)record_header; result = sysfs_create_group(fpdt_kobj, &resume_attr_group); if (result) - return result; + goto err; break; case RECORD_S3_SUSPEND: if (subtable_type != SUBTABLE_S3PT) { @@ -223,13 +230,14 @@ record_suspend = (struct suspend_performance_record *)record_header; result = sysfs_create_group(fpdt_kobj, &suspend_attr_group); if (result) - return result; + goto err; break; case RECORD_BOOT: if (subtable_type != SUBTABLE_FBPT) { pr_err(FW_BUG "Invalid %d for subtable %s\n", record_header->type, signature); - return -EINVAL; + result = -EINVAL; + goto err; } if (record_boot) { pr_err("Duplicate boot performance record found.\n"); @@ -238,7 +246,7 @@ record_boot = (struct boot_performance_record *)record_header; result = sysfs_create_group(fpdt_kobj, &boot_attr_group); if (result) - return result; + goto err; break; default: @@ -247,6 +255,18 @@ } } return 0; + +err: + if (record_boot) + sysfs_remove_group(fpdt_kobj, &boot_attr_group); + + if (record_suspend) + sysfs_remove_group(fpdt_kobj, &suspend_attr_group); + + if (record_resume) + sysfs_remove_group(fpdt_kobj, &resume_attr_group); + + return result; } static int __init acpi_init_fpdt(void) @@ -255,6 +275,7 @@ struct acpi_table_header *header; struct fpdt_subtable_entry *subtable; u32 offset = sizeof(*header); + int result; status = acpi_get_table(ACPI_SIG_FPDT, 0, &header); @@ -263,8 +284,8 @@ fpdt_kobj = kobject_create_and_add("fpdt", acpi_kobj); if (!fpdt_kobj) { - acpi_put_table(header); - return -ENOMEM; + result = -ENOMEM; + goto err_nomem; } while (offset < header->length) { @@ -272,8 +293,10 @@ switch (subtable->type) { case SUBTABLE_FBPT: case SUBTABLE_S3PT: - fpdt_process_subtable(subtable->address, + result = fpdt_process_subtable(subtable->address, subtable->type); + if (result) + goto err_subtable; break; default: /* Other types are reserved in ACPI 6.4 spec. */ @@ -282,6 +305,12 @@ offset += sizeof(*subtable); } return 0; +err_subtable: + kobject_put(fpdt_kobj); + +err_nomem: + acpi_put_table(header); + return result; } fs_initcall(acpi_init_fpdt); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/acpi/apei/ghes.c +++ linux-aws-6.5-6.5.0/drivers/acpi/apei/ghes.c @@ -209,6 +209,20 @@ return -ENOMEM; } +/** + * ghes_estatus_pool_region_free - free previously allocated memory + * from the ghes_estatus_pool. + * @addr: address of memory to free. + * @size: size of memory to free. + * + * Returns none. + */ +void ghes_estatus_pool_region_free(unsigned long addr, u32 size) +{ + gen_pool_free(ghes_estatus_pool, addr, size); +} +EXPORT_SYMBOL_GPL(ghes_estatus_pool_region_free); + static int map_gen_v2(struct ghes *ghes) { return apei_map_generic_address(&ghes->generic_v2->read_ack_register); @@ -564,6 +578,7 @@ pcie_err->validation_bits & CPER_PCIE_VALID_AER_INFO) { unsigned int devfn; int aer_severity; + u8 *aer_info; devfn = PCI_DEVFN(pcie_err->device_id.device, pcie_err->device_id.function); @@ -577,11 +592,17 @@ if (gdata->flags & CPER_SEC_RESET) aer_severity = AER_FATAL; + aer_info = (void *)gen_pool_alloc(ghes_estatus_pool, + sizeof(struct aer_capability_regs)); + if (!aer_info) + return; + memcpy(aer_info, pcie_err->aer_info, sizeof(struct aer_capability_regs)); + aer_recover_queue(pcie_err->device_id.segment, pcie_err->device_id.bus, devfn, aer_severity, (struct aer_capability_regs *) - pcie_err->aer_info); + aer_info); } #endif } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/acpi/bus.c +++ linux-aws-6.5-6.5.0/drivers/acpi/bus.c @@ -1387,10 +1387,10 @@ acpi_init_ffh(); pci_mmcfg_late_init(); - acpi_arm_init(); acpi_viot_early_init(); acpi_hest_init(); acpi_ghes_init(); + acpi_arm_init(); acpi_scan_init(); acpi_ec_init(); acpi_debugfs_init(); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/acpi/device_pm.c +++ linux-aws-6.5-6.5.0/drivers/acpi/device_pm.c @@ -397,6 +397,19 @@ } EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_extended); +/** + * acpi_device_fix_up_power_children - Force a device's children into D0. + * @adev: Parent device object whose children's power state is to be fixed up. + * + * Call acpi_device_fix_up_power() for @adev's children so long as they + * are reported as present and enabled. + */ +void acpi_device_fix_up_power_children(struct acpi_device *adev) +{ + acpi_dev_for_each_child(adev, fix_up_power_if_applicable, NULL); +} +EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_children); + int acpi_device_update_power(struct acpi_device *device, int *state_p) { int state; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/acpi/device_sysfs.c +++ linux-aws-6.5-6.5.0/drivers/acpi/device_sysfs.c @@ -158,8 +158,8 @@ return 0; len = snprintf(modalias, size, "acpi:"); - if (len <= 0) - return len; + if (len >= size) + return -ENOMEM; size -= len; @@ -212,8 +212,10 @@ len = snprintf(modalias, size, "of:N%sT", (char *)buf.pointer); ACPI_FREE(buf.pointer); - if (len <= 0) - return len; + if (len >= size) + return -ENOMEM; + + size -= len; of_compatible = acpi_dev->data.of_compatible; if (of_compatible->type == ACPI_TYPE_PACKAGE) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/acpi/irq.c +++ linux-aws-6.5-6.5.0/drivers/acpi/irq.c @@ -57,6 +57,7 @@ int polarity) { struct irq_fwspec fwspec; + unsigned int irq; fwspec.fwnode = acpi_get_gsi_domain_id(gsi); if (WARN_ON(!fwspec.fwnode)) { @@ -68,7 +69,11 @@ fwspec.param[1] = acpi_dev_get_irq_type(trigger, polarity); fwspec.param_count = 2; - return irq_create_fwspec_mapping(&fwspec); + irq = irq_create_fwspec_mapping(&fwspec); + if (!irq) + return -EINVAL; + + return irq; } EXPORT_SYMBOL_GPL(acpi_register_gsi); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/acpi/numa/srat.c +++ linux-aws-6.5-6.5.0/drivers/acpi/numa/srat.c @@ -310,11 +310,16 @@ start = cfmws->base_hpa; end = cfmws->base_hpa + cfmws->window_size; - /* Skip if the SRAT already described the NUMA details for this HPA */ - node = phys_to_target_node(start); - if (node != NUMA_NO_NODE) + /* + * The SRAT may have already described NUMA details for all, + * or a portion of, this CFMWS HPA range. Extend the memblks + * found for any portion of the window to cover the entire + * window. + */ + if (!numa_fill_memblks(start, end)) return 0; + /* No SRAT description. Create a new node. */ node = acpi_map_pxm_to_node(*fake_pxm); if (node == NUMA_NO_NODE) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/acpi/property.c +++ linux-aws-6.5-6.5.0/drivers/acpi/property.c @@ -1102,25 +1102,26 @@ switch (proptype) { case DEV_PROP_STRING: break; - case DEV_PROP_U8 ... DEV_PROP_U64: + default: if (obj->type == ACPI_TYPE_BUFFER) { if (nval > obj->buffer.length) return -EOVERFLOW; - break; + } else { + if (nval > obj->package.count) + return -EOVERFLOW; } - fallthrough; - default: - if (nval > obj->package.count) - return -EOVERFLOW; break; } if (nval == 0) return -EINVAL; - if (obj->type != ACPI_TYPE_BUFFER) - items = obj->package.elements; - else + if (obj->type == ACPI_TYPE_BUFFER) { + if (proptype != DEV_PROP_U8) + return -EPROTO; items = obj; + } else { + items = obj->package.elements; + } switch (proptype) { case DEV_PROP_U8: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/acpi/scan.c +++ linux-aws-6.5-6.5.0/drivers/acpi/scan.c @@ -1565,17 +1565,22 @@ int err; const struct iommu_ops *ops; + /* Serialise to make dev->iommu stable under our potential fwspec */ + mutex_lock(&iommu_probe_device_lock); /* * If we already translated the fwspec there is nothing left to do, * return the iommu_ops. */ ops = acpi_iommu_fwspec_ops(dev); - if (ops) + if (ops) { + mutex_unlock(&iommu_probe_device_lock); return ops; + } err = iort_iommu_configure_id(dev, id_in); if (err && err != -EPROBE_DEFER) err = viot_iommu_configure(dev); + mutex_unlock(&iommu_probe_device_lock); /* * If we have reason to believe the IOMMU driver missed the initial only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/ata/pata_isapnp.c +++ linux-aws-6.5-6.5.0/drivers/ata/pata_isapnp.c @@ -82,6 +82,9 @@ if (pnp_port_valid(idev, 1)) { ctl_addr = devm_ioport_map(&idev->dev, pnp_port_start(idev, 1), 1); + if (!ctl_addr) + return -ENOMEM; + ap->ioaddr.altstatus_addr = ctl_addr; ap->ioaddr.ctl_addr = ctl_addr; ap->ops = &isapnp_port_ops; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/ata/pata_parport/fit3.c +++ linux-aws-6.5-6.5.0/drivers/ata/pata_parport/fit3.c @@ -9,11 +9,6 @@ * * The TD-2000 and certain older devices use a different protocol. * Try the fit2 protocol module with them. - * - * NB: The FIT adapters do not appear to support the control - * registers. So, we map ALT_STATUS to STATUS and NO-OP writes - * to the device control register - this means that IDE reset - * will not work on these devices. */ #include @@ -37,8 +32,7 @@ static void fit3_write_regr(struct pi_adapter *pi, int cont, int regr, int val) { - if (cont == 1) - return; + regr += cont << 3; switch (pi->mode) { case 0: @@ -59,11 +53,7 @@ { int a, b; - if (cont) { - if (regr != 6) - return 0xff; - regr = 7; - } + regr += cont << 3; switch (pi->mode) { case 0: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/atm/iphase.c +++ linux-aws-6.5-6.5.0/drivers/atm/iphase.c @@ -2291,19 +2291,21 @@ static int reset_sar(struct atm_dev *dev) { IADEV *iadev; - int i, error = 1; + int i, error; unsigned int pci[64]; iadev = INPH_IA_DEV(dev); - for(i=0; i<64; i++) - if ((error = pci_read_config_dword(iadev->pci, - i*4, &pci[i])) != PCIBIOS_SUCCESSFUL) - return error; + for (i = 0; i < 64; i++) { + error = pci_read_config_dword(iadev->pci, i * 4, &pci[i]); + if (error != PCIBIOS_SUCCESSFUL) + return error; + } writel(0, iadev->reg+IPHASE5575_EXT_RESET); - for(i=0; i<64; i++) - if ((error = pci_write_config_dword(iadev->pci, - i*4, pci[i])) != PCIBIOS_SUCCESSFUL) - return error; + for (i = 0; i < 64; i++) { + error = pci_write_config_dword(iadev->pci, i * 4, pci[i]); + if (error != PCIBIOS_SUCCESSFUL) + return error; + } udelay(5); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/auxdisplay/hd44780_common.c +++ linux-aws-6.5-6.5.0/drivers/auxdisplay/hd44780_common.c @@ -82,7 +82,15 @@ hdc->write_cmd(hdc, LCD_CMD_DISPLAY_CLEAR); /* datasheet says to wait 1,64 milliseconds */ long_sleep(2); - return 0; + + /* + * The Hitachi HD44780 controller (and compatible ones) reset the DDRAM + * address when executing the DISPLAY_CLEAR command, thus the + * following call is not required. However, other controllers do not + * (e.g. NewHaven NHD-0220DZW-AG5), thus move the cursor to home + * unconditionally to support both. + */ + return hd44780_common_home(lcd); } EXPORT_SYMBOL_GPL(hd44780_common_clear_display); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/base/cpu.c +++ linux-aws-6.5-6.5.0/drivers/base/cpu.c @@ -125,7 +125,7 @@ #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ #endif /* CONFIG_HOTPLUG_CPU */ -#ifdef CONFIG_KEXEC +#ifdef CONFIG_KEXEC_CORE #include static ssize_t crash_notes_show(struct device *dev, @@ -170,14 +170,14 @@ #endif static const struct attribute_group *common_cpu_attr_groups[] = { -#ifdef CONFIG_KEXEC +#ifdef CONFIG_KEXEC_CORE &crash_note_cpu_attr_group, #endif NULL }; static const struct attribute_group *hotplugable_cpu_attr_groups[] = { -#ifdef CONFIG_KEXEC +#ifdef CONFIG_KEXEC_CORE &crash_note_cpu_attr_group, #endif NULL only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/base/devcoredump.c +++ linux-aws-6.5-6.5.0/drivers/base/devcoredump.c @@ -362,6 +362,7 @@ devcd->devcd_dev.class = &devcd_class; mutex_lock(&devcd->mutex); + dev_set_uevent_suppress(&devcd->devcd_dev, true); if (device_add(&devcd->devcd_dev)) goto put_device; @@ -376,6 +377,8 @@ "devcoredump")) dev_warn(dev, "devcoredump create_link failed\n"); + dev_set_uevent_suppress(&devcd->devcd_dev, false); + kobject_uevent(&devcd->devcd_dev.kobj, KOBJ_ADD); INIT_DELAYED_WORK(&devcd->del_wk, devcd_del); schedule_delayed_work(&devcd->del_wk, DEVCD_TIMEOUT); mutex_unlock(&devcd->mutex); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/base/memory.c +++ linux-aws-6.5-6.5.0/drivers/base/memory.c @@ -179,6 +179,9 @@ } #endif +/* + * Must acquire mem_hotplug_lock in write mode. + */ static int memory_block_online(struct memory_block *mem) { unsigned long start_pfn = section_nr_to_pfn(mem->start_section_nr); @@ -200,10 +203,11 @@ * stage helps to keep accounting easier to follow - e.g vmemmaps * belong to the same zone as the memory they backed. */ + mem_hotplug_begin(); if (nr_vmemmap_pages) { ret = mhp_init_memmap_on_memory(start_pfn, nr_vmemmap_pages, zone); if (ret) - return ret; + goto out; } ret = online_pages(start_pfn + nr_vmemmap_pages, @@ -211,7 +215,7 @@ if (ret) { if (nr_vmemmap_pages) mhp_deinit_memmap_on_memory(start_pfn, nr_vmemmap_pages); - return ret; + goto out; } /* @@ -223,9 +227,14 @@ nr_vmemmap_pages); mem->zone = zone; +out: + mem_hotplug_done(); return ret; } +/* + * Must acquire mem_hotplug_lock in write mode. + */ static int memory_block_offline(struct memory_block *mem) { unsigned long start_pfn = section_nr_to_pfn(mem->start_section_nr); @@ -240,6 +249,7 @@ * Unaccount before offlining, such that unpopulated zone and kthreads * can properly be torn down in offline_pages(). */ + mem_hotplug_begin(); if (nr_vmemmap_pages) adjust_present_page_count(pfn_to_page(start_pfn), mem->group, -nr_vmemmap_pages); @@ -251,13 +261,15 @@ if (nr_vmemmap_pages) adjust_present_page_count(pfn_to_page(start_pfn), mem->group, nr_vmemmap_pages); - return ret; + goto out; } if (nr_vmemmap_pages) mhp_deinit_memmap_on_memory(start_pfn, nr_vmemmap_pages); mem->zone = NULL; +out: + mem_hotplug_done(); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/base/regmap/regcache.c +++ linux-aws-6.5-6.5.0/drivers/base/regmap/regcache.c @@ -334,6 +334,11 @@ return 0; } +static int rbtree_all(const void *key, const struct rb_node *node) +{ + return 0; +} + /** * regcache_sync - Sync the register cache with the hardware. * @@ -351,6 +356,7 @@ unsigned int i; const char *name; bool bypass; + struct rb_node *node; if (WARN_ON(map->cache_type == REGCACHE_NONE)) return -EINVAL; @@ -392,6 +398,29 @@ /* Restore the bypass state */ map->cache_bypass = bypass; map->no_sync_defaults = false; + + /* + * If we did any paging with cache bypassed and a cached + * paging register then the register and cache state might + * have gone out of sync, force writes of all the paging + * registers. + */ + rb_for_each(node, 0, &map->range_tree, rbtree_all) { + struct regmap_range_node *this = + rb_entry(node, struct regmap_range_node, node); + + /* If there's nothing in the cache there's nothing to sync */ + if (regcache_read(map, this->selector_reg, &i) != 0) + continue; + + ret = _regmap_write(map, this->selector_reg, i); + if (ret != 0) { + dev_err(map->dev, "Failed to write %x = %x: %d\n", + this->selector_reg, i, ret); + break; + } + } + map->unlock(map->lock_arg); regmap_async_complete(map); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/base/regmap/regmap-debugfs.c +++ linux-aws-6.5-6.5.0/drivers/base/regmap/regmap-debugfs.c @@ -48,7 +48,7 @@ name = map->dev->driver->name; ret = snprintf(buf, PAGE_SIZE, "%s\n", name); - if (ret < 0) { + if (ret >= PAGE_SIZE) { kfree(buf); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/base/regmap/regmap.c +++ linux-aws-6.5-6.5.0/drivers/base/regmap/regmap.c @@ -1572,7 +1572,7 @@ /* If the user didn't specify a name match any */ if (data) - return !strcmp((*r)->name, data); + return (*r)->name && !strcmp((*r)->name, data); else return 1; } @@ -1714,17 +1714,19 @@ } if (!map->cache_bypass && map->format.parse_val) { - unsigned int ival; + unsigned int ival, offset; int val_bytes = map->format.val_bytes; - for (i = 0; i < val_len / val_bytes; i++) { - ival = map->format.parse_val(val + (i * val_bytes)); - ret = regcache_write(map, - reg + regmap_get_offset(map, i), - ival); + + /* Cache the last written value for noinc writes */ + i = noinc ? val_len - val_bytes : 0; + for (; i < val_len; i += val_bytes) { + ival = map->format.parse_val(val + i); + offset = noinc ? 0 : regmap_get_offset(map, i / val_bytes); + ret = regcache_write(map, reg + offset, ival); if (ret) { dev_err(map->dev, "Error in caching of register: %x ret: %d\n", - reg + regmap_get_offset(map, i), ret); + reg + offset, ret); return ret; } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/block/virtio_blk.c +++ linux-aws-6.5-6.5.0/drivers/block/virtio_blk.c @@ -1313,6 +1313,7 @@ u16 min_io_size; u8 physical_block_exp, alignment_offset; unsigned int queue_depth; + size_t max_dma_size; if (!vdev->config->get) { dev_err(&vdev->dev, "%s failure: config access disabled\n", @@ -1411,7 +1412,8 @@ /* No real sector limit. */ blk_queue_max_hw_sectors(q, UINT_MAX); - max_size = virtio_max_dma_size(vdev); + max_dma_size = virtio_max_dma_size(vdev); + max_size = max_dma_size > U32_MAX ? U32_MAX : max_dma_size; /* Host can optionally specify maximum segment size and number of * segments. */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/bluetooth/hci_bcm4377.c +++ linux-aws-6.5-6.5.0/drivers/bluetooth/hci_bcm4377.c @@ -512,6 +512,7 @@ unsigned long disable_aspm : 1; unsigned long broken_ext_scan : 1; unsigned long broken_mws_transport_config : 1; + unsigned long broken_le_coded : 1; int (*send_calibration)(struct bcm4377_data *bcm4377); int (*send_ptb)(struct bcm4377_data *bcm4377, @@ -2372,6 +2373,8 @@ set_bit(HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG, &hdev->quirks); if (bcm4377->hw->broken_ext_scan) set_bit(HCI_QUIRK_BROKEN_EXT_SCAN, &hdev->quirks); + if (bcm4377->hw->broken_le_coded) + set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks); pci_set_drvdata(pdev, bcm4377); hci_set_drvdata(hdev, bcm4377); @@ -2461,6 +2464,7 @@ .bar0_core2_window2 = 0x18107000, .has_bar0_core2_window2 = true, .broken_mws_transport_config = true, + .broken_le_coded = true, .send_calibration = bcm4378_send_calibration, .send_ptb = bcm4378_send_ptb, }, @@ -2474,6 +2478,7 @@ .has_bar0_core2_window2 = true, .clear_pciecfg_subsystem_ctrl_bit19 = true, .broken_mws_transport_config = true, + .broken_le_coded = true, .send_calibration = bcm4387_send_calibration, .send_ptb = bcm4378_send_ptb, }, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/bluetooth/hci_vhci.c +++ linux-aws-6.5-6.5.0/drivers/bluetooth/hci_vhci.c @@ -74,7 +74,10 @@ struct vhci_data *data = hci_get_drvdata(hdev); memcpy(skb_push(skb, 1), &hci_skb_pkt_type(skb), 1); + + mutex_lock(&data->open_mutex); skb_queue_tail(&data->readq, skb); + mutex_unlock(&data->open_mutex); wake_up_interruptible(&data->read_wait); return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/char/hw_random/bcm2835-rng.c +++ linux-aws-6.5-6.5.0/drivers/char/hw_random/bcm2835-rng.c @@ -71,7 +71,7 @@ while ((rng_readl(priv, RNG_STATUS) >> 24) == 0) { if (!wait) return 0; - hwrng_msleep(rng, 1000); + hwrng_yield(rng); } num_words = rng_readl(priv, RNG_STATUS) >> 24; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/char/hw_random/core.c +++ linux-aws-6.5-6.5.0/drivers/char/hw_random/core.c @@ -679,6 +679,12 @@ } EXPORT_SYMBOL_GPL(hwrng_msleep); +long hwrng_yield(struct hwrng *rng) +{ + return wait_for_completion_interruptible_timeout(&rng->dying, 1); +} +EXPORT_SYMBOL_GPL(hwrng_yield); + static int __init hwrng_modinit(void) { int ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/char/hw_random/geode-rng.c +++ linux-aws-6.5-6.5.0/drivers/char/hw_random/geode-rng.c @@ -58,7 +58,8 @@ static int geode_rng_data_read(struct hwrng *rng, u32 *data) { - void __iomem *mem = (void __iomem *)rng->priv; + struct amd_geode_priv *priv = (struct amd_geode_priv *)rng->priv; + void __iomem *mem = priv->membase; *data = readl(mem + GEODE_RNG_DATA_REG); @@ -67,7 +68,8 @@ static int geode_rng_data_present(struct hwrng *rng, int wait) { - void __iomem *mem = (void __iomem *)rng->priv; + struct amd_geode_priv *priv = (struct amd_geode_priv *)rng->priv; + void __iomem *mem = priv->membase; int data, i; for (i = 0; i < 20; i++) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/clk-npcm7xx.c +++ linux-aws-6.5-6.5.0/drivers/clk/clk-npcm7xx.c @@ -510,7 +510,7 @@ return; npcm7xx_init_fail: - kfree(npcm7xx_clk_data->hws); + kfree(npcm7xx_clk_data); npcm7xx_init_np_err: iounmap(clk_base); npcm7xx_init_error: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/clk-scmi.c +++ linux-aws-6.5-6.5.0/drivers/clk/clk-scmi.c @@ -213,6 +213,7 @@ sclk->info = scmi_proto_clk_ops->info_get(ph, idx); if (!sclk->info) { dev_dbg(dev, "invalid clock info for idx %d\n", idx); + devm_kfree(dev, sclk); continue; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/clk.c +++ linux-aws-6.5-6.5.0/drivers/clk/clk.c @@ -3416,6 +3416,7 @@ unsigned int i, char terminator) { struct clk_core *parent; + const char *name = NULL; /* * Go through the following options to fetch a parent's name. @@ -3430,18 +3431,20 @@ * registered (yet). */ parent = clk_core_get_parent_by_index(core, i); - if (parent) + if (parent) { seq_puts(s, parent->name); - else if (core->parents[i].name) + } else if (core->parents[i].name) { seq_puts(s, core->parents[i].name); - else if (core->parents[i].fw_name) + } else if (core->parents[i].fw_name) { seq_printf(s, "<%s>(fw)", core->parents[i].fw_name); - else if (core->parents[i].index >= 0) - seq_puts(s, - of_clk_get_parent_name(core->of_node, - core->parents[i].index)); - else - seq_puts(s, "(missing)"); + } else { + if (core->parents[i].index >= 0) + name = of_clk_get_parent_name(core->of_node, core->parents[i].index); + if (!name) + name = "(missing)"; + + seq_puts(s, name); + } seq_putc(s, terminator); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/imx/Kconfig +++ linux-aws-6.5-6.5.0/drivers/clk/imx/Kconfig @@ -96,6 +96,7 @@ depends on (ARCH_MXC && ARM64) || COMPILE_TEST depends on IMX_SCU && HAVE_ARM_SMCCC select MXC_CLK_SCU + select MXC_CLK help Build the driver for IMX8QXP SCU based clocks. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/imx/clk-imx8mq.c +++ linux-aws-6.5-6.5.0/drivers/clk/imx/clk-imx8mq.c @@ -288,8 +288,7 @@ void __iomem *base; int err; - clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, - IMX8MQ_CLK_END), GFP_KERNEL); + clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, IMX8MQ_CLK_END), GFP_KERNEL); if (WARN_ON(!clk_hw_data)) return -ENOMEM; @@ -306,10 +305,12 @@ hws[IMX8MQ_CLK_EXT4] = imx_get_clk_hw_by_name(np, "clk_ext4"); np = of_find_compatible_node(NULL, NULL, "fsl,imx8mq-anatop"); - base = of_iomap(np, 0); + base = devm_of_iomap(dev, np, 0, NULL); of_node_put(np); - if (WARN_ON(!base)) - return -ENOMEM; + if (WARN_ON(IS_ERR(base))) { + err = PTR_ERR(base); + goto unregister_hws; + } hws[IMX8MQ_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", base + 0x28, 16, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); hws[IMX8MQ_GPU_PLL_REF_SEL] = imx_clk_hw_mux("gpu_pll_ref_sel", base + 0x18, 16, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); @@ -395,8 +396,10 @@ np = dev->of_node; base = devm_platform_ioremap_resource(pdev, 0); - if (WARN_ON(IS_ERR(base))) - return PTR_ERR(base); + if (WARN_ON(IS_ERR(base))) { + err = PTR_ERR(base); + goto unregister_hws; + } /* CORE */ hws[IMX8MQ_CLK_A53_DIV] = imx8m_clk_hw_composite_core("arm_a53_div", imx8mq_a53_sels, base + 0x8000); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/imx/clk-imx8qxp.c +++ linux-aws-6.5-6.5.0/drivers/clk/imx/clk-imx8qxp.c @@ -148,10 +148,10 @@ imx_clk_scu("adc0_clk", IMX_SC_R_ADC_0, IMX_SC_PM_CLK_PER); imx_clk_scu("adc1_clk", IMX_SC_R_ADC_1, IMX_SC_PM_CLK_PER); imx_clk_scu("pwm_clk", IMX_SC_R_LCD_0_PWM_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("elcdif_pll", IMX_SC_R_ELCDIF_PLL, IMX_SC_PM_CLK_PLL); imx_clk_scu2("lcd_clk", lcd_sels, ARRAY_SIZE(lcd_sels), IMX_SC_R_LCD_0, IMX_SC_PM_CLK_PER); imx_clk_scu2("lcd_pxl_clk", lcd_pxl_sels, ARRAY_SIZE(lcd_pxl_sels), IMX_SC_R_LCD_0, IMX_SC_PM_CLK_MISC0); imx_clk_scu("lcd_pxl_bypass_div_clk", IMX_SC_R_LCD_0, IMX_SC_PM_CLK_BYPASS); - imx_clk_scu("elcdif_pll", IMX_SC_R_ELCDIF_PLL, IMX_SC_PM_CLK_PLL); /* Audio SS */ imx_clk_scu("audio_pll0_clk", IMX_SC_R_AUDIO_PLL_0, IMX_SC_PM_CLK_PLL); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/mediatek/clk-mt2701.c +++ linux-aws-6.5-6.5.0/drivers/clk/mediatek/clk-mt2701.c @@ -670,6 +670,8 @@ return PTR_ERR(base); clk_data = mtk_alloc_clk_data(CLK_TOP_NR); + if (!clk_data) + return -ENOMEM; mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks), clk_data); @@ -750,6 +752,8 @@ if (!infra_clk_data) { infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR); + if (!infra_clk_data) + return; for (i = 0; i < CLK_INFRA_NR; i++) infra_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER); @@ -777,6 +781,8 @@ if (!infra_clk_data) { infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR); + if (!infra_clk_data) + return -ENOMEM; } else { for (i = 0; i < CLK_INFRA_NR; i++) { if (infra_clk_data->hws[i] == ERR_PTR(-EPROBE_DEFER)) @@ -894,6 +900,8 @@ return PTR_ERR(base); clk_data = mtk_alloc_clk_data(CLK_PERI_NR); + if (!clk_data) + return -ENOMEM; mtk_clk_register_gates(&pdev->dev, node, peri_clks, ARRAY_SIZE(peri_clks), clk_data); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/mediatek/clk-mt6765.c +++ linux-aws-6.5-6.5.0/drivers/clk/mediatek/clk-mt6765.c @@ -740,6 +740,8 @@ } clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK); + if (!clk_data) + return -ENOMEM; mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); @@ -775,6 +777,8 @@ } clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK); + if (!clk_data) + return -ENOMEM; mtk_clk_register_fixed_clks(fixed_clks, ARRAY_SIZE(fixed_clks), clk_data); @@ -816,6 +820,8 @@ } clk_data = mtk_alloc_clk_data(CLK_IFR_NR_CLK); + if (!clk_data) + return -ENOMEM; mtk_clk_register_gates(&pdev->dev, node, ifr_clks, ARRAY_SIZE(ifr_clks), clk_data); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/mediatek/clk-mt6779.c +++ linux-aws-6.5-6.5.0/drivers/clk/mediatek/clk-mt6779.c @@ -1219,6 +1219,8 @@ struct device_node *node = pdev->dev.of_node; clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK); + if (!clk_data) + return -ENOMEM; mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); @@ -1239,6 +1241,8 @@ return PTR_ERR(base); clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK); + if (!clk_data) + return -ENOMEM; mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks), clk_data); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/mediatek/clk-mt6797.c +++ linux-aws-6.5-6.5.0/drivers/clk/mediatek/clk-mt6797.c @@ -392,6 +392,8 @@ return PTR_ERR(base); clk_data = mtk_alloc_clk_data(CLK_TOP_NR); + if (!clk_data) + return -ENOMEM; mtk_clk_register_factors(top_fixed_divs, ARRAY_SIZE(top_fixed_divs), clk_data); @@ -547,6 +549,8 @@ if (!infra_clk_data) { infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR); + if (!infra_clk_data) + return; for (i = 0; i < CLK_INFRA_NR; i++) infra_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER); @@ -572,6 +576,8 @@ if (!infra_clk_data) { infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR); + if (!infra_clk_data) + return -ENOMEM; } else { for (i = 0; i < CLK_INFRA_NR; i++) { if (infra_clk_data->hws[i] == ERR_PTR(-EPROBE_DEFER)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/mediatek/clk-mt7629-eth.c +++ linux-aws-6.5-6.5.0/drivers/clk/mediatek/clk-mt7629-eth.c @@ -79,6 +79,8 @@ int r; clk_data = mtk_alloc_clk_data(CLK_ETH_NR_CLK); + if (!clk_data) + return -ENOMEM; mtk_clk_register_gates(&pdev->dev, node, eth_clks, CLK_ETH_NR_CLK, clk_data); @@ -102,6 +104,8 @@ int r; clk_data = mtk_alloc_clk_data(CLK_SGMII_NR_CLK); + if (!clk_data) + return -ENOMEM; mtk_clk_register_gates(&pdev->dev, node, sgmii_clks[id++], CLK_SGMII_NR_CLK, clk_data); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/mediatek/clk-mt7629.c +++ linux-aws-6.5-6.5.0/drivers/clk/mediatek/clk-mt7629.c @@ -557,6 +557,8 @@ return PTR_ERR(base); clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK); + if (!clk_data) + return -ENOMEM; mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks), clk_data); @@ -581,6 +583,8 @@ struct clk_hw_onecell_data *clk_data; clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK); + if (!clk_data) + return -ENOMEM; mtk_clk_register_gates(&pdev->dev, node, infra_clks, ARRAY_SIZE(infra_clks), clk_data); @@ -604,6 +608,8 @@ return PTR_ERR(base); clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK); + if (!clk_data) + return -ENOMEM; mtk_clk_register_gates(&pdev->dev, node, peri_clks, ARRAY_SIZE(peri_clks), clk_data); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/mediatek/clk-pll.c +++ linux-aws-6.5-6.5.0/drivers/clk/mediatek/clk-pll.c @@ -321,10 +321,8 @@ ret = clk_hw_register(NULL, &pll->hw); - if (ret) { - kfree(pll); + if (ret) return ERR_PTR(ret); - } return &pll->hw; } @@ -340,6 +338,8 @@ return ERR_PTR(-ENOMEM); hw = mtk_clk_register_pll_ops(pll, data, base, &mtk_pll_ops); + if (IS_ERR(hw)) + kfree(pll); return hw; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/apss-ipq-pll.c +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/apss-ipq-pll.c @@ -68,13 +68,13 @@ .fw_name = "xo", }, .num_parents = 1, - .ops = &clk_alpha_pll_stromer_ops, + .ops = &clk_alpha_pll_stromer_plus_ops, }, }, }; static const struct alpha_pll_config ipq5332_pll_config = { - .l = 0x3e, + .l = 0x2d, .config_ctl_val = 0x4001075b, .config_ctl_hi_val = 0x304, .main_output_mask = BIT(0), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/clk-alpha-pll.c +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/clk-alpha-pll.c @@ -2479,3 +2479,66 @@ .set_rate = clk_alpha_pll_stromer_set_rate, }; EXPORT_SYMBOL_GPL(clk_alpha_pll_stromer_ops); + +static int clk_alpha_pll_stromer_plus_set_rate(struct clk_hw *hw, + unsigned long rate, + unsigned long prate) +{ + struct clk_alpha_pll *pll = to_clk_alpha_pll(hw); + u32 l, alpha_width = pll_alpha_width(pll); + int ret, pll_mode; + u64 a; + + rate = alpha_pll_round_rate(rate, prate, &l, &a, alpha_width); + + ret = regmap_read(pll->clkr.regmap, PLL_MODE(pll), &pll_mode); + if (ret) + return ret; + + regmap_write(pll->clkr.regmap, PLL_MODE(pll), 0); + + /* Delay of 2 output clock ticks required until output is disabled */ + udelay(1); + + regmap_write(pll->clkr.regmap, PLL_L_VAL(pll), l); + + if (alpha_width > ALPHA_BITWIDTH) + a <<= alpha_width - ALPHA_BITWIDTH; + + regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL(pll), a); + regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL_U(pll), + a >> ALPHA_BITWIDTH); + + regmap_write(pll->clkr.regmap, PLL_MODE(pll), PLL_BYPASSNL); + + /* Wait five micro seconds or more */ + udelay(5); + regmap_update_bits(pll->clkr.regmap, PLL_MODE(pll), PLL_RESET_N, + PLL_RESET_N); + + /* The lock time should be less than 50 micro seconds worst case */ + usleep_range(50, 60); + + ret = wait_for_pll_enable_lock(pll); + if (ret) { + pr_err("Wait for PLL enable lock failed [%s] %d\n", + clk_hw_get_name(hw), ret); + return ret; + } + + if (pll_mode & PLL_OUTCTRL) + regmap_update_bits(pll->clkr.regmap, PLL_MODE(pll), PLL_OUTCTRL, + PLL_OUTCTRL); + + return 0; +} + +const struct clk_ops clk_alpha_pll_stromer_plus_ops = { + .prepare = clk_alpha_pll_enable, + .unprepare = clk_alpha_pll_disable, + .is_enabled = clk_alpha_pll_is_enabled, + .recalc_rate = clk_alpha_pll_recalc_rate, + .determine_rate = clk_alpha_pll_stromer_determine_rate, + .set_rate = clk_alpha_pll_stromer_plus_set_rate, +}; +EXPORT_SYMBOL_GPL(clk_alpha_pll_stromer_plus_ops); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/clk-alpha-pll.h +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/clk-alpha-pll.h @@ -152,6 +152,7 @@ extern const struct clk_ops clk_alpha_pll_huayra_ops; extern const struct clk_ops clk_alpha_pll_postdiv_ro_ops; extern const struct clk_ops clk_alpha_pll_stromer_ops; +extern const struct clk_ops clk_alpha_pll_stromer_plus_ops; extern const struct clk_ops clk_alpha_pll_fabia_ops; extern const struct clk_ops clk_alpha_pll_fixed_fabia_ops; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/clk-rcg2.c +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/clk-rcg2.c @@ -158,17 +158,11 @@ static unsigned long calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div) { - if (hid_div) { - rate *= 2; - rate /= hid_div + 1; - } + if (hid_div) + rate = mult_frac(rate, 2, hid_div + 1); - if (mode) { - u64 tmp = rate; - tmp *= m; - do_div(tmp, n); - rate = tmp; - } + if (mode) + rate = mult_frac(rate, m, n); return rate; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/gcc-ipq5332.c +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/gcc-ipq5332.c @@ -70,7 +70,6 @@ &gpll0_main.clkr.hw }, .num_parents = 1, .ops = &clk_fixed_factor_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -84,7 +83,6 @@ &gpll0_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -113,7 +111,6 @@ &gpll2_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -153,7 +150,6 @@ &gpll4_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/gcc-ipq6018.c +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/gcc-ipq6018.c @@ -73,7 +73,6 @@ &gpll0_main.clkr.hw }, .num_parents = 1, .ops = &clk_fixed_factor_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -87,7 +86,6 @@ &gpll0_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -162,7 +160,6 @@ &gpll6_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -193,7 +190,6 @@ &gpll4_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -244,7 +240,6 @@ &gpll2_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -275,7 +270,6 @@ &nss_crypto_pll_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/gcc-ipq8074.c +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/gcc-ipq8074.c @@ -76,7 +76,6 @@ &gpll0_main.clkr.hw }, .num_parents = 1, .ops = &clk_fixed_factor_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -122,7 +121,6 @@ &gpll2_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -155,7 +153,6 @@ &gpll4_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -189,7 +186,6 @@ &gpll6_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -202,7 +198,6 @@ &gpll6_main.clkr.hw }, .num_parents = 1, .ops = &clk_fixed_factor_ops, - .flags = CLK_SET_RATE_PARENT, }, }; @@ -267,7 +262,6 @@ &nss_crypto_pll_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/gcc-ipq9574.c +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/gcc-ipq9574.c @@ -87,7 +87,6 @@ &gpll0_main.clkr.hw }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_fixed_factor_ops, }, }; @@ -102,7 +101,6 @@ &gpll0_main.clkr.hw }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_alpha_pll_postdiv_ro_ops, }, }; @@ -132,7 +130,6 @@ &gpll4_main.clkr.hw }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_alpha_pll_postdiv_ro_ops, }, }; @@ -162,7 +159,6 @@ &gpll2_main.clkr.hw }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_alpha_pll_postdiv_ro_ops, }, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/gcc-msm8996.c +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/gcc-msm8996.c @@ -245,71 +245,6 @@ { .hw = &gpll0_early_div.hw } }; -static const struct freq_tbl ftbl_system_noc_clk_src[] = { - F(19200000, P_XO, 1, 0, 0), - F(50000000, P_GPLL0_EARLY_DIV, 6, 0, 0), - F(100000000, P_GPLL0, 6, 0, 0), - F(150000000, P_GPLL0, 4, 0, 0), - F(200000000, P_GPLL0, 3, 0, 0), - F(240000000, P_GPLL0, 2.5, 0, 0), - { } -}; - -static struct clk_rcg2 system_noc_clk_src = { - .cmd_rcgr = 0x0401c, - .hid_width = 5, - .parent_map = gcc_xo_gpll0_gpll0_early_div_map, - .freq_tbl = ftbl_system_noc_clk_src, - .clkr.hw.init = &(struct clk_init_data){ - .name = "system_noc_clk_src", - .parent_data = gcc_xo_gpll0_gpll0_early_div, - .num_parents = ARRAY_SIZE(gcc_xo_gpll0_gpll0_early_div), - .ops = &clk_rcg2_ops, - }, -}; - -static const struct freq_tbl ftbl_config_noc_clk_src[] = { - F(19200000, P_XO, 1, 0, 0), - F(37500000, P_GPLL0, 16, 0, 0), - F(75000000, P_GPLL0, 8, 0, 0), - { } -}; - -static struct clk_rcg2 config_noc_clk_src = { - .cmd_rcgr = 0x0500c, - .hid_width = 5, - .parent_map = gcc_xo_gpll0_map, - .freq_tbl = ftbl_config_noc_clk_src, - .clkr.hw.init = &(struct clk_init_data){ - .name = "config_noc_clk_src", - .parent_data = gcc_xo_gpll0, - .num_parents = ARRAY_SIZE(gcc_xo_gpll0), - .ops = &clk_rcg2_ops, - }, -}; - -static const struct freq_tbl ftbl_periph_noc_clk_src[] = { - F(19200000, P_XO, 1, 0, 0), - F(37500000, P_GPLL0, 16, 0, 0), - F(50000000, P_GPLL0, 12, 0, 0), - F(75000000, P_GPLL0, 8, 0, 0), - F(100000000, P_GPLL0, 6, 0, 0), - { } -}; - -static struct clk_rcg2 periph_noc_clk_src = { - .cmd_rcgr = 0x06014, - .hid_width = 5, - .parent_map = gcc_xo_gpll0_map, - .freq_tbl = ftbl_periph_noc_clk_src, - .clkr.hw.init = &(struct clk_init_data){ - .name = "periph_noc_clk_src", - .parent_data = gcc_xo_gpll0, - .num_parents = ARRAY_SIZE(gcc_xo_gpll0), - .ops = &clk_rcg2_ops, - }, -}; - static const struct freq_tbl ftbl_usb30_master_clk_src[] = { F(19200000, P_XO, 1, 0, 0), F(120000000, P_GPLL0, 5, 0, 0), @@ -1298,11 +1233,7 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_mmss_noc_cfg_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, + .flags = CLK_IGNORE_UNUSED, .ops = &clk_branch2_ops, }, }, @@ -1465,11 +1396,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb_phy_cfg_ahb2phy_clk", - .parent_hws = (const struct clk_hw*[]){ - &periph_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -1499,11 +1425,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc1_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &periph_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -1550,11 +1471,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc2_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &periph_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -1584,11 +1500,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc3_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &periph_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -1618,11 +1529,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc4_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &periph_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -1636,11 +1542,6 @@ .enable_mask = BIT(17), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &periph_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -1978,11 +1879,6 @@ .enable_mask = BIT(15), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp2_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &periph_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2319,11 +2215,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pdm_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &periph_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2354,11 +2245,6 @@ .enable_mask = BIT(13), .hw.init = &(struct clk_init_data){ .name = "gcc_prng_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2371,11 +2257,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_tsif_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &periph_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2423,11 +2304,6 @@ .enable_mask = BIT(10), .hw.init = &(struct clk_init_data){ .name = "gcc_boot_rom_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2521,11 +2397,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie_0_slv_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2538,11 +2409,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie_0_mstr_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2555,11 +2421,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie_0_cfg_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2607,11 +2468,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie_1_slv_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2624,11 +2480,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie_1_mstr_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2641,11 +2492,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie_1_cfg_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2693,11 +2539,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie_2_slv_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2710,11 +2551,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie_2_mstr_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2727,11 +2563,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie_2_cfg_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2779,11 +2610,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie_phy_cfg_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -2830,11 +2656,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ufs_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -3061,11 +2882,7 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_aggre0_snoc_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, + .flags = CLK_IS_CRITICAL, .ops = &clk_branch2_ops, }, }, @@ -3078,11 +2895,7 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_aggre0_cnoc_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, + .flags = CLK_IS_CRITICAL, .ops = &clk_branch2_ops, }, }, @@ -3095,11 +2908,7 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_smmu_aggre0_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, + .flags = CLK_IS_CRITICAL, .ops = &clk_branch2_ops, }, }, @@ -3112,11 +2921,7 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_smmu_aggre0_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, + .flags = CLK_IS_CRITICAL, .ops = &clk_branch2_ops, }, }, @@ -3163,10 +2968,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_dcc_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, .ops = &clk_branch2_ops, }, }, @@ -3179,10 +2980,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_aggre0_noc_mpu_cfg_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, .ops = &clk_branch2_ops, }, }, @@ -3195,11 +2992,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_qspi_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &periph_noc_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, }, }, @@ -3348,10 +3140,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_mss_cfg_ahb_clk", - .parent_hws = (const struct clk_hw*[]){ - &config_noc_clk_src.clkr.hw, - }, - .num_parents = 1, .ops = &clk_branch2_ops, }, }, @@ -3364,10 +3152,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_mss_mnoc_bimc_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, .ops = &clk_branch2_ops, }, }, @@ -3380,10 +3164,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_mss_snoc_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, .ops = &clk_branch2_ops, }, }, @@ -3396,10 +3176,6 @@ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_mss_q6_bimc_axi_clk", - .parent_hws = (const struct clk_hw*[]){ - &system_noc_clk_src.clkr.hw, - }, - .num_parents = 1, .ops = &clk_branch2_ops, }, }, @@ -3496,9 +3272,6 @@ [GPLL0] = &gpll0.clkr, [GPLL4_EARLY] = &gpll4_early.clkr, [GPLL4] = &gpll4.clkr, - [SYSTEM_NOC_CLK_SRC] = &system_noc_clk_src.clkr, - [CONFIG_NOC_CLK_SRC] = &config_noc_clk_src.clkr, - [PERIPH_NOC_CLK_SRC] = &periph_noc_clk_src.clkr, [USB30_MASTER_CLK_SRC] = &usb30_master_clk_src.clkr, [USB30_MOCK_UTMI_CLK_SRC] = &usb30_mock_utmi_clk_src.clkr, [USB3_PHY_AUX_CLK_SRC] = &usb3_phy_aux_clk_src.clkr, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/gcc-sm8150.c +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/gcc-sm8150.c @@ -775,7 +775,7 @@ .name = "gcc_sdcc2_apps_clk_src", .parent_data = gcc_parents_6, .num_parents = ARRAY_SIZE(gcc_parents_6), - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_OPS_PARENT_ENABLE, .ops = &clk_rcg2_floor_ops, }, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/qcom/mmcc-msm8998.c +++ linux-aws-6.5-6.5.0/drivers/clk/qcom/mmcc-msm8998.c @@ -2453,6 +2453,7 @@ static struct clk_branch mnoc_ahb_clk = { .halt_reg = 0x5024, + .halt_check = BRANCH_HALT_SKIP, .clkr = { .enable_reg = 0x5024, .enable_mask = BIT(0), @@ -2468,6 +2469,7 @@ static struct clk_branch bimc_smmu_ahb_clk = { .halt_reg = 0xe004, + .halt_check = BRANCH_HALT_SKIP, .hwcg_reg = 0xe004, .hwcg_bit = 1, .clkr = { @@ -2485,6 +2487,7 @@ static struct clk_branch bimc_smmu_axi_clk = { .halt_reg = 0xe008, + .halt_check = BRANCH_HALT_SKIP, .hwcg_reg = 0xe008, .hwcg_bit = 1, .clkr = { @@ -2625,11 +2628,13 @@ static struct gdsc bimc_smmu_gdsc = { .gdscr = 0xe020, .gds_hw_ctrl = 0xe024, + .cxcs = (unsigned int []){ 0xe008 }, + .cxc_count = 1, .pd = { .name = "bimc_smmu", }, .pwrsts = PWRSTS_OFF_ON, - .flags = HW_CTRL | ALWAYS_ON, + .flags = VOTABLE, }; static struct clk_regmap *mmcc_msm8998_clocks[] = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/ralink/clk-mtmips.c +++ linux-aws-6.5-6.5.0/drivers/clk/ralink/clk-mtmips.c @@ -822,6 +822,10 @@ static const struct of_device_id mtmips_of_match[] = { { + .compatible = "ralink,rt2880-reset", + .data = NULL, + }, + { .compatible = "ralink,rt2880-sysc", .data = &rt2880_clk_data, }, @@ -1088,25 +1092,11 @@ return 0; } -static const struct of_device_id mtmips_clk_of_match[] = { - { .compatible = "ralink,rt2880-reset" }, - { .compatible = "ralink,rt2880-sysc" }, - { .compatible = "ralink,rt3050-sysc" }, - { .compatible = "ralink,rt3052-sysc" }, - { .compatible = "ralink,rt3352-sysc" }, - { .compatible = "ralink,rt3883-sysc" }, - { .compatible = "ralink,rt5350-sysc" }, - { .compatible = "ralink,mt7620-sysc" }, - { .compatible = "ralink,mt7628-sysc" }, - { .compatible = "ralink,mt7688-sysc" }, - {} -}; - static struct platform_driver mtmips_clk_driver = { .probe = mtmips_clk_probe, .driver = { .name = "mtmips-clk", - .of_match_table = mtmips_clk_of_match, + .of_match_table = mtmips_of_match, }, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/renesas/rcar-cpg-lib.c +++ linux-aws-6.5-6.5.0/drivers/clk/renesas/rcar-cpg-lib.c @@ -70,8 +70,21 @@ #define STPnHCK BIT(9 - SDnSRCFC_SHIFT) static const struct clk_div_table cpg_sdh_div_table[] = { + /* + * These values are recommended by the datasheet. Because they come + * first, Linux will only use these. + */ { 0, 1 }, { 1, 2 }, { STPnHCK | 2, 4 }, { STPnHCK | 3, 8 }, - { STPnHCK | 4, 16 }, { 0, 0 }, + { STPnHCK | 4, 16 }, + /* + * These values are not recommended because STPnHCK is wrong. But they + * have been seen because of broken firmware. So, we support reading + * them but Linux will sanitize them when initializing through + * recalc_rate. + */ + { STPnHCK | 0, 1 }, { STPnHCK | 1, 2 }, { 2, 4 }, { 3, 8 }, { 4, 16 }, + /* Sentinel */ + { 0, 0 } }; struct clk * __init cpg_sdh_clk_register(const char *name, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/renesas/rzg2l-cpg.c +++ linux-aws-6.5-6.5.0/drivers/clk/renesas/rzg2l-cpg.c @@ -11,6 +11,7 @@ * Copyright (C) 2015 Renesas Electronics Corp. */ +#include #include #include #include @@ -39,14 +40,13 @@ #define WARN_DEBUG(x) do { } while (0) #endif -#define DIV_RSMASK(v, s, m) ((v >> s) & m) #define GET_SHIFT(val) ((val >> 12) & 0xff) #define GET_WIDTH(val) ((val >> 8) & 0xf) -#define KDIV(val) DIV_RSMASK(val, 16, 0xffff) -#define MDIV(val) DIV_RSMASK(val, 6, 0x3ff) -#define PDIV(val) DIV_RSMASK(val, 0, 0x3f) -#define SDIV(val) DIV_RSMASK(val, 0, 0x7) +#define KDIV(val) ((s16)FIELD_GET(GENMASK(31, 16), val)) +#define MDIV(val) FIELD_GET(GENMASK(15, 6), val) +#define PDIV(val) FIELD_GET(GENMASK(5, 0), val) +#define SDIV(val) FIELD_GET(GENMASK(2, 0), val) #define CLK_ON_R(reg) (reg) #define CLK_MON_R(reg) (0x180 + (reg)) @@ -195,7 +195,9 @@ u32 off = GET_REG_OFFSET(hwdata->conf); u32 shift = GET_SHIFT(hwdata->conf); const u32 clk_src_266 = 2; - u32 bitmask; + u32 msk, val, bitmask; + unsigned long flags; + int ret; /* * As per the HW manual, we should not directly switch from 533 MHz to @@ -209,26 +211,30 @@ * the index to value mapping is done by adding 1 to the index. */ bitmask = (GENMASK(GET_WIDTH(hwdata->conf) - 1, 0) << shift) << 16; + msk = off ? CPG_CLKSTATUS_SELSDHI1_STS : CPG_CLKSTATUS_SELSDHI0_STS; + spin_lock_irqsave(&priv->rmw_lock, flags); if (index != clk_src_266) { - u32 msk, val; - int ret; - writel(bitmask | ((clk_src_266 + 1) << shift), priv->base + off); - msk = off ? CPG_CLKSTATUS_SELSDHI1_STS : CPG_CLKSTATUS_SELSDHI0_STS; - - ret = readl_poll_timeout(priv->base + CPG_CLKSTATUS, val, - !(val & msk), 100, - CPG_SDHI_CLK_SWITCH_STATUS_TIMEOUT_US); - if (ret) { - dev_err(priv->dev, "failed to switch clk source\n"); - return ret; - } + ret = readl_poll_timeout_atomic(priv->base + CPG_CLKSTATUS, val, + !(val & msk), 10, + CPG_SDHI_CLK_SWITCH_STATUS_TIMEOUT_US); + if (ret) + goto unlock; } writel(bitmask | ((index + 1) << shift), priv->base + off); - return 0; + ret = readl_poll_timeout_atomic(priv->base + CPG_CLKSTATUS, val, + !(val & msk), 10, + CPG_SDHI_CLK_SWITCH_STATUS_TIMEOUT_US); +unlock: + spin_unlock_irqrestore(&priv->rmw_lock, flags); + + if (ret) + dev_err(priv->dev, "failed to switch clk source\n"); + + return ret; } static u8 rzg2l_cpg_sd_clk_mux_get_parent(struct clk_hw *hw) @@ -239,14 +245,8 @@ val >>= GET_SHIFT(hwdata->conf); val &= GENMASK(GET_WIDTH(hwdata->conf) - 1, 0); - if (val) { - val--; - } else { - /* Prohibited clk source, change it to 533 MHz(reset value) */ - rzg2l_cpg_sd_clk_mux_set_parent(hw, 0); - } - return val; + return val ? val - 1 : 0; } static const struct clk_ops rzg2l_cpg_sd_clk_mux_ops = { @@ -702,18 +702,18 @@ struct pll_clk *pll_clk = to_pll(hw); struct rzg2l_cpg_priv *priv = pll_clk->priv; unsigned int val1, val2; - unsigned int mult = 1; - unsigned int div = 1; + u64 rate; if (pll_clk->type != CLK_TYPE_SAM_PLL) return parent_rate; val1 = readl(priv->base + GET_REG_SAMPLL_CLK1(pll_clk->conf)); val2 = readl(priv->base + GET_REG_SAMPLL_CLK2(pll_clk->conf)); - mult = MDIV(val1) + KDIV(val1) / 65536; - div = PDIV(val1) << SDIV(val2); - return DIV_ROUND_CLOSEST_ULL((u64)parent_rate * mult, div); + rate = mul_u64_u32_shr(parent_rate, (MDIV(val1) << 16) + KDIV(val1), + 16 + SDIV(val2)); + + return DIV_ROUND_CLOSEST_ULL(rate, PDIV(val1)); } static const struct clk_ops rzg2l_cpg_pll_ops = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/renesas/rzg2l-cpg.h +++ linux-aws-6.5-6.5.0/drivers/clk/renesas/rzg2l-cpg.h @@ -43,7 +43,7 @@ #define CPG_CLKSTATUS_SELSDHI0_STS BIT(28) #define CPG_CLKSTATUS_SELSDHI1_STS BIT(29) -#define CPG_SDHI_CLK_SWITCH_STATUS_TIMEOUT_US 20000 +#define CPG_SDHI_CLK_SWITCH_STATUS_TIMEOUT_US 200 /* n = 0/1/2 for PLL1/4/6 */ #define CPG_SAMPLL_CLK1(n) (0x04 + (16 * n)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/socfpga/clk-gate.c +++ linux-aws-6.5-6.5.0/drivers/clk/socfpga/clk-gate.c @@ -87,10 +87,8 @@ return 0; } -static unsigned long socfpga_clk_recalc_rate(struct clk_hw *hwclk, - unsigned long parent_rate) +static u32 socfpga_clk_get_div(struct socfpga_gate_clk *socfpgaclk) { - struct socfpga_gate_clk *socfpgaclk = to_socfpga_gate_clk(hwclk); u32 div = 1, val; if (socfpgaclk->fixed_div) @@ -105,12 +103,33 @@ div = (1 << val); } + return div; +} + +static unsigned long socfpga_clk_recalc_rate(struct clk_hw *hwclk, + unsigned long parent_rate) +{ + struct socfpga_gate_clk *socfpgaclk = to_socfpga_gate_clk(hwclk); + u32 div = socfpga_clk_get_div(socfpgaclk); + return parent_rate / div; } + +static int socfpga_clk_determine_rate(struct clk_hw *hwclk, + struct clk_rate_request *req) +{ + struct socfpga_gate_clk *socfpgaclk = to_socfpga_gate_clk(hwclk); + u32 div = socfpga_clk_get_div(socfpgaclk); + + req->rate = req->best_parent_rate / div; + + return 0; +} + static struct clk_ops gateclk_ops = { .recalc_rate = socfpga_clk_recalc_rate, - .determine_rate = clk_hw_determine_rate_no_reparent, + .determine_rate = socfpga_clk_determine_rate, .get_parent = socfpga_clk_get_parent, .set_parent = socfpga_clk_set_parent, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/socfpga/stratix10-clk.h +++ linux-aws-6.5-6.5.0/drivers/clk/socfpga/stratix10-clk.h @@ -7,8 +7,10 @@ #define __STRATIX10_CLK_H struct stratix10_clock_data { - struct clk_hw_onecell_data clk_data; void __iomem *base; + + /* Must be last */ + struct clk_hw_onecell_data clk_data; }; struct stratix10_pll_clock { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/stm32/clk-stm32-core.c +++ linux-aws-6.5-6.5.0/drivers/clk/stm32/clk-stm32-core.c @@ -431,7 +431,7 @@ { struct clk_stm32_composite *composite = to_clk_stm32_composite(hw); const struct stm32_div_cfg *divider; - unsigned long rate; + long rate; if (composite->div_id == NO_STM32_DIV) return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/ti/clk-44xx.c +++ linux-aws-6.5-6.5.0/drivers/clk/ti/clk-44xx.c @@ -749,9 +749,14 @@ DT_CLK(NULL, "mcbsp1_sync_mux_ck", "abe-clkctrl:0028:26"), DT_CLK(NULL, "mcbsp2_sync_mux_ck", "abe-clkctrl:0030:26"), DT_CLK(NULL, "mcbsp3_sync_mux_ck", "abe-clkctrl:0038:26"), + DT_CLK("40122000.mcbsp", "prcm_fck", "abe-clkctrl:0028:26"), + DT_CLK("40124000.mcbsp", "prcm_fck", "abe-clkctrl:0030:26"), + DT_CLK("40126000.mcbsp", "prcm_fck", "abe-clkctrl:0038:26"), DT_CLK(NULL, "mcbsp4_sync_mux_ck", "l4-per-clkctrl:00c0:26"), + DT_CLK("48096000.mcbsp", "prcm_fck", "l4-per-clkctrl:00c0:26"), DT_CLK(NULL, "ocp2scp_usb_phy_phy_48m", "l3-init-clkctrl:00c0:8"), DT_CLK(NULL, "otg_60m_gfclk", "l3-init-clkctrl:0040:24"), + DT_CLK(NULL, "pad_fck", "pad_clks_ck"), DT_CLK(NULL, "per_mcbsp4_gfclk", "l4-per-clkctrl:00c0:24"), DT_CLK(NULL, "pmd_stm_clock_mux_ck", "emu-sys-clkctrl:0000:20"), DT_CLK(NULL, "pmd_trace_clk_mux_ck", "emu-sys-clkctrl:0000:22"), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/ti/clk-54xx.c +++ linux-aws-6.5-6.5.0/drivers/clk/ti/clk-54xx.c @@ -565,15 +565,19 @@ DT_CLK(NULL, "gpio8_dbclk", "l4per-clkctrl:00f8:8"), DT_CLK(NULL, "mcbsp1_gfclk", "abe-clkctrl:0028:24"), DT_CLK(NULL, "mcbsp1_sync_mux_ck", "abe-clkctrl:0028:26"), + DT_CLK("40122000.mcbsp", "prcm_fck", "abe-clkctrl:0028:26"), DT_CLK(NULL, "mcbsp2_gfclk", "abe-clkctrl:0030:24"), DT_CLK(NULL, "mcbsp2_sync_mux_ck", "abe-clkctrl:0030:26"), + DT_CLK("40124000.mcbsp", "prcm_fck", "abe-clkctrl:0030:26"), DT_CLK(NULL, "mcbsp3_gfclk", "abe-clkctrl:0038:24"), DT_CLK(NULL, "mcbsp3_sync_mux_ck", "abe-clkctrl:0038:26"), + DT_CLK("40126000.mcbsp", "prcm_fck", "abe-clkctrl:0038:26"), DT_CLK(NULL, "mmc1_32khz_clk", "l3init-clkctrl:0008:8"), DT_CLK(NULL, "mmc1_fclk", "l3init-clkctrl:0008:25"), DT_CLK(NULL, "mmc1_fclk_mux", "l3init-clkctrl:0008:24"), DT_CLK(NULL, "mmc2_fclk", "l3init-clkctrl:0010:25"), DT_CLK(NULL, "mmc2_fclk_mux", "l3init-clkctrl:0010:24"), + DT_CLK(NULL, "pad_fck", "pad_clks_ck"), DT_CLK(NULL, "sata_ref_clk", "l3init-clkctrl:0068:8"), DT_CLK(NULL, "timer10_gfclk_mux", "l4per-clkctrl:0008:24"), DT_CLK(NULL, "timer11_gfclk_mux", "l4per-clkctrl:0010:24"), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/ti/divider.c +++ linux-aws-6.5-6.5.0/drivers/clk/ti/divider.c @@ -309,7 +309,6 @@ u32 flags, struct clk_omap_divider *div) { - struct clk *clk; struct clk_init_data init; const char *parent_name; const char *name; @@ -326,12 +325,7 @@ div->hw.init = &init; /* register the clock */ - clk = of_ti_clk_register(node, &div->hw, name); - - if (IS_ERR(clk)) - kfree(div); - - return clk; + return of_ti_clk_register(node, &div->hw, name); } int ti_clk_parse_divider_data(int *div_table, int num_dividers, int max_div, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clk/visconti/pll.h +++ linux-aws-6.5-6.5.0/drivers/clk/visconti/pll.h @@ -15,8 +15,10 @@ struct visconti_pll_provider { void __iomem *reg_base; - struct clk_hw_onecell_data clk_data; struct device_node *node; + + /* Must be last */ + struct clk_hw_onecell_data clk_data; }; #define VISCONTI_PLL_RATE(_rate, _dacen, _dsmen, \ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clocksource/timer-atmel-tcb.c +++ linux-aws-6.5-6.5.0/drivers/clocksource/timer-atmel-tcb.c @@ -315,6 +315,7 @@ writel(mck_divisor_idx /* likely divide-by-8 */ | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP /* free-run */ + | ATMEL_TC_ASWTRG_SET /* TIOA0 rises at software trigger */ | ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */ | ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */ tcaddr + ATMEL_TC_REG(0, CMR)); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clocksource/timer-imx-gpt.c +++ linux-aws-6.5-6.5.0/drivers/clocksource/timer-imx-gpt.c @@ -434,12 +434,16 @@ return -ENOMEM; imxtm->base = of_iomap(np, 0); - if (!imxtm->base) - return -ENXIO; + if (!imxtm->base) { + ret = -ENXIO; + goto err_kfree; + } imxtm->irq = irq_of_parse_and_map(np, 0); - if (imxtm->irq <= 0) - return -EINVAL; + if (imxtm->irq <= 0) { + ret = -EINVAL; + goto err_kfree; + } imxtm->clk_ipg = of_clk_get_by_name(np, "ipg"); @@ -452,11 +456,15 @@ ret = _mxc_timer_init(imxtm); if (ret) - return ret; + goto err_kfree; initialized = 1; return 0; + +err_kfree: + kfree(imxtm); + return ret; } static int __init imx1_timer_init_dt(struct device_node *np) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/clocksource/timer-ti-dm.c +++ linux-aws-6.5-6.5.0/drivers/clocksource/timer-ti-dm.c @@ -141,6 +141,8 @@ struct platform_device *pdev; struct list_head node; struct notifier_block nb; + struct notifier_block fclk_nb; + unsigned long fclk_rate; }; static u32 omap_reserved_systimers; @@ -254,8 +256,7 @@ timer->posted = OMAP_TIMER_POSTED; } -static inline void __omap_dm_timer_stop(struct dmtimer *timer, - unsigned long rate) +static inline void __omap_dm_timer_stop(struct dmtimer *timer) { u32 l; @@ -270,7 +271,7 @@ * Wait for functional clock period x 3.5 to make sure that * timer is stopped */ - udelay(3500000 / rate + 1); + udelay(3500000 / timer->fclk_rate + 1); #endif } @@ -349,6 +350,21 @@ return NOTIFY_OK; } +static int omap_timer_fclk_notifier(struct notifier_block *nb, + unsigned long event, void *data) +{ + struct clk_notifier_data *clk_data = data; + struct dmtimer *timer = container_of(nb, struct dmtimer, fclk_nb); + + switch (event) { + case POST_RATE_CHANGE: + timer->fclk_rate = clk_data->new_rate; + return NOTIFY_OK; + default: + return NOTIFY_DONE; + } +} + static int omap_dm_timer_reset(struct dmtimer *timer) { u32 l, timeout = 100000; @@ -755,7 +771,6 @@ { struct dmtimer *timer; struct device *dev; - unsigned long rate = 0; timer = to_dmtimer(cookie); if (unlikely(!timer)) @@ -763,10 +778,7 @@ dev = &timer->pdev->dev; - if (!timer->omap1) - rate = clk_get_rate(timer->fclk); - - __omap_dm_timer_stop(timer, rate); + __omap_dm_timer_stop(timer); pm_runtime_put_sync(dev); @@ -1125,6 +1137,14 @@ timer->fclk = devm_clk_get(dev, "fck"); if (IS_ERR(timer->fclk)) return PTR_ERR(timer->fclk); + + timer->fclk_nb.notifier_call = omap_timer_fclk_notifier; + ret = devm_clk_notifier_register(dev, timer->fclk, + &timer->fclk_nb); + if (ret) + return ret; + + timer->fclk_rate = clk_get_rate(timer->fclk); } else { timer->fclk = ERR_PTR(-ENODEV); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/cpufreq/amd-pstate.c +++ linux-aws-6.5-6.5.0/drivers/cpufreq/amd-pstate.c @@ -307,11 +307,11 @@ highest_perf = AMD_CPPC_HIGHEST_PERF(cap1); WRITE_ONCE(cpudata->highest_perf, highest_perf); - + WRITE_ONCE(cpudata->max_limit_perf, highest_perf); WRITE_ONCE(cpudata->nominal_perf, AMD_CPPC_NOMINAL_PERF(cap1)); WRITE_ONCE(cpudata->lowest_nonlinear_perf, AMD_CPPC_LOWNONLIN_PERF(cap1)); WRITE_ONCE(cpudata->lowest_perf, AMD_CPPC_LOWEST_PERF(cap1)); - + WRITE_ONCE(cpudata->min_limit_perf, AMD_CPPC_LOWEST_PERF(cap1)); return 0; } @@ -329,11 +329,12 @@ highest_perf = cppc_perf.highest_perf; WRITE_ONCE(cpudata->highest_perf, highest_perf); - + WRITE_ONCE(cpudata->max_limit_perf, highest_perf); WRITE_ONCE(cpudata->nominal_perf, cppc_perf.nominal_perf); WRITE_ONCE(cpudata->lowest_nonlinear_perf, cppc_perf.lowest_nonlinear_perf); WRITE_ONCE(cpudata->lowest_perf, cppc_perf.lowest_perf); + WRITE_ONCE(cpudata->min_limit_perf, cppc_perf.lowest_perf); if (cppc_state == AMD_PSTATE_ACTIVE) return 0; @@ -432,6 +433,10 @@ u64 prev = READ_ONCE(cpudata->cppc_req_cached); u64 value = prev; + min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf, + cpudata->max_limit_perf); + max_perf = clamp_t(unsigned long, max_perf, cpudata->min_limit_perf, + cpudata->max_limit_perf); des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf); if ((cppc_state == AMD_PSTATE_GUIDED) && (gov_flags & CPUFREQ_GOV_DYNAMIC_SWITCHING)) { @@ -470,6 +475,22 @@ return 0; } +static int amd_pstate_update_min_max_limit(struct cpufreq_policy *policy) +{ + u32 max_limit_perf, min_limit_perf; + struct amd_cpudata *cpudata = policy->driver_data; + + max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq); + min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq); + + WRITE_ONCE(cpudata->max_limit_perf, max_limit_perf); + WRITE_ONCE(cpudata->min_limit_perf, min_limit_perf); + WRITE_ONCE(cpudata->max_limit_freq, policy->max); + WRITE_ONCE(cpudata->min_limit_freq, policy->min); + + return 0; +} + static int amd_pstate_update_freq(struct cpufreq_policy *policy, unsigned int target_freq, bool fast_switch) { @@ -480,6 +501,9 @@ if (!cpudata->max_freq) return -ENODEV; + if (policy->min != cpudata->min_limit_freq || policy->max != cpudata->max_limit_freq) + amd_pstate_update_min_max_limit(policy); + cap_perf = READ_ONCE(cpudata->highest_perf); min_perf = READ_ONCE(cpudata->lowest_perf); max_perf = cap_perf; @@ -518,7 +542,9 @@ static unsigned int amd_pstate_fast_switch(struct cpufreq_policy *policy, unsigned int target_freq) { - return amd_pstate_update_freq(policy, target_freq, true); + if (!amd_pstate_update_freq(policy, target_freq, true)) + return target_freq; + return policy->cur; } static void amd_pstate_adjust_perf(unsigned int cpu, @@ -532,6 +558,10 @@ struct amd_cpudata *cpudata = policy->driver_data; unsigned int target_freq; + if (policy->min != cpudata->min_limit_freq || policy->max != cpudata->max_limit_freq) + amd_pstate_update_min_max_limit(policy); + + cap_perf = READ_ONCE(cpudata->highest_perf); lowest_nonlinear_perf = READ_ONCE(cpudata->lowest_nonlinear_perf); max_freq = READ_ONCE(cpudata->max_freq); @@ -745,6 +775,8 @@ /* Initial processor data capability frequencies */ cpudata->max_freq = max_freq; cpudata->min_freq = min_freq; + cpudata->max_limit_freq = max_freq; + cpudata->min_limit_freq = min_freq; cpudata->nominal_freq = nominal_freq; cpudata->lowest_nonlinear_freq = lowest_nonlinear_freq; @@ -850,11 +882,16 @@ { int i = 0; int offset = 0; + struct amd_cpudata *cpudata = policy->driver_data; + + if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) + return sysfs_emit_at(buf, offset, "%s\n", + energy_perf_strings[EPP_INDEX_PERFORMANCE]); while (energy_perf_strings[i] != NULL) offset += sysfs_emit_at(buf, offset, "%s ", energy_perf_strings[i++]); - sysfs_emit_at(buf, offset, "\n"); + offset += sysfs_emit_at(buf, offset, "\n"); return offset; } @@ -1183,16 +1220,25 @@ return 0; } -static void amd_pstate_epp_init(unsigned int cpu) +static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy) { - struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); struct amd_cpudata *cpudata = policy->driver_data; - u32 max_perf, min_perf; + u32 max_perf, min_perf, min_limit_perf, max_limit_perf; u64 value; s16 epp; max_perf = READ_ONCE(cpudata->highest_perf); min_perf = READ_ONCE(cpudata->lowest_perf); + max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq); + min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq); + + max_perf = clamp_t(unsigned long, max_perf, cpudata->min_limit_perf, + cpudata->max_limit_perf); + min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf, + cpudata->max_limit_perf); + + WRITE_ONCE(cpudata->max_limit_perf, max_limit_perf); + WRITE_ONCE(cpudata->min_limit_perf, min_limit_perf); value = READ_ONCE(cpudata->cppc_req_cached); @@ -1210,9 +1256,6 @@ value &= ~AMD_CPPC_DES_PERF(~0L); value |= AMD_CPPC_DES_PERF(0); - if (cpudata->epp_policy == cpudata->policy) - goto skip_epp; - cpudata->epp_policy = cpudata->policy; /* Get BIOS pre-defined epp value */ @@ -1222,7 +1265,7 @@ * This return value can only be negative for shared_memory * systems where EPP register read/write not supported. */ - goto skip_epp; + return; } if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) @@ -1236,8 +1279,6 @@ WRITE_ONCE(cpudata->cppc_req_cached, value); amd_pstate_set_epp(cpudata, epp); -skip_epp: - cpufreq_cpu_put(policy); } static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy) @@ -1252,7 +1293,7 @@ cpudata->policy = policy->policy; - amd_pstate_epp_init(policy->cpu); + amd_pstate_epp_update_limit(policy); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/cpufreq/cpufreq_stats.c +++ linux-aws-6.5-6.5.0/drivers/cpufreq/cpufreq_stats.c @@ -131,23 +131,23 @@ len += sysfs_emit_at(buf, len, " From : To\n"); len += sysfs_emit_at(buf, len, " : "); for (i = 0; i < stats->state_num; i++) { - if (len >= PAGE_SIZE) + if (len >= PAGE_SIZE - 1) break; len += sysfs_emit_at(buf, len, "%9u ", stats->freq_table[i]); } - if (len >= PAGE_SIZE) - return PAGE_SIZE; + if (len >= PAGE_SIZE - 1) + return PAGE_SIZE - 1; len += sysfs_emit_at(buf, len, "\n"); for (i = 0; i < stats->state_num; i++) { - if (len >= PAGE_SIZE) + if (len >= PAGE_SIZE - 1) break; len += sysfs_emit_at(buf, len, "%9u: ", stats->freq_table[i]); for (j = 0; j < stats->state_num; j++) { - if (len >= PAGE_SIZE) + if (len >= PAGE_SIZE - 1) break; if (pending) @@ -157,12 +157,12 @@ len += sysfs_emit_at(buf, len, "%9u ", count); } - if (len >= PAGE_SIZE) + if (len >= PAGE_SIZE - 1) break; len += sysfs_emit_at(buf, len, "\n"); } - if (len >= PAGE_SIZE) { + if (len >= PAGE_SIZE - 1) { pr_warn_once("cpufreq transition table exceeds PAGE_SIZE. Disabling\n"); return -EFBIG; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/cpufreq/imx6q-cpufreq.c +++ linux-aws-6.5-6.5.0/drivers/cpufreq/imx6q-cpufreq.c @@ -327,7 +327,7 @@ imx6x_disable_freq_in_opp(dev, 696000000); if (of_machine_is_compatible("fsl,imx6ull")) { - if (val != OCOTP_CFG3_6ULL_SPEED_792MHZ) + if (val < OCOTP_CFG3_6ULL_SPEED_792MHZ) imx6x_disable_freq_in_opp(dev, 792000000); if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/caam/caamalg.c +++ linux-aws-6.5-6.5.0/drivers/crypto/caam/caamalg.c @@ -572,7 +572,8 @@ if (keylen != CHACHA_KEY_SIZE + saltlen) return -EINVAL; - ctx->cdata.key_virt = key; + memcpy(ctx->key, key, keylen); + ctx->cdata.key_virt = ctx->key; ctx->cdata.keylen = keylen - saltlen; return chachapoly_set_sh_desc(aead); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/caam/caamalg_qi2.c +++ linux-aws-6.5-6.5.0/drivers/crypto/caam/caamalg_qi2.c @@ -641,7 +641,8 @@ if (keylen != CHACHA_KEY_SIZE + saltlen) return -EINVAL; - ctx->cdata.key_virt = key; + memcpy(ctx->key, key, keylen); + ctx->cdata.key_virt = ctx->key; ctx->cdata.keylen = keylen - saltlen; return chachapoly_set_sh_desc(aead); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/hisilicon/hpre/hpre_main.c +++ linux-aws-6.5-6.5.0/drivers/crypto/hisilicon/hpre/hpre_main.c @@ -430,8 +430,11 @@ module_param_cb(uacce_mode, &hpre_uacce_mode_ops, &uacce_mode, 0444); MODULE_PARM_DESC(uacce_mode, UACCE_MODE_DESC); +static bool pf_q_num_flag; static int pf_q_num_set(const char *val, const struct kernel_param *kp) { + pf_q_num_flag = true; + return q_num_set(val, kp, PCI_DEVICE_ID_HUAWEI_HPRE_PF); } @@ -1030,7 +1033,7 @@ for (i = 0; i < clusters_num; i++) { ret = snprintf(buf, HPRE_DBGFS_VAL_MAX_LEN, "cluster%d", i); - if (ret < 0) + if (ret >= HPRE_DBGFS_VAL_MAX_LEN) return -EINVAL; tmp_d = debugfs_create_dir(buf, qm->debug.debug_root); @@ -1154,6 +1157,8 @@ qm->qp_num = pf_q_num; qm->debug.curr_qm_qp_num = pf_q_num; qm->qm_list = &hpre_devices; + if (pf_q_num_flag) + set_bit(QM_MODULE_PARAM, &qm->misc_ctl); } ret = hisi_qm_init(qm); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/hisilicon/qm.c +++ linux-aws-6.5-6.5.0/drivers/crypto/hisilicon/qm.c @@ -204,8 +204,6 @@ #define WAIT_PERIOD 20 #define REMOVE_WAIT_DELAY 10 -#define QM_DRIVER_REMOVING 0 -#define QM_RST_SCHED 1 #define QM_QOS_PARAM_NUM 2 #define QM_QOS_MAX_VAL 1000 #define QM_QOS_RATE 100 @@ -847,6 +845,8 @@ qm_db(qm, qp->qp_id, QM_DOORBELL_CMD_CQ, qp->qp_status.cq_head, 0); atomic_dec(&qp->qp_status.used); + + cond_resched(); } /* set c_flag */ @@ -2814,7 +2814,6 @@ mutex_init(&qm->mailbox_lock); init_rwsem(&qm->qps_lock); qm->qp_in_used = 0; - qm->misc_ctl = false; if (test_bit(QM_SUPPORT_RPM, &qm->caps)) { if (!acpi_device_power_manageable(ACPI_COMPANION(&pdev->dev))) dev_info(&pdev->dev, "_PS0 and _PR0 are not defined"); @@ -5081,6 +5080,7 @@ static int qm_get_qp_num(struct hisi_qm *qm) { + struct device *dev = &qm->pdev->dev; bool is_db_isolation; /* VF's qp_num assigned by PF in v2, and VF can get qp_num by vft. */ @@ -5097,13 +5097,21 @@ qm->max_qp_num = hisi_qm_get_hw_info(qm, qm_basic_info, QM_FUNC_MAX_QP_CAP, is_db_isolation); - /* check if qp number is valid */ - if (qm->qp_num > qm->max_qp_num) { - dev_err(&qm->pdev->dev, "qp num(%u) is more than max qp num(%u)!\n", + if (qm->qp_num <= qm->max_qp_num) + return 0; + + if (test_bit(QM_MODULE_PARAM, &qm->misc_ctl)) { + /* Check whether the set qp number is valid */ + dev_err(dev, "qp num(%u) is more than max qp num(%u)!\n", qm->qp_num, qm->max_qp_num); return -EINVAL; } + dev_info(dev, "Default qp num(%u) is too big, reset it to Function's max qp num(%u)!\n", + qm->qp_num, qm->max_qp_num); + qm->qp_num = qm->max_qp_num; + qm->debug.curr_qm_qp_num = qm->qp_num; + return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/hisilicon/qm_common.h +++ linux-aws-6.5-6.5.0/drivers/crypto/hisilicon/qm_common.h @@ -4,7 +4,6 @@ #define QM_COMMON_H #define QM_DBG_READ_LEN 256 -#define QM_RESETTING 2 struct qm_cqe { __le32 rsvd0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/hisilicon/sec2/sec_main.c +++ linux-aws-6.5-6.5.0/drivers/crypto/hisilicon/sec2/sec_main.c @@ -311,8 +311,11 @@ } DEFINE_SHOW_ATTRIBUTE(sec_diff_regs); +static bool pf_q_num_flag; static int sec_pf_q_num_set(const char *val, const struct kernel_param *kp) { + pf_q_num_flag = true; + return q_num_set(val, kp, PCI_DEVICE_ID_HUAWEI_SEC_PF); } @@ -1120,6 +1123,8 @@ qm->qp_num = pf_q_num; qm->debug.curr_qm_qp_num = pf_q_num; qm->qm_list = &sec_devices; + if (pf_q_num_flag) + set_bit(QM_MODULE_PARAM, &qm->misc_ctl); } else if (qm->fun_type == QM_HW_VF && qm->ver == QM_HW_V1) { /* * have no way to get qm configure in VM in v1 hardware, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/hisilicon/zip/zip_main.c +++ linux-aws-6.5-6.5.0/drivers/crypto/hisilicon/zip/zip_main.c @@ -364,8 +364,11 @@ module_param_cb(uacce_mode, &zip_uacce_mode_ops, &uacce_mode, 0444); MODULE_PARM_DESC(uacce_mode, UACCE_MODE_DESC); +static bool pf_q_num_flag; static int pf_q_num_set(const char *val, const struct kernel_param *kp) { + pf_q_num_flag = true; + return q_num_set(val, kp, PCI_DEVICE_ID_HUAWEI_ZIP_PF); } @@ -1139,6 +1142,8 @@ qm->qp_num = pf_q_num; qm->debug.curr_qm_qp_num = pf_q_num; qm->qm_list = &zip_devices; + if (pf_q_num_flag) + set_bit(QM_MODULE_PARAM, &qm->misc_ctl); } else if (qm->fun_type == QM_HW_VF && qm->ver == QM_HW_V1) { /* * have no way to get qm configure in VM in v1 hardware, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h +++ linux-aws-6.5-6.5.0/drivers/crypto/intel/qat/qat_common/adf_accel_devices.h @@ -29,7 +29,7 @@ #define ADF_PCI_MAX_BARS 3 #define ADF_DEVICE_NAME_LENGTH 32 #define ADF_ETR_MAX_RINGS_PER_BANK 16 -#define ADF_MAX_MSIX_VECTOR_NAME 16 +#define ADF_MAX_MSIX_VECTOR_NAME 48 #define ADF_DEVICE_NAME_PREFIX "qat_" enum adf_accel_capabilities { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/intel/qat/qat_common/adf_common_drv.h +++ linux-aws-6.5-6.5.0/drivers/crypto/intel/qat/qat_common/adf_common_drv.h @@ -25,6 +25,8 @@ #define ADF_STATUS_AE_STARTED 6 #define ADF_STATUS_PF_RUNNING 7 #define ADF_STATUS_IRQ_ALLOCATED 8 +#define ADF_STATUS_CRYPTO_ALGS_REGISTERED 9 +#define ADF_STATUS_COMP_ALGS_REGISTERED 10 enum adf_dev_reset_mode { ADF_DEV_RESET_ASYNC = 0, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/intel/qat/qat_common/adf_init.c +++ linux-aws-6.5-6.5.0/drivers/crypto/intel/qat/qat_common/adf_init.c @@ -209,6 +209,7 @@ clear_bit(ADF_STATUS_STARTED, &accel_dev->status); return -EFAULT; } + set_bit(ADF_STATUS_CRYPTO_ALGS_REGISTERED, &accel_dev->status); if (!list_empty(&accel_dev->compression_list) && qat_comp_algs_register()) { dev_err(&GET_DEV(accel_dev), @@ -217,6 +218,7 @@ clear_bit(ADF_STATUS_STARTED, &accel_dev->status); return -EFAULT; } + set_bit(ADF_STATUS_COMP_ALGS_REGISTERED, &accel_dev->status); adf_dbgfs_add(accel_dev); @@ -249,13 +251,17 @@ clear_bit(ADF_STATUS_STARTING, &accel_dev->status); clear_bit(ADF_STATUS_STARTED, &accel_dev->status); - if (!list_empty(&accel_dev->crypto_list)) { + if (!list_empty(&accel_dev->crypto_list) && + test_bit(ADF_STATUS_CRYPTO_ALGS_REGISTERED, &accel_dev->status)) { qat_algs_unregister(); qat_asym_algs_unregister(); } + clear_bit(ADF_STATUS_CRYPTO_ALGS_REGISTERED, &accel_dev->status); - if (!list_empty(&accel_dev->compression_list)) + if (!list_empty(&accel_dev->compression_list) && + test_bit(ADF_STATUS_COMP_ALGS_REGISTERED, &accel_dev->status)) qat_comp_algs_unregister(); + clear_bit(ADF_STATUS_COMP_ALGS_REGISTERED, &accel_dev->status); list_for_each(list_itr, &service_table) { service = list_entry(list_itr, struct service_hndl, list); @@ -412,13 +418,6 @@ mutex_lock(&accel_dev->state_lock); - if (!adf_dev_started(accel_dev)) { - dev_info(&GET_DEV(accel_dev), "Device qat_dev%d already down\n", - accel_dev->accel_id); - ret = -EINVAL; - goto out; - } - if (reconfig) { ret = adf_dev_shutdown_cache_cfg(accel_dev); goto out; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/intel/qat/qat_common/adf_sysfs.c +++ linux-aws-6.5-6.5.0/drivers/crypto/intel/qat/qat_common/adf_sysfs.c @@ -52,6 +52,13 @@ case DEV_DOWN: dev_info(dev, "Stopping device qat_dev%d\n", accel_id); + if (!adf_dev_started(accel_dev)) { + dev_info(&GET_DEV(accel_dev), "Device qat_dev%d already down\n", + accel_id); + + break; + } + ret = adf_dev_down(accel_dev, true); if (ret < 0) return -EINVAL; @@ -61,7 +68,9 @@ dev_info(dev, "Starting device qat_dev%d\n", accel_id); ret = adf_dev_up(accel_dev, true); - if (ret < 0) { + if (ret == -EALREADY) { + break; + } else if (ret) { dev_err(dev, "Failed to start device qat_dev%d\n", accel_id); adf_dev_down(accel_dev, true); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/intel/qat/qat_common/adf_transport_debug.c +++ linux-aws-6.5-6.5.0/drivers/crypto/intel/qat/qat_common/adf_transport_debug.c @@ -90,7 +90,7 @@ int adf_ring_debugfs_add(struct adf_etr_ring_data *ring, const char *name) { struct adf_etr_ring_debug_entry *ring_debug; - char entry_name[8]; + char entry_name[16]; ring_debug = kzalloc(sizeof(*ring_debug), GFP_KERNEL); if (!ring_debug) @@ -192,7 +192,7 @@ { struct adf_accel_dev *accel_dev = bank->accel_dev; struct dentry *parent = accel_dev->transport->debug; - char name[8]; + char name[16]; snprintf(name, sizeof(name), "bank_%02d", bank->bank_number); bank->bank_debug_dir = debugfs_create_dir(name, parent); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/intel/qat/qat_common/qat_algs_send.c +++ linux-aws-6.5-6.5.0/drivers/crypto/intel/qat/qat_common/qat_algs_send.c @@ -40,40 +40,44 @@ spin_unlock_bh(&backlog->lock); } -static void qat_alg_backlog_req(struct qat_alg_req *req, - struct qat_instance_backlog *backlog) -{ - INIT_LIST_HEAD(&req->list); - - spin_lock_bh(&backlog->lock); - list_add_tail(&req->list, &backlog->list); - spin_unlock_bh(&backlog->lock); -} - -static int qat_alg_send_message_maybacklog(struct qat_alg_req *req) +static bool qat_alg_try_enqueue(struct qat_alg_req *req) { struct qat_instance_backlog *backlog = req->backlog; struct adf_etr_ring_data *tx_ring = req->tx_ring; u32 *fw_req = req->fw_req; - /* If any request is already backlogged, then add to backlog list */ + /* Check if any request is already backlogged */ if (!list_empty(&backlog->list)) - goto enqueue; + return false; - /* If ring is nearly full, then add to backlog list */ + /* Check if ring is nearly full */ if (adf_ring_nearly_full(tx_ring)) - goto enqueue; + return false; - /* If adding request to HW ring fails, then add to backlog list */ + /* Try to enqueue to HW ring */ if (adf_send_message(tx_ring, fw_req)) - goto enqueue; + return false; + + return true; +} + + +static int qat_alg_send_message_maybacklog(struct qat_alg_req *req) +{ + struct qat_instance_backlog *backlog = req->backlog; + int ret = -EINPROGRESS; - return -EINPROGRESS; + if (qat_alg_try_enqueue(req)) + return ret; -enqueue: - qat_alg_backlog_req(req, backlog); + spin_lock_bh(&backlog->lock); + if (!qat_alg_try_enqueue(req)) { + list_add_tail(&req->list, &backlog->list); + ret = -EBUSY; + } + spin_unlock_bh(&backlog->lock); - return -EBUSY; + return ret; } int qat_alg_send_message(struct qat_alg_req *req) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/virtio/virtio_crypto_common.h +++ linux-aws-6.5-6.5.0/drivers/crypto/virtio/virtio_crypto_common.h @@ -35,6 +35,9 @@ struct virtqueue *ctrl_vq; struct data_queue *data_vq; + /* Work struct for config space updates */ + struct work_struct config_work; + /* To protect the vq operations for the controlq */ spinlock_t ctrl_lock; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/crypto/virtio/virtio_crypto_core.c +++ linux-aws-6.5-6.5.0/drivers/crypto/virtio/virtio_crypto_core.c @@ -335,6 +335,14 @@ virtcrypto_free_queues(vcrypto); } +static void vcrypto_config_changed_work(struct work_struct *work) +{ + struct virtio_crypto *vcrypto = + container_of(work, struct virtio_crypto, config_work); + + virtcrypto_update_status(vcrypto); +} + static int virtcrypto_probe(struct virtio_device *vdev) { int err = -EFAULT; @@ -454,6 +462,8 @@ if (err) goto free_engines; + INIT_WORK(&vcrypto->config_work, vcrypto_config_changed_work); + return 0; free_engines: @@ -490,6 +500,7 @@ dev_info(&vdev->dev, "Start virtcrypto_remove.\n"); + flush_work(&vcrypto->config_work); if (virtcrypto_dev_started(vcrypto)) virtcrypto_dev_stop(vcrypto); virtio_reset_device(vdev); @@ -504,7 +515,7 @@ { struct virtio_crypto *vcrypto = vdev->priv; - virtcrypto_update_status(vcrypto); + schedule_work(&vcrypto->config_work); } #ifdef CONFIG_PM_SLEEP @@ -512,6 +523,7 @@ { struct virtio_crypto *vcrypto = vdev->priv; + flush_work(&vcrypto->config_work); virtio_reset_device(vdev); virtcrypto_free_unused_reqs(vcrypto); if (virtcrypto_dev_started(vcrypto)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/cxl/core/core.h +++ linux-aws-6.5-6.5.0/drivers/cxl/core/core.h @@ -75,6 +75,7 @@ enum cxl_rcrb which); extern struct rw_semaphore cxl_dpa_rwsem; +extern struct rw_semaphore cxl_region_rwsem; int cxl_memdev_init(void); void cxl_memdev_exit(void); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/cxl/core/hdm.c +++ linux-aws-6.5-6.5.0/drivers/cxl/core/hdm.c @@ -85,7 +85,7 @@ struct cxl_component_regs *regs) { struct cxl_register_map map = { - .dev = &port->dev, + .host = &port->dev, .resource = port->component_reg_phys, .base = crb, .max_size = CXL_COMPONENT_REG_BLOCK_SIZE, @@ -575,17 +575,11 @@ CXL_HDM_DECODER0_CTRL_HOSTONLY); } -static int cxlsd_set_targets(struct cxl_switch_decoder *cxlsd, u64 *tgt) +static void cxlsd_set_targets(struct cxl_switch_decoder *cxlsd, u64 *tgt) { struct cxl_dport **t = &cxlsd->target[0]; int ways = cxlsd->cxld.interleave_ways; - if (dev_WARN_ONCE(&cxlsd->cxld.dev, - ways > 8 || ways > cxlsd->nr_targets, - "ways: %d overflows targets: %d\n", ways, - cxlsd->nr_targets)) - return -ENXIO; - *tgt = FIELD_PREP(GENMASK(7, 0), t[0]->port_id); if (ways > 1) *tgt |= FIELD_PREP(GENMASK(15, 8), t[1]->port_id); @@ -601,8 +595,6 @@ *tgt |= FIELD_PREP(GENMASK_ULL(55, 48), t[6]->port_id); if (ways > 7) *tgt |= FIELD_PREP(GENMASK_ULL(63, 56), t[7]->port_id); - - return 0; } /* @@ -650,6 +642,25 @@ return -EBUSY; } + /* + * For endpoint decoders hosted on CXL memory devices that + * support the sanitize operation, make sure sanitize is not in-flight. + */ + if (is_endpoint_decoder(&cxld->dev)) { + struct cxl_endpoint_decoder *cxled = + to_cxl_endpoint_decoder(&cxld->dev); + struct cxl_memdev *cxlmd = cxled_to_memdev(cxled); + struct cxl_memdev_state *mds = + to_cxl_memdev_state(cxlmd->cxlds); + + if (mds && mds->security.sanitize_active) { + dev_dbg(&cxlmd->dev, + "attempted to commit %s during sanitize\n", + dev_name(&cxld->dev)); + return -EBUSY; + } + } + down_read(&cxl_dpa_rwsem); /* common decoder settings */ ctrl = readl(hdm + CXL_HDM_DECODER0_CTRL_OFFSET(cxld->id)); @@ -670,13 +681,7 @@ void __iomem *tl_lo = hdm + CXL_HDM_DECODER0_TL_LOW(id); u64 targets; - rc = cxlsd_set_targets(cxlsd, &targets); - if (rc) { - dev_dbg(&port->dev, "%s: target configuration error\n", - dev_name(&cxld->dev)); - goto err; - } - + cxlsd_set_targets(cxlsd, &targets); writel(upper_32_bits(targets), tl_hi); writel(lower_32_bits(targets), tl_lo); } else { @@ -694,7 +699,6 @@ port->commit_end++; rc = cxld_await_commit(hdm, cxld->id); -err: if (rc) { dev_dbg(&port->dev, "%s: error %d committing decoder\n", dev_name(&cxld->dev), rc); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/cxl/core/memdev.c +++ linux-aws-6.5-6.5.0/drivers/cxl/core/memdev.c @@ -125,13 +125,16 @@ struct cxl_memdev *cxlmd = to_cxl_memdev(dev); struct cxl_dev_state *cxlds = cxlmd->cxlds; struct cxl_memdev_state *mds = to_cxl_memdev_state(cxlds); - u64 reg = readq(cxlds->regs.mbox + CXLDEV_MBOX_BG_CMD_STATUS_OFFSET); - u32 pct = FIELD_GET(CXLDEV_MBOX_BG_CMD_COMMAND_PCT_MASK, reg); - u16 cmd = FIELD_GET(CXLDEV_MBOX_BG_CMD_COMMAND_OPCODE_MASK, reg); unsigned long state = mds->security.state; + int rc = 0; - if (cmd == CXL_MBOX_OP_SANITIZE && pct != 100) - return sysfs_emit(buf, "sanitize\n"); + /* sync with latest submission state */ + mutex_lock(&mds->mbox_mutex); + if (mds->security.sanitize_active) + rc = sysfs_emit(buf, "sanitize\n"); + mutex_unlock(&mds->mbox_mutex); + if (rc) + return rc; if (!(state & CXL_PMEM_SEC_STATE_USER_PASS_SET)) return sysfs_emit(buf, "disabled\n"); @@ -152,24 +155,17 @@ const char *buf, size_t len) { struct cxl_memdev *cxlmd = to_cxl_memdev(dev); - struct cxl_memdev_state *mds = to_cxl_memdev_state(cxlmd->cxlds); - struct cxl_port *port = cxlmd->endpoint; bool sanitize; ssize_t rc; if (kstrtobool(buf, &sanitize) || !sanitize) return -EINVAL; - if (!port || !is_cxl_endpoint(port)) - return -EINVAL; - - /* ensure no regions are mapped to this memdev */ - if (port->commit_end != -1) - return -EBUSY; - - rc = cxl_mem_sanitize(mds, CXL_MBOX_OP_SANITIZE); + rc = cxl_mem_sanitize(cxlmd, CXL_MBOX_OP_SANITIZE); + if (rc) + return rc; - return rc ? rc : len; + return len; } static struct device_attribute dev_attr_security_sanitize = __ATTR(sanitize, 0200, NULL, security_sanitize_store); @@ -179,24 +175,17 @@ const char *buf, size_t len) { struct cxl_memdev *cxlmd = to_cxl_memdev(dev); - struct cxl_memdev_state *mds = to_cxl_memdev_state(cxlmd->cxlds); - struct cxl_port *port = cxlmd->endpoint; ssize_t rc; bool erase; if (kstrtobool(buf, &erase) || !erase) return -EINVAL; - if (!port || !is_cxl_endpoint(port)) - return -EINVAL; - - /* ensure no regions are mapped to this memdev */ - if (port->commit_end != -1) - return -EBUSY; - - rc = cxl_mem_sanitize(mds, CXL_MBOX_OP_SECURE_ERASE); + rc = cxl_mem_sanitize(cxlmd, CXL_MBOX_OP_SECURE_ERASE); + if (rc) + return rc; - return rc ? rc : len; + return len; } static struct device_attribute dev_attr_security_erase = __ATTR(erase, 0200, NULL, security_erase_store); @@ -556,21 +545,11 @@ } EXPORT_SYMBOL_NS_GPL(clear_exclusive_cxl_commands, CXL); -static void cxl_memdev_security_shutdown(struct device *dev) -{ - struct cxl_memdev *cxlmd = to_cxl_memdev(dev); - struct cxl_memdev_state *mds = to_cxl_memdev_state(cxlmd->cxlds); - - if (mds->security.poll) - cancel_delayed_work_sync(&mds->security.poll_dwork); -} - static void cxl_memdev_shutdown(struct device *dev) { struct cxl_memdev *cxlmd = to_cxl_memdev(dev); down_write(&cxl_memdev_rwsem); - cxl_memdev_security_shutdown(dev); cxlmd->cxlds = NULL; up_write(&cxl_memdev_rwsem); } @@ -580,8 +559,8 @@ struct cxl_memdev *cxlmd = _cxlmd; struct device *dev = &cxlmd->dev; - cxl_memdev_shutdown(dev); cdev_device_del(&cxlmd->cdev, dev); + cxl_memdev_shutdown(dev); put_device(dev); } @@ -961,17 +940,16 @@ .cleanup = cxl_fw_cleanup, }; -static void devm_cxl_remove_fw_upload(void *fwl) +static void cxl_remove_fw_upload(void *fwl) { firmware_upload_unregister(fwl); } -int cxl_memdev_setup_fw_upload(struct cxl_memdev_state *mds) +int devm_cxl_setup_fw_upload(struct device *host, struct cxl_memdev_state *mds) { struct cxl_dev_state *cxlds = &mds->cxlds; struct device *dev = &cxlds->cxlmd->dev; struct fw_upload *fwl; - int rc; if (!test_bit(CXL_MEM_COMMAND_ID_GET_FW_INFO, mds->enabled_cmds)) return 0; @@ -979,19 +957,10 @@ fwl = firmware_upload_register(THIS_MODULE, dev, dev_name(dev), &cxl_memdev_fw_ops, mds); if (IS_ERR(fwl)) - return dev_err_probe(dev, PTR_ERR(fwl), - "Failed to register firmware loader\n"); - - rc = devm_add_action_or_reset(cxlds->dev, devm_cxl_remove_fw_upload, - fwl); - if (rc) - dev_err(dev, - "Failed to add firmware loader remove action: %d\n", - rc); - - return rc; + return PTR_ERR(fwl); + return devm_add_action_or_reset(host, cxl_remove_fw_upload, fwl); } -EXPORT_SYMBOL_NS_GPL(cxl_memdev_setup_fw_upload, CXL); +EXPORT_SYMBOL_NS_GPL(devm_cxl_setup_fw_upload, CXL); static const struct file_operations cxl_memdev_fops = { .owner = THIS_MODULE, @@ -1002,36 +971,8 @@ .llseek = noop_llseek, }; -static void put_sanitize(void *data) -{ - struct cxl_memdev_state *mds = data; - - sysfs_put(mds->security.sanitize_node); -} - -static int cxl_memdev_security_init(struct cxl_memdev *cxlmd) -{ - struct cxl_dev_state *cxlds = cxlmd->cxlds; - struct cxl_memdev_state *mds = to_cxl_memdev_state(cxlds); - struct device *dev = &cxlmd->dev; - struct kernfs_node *sec; - - sec = sysfs_get_dirent(dev->kobj.sd, "security"); - if (!sec) { - dev_err(dev, "sysfs_get_dirent 'security' failed\n"); - return -ENODEV; - } - mds->security.sanitize_node = sysfs_get_dirent(sec, "state"); - sysfs_put(sec); - if (!mds->security.sanitize_node) { - dev_err(dev, "sysfs_get_dirent 'state' failed\n"); - return -ENODEV; - } - - return devm_add_action_or_reset(cxlds->dev, put_sanitize, mds); - } - -struct cxl_memdev *devm_cxl_add_memdev(struct cxl_dev_state *cxlds) +struct cxl_memdev *devm_cxl_add_memdev(struct device *host, + struct cxl_dev_state *cxlds) { struct cxl_memdev *cxlmd; struct device *dev; @@ -1059,11 +1000,7 @@ if (rc) goto err; - rc = cxl_memdev_security_init(cxlmd); - if (rc) - goto err; - - rc = devm_add_action_or_reset(cxlds->dev, cxl_memdev_unregister, cxlmd); + rc = devm_add_action_or_reset(host, cxl_memdev_unregister, cxlmd); if (rc) return ERR_PTR(rc); return cxlmd; @@ -1079,6 +1016,50 @@ } EXPORT_SYMBOL_NS_GPL(devm_cxl_add_memdev, CXL); +static void sanitize_teardown_notifier(void *data) +{ + struct cxl_memdev_state *mds = data; + struct kernfs_node *state; + + /* + * Prevent new irq triggered invocations of the workqueue and + * flush inflight invocations. + */ + mutex_lock(&mds->mbox_mutex); + state = mds->security.sanitize_node; + mds->security.sanitize_node = NULL; + mutex_unlock(&mds->mbox_mutex); + + cancel_delayed_work_sync(&mds->security.poll_dwork); + sysfs_put(state); +} + +int devm_cxl_sanitize_setup_notifier(struct device *host, + struct cxl_memdev *cxlmd) +{ + struct cxl_dev_state *cxlds = cxlmd->cxlds; + struct cxl_memdev_state *mds = to_cxl_memdev_state(cxlds); + struct kernfs_node *sec; + + if (!test_bit(CXL_SEC_ENABLED_SANITIZE, mds->security.enabled_cmds)) + return 0; + + /* + * Note, the expectation is that @cxlmd would have failed to be + * created if these sysfs_get_dirent calls fail. + */ + sec = sysfs_get_dirent(cxlmd->dev.kobj.sd, "security"); + if (!sec) + return -ENOENT; + mds->security.sanitize_node = sysfs_get_dirent(sec, "state"); + sysfs_put(sec); + if (!mds->security.sanitize_node) + return -ENOENT; + + return devm_add_action_or_reset(host, sanitize_teardown_notifier, mds); +} +EXPORT_SYMBOL_NS_GPL(devm_cxl_sanitize_setup_notifier, CXL); + __init int cxl_memdev_init(void) { dev_t devt; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/cxl/core/regs.c +++ linux-aws-6.5-6.5.0/drivers/cxl/core/regs.c @@ -204,7 +204,7 @@ struct cxl_component_regs *regs, unsigned long map_mask) { - struct device *dev = map->dev; + struct device *host = map->host; struct mapinfo { const struct cxl_reg_map *rmap; void __iomem **addr; @@ -225,7 +225,7 @@ continue; phys_addr = map->resource + mi->rmap->offset; length = mi->rmap->size; - *(mi->addr) = devm_cxl_iomap_block(dev, phys_addr, length); + *(mi->addr) = devm_cxl_iomap_block(host, phys_addr, length); if (!*(mi->addr)) return -ENOMEM; } @@ -237,7 +237,7 @@ int cxl_map_device_regs(const struct cxl_register_map *map, struct cxl_device_regs *regs) { - struct device *dev = map->dev; + struct device *host = map->host; resource_size_t phys_addr = map->resource; struct mapinfo { const struct cxl_reg_map *rmap; @@ -259,7 +259,7 @@ addr = phys_addr + mi->rmap->offset; length = mi->rmap->size; - *(mi->addr) = devm_cxl_iomap_block(dev, addr, length); + *(mi->addr) = devm_cxl_iomap_block(host, addr, length); if (!*(mi->addr)) return -ENOMEM; } @@ -309,7 +309,7 @@ int regloc, i; *map = (struct cxl_register_map) { - .dev = &pdev->dev, + .host = &pdev->dev, .resource = CXL_RESOURCE_NONE, }; @@ -403,15 +403,15 @@ static int cxl_map_regblock(struct cxl_register_map *map) { - struct device *dev = map->dev; + struct device *host = map->host; map->base = ioremap(map->resource, map->max_size); if (!map->base) { - dev_err(dev, "failed to map registers\n"); + dev_err(host, "failed to map registers\n"); return -ENOMEM; } - dev_dbg(dev, "Mapped CXL Memory Device resource %pa\n", &map->resource); + dev_dbg(host, "Mapped CXL Memory Device resource %pa\n", &map->resource); return 0; } @@ -425,28 +425,28 @@ { struct cxl_component_reg_map *comp_map; struct cxl_device_reg_map *dev_map; - struct device *dev = map->dev; + struct device *host = map->host; void __iomem *base = map->base; switch (map->reg_type) { case CXL_REGLOC_RBI_COMPONENT: comp_map = &map->component_map; - cxl_probe_component_regs(dev, base, comp_map); - dev_dbg(dev, "Set up component registers\n"); + cxl_probe_component_regs(host, base, comp_map); + dev_dbg(host, "Set up component registers\n"); break; case CXL_REGLOC_RBI_MEMDEV: dev_map = &map->device_map; - cxl_probe_device_regs(dev, base, dev_map); + cxl_probe_device_regs(host, base, dev_map); if (!dev_map->status.valid || !dev_map->mbox.valid || !dev_map->memdev.valid) { - dev_err(dev, "registers not found: %s%s%s\n", + dev_err(host, "registers not found: %s%s%s\n", !dev_map->status.valid ? "status " : "", !dev_map->mbox.valid ? "mbox " : "", !dev_map->memdev.valid ? "memdev " : ""); return -ENXIO; } - dev_dbg(dev, "Probing device registers...\n"); + dev_dbg(host, "Probing device registers...\n"); break; default: break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/cxl/cxl.h +++ linux-aws-6.5-6.5.0/drivers/cxl/cxl.h @@ -247,7 +247,7 @@ /** * struct cxl_register_map - DVSEC harvested register block mapping parameters - * @dev: device for devm operations and logging + * @host: device for devm operations and logging * @base: virtual base of the register-block-BAR + @block_offset * @resource: physical resource base of the register block * @max_size: maximum mapping size to perform register search @@ -257,7 +257,7 @@ * @pmu_map: cxl_reg_maps for CXL Performance Monitoring Units */ struct cxl_register_map { - struct device *dev; + struct device *host; void __iomem *base; resource_size_t resource; resource_size_t max_size; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/cxl/cxlmem.h +++ linux-aws-6.5-6.5.0/drivers/cxl/cxlmem.h @@ -84,9 +84,12 @@ return is_cxl_memdev(port->uport_dev); } -struct cxl_memdev *devm_cxl_add_memdev(struct cxl_dev_state *cxlds); +struct cxl_memdev *devm_cxl_add_memdev(struct device *host, + struct cxl_dev_state *cxlds); +int devm_cxl_sanitize_setup_notifier(struct device *host, + struct cxl_memdev *cxlmd); struct cxl_memdev_state; -int cxl_memdev_setup_fw_upload(struct cxl_memdev_state *mds); +int devm_cxl_setup_fw_upload(struct device *host, struct cxl_memdev_state *mds); int devm_cxl_dpa_reserve(struct cxl_endpoint_decoder *cxled, resource_size_t base, resource_size_t len, resource_size_t skipped); @@ -360,16 +363,16 @@ * * @state: state of last security operation * @enabled_cmds: All security commands enabled in the CEL - * @poll: polling for sanitization is enabled, device has no mbox irq support * @poll_tmo_secs: polling timeout + * @sanitize_active: sanitize completion pending * @poll_dwork: polling work item * @sanitize_node: sanitation sysfs file to notify */ struct cxl_security_state { unsigned long state; DECLARE_BITMAP(enabled_cmds, CXL_SEC_ENABLED_MAX); - bool poll; int poll_tmo_secs; + bool sanitize_active; struct delayed_work poll_dwork; struct kernfs_node *sanitize_node; }; @@ -883,7 +886,7 @@ } #endif -int cxl_mem_sanitize(struct cxl_memdev_state *mds, u16 cmd); +int cxl_mem_sanitize(struct cxl_memdev *cxlmd, u16 cmd); struct cxl_hdm { struct cxl_component_regs regs; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/devfreq/event/rockchip-dfi.c +++ linux-aws-6.5-6.5.0/drivers/devfreq/event/rockchip-dfi.c @@ -193,14 +193,15 @@ return dev_err_probe(dev, PTR_ERR(data->clk), "Cannot get the clk pclk_ddr_mon\n"); - /* try to find the optional reference to the pmu syscon */ node = of_parse_phandle(np, "rockchip,pmu", 0); - if (node) { - data->regmap_pmu = syscon_node_to_regmap(node); - of_node_put(node); - if (IS_ERR(data->regmap_pmu)) - return PTR_ERR(data->regmap_pmu); - } + if (!node) + return dev_err_probe(&pdev->dev, -ENODEV, "Can't find pmu_grf registers\n"); + + data->regmap_pmu = syscon_node_to_regmap(node); + of_node_put(node); + if (IS_ERR(data->regmap_pmu)) + return PTR_ERR(data->regmap_pmu); + data->dev = dev; desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/dma-buf/dma-resv.c +++ linux-aws-6.5-6.5.0/drivers/dma-buf/dma-resv.c @@ -301,7 +301,7 @@ dma_resv_list_entry(fobj, i, obj, &old, &old_usage); if ((old->context == fence->context && old_usage >= usage && - dma_fence_is_later(fence, old)) || + dma_fence_is_later_or_same(fence, old)) || dma_fence_is_signaled(old)) { dma_resv_list_set(fobj, i, fence, usage); dma_fence_put(old); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/dma/idxd/Makefile +++ linux-aws-6.5-6.5.0/drivers/dma/idxd/Makefile @@ -1,12 +1,12 @@ ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=IDXD +obj-$(CONFIG_INTEL_IDXD_BUS) += idxd_bus.o +idxd_bus-y := bus.o + obj-$(CONFIG_INTEL_IDXD) += idxd.o idxd-y := init.o irq.o device.o sysfs.o submit.o dma.o cdev.o debugfs.o idxd-$(CONFIG_INTEL_IDXD_PERFMON) += perfmon.o -obj-$(CONFIG_INTEL_IDXD_BUS) += idxd_bus.o -idxd_bus-y := bus.o - obj-$(CONFIG_INTEL_IDXD_COMPAT) += idxd_compat.o idxd_compat-y := compat.o only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/dma/pxa_dma.c +++ linux-aws-6.5-6.5.0/drivers/dma/pxa_dma.c @@ -722,7 +722,6 @@ dma_addr_t dma; struct pxad_desc_sw *sw_desc = to_pxad_sw_desc(vd); - BUG_ON(sw_desc->nb_desc == 0); for (i = sw_desc->nb_desc - 1; i >= 0; i--) { if (i > 0) dma = sw_desc->hw_desc[i - 1]->ddadr; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/dma/ti/edma.c +++ linux-aws-6.5-6.5.0/drivers/dma/ti/edma.c @@ -2402,7 +2402,7 @@ if (irq < 0 && node) irq = irq_of_parse_and_map(node, 0); - if (irq >= 0) { + if (irq > 0) { irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccint", dev_name(dev)); ret = devm_request_irq(dev, irq, dma_irq_handler, 0, irq_name, @@ -2418,7 +2418,7 @@ if (irq < 0 && node) irq = irq_of_parse_and_map(node, 2); - if (irq >= 0) { + if (irq > 0) { irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccerrint", dev_name(dev)); ret = devm_request_irq(dev, irq, dma_ccerr_handler, 0, irq_name, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/firmware/arm_ffa/bus.c +++ linux-aws-6.5-6.5.0/drivers/firmware/arm_ffa/bus.c @@ -193,6 +193,7 @@ dev->release = ffa_release_device; dev_set_name(&ffa_dev->dev, "arm-ffa-%d", id); + ffa_dev->id = id; ffa_dev->vm_id = vm_id; ffa_dev->ops = ops; uuid_copy(&ffa_dev->uuid, uuid); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/firmware/efi/unaccepted_memory.c +++ linux-aws-6.5-6.5.0/drivers/firmware/efi/unaccepted_memory.c @@ -5,9 +5,17 @@ #include #include -/* Protects unaccepted memory bitmap */ +/* Protects unaccepted memory bitmap and accepting_list */ static DEFINE_SPINLOCK(unaccepted_memory_lock); +struct accept_range { + struct list_head list; + unsigned long start; + unsigned long end; +}; + +static LIST_HEAD(accepting_list); + /* * accept_memory() -- Consult bitmap and accept the memory if needed. * @@ -24,6 +32,7 @@ { struct efi_unaccepted_memory *unaccepted; unsigned long range_start, range_end; + struct accept_range range, *entry; unsigned long flags; u64 unit_size; @@ -78,20 +87,67 @@ if (end > unaccepted->size * unit_size * BITS_PER_BYTE) end = unaccepted->size * unit_size * BITS_PER_BYTE; - range_start = start / unit_size; - + range.start = start / unit_size; + range.end = DIV_ROUND_UP(end, unit_size); +retry: spin_lock_irqsave(&unaccepted_memory_lock, flags); + + /* + * Check if anybody works on accepting the same range of the memory. + * + * The check is done with unit_size granularity. It is crucial to catch + * all accept requests to the same unit_size block, even if they don't + * overlap on physical address level. + */ + list_for_each_entry(entry, &accepting_list, list) { + if (entry->end <= range.start) + continue; + if (entry->start >= range.end) + continue; + + /* + * Somebody else accepting the range. Or at least part of it. + * + * Drop the lock and retry until it is complete. + */ + spin_unlock_irqrestore(&unaccepted_memory_lock, flags); + goto retry; + } + + /* + * Register that the range is about to be accepted. + * Make sure nobody else will accept it. + */ + list_add(&range.list, &accepting_list); + + range_start = range.start; for_each_set_bitrange_from(range_start, range_end, unaccepted->bitmap, - DIV_ROUND_UP(end, unit_size)) { + range.end) { unsigned long phys_start, phys_end; unsigned long len = range_end - range_start; phys_start = range_start * unit_size + unaccepted->phys_base; phys_end = range_end * unit_size + unaccepted->phys_base; + /* + * Keep interrupts disabled until the accept operation is + * complete in order to prevent deadlocks. + * + * Enabling interrupts before calling arch_accept_memory() + * creates an opportunity for an interrupt handler to request + * acceptance for the same memory. The handler will continuously + * spin with interrupts disabled, preventing other task from + * making progress with the acceptance process. + */ + spin_unlock(&unaccepted_memory_lock); + arch_accept_memory(phys_start, phys_end); + + spin_lock(&unaccepted_memory_lock); bitmap_clear(unaccepted->bitmap, range_start, len); } + + list_del(&range.list); spin_unlock_irqrestore(&unaccepted_memory_lock, flags); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/firmware/qcom_scm.c +++ linux-aws-6.5-6.5.0/drivers/firmware/qcom_scm.c @@ -172,6 +172,12 @@ return qcom_scm_convention; /* + * Per the "SMC calling convention specification", the 64-bit calling + * convention can only be used when the client is 64-bit, otherwise + * system will encounter the undefined behaviour. + */ +#if IS_ENABLED(CONFIG_ARM64) + /* * Device isn't required as there is only one argument - no device * needed to dma_map_single to secure world */ @@ -191,6 +197,7 @@ forced = true; goto found; } +#endif probed_convention = SMC_CONVENTION_ARM_32; ret = __scm_smc_call(NULL, &desc, probed_convention, &res, true); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/firmware/tegra/bpmp.c +++ linux-aws-6.5-6.5.0/drivers/firmware/tegra/bpmp.c @@ -314,6 +314,8 @@ return __tegra_bpmp_channel_write(channel, mrq, flags, data, size); } +static int __maybe_unused tegra_bpmp_resume(struct device *dev); + int tegra_bpmp_transfer_atomic(struct tegra_bpmp *bpmp, struct tegra_bpmp_message *msg) { @@ -326,6 +328,14 @@ if (!tegra_bpmp_message_valid(msg)) return -EINVAL; + if (bpmp->suspended) { + /* Reset BPMP IPC channels during resume based on flags passed */ + if (msg->flags & TEGRA_BPMP_MESSAGE_RESET) + tegra_bpmp_resume(bpmp->dev); + else + return -EAGAIN; + } + channel = bpmp->tx_channel; spin_lock(&bpmp->atomic_tx_lock); @@ -365,6 +375,14 @@ if (!tegra_bpmp_message_valid(msg)) return -EINVAL; + if (bpmp->suspended) { + /* Reset BPMP IPC channels during resume based on flags passed */ + if (msg->flags & TEGRA_BPMP_MESSAGE_RESET) + tegra_bpmp_resume(bpmp->dev); + else + return -EAGAIN; + } + channel = tegra_bpmp_write_threaded(bpmp, msg->mrq, msg->tx.data, msg->tx.size); if (IS_ERR(channel)) @@ -797,10 +815,21 @@ return err; } +static int __maybe_unused tegra_bpmp_suspend(struct device *dev) +{ + struct tegra_bpmp *bpmp = dev_get_drvdata(dev); + + bpmp->suspended = true; + + return 0; +} + static int __maybe_unused tegra_bpmp_resume(struct device *dev) { struct tegra_bpmp *bpmp = dev_get_drvdata(dev); + bpmp->suspended = false; + if (bpmp->soc->ops->resume) return bpmp->soc->ops->resume(bpmp); else @@ -808,6 +837,7 @@ } static const struct dev_pm_ops tegra_bpmp_pm_ops = { + .suspend_noirq = tegra_bpmp_suspend, .resume_noirq = tegra_bpmp_resume, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpio/gpio-timberdale.c +++ linux-aws-6.5-6.5.0/drivers/gpio/gpio-timberdale.c @@ -43,9 +43,10 @@ unsigned offset, bool enabled) { struct timbgpio *tgpio = gpiochip_get_data(gpio); + unsigned long flags; u32 reg; - spin_lock(&tgpio->lock); + spin_lock_irqsave(&tgpio->lock, flags); reg = ioread32(tgpio->membase + offset); if (enabled) @@ -54,7 +55,7 @@ reg &= ~(1 << index); iowrite32(reg, tgpio->membase + offset); - spin_unlock(&tgpio->lock); + spin_unlock_irqrestore(&tgpio->lock, flags); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpio/gpio-vf610.c +++ linux-aws-6.5-6.5.0/drivers/gpio/gpio-vf610.c @@ -127,14 +127,14 @@ unsigned long mask = BIT(gpio); u32 val; + vf610_gpio_set(chip, gpio, value); + if (port->sdata && port->sdata->have_paddr) { val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR); val |= mask; vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR); } - vf610_gpio_set(chip, gpio, value); - return pinctrl_gpio_direction_output(chip->base + gpio); } @@ -247,7 +247,8 @@ .irq_unmask = vf610_gpio_irq_unmask, .irq_set_type = vf610_gpio_irq_set_type, .irq_set_wake = vf610_gpio_irq_set_wake, - .flags = IRQCHIP_IMMUTABLE, + .flags = IRQCHIP_IMMUTABLE | IRQCHIP_MASK_ON_SUSPEND + | IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND, GPIOCHIP_IRQ_RESOURCE_HELPERS, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpio/gpiolib-acpi.c +++ linux-aws-6.5-6.5.0/drivers/gpio/gpiolib-acpi.c @@ -951,6 +951,7 @@ if (!propname) return ERR_PTR(-EINVAL); + memset(&lookup, 0, sizeof(lookup)); lookup.index = index; ret = acpi_gpio_property_lookup(fwnode, propname, index, &lookup); @@ -1654,6 +1655,26 @@ .ignore_wake = "SYNA1202:00@16", }, }, + { + /* + * On the Peaq C1010 2-in-1 INT33FC:00 pin 3 is connected to + * a "dolby" button. At the ACPI level an _AEI event-handler + * is connected which sets an ACPI variable to 1 on both + * edges. This variable can be polled + cleared to 0 using + * WMI. But since the variable is set on both edges the WMI + * interface is pretty useless even when polling. + * So instead the x86-android-tablets code instantiates + * a gpio-keys platform device for it. + * Ignore the _AEI handler for the pin, so that it is not busy. + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "PEAQ"), + DMI_MATCH(DMI_PRODUCT_NAME, "PEAQ PMM C1010 MD99187"), + }, + .driver_data = &(struct acpi_gpiolib_dmi_quirk) { + .ignore_interrupt = "INT33FC:00@3", + }, + }, {} /* Terminating entry */ }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpio/gpiolib-of.c +++ linux-aws-6.5-6.5.0/drivers/gpio/gpiolib-of.c @@ -496,6 +496,10 @@ #if IS_ENABLED(CONFIG_SND_SOC_CS42L56) { "reset", "cirrus,gpio-nreset", "cirrus,cs42l56" }, #endif +#if IS_ENABLED(CONFIG_SND_SOC_MT2701_CS42448) + { "i2s1-in-sel-gpio1", NULL, "mediatek,mt2701-cs42448-machine" }, + { "i2s1-in-sel-gpio2", NULL, "mediatek,mt2701-cs42448-machine" }, +#endif #if IS_ENABLED(CONFIG_SND_SOC_TLV320AIC3X) { "reset", "gpio-reset", "ti,tlv320aic3x" }, { "reset", "gpio-reset", "ti,tlv320aic33" }, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpio/gpiolib-sysfs.c +++ linux-aws-6.5-6.5.0/drivers/gpio/gpiolib-sysfs.c @@ -474,14 +474,17 @@ goto done; status = gpiod_set_transitory(desc, false); - if (!status) { - status = gpiod_export(desc, true); - if (status < 0) - gpiod_free(desc); - else - set_bit(FLAG_SYSFS, &desc->flags); + if (status) { + gpiod_free(desc); + goto done; } + status = gpiod_export(desc, true); + if (status < 0) + gpiod_free(desc); + else + set_bit(FLAG_SYSFS, &desc->flags); + done: if (status) pr_debug("%s: status %d\n", __func__, status); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c @@ -29,6 +29,7 @@ #include "amdgpu.h" #include "atom.h" +#include #include #include #include @@ -287,6 +288,10 @@ if (adev->flags & AMD_IS_APU) return false; + /* ATRM is for on-platform devices only */ + if (dev_is_removable(&adev->pdev->dev)) + return false; + while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) { dhandle = ACPI_HANDLE(&pdev->dev); if (!dhandle) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c @@ -179,6 +179,7 @@ } rcu_read_unlock(); + *result = NULL; return -ENOENT; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -47,7 +47,6 @@ bool amdgpu_ctx_priority_is_valid(int32_t ctx_prio) { switch (ctx_prio) { - case AMDGPU_CTX_PRIORITY_UNSET: case AMDGPU_CTX_PRIORITY_VERY_LOW: case AMDGPU_CTX_PRIORITY_LOW: case AMDGPU_CTX_PRIORITY_NORMAL: @@ -55,6 +54,7 @@ case AMDGPU_CTX_PRIORITY_VERY_HIGH: return true; default: + case AMDGPU_CTX_PRIORITY_UNSET: return false; } } @@ -64,7 +64,8 @@ { switch (ctx_prio) { case AMDGPU_CTX_PRIORITY_UNSET: - return DRM_SCHED_PRIORITY_UNSET; + pr_warn_once("AMD-->DRM context priority value UNSET-->NORMAL"); + return DRM_SCHED_PRIORITY_NORMAL; case AMDGPU_CTX_PRIORITY_VERY_LOW: return DRM_SCHED_PRIORITY_MIN; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -747,6 +747,9 @@ ssize_t result = 0; int r; + if (!adev->smc_rreg) + return -EPERM; + if (size & 0x3 || *pos & 0x3) return -EINVAL; @@ -803,6 +806,9 @@ ssize_t result = 0; int r; + if (!adev->smc_wreg) + return -EPERM; + if (size & 0x3 || *pos & 0x3) return -EINVAL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c @@ -92,6 +92,7 @@ MODULE_FIRMWARE(FIRMWARE_IP_DISCOVERY); #define mmRCC_CONFIG_MEMSIZE 0xde3 +#define mmMP0_SMN_C2PMSG_33 0x16061 #define mmMM_INDEX 0x0 #define mmMM_INDEX_HI 0x6 #define mmMM_DATA 0x1 @@ -230,8 +231,26 @@ static int amdgpu_discovery_read_binary_from_mem(struct amdgpu_device *adev, uint8_t *binary) { - uint64_t vram_size = (uint64_t)RREG32(mmRCC_CONFIG_MEMSIZE) << 20; - int ret = 0; + uint64_t vram_size; + u32 msg; + int i, ret = 0; + + /* It can take up to a second for IFWI init to complete on some dGPUs, + * but generally it should be in the 60-100ms range. Normally this starts + * as soon as the device gets power so by the time the OS loads this has long + * completed. However, when a card is hotplugged via e.g., USB4, we need to + * wait for this to complete. Once the C2PMSG is updated, we can + * continue. + */ + if (dev_is_removable(&adev->pdev->dev)) { + for (i = 0; i < 1000; i++) { + msg = RREG32(mmMP0_SMN_C2PMSG_33); + if (msg & 0x80000000) + break; + msleep(1); + } + } + vram_size = (uint64_t)RREG32(mmRCC_CONFIG_MEMSIZE) << 20; if (vram_size) { uint64_t pos = vram_size - DISCOVERY_TMR_OFFSET; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c @@ -403,7 +403,10 @@ continue; } - r = amdgpu_vm_clear_freed(adev, vm, NULL); + /* Reserve fences for two SDMA page table updates */ + r = dma_resv_reserve_fences(resv, 2); + if (!r) + r = amdgpu_vm_clear_freed(adev, vm, NULL); if (!r) r = amdgpu_vm_handle_moved(adev, vm); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c @@ -383,9 +383,11 @@ struct amdgpu_ring *ring = &kiq->ring; u32 domain = AMDGPU_GEM_DOMAIN_GTT; +#if !defined(CONFIG_ARM) && !defined(CONFIG_ARM64) /* Only enable on gfx10 and 11 for now to avoid changing behavior on older chips */ if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 0, 0)) domain |= AMDGPU_GEM_DOMAIN_VRAM; +#endif /* create MQD for KIQ */ if (!adev->enable_mes_kiq && !ring->mqd_obj) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c @@ -627,8 +627,20 @@ mqd_prop.hqd_queue_priority = p->hqd_queue_priority; mqd_prop.hqd_active = false; + if (p->queue_type == AMDGPU_RING_TYPE_GFX || + p->queue_type == AMDGPU_RING_TYPE_COMPUTE) { + mutex_lock(&adev->srbm_mutex); + amdgpu_gfx_select_me_pipe_q(adev, p->ring->me, p->ring->pipe, 0, 0, 0); + } + mqd_mgr->init_mqd(adev, q->mqd_cpu_ptr, &mqd_prop); + if (p->queue_type == AMDGPU_RING_TYPE_GFX || + p->queue_type == AMDGPU_RING_TYPE_COMPUTE) { + amdgpu_gfx_select_me_pipe_q(adev, 0, 0, 0, 0, 0); + mutex_unlock(&adev->srbm_mutex); + } + amdgpu_bo_unreserve(q->mqd_obj); } @@ -1062,9 +1074,13 @@ switch (queue_type) { case AMDGPU_RING_TYPE_GFX: ring->funcs = adev->gfx.gfx_ring[0].funcs; + ring->me = adev->gfx.gfx_ring[0].me; + ring->pipe = adev->gfx.gfx_ring[0].pipe; break; case AMDGPU_RING_TYPE_COMPUTE: ring->funcs = adev->gfx.compute_ring[0].funcs; + ring->me = adev->gfx.compute_ring[0].me; + ring->pipe = adev->gfx.compute_ring[0].pipe; break; case AMDGPU_RING_TYPE_SDMA: ring->funcs = adev->sdma.instance[0].ring.funcs; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -2084,6 +2084,17 @@ } /* SECUREDISPLAY end */ +int amdgpu_psp_wait_for_bootloader(struct amdgpu_device *adev) +{ + struct psp_context *psp = &adev->psp; + int ret = 0; + + if (!amdgpu_sriov_vf(adev) && psp->funcs && psp->funcs->wait_for_bootloader != NULL) + ret = psp->funcs->wait_for_bootloader(psp); + + return ret; +} + static int psp_hw_start(struct psp_context *psp) { struct amdgpu_device *adev = psp->adev; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c @@ -158,6 +158,7 @@ case IP_VERSION(11, 0, 7): /* Sienna cichlid */ case IP_VERSION(13, 0, 0): case IP_VERSION(13, 0, 2): /* Aldebaran */ + case IP_VERSION(13, 0, 6): case IP_VERSION(13, 0, 10): return true; default: @@ -212,6 +213,13 @@ control->i2c_address = EEPROM_I2C_MADDR_0; return true; case IP_VERSION(13, 0, 0): + if (strnstr(atom_ctx->vbios_pn, "D707", + sizeof(atom_ctx->vbios_pn))) + control->i2c_address = EEPROM_I2C_MADDR_0; + else + control->i2c_address = EEPROM_I2C_MADDR_4; + return true; + case IP_VERSION(13, 0, 6): case IP_VERSION(13, 0, 10): control->i2c_address = EEPROM_I2C_MADDR_4; return true; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c @@ -292,8 +292,15 @@ void *ptr; int i, idx; + bool in_ras_intr = amdgpu_ras_intr_triggered(); + cancel_delayed_work_sync(&adev->vcn.idle_work); + /* err_event_athub will corrupt VCPU buffer, so we need to + * restore fw data and clear buffer in amdgpu_vcn_resume() */ + if (in_ras_intr) + return 0; + for (i = 0; i < adev->vcn.num_vcn_inst; ++i) { if (adev->vcn.harvest_config & (1 << i)) continue; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c @@ -239,6 +239,8 @@ for (i = 0; i < ARRAY_SIZE(common_modes); i++) { mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h, 60, false, false, false); + if (!mode) + continue; drm_mode_probed_add(connector, mode); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1094,12 +1094,13 @@ struct drm_gem_object *gobj = dma_buf->priv; struct amdgpu_bo *abo = gem_to_amdgpu_bo(gobj); - if (abo->tbo.resource->mem_type == TTM_PL_VRAM) + if (abo->tbo.resource && + abo->tbo.resource->mem_type == TTM_PL_VRAM) bo = gem_to_amdgpu_bo(gobj); } mem = bo->tbo.resource; - if (mem->mem_type == TTM_PL_TT || - mem->mem_type == AMDGPU_PL_PREEMPT) + if (mem && (mem->mem_type == TTM_PL_TT || + mem->mem_type == AMDGPU_PL_PREEMPT)) pages_addr = bo->tbo.ttm->dma_address; } @@ -2128,7 +2129,8 @@ * Returns: * 0 for success, error for failure. */ -int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, int32_t xcp_id) +int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, + int32_t xcp_id) { struct amdgpu_bo *root_bo; struct amdgpu_bo_vm *root; @@ -2147,6 +2149,7 @@ INIT_LIST_HEAD(&vm->done); INIT_LIST_HEAD(&vm->pt_freed); INIT_WORK(&vm->pt_free_work, amdgpu_vm_pt_free_work); + INIT_KFIFO(vm->faults); r = amdgpu_vm_init_entities(adev, vm); if (r) @@ -2181,34 +2184,33 @@ false, &root, xcp_id); if (r) goto error_free_delayed; - root_bo = &root->bo; + + root_bo = amdgpu_bo_ref(&root->bo); r = amdgpu_bo_reserve(root_bo, true); - if (r) - goto error_free_root; + if (r) { + amdgpu_bo_unref(&root->shadow); + amdgpu_bo_unref(&root_bo); + goto error_free_delayed; + } + amdgpu_vm_bo_base_init(&vm->root, vm, root_bo); r = dma_resv_reserve_fences(root_bo->tbo.base.resv, 1); if (r) - goto error_unreserve; - - amdgpu_vm_bo_base_init(&vm->root, vm, root_bo); + goto error_free_root; r = amdgpu_vm_pt_clear(adev, vm, root, false); if (r) - goto error_unreserve; + goto error_free_root; amdgpu_bo_unreserve(vm->root.bo); - - INIT_KFIFO(vm->faults); + amdgpu_bo_unref(&root_bo); return 0; -error_unreserve: - amdgpu_bo_unreserve(vm->root.bo); - error_free_root: - amdgpu_bo_unref(&root->shadow); + amdgpu_vm_pt_free_root(adev, vm); + amdgpu_bo_unreserve(vm->root.bo); amdgpu_bo_unref(&root_bo); - vm->root.bo = NULL; error_free_delayed: dma_fence_put(vm->last_tlb_flush); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c @@ -2211,8 +2211,6 @@ if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 3)) amdgpu_gmc_sysfs_fini(adev); - adev->gmc.num_mem_partitions = 0; - kfree(adev->gmc.mem_partitions); amdgpu_gmc_ras_fini(adev); amdgpu_gem_force_release(adev); @@ -2226,6 +2224,9 @@ amdgpu_bo_free_kernel(&adev->gmc.pdb0_bo, NULL, &adev->gmc.ptr_pdb0); amdgpu_bo_fini(adev); + adev->gmc.num_mem_partitions = 0; + kfree(adev->gmc.mem_partitions); + return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c @@ -130,6 +130,9 @@ uint64_t value; int i; + if (amdgpu_sriov_vf(adev)) + return; + inst_mask = adev->aid_mask; for_each_inst(i, inst_mask) { /* Program the AGP BAR */ @@ -139,9 +142,6 @@ WREG32_SOC15(MMHUB, i, regMC_VM_AGP_TOP, adev->gmc.agp_end >> 24); - if (amdgpu_sriov_vf(adev)) - return; - /* Program the system aperture low logical page number. */ WREG32_SOC15(MMHUB, i, regMC_VM_SYSTEM_APERTURE_LOW_ADDR, min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c @@ -28,6 +28,7 @@ #include "nbio/nbio_2_3_offset.h" #include "nbio/nbio_2_3_sh_mask.h" #include +#include #include #define smnPCIE_CONFIG_CNTL 0x11180044 @@ -361,7 +362,7 @@ data |= NAVI10_PCIE__LC_L0S_INACTIVITY_DEFAULT << PCIE_LC_CNTL__LC_L0S_INACTIVITY__SHIFT; - if (pci_is_thunderbolt_attached(adev->pdev)) + if (dev_is_removable(&adev->pdev->dev)) data |= NAVI10_PCIE__LC_L1_INACTIVITY_TBT_DEFAULT << PCIE_LC_CNTL__LC_L1_INACTIVITY__SHIFT; else data |= NAVI10_PCIE__LC_L1_INACTIVITY_DEFAULT << PCIE_LC_CNTL__LC_L1_INACTIVITY__SHIFT; @@ -480,7 +481,7 @@ def = data = RREG32_PCIE(smnPCIE_LC_CNTL); data |= NAVI10_PCIE__LC_L0S_INACTIVITY_DEFAULT << PCIE_LC_CNTL__LC_L0S_INACTIVITY__SHIFT; - if (pci_is_thunderbolt_attached(adev->pdev)) + if (dev_is_removable(&adev->pdev->dev)) data |= NAVI10_PCIE__LC_L1_INACTIVITY_TBT_DEFAULT << PCIE_LC_CNTL__LC_L1_INACTIVITY__SHIFT; else data |= NAVI10_PCIE__LC_L1_INACTIVITY_DEFAULT << PCIE_LC_CNTL__LC_L1_INACTIVITY__SHIFT; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c @@ -57,6 +57,9 @@ /* Read USB-PD from LFB */ #define GFX_CMD_USB_PD_USE_LFB 0x480 +/* Retry times for vmbx ready wait */ +#define PSP_VMBX_POLLING_LIMIT 3000 + /* VBIOS gfl defines */ #define MBOX_READY_MASK 0x80000000 #define MBOX_STATUS_MASK 0x0000FFFF @@ -130,19 +133,43 @@ return sol_reg != 0x0; } -static int psp_v13_0_wait_for_bootloader(struct psp_context *psp) +static int psp_v13_0_wait_for_vmbx_ready(struct psp_context *psp) { struct amdgpu_device *adev = psp->adev; + int retry_loop, ret; - int ret; - int retry_loop; + for (retry_loop = 0; retry_loop < PSP_VMBX_POLLING_LIMIT; retry_loop++) { + /* Wait for bootloader to signify that is + ready having bit 31 of C2PMSG_33 set to 1 */ + ret = psp_wait_for( + psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_33), + 0x80000000, 0xffffffff, false); + + if (ret == 0) + break; + } + + if (ret) + dev_warn(adev->dev, "Bootloader wait timed out"); + + return ret; +} +static int psp_v13_0_wait_for_bootloader(struct psp_context *psp) +{ + struct amdgpu_device *adev = psp->adev; + int retry_loop, retry_cnt, ret; + + retry_cnt = + (adev->ip_versions[MP0_HWIP][0] == IP_VERSION(13, 0, 6)) ? + PSP_VMBX_POLLING_LIMIT : + 10; /* Wait for bootloader to signify that it is ready having bit 31 of * C2PMSG_35 set to 1. All other bits are expected to be cleared. * If there is an error in processing command, bits[7:0] will be set. * This is applicable for PSP v13.0.6 and newer. */ - for (retry_loop = 0; retry_loop < 10; retry_loop++) { + for (retry_loop = 0; retry_loop < retry_cnt; retry_loop++) { ret = psp_wait_for( psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_35), 0x80000000, 0xffffffff, false); @@ -154,6 +181,19 @@ return ret; } +static int psp_v13_0_wait_for_bootloader_steady_state(struct psp_context *psp) +{ + struct amdgpu_device *adev = psp->adev; + + if (adev->ip_versions[MP0_HWIP][0] == IP_VERSION(13, 0, 6)) { + psp_v13_0_wait_for_vmbx_ready(psp); + + return psp_v13_0_wait_for_bootloader(psp); + } + + return 0; +} + static int psp_v13_0_bootloader_load_component(struct psp_context *psp, struct psp_bin_desc *bin_desc, enum psp_bootloader_cmd bl_cmd) @@ -690,6 +730,7 @@ static const struct psp_funcs psp_v13_0_funcs = { .init_microcode = psp_v13_0_init_microcode, + .wait_for_bootloader = psp_v13_0_wait_for_bootloader_steady_state, .bootloader_load_kdb = psp_v13_0_bootloader_load_kdb, .bootloader_load_spl = psp_v13_0_bootloader_load_spl, .bootloader_load_sysdrv = psp_v13_0_bootloader_load_sysdrv, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/soc15.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/soc15.c @@ -325,7 +325,8 @@ u32 reference_clock = adev->clock.spll.reference_freq; if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 0) || - adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 1)) + adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 1) || + adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 6)) return 10000; if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(10, 0, 0) || adev->ip_versions[MP1_HWIP][0] == IP_VERSION(10, 0, 1)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdgpu/vi.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdgpu/vi.c @@ -1124,7 +1124,7 @@ bool bL1SS = false; bool bClkReqSupport = true; - if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk()) + if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_pcie_dynamic_switching_supported()) return; if (adev->flags & AMD_IS_APU || only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v10.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v10.c @@ -268,7 +268,7 @@ SQ_INTERRUPT_WORD_WAVE_CTXID1, ENCODING); switch (encoding) { case SQ_INTERRUPT_WORD_ENCODING_AUTO: - pr_debug( + pr_debug_ratelimited( "sq_intr: auto, se %d, ttrace %d, wlt %d, ttrac_buf0_full %d, ttrac_buf1_full %d, ttrace_utc_err %d\n", REG_GET_FIELD(context_id1, SQ_INTERRUPT_WORD_AUTO_CTXID1, SE_ID), @@ -284,7 +284,7 @@ THREAD_TRACE_UTC_ERROR)); break; case SQ_INTERRUPT_WORD_ENCODING_INST: - pr_debug("sq_intr: inst, se %d, data 0x%x, sa %d, priv %d, wave_id %d, simd_id %d, wgp_id %d\n", + pr_debug_ratelimited("sq_intr: inst, se %d, data 0x%x, sa %d, priv %d, wave_id %d, simd_id %d, wgp_id %d\n", REG_GET_FIELD(context_id1, SQ_INTERRUPT_WORD_WAVE_CTXID1, SE_ID), REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID0, @@ -310,7 +310,7 @@ case SQ_INTERRUPT_WORD_ENCODING_ERROR: sq_intr_err_type = REG_GET_FIELD(context_id0, KFD_CTXID0, ERR_TYPE); - pr_warn("sq_intr: error, se %d, data 0x%x, sa %d, priv %d, wave_id %d, simd_id %d, wgp_id %d, err_type %d\n", + pr_warn_ratelimited("sq_intr: error, se %d, data 0x%x, sa %d, priv %d, wave_id %d, simd_id %d, wgp_id %d, err_type %d\n", REG_GET_FIELD(context_id1, SQ_INTERRUPT_WORD_WAVE_CTXID1, SE_ID), REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID0, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c @@ -150,7 +150,7 @@ static void print_sq_intr_info_auto(uint32_t context_id0, uint32_t context_id1) { - pr_debug( + pr_debug_ratelimited( "sq_intr: auto, ttrace %d, wlt %d, ttrace_buf_full %d, reg_tms %d, cmd_tms %d, host_cmd_ovf %d, host_reg_ovf %d, immed_ovf %d, ttrace_utc_err %d\n", REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_AUTO_CTXID0, THREAD_TRACE), REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_AUTO_CTXID0, WLT), @@ -165,7 +165,7 @@ static void print_sq_intr_info_inst(uint32_t context_id0, uint32_t context_id1) { - pr_debug( + pr_debug_ratelimited( "sq_intr: inst, data 0x%08x, sh %d, priv %d, wave_id %d, simd_id %d, wgp_id %d\n", REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID0, DATA), REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID0, SH_ID), @@ -177,7 +177,7 @@ static void print_sq_intr_info_error(uint32_t context_id0, uint32_t context_id1) { - pr_warn( + pr_warn_ratelimited( "sq_intr: error, detail 0x%08x, type %d, sh %d, priv %d, wave_id %d, simd_id %d, wgp_id %d\n", REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_ERROR_CTXID0, DETAIL), REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_ERROR_CTXID0, TYPE), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c @@ -333,7 +333,7 @@ encoding = REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID, ENCODING); switch (encoding) { case SQ_INTERRUPT_WORD_ENCODING_AUTO: - pr_debug( + pr_debug_ratelimited( "sq_intr: auto, se %d, ttrace %d, wlt %d, ttrac_buf_full %d, reg_tms %d, cmd_tms %d, host_cmd_ovf %d, host_reg_ovf %d, immed_ovf %d, ttrace_utc_err %d\n", REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_AUTO_CTXID, SE_ID), REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_AUTO_CTXID, THREAD_TRACE), @@ -347,7 +347,7 @@ REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_AUTO_CTXID, THREAD_TRACE_UTC_ERROR)); break; case SQ_INTERRUPT_WORD_ENCODING_INST: - pr_debug("sq_intr: inst, se %d, data 0x%x, sh %d, priv %d, wave_id %d, simd_id %d, cu_id %d, intr_data 0x%x\n", + pr_debug_ratelimited("sq_intr: inst, se %d, data 0x%x, sh %d, priv %d, wave_id %d, simd_id %d, cu_id %d, intr_data 0x%x\n", REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID, SE_ID), REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID, DATA), REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID, SH_ID), @@ -366,7 +366,7 @@ break; case SQ_INTERRUPT_WORD_ENCODING_ERROR: sq_intr_err = REG_GET_FIELD(sq_int_data, KFD_SQ_INT_DATA, ERR_TYPE); - pr_warn("sq_intr: error, se %d, data 0x%x, sh %d, priv %d, wave_id %d, simd_id %d, cu_id %d, err_type %d\n", + pr_warn_ratelimited("sq_intr: error, se %d, data 0x%x, sh %d, priv %d, wave_id %d, simd_id %d, cu_id %d, err_type %d\n", REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID, SE_ID), REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID, DATA), REG_GET_FIELD(context_id0, SQ_INTERRUPT_WORD_WAVE_CTXID, SH_ID), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdkfd/kfd_svm.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdkfd/kfd_svm.c @@ -484,11 +484,11 @@ /* We need a new svm_bo. Spin-loop to wait for concurrent * svm_range_bo_release to finish removing this range from - * its range list. After this, it is safe to reuse the - * svm_bo pointer and svm_bo_list head. + * its range list and set prange->svm_bo to null. After this, + * it is safe to reuse the svm_bo pointer and svm_bo_list head. */ - while (!list_empty_careful(&prange->svm_bo_list)) - ; + while (!list_empty_careful(&prange->svm_bo_list) || prange->svm_bo) + cond_resched(); return false; } @@ -617,8 +617,15 @@ void svm_range_vram_node_free(struct svm_range *prange) { - svm_range_bo_unref(prange->svm_bo); - prange->ttm_res = NULL; + /* serialize prange->svm_bo unref */ + mutex_lock(&prange->lock); + /* prange->svm_bo has not been unref */ + if (prange->ttm_res) { + prange->ttm_res = NULL; + mutex_unlock(&prange->lock); + svm_range_bo_unref(prange->svm_bo); + } else + mutex_unlock(&prange->lock); } struct kfd_node * @@ -749,7 +756,7 @@ prange->flags &= ~attrs[i].value; break; case KFD_IOCTL_SVM_ATTR_GRANULARITY: - prange->granularity = attrs[i].value; + prange->granularity = min_t(uint32_t, attrs[i].value, 0x3F); break; default: WARN_ONCE(1, "svm_range_check_attrs wasn't called?"); @@ -809,7 +816,7 @@ } } - return !prange->is_error_flag; + return true; } /** @@ -1627,71 +1634,66 @@ start = prange->start << PAGE_SHIFT; end = (prange->last + 1) << PAGE_SHIFT; - for (addr = start; addr < end && !r; ) { + for (addr = start; !r && addr < end; ) { struct hmm_range *hmm_range; struct vm_area_struct *vma; - unsigned long next; + unsigned long next = 0; unsigned long offset; unsigned long npages; bool readonly; vma = vma_lookup(mm, addr); - if (!vma) { - r = -EFAULT; - goto unreserve_out; - } - readonly = !(vma->vm_flags & VM_WRITE); + if (vma) { + readonly = !(vma->vm_flags & VM_WRITE); - next = min(vma->vm_end, end); - npages = (next - addr) >> PAGE_SHIFT; - WRITE_ONCE(p->svms.faulting_task, current); - r = amdgpu_hmm_range_get_pages(&prange->notifier, addr, npages, - readonly, owner, NULL, - &hmm_range); - WRITE_ONCE(p->svms.faulting_task, NULL); - if (r) { - pr_debug("failed %d to get svm range pages\n", r); - goto unreserve_out; + next = min(vma->vm_end, end); + npages = (next - addr) >> PAGE_SHIFT; + WRITE_ONCE(p->svms.faulting_task, current); + r = amdgpu_hmm_range_get_pages(&prange->notifier, addr, npages, + readonly, owner, NULL, + &hmm_range); + WRITE_ONCE(p->svms.faulting_task, NULL); + if (r) { + pr_debug("failed %d to get svm range pages\n", r); + if (r == -EBUSY) + r = -EAGAIN; + } + } else { + r = -EFAULT; } - offset = (addr - start) >> PAGE_SHIFT; - r = svm_range_dma_map(prange, ctx->bitmap, offset, npages, - hmm_range->hmm_pfns); - if (r) { - pr_debug("failed %d to dma map range\n", r); - goto unreserve_out; + if (!r) { + offset = (addr - start) >> PAGE_SHIFT; + r = svm_range_dma_map(prange, ctx->bitmap, offset, npages, + hmm_range->hmm_pfns); + if (r) + pr_debug("failed %d to dma map range\n", r); } svm_range_lock(prange); - if (amdgpu_hmm_range_get_pages_done(hmm_range)) { + if (!r && amdgpu_hmm_range_get_pages_done(hmm_range)) { pr_debug("hmm update the range, need validate again\n"); r = -EAGAIN; - goto unlock_out; } - if (!list_empty(&prange->child_list)) { + + if (!r && !list_empty(&prange->child_list)) { pr_debug("range split by unmap in parallel, validate again\n"); r = -EAGAIN; - goto unlock_out; } - r = svm_range_map_to_gpus(prange, offset, npages, readonly, - ctx->bitmap, wait, flush_tlb); + if (!r) + r = svm_range_map_to_gpus(prange, offset, npages, readonly, + ctx->bitmap, wait, flush_tlb); + + if (!r && next == end) + prange->mapped_to_gpu = true; -unlock_out: svm_range_unlock(prange); addr = next; } - if (addr == end) { - prange->validated_once = true; - prange->mapped_to_gpu = true; - } - -unreserve_out: svm_range_unreserve_bos(ctx); - - prange->is_error_flag = !!r; if (!r) prange->validate_timestamp = ktime_get_boottime(); @@ -2057,7 +2059,8 @@ next = interval_tree_iter_next(node, start, last); next_start = min(node->last, last) + 1; - if (svm_range_is_same_attrs(p, prange, nattr, attrs)) { + if (svm_range_is_same_attrs(p, prange, nattr, attrs) && + prange->mapped_to_gpu) { /* nothing to do */ } else if (node->start < start || node->last > last) { /* node intersects the update range and its attributes @@ -3470,7 +3473,7 @@ struct svm_range *next; bool update_mapping = false; bool flush_tlb; - int r = 0; + int r, ret = 0; pr_debug("pasid 0x%x svms 0x%p [0x%llx 0x%llx] pages 0x%llx\n", p->pasid, &p->svms, start, start + size - 1, size); @@ -3558,7 +3561,7 @@ out_unlock_range: mutex_unlock(&prange->migrate_mutex); if (r) - break; + ret = r; } svm_range_debug_dump(svms); @@ -3571,7 +3574,7 @@ pr_debug("pasid 0x%x svms 0x%p [0x%llx 0x%llx] done, r=%d\n", p->pasid, &p->svms, start, start + size - 1, r); - return r; + return ret ? ret : r; } static int only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/amdkfd/kfd_svm.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/amdkfd/kfd_svm.h @@ -132,9 +132,7 @@ struct list_head child_list; DECLARE_BITMAP(bitmap_access, MAX_GPU_INSTANCE); DECLARE_BITMAP(bitmap_aip, MAX_GPU_INSTANCE); - bool validated_once; bool mapped_to_gpu; - bool is_error_flag; }; static inline void svm_range_lock(struct svm_range *prange) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -1591,31 +1591,31 @@ unsigned int upper_link_bw_in_kbps = 0, down_link_bw_in_kbps = 0; unsigned int max_compressed_bw_in_kbps = 0; struct dc_dsc_bw_range bw_range = {0}; - struct drm_dp_mst_topology_mgr *mst_mgr; + uint16_t full_pbn = aconnector->mst_output_port->full_pbn; /* - * check if the mode could be supported if DSC pass-through is supported - * AND check if there enough bandwidth available to support the mode - * with DSC enabled. + * Consider the case with the depth of the mst topology tree is equal or less than 2 + * A. When dsc bitstream can be transmitted along the entire path + * 1. dsc is possible between source and branch/leaf device (common dsc params is possible), AND + * 2. dsc passthrough supported at MST branch, or + * 3. dsc decoding supported at leaf MST device + * Use maximum dsc compression as bw constraint + * B. When dsc bitstream cannot be transmitted along the entire path + * Use native bw as bw constraint */ if (is_dsc_common_config_possible(stream, &bw_range) && - aconnector->mst_output_port->passthrough_aux) { - mst_mgr = aconnector->mst_output_port->mgr; - mutex_lock(&mst_mgr->lock); - + (aconnector->mst_output_port->passthrough_aux || + aconnector->dsc_aux == &aconnector->mst_output_port->aux)) { cur_link_settings = stream->link->verified_link_cap; upper_link_bw_in_kbps = dc_link_bandwidth_kbps(aconnector->dc_link, - &cur_link_settings - ); - down_link_bw_in_kbps = kbps_from_pbn(aconnector->mst_output_port->full_pbn); + &cur_link_settings); + down_link_bw_in_kbps = kbps_from_pbn(full_pbn); /* pick the bottleneck */ end_to_end_bw_in_kbps = min(upper_link_bw_in_kbps, down_link_bw_in_kbps); - mutex_unlock(&mst_mgr->lock); - /* * use the maximum dsc compression bandwidth as the required * bandwidth for the mode @@ -1630,8 +1630,7 @@ /* check if mode could be supported within full_pbn */ bpp = convert_dc_color_depth_into_bpc(stream->timing.display_color_depth) * 3; pbn = drm_dp_calc_pbn_mode(stream->timing.pix_clk_100hz / 10, bpp, false); - - if (pbn > aconnector->mst_output_port->full_pbn) + if (pbn > full_pbn) return DC_FAIL_BANDWIDTH_VALIDATE; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -556,7 +556,7 @@ for (i = 0; i < MAX_PIPES; i++) { struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg; - if (res_ctx->pipe_ctx[i].stream != stream) + if (res_ctx->pipe_ctx[i].stream != stream || !tg) continue; return tg->funcs->get_frame_count(tg); @@ -615,7 +615,7 @@ for (i = 0; i < MAX_PIPES; i++) { struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg; - if (res_ctx->pipe_ctx[i].stream != stream) + if (res_ctx->pipe_ctx[i].stream != stream || !tg) continue; tg->funcs->get_scanoutpos(tg, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/dc_stream.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dc_stream.h @@ -302,7 +302,6 @@ bool vblank_synchronized; bool fpo_in_use; struct mall_stream_config mall_stream_config; - bool skip_edp_power_down; }; #define ABM_LEVEL_IMMEDIATE_DISABLE 255 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c @@ -586,7 +586,8 @@ if (state == PSR_STATE0) break; } - fsleep(500); + /* must *not* be fsleep - this can be called from high irq levels */ + udelay(500); } /* assert if max retry hit */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c @@ -216,7 +216,8 @@ break; } - fsleep(500); + /* must *not* be fsleep - this can be called from high irq levels */ + udelay(500); } /* assert if max retry hit */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c @@ -476,7 +476,8 @@ struct dmcu *dmcu = dc->res_pool->dmcu; if (signal == SIGNAL_TYPE_EDP && - link->dc->hwss.edp_backlight_control) + link->dc->hwss.edp_backlight_control && + !link->skip_implict_edp_power_control) link->dc->hwss.edp_backlight_control(link, false); else if (dmcu != NULL && dmcu->funcs->lock_phy) dmcu->funcs->lock_phy(dmcu); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c @@ -216,7 +216,7 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *ctx) { int i; - uint8_t num_ways = 0; + uint32_t num_ways = 0; uint32_t mall_ss_size_bytes = 0; mall_ss_size_bytes = ctx->bw_ctx.bw.dcn.mall_ss_size_bytes; @@ -246,7 +246,8 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable) { union dmub_rb_cmd cmd; - uint8_t ways, i; + uint8_t i; + uint32_t ways; int j; bool mall_ss_unsupported = false; struct dc_plane_state *plane = NULL; @@ -306,7 +307,7 @@ cmd.cab.header.type = DMUB_CMD__CAB_FOR_SS; cmd.cab.header.sub_type = DMUB_CMD__CAB_DCN_SS_FIT_IN_CAB; cmd.cab.header.payload_bytes = sizeof(cmd.cab) - sizeof(cmd.cab.header); - cmd.cab.cab_alloc_ways = ways; + cmd.cab.cab_alloc_ways = (uint8_t)ways; dm_execute_dmub_cmd(dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_NO_WAIT); @@ -484,8 +485,7 @@ if (plane_state->blend_tf->type == TF_TYPE_HWPWL) lut_params = &plane_state->blend_tf->pwl; else if (plane_state->blend_tf->type == TF_TYPE_DISTRIBUTED_POINTS) { - cm_helper_translate_curve_to_hw_format(plane_state->ctx, - plane_state->blend_tf, + cm3_helper_translate_curve_to_hw_format(plane_state->blend_tf, &dpp_base->regamma_params, false); lut_params = &dpp_base->regamma_params; } @@ -499,8 +499,7 @@ else if (plane_state->in_shaper_func->type == TF_TYPE_DISTRIBUTED_POINTS) { // TODO: dpp_base replace ASSERT(false); - cm_helper_translate_curve_to_hw_format(plane_state->ctx, - plane_state->in_shaper_func, + cm3_helper_translate_curve_to_hw_format(plane_state->in_shaper_func, &dpp_base->shaper_params, true); lut_params = &dpp_base->shaper_params; } @@ -1575,3 +1574,101 @@ if (opp) hws->funcs.wait_for_blank_complete(opp); } + +void dcn32_blank_phantom(struct dc *dc, + struct timing_generator *tg, + int width, + int height) +{ + struct dce_hwseq *hws = dc->hwseq; + enum dc_color_space color_space; + struct tg_color black_color = {0}; + struct output_pixel_processor *opp = NULL; + uint32_t num_opps, opp_id_src0, opp_id_src1; + uint32_t otg_active_width, otg_active_height; + uint32_t i; + + /* program opp dpg blank color */ + color_space = COLOR_SPACE_SRGB; + color_space_to_black_color(dc, color_space, &black_color); + + otg_active_width = width; + otg_active_height = height; + + /* get the OPTC source */ + tg->funcs->get_optc_source(tg, &num_opps, &opp_id_src0, &opp_id_src1); + ASSERT(opp_id_src0 < dc->res_pool->res_cap->num_opp); + + for (i = 0; i < dc->res_pool->res_cap->num_opp; i++) { + if (dc->res_pool->opps[i] != NULL && dc->res_pool->opps[i]->inst == opp_id_src0) { + opp = dc->res_pool->opps[i]; + break; + } + } + + if (opp && opp->funcs->opp_set_disp_pattern_generator) + opp->funcs->opp_set_disp_pattern_generator( + opp, + CONTROLLER_DP_TEST_PATTERN_SOLID_COLOR, + CONTROLLER_DP_COLOR_SPACE_UDEFINED, + COLOR_DEPTH_UNDEFINED, + &black_color, + otg_active_width, + otg_active_height, + 0); + + if (tg->funcs->is_tg_enabled(tg)) + hws->funcs.wait_for_blank_complete(opp); +} + +bool dcn32_is_pipe_topology_transition_seamless(struct dc *dc, + const struct dc_state *cur_ctx, + const struct dc_state *new_ctx) +{ + int i; + const struct pipe_ctx *cur_pipe, *new_pipe; + bool is_seamless = true; + + for (i = 0; i < dc->res_pool->pipe_count; i++) { + cur_pipe = &cur_ctx->res_ctx.pipe_ctx[i]; + new_pipe = &new_ctx->res_ctx.pipe_ctx[i]; + + if (resource_is_pipe_type(cur_pipe, FREE_PIPE) || + resource_is_pipe_type(new_pipe, FREE_PIPE)) + /* adding or removing free pipes is always seamless */ + continue; + else if (resource_is_pipe_type(cur_pipe, OTG_MASTER)) { + if (resource_is_pipe_type(new_pipe, OTG_MASTER)) + if (cur_pipe->stream->stream_id == new_pipe->stream->stream_id) + /* OTG master with the same stream is seamless */ + continue; + } else if (resource_is_pipe_type(cur_pipe, OPP_HEAD)) { + if (resource_is_pipe_type(new_pipe, OPP_HEAD)) { + if (cur_pipe->stream_res.tg == new_pipe->stream_res.tg) + /* + * OPP heads sharing the same timing + * generator is seamless + */ + continue; + } + } else if (resource_is_pipe_type(cur_pipe, DPP_PIPE)) { + if (resource_is_pipe_type(new_pipe, DPP_PIPE)) { + if (cur_pipe->stream_res.opp == new_pipe->stream_res.opp) + /* + * DPP pipes sharing the same OPP head is + * seamless + */ + continue; + } + } + + /* + * This pipe's transition doesn't fall under any seamless + * conditions + */ + is_seamless = false; + break; + } + + return is_seamless; +} only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h @@ -115,4 +115,13 @@ struct dc *dc, struct timing_generator *tg); +void dcn32_blank_phantom(struct dc *dc, + struct timing_generator *tg, + int width, + int height); + +bool dcn32_is_pipe_topology_transition_seamless(struct dc *dc, + const struct dc_state *cur_ctx, + const struct dc_state *new_ctx); + #endif /* __DC_HWSS_DCN32_H__ */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c @@ -115,6 +115,8 @@ .update_phantom_vp_position = dcn32_update_phantom_vp_position, .update_dsc_pg = dcn32_update_dsc_pg, .apply_update_flags_for_phantom = dcn32_apply_update_flags_for_phantom, + .blank_phantom = dcn32_blank_phantom, + .is_pipe_topology_transition_seamless = dcn32_is_pipe_topology_transition_seamless, }; static const struct hwseq_private_funcs dcn32_private_funcs = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c @@ -1958,6 +1958,7 @@ int i, pipe_idx, vlevel_temp = 0; double dcfclk = dcn3_2_soc.clock_limits[0].dcfclk_mhz; double dcfclk_from_validation = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb]; + double dram_speed_from_validation = context->bw_ctx.dml.vba.DRAMSpeed; double dcfclk_from_fw_based_mclk_switching = dcfclk_from_validation; bool pstate_en = context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][context->bw_ctx.dml.vba.maxMpcComb] != dm_dram_clock_change_unsupported; @@ -2145,7 +2146,7 @@ } if (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_C].valid) { - min_dram_speed_mts = context->bw_ctx.dml.vba.DRAMSpeed; + min_dram_speed_mts = dram_speed_from_validation; min_dram_speed_mts_margin = 160; context->bw_ctx.dml.soc.dram_clock_change_latency_us = only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h @@ -388,6 +388,11 @@ void (*z10_restore)(const struct dc *dc); void (*z10_save_init)(struct dc *dc); + void (*blank_phantom)(struct dc *dc, + struct timing_generator *tg, + int width, + int height); + void (*update_visual_confirm_color)(struct dc *dc, struct pipe_ctx *pipe_ctx, int mpcc_id); @@ -396,6 +401,9 @@ struct dc_state *context, struct pipe_ctx *phantom_pipe); void (*apply_update_flags_for_phantom)(struct pipe_ctx *phantom_pipe); + bool (*is_pipe_topology_transition_seamless)(struct dc *dc, + const struct dc_state *cur_ctx, + const struct dc_state *new_ctx); void (*commit_subvp_config)(struct dc *dc, struct dc_state *context); void (*enable_phantom_streams)(struct dc *dc, struct dc_state *context); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/inc/link.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/inc/link.h @@ -277,6 +277,7 @@ bool (*edp_receiver_ready_T9)(struct dc_link *link); bool (*edp_receiver_ready_T7)(struct dc_link *link); bool (*edp_power_alpm_dpcd_enable)(struct dc_link *link, bool enable); + void (*edp_set_panel_power)(struct dc_link *link, bool powerOn); /*************************** DP CTS ************************************/ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/link/link_detection.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/link_detection.c @@ -1164,6 +1164,12 @@ dm_helpers_init_panel_settings(dc_ctx, &link->panel_config, sink); // Override dc_panel_config if system has specific settings dm_helpers_override_panel_settings(dc_ctx, &link->panel_config); + + //sink only can use supported link rate table, we are foreced to enable it + if (link->reported_link_cap.link_rate == LINK_RATE_UNKNOWN) + link->panel_config.ilr.optimize_edp_link_rate = true; + if (edp_is_ilr_optimization_enabled(link)) + link->reported_link_cap.link_rate = get_max_link_rate_from_ilr_table(link); } } else { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/link/link_dpms.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/link_dpms.c @@ -1926,7 +1926,7 @@ dp_disable_link_phy(link, link_res, signal); if (link->connector_signal == SIGNAL_TYPE_EDP) { - if (!link->dc->config.edp_no_power_sequencing) + if (!link->skip_implict_edp_power_control) link->dc->hwss.edp_power_control(link, false); } @@ -2207,7 +2207,7 @@ * link settings. Need to call disable first before enabling at * new link settings. */ - if (link->link_status.link_active && !stream->skip_edp_power_down) + if (link->link_status.link_active) disable_link(link, &pipe_ctx->link_res, pipe_ctx->stream->signal); switch (pipe_ctx->stream->signal) { @@ -2326,9 +2326,7 @@ dc->hwss.disable_stream(pipe_ctx); } else { dc->hwss.disable_stream(pipe_ctx); - if (!pipe_ctx->stream->skip_edp_power_down) { - disable_link(pipe_ctx->stream->link, &pipe_ctx->link_res, pipe_ctx->stream->signal); - } + disable_link(pipe_ctx->stream->link, &pipe_ctx->link_res, pipe_ctx->stream->signal); } if (pipe_ctx->stream->timing.flags.DSC) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c @@ -707,8 +707,7 @@ * edp_supported_link_rates_count is only valid for eDP v1.4 or higher. * Per VESA eDP spec, "The DPCD revision for eDP v1.4 is 13h" */ - if (link->dpcd_caps.dpcd_rev.raw < DPCD_REV_13 || - link->dpcd_caps.edp_supported_link_rates_count == 0) { + if (!edp_is_ilr_optimization_enabled(link)) { *link_setting = link->verified_link_cap; return true; } @@ -772,8 +771,7 @@ * edp_supported_link_rates_count is only valid for eDP v1.4 or higher. * Per VESA eDP spec, "The DPCD revision for eDP v1.4 is 13h" */ - if ((link->dpcd_caps.dpcd_rev.raw < DPCD_REV_13 || - link->dpcd_caps.edp_supported_link_rates_count == 0)) { + if (!edp_is_ilr_optimization_enabled(link)) { /* for DSC enabled case, we search for minimum lane count */ memset(&initial_link_setting, 0, sizeof(initial_link_setting)); initial_link_setting.lane_count = LANE_COUNT_ONE; @@ -1937,9 +1935,7 @@ * edp_supported_link_rates_count is only valid for eDP v1.4 or higher. * Per VESA eDP spec, "The DPCD revision for eDP v1.4 is 13h" */ - if (link->dpcd_caps.dpcd_rev.raw >= DPCD_REV_13 && - (link->panel_config.ilr.optimize_edp_link_rate || - link->reported_link_cap.link_rate == LINK_RATE_UNKNOWN)) { + if (link->dpcd_caps.dpcd_rev.raw >= DPCD_REV_13) { // Read DPCD 00010h - 0001Fh 16 bytes at one shot core_link_read_dpcd(link, DP_SUPPORTED_LINK_RATES, supported_link_rates, sizeof(supported_link_rates)); @@ -1957,12 +1953,10 @@ link_rate = linkRateInKHzToLinkRateMultiplier(link_rate_in_khz); link->dpcd_caps.edp_supported_link_rates[link->dpcd_caps.edp_supported_link_rates_count] = link_rate; link->dpcd_caps.edp_supported_link_rates_count++; - - if (link->reported_link_cap.link_rate < link_rate) - link->reported_link_cap.link_rate = link_rate; } } } + core_link_read_dpcd(link, DP_EDP_BACKLIGHT_ADJUSTMENT_CAP, &backlight_adj_cap, sizeof(backlight_adj_cap)); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c @@ -73,7 +73,8 @@ { struct dc *dc = link->ctx->dc; - if (!link->wa_flags.dp_keep_receiver_powered) + if (!link->wa_flags.dp_keep_receiver_powered && + !link->skip_implict_edp_power_control) dpcd_write_rx_power_ctrl(link, false); dc->hwss.disable_link_output(link, link_res, signal); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.c @@ -151,7 +151,7 @@ lt_settings->cr_pattern_time = 16000; /* Fixed VS/PE specific: Toggle link rate */ - apply_toggle_rate_wa = (link->vendor_specific_lttpr_link_rate_wa == target_rate); + apply_toggle_rate_wa = ((link->vendor_specific_lttpr_link_rate_wa == target_rate) || (link->vendor_specific_lttpr_link_rate_wa == 0)); target_rate = get_dpcd_link_rate(<_settings->link_settings); toggle_rate = (target_rate == 0x6) ? 0xA : 0x6; @@ -317,7 +317,7 @@ /* Vendor specific: Toggle link rate */ toggle_rate = (rate == 0x6) ? 0xA : 0x6; - if (link->vendor_specific_lttpr_link_rate_wa == rate) { + if (link->vendor_specific_lttpr_link_rate_wa == rate || link->vendor_specific_lttpr_link_rate_wa == 0) { core_link_write_dpcd( link, DP_LINK_BW_SET, @@ -680,7 +680,7 @@ /* Vendor specific: Toggle link rate */ toggle_rate = (rate == 0x6) ? 0xA : 0x6; - if (link->vendor_specific_lttpr_link_rate_wa == rate) { + if (link->vendor_specific_lttpr_link_rate_wa == rate || link->vendor_specific_lttpr_link_rate_wa == 0) { core_link_write_dpcd( link, DP_LINK_BW_SET, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c @@ -33,6 +33,7 @@ #include "link_dp_capability.h" #include "dm_helpers.h" #include "dal_asic_id.h" +#include "link_dp_phy.h" #include "dce/dmub_psr.h" #include "abm.h" #define DC_LOGGER_INIT(logger) @@ -266,8 +267,8 @@ if (link && link->dpcd_sink_ext_caps.bits.oled == 1) { if (!read_default_bl_aux(link, &default_backlight)) default_backlight = 150000; - // if < 5 nits or > 5000, it might be wrong readback - if (default_backlight < 5000 || default_backlight > 5000000) + // if < 1 nits or > 5000, it might be wrong readback + if (default_backlight < 1000 || default_backlight > 5000000) default_backlight = 150000; // return edp_set_backlight_level_nits(link, true, @@ -275,6 +276,24 @@ } return false; } +bool edp_is_ilr_optimization_enabled(struct dc_link *link) +{ + if (link->dpcd_caps.edp_supported_link_rates_count == 0 || !link->panel_config.ilr.optimize_edp_link_rate) + return false; + return true; +} + +enum dc_link_rate get_max_link_rate_from_ilr_table(struct dc_link *link) +{ + enum dc_link_rate link_rate = link->reported_link_cap.link_rate; + + for (int i = 0; i < link->dpcd_caps.edp_supported_link_rates_count; i++) { + if (link_rate < link->dpcd_caps.edp_supported_link_rates[i]) + link_rate = link->dpcd_caps.edp_supported_link_rates[i]; + } + + return link_rate; +} bool edp_is_ilr_optimization_required(struct dc_link *link, struct dc_crtc_timing *crtc_timing) @@ -287,8 +306,7 @@ ASSERT(link || crtc_timing); // invalid input - if (link->dpcd_caps.edp_supported_link_rates_count == 0 || - !link->panel_config.ilr.optimize_edp_link_rate) + if (!edp_is_ilr_optimization_enabled(link)) return false; @@ -338,6 +356,34 @@ link->dc->hwss.edp_backlight_control(link, true); } +void edp_set_panel_power(struct dc_link *link, bool powerOn) +{ + if (powerOn) { + // 1. panel VDD on + if (!link->dc->config.edp_no_power_sequencing) + link->dc->hwss.edp_power_control(link, true); + link->dc->hwss.edp_wait_for_hpd_ready(link, true); + + // 2. panel BL on + if (link->dc->hwss.edp_backlight_control) + link->dc->hwss.edp_backlight_control(link, true); + + // 3. Rx power on + dpcd_write_rx_power_ctrl(link, true); + } else { + // 3. Rx power off + dpcd_write_rx_power_ctrl(link, false); + + // 2. panel BL off + if (link->dc->hwss.edp_backlight_control) + link->dc->hwss.edp_backlight_control(link, false); + + // 1. panel VDD off + if (!link->dc->config.edp_no_power_sequencing) + link->dc->hwss.edp_power_control(link, false); + } +} + bool edp_wait_for_t12(struct dc_link *link) { if (link->connector_signal == SIGNAL_TYPE_EDP && link->dc->hwss.edp_wait_for_T12) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.h @@ -55,9 +55,12 @@ bool edp_wait_for_t12(struct dc_link *link); bool edp_is_ilr_optimization_required(struct dc_link *link, struct dc_crtc_timing *crtc_timing); +bool edp_is_ilr_optimization_enabled(struct dc_link *link); +enum dc_link_rate get_max_link_rate_from_ilr_table(struct dc_link *link); bool edp_backlight_enable_aux(struct dc_link *link, bool enable); void edp_add_delay_for_T9(struct dc_link *link); bool edp_receiver_ready_T9(struct dc_link *link); bool edp_receiver_ready_T7(struct dc_link *link); bool edp_power_alpm_dpcd_enable(struct dc_link *link, bool enable); +void edp_set_panel_power(struct dc_link *link, bool powerOn); #endif /* __DC_LINK_EDP_POWER_CONTROL_H__ */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dmub/dmub_srv.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dmub/dmub_srv.h @@ -186,6 +186,7 @@ uint32_t vbios_size; const uint8_t *fw_inst_const; const uint8_t *fw_bss_data; + bool is_mailbox_in_inbox; }; /** @@ -205,20 +206,25 @@ */ struct dmub_srv_region_info { uint32_t fb_size; + uint32_t inbox_size; uint8_t num_regions; struct dmub_region regions[DMUB_WINDOW_TOTAL]; }; /** - * struct dmub_srv_fb_params - parameters used for driver fb setup + * struct dmub_srv_memory_params - parameters used for driver fb setup * @region_info: region info calculated by dmub service - * @cpu_addr: base cpu address for the framebuffer - * @gpu_addr: base gpu virtual address for the framebuffer + * @cpu_fb_addr: base cpu address for the framebuffer + * @cpu_inbox_addr: base cpu address for the gart + * @gpu_fb_addr: base gpu virtual address for the framebuffer + * @gpu_inbox_addr: base gpu virtual address for the gart */ -struct dmub_srv_fb_params { +struct dmub_srv_memory_params { const struct dmub_srv_region_info *region_info; - void *cpu_addr; - uint64_t gpu_addr; + void *cpu_fb_addr; + void *cpu_inbox_addr; + uint64_t gpu_fb_addr; + uint64_t gpu_inbox_addr; }; /** @@ -545,8 +551,8 @@ * DMUB_STATUS_OK - success * DMUB_STATUS_INVALID - unspecified error */ -enum dmub_status dmub_srv_calc_fb_info(struct dmub_srv *dmub, - const struct dmub_srv_fb_params *params, +enum dmub_status dmub_srv_calc_mem_info(struct dmub_srv *dmub, + const struct dmub_srv_memory_params *params, struct dmub_srv_fb_info *out); /** only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c @@ -385,7 +385,7 @@ uint32_t fw_state_size = DMUB_FW_STATE_SIZE; uint32_t trace_buffer_size = DMUB_TRACE_BUFFER_SIZE; uint32_t scratch_mem_size = DMUB_SCRATCH_MEM_SIZE; - + uint32_t previous_top = 0; if (!dmub->sw_init) return DMUB_STATUS_INVALID; @@ -410,8 +410,15 @@ bios->base = dmub_align(stack->top, 256); bios->top = bios->base + params->vbios_size; - mail->base = dmub_align(bios->top, 256); - mail->top = mail->base + DMUB_MAILBOX_SIZE; + if (params->is_mailbox_in_inbox) { + mail->base = 0; + mail->top = mail->base + DMUB_MAILBOX_SIZE; + previous_top = bios->top; + } else { + mail->base = dmub_align(bios->top, 256); + mail->top = mail->base + DMUB_MAILBOX_SIZE; + previous_top = mail->top; + } fw_info = dmub_get_fw_meta_info(params); @@ -430,7 +437,7 @@ dmub->fw_version = fw_info->fw_version; } - trace_buff->base = dmub_align(mail->top, 256); + trace_buff->base = dmub_align(previous_top, 256); trace_buff->top = trace_buff->base + dmub_align(trace_buffer_size, 64); fw_state->base = dmub_align(trace_buff->top, 256); @@ -441,11 +448,14 @@ out->fb_size = dmub_align(scratch_mem->top, 4096); + if (params->is_mailbox_in_inbox) + out->inbox_size = dmub_align(mail->top, 4096); + return DMUB_STATUS_OK; } -enum dmub_status dmub_srv_calc_fb_info(struct dmub_srv *dmub, - const struct dmub_srv_fb_params *params, +enum dmub_status dmub_srv_calc_mem_info(struct dmub_srv *dmub, + const struct dmub_srv_memory_params *params, struct dmub_srv_fb_info *out) { uint8_t *cpu_base; @@ -460,8 +470,8 @@ if (params->region_info->num_regions != DMUB_NUM_WINDOWS) return DMUB_STATUS_INVALID; - cpu_base = (uint8_t *)params->cpu_addr; - gpu_base = params->gpu_addr; + cpu_base = (uint8_t *)params->cpu_fb_addr; + gpu_base = params->gpu_fb_addr; for (i = 0; i < DMUB_NUM_WINDOWS; ++i) { const struct dmub_region *reg = @@ -469,6 +479,12 @@ out->fb[i].cpu_addr = cpu_base + reg->base; out->fb[i].gpu_addr = gpu_base + reg->base; + + if (i == DMUB_WINDOW_4_MAILBOX && params->cpu_inbox_addr != 0) { + out->fb[i].cpu_addr = (uint8_t *)params->cpu_inbox_addr + reg->base; + out->fb[i].gpu_addr = params->gpu_inbox_addr + reg->base; + } + out->fb[i].size = reg->top - reg->base; } @@ -657,9 +673,16 @@ return DMUB_STATUS_INVALID; if (dmub->hw_funcs.get_inbox1_rptr && dmub->hw_funcs.get_inbox1_wptr) { - dmub->inbox1_rb.rptr = dmub->hw_funcs.get_inbox1_rptr(dmub); - dmub->inbox1_rb.wrpt = dmub->hw_funcs.get_inbox1_wptr(dmub); - dmub->inbox1_last_wptr = dmub->inbox1_rb.wrpt; + uint32_t rptr = dmub->hw_funcs.get_inbox1_rptr(dmub); + uint32_t wptr = dmub->hw_funcs.get_inbox1_wptr(dmub); + + if (rptr > dmub->inbox1_rb.capacity || wptr > dmub->inbox1_rb.capacity) { + return DMUB_STATUS_HW_FAILURE; + } else { + dmub->inbox1_rb.rptr = rptr; + dmub->inbox1_rb.wrpt = wptr; + dmub->inbox1_last_wptr = dmub->inbox1_rb.wrpt; + } } return DMUB_STATUS_OK; @@ -693,6 +716,11 @@ if (!dmub->hw_init) return DMUB_STATUS_INVALID; + if (dmub->inbox1_rb.rptr > dmub->inbox1_rb.capacity || + dmub->inbox1_rb.wrpt > dmub->inbox1_rb.capacity) { + return DMUB_STATUS_HW_FAILURE; + } + if (dmub_rb_push_front(&dmub->inbox1_rb, cmd)) return DMUB_STATUS_OK; @@ -942,6 +970,7 @@ ack = dmub->hw_funcs.read_inbox0_ack_register(dmub); if (ack) return DMUB_STATUS_OK; + udelay(1); } return DMUB_STATUS_TIMEOUT; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/include/asic_reg/gc/gc_11_0_0_offset.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/include/asic_reg/gc/gc_11_0_0_offset.h @@ -6369,6 +6369,8 @@ #define regTCP_INVALIDATE_BASE_IDX 1 #define regTCP_STATUS 0x19a1 #define regTCP_STATUS_BASE_IDX 1 +#define regTCP_CNTL 0x19a2 +#define regTCP_CNTL_BASE_IDX 1 #define regTCP_CNTL2 0x19a3 #define regTCP_CNTL2_BASE_IDX 1 #define regTCP_DEBUG_INDEX 0x19a5 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/include/pptable.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/include/pptable.h @@ -78,7 +78,7 @@ typedef struct _ATOM_PPLIB_STATE { UCHAR ucNonClockStateIndex; - UCHAR ucClockStateIndices[1]; // variable-sized + UCHAR ucClockStateIndices[]; // variable-sized } ATOM_PPLIB_STATE; @@ -473,7 +473,7 @@ /** * Driver will read the first ucNumDPMLevels in this array */ - UCHAR clockInfoIndex[1]; + UCHAR clockInfoIndex[]; } ATOM_PPLIB_STATE_V2; typedef struct _StateArray{ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h @@ -164,7 +164,7 @@ typedef struct _ATOM_Tonga_State_Array { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Tonga_State entries[1]; /* Dynamically allocate entries. */ + ATOM_Tonga_State entries[]; /* Dynamically allocate entries. */ } ATOM_Tonga_State_Array; typedef struct _ATOM_Tonga_MCLK_Dependency_Record { @@ -179,7 +179,7 @@ typedef struct _ATOM_Tonga_MCLK_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Tonga_MCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Tonga_MCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Tonga_MCLK_Dependency_Table; typedef struct _ATOM_Tonga_SCLK_Dependency_Record { @@ -194,7 +194,7 @@ typedef struct _ATOM_Tonga_SCLK_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Tonga_SCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Tonga_SCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Tonga_SCLK_Dependency_Table; typedef struct _ATOM_Polaris_SCLK_Dependency_Record { @@ -210,7 +210,7 @@ typedef struct _ATOM_Polaris_SCLK_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Polaris_SCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Polaris_SCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Polaris_SCLK_Dependency_Table; typedef struct _ATOM_Tonga_PCIE_Record { @@ -222,7 +222,7 @@ typedef struct _ATOM_Tonga_PCIE_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Tonga_PCIE_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Tonga_PCIE_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Tonga_PCIE_Table; typedef struct _ATOM_Polaris10_PCIE_Record { @@ -235,7 +235,7 @@ typedef struct _ATOM_Polaris10_PCIE_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Polaris10_PCIE_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Polaris10_PCIE_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Polaris10_PCIE_Table; @@ -252,7 +252,7 @@ typedef struct _ATOM_Tonga_MM_Dependency_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Tonga_MM_Dependency_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Tonga_MM_Dependency_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Tonga_MM_Dependency_Table; typedef struct _ATOM_Tonga_Voltage_Lookup_Record { @@ -265,7 +265,7 @@ typedef struct _ATOM_Tonga_Voltage_Lookup_Table { UCHAR ucRevId; UCHAR ucNumEntries; /* Number of entries. */ - ATOM_Tonga_Voltage_Lookup_Record entries[1]; /* Dynamically allocate entries. */ + ATOM_Tonga_Voltage_Lookup_Record entries[]; /* Dynamically allocate entries. */ } ATOM_Tonga_Voltage_Lookup_Table; typedef struct _ATOM_Tonga_Fan_Table { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c @@ -1823,9 +1823,7 @@ data->mclk_dpm_key_disabled = hwmgr->feature_mask & PP_MCLK_DPM_MASK ? false : true; data->sclk_dpm_key_disabled = hwmgr->feature_mask & PP_SCLK_DPM_MASK ? false : true; - data->pcie_dpm_key_disabled = - !amdgpu_device_pcie_dynamic_switching_supported() || - !(hwmgr->feature_mask & PP_PCIE_DPM_MASK); + data->pcie_dpm_key_disabled = !(hwmgr->feature_mask & PP_PCIE_DPM_MASK); /* need to set voltage control types before EVV patching */ data->voltage_control = SMU7_VOLTAGE_CONTROL_NONE; data->vddci_control = SMU7_VOLTAGE_CONTROL_NONE; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -1232,7 +1232,7 @@ { struct smu_feature *feature = &smu->smu_feature; struct amdgpu_device *adev = smu->adev; - uint32_t pcie_gen = 0, pcie_width = 0; + uint8_t pcie_gen = 0, pcie_width = 0; uint64_t features_supported; int ret = 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h @@ -856,7 +856,7 @@ * &pcie_gen_cap: Maximum allowed PCIe generation. * &pcie_width_cap: Maximum allowed PCIe width. */ - int (*update_pcie_parameters)(struct smu_context *smu, uint32_t pcie_gen_cap, uint32_t pcie_width_cap); + int (*update_pcie_parameters)(struct smu_context *smu, uint8_t pcie_gen_cap, uint8_t pcie_width_cap); /** * @i2c_init: Initialize i2c. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h @@ -296,8 +296,8 @@ uint32_t pptable_id); int smu_v13_0_update_pcie_parameters(struct smu_context *smu, - uint32_t pcie_gen_cap, - uint32_t pcie_width_cap); + uint8_t pcie_gen_cap, + uint8_t pcie_width_cap); #endif #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c @@ -2375,8 +2375,8 @@ } static int navi10_update_pcie_parameters(struct smu_context *smu, - uint32_t pcie_gen_cap, - uint32_t pcie_width_cap) + uint8_t pcie_gen_cap, + uint8_t pcie_width_cap) { struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context; PPTable_t *pptable = smu->smu_table.driver_pptable; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c @@ -258,8 +258,11 @@ } smu_table->ecc_table = kzalloc(tables[SMU_TABLE_ECCINFO].size, GFP_KERNEL); - if (!smu_table->ecc_table) + if (!smu_table->ecc_table) { + kfree(smu_table->metrics_table); + kfree(smu_table->gpu_metrics_table); return -ENOMEM; + } return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c @@ -2426,8 +2426,8 @@ } int smu_v13_0_update_pcie_parameters(struct smu_context *smu, - uint32_t pcie_gen_cap, - uint32_t pcie_width_cap) + uint8_t pcie_gen_cap, + uint8_t pcie_width_cap) { struct smu_13_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context; struct smu_13_0_pcie_table *pcie_table = @@ -2436,7 +2436,10 @@ uint32_t smu_pcie_arg; int ret, i; - if (!amdgpu_device_pcie_dynamic_switching_supported()) { + if (!num_of_levels) + return 0; + + if (!(smu->adev->pm.pp_feature & PP_PCIE_DPM_MASK)) { if (pcie_table->pcie_gen[num_of_levels - 1] < pcie_gen_cap) pcie_gen_cap = pcie_table->pcie_gen[num_of_levels - 1]; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c @@ -1977,8 +1977,10 @@ metrics = kzalloc(sizeof(MetricsTable_t), GFP_KERNEL); ret = smu_v13_0_6_get_metrics_table(smu, metrics, true); - if (ret) + if (ret) { + kfree(metrics); return ret; + } smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 3); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -1223,7 +1223,7 @@ return 0; } -static void +static int komeda_pipeline_unbound_components(struct komeda_pipeline *pipe, struct komeda_pipeline_state *new) { @@ -1243,8 +1243,12 @@ c = komeda_pipeline_get_component(pipe, id); c_st = komeda_component_get_state_and_set_user(c, drm_st, NULL, new->crtc); + if (PTR_ERR(c_st) == -EDEADLK) + return -EDEADLK; WARN_ON(IS_ERR(c_st)); } + + return 0; } /* release unclaimed pipeline resource */ @@ -1266,9 +1270,8 @@ if (WARN_ON(IS_ERR_OR_NULL(st))) return -EINVAL; - komeda_pipeline_unbound_components(pipe, st); + return komeda_pipeline_unbound_components(pipe, st); - return 0; } /* Since standalone disabled components must be disabled separately and in the only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c @@ -351,20 +351,25 @@ return ret; } -static int aspeed_gfx_remove(struct platform_device *pdev) +static void aspeed_gfx_remove(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev); sysfs_remove_group(&pdev->dev.kobj, &aspeed_sysfs_attr_group); drm_dev_unregister(drm); aspeed_gfx_unload(drm); + drm_atomic_helper_shutdown(drm); +} - return 0; +static void aspeed_gfx_shutdown(struct platform_device *pdev) +{ + drm_atomic_helper_shutdown(platform_get_drvdata(pdev)); } static struct platform_driver aspeed_gfx_platform_driver = { .probe = aspeed_gfx_probe, - .remove = aspeed_gfx_remove, + .remove_new = aspeed_gfx_remove, + .shutdown = aspeed_gfx_shutdown, .driver = { .name = "aspeed_gfx", .of_match_table = aspeed_gfx_match, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/bridge/Kconfig +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/Kconfig @@ -181,6 +181,7 @@ select DRM_KMS_HELPER select DRM_MIPI_DSI select DRM_PANEL_BRIDGE + select GENERIC_PHY select GENERIC_PHY_MIPI_DPHY select MFD_SYSCON select MULTIPLEXER @@ -227,6 +228,7 @@ select DRM_KMS_HELPER select DRM_MIPI_DSI select DRM_PANEL_BRIDGE + select GENERIC_PHY select GENERIC_PHY_MIPI_DPHY help The Samsung MIPI DSIM bridge controller driver. @@ -311,6 +313,7 @@ select REGMAP_I2C select DRM_PANEL select DRM_MIPI_DSI + select VIDEOMODE_HELPERS help Toshiba TC358768AXBG/TC358778XBG DSI bridge chip driver. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/bridge/cadence/Kconfig +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/cadence/Kconfig @@ -4,6 +4,7 @@ select DRM_KMS_HELPER select DRM_MIPI_DSI select DRM_PANEL_BRIDGE + select GENERIC_PHY select GENERIC_PHY_MIPI_DPHY depends on OF help only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/bridge/ite-it66121.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/ite-it66121.c @@ -884,14 +884,14 @@ mutex_lock(&ctx->lock); ret = it66121_preamble_ddc(ctx); if (ret) { - edid = ERR_PTR(ret); + edid = NULL; goto out_unlock; } ret = regmap_write(ctx->regmap, IT66121_DDC_HEADER_REG, IT66121_DDC_HEADER_EDID); if (ret) { - edid = ERR_PTR(ret); + edid = NULL; goto out_unlock; } @@ -1447,10 +1447,14 @@ struct it66121_ctx *ctx = dev_get_drvdata(dev); mutex_lock(&ctx->lock); - - memcpy(buf, ctx->connector->eld, - min(sizeof(ctx->connector->eld), len)); - + if (!ctx->connector) { + /* Pass en empty ELD if connector not available */ + dev_dbg(dev, "No connector present, passing empty EDID data"); + memset(buf, 0, len); + } else { + memcpy(buf, ctx->connector->eld, + min(sizeof(ctx->connector->eld), len)); + } mutex_unlock(&ctx->lock); return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/bridge/lontium-lt8912b.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/lontium-lt8912b.c @@ -45,7 +45,6 @@ u8 data_lanes; bool is_power_on; - bool is_attached; }; static int lt8912_write_init_config(struct lt8912 *lt) @@ -559,6 +558,13 @@ struct lt8912 *lt = bridge_to_lt8912(bridge); int ret; + ret = drm_bridge_attach(bridge->encoder, lt->hdmi_port, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); + if (ret < 0) { + dev_err(lt->dev, "Failed to attach next bridge (%d)\n", ret); + return ret; + } + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { ret = lt8912_bridge_connector_init(bridge); if (ret) { @@ -575,8 +581,6 @@ if (ret) goto error; - lt->is_attached = true; - return 0; error: @@ -588,15 +592,10 @@ { struct lt8912 *lt = bridge_to_lt8912(bridge); - if (lt->is_attached) { - lt8912_hard_power_off(lt); - - if (lt->hdmi_port->ops & DRM_BRIDGE_OP_HPD) - drm_bridge_hpd_disable(lt->hdmi_port); + lt8912_hard_power_off(lt); - drm_connector_unregister(<->connector); - drm_connector_cleanup(<->connector); - } + if (lt->connector.dev && lt->hdmi_port->ops & DRM_BRIDGE_OP_HPD) + drm_bridge_hpd_disable(lt->hdmi_port); } static enum drm_connector_status @@ -750,7 +749,6 @@ { struct lt8912 *lt = i2c_get_clientdata(client); - lt8912_bridge_detach(<->bridge); drm_bridge_remove(<->bridge); lt8912_free_i2c(lt); lt8912_put_dt(lt); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/bridge/lontium-lt9611uxc.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/lontium-lt9611uxc.c @@ -927,9 +927,9 @@ init_waitqueue_head(<9611uxc->wq); INIT_WORK(<9611uxc->work, lt9611uxc_hpd_work); - ret = devm_request_threaded_irq(dev, client->irq, NULL, - lt9611uxc_irq_thread_handler, - IRQF_ONESHOT, "lt9611uxc", lt9611uxc); + ret = request_threaded_irq(client->irq, NULL, + lt9611uxc_irq_thread_handler, + IRQF_ONESHOT, "lt9611uxc", lt9611uxc); if (ret) { dev_err(dev, "failed to request irq\n"); goto err_disable_regulators; @@ -965,6 +965,8 @@ return lt9611uxc_audio_init(dev, lt9611uxc); err_remove_bridge: + free_irq(client->irq, lt9611uxc); + cancel_work_sync(<9611uxc->work); drm_bridge_remove(<9611uxc->bridge); err_disable_regulators: @@ -981,7 +983,7 @@ { struct lt9611uxc *lt9611uxc = i2c_get_clientdata(client); - disable_irq(client->irq); + free_irq(client->irq, lt9611uxc); cancel_work_sync(<9611uxc->work); lt9611uxc_audio_exit(lt9611uxc); drm_bridge_remove(<9611uxc->bridge); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/bridge/tc358768.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/tc358768.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -216,6 +217,10 @@ u32 tmp, orig; tc358768_read(priv, reg, &orig); + + if (priv->error) + return; + tmp = orig & ~mask; tmp |= val & mask; if (tmp != orig) @@ -600,7 +605,7 @@ dev_dbg(priv->dev, "PLL: refclk %lu, fbd %u, prd %u, frs %u\n", clk_get_rate(priv->refclk), fbd, prd, frs); - dev_dbg(priv->dev, "PLL: pll_clk: %u, DSIClk %u, DSIByteClk %u\n", + dev_dbg(priv->dev, "PLL: pll_clk: %u, DSIClk %u, HSByteClk %u\n", priv->dsiclk * 2, priv->dsiclk, priv->dsiclk / 4); dev_dbg(priv->dev, "PLL: pclk %u (panel: %u)\n", tc358768_pll_to_pclk(priv, priv->dsiclk * 2), @@ -623,15 +628,14 @@ return tc358768_clear_error(priv); } -#define TC358768_PRECISION 1000 -static u32 tc358768_ns_to_cnt(u32 ns, u32 period_nsk) +static u32 tc358768_ns_to_cnt(u32 ns, u32 period_ps) { - return (ns * TC358768_PRECISION + period_nsk) / period_nsk; + return DIV_ROUND_UP(ns * 1000, period_ps); } -static u32 tc358768_to_ns(u32 nsk) +static u32 tc358768_ps_to_ns(u32 ps) { - return (nsk / TC358768_PRECISION); + return ps / 1000; } static void tc358768_bridge_pre_enable(struct drm_bridge *bridge) @@ -642,13 +646,15 @@ u32 val, val2, lptxcnt, hact, data_type; s32 raw_val; const struct drm_display_mode *mode; - u32 dsibclk_nsk, dsiclk_nsk, ui_nsk; - u32 dsiclk, dsibclk, video_start; + u32 hsbyteclk_ps, dsiclk_ps, ui_ps; + u32 dsiclk, hsbyteclk, video_start; const u32 internal_delay = 40; int ret, i; + struct videomode vm; + struct device *dev = priv->dev; if (mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) { - dev_warn_once(priv->dev, "Non-continuous mode unimplemented, falling back to continuous\n"); + dev_warn_once(dev, "Non-continuous mode unimplemented, falling back to continuous\n"); mode_flags &= ~MIPI_DSI_CLOCK_NON_CONTINUOUS; } @@ -656,7 +662,7 @@ ret = tc358768_sw_reset(priv); if (ret) { - dev_err(priv->dev, "Software reset failed: %d\n", ret); + dev_err(dev, "Software reset failed: %d\n", ret); tc358768_hw_disable(priv); return; } @@ -664,45 +670,47 @@ mode = &bridge->encoder->crtc->state->adjusted_mode; ret = tc358768_setup_pll(priv, mode); if (ret) { - dev_err(priv->dev, "PLL setup failed: %d\n", ret); + dev_err(dev, "PLL setup failed: %d\n", ret); tc358768_hw_disable(priv); return; } + drm_display_mode_to_videomode(mode, &vm); + dsiclk = priv->dsiclk; - dsibclk = dsiclk / 4; + hsbyteclk = dsiclk / 4; /* Data Format Control Register */ val = BIT(2) | BIT(1) | BIT(0); /* rdswap_en | dsitx_en | txdt_en */ switch (dsi_dev->format) { case MIPI_DSI_FMT_RGB888: val |= (0x3 << 4); - hact = mode->hdisplay * 3; - video_start = (mode->htotal - mode->hsync_start) * 3; + hact = vm.hactive * 3; + video_start = (vm.hsync_len + vm.hback_porch) * 3; data_type = MIPI_DSI_PACKED_PIXEL_STREAM_24; break; case MIPI_DSI_FMT_RGB666: val |= (0x4 << 4); - hact = mode->hdisplay * 3; - video_start = (mode->htotal - mode->hsync_start) * 3; + hact = vm.hactive * 3; + video_start = (vm.hsync_len + vm.hback_porch) * 3; data_type = MIPI_DSI_PACKED_PIXEL_STREAM_18; break; case MIPI_DSI_FMT_RGB666_PACKED: val |= (0x4 << 4) | BIT(3); - hact = mode->hdisplay * 18 / 8; - video_start = (mode->htotal - mode->hsync_start) * 18 / 8; + hact = vm.hactive * 18 / 8; + video_start = (vm.hsync_len + vm.hback_porch) * 18 / 8; data_type = MIPI_DSI_PIXEL_STREAM_3BYTE_18; break; case MIPI_DSI_FMT_RGB565: val |= (0x5 << 4); - hact = mode->hdisplay * 2; - video_start = (mode->htotal - mode->hsync_start) * 2; + hact = vm.hactive * 2; + video_start = (vm.hsync_len + vm.hback_porch) * 2; data_type = MIPI_DSI_PACKED_PIXEL_STREAM_16; break; default: - dev_err(priv->dev, "Invalid data format (%u)\n", + dev_err(dev, "Invalid data format (%u)\n", dsi_dev->format); tc358768_hw_disable(priv); return; @@ -722,67 +730,67 @@ tc358768_write(priv, TC358768_D0W_CNTRL + i * 4, 0x0000); /* DSI Timings */ - dsibclk_nsk = (u32)div_u64((u64)1000000000 * TC358768_PRECISION, - dsibclk); - dsiclk_nsk = (u32)div_u64((u64)1000000000 * TC358768_PRECISION, dsiclk); - ui_nsk = dsiclk_nsk / 2; - dev_dbg(priv->dev, "dsiclk_nsk: %u\n", dsiclk_nsk); - dev_dbg(priv->dev, "ui_nsk: %u\n", ui_nsk); - dev_dbg(priv->dev, "dsibclk_nsk: %u\n", dsibclk_nsk); + hsbyteclk_ps = (u32)div_u64(PICO, hsbyteclk); + dsiclk_ps = (u32)div_u64(PICO, dsiclk); + ui_ps = dsiclk_ps / 2; + dev_dbg(dev, "dsiclk: %u ps, ui %u ps, hsbyteclk %u ps\n", dsiclk_ps, + ui_ps, hsbyteclk_ps); /* LP11 > 100us for D-PHY Rx Init */ - val = tc358768_ns_to_cnt(100 * 1000, dsibclk_nsk) - 1; - dev_dbg(priv->dev, "LINEINITCNT: 0x%x\n", val); + val = tc358768_ns_to_cnt(100 * 1000, hsbyteclk_ps) - 1; + dev_dbg(dev, "LINEINITCNT: %u\n", val); tc358768_write(priv, TC358768_LINEINITCNT, val); /* LPTimeCnt > 50ns */ - val = tc358768_ns_to_cnt(50, dsibclk_nsk) - 1; + val = tc358768_ns_to_cnt(50, hsbyteclk_ps) - 1; lptxcnt = val; - dev_dbg(priv->dev, "LPTXTIMECNT: 0x%x\n", val); + dev_dbg(dev, "LPTXTIMECNT: %u\n", val); tc358768_write(priv, TC358768_LPTXTIMECNT, val); /* 38ns < TCLK_PREPARE < 95ns */ - val = tc358768_ns_to_cnt(65, dsibclk_nsk) - 1; + val = tc358768_ns_to_cnt(65, hsbyteclk_ps) - 1; + dev_dbg(dev, "TCLK_PREPARECNT %u\n", val); /* TCLK_PREPARE + TCLK_ZERO > 300ns */ - val2 = tc358768_ns_to_cnt(300 - tc358768_to_ns(2 * ui_nsk), - dsibclk_nsk) - 2; + val2 = tc358768_ns_to_cnt(300 - tc358768_ps_to_ns(2 * ui_ps), + hsbyteclk_ps) - 2; + dev_dbg(dev, "TCLK_ZEROCNT %u\n", val2); val |= val2 << 8; - dev_dbg(priv->dev, "TCLK_HEADERCNT: 0x%x\n", val); tc358768_write(priv, TC358768_TCLK_HEADERCNT, val); /* TCLK_TRAIL > 60ns AND TEOT <= 105 ns + 12*UI */ - raw_val = tc358768_ns_to_cnt(60 + tc358768_to_ns(2 * ui_nsk), dsibclk_nsk) - 5; + raw_val = tc358768_ns_to_cnt(60 + tc358768_ps_to_ns(2 * ui_ps), hsbyteclk_ps) - 5; val = clamp(raw_val, 0, 127); - dev_dbg(priv->dev, "TCLK_TRAILCNT: 0x%x\n", val); + dev_dbg(dev, "TCLK_TRAILCNT: %u\n", val); tc358768_write(priv, TC358768_TCLK_TRAILCNT, val); /* 40ns + 4*UI < THS_PREPARE < 85ns + 6*UI */ - val = 50 + tc358768_to_ns(4 * ui_nsk); - val = tc358768_ns_to_cnt(val, dsibclk_nsk) - 1; + val = 50 + tc358768_ps_to_ns(4 * ui_ps); + val = tc358768_ns_to_cnt(val, hsbyteclk_ps) - 1; + dev_dbg(dev, "THS_PREPARECNT %u\n", val); /* THS_PREPARE + THS_ZERO > 145ns + 10*UI */ - raw_val = tc358768_ns_to_cnt(145 - tc358768_to_ns(3 * ui_nsk), dsibclk_nsk) - 10; + raw_val = tc358768_ns_to_cnt(145 - tc358768_ps_to_ns(3 * ui_ps), hsbyteclk_ps) - 10; val2 = clamp(raw_val, 0, 127); + dev_dbg(dev, "THS_ZEROCNT %u\n", val2); val |= val2 << 8; - dev_dbg(priv->dev, "THS_HEADERCNT: 0x%x\n", val); tc358768_write(priv, TC358768_THS_HEADERCNT, val); /* TWAKEUP > 1ms in lptxcnt steps */ - val = tc358768_ns_to_cnt(1020000, dsibclk_nsk); + val = tc358768_ns_to_cnt(1020000, hsbyteclk_ps); val = val / (lptxcnt + 1) - 1; - dev_dbg(priv->dev, "TWAKEUP: 0x%x\n", val); + dev_dbg(dev, "TWAKEUP: %u\n", val); tc358768_write(priv, TC358768_TWAKEUP, val); /* TCLK_POSTCNT > 60ns + 52*UI */ - val = tc358768_ns_to_cnt(60 + tc358768_to_ns(52 * ui_nsk), - dsibclk_nsk) - 3; - dev_dbg(priv->dev, "TCLK_POSTCNT: 0x%x\n", val); + val = tc358768_ns_to_cnt(60 + tc358768_ps_to_ns(52 * ui_ps), + hsbyteclk_ps) - 3; + dev_dbg(dev, "TCLK_POSTCNT: %u\n", val); tc358768_write(priv, TC358768_TCLK_POSTCNT, val); /* max(60ns + 4*UI, 8*UI) < THS_TRAILCNT < 105ns + 12*UI */ - raw_val = tc358768_ns_to_cnt(60 + tc358768_to_ns(18 * ui_nsk), - dsibclk_nsk) - 4; + raw_val = tc358768_ns_to_cnt(60 + tc358768_ps_to_ns(18 * ui_ps), + hsbyteclk_ps) - 4; val = clamp(raw_val, 0, 15); - dev_dbg(priv->dev, "THS_TRAILCNT: 0x%x\n", val); + dev_dbg(dev, "THS_TRAILCNT: %u\n", val); tc358768_write(priv, TC358768_THS_TRAILCNT, val); val = BIT(0); @@ -790,16 +798,17 @@ val |= BIT(i + 1); tc358768_write(priv, TC358768_HSTXVREGEN, val); - if (!(mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS)) - tc358768_write(priv, TC358768_TXOPTIONCNTRL, 0x1); + tc358768_write(priv, TC358768_TXOPTIONCNTRL, + (mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) ? 0 : BIT(0)); /* TXTAGOCNT[26:16] RXTASURECNT[10:0] */ - val = tc358768_to_ns((lptxcnt + 1) * dsibclk_nsk * 4); - val = tc358768_ns_to_cnt(val, dsibclk_nsk) / 4 - 1; - val2 = tc358768_ns_to_cnt(tc358768_to_ns((lptxcnt + 1) * dsibclk_nsk), - dsibclk_nsk) - 2; + val = tc358768_ps_to_ns((lptxcnt + 1) * hsbyteclk_ps * 4); + val = tc358768_ns_to_cnt(val, hsbyteclk_ps) / 4 - 1; + dev_dbg(dev, "TXTAGOCNT: %u\n", val); + val2 = tc358768_ns_to_cnt(tc358768_ps_to_ns((lptxcnt + 1) * hsbyteclk_ps), + hsbyteclk_ps) - 2; + dev_dbg(dev, "RXTASURECNT: %u\n", val2); val = val << 16 | val2; - dev_dbg(priv->dev, "BTACNTRL1: 0x%x\n", val); tc358768_write(priv, TC358768_BTACNTRL1, val); /* START[0] */ @@ -810,43 +819,43 @@ tc358768_write(priv, TC358768_DSI_EVENT, 0); /* vact */ - tc358768_write(priv, TC358768_DSI_VACT, mode->vdisplay); + tc358768_write(priv, TC358768_DSI_VACT, vm.vactive); /* vsw */ - tc358768_write(priv, TC358768_DSI_VSW, - mode->vsync_end - mode->vsync_start); + tc358768_write(priv, TC358768_DSI_VSW, vm.vsync_len); + /* vbp */ - tc358768_write(priv, TC358768_DSI_VBPR, - mode->vtotal - mode->vsync_end); + tc358768_write(priv, TC358768_DSI_VBPR, vm.vback_porch); /* hsw * byteclk * ndl / pclk */ - val = (u32)div_u64((mode->hsync_end - mode->hsync_start) * - ((u64)priv->dsiclk / 4) * priv->dsi_lanes, - mode->clock * 1000); + val = (u32)div_u64(vm.hsync_len * + (u64)hsbyteclk * priv->dsi_lanes, + vm.pixelclock); tc358768_write(priv, TC358768_DSI_HSW, val); /* hbp * byteclk * ndl / pclk */ - val = (u32)div_u64((mode->htotal - mode->hsync_end) * - ((u64)priv->dsiclk / 4) * priv->dsi_lanes, - mode->clock * 1000); + val = (u32)div_u64(vm.hback_porch * + (u64)hsbyteclk * priv->dsi_lanes, + vm.pixelclock); tc358768_write(priv, TC358768_DSI_HBPR, val); } else { /* Set event mode */ tc358768_write(priv, TC358768_DSI_EVENT, 1); /* vact */ - tc358768_write(priv, TC358768_DSI_VACT, mode->vdisplay); + tc358768_write(priv, TC358768_DSI_VACT, vm.vactive); /* vsw (+ vbp) */ tc358768_write(priv, TC358768_DSI_VSW, - mode->vtotal - mode->vsync_start); + vm.vsync_len + vm.vback_porch); + /* vbp (not used in event mode) */ tc358768_write(priv, TC358768_DSI_VBPR, 0); /* (hsw + hbp) * byteclk * ndl / pclk */ - val = (u32)div_u64((mode->htotal - mode->hsync_start) * - ((u64)priv->dsiclk / 4) * priv->dsi_lanes, - mode->clock * 1000); + val = (u32)div_u64((vm.hsync_len + vm.hback_porch) * + (u64)hsbyteclk * priv->dsi_lanes, + vm.pixelclock); tc358768_write(priv, TC358768_DSI_HSW, val); /* hbp (not used in event mode) */ @@ -857,11 +866,12 @@ tc358768_write(priv, TC358768_DSI_HACT, hact); /* VSYNC polarity */ - if (!(mode->flags & DRM_MODE_FLAG_NVSYNC)) - tc358768_update_bits(priv, TC358768_CONFCTL, BIT(5), BIT(5)); + tc358768_update_bits(priv, TC358768_CONFCTL, BIT(5), + (mode->flags & DRM_MODE_FLAG_PVSYNC) ? BIT(5) : 0); + /* HSYNC polarity */ - if (mode->flags & DRM_MODE_FLAG_PHSYNC) - tc358768_update_bits(priv, TC358768_PP_MISC, BIT(0), BIT(0)); + tc358768_update_bits(priv, TC358768_PP_MISC, BIT(0), + (mode->flags & DRM_MODE_FLAG_PHSYNC) ? BIT(0) : 0); /* Start DSI Tx */ tc358768_write(priv, TC358768_DSI_START, 0x1); @@ -891,7 +901,7 @@ ret = tc358768_clear_error(priv); if (ret) { - dev_err(priv->dev, "Bridge pre_enable failed: %d\n", ret); + dev_err(dev, "Bridge pre_enable failed: %d\n", ret); tc358768_bridge_disable(bridge); tc358768_bridge_post_disable(bridge); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -692,7 +692,7 @@ return container_of(bridge, struct ti_sn65dsi86, bridge); } -static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata) +static int ti_sn_attach_host(struct auxiliary_device *adev, struct ti_sn65dsi86 *pdata) { int val; struct mipi_dsi_host *host; @@ -707,7 +707,7 @@ if (!host) return -EPROBE_DEFER; - dsi = devm_mipi_dsi_device_register_full(dev, host, &info); + dsi = devm_mipi_dsi_device_register_full(&adev->dev, host, &info); if (IS_ERR(dsi)) return PTR_ERR(dsi); @@ -725,7 +725,7 @@ pdata->dsi = dsi; - return devm_mipi_dsi_attach(dev, dsi); + return devm_mipi_dsi_attach(&adev->dev, dsi); } static int ti_sn_bridge_attach(struct drm_bridge *bridge, @@ -1298,9 +1298,9 @@ struct device_node *np = pdata->dev->of_node; int ret; - pdata->next_bridge = devm_drm_of_get_bridge(pdata->dev, np, 1, 0); + pdata->next_bridge = devm_drm_of_get_bridge(&adev->dev, np, 1, 0); if (IS_ERR(pdata->next_bridge)) - return dev_err_probe(pdata->dev, PTR_ERR(pdata->next_bridge), + return dev_err_probe(&adev->dev, PTR_ERR(pdata->next_bridge), "failed to create panel bridge\n"); ti_sn_bridge_parse_lanes(pdata, np); @@ -1319,9 +1319,9 @@ drm_bridge_add(&pdata->bridge); - ret = ti_sn_attach_host(pdata); + ret = ti_sn_attach_host(adev, pdata); if (ret) { - dev_err_probe(pdata->dev, ret, "failed to attach dsi host\n"); + dev_err_probe(&adev->dev, ret, "failed to attach dsi host\n"); goto err_remove_bridge; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -2574,14 +2574,14 @@ struct drm_dp_mst_branch *found_mstb; struct drm_dp_mst_port *port; + if (!mstb) + return NULL; + if (memcmp(mstb->guid, guid, 16) == 0) return mstb; list_for_each_entry(port, &mstb->ports, next) { - if (!port->mstb) - continue; - found_mstb = get_mst_branch_device_by_guid_helper(port->mstb, guid); if (found_mstb) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/drm_lease.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_lease.c @@ -510,8 +510,8 @@ /* Handle leased objects, if any */ idr_init(&leases); if (object_count != 0) { - object_ids = memdup_user(u64_to_user_ptr(cl->object_ids), - array_size(object_count, sizeof(__u32))); + object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids), + object_count, sizeof(__u32)); if (IS_ERR(object_ids)) { ret = PTR_ERR(object_ids); idr_destroy(&leases); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_panel_orientation_quirks.c @@ -38,6 +38,14 @@ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, }; +static const struct drm_dmi_panel_orientation_data gpd_onemix2s = { + .width = 1200, + .height = 1920, + .bios_dates = (const char * const []){ "05/21/2018", "10/26/2018", + "03/04/2019", NULL }, + .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, +}; + static const struct drm_dmi_panel_orientation_data gpd_pocket = { .width = 1200, .height = 1920, @@ -401,6 +409,14 @@ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LTH17"), }, .driver_data = (void *)&lcd800x1280_rightside_up, + }, { /* One Mix 2S (generic strings, also match on bios date) */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), + }, + .driver_data = (void *)&gpd_onemix2s, }, {} }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/drm_syncobj.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/drm_syncobj.c @@ -1015,7 +1015,8 @@ fence = drm_syncobj_fence_get(syncobjs[i]); if (!fence || dma_fence_chain_find_seqno(&fence, points[i])) { dma_fence_put(fence); - if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) { + if (flags & (DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT | + DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE)) { continue; } else { timeout = -EINVAL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/gma500/psb_drv.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/gma500/psb_drv.h @@ -424,6 +424,7 @@ uint32_t pipestat[PSB_NUM_PIPE]; spinlock_t irqmask_lock; + bool irq_enabled; /* Power */ bool pm_initialized; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/gma500/psb_irq.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/gma500/psb_irq.c @@ -327,6 +327,8 @@ gma_irq_postinstall(dev); + dev_priv->irq_enabled = true; + return 0; } @@ -337,6 +339,9 @@ unsigned long irqflags; unsigned int i; + if (!dev_priv->irq_enabled) + return; + spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags); if (dev_priv->ops->hotplug_enable) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/icl_dsi.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/icl_dsi.c @@ -1415,6 +1415,13 @@ static enum drm_mode_status gen11_dsi_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { + struct drm_i915_private *i915 = to_i915(connector->dev); + enum drm_mode_status status; + + status = intel_cpu_transcoder_mode_valid(i915, mode); + if (status != MODE_OK) + return status; + /* FIXME: DSC? */ return intel_dsi_mode_valid(connector, mode); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_cdclk.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_cdclk.c @@ -2680,6 +2680,18 @@ for_each_pipe(dev_priv, pipe) min_cdclk = max(cdclk_state->min_cdclk[pipe], min_cdclk); + /* + * Avoid glk_force_audio_cdclk() causing excessive screen + * blinking when multiple pipes are active by making sure + * CDCLK frequency is always high enough for audio. With a + * single active pipe we can always change CDCLK frequency + * by changing the cd2x divider (see glk_cdclk_table[]) and + * thus a full modeset won't be needed then. + */ + if (IS_GEMINILAKE(dev_priv) && cdclk_state->active_pipes && + !is_power_of_2(cdclk_state->active_pipes)) + min_cdclk = max(2 * 96000, min_cdclk); + if (min_cdclk > dev_priv->display.cdclk.max_cdclk_freq) { drm_dbg_kms(&dev_priv->drm, "required cdclk (%d kHz) exceeds max (%d kHz)\n", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_crt.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_crt.c @@ -348,8 +348,13 @@ struct drm_device *dev = connector->dev; struct drm_i915_private *dev_priv = to_i915(dev); int max_dotclk = dev_priv->max_dotclk_freq; + enum drm_mode_status status; int max_clock; + status = intel_cpu_transcoder_mode_valid(dev_priv, mode); + if (status != MODE_OK) + return status; + if (mode->flags & DRM_MODE_FLAG_DBLSCAN) return MODE_NO_DBLESCAN; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_cx0_phy.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_cx0_phy.c @@ -2554,8 +2554,7 @@ drm_warn(&i915->drm, "PHY %c failed to bring out of SOC reset after %dus.\n", phy_name(phy), XELPDP_PORT_BUF_SOC_READY_TIMEOUT_US); - intel_de_rmw(i915, XELPDP_PORT_BUF_CTL2(port), - XELPDP_LANE_PIPE_RESET(0) | XELPDP_LANE_PIPE_RESET(1), + intel_de_rmw(i915, XELPDP_PORT_BUF_CTL2(port), lane_pipe_reset, lane_pipe_reset); if (__intel_de_wait_for_register(i915, XELPDP_PORT_BUF_CTL2(port), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_display.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_display.c @@ -7271,7 +7271,7 @@ for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) intel_color_cleanup_commit(new_crtc_state); - drm_atomic_helper_cleanup_planes(dev, &state->base); + drm_atomic_helper_unprepare_planes(dev, &state->base); intel_runtime_pm_put(&dev_priv->runtime_pm, state->wakeref); return ret; } @@ -7725,6 +7725,16 @@ mode->vtotal > vtotal_max) return MODE_V_ILLEGAL; + return MODE_OK; +} + +enum drm_mode_status intel_cpu_transcoder_mode_valid(struct drm_i915_private *dev_priv, + const struct drm_display_mode *mode) +{ + /* + * Additional transcoder timing limits, + * excluding BXT/GLK DSI transcoders. + */ if (DISPLAY_VER(dev_priv) >= 5) { if (mode->hdisplay < 64 || mode->htotal - mode->hdisplay < 32) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_display.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_display.h @@ -405,6 +405,9 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, const struct drm_display_mode *mode, bool bigjoiner); +enum drm_mode_status +intel_cpu_transcoder_mode_valid(struct drm_i915_private *i915, + const struct drm_display_mode *mode); enum phy intel_port_to_phy(struct drm_i915_private *i915, enum port port); bool is_trans_port_sync_mode(const struct intel_crtc_state *state); bool is_trans_port_sync_master(const struct intel_crtc_state *state); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -921,6 +921,10 @@ return 0; } + *status = intel_cpu_transcoder_mode_valid(dev_priv, mode); + if (*status != MODE_OK) + return 0; + if (mode->flags & DRM_MODE_FLAG_DBLSCAN) { *status = MODE_NO_DBLESCAN; return 0; @@ -955,6 +959,10 @@ if (intel_dp_need_bigjoiner(intel_dp, mode->hdisplay, target_clock)) { bigjoiner = true; max_dotclk *= 2; + + /* TODO: add support for bigjoiner */ + *status = MODE_CLOCK_HIGH; + return 0; } if (DISPLAY_VER(dev_priv) >= 10 && @@ -988,11 +996,15 @@ * Big joiner configuration needs DSC for TGL which is not true for * XE_LPD where uncompressed joiner is supported. */ - if (DISPLAY_VER(dev_priv) < 13 && bigjoiner && !dsc) - return MODE_CLOCK_HIGH; + if (DISPLAY_VER(dev_priv) < 13 && bigjoiner && !dsc) { + *status = MODE_CLOCK_HIGH; + return 0; + } - if (mode_rate > max_rate && !dsc) - return MODE_CLOCK_HIGH; + if (mode_rate > max_rate && !dsc) { + *status = MODE_CLOCK_HIGH; + return 0; + } *status = intel_mode_valid_max_plane_size(dev_priv, mode, false); return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_dvo.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_dvo.c @@ -218,10 +218,16 @@ { struct intel_connector *connector = to_intel_connector(_connector); struct intel_dvo *intel_dvo = intel_attached_dvo(connector); + struct drm_i915_private *i915 = to_i915(connector->base.dev); const struct drm_display_mode *fixed_mode = intel_panel_fixed_mode(connector, mode); int max_dotclk = to_i915(connector->base.dev)->max_dotclk_freq; int target_clock = mode->clock; + enum drm_mode_status status; + + status = intel_cpu_transcoder_mode_valid(i915, mode); + if (status != MODE_OK) + return status; if (mode->flags & DRM_MODE_FLAG_DBLSCAN) return MODE_NO_DBLESCAN; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_hdmi.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -1986,6 +1986,10 @@ bool ycbcr_420_only; enum intel_output_format sink_format; + status = intel_cpu_transcoder_mode_valid(dev_priv, mode); + if (status != MODE_OK) + return status; + if ((mode->flags & DRM_MODE_FLAG_3D_MASK) == DRM_MODE_FLAG_3D_FRAME_PACKING) clock *= 2; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_lvds.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_lvds.c @@ -389,11 +389,16 @@ struct drm_display_mode *mode) { struct intel_connector *connector = to_intel_connector(_connector); + struct drm_i915_private *i915 = to_i915(connector->base.dev); const struct drm_display_mode *fixed_mode = intel_panel_fixed_mode(connector, mode); int max_pixclk = to_i915(connector->base.dev)->max_dotclk_freq; enum drm_mode_status status; + status = intel_cpu_transcoder_mode_valid(i915, mode); + if (status != MODE_OK) + return status; + if (mode->flags & DRM_MODE_FLAG_DBLSCAN) return MODE_NO_DBLESCAN; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_sdvo.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -1906,13 +1906,19 @@ intel_sdvo_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { + struct drm_i915_private *i915 = to_i915(connector->dev); struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); - int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; bool has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo_connector, connector->state); + int max_dotclk = i915->max_dotclk_freq; + enum drm_mode_status status; int clock = mode->clock; + status = intel_cpu_transcoder_mode_valid(i915, mode); + if (status != MODE_OK) + return status; + if (mode->flags & DRM_MODE_FLAG_DBLSCAN) return MODE_NO_DBLESCAN; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_tc.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_tc.c @@ -58,7 +58,7 @@ struct delayed_work link_reset_work; int link_refcount; bool legacy_port:1; - char port_name[8]; + const char *port_name; enum tc_port_mode mode; enum tc_port_mode init_mode; enum phy_fia phy_fia; @@ -1841,8 +1841,12 @@ else tc->phy_ops = &icl_tc_phy_ops; - snprintf(tc->port_name, sizeof(tc->port_name), - "%c/TC#%d", port_name(port), tc_port + 1); + tc->port_name = kasprintf(GFP_KERNEL, "%c/TC#%d", port_name(port), + tc_port + 1); + if (!tc->port_name) { + kfree(tc); + return -ENOMEM; + } mutex_init(&tc->lock); /* TODO: Combine the two works */ @@ -1863,6 +1867,7 @@ { intel_tc_port_suspend(dig_port); + kfree(dig_port->tc->port_name); kfree(dig_port->tc); dig_port->tc = NULL; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/intel_tv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/intel_tv.c @@ -958,8 +958,14 @@ intel_tv_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { + struct drm_i915_private *i915 = to_i915(connector->dev); const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state); - int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; + int max_dotclk = i915->max_dotclk_freq; + enum drm_mode_status status; + + status = intel_cpu_transcoder_mode_valid(i915, mode); + if (status != MODE_OK) + return status; if (mode->flags & DRM_MODE_FLAG_DBLSCAN) return MODE_NO_DBLESCAN; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/display/vlv_dsi.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -1563,9 +1563,25 @@ .destroy = intel_dsi_encoder_destroy, }; +static enum drm_mode_status vlv_dsi_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) +{ + struct drm_i915_private *i915 = to_i915(connector->dev); + + if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) { + enum drm_mode_status status; + + status = intel_cpu_transcoder_mode_valid(i915, mode); + if (status != MODE_OK) + return status; + } + + return intel_dsi_mode_valid(connector, mode); +} + static const struct drm_connector_helper_funcs intel_dsi_connector_helper_funcs = { .get_modes = intel_dsi_get_modes, - .mode_valid = intel_dsi_mode_valid, + .mode_valid = vlv_dsi_mode_valid, .atomic_check = intel_digital_connector_atomic_check, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/gem/i915_gem_context.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/gem/i915_gem_context.c @@ -844,6 +844,7 @@ if (idx >= pc->num_user_engines) return -EINVAL; + idx = array_index_nospec(idx, pc->num_user_engines); pe = &pc->user_engines[idx]; /* Only render engine supports RPCS configuration. */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -235,6 +235,7 @@ case 0: case -EAGAIN: case -ENOSPC: /* transient failure to evict? */ + case -ENOBUFS: /* temporarily out of fences? */ case -ERESTARTSYS: case -EINTR: case -EBUSY: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/gt/intel_engine_user.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/gt/intel_engine_user.c @@ -42,12 +42,15 @@ (struct llist_head *)&engine->i915->uabi_engines); } -static const u8 uabi_classes[] = { +#define I915_NO_UABI_CLASS ((u16)(-1)) + +static const u16 uabi_classes[] = { [RENDER_CLASS] = I915_ENGINE_CLASS_RENDER, [COPY_ENGINE_CLASS] = I915_ENGINE_CLASS_COPY, [VIDEO_DECODE_CLASS] = I915_ENGINE_CLASS_VIDEO, [VIDEO_ENHANCEMENT_CLASS] = I915_ENGINE_CLASS_VIDEO_ENHANCE, [COMPUTE_CLASS] = I915_ENGINE_CLASS_COMPUTE, + [OTHER_CLASS] = I915_NO_UABI_CLASS, /* Not exposed to users, no uabi class. */ }; static int engine_cmp(void *priv, const struct list_head *A, @@ -202,6 +205,7 @@ void intel_engines_driver_register(struct drm_i915_private *i915) { + u16 name_instance, other_instance = 0; struct legacy_ring ring = {}; struct list_head *it, *next; struct rb_node **p, *prev; @@ -219,27 +223,28 @@ if (intel_gt_has_unrecoverable_error(engine->gt)) continue; /* ignore incomplete engines */ - /* - * We don't want to expose the GSC engine to the users, but we - * still rename it so it is easier to identify in the debug logs - */ - if (engine->id == GSC0) { - engine_rename(engine, "gsc", 0); - continue; - } - GEM_BUG_ON(engine->class >= ARRAY_SIZE(uabi_classes)); engine->uabi_class = uabi_classes[engine->class]; + if (engine->uabi_class == I915_NO_UABI_CLASS) { + name_instance = other_instance++; + } else { + GEM_BUG_ON(engine->uabi_class >= + ARRAY_SIZE(i915->engine_uabi_class_count)); + name_instance = + i915->engine_uabi_class_count[engine->uabi_class]++; + } + engine->uabi_instance = name_instance; - GEM_BUG_ON(engine->uabi_class >= - ARRAY_SIZE(i915->engine_uabi_class_count)); - engine->uabi_instance = - i915->engine_uabi_class_count[engine->uabi_class]++; - - /* Replace the internal name with the final user facing name */ + /* + * Replace the internal name with the final user and log facing + * name. + */ engine_rename(engine, intel_engine_class_repr(engine->class), - engine->uabi_instance); + name_instance); + + if (engine->uabi_class == I915_NO_UABI_CLASS) + continue; rb_link_node(&engine->uabi_node, prev, p); rb_insert_color(&engine->uabi_node, &i915->uabi_engines); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/gt/intel_gt.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/gt/intel_gt.c @@ -967,8 +967,6 @@ err: i915_probe_error(i915, "Failed to initialize %s! (%d)\n", gtdef->name, ret); - intel_gt_release_all(i915); - return ret; } @@ -987,15 +985,6 @@ return 0; } -void intel_gt_release_all(struct drm_i915_private *i915) -{ - struct intel_gt *gt; - unsigned int id; - - for_each_gt(gt, i915, id) - i915->gt[id] = NULL; -} - void intel_gt_info_print(const struct intel_gt_info *info, struct drm_printer *p) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/gt/intel_gt_mcr.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/gt/intel_gt_mcr.c @@ -376,9 +376,26 @@ * driver threads, but also with hardware/firmware agents. A dedicated * locking register is used. */ - if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) + if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) { + /* + * The steering control and semaphore registers are inside an + * "always on" power domain with respect to RC6. However there + * are some issues if higher-level platform sleep states are + * entering/exiting at the same time these registers are + * accessed. Grabbing GT forcewake and holding it over the + * entire lock/steer/unlock cycle ensures that those sleep + * states have been fully exited before we access these + * registers. This wakeref will be released in the unlock + * routine. + * + * This is expected to become a formally documented/numbered + * workaround soon. + */ + intel_uncore_forcewake_get(gt->uncore, FORCEWAKE_GT); + err = wait_for(intel_uncore_read_fw(gt->uncore, MTL_STEER_SEMAPHORE) == 0x1, 100); + } /* * Even on platforms with a hardware lock, we'll continue to grab @@ -415,8 +432,11 @@ { spin_unlock_irqrestore(>->mcr_lock, flags); - if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) + if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) { intel_uncore_write_fw(gt->uncore, MTL_STEER_SEMAPHORE, 0x1); + + intel_uncore_forcewake_put(gt->uncore, FORCEWAKE_GT); + } } /** only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/gt/intel_rc6.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/gt/intel_rc6.c @@ -584,19 +584,23 @@ static void rc6_res_reg_init(struct intel_rc6 *rc6) { - memset(rc6->res_reg, INVALID_MMIO_REG.reg, sizeof(rc6->res_reg)); + i915_reg_t res_reg[INTEL_RC6_RES_MAX] = { + [0 ... INTEL_RC6_RES_MAX - 1] = INVALID_MMIO_REG, + }; switch (rc6_to_gt(rc6)->type) { case GT_MEDIA: - rc6->res_reg[INTEL_RC6_RES_RC6] = MTL_MEDIA_MC6; + res_reg[INTEL_RC6_RES_RC6] = MTL_MEDIA_MC6; break; default: - rc6->res_reg[INTEL_RC6_RES_RC6_LOCKED] = GEN6_GT_GFX_RC6_LOCKED; - rc6->res_reg[INTEL_RC6_RES_RC6] = GEN6_GT_GFX_RC6; - rc6->res_reg[INTEL_RC6_RES_RC6p] = GEN6_GT_GFX_RC6p; - rc6->res_reg[INTEL_RC6_RES_RC6pp] = GEN6_GT_GFX_RC6pp; + res_reg[INTEL_RC6_RES_RC6_LOCKED] = GEN6_GT_GFX_RC6_LOCKED; + res_reg[INTEL_RC6_RES_RC6] = GEN6_GT_GFX_RC6; + res_reg[INTEL_RC6_RES_RC6p] = GEN6_GT_GFX_RC6p; + res_reg[INTEL_RC6_RES_RC6pp] = GEN6_GT_GFX_RC6pp; break; } + + memcpy(rc6->res_reg, res_reg, sizeof(res_reg)); } void intel_rc6_init(struct intel_rc6 *rc6) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/i915_driver.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/i915_driver.c @@ -775,7 +775,7 @@ ret = i915_driver_mmio_probe(i915); if (ret < 0) - goto out_tiles_cleanup; + goto out_runtime_pm_put; ret = i915_driver_hw_probe(i915); if (ret < 0) @@ -835,8 +835,6 @@ i915_ggtt_driver_late_release(i915); out_cleanup_mmio: i915_driver_mmio_release(i915); -out_tiles_cleanup: - intel_gt_release_all(i915); out_runtime_pm_put: enable_rpm_wakeref_asserts(&i915->runtime_pm); i915_driver_late_release(i915); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/i915_perf.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/i915_perf.c @@ -482,8 +482,7 @@ static bool oa_report_ctx_invalid(struct i915_perf_stream *stream, void *report) { return !(oa_report_id(stream, report) & - stream->perf->gen8_valid_ctx_bit) && - GRAPHICS_VER(stream->perf->i915) <= 11; + stream->perf->gen8_valid_ctx_bit); } static u64 oa_timestamp(struct i915_perf_stream *stream, void *report) @@ -4287,11 +4286,8 @@ u32 known_open_flags; int ret; - if (!perf->i915) { - drm_dbg(&perf->i915->drm, - "i915 perf interface not available for this system\n"); + if (!perf->i915) return -ENOTSUPP; - } known_open_flags = I915_PERF_FLAG_FD_CLOEXEC | I915_PERF_FLAG_FD_NONBLOCK | @@ -4667,11 +4663,8 @@ struct i915_oa_reg *regs; int err, id; - if (!perf->i915) { - drm_dbg(&perf->i915->drm, - "i915 perf interface not available for this system\n"); + if (!perf->i915) return -ENOTSUPP; - } if (!perf->metrics_kobj) { drm_dbg(&perf->i915->drm, @@ -4833,11 +4826,8 @@ struct i915_oa_config *oa_config; int ret; - if (!perf->i915) { - drm_dbg(&perf->i915->drm, - "i915 perf interface not available for this system\n"); + if (!perf->i915) return -ENOTSUPP; - } if (i915_perf_stream_paranoid && !perfmon_capable()) { drm_dbg(&perf->i915->drm, @@ -5106,6 +5096,7 @@ perf->gen8_valid_ctx_bit = BIT(16); break; case 12: + perf->gen8_valid_ctx_bit = BIT(16); /* * Calculate offset at runtime in oa_pin_context for gen12 and * cache the value in perf->ctx_oactxctrl_offset. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/i915/i915_pmu.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/i915/i915_pmu.c @@ -832,9 +832,18 @@ static void i915_pmu_event_stop(struct perf_event *event, int flags) { + struct drm_i915_private *i915 = + container_of(event->pmu, typeof(*i915), pmu.base); + struct i915_pmu *pmu = &i915->pmu; + + if (pmu->closed) + goto out; + if (flags & PERF_EF_UPDATE) i915_pmu_event_read(event); i915_pmu_disable(event); + +out: event->hw.state = PERF_HES_STOPPED; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/logicvc/Kconfig +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/logicvc/Kconfig @@ -5,5 +5,7 @@ select DRM_KMS_HELPER select DRM_KMS_DMA_HELPER select DRM_GEM_DMA_HELPER + select REGMAP + select REGMAP_MMIO help DRM display driver for the logiCVC programmable logic block from Xylon only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -145,6 +145,7 @@ dma_addr_t addr; dma_addr_t hdr_addr = 0; unsigned int hdr_pitch = 0; + int offset; gem = fb->obj[0]; mtk_gem = to_mtk_gem_obj(gem); @@ -154,8 +155,15 @@ modifier = fb->modifier; if (modifier == DRM_FORMAT_MOD_LINEAR) { - addr += (new_state->src.x1 >> 16) * fb->format->cpp[0]; - addr += (new_state->src.y1 >> 16) * pitch; + /* + * Using dma_addr_t variable to calculate with multiplier of different types, + * for example: addr += (new_state->src.x1 >> 16) * fb->format->cpp[0]; + * may cause coverity issue with unintentional overflow. + */ + offset = (new_state->src.x1 >> 16) * fb->format->cpp[0]; + addr += offset; + offset = (new_state->src.y1 >> 16) * pitch; + addr += offset; } else { int width_in_blocks = ALIGN(fb->width, AFBC_DATA_BLOCK_WIDTH) / AFBC_DATA_BLOCK_WIDTH; @@ -163,21 +171,34 @@ / AFBC_DATA_BLOCK_HEIGHT; int x_offset_in_blocks = (new_state->src.x1 >> 16) / AFBC_DATA_BLOCK_WIDTH; int y_offset_in_blocks = (new_state->src.y1 >> 16) / AFBC_DATA_BLOCK_HEIGHT; - int hdr_size; + int hdr_size, hdr_offset; hdr_pitch = width_in_blocks * AFBC_HEADER_BLOCK_SIZE; pitch = width_in_blocks * AFBC_DATA_BLOCK_WIDTH * AFBC_DATA_BLOCK_HEIGHT * fb->format->cpp[0]; hdr_size = ALIGN(hdr_pitch * height_in_blocks, AFBC_HEADER_ALIGNMENT); + hdr_offset = hdr_pitch * y_offset_in_blocks + + AFBC_HEADER_BLOCK_SIZE * x_offset_in_blocks; + + /* + * Using dma_addr_t variable to calculate with multiplier of different types, + * for example: addr += hdr_pitch * y_offset_in_blocks; + * may cause coverity issue with unintentional overflow. + */ + hdr_addr = addr + hdr_offset; - hdr_addr = addr + hdr_pitch * y_offset_in_blocks + - AFBC_HEADER_BLOCK_SIZE * x_offset_in_blocks; /* The data plane is offset by 1 additional block. */ - addr = addr + hdr_size + - pitch * y_offset_in_blocks + - AFBC_DATA_BLOCK_WIDTH * AFBC_DATA_BLOCK_HEIGHT * - fb->format->cpp[0] * (x_offset_in_blocks + 1); + offset = pitch * y_offset_in_blocks + + AFBC_DATA_BLOCK_WIDTH * AFBC_DATA_BLOCK_HEIGHT * + fb->format->cpp[0] * (x_offset_in_blocks + 1); + + /* + * Using dma_addr_t variable to calculate with multiplier of different types, + * for example: addr += pitch * y_offset_in_blocks; + * may cause coverity issue with unintentional overflow. + */ + addr = addr + hdr_size + offset; } mtk_plane_state->pending.enable = true; @@ -210,9 +231,9 @@ plane->state->src_y = new_state->src_y; plane->state->src_h = new_state->src_h; plane->state->src_w = new_state->src_w; - swap(plane->state->fb, new_state->fb); mtk_plane_update_new_state(new_state, new_plane_state); + swap(plane->state->fb, new_state->fb); wmb(); /* Make sure the above parameters are set before update */ new_plane_state->pending.async_dirty = true; mtk_drm_crtc_async_update(new_state->crtc, plane, state); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/mediatek/mtk_dsi.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -407,7 +407,7 @@ if (dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) tmp_reg |= HSTX_CKLP_EN; - if (!(dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)) + if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) tmp_reg |= DIS_EOT; writel(tmp_reg, dsi->regs + DSI_TXRX_CTRL); @@ -484,7 +484,7 @@ timing->da_hs_zero + timing->da_hs_exit + 3; delta = dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST ? 18 : 12; - delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 2 : 0; + delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 0 : 2; horizontal_frontporch_byte = vm->hfront_porch * dsi_tmp_buf_bpp; horizontal_front_back_byte = horizontal_frontporch_byte + horizontal_backporch_byte; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/mgag200/mgag200_drv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -278,6 +279,12 @@ struct drm_device *dev = pci_get_drvdata(pdev); drm_dev_unregister(dev); + drm_atomic_helper_shutdown(dev); +} + +static void mgag200_pci_shutdown(struct pci_dev *pdev) +{ + drm_atomic_helper_shutdown(pci_get_drvdata(pdev)); } static struct pci_driver mgag200_pci_driver = { @@ -285,6 +292,7 @@ .id_table = mgag200_pciidlist, .probe = mgag200_pci_probe, .remove = mgag200_pci_remove, + .shutdown = mgag200_pci_shutdown, }; drm_module_pci_driver_if_modeset(mgag200_pci_driver, mgag200_modeset); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/msm/dp/dp_panel.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/dp/dp_panel.c @@ -289,26 +289,9 @@ static u8 dp_panel_get_edid_checksum(struct edid *edid) { - struct edid *last_block; - u8 *raw_edid; - bool is_edid_corrupt = false; + edid += edid->extensions; - if (!edid) { - DRM_ERROR("invalid edid input\n"); - return 0; - } - - raw_edid = (u8 *)edid; - raw_edid += (edid->extensions * EDID_LENGTH); - last_block = (struct edid *)raw_edid; - - /* block type extension */ - drm_edid_block_valid(raw_edid, 1, false, &is_edid_corrupt); - if (!is_edid_corrupt) - return last_block->checksum; - - DRM_ERROR("Invalid block, no checksum\n"); - return 0; + return edid->checksum; } void dp_panel_handle_sink_request(struct dp_panel *dp_panel) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/msm/dsi/dsi.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/dsi/dsi.c @@ -126,6 +126,7 @@ struct msm_drm_private *priv = dev_get_drvdata(master); struct msm_dsi *msm_dsi = dev_get_drvdata(dev); + msm_dsi_tx_buf_free(msm_dsi->host); priv->dsi[msm_dsi->id] = NULL; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/msm/dsi/dsi.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/dsi/dsi.h @@ -125,6 +125,7 @@ void *dsi_tx_buf_get_6g(struct msm_dsi_host *msm_host); void *dsi_tx_buf_get_v2(struct msm_dsi_host *msm_host); void dsi_tx_buf_put_6g(struct msm_dsi_host *msm_host); +void msm_dsi_tx_buf_free(struct mipi_dsi_host *mipi_host); int dsi_dma_base_get_6g(struct msm_dsi_host *msm_host, uint64_t *iova); int dsi_dma_base_get_v2(struct msm_dsi_host *msm_host, uint64_t *iova); int dsi_clk_init_v2(struct msm_dsi_host *msm_host); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c @@ -918,7 +918,7 @@ if ((phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V5_2)) { if (phy->cphy_mode) { vreg_ctrl_0 = 0x45; - vreg_ctrl_1 = 0x45; + vreg_ctrl_1 = 0x41; glbl_rescode_top_ctrl = 0x00; glbl_rescode_bot_ctrl = 0x00; } else { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -2310,7 +2310,7 @@ err_cleanup: if (ret) - drm_atomic_helper_cleanup_planes(dev, state); + drm_atomic_helper_unprepare_planes(dev, state); done: pm_runtime_put_autosuspend(dev->dev); return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/nouveau/include/nvkm/core/event.h +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/nouveau/include/nvkm/core/event.h @@ -14,7 +14,7 @@ int index_nr; spinlock_t refs_lock; - spinlock_t list_lock; + rwlock_t list_lock; int *refs; struct list_head ntfy; @@ -38,7 +38,7 @@ int types_nr, int index_nr, struct nvkm_event *event) { spin_lock_init(&event->refs_lock); - spin_lock_init(&event->list_lock); + rwlock_init(&event->list_lock); return __nvkm_event_init(func, subdev, types_nr, index_nr, event); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/nouveau/nvkm/core/event.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/nouveau/nvkm/core/event.c @@ -81,17 +81,17 @@ static void nvkm_event_ntfy_remove(struct nvkm_event_ntfy *ntfy) { - spin_lock_irq(&ntfy->event->list_lock); + write_lock_irq(&ntfy->event->list_lock); list_del_init(&ntfy->head); - spin_unlock_irq(&ntfy->event->list_lock); + write_unlock_irq(&ntfy->event->list_lock); } static void nvkm_event_ntfy_insert(struct nvkm_event_ntfy *ntfy) { - spin_lock_irq(&ntfy->event->list_lock); + write_lock_irq(&ntfy->event->list_lock); list_add_tail(&ntfy->head, &ntfy->event->ntfy); - spin_unlock_irq(&ntfy->event->list_lock); + write_unlock_irq(&ntfy->event->list_lock); } static void @@ -176,7 +176,7 @@ return; nvkm_trace(event->subdev, "event: ntfy %08x on %d\n", bits, id); - spin_lock_irqsave(&event->list_lock, flags); + read_lock_irqsave(&event->list_lock, flags); list_for_each_entry_safe(ntfy, ntmp, &event->ntfy, head) { if (ntfy->id == id && ntfy->bits & bits) { @@ -185,7 +185,7 @@ } } - spin_unlock_irqrestore(&event->list_lock, flags); + read_unlock_irqrestore(&event->list_lock, flags); } void only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c @@ -62,6 +62,18 @@ return object->client->event(token, &args, sizeof(args.v0)); } +static bool +nvkm_connector_is_dp_dms(u8 type) +{ + switch (type) { + case DCB_CONNECTOR_DMS59_DP0: + case DCB_CONNECTOR_DMS59_DP1: + return true; + default: + return false; + } +} + static int nvkm_uconn_uevent(struct nvkm_object *object, void *argv, u32 argc, struct nvkm_uevent *uevent) { @@ -101,7 +113,7 @@ if (args->v0.types & NVIF_CONN_EVENT_V0_UNPLUG) bits |= NVKM_GPIO_LO; if (args->v0.types & NVIF_CONN_EVENT_V0_IRQ) { /* TODO: support DP IRQ on ANX9805 and remove this hack. */ - if (!outp->info.location) + if (!outp->info.location && !nvkm_connector_is_dp_dms(conn->info.type)) return -EINVAL; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/panel/panel-arm-versatile.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-arm-versatile.c @@ -267,6 +267,8 @@ connector->display_info.bus_flags = vpanel->panel_type->bus_flags; mode = drm_mode_duplicate(connector->dev, &vpanel->panel_type->mode); + if (!mode) + return -ENOMEM; drm_mode_set_name(mode); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/panel/panel-novatek-nt36523.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-novatek-nt36523.c @@ -1266,9 +1266,9 @@ return dev_err_probe(dev, -EPROBE_DEFER, "cannot get secondary DSI host\n"); pinfo->dsi[1] = mipi_dsi_device_register_full(dsi1_host, info); - if (!pinfo->dsi[1]) { + if (IS_ERR(pinfo->dsi[1])) { dev_err(dev, "cannot get secondary DSI device\n"); - return -ENODEV; + return PTR_ERR(pinfo->dsi[1]); } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-sitronix-st7703.c @@ -506,29 +506,30 @@ return 0; dev_dbg(ctx->dev, "Resetting the panel\n"); - ret = regulator_enable(ctx->vcc); + gpiod_set_value_cansleep(ctx->reset_gpio, 1); + + ret = regulator_enable(ctx->iovcc); if (ret < 0) { - dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret); + dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); return ret; } - ret = regulator_enable(ctx->iovcc); + + ret = regulator_enable(ctx->vcc); if (ret < 0) { - dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); - goto disable_vcc; + dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret); + regulator_disable(ctx->iovcc); + return ret; } - gpiod_set_value_cansleep(ctx->reset_gpio, 1); - usleep_range(20, 40); + /* Give power supplies time to stabilize before deasserting reset. */ + usleep_range(10000, 20000); + gpiod_set_value_cansleep(ctx->reset_gpio, 0); - msleep(20); + usleep_range(15000, 20000); ctx->prepared = true; return 0; - -disable_vcc: - regulator_disable(ctx->vcc); - return ret; } static const u32 mantix_bus_formats[] = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/panel/panel-tpo-tpg110.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/panel/panel-tpo-tpg110.c @@ -379,6 +379,8 @@ connector->display_info.bus_flags = tpg->panel_mode->bus_flags; mode = drm_mode_duplicate(connector->dev, &tpg->panel_mode->mode); + if (!mode) + return -ENOMEM; drm_mode_set_name(mode); mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/pl111/pl111_drv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/pl111/pl111_drv.c @@ -326,12 +326,18 @@ struct pl111_drm_dev_private *priv = drm->dev_private; drm_dev_unregister(drm); + drm_atomic_helper_shutdown(drm); if (priv->panel) drm_panel_bridge_remove(priv->bridge); drm_dev_put(drm); of_reserved_mem_device_release(dev); } +static void pl111_amba_shutdown(struct amba_device *amba_dev) +{ + drm_atomic_helper_shutdown(amba_get_drvdata(amba_dev)); +} + /* * This early variant lacks the 565 and 444 pixel formats. */ @@ -434,6 +440,7 @@ }, .probe = pl111_amba_probe, .remove = pl111_amba_remove, + .shutdown = pl111_amba_shutdown, .id_table = pl111_id_table, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/qxl/qxl_display.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/qxl/qxl_display.c @@ -1229,6 +1229,9 @@ if (!qdev->monitors_config_bo) return 0; + kfree(qdev->dumb_heads); + qdev->dumb_heads = NULL; + qdev->monitors_config = NULL; qdev->ram_header->monitors_config = 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/radeon/evergreen.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/radeon/evergreen.c @@ -4821,14 +4821,15 @@ break; case 44: /* hdmi */ afmt_idx = src_data; - if (!(afmt_status[afmt_idx] & AFMT_AZ_FORMAT_WTRIG)) - DRM_DEBUG("IH: IH event w/o asserted irq bit?\n"); - if (afmt_idx > 5) { DRM_ERROR("Unhandled interrupt: %d %d\n", src_id, src_data); break; } + + if (!(afmt_status[afmt_idx] & AFMT_AZ_FORMAT_WTRIG)) + DRM_DEBUG("IH: IH event w/o asserted irq bit?\n"); + afmt_status[afmt_idx] &= ~AFMT_AZ_FORMAT_WTRIG; queue_hdmi = true; DRM_DEBUG("IH: HDMI%d\n", afmt_idx + 1); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/radeon/radeon_connectors.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1122,6 +1122,8 @@ else { /* only 800x600 is supported right now on pre-avivo chips */ tv_mode = drm_cvt_mode(dev, 800, 600, 60, false, false, false); + if (!tv_mode) + return 0; tv_mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; drm_mode_probed_add(connector, tv_mode); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -1177,6 +1177,7 @@ struct cdn_dp_device *dp; struct extcon_dev *extcon; struct phy *phy; + int ret; int i; dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL); @@ -1217,9 +1218,19 @@ mutex_init(&dp->lock); dev_set_drvdata(dev, dp); - cdn_dp_audio_codec_init(dp, dev); - - return component_add(dev, &cdn_dp_component_ops); + ret = cdn_dp_audio_codec_init(dp, dev); + if (ret) + return ret; + + ret = component_add(dev, &cdn_dp_component_ops); + if (ret) + goto err_audio_deinit; + + return 0; + +err_audio_deinit: + platform_device_unregister(dp->audio_pdev); + return ret; } static int cdn_dp_remove(struct platform_device *pdev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -40,7 +40,7 @@ ret = iommu_map_sgtable(private->domain, rk_obj->dma_addr, rk_obj->sgt, prot); - if (ret < rk_obj->base.size) { + if (ret < (ssize_t)rk_obj->base.size) { DRM_ERROR("failed to map buffer: size=%zd request_size=%zd\n", ret, rk_obj->base.size); ret = -ENOMEM; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -248,14 +248,22 @@ VOP_REG_SET(vop, common, cfg_done, 1); } -static bool has_rb_swapped(uint32_t format) +static bool has_rb_swapped(uint32_t version, uint32_t format) { switch (format) { case DRM_FORMAT_XBGR8888: case DRM_FORMAT_ABGR8888: - case DRM_FORMAT_BGR888: case DRM_FORMAT_BGR565: return true; + /* + * full framework (IP version 3.x) only need rb swapped for RGB888 and + * little framework (IP version 2.x) only need rb swapped for BGR888, + * check for 3.x to also only rb swap BGR888 for unknown vop version + */ + case DRM_FORMAT_RGB888: + return VOP_MAJOR(version) == 3; + case DRM_FORMAT_BGR888: + return VOP_MAJOR(version) != 3; default: return false; } @@ -1014,7 +1022,7 @@ VOP_WIN_SET(vop, win, dsp_info, dsp_info); VOP_WIN_SET(vop, win, dsp_st, dsp_st); - rb_swap = has_rb_swapped(fb->format->format); + rb_swap = has_rb_swapped(vop->data->version, fb->format->format); VOP_WIN_SET(vop, win, rb_swap, rb_swap); /* @@ -1615,7 +1623,8 @@ if (WARN_ON(!crtc->state)) return NULL; - rockchip_state = kzalloc(sizeof(*rockchip_state), GFP_KERNEL); + rockchip_state = kmemdup(to_rockchip_crtc_state(crtc->state), + sizeof(*rockchip_state), GFP_KERNEL); if (!rockchip_state) return NULL; @@ -1640,7 +1649,10 @@ if (crtc->state) vop_crtc_destroy_state(crtc, crtc->state); - __drm_atomic_helper_crtc_reset(crtc, &crtc_state->base); + if (crtc_state) + __drm_atomic_helper_crtc_reset(crtc, &crtc_state->base); + else + __drm_atomic_helper_crtc_reset(crtc, NULL); } #ifdef CONFIG_DRM_ANALOGIX_DP only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -2080,30 +2080,15 @@ .atomic_disable = vop2_crtc_atomic_disable, }; -static void vop2_crtc_reset(struct drm_crtc *crtc) -{ - struct rockchip_crtc_state *vcstate = to_rockchip_crtc_state(crtc->state); - - if (crtc->state) { - __drm_atomic_helper_crtc_destroy_state(crtc->state); - kfree(vcstate); - } - - vcstate = kzalloc(sizeof(*vcstate), GFP_KERNEL); - if (!vcstate) - return; - - crtc->state = &vcstate->base; - crtc->state->crtc = crtc; -} - static struct drm_crtc_state *vop2_crtc_duplicate_state(struct drm_crtc *crtc) { - struct rockchip_crtc_state *vcstate, *old_vcstate; + struct rockchip_crtc_state *vcstate; - old_vcstate = to_rockchip_crtc_state(crtc->state); + if (WARN_ON(!crtc->state)) + return NULL; - vcstate = kmemdup(old_vcstate, sizeof(*old_vcstate), GFP_KERNEL); + vcstate = kmemdup(to_rockchip_crtc_state(crtc->state), + sizeof(*vcstate), GFP_KERNEL); if (!vcstate) return NULL; @@ -2121,6 +2106,20 @@ kfree(vcstate); } +static void vop2_crtc_reset(struct drm_crtc *crtc) +{ + struct rockchip_crtc_state *vcstate = + kzalloc(sizeof(*vcstate), GFP_KERNEL); + + if (crtc->state) + vop2_crtc_destroy_state(crtc, crtc->state); + + if (vcstate) + __drm_atomic_helper_crtc_reset(crtc, &vcstate->base); + else + __drm_atomic_helper_crtc_reset(crtc, NULL); +} + static const struct drm_crtc_funcs vop2_crtc_funcs = { .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/stm/drv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/stm/drv.c @@ -113,6 +113,7 @@ DRM_DEBUG("%s\n", __func__); drm_kms_helper_poll_fini(ddev); + drm_atomic_helper_shutdown(ddev); ltdc_unload(ddev); } @@ -213,7 +214,7 @@ return ret; } -static int stm_drm_platform_remove(struct platform_device *pdev) +static void stm_drm_platform_remove(struct platform_device *pdev) { struct drm_device *ddev = platform_get_drvdata(pdev); @@ -222,8 +223,11 @@ drm_dev_unregister(ddev); drv_unload(ddev); drm_dev_put(ddev); +} - return 0; +static void stm_drm_platform_shutdown(struct platform_device *pdev) +{ + drm_atomic_helper_shutdown(platform_get_drvdata(pdev)); } static const struct of_device_id drv_dt_ids[] = { @@ -234,7 +238,8 @@ static struct platform_driver stm_drm_platform_driver = { .probe = stm_drm_platform_probe, - .remove = stm_drm_platform_remove, + .remove_new = stm_drm_platform_remove, + .shutdown = stm_drm_platform_shutdown, .driver = { .name = "stm32-display", .of_match_table = drv_dt_ids, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c @@ -535,15 +535,13 @@ return ret; } -static int dw_mipi_dsi_stm_remove(struct platform_device *pdev) +static void dw_mipi_dsi_stm_remove(struct platform_device *pdev) { struct dw_mipi_dsi_stm *dsi = platform_get_drvdata(pdev); dw_mipi_dsi_remove(dsi->dsi); clk_disable_unprepare(dsi->pllref_clk); regulator_disable(dsi->vdd_supply); - - return 0; } static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev) @@ -588,7 +586,7 @@ static struct platform_driver dw_mipi_dsi_stm_driver = { .probe = dw_mipi_dsi_stm_probe, - .remove = dw_mipi_dsi_stm_remove, + .remove_new = dw_mipi_dsi_stm_remove, .driver = { .of_match_table = dw_mipi_dsi_stm_dt_ids, .name = "stm32-display-dsi", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -175,6 +175,7 @@ drm_dev_unregister(dev); drm_kms_helper_poll_fini(dev); + drm_atomic_helper_shutdown(dev); tilcdc_irq_uninstall(dev); drm_mode_config_cleanup(dev); @@ -389,6 +390,7 @@ init_failed: tilcdc_fini(ddev); + platform_set_drvdata(pdev, NULL); return ret; } @@ -537,7 +539,8 @@ if (!ddev->dev_private) return; - tilcdc_fini(dev_get_drvdata(dev)); + tilcdc_fini(ddev); + dev_set_drvdata(dev, NULL); } static const struct component_master_ops tilcdc_comp_ops = { @@ -582,6 +585,11 @@ return 0; } +static void tilcdc_pdev_shutdown(struct platform_device *pdev) +{ + drm_atomic_helper_shutdown(platform_get_drvdata(pdev)); +} + static const struct of_device_id tilcdc_of_match[] = { { .compatible = "ti,am33xx-tilcdc", }, { .compatible = "ti,da850-tilcdc", }, @@ -592,6 +600,7 @@ static struct platform_driver tilcdc_platform_driver = { .probe = tilcdc_pdev_probe, .remove = tilcdc_pdev_remove, + .shutdown = tilcdc_pdev_shutdown, .driver = { .name = "tilcdc", .pm = pm_sleep_ptr(&tilcdc_pm_ops), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/ttm/ttm_device.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/ttm/ttm_device.c @@ -232,10 +232,6 @@ struct ttm_resource_manager *man; unsigned i; - man = ttm_manager_type(bdev, TTM_PL_SYSTEM); - ttm_resource_manager_set_used(man, false); - ttm_set_driver_manager(bdev, TTM_PL_SYSTEM, NULL); - mutex_lock(&ttm_global_mutex); list_del(&bdev->device_list); mutex_unlock(&ttm_global_mutex); @@ -243,6 +239,10 @@ drain_workqueue(bdev->wq); destroy_workqueue(bdev->wq); + man = ttm_manager_type(bdev, TTM_PL_SYSTEM); + ttm_resource_manager_set_used(man, false); + ttm_set_driver_manager(bdev, TTM_PL_SYSTEM, NULL); + spin_lock(&bdev->lru_lock); for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) if (list_empty(&man->lru[0])) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/tve200/tve200_drv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/tve200/tve200_drv.c @@ -236,19 +236,23 @@ return ret; } -static int tve200_remove(struct platform_device *pdev) +static void tve200_remove(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev); struct tve200_drm_dev_private *priv = drm->dev_private; drm_dev_unregister(drm); + drm_atomic_helper_shutdown(drm); if (priv->panel) drm_panel_bridge_remove(priv->bridge); drm_mode_config_cleanup(drm); clk_disable_unprepare(priv->pclk); drm_dev_put(drm); +} - return 0; +static void tve200_shutdown(struct platform_device *pdev) +{ + drm_atomic_helper_shutdown(platform_get_drvdata(pdev)); } static const struct of_device_id tve200_of_match[] = { @@ -264,7 +268,8 @@ .of_match_table = of_match_ptr(tve200_of_match), }, .probe = tve200_probe, - .remove = tve200_remove, + .remove_new = tve200_remove, + .shutdown = tve200_shutdown, }; drm_module_platform_driver(tve200_driver); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/vboxvideo/vbox_drv.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/vboxvideo/vbox_drv.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -97,11 +98,19 @@ struct vbox_private *vbox = pci_get_drvdata(pdev); drm_dev_unregister(&vbox->ddev); + drm_atomic_helper_shutdown(&vbox->ddev); vbox_irq_fini(vbox); vbox_mode_fini(vbox); vbox_hw_fini(vbox); } +static void vbox_pci_shutdown(struct pci_dev *pdev) +{ + struct vbox_private *vbox = pci_get_drvdata(pdev); + + drm_atomic_helper_shutdown(&vbox->ddev); +} + static int vbox_pm_suspend(struct device *dev) { struct vbox_private *vbox = dev_get_drvdata(dev); @@ -165,6 +174,7 @@ .id_table = pciidlist, .probe = vbox_pci_probe, .remove = vbox_pci_remove, + .shutdown = vbox_pci_shutdown, .driver.pm = pm_sleep_ptr(&vbox_pm_ops), }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/vc4/tests/vc4_mock_crtc.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/vc4/tests/vc4_mock_crtc.c @@ -26,7 +26,7 @@ struct vc4_crtc *vc4_crtc; int ret; - dummy_crtc = kunit_kzalloc(test, sizeof(*dummy_crtc), GFP_KERNEL); + dummy_crtc = drmm_kzalloc(drm, sizeof(*dummy_crtc), GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, dummy_crtc); vc4_crtc = &dummy_crtc->crtc; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/drm/vc4/tests/vc4_mock_output.c +++ linux-aws-6.5-6.5.0/drivers/gpu/drm/vc4/tests/vc4_mock_output.c @@ -32,7 +32,7 @@ struct drm_encoder *enc; int ret; - dummy_output = kunit_kzalloc(test, sizeof(*dummy_output), GFP_KERNEL); + dummy_output = drmm_kzalloc(drm, sizeof(*dummy_output), GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dummy_output); dummy_output->encoder.type = vc4_encoder_type; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/gpu/host1x/context.c +++ linux-aws-6.5-6.5.0/drivers/gpu/host1x/context.c @@ -34,10 +34,10 @@ if (err < 0) return 0; - cdl->devs = kcalloc(err, sizeof(*cdl->devs), GFP_KERNEL); + cdl->len = err / 4; + cdl->devs = kcalloc(cdl->len, sizeof(*cdl->devs), GFP_KERNEL); if (!cdl->devs) return -ENOMEM; - cdl->len = err / 4; for (i = 0; i < cdl->len; i++) { ctx = &cdl->devs[i]; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hid/hid-core.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-core.c @@ -702,15 +702,22 @@ * Free a device structure, all reports, and all fields. */ -static void hid_device_release(struct device *dev) +void hiddev_free(struct kref *ref) { - struct hid_device *hid = to_hid_device(dev); + struct hid_device *hid = container_of(ref, struct hid_device, ref); hid_close_report(hid); kfree(hid->dev_rdesc); kfree(hid); } +static void hid_device_release(struct device *dev) +{ + struct hid_device *hid = to_hid_device(dev); + + kref_put(&hid->ref, hiddev_free); +} + /* * Fetch a report description item from the data stream. We support long * items, though they are not used yet. @@ -2846,6 +2853,7 @@ spin_lock_init(&hdev->debug_list_lock); sema_init(&hdev->driver_input_lock, 1); mutex_init(&hdev->ll_open_lock); + kref_init(&hdev->ref); hid_bpf_device_init(hdev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hid/hid-cp2112.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-cp2112.c @@ -163,7 +163,6 @@ atomic_t read_avail; atomic_t xfer_avail; struct gpio_chip gc; - struct irq_chip irq; u8 *in_out_buffer; struct mutex lock; @@ -1080,16 +1079,20 @@ { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct cp2112_device *dev = gpiochip_get_data(gc); + irq_hw_number_t hwirq = irqd_to_hwirq(d); - __clear_bit(d->hwirq, &dev->irq_mask); + __clear_bit(hwirq, &dev->irq_mask); + gpiochip_disable_irq(gc, hwirq); } static void cp2112_gpio_irq_unmask(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct cp2112_device *dev = gpiochip_get_data(gc); + irq_hw_number_t hwirq = irqd_to_hwirq(d); - __set_bit(d->hwirq, &dev->irq_mask); + gpiochip_enable_irq(gc, hwirq); + __set_bit(hwirq, &dev->irq_mask); } static void cp2112_gpio_poll_callback(struct work_struct *work) @@ -1159,8 +1162,6 @@ struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct cp2112_device *dev = gpiochip_get_data(gc); - INIT_DELAYED_WORK(&dev->gpio_poll_worker, cp2112_gpio_poll_callback); - if (!dev->gpio_poll) { dev->gpio_poll = true; schedule_delayed_work(&dev->gpio_poll_worker, 0); @@ -1175,7 +1176,12 @@ struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct cp2112_device *dev = gpiochip_get_data(gc); - cancel_delayed_work_sync(&dev->gpio_poll_worker); + cp2112_gpio_irq_mask(d); + + if (!dev->irq_mask) { + dev->gpio_poll = false; + cancel_delayed_work_sync(&dev->gpio_poll_worker); + } } static int cp2112_gpio_irq_type(struct irq_data *d, unsigned int type) @@ -1228,6 +1234,18 @@ return ret; } +static const struct irq_chip cp2112_gpio_irqchip = { + .name = "cp2112-gpio", + .irq_startup = cp2112_gpio_irq_startup, + .irq_shutdown = cp2112_gpio_irq_shutdown, + .irq_ack = cp2112_gpio_irq_ack, + .irq_mask = cp2112_gpio_irq_mask, + .irq_unmask = cp2112_gpio_irq_unmask, + .irq_set_type = cp2112_gpio_irq_type, + .flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS, +}; + static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id) { struct cp2112_device *dev; @@ -1337,17 +1355,8 @@ dev->gc.can_sleep = 1; dev->gc.parent = &hdev->dev; - dev->irq.name = "cp2112-gpio"; - dev->irq.irq_startup = cp2112_gpio_irq_startup; - dev->irq.irq_shutdown = cp2112_gpio_irq_shutdown; - dev->irq.irq_ack = cp2112_gpio_irq_ack; - dev->irq.irq_mask = cp2112_gpio_irq_mask; - dev->irq.irq_unmask = cp2112_gpio_irq_unmask; - dev->irq.irq_set_type = cp2112_gpio_irq_type; - dev->irq.flags = IRQCHIP_MASK_ON_SUSPEND; - girq = &dev->gc.irq; - girq->chip = &dev->irq; + gpio_irq_chip_set_chip(girq, &cp2112_gpio_irqchip); /* The event comes from the outside so no parent handler */ girq->parent_handler = NULL; girq->num_parents = 0; @@ -1356,6 +1365,8 @@ girq->handler = handle_simple_irq; girq->threaded = true; + INIT_DELAYED_WORK(&dev->gpio_poll_worker, cp2112_gpio_poll_callback); + ret = gpiochip_add_data(&dev->gc, dev); if (ret < 0) { hid_err(hdev, "error registering gpio chip\n"); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hid/hid-debug.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-debug.c @@ -1135,6 +1135,7 @@ goto out; } list->hdev = (struct hid_device *) inode->i_private; + kref_get(&list->hdev->ref); file->private_data = list; mutex_init(&list->read_mutex); @@ -1227,6 +1228,8 @@ list_del(&list->node); spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags); kfifo_free(&list->hid_debug_fifo); + + kref_put(&list->hdev->ref, hiddev_free); kfree(list); return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hid/hid-holtek-kbd.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-holtek-kbd.c @@ -130,6 +130,10 @@ return -ENODEV; boot_hid = usb_get_intfdata(boot_interface); + if (list_empty(&boot_hid->inputs)) { + hid_err(hid, "no inputs found\n"); + return -ENODEV; + } boot_hid_input = list_first_entry(&boot_hid->inputs, struct hid_input, list); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hid/hid-ids.h +++ linux-aws-6.5-6.5.0/drivers/hid/hid-ids.h @@ -366,6 +366,7 @@ #define USB_VENDOR_ID_DELL 0x413c #define USB_DEVICE_ID_DELL_PIXART_USB_OPTICAL_MOUSE 0x301a +#define USB_DEVICE_ID_DELL_PRO_WIRELESS_KM5221W 0x4503 #define USB_VENDOR_ID_DELORME 0x1163 #define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100 @@ -425,6 +426,7 @@ #define I2C_DEVICE_ID_HP_SPECTRE_X360_13T_AW100 0x29F5 #define I2C_DEVICE_ID_HP_SPECTRE_X360_14T_EA100_V1 0x2BED #define I2C_DEVICE_ID_HP_SPECTRE_X360_14T_EA100_V2 0x2BEE +#define I2C_DEVICE_ID_HP_ENVY_X360_15_EU0556NG 0x2D02 #define USB_VENDOR_ID_ELECOM 0x056e #define USB_DEVICE_ID_ELECOM_BM084 0x0061 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hid/hid-lenovo.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-lenovo.c @@ -51,7 +51,12 @@ int select_right; int sensitivity; int press_speed; - u8 middlebutton_state; /* 0:Up, 1:Down (undecided), 2:Scrolling */ + /* 0: Up + * 1: Down (undecided) + * 2: Scrolling + * 3: Patched firmware, disable workaround + */ + u8 middlebutton_state; bool fn_lock; }; @@ -521,6 +526,19 @@ int ret; struct lenovo_drvdata *cptkbd_data = hid_get_drvdata(hdev); + /* + * Tell the keyboard a driver understands it, and turn F7, F9, F11 into + * regular keys + */ + ret = lenovo_send_cmd_cptkbd(hdev, 0x01, 0x03); + if (ret) + hid_warn(hdev, "Failed to switch F7/9/11 mode: %d\n", ret); + + /* Switch middle button to native mode */ + ret = lenovo_send_cmd_cptkbd(hdev, 0x09, 0x01); + if (ret) + hid_warn(hdev, "Failed to switch middle button: %d\n", ret); + ret = lenovo_send_cmd_cptkbd(hdev, 0x05, cptkbd_data->fn_lock); if (ret) hid_err(hdev, "Fn-lock setting failed: %d\n", ret); @@ -668,31 +686,48 @@ { struct lenovo_drvdata *cptkbd_data = hid_get_drvdata(hdev); - /* "wheel" scroll events */ - if (usage->type == EV_REL && (usage->code == REL_WHEEL || - usage->code == REL_HWHEEL)) { - /* Scroll events disable middle-click event */ - cptkbd_data->middlebutton_state = 2; - return 0; - } + if (cptkbd_data->middlebutton_state != 3) { + /* REL_X and REL_Y events during middle button pressed + * are only possible on patched, bug-free firmware + * so set middlebutton_state to 3 + * to never apply workaround anymore + */ + if (cptkbd_data->middlebutton_state == 1 && + usage->type == EV_REL && + (usage->code == REL_X || usage->code == REL_Y)) { + cptkbd_data->middlebutton_state = 3; + /* send middle button press which was hold before */ + input_event(field->hidinput->input, + EV_KEY, BTN_MIDDLE, 1); + input_sync(field->hidinput->input); + } + + /* "wheel" scroll events */ + if (usage->type == EV_REL && (usage->code == REL_WHEEL || + usage->code == REL_HWHEEL)) { + /* Scroll events disable middle-click event */ + cptkbd_data->middlebutton_state = 2; + return 0; + } - /* Middle click events */ - if (usage->type == EV_KEY && usage->code == BTN_MIDDLE) { - if (value == 1) { - cptkbd_data->middlebutton_state = 1; - } else if (value == 0) { - if (cptkbd_data->middlebutton_state == 1) { - /* No scrolling inbetween, send middle-click */ - input_event(field->hidinput->input, - EV_KEY, BTN_MIDDLE, 1); - input_sync(field->hidinput->input); - input_event(field->hidinput->input, - EV_KEY, BTN_MIDDLE, 0); - input_sync(field->hidinput->input); + /* Middle click events */ + if (usage->type == EV_KEY && usage->code == BTN_MIDDLE) { + if (value == 1) { + cptkbd_data->middlebutton_state = 1; + } else if (value == 0) { + if (cptkbd_data->middlebutton_state == 1) { + /* No scrolling inbetween, send middle-click */ + input_event(field->hidinput->input, + EV_KEY, BTN_MIDDLE, 1); + input_sync(field->hidinput->input); + input_event(field->hidinput->input, + EV_KEY, BTN_MIDDLE, 0); + input_sync(field->hidinput->input); + } + cptkbd_data->middlebutton_state = 0; } - cptkbd_data->middlebutton_state = 0; + return 1; } - return 1; } if (usage->type == EV_KEY && usage->code == KEY_FN_ESC && value == 1) { @@ -1126,22 +1161,6 @@ } hid_set_drvdata(hdev, cptkbd_data); - /* - * Tell the keyboard a driver understands it, and turn F7, F9, F11 into - * regular keys (Compact only) - */ - if (hdev->product == USB_DEVICE_ID_LENOVO_CUSBKBD || - hdev->product == USB_DEVICE_ID_LENOVO_CBTKBD) { - ret = lenovo_send_cmd_cptkbd(hdev, 0x01, 0x03); - if (ret) - hid_warn(hdev, "Failed to switch F7/9/11 mode: %d\n", ret); - } - - /* Switch middle button to native mode */ - ret = lenovo_send_cmd_cptkbd(hdev, 0x09, 0x01); - if (ret) - hid_warn(hdev, "Failed to switch middle button: %d\n", ret); - /* Set keyboard settings to known state */ cptkbd_data->middlebutton_state = 0; cptkbd_data->fn_lock = true; @@ -1264,6 +1283,24 @@ return ret; } +#ifdef CONFIG_PM +static int lenovo_reset_resume(struct hid_device *hdev) +{ + switch (hdev->product) { + case USB_DEVICE_ID_LENOVO_CUSBKBD: + case USB_DEVICE_ID_LENOVO_TPIIUSBKBD: + if (hdev->type == HID_TYPE_USBMOUSE) + lenovo_features_set_cptkbd(hdev); + + break; + default: + break; + } + + return 0; +} +#endif + static void lenovo_remove_tpkbd(struct hid_device *hdev) { struct lenovo_drvdata *data_pointer = hid_get_drvdata(hdev); @@ -1380,6 +1417,9 @@ .raw_event = lenovo_raw_event, .event = lenovo_event, .report_fixup = lenovo_report_fixup, +#ifdef CONFIG_PM + .reset_resume = lenovo_reset_resume, +#endif }; module_hid_driver(lenovo_driver); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hid/hid-nintendo.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-nintendo.c @@ -2088,7 +2088,9 @@ struct joycon_input_report *report; req.subcmd_id = JC_SUBCMD_REQ_DEV_INFO; + mutex_lock(&ctlr->output_mutex); ret = joycon_send_subcmd(ctlr, &req, 0, HZ); + mutex_unlock(&ctlr->output_mutex); if (ret) { hid_err(ctlr->hdev, "Failed to get joycon info; ret=%d\n", ret); return ret; @@ -2117,6 +2119,85 @@ return 0; } +static int joycon_init(struct hid_device *hdev) +{ + struct joycon_ctlr *ctlr = hid_get_drvdata(hdev); + int ret = 0; + + mutex_lock(&ctlr->output_mutex); + /* if handshake command fails, assume ble pro controller */ + if ((jc_type_is_procon(ctlr) || jc_type_is_chrggrip(ctlr)) && + !joycon_send_usb(ctlr, JC_USB_CMD_HANDSHAKE, HZ)) { + hid_dbg(hdev, "detected USB controller\n"); + /* set baudrate for improved latency */ + ret = joycon_send_usb(ctlr, JC_USB_CMD_BAUDRATE_3M, HZ); + if (ret) { + hid_err(hdev, "Failed to set baudrate; ret=%d\n", ret); + goto out_unlock; + } + /* handshake */ + ret = joycon_send_usb(ctlr, JC_USB_CMD_HANDSHAKE, HZ); + if (ret) { + hid_err(hdev, "Failed handshake; ret=%d\n", ret); + goto out_unlock; + } + /* + * Set no timeout (to keep controller in USB mode). + * This doesn't send a response, so ignore the timeout. + */ + joycon_send_usb(ctlr, JC_USB_CMD_NO_TIMEOUT, HZ/10); + } else if (jc_type_is_chrggrip(ctlr)) { + hid_err(hdev, "Failed charging grip handshake\n"); + ret = -ETIMEDOUT; + goto out_unlock; + } + + /* get controller calibration data, and parse it */ + ret = joycon_request_calibration(ctlr); + if (ret) { + /* + * We can function with default calibration, but it may be + * inaccurate. Provide a warning, and continue on. + */ + hid_warn(hdev, "Analog stick positions may be inaccurate\n"); + } + + /* get IMU calibration data, and parse it */ + ret = joycon_request_imu_calibration(ctlr); + if (ret) { + /* + * We can function with default calibration, but it may be + * inaccurate. Provide a warning, and continue on. + */ + hid_warn(hdev, "Unable to read IMU calibration data\n"); + } + + /* Set the reporting mode to 0x30, which is the full report mode */ + ret = joycon_set_report_mode(ctlr); + if (ret) { + hid_err(hdev, "Failed to set report mode; ret=%d\n", ret); + goto out_unlock; + } + + /* Enable rumble */ + ret = joycon_enable_rumble(ctlr); + if (ret) { + hid_err(hdev, "Failed to enable rumble; ret=%d\n", ret); + goto out_unlock; + } + + /* Enable the IMU */ + ret = joycon_enable_imu(ctlr); + if (ret) { + hid_err(hdev, "Failed to enable the IMU; ret=%d\n", ret); + goto out_unlock; + } + +out_unlock: + mutex_unlock(&ctlr->output_mutex); + return ret; +} + /* Common handler for parsing inputs */ static int joycon_ctlr_read_handler(struct joycon_ctlr *ctlr, u8 *data, int size) @@ -2248,85 +2329,19 @@ hid_device_io_start(hdev); - /* Initialize the controller */ - mutex_lock(&ctlr->output_mutex); - /* if handshake command fails, assume ble pro controller */ - if ((jc_type_is_procon(ctlr) || jc_type_is_chrggrip(ctlr)) && - !joycon_send_usb(ctlr, JC_USB_CMD_HANDSHAKE, HZ)) { - hid_dbg(hdev, "detected USB controller\n"); - /* set baudrate for improved latency */ - ret = joycon_send_usb(ctlr, JC_USB_CMD_BAUDRATE_3M, HZ); - if (ret) { - hid_err(hdev, "Failed to set baudrate; ret=%d\n", ret); - goto err_mutex; - } - /* handshake */ - ret = joycon_send_usb(ctlr, JC_USB_CMD_HANDSHAKE, HZ); - if (ret) { - hid_err(hdev, "Failed handshake; ret=%d\n", ret); - goto err_mutex; - } - /* - * Set no timeout (to keep controller in USB mode). - * This doesn't send a response, so ignore the timeout. - */ - joycon_send_usb(ctlr, JC_USB_CMD_NO_TIMEOUT, HZ/10); - } else if (jc_type_is_chrggrip(ctlr)) { - hid_err(hdev, "Failed charging grip handshake\n"); - ret = -ETIMEDOUT; - goto err_mutex; - } - - /* get controller calibration data, and parse it */ - ret = joycon_request_calibration(ctlr); - if (ret) { - /* - * We can function with default calibration, but it may be - * inaccurate. Provide a warning, and continue on. - */ - hid_warn(hdev, "Analog stick positions may be inaccurate\n"); - } - - /* get IMU calibration data, and parse it */ - ret = joycon_request_imu_calibration(ctlr); + ret = joycon_init(hdev); if (ret) { - /* - * We can function with default calibration, but it may be - * inaccurate. Provide a warning, and continue on. - */ - hid_warn(hdev, "Unable to read IMU calibration data\n"); - } - - /* Set the reporting mode to 0x30, which is the full report mode */ - ret = joycon_set_report_mode(ctlr); - if (ret) { - hid_err(hdev, "Failed to set report mode; ret=%d\n", ret); - goto err_mutex; - } - - /* Enable rumble */ - ret = joycon_enable_rumble(ctlr); - if (ret) { - hid_err(hdev, "Failed to enable rumble; ret=%d\n", ret); - goto err_mutex; - } - - /* Enable the IMU */ - ret = joycon_enable_imu(ctlr); - if (ret) { - hid_err(hdev, "Failed to enable the IMU; ret=%d\n", ret); - goto err_mutex; + hid_err(hdev, "Failed to initialize controller; ret=%d\n", ret); + goto err_close; } ret = joycon_read_info(ctlr); if (ret) { hid_err(hdev, "Failed to retrieve controller info; ret=%d\n", ret); - goto err_mutex; + goto err_close; } - mutex_unlock(&ctlr->output_mutex); - /* Initialize the leds */ ret = joycon_leds_create(ctlr); if (ret) { @@ -2352,8 +2367,6 @@ hid_dbg(hdev, "probe - success\n"); return 0; -err_mutex: - mutex_unlock(&ctlr->output_mutex); err_close: hid_hw_close(hdev); err_stop: @@ -2383,6 +2396,20 @@ hid_hw_stop(hdev); } +#ifdef CONFIG_PM + +static int nintendo_hid_resume(struct hid_device *hdev) +{ + int ret = joycon_init(hdev); + + if (ret) + hid_err(hdev, "Failed to restore controller after resume"); + + return ret; +} + +#endif + static const struct hid_device_id nintendo_hid_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_PROCON) }, @@ -2404,6 +2431,10 @@ .probe = nintendo_hid_probe, .remove = nintendo_hid_remove, .raw_event = nintendo_hid_event, + +#ifdef CONFIG_PM + .resume = nintendo_hid_resume, +#endif }; module_hid_driver(nintendo_hid_driver); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hid/hid-quirks.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-quirks.c @@ -66,6 +66,7 @@ { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_STRAFE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL }, + { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_PRO_WIRELESS_KM5221W), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_2NES2SNES), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_4NES4SNES), HID_QUIRK_MULTI_INPUT }, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hid/hid-uclogic-core-test.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-uclogic-core-test.c @@ -56,6 +56,11 @@ }, }; +static void fake_work(struct work_struct *work) +{ + +} + static void hid_test_uclogic_exec_event_hook_test(struct kunit *test) { struct uclogic_params p = {0, }; @@ -77,6 +82,8 @@ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, filter->event); memcpy(filter->event, &hook_events[n].event[0], filter->size); + INIT_WORK(&filter->work, fake_work); + list_add_tail(&filter->list, &p.event_hooks->list); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hid/hid-uclogic-params-test.c +++ linux-aws-6.5-6.5.0/drivers/hid/hid-uclogic-params-test.c @@ -174,12 +174,26 @@ KUNIT_EXPECT_EQ(test, params->frame_type, frame_type); } +struct fake_device { + unsigned long quirks; +}; + static void hid_test_uclogic_params_cleanup_event_hooks(struct kunit *test) { int res, n; + struct hid_device *hdev; + struct fake_device *fake_dev; struct uclogic_params p = {0, }; - res = uclogic_params_ugee_v2_init_event_hooks(NULL, &p); + hdev = kunit_kzalloc(test, sizeof(struct hid_device), GFP_KERNEL); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hdev); + + fake_dev = kunit_kzalloc(test, sizeof(struct fake_device), GFP_KERNEL); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, fake_dev); + + hid_set_drvdata(hdev, fake_dev); + + res = uclogic_params_ugee_v2_init_event_hooks(hdev, &p); KUNIT_ASSERT_EQ(test, res, 0); /* Check that the function can be called repeatedly */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hte/hte-tegra194-test.c +++ linux-aws-6.5-6.5.0/drivers/hte/hte-tegra194-test.c @@ -153,8 +153,10 @@ } cnt = of_hte_req_count(hte.pdev); - if (cnt < 0) + if (cnt < 0) { + ret = cnt; goto free_irq; + } dev_info(&pdev->dev, "Total requested lines:%d\n", cnt); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwmon/acpi_power_meter.c +++ linux-aws-6.5-6.5.0/drivers/hwmon/acpi_power_meter.c @@ -31,6 +31,7 @@ #define POWER_METER_CAN_NOTIFY (1 << 3) #define POWER_METER_IS_BATTERY (1 << 8) #define UNKNOWN_HYSTERESIS 0xFFFFFFFF +#define UNKNOWN_POWER 0xFFFFFFFF #define METER_NOTIFY_CONFIG 0x80 #define METER_NOTIFY_TRIP 0x81 @@ -348,6 +349,9 @@ update_meter(resource); mutex_unlock(&resource->lock); + if (resource->power == UNKNOWN_POWER) + return -ENODATA; + return sprintf(buf, "%llu\n", resource->power * 1000); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwmon/axi-fan-control.c +++ linux-aws-6.5-6.5.0/drivers/hwmon/axi-fan-control.c @@ -496,6 +496,21 @@ return -ENODEV; } + ret = axi_fan_control_init(ctl, pdev->dev.of_node); + if (ret) { + dev_err(&pdev->dev, "Failed to initialize device\n"); + return ret; + } + + ctl->hdev = devm_hwmon_device_register_with_info(&pdev->dev, + name, + ctl, + &axi_chip_info, + axi_fan_control_groups); + + if (IS_ERR(ctl->hdev)) + return PTR_ERR(ctl->hdev); + ctl->irq = platform_get_irq(pdev, 0); if (ctl->irq < 0) return ctl->irq; @@ -509,19 +524,7 @@ return ret; } - ret = axi_fan_control_init(ctl, pdev->dev.of_node); - if (ret) { - dev_err(&pdev->dev, "Failed to initialize device\n"); - return ret; - } - - ctl->hdev = devm_hwmon_device_register_with_info(&pdev->dev, - name, - ctl, - &axi_chip_info, - axi_fan_control_groups); - - return PTR_ERR_OR_ZERO(ctl->hdev); + return 0; } static struct platform_driver axi_fan_control_driver = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwmon/coretemp.c +++ linux-aws-6.5-6.5.0/drivers/hwmon/coretemp.c @@ -42,7 +42,7 @@ #define PKG_SYSFS_ATTR_NO 1 /* Sysfs attribute for package temp */ #define BASE_SYSFS_ATTR_NO 2 /* Sysfs Base attr no for coretemp */ #define NUM_REAL_CORES 128 /* Number of Real cores per cpu */ -#define CORETEMP_NAME_LENGTH 19 /* String Length of attrs */ +#define CORETEMP_NAME_LENGTH 28 /* String Length of attrs */ #define MAX_CORE_ATTRS 4 /* Maximum no of basic attrs */ #define TOTAL_ATTRS (MAX_CORE_ATTRS + 1) #define MAX_CORE_DATA (NUM_REAL_CORES + BASE_SYSFS_ATTR_NO) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwmon/nct6775-core.c +++ linux-aws-6.5-6.5.0/drivers/hwmon/nct6775-core.c @@ -1581,17 +1581,21 @@ data->fan_div[i]); if (data->has_fan_min & BIT(i)) { - err = nct6775_read_value(data, data->REG_FAN_MIN[i], ®); + u16 tmp; + + err = nct6775_read_value(data, data->REG_FAN_MIN[i], &tmp); if (err) goto out; - data->fan_min[i] = reg; + data->fan_min[i] = tmp; } if (data->REG_FAN_PULSES[i]) { - err = nct6775_read_value(data, data->REG_FAN_PULSES[i], ®); + u16 tmp; + + err = nct6775_read_value(data, data->REG_FAN_PULSES[i], &tmp); if (err) goto out; - data->fan_pulses[i] = (reg >> data->FAN_PULSE_SHIFT[i]) & 0x03; + data->fan_pulses[i] = (tmp >> data->FAN_PULSE_SHIFT[i]) & 0x03; } err = nct6775_select_fan_div(dev, data, i, reg); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwmon/nzxt-kraken2.c +++ linux-aws-6.5-6.5.0/drivers/hwmon/nzxt-kraken2.c @@ -161,13 +161,13 @@ ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); if (ret) { hid_err(hdev, "hid hw start failed with %d\n", ret); - goto fail_and_stop; + return ret; } ret = hid_hw_open(hdev); if (ret) { hid_err(hdev, "hid hw open failed with %d\n", ret); - goto fail_and_close; + goto fail_and_stop; } priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "kraken2", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwmon/sch5627.c +++ linux-aws-6.5-6.5.0/drivers/hwmon/sch5627.c @@ -6,6 +6,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -32,6 +33,10 @@ #define SCH5627_REG_PRIMARY_ID 0x3f #define SCH5627_REG_CTRL 0x40 +#define SCH5627_CTRL_START BIT(0) +#define SCH5627_CTRL_LOCK BIT(1) +#define SCH5627_CTRL_VBAT BIT(4) + #define SCH5627_NO_TEMPS 8 #define SCH5627_NO_FANS 4 #define SCH5627_NO_IN 5 @@ -147,7 +152,8 @@ /* Trigger a Vbat voltage measurement every 5 minutes */ if (time_after(jiffies, data->last_battery + 300 * HZ)) { - sch56xx_write_virtual_reg(data->addr, SCH5627_REG_CTRL, data->control | 0x10); + sch56xx_write_virtual_reg(data->addr, SCH5627_REG_CTRL, + data->control | SCH5627_CTRL_VBAT); data->last_battery = jiffies; } @@ -226,6 +232,14 @@ static umode_t sch5627_is_visible(const void *drvdata, enum hwmon_sensor_types type, u32 attr, int channel) { + const struct sch5627_data *data = drvdata; + + /* Once the lock bit is set, the virtual registers become read-only + * until the next power cycle. + */ + if (data->control & SCH5627_CTRL_LOCK) + return 0444; + if (type == hwmon_pwm && attr == hwmon_pwm_auto_channels_temp) return 0644; @@ -483,14 +497,13 @@ return val; data->control = val; - if (!(data->control & 0x01)) { + if (!(data->control & SCH5627_CTRL_START)) { pr_err("hardware monitoring not enabled\n"); return -ENODEV; } /* Trigger a Vbat voltage measurement, so that we get a valid reading the first time we read Vbat */ - sch56xx_write_virtual_reg(data->addr, SCH5627_REG_CTRL, - data->control | 0x10); + sch56xx_write_virtual_reg(data->addr, SCH5627_REG_CTRL, data->control | SCH5627_CTRL_VBAT); data->last_battery = jiffies; /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwmon/sch56xx-common.c +++ linux-aws-6.5-6.5.0/drivers/hwmon/sch56xx-common.c @@ -7,10 +7,8 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include -#include #include #include -#include #include #include #include @@ -21,10 +19,7 @@ #include #include "sch56xx-common.h" -static bool ignore_dmi; -module_param(ignore_dmi, bool, 0); -MODULE_PARM_DESC(ignore_dmi, "Omit DMI check for supported devices (default=0)"); - +/* Insmod parameters */ static bool nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" @@ -523,66 +518,11 @@ return PTR_ERR_OR_ZERO(sch56xx_pdev); } -static const struct dmi_system_id sch56xx_dmi_override_table[] __initconst = { - { - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), - DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS W380"), - }, - }, - { - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), - DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO P710"), - }, - }, - { - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), - DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO E9900"), - }, - }, - { } -}; - -/* For autoloading only */ -static const struct dmi_system_id sch56xx_dmi_table[] __initconst = { - { - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), - }, - }, - { } -}; -MODULE_DEVICE_TABLE(dmi, sch56xx_dmi_table); - static int __init sch56xx_init(void) { - const char *name = NULL; int address; + const char *name = NULL; - if (!ignore_dmi) { - if (!dmi_check_system(sch56xx_dmi_table)) - return -ENODEV; - - if (!dmi_check_system(sch56xx_dmi_override_table)) { - /* - * Some machines like the Esprimo P720 and Esprimo C700 have - * onboard devices named " Antiope"/" Theseus" instead of - * "Antiope"/"Theseus", so we need to check for both. - */ - if (!dmi_find_device(DMI_DEV_TYPE_OTHER, "Antiope", NULL) && - !dmi_find_device(DMI_DEV_TYPE_OTHER, " Antiope", NULL) && - !dmi_find_device(DMI_DEV_TYPE_OTHER, "Theseus", NULL) && - !dmi_find_device(DMI_DEV_TYPE_OTHER, " Theseus", NULL)) - return -ENODEV; - } - } - - /* - * Some devices like the Esprimo C700 have both onboard devices, - * so we still have to check manually - */ address = sch56xx_find(0x4e, &name); if (address < 0) address = sch56xx_find(0x2e, &name); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwtracing/coresight/coresight-etm-perf.c +++ linux-aws-6.5-6.5.0/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -493,7 +493,7 @@ goto fail_end_stop; /* Finally enable the tracer */ - if (coresight_enable_source(csdev, CS_MODE_PERF, event)) + if (source_ops(csdev)->enable(csdev, event, CS_MODE_PERF)) goto fail_disable_path; /* @@ -587,7 +587,7 @@ return; /* stop tracer */ - coresight_disable_source(csdev, event); + source_ops(csdev)->disable(csdev, event); /* tell the core */ event->hw.state = PERF_HES_STOPPED; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ linux-aws-6.5-6.5.0/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -2190,7 +2190,7 @@ per_cpu(delayed_probe, cpu) = NULL; } -static void __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) +static void etm4_remove_dev(struct etmv4_drvdata *drvdata) { bool had_delayed_probe; /* @@ -2219,7 +2219,7 @@ } } -static void __exit etm4_remove_amba(struct amba_device *adev) +static void etm4_remove_amba(struct amba_device *adev) { struct etmv4_drvdata *drvdata = dev_get_drvdata(&adev->dev); @@ -2227,7 +2227,7 @@ etm4_remove_dev(drvdata); } -static int __exit etm4_remove_platform_dev(struct platform_device *pdev) +static int etm4_remove_platform_dev(struct platform_device *pdev) { struct etmv4_drvdata *drvdata = dev_get_drvdata(&pdev->dev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwtracing/coresight/ultrasoc-smb.c +++ linux-aws-6.5-6.5.0/drivers/hwtracing/coresight/ultrasoc-smb.c @@ -99,7 +99,7 @@ struct smb_drv_data, miscdev); int ret = 0; - mutex_lock(&drvdata->mutex); + spin_lock(&drvdata->spinlock); if (drvdata->reading) { ret = -EBUSY; @@ -115,7 +115,7 @@ drvdata->reading = true; out: - mutex_unlock(&drvdata->mutex); + spin_unlock(&drvdata->spinlock); return ret; } @@ -132,10 +132,8 @@ if (!len) return 0; - mutex_lock(&drvdata->mutex); - if (!sdb->data_size) - goto out; + return 0; to_copy = min(sdb->data_size, len); @@ -145,20 +143,15 @@ if (copy_to_user(data, sdb->buf_base + sdb->buf_rdptr, to_copy)) { dev_dbg(dev, "Failed to copy data to user\n"); - to_copy = -EFAULT; - goto out; + return -EFAULT; } *ppos += to_copy; - smb_update_read_ptr(drvdata, to_copy); - - dev_dbg(dev, "%zu bytes copied\n", to_copy); -out: if (!sdb->data_size) smb_reset_buffer(drvdata); - mutex_unlock(&drvdata->mutex); + dev_dbg(dev, "%zu bytes copied\n", to_copy); return to_copy; } @@ -167,9 +160,9 @@ struct smb_drv_data *drvdata = container_of(file->private_data, struct smb_drv_data, miscdev); - mutex_lock(&drvdata->mutex); + spin_lock(&drvdata->spinlock); drvdata->reading = false; - mutex_unlock(&drvdata->mutex); + spin_unlock(&drvdata->spinlock); return 0; } @@ -262,7 +255,7 @@ struct smb_drv_data *drvdata = dev_get_drvdata(csdev->dev.parent); int ret = 0; - mutex_lock(&drvdata->mutex); + spin_lock(&drvdata->spinlock); /* Do nothing, the trace data is reading by other interface now */ if (drvdata->reading) { @@ -294,7 +287,7 @@ dev_dbg(&csdev->dev, "Ultrasoc SMB enabled\n"); out: - mutex_unlock(&drvdata->mutex); + spin_unlock(&drvdata->spinlock); return ret; } @@ -304,7 +297,7 @@ struct smb_drv_data *drvdata = dev_get_drvdata(csdev->dev.parent); int ret = 0; - mutex_lock(&drvdata->mutex); + spin_lock(&drvdata->spinlock); if (drvdata->reading) { ret = -EBUSY; @@ -327,7 +320,7 @@ dev_dbg(&csdev->dev, "Ultrasoc SMB disabled\n"); out: - mutex_unlock(&drvdata->mutex); + spin_unlock(&drvdata->spinlock); return ret; } @@ -408,7 +401,7 @@ if (!buf) return 0; - mutex_lock(&drvdata->mutex); + spin_lock(&drvdata->spinlock); /* Don't do anything if another tracer is using this sink. */ if (atomic_read(&csdev->refcnt) != 1) @@ -432,7 +425,7 @@ if (!buf->snapshot && lost) perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); out: - mutex_unlock(&drvdata->mutex); + spin_unlock(&drvdata->spinlock); return data_size; } @@ -484,7 +477,6 @@ static void smb_init_hw(struct smb_drv_data *drvdata) { smb_disable_hw(drvdata); - smb_reset_buffer(drvdata); writel(SMB_LB_CFG_LO_DEFAULT, drvdata->base + SMB_LB_CFG_LO_REG); writel(SMB_LB_CFG_HI_DEFAULT, drvdata->base + SMB_LB_CFG_HI_REG); @@ -590,37 +582,33 @@ return ret; } - mutex_init(&drvdata->mutex); + ret = smb_config_inport(dev, true); + if (ret) + return ret; + + smb_reset_buffer(drvdata); + platform_set_drvdata(pdev, drvdata); + spin_lock_init(&drvdata->spinlock); drvdata->pid = -1; ret = smb_register_sink(pdev, drvdata); if (ret) { + smb_config_inport(&pdev->dev, false); dev_err(dev, "Failed to register SMB sink\n"); return ret; } - ret = smb_config_inport(dev, true); - if (ret) { - smb_unregister_sink(drvdata); - return ret; - } - - platform_set_drvdata(pdev, drvdata); - return 0; } static int smb_remove(struct platform_device *pdev) { struct smb_drv_data *drvdata = platform_get_drvdata(pdev); - int ret; - - ret = smb_config_inport(&pdev->dev, false); - if (ret) - return ret; smb_unregister_sink(drvdata); + smb_config_inport(&pdev->dev, false); + return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwtracing/coresight/ultrasoc-smb.h +++ linux-aws-6.5-6.5.0/drivers/hwtracing/coresight/ultrasoc-smb.h @@ -8,7 +8,7 @@ #define _ULTRASOC_SMB_H #include -#include +#include /* Offset of SMB global registers */ #define SMB_GLB_CFG_REG 0x00 @@ -105,7 +105,7 @@ * @csdev: Component vitals needed by the framework. * @sdb: Data buffer for SMB. * @miscdev: Specifics to handle "/dev/xyz.smb" entry. - * @mutex: Control data access to one at a time. + * @spinlock: Control data access to one at a time. * @reading: Synchronise user space access to SMB buffer. * @pid: Process ID of the process being monitored by the * session that is using this component. @@ -116,7 +116,7 @@ struct coresight_device *csdev; struct smb_data_buffer sdb; struct miscdevice miscdev; - struct mutex mutex; + spinlock_t spinlock; bool reading; pid_t pid; enum cs_mode mode; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/hwtracing/ptt/hisi_ptt.c +++ linux-aws-6.5-6.5.0/drivers/hwtracing/ptt/hisi_ptt.c @@ -1178,6 +1178,10 @@ hisi_ptt_pmu_stop(event, PERF_EF_UPDATE); } +static void hisi_ptt_pmu_read(struct perf_event *event) +{ +} + static void hisi_ptt_remove_cpuhp_instance(void *hotplug_node) { cpuhp_state_remove_instance_nocalls(hisi_ptt_pmu_online, hotplug_node); @@ -1221,6 +1225,7 @@ .stop = hisi_ptt_pmu_stop, .add = hisi_ptt_pmu_add, .del = hisi_ptt_pmu_del, + .read = hisi_ptt_pmu_read, }; reg = readl(hisi_ptt->iobase + HISI_PTT_LOCATION); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/busses/Kconfig +++ linux-aws-6.5-6.5.0/drivers/i2c/busses/Kconfig @@ -158,6 +158,7 @@ Alder Lake (PCH) Raptor Lake (PCH) Meteor Lake (SOC and PCH) + Birch Stream (SOC) This driver can also be built as a module. If so, the module will be called i2c-i801. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/busses/i2c-bcm-iproc.c +++ linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-bcm-iproc.c @@ -316,26 +316,44 @@ iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, val); } -static void bcm_iproc_i2c_check_slave_status( - struct bcm_iproc_i2c_dev *iproc_i2c) +static bool bcm_iproc_i2c_check_slave_status + (struct bcm_iproc_i2c_dev *iproc_i2c, u32 status) { u32 val; + bool recover = false; - val = iproc_i2c_rd_reg(iproc_i2c, S_CMD_OFFSET); - /* status is valid only when START_BUSY is cleared after it was set */ - if (val & BIT(S_CMD_START_BUSY_SHIFT)) - return; - - val = (val >> S_CMD_STATUS_SHIFT) & S_CMD_STATUS_MASK; - if (val == S_CMD_STATUS_TIMEOUT || val == S_CMD_STATUS_MASTER_ABORT) { - dev_err(iproc_i2c->device, (val == S_CMD_STATUS_TIMEOUT) ? - "slave random stretch time timeout\n" : - "Master aborted read transaction\n"); + /* check slave transmit status only if slave is transmitting */ + if (!iproc_i2c->slave_rx_only) { + val = iproc_i2c_rd_reg(iproc_i2c, S_CMD_OFFSET); + /* status is valid only when START_BUSY is cleared */ + if (!(val & BIT(S_CMD_START_BUSY_SHIFT))) { + val = (val >> S_CMD_STATUS_SHIFT) & S_CMD_STATUS_MASK; + if (val == S_CMD_STATUS_TIMEOUT || + val == S_CMD_STATUS_MASTER_ABORT) { + dev_warn(iproc_i2c->device, + (val == S_CMD_STATUS_TIMEOUT) ? + "slave random stretch time timeout\n" : + "Master aborted read transaction\n"); + recover = true; + } + } + } + + /* RX_EVENT is not valid when START_BUSY is set */ + if ((status & BIT(IS_S_RX_EVENT_SHIFT)) && + (status & BIT(IS_S_START_BUSY_SHIFT))) { + dev_warn(iproc_i2c->device, "Slave aborted read transaction\n"); + recover = true; + } + + if (recover) { /* re-initialize i2c for recovery */ bcm_iproc_i2c_enable_disable(iproc_i2c, false); bcm_iproc_i2c_slave_init(iproc_i2c, true); bcm_iproc_i2c_enable_disable(iproc_i2c, true); } + + return recover; } static void bcm_iproc_i2c_slave_read(struct bcm_iproc_i2c_dev *iproc_i2c) @@ -420,48 +438,6 @@ u32 val; u8 value; - /* - * Slave events in case of master-write, master-write-read and, - * master-read - * - * Master-write : only IS_S_RX_EVENT_SHIFT event - * Master-write-read: both IS_S_RX_EVENT_SHIFT and IS_S_RD_EVENT_SHIFT - * events - * Master-read : both IS_S_RX_EVENT_SHIFT and IS_S_RD_EVENT_SHIFT - * events or only IS_S_RD_EVENT_SHIFT - * - * iproc has a slave rx fifo size of 64 bytes. Rx fifo full interrupt - * (IS_S_RX_FIFO_FULL_SHIFT) will be generated when RX fifo becomes - * full. This can happen if Master issues write requests of more than - * 64 bytes. - */ - if (status & BIT(IS_S_RX_EVENT_SHIFT) || - status & BIT(IS_S_RD_EVENT_SHIFT) || - status & BIT(IS_S_RX_FIFO_FULL_SHIFT)) { - /* disable slave interrupts */ - val = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET); - val &= ~iproc_i2c->slave_int_mask; - iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, val); - - if (status & BIT(IS_S_RD_EVENT_SHIFT)) - /* Master-write-read request */ - iproc_i2c->slave_rx_only = false; - else - /* Master-write request only */ - iproc_i2c->slave_rx_only = true; - - /* schedule tasklet to read data later */ - tasklet_schedule(&iproc_i2c->slave_rx_tasklet); - - /* - * clear only IS_S_RX_EVENT_SHIFT and - * IS_S_RX_FIFO_FULL_SHIFT interrupt. - */ - val = BIT(IS_S_RX_EVENT_SHIFT); - if (status & BIT(IS_S_RX_FIFO_FULL_SHIFT)) - val |= BIT(IS_S_RX_FIFO_FULL_SHIFT); - iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, val); - } if (status & BIT(IS_S_TX_UNDERRUN_SHIFT)) { iproc_i2c->tx_underrun++; @@ -493,8 +469,9 @@ * less than PKT_LENGTH bytes were output on the SMBUS */ iproc_i2c->slave_int_mask &= ~BIT(IE_S_TX_UNDERRUN_SHIFT); - iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, - iproc_i2c->slave_int_mask); + val = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET); + val &= ~BIT(IE_S_TX_UNDERRUN_SHIFT); + iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, val); /* End of SMBUS for Master Read */ val = BIT(S_TX_WR_STATUS_SHIFT); @@ -515,9 +492,49 @@ BIT(IS_S_START_BUSY_SHIFT)); } - /* check slave transmit status only if slave is transmitting */ - if (!iproc_i2c->slave_rx_only) - bcm_iproc_i2c_check_slave_status(iproc_i2c); + /* if the controller has been reset, immediately return from the ISR */ + if (bcm_iproc_i2c_check_slave_status(iproc_i2c, status)) + return true; + + /* + * Slave events in case of master-write, master-write-read and, + * master-read + * + * Master-write : only IS_S_RX_EVENT_SHIFT event + * Master-write-read: both IS_S_RX_EVENT_SHIFT and IS_S_RD_EVENT_SHIFT + * events + * Master-read : both IS_S_RX_EVENT_SHIFT and IS_S_RD_EVENT_SHIFT + * events or only IS_S_RD_EVENT_SHIFT + * + * iproc has a slave rx fifo size of 64 bytes. Rx fifo full interrupt + * (IS_S_RX_FIFO_FULL_SHIFT) will be generated when RX fifo becomes + * full. This can happen if Master issues write requests of more than + * 64 bytes. + */ + if (status & BIT(IS_S_RX_EVENT_SHIFT) || + status & BIT(IS_S_RD_EVENT_SHIFT) || + status & BIT(IS_S_RX_FIFO_FULL_SHIFT)) { + /* disable slave interrupts */ + val = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET); + val &= ~iproc_i2c->slave_int_mask; + iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, val); + + if (status & BIT(IS_S_RD_EVENT_SHIFT)) + /* Master-write-read request */ + iproc_i2c->slave_rx_only = false; + else + /* Master-write request only */ + iproc_i2c->slave_rx_only = true; + + /* schedule tasklet to read data later */ + tasklet_schedule(&iproc_i2c->slave_rx_tasklet); + + /* clear IS_S_RX_FIFO_FULL_SHIFT interrupt */ + if (status & BIT(IS_S_RX_FIFO_FULL_SHIFT)) { + val = BIT(IS_S_RX_FIFO_FULL_SHIFT); + iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, val); + } + } return true; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/busses/i2c-designware-master.c +++ linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-designware-master.c @@ -518,10 +518,16 @@ /* * Because we don't know the buffer length in the - * I2C_FUNC_SMBUS_BLOCK_DATA case, we can't stop - * the transaction here. + * I2C_FUNC_SMBUS_BLOCK_DATA case, we can't stop the + * transaction here. Also disable the TX_EMPTY IRQ + * while waiting for the data length byte to avoid the + * bogus interrupts flood. */ - if (buf_len > 0 || flags & I2C_M_RECV_LEN) { + if (flags & I2C_M_RECV_LEN) { + dev->status |= STATUS_WRITE_IN_PROGRESS; + intr_mask &= ~DW_IC_INTR_TX_EMPTY; + break; + } else if (buf_len > 0) { /* more bytes to be written */ dev->status |= STATUS_WRITE_IN_PROGRESS; break; @@ -557,6 +563,13 @@ msgs[dev->msg_read_idx].len = len; msgs[dev->msg_read_idx].flags &= ~I2C_M_RECV_LEN; + /* + * Received buffer length, re-enable TX_EMPTY interrupt + * to resume the SMBUS transaction. + */ + regmap_update_bits(dev->map, DW_IC_INTR_MASK, DW_IC_INTR_TX_EMPTY, + DW_IC_INTR_TX_EMPTY); + return len; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/busses/i2c-pxa.c +++ linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-pxa.c @@ -264,6 +264,9 @@ u32 hs_mask; struct i2c_bus_recovery_info recovery; + struct pinctrl *pinctrl; + struct pinctrl_state *pinctrl_default; + struct pinctrl_state *pinctrl_recovery; }; #define _IBMR(i2c) ((i2c)->reg_ibmr) @@ -1300,12 +1303,13 @@ */ gpiod_set_value(i2c->recovery.scl_gpiod, ibmr & IBMR_SCLS); gpiod_set_value(i2c->recovery.sda_gpiod, ibmr & IBMR_SDAS); + + WARN_ON(pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_recovery)); } static void i2c_pxa_unprepare_recovery(struct i2c_adapter *adap) { struct pxa_i2c *i2c = adap->algo_data; - struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; u32 isr; /* @@ -1319,7 +1323,7 @@ i2c_pxa_do_reset(i2c); } - WARN_ON(pinctrl_select_state(bri->pinctrl, bri->pins_default)); + WARN_ON(pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_default)); dev_dbg(&i2c->adap.dev, "recovery: IBMR 0x%08x ISR 0x%08x\n", readl(_IBMR(i2c)), readl(_ISR(i2c))); @@ -1341,20 +1345,76 @@ if (IS_ENABLED(CONFIG_I2C_PXA_SLAVE)) return 0; - bri->pinctrl = devm_pinctrl_get(dev); - if (PTR_ERR(bri->pinctrl) == -ENODEV) { - bri->pinctrl = NULL; + i2c->pinctrl = devm_pinctrl_get(dev); + if (PTR_ERR(i2c->pinctrl) == -ENODEV) + i2c->pinctrl = NULL; + if (IS_ERR(i2c->pinctrl)) + return PTR_ERR(i2c->pinctrl); + + if (!i2c->pinctrl) + return 0; + + i2c->pinctrl_default = pinctrl_lookup_state(i2c->pinctrl, + PINCTRL_STATE_DEFAULT); + i2c->pinctrl_recovery = pinctrl_lookup_state(i2c->pinctrl, "recovery"); + + if (IS_ERR(i2c->pinctrl_default) || IS_ERR(i2c->pinctrl_recovery)) { + dev_info(dev, "missing pinmux recovery information: %ld %ld\n", + PTR_ERR(i2c->pinctrl_default), + PTR_ERR(i2c->pinctrl_recovery)); + return 0; + } + + /* + * Claiming GPIOs can influence the pinmux state, and may glitch the + * I2C bus. Do this carefully. + */ + bri->scl_gpiod = devm_gpiod_get(dev, "scl", GPIOD_OUT_HIGH_OPEN_DRAIN); + if (bri->scl_gpiod == ERR_PTR(-EPROBE_DEFER)) + return -EPROBE_DEFER; + if (IS_ERR(bri->scl_gpiod)) { + dev_info(dev, "missing scl gpio recovery information: %pe\n", + bri->scl_gpiod); + return 0; + } + + /* + * We have SCL. Pull SCL low and wait a bit so that SDA glitches + * have no effect. + */ + gpiod_direction_output(bri->scl_gpiod, 0); + udelay(10); + bri->sda_gpiod = devm_gpiod_get(dev, "sda", GPIOD_OUT_HIGH_OPEN_DRAIN); + + /* Wait a bit in case of a SDA glitch, and then release SCL. */ + udelay(10); + gpiod_direction_output(bri->scl_gpiod, 1); + + if (bri->sda_gpiod == ERR_PTR(-EPROBE_DEFER)) + return -EPROBE_DEFER; + + if (IS_ERR(bri->sda_gpiod)) { + dev_info(dev, "missing sda gpio recovery information: %pe\n", + bri->sda_gpiod); return 0; } - if (IS_ERR(bri->pinctrl)) - return PTR_ERR(bri->pinctrl); bri->prepare_recovery = i2c_pxa_prepare_recovery; bri->unprepare_recovery = i2c_pxa_unprepare_recovery; + bri->recover_bus = i2c_generic_scl_recovery; i2c->adap.bus_recovery_info = bri; - return 0; + /* + * Claiming GPIOs can change the pinmux state, which confuses the + * pinctrl since pinctrl's idea of the current setting is unaffected + * by the pinmux change caused by claiming the GPIO. Work around that + * by switching pinctrl to the GPIO state here. We do it this way to + * avoid glitching the I2C bus. + */ + pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_recovery); + + return pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_default); } static int i2c_pxa_probe(struct platform_device *dev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/busses/i2c-stm32f7.c +++ linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-stm32f7.c @@ -1059,9 +1059,10 @@ /* Configure PEC */ if ((flags & I2C_CLIENT_PEC) && f7_msg->size != I2C_SMBUS_QUICK) { cr1 |= STM32F7_I2C_CR1_PECEN; - cr2 |= STM32F7_I2C_CR2_PECBYTE; - if (!f7_msg->read_write) + if (!f7_msg->read_write) { + cr2 |= STM32F7_I2C_CR2_PECBYTE; f7_msg->count++; + } } else { cr1 &= ~STM32F7_I2C_CR1_PECEN; cr2 &= ~STM32F7_I2C_CR2_PECBYTE; @@ -1149,8 +1150,10 @@ f7_msg->stop = true; /* Add one byte for PEC if needed */ - if (cr1 & STM32F7_I2C_CR1_PECEN) + if (cr1 & STM32F7_I2C_CR1_PECEN) { + cr2 |= STM32F7_I2C_CR2_PECBYTE; f7_msg->count++; + } /* Set number of bytes to be transferred */ cr2 &= ~(STM32F7_I2C_CR2_NBYTES_MASK); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/busses/i2c-sun6i-p2wi.c +++ linux-aws-6.5-6.5.0/drivers/i2c/busses/i2c-sun6i-p2wi.c @@ -201,6 +201,11 @@ return -EINVAL; } + if (clk_freq == 0) { + dev_err(dev, "clock-frequency is set to 0 in DT\n"); + return -EINVAL; + } + if (of_get_child_count(np) > 1) { dev_err(dev, "P2WI only supports one slave device\n"); return -EINVAL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/i2c-core-base.c +++ linux-aws-6.5-6.5.0/drivers/i2c/i2c-core-base.c @@ -931,8 +931,9 @@ struct i2c_client * i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *info) { - struct i2c_client *client; - int status; + struct i2c_client *client; + bool need_put = false; + int status; client = kzalloc(sizeof *client, GFP_KERNEL); if (!client) @@ -970,7 +971,6 @@ client->dev.fwnode = info->fwnode; device_enable_async_suspend(&client->dev); - i2c_dev_set_name(adap, client, info); if (info->swnode) { status = device_add_software_node(&client->dev, info->swnode); @@ -982,6 +982,7 @@ } } + i2c_dev_set_name(adap, client, info); status = device_register(&client->dev); if (status) goto out_remove_swnode; @@ -993,6 +994,7 @@ out_remove_swnode: device_remove_software_node(&client->dev); + need_put = true; out_err_put_of_node: of_node_put(info->of_node); out_err: @@ -1000,7 +1002,10 @@ "Failed to register i2c client %s at 0x%02x (%d)\n", client->name, client->addr, status); out_err_silent: - kfree(client); + if (need_put) + put_device(&client->dev); + else + kfree(client); return ERR_PTR(status); } EXPORT_SYMBOL_GPL(i2c_new_client_device); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/i2c-core.h +++ linux-aws-6.5-6.5.0/drivers/i2c/i2c-core.h @@ -29,7 +29,7 @@ */ static inline bool i2c_in_atomic_xfer_mode(void) { - return system_state > SYSTEM_RUNNING && irqs_disabled(); + return system_state > SYSTEM_RUNNING && !preemptible(); } static inline int __i2c_lock_bus_helper(struct i2c_adapter *adap) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/i2c-dev.c +++ linux-aws-6.5-6.5.0/drivers/i2c/i2c-dev.c @@ -450,8 +450,8 @@ if (rdwr_arg.nmsgs > I2C_RDWR_IOCTL_MAX_MSGS) return -EINVAL; - rdwr_pa = memdup_user(rdwr_arg.msgs, - rdwr_arg.nmsgs * sizeof(struct i2c_msg)); + rdwr_pa = memdup_array_user(rdwr_arg.msgs, + rdwr_arg.nmsgs, sizeof(struct i2c_msg)); if (IS_ERR(rdwr_pa)) return PTR_ERR(rdwr_pa); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/i2c-mux.c +++ linux-aws-6.5-6.5.0/drivers/i2c/i2c-mux.c @@ -341,7 +341,7 @@ priv->adap.lock_ops = &i2c_parent_lock_ops; /* Sanity check on class */ - if (i2c_mux_parent_classes(parent) & class) + if (i2c_mux_parent_classes(parent) & class & ~I2C_CLASS_DEPRECATED) dev_err(&parent->dev, "Segment %d behind mux can't share classes with ancestors\n", chan_id); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/muxes/i2c-mux-gpmux.c +++ linux-aws-6.5-6.5.0/drivers/i2c/muxes/i2c-mux-gpmux.c @@ -52,7 +52,7 @@ dev_err(dev, "Cannot parse i2c-parent\n"); return ERR_PTR(-ENODEV); } - parent = of_find_i2c_adapter_by_node(parent_np); + parent = of_get_i2c_adapter_by_node(parent_np); of_node_put(parent_np); if (!parent) return ERR_PTR(-EPROBE_DEFER); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i2c/muxes/i2c-mux-pinctrl.c +++ linux-aws-6.5-6.5.0/drivers/i2c/muxes/i2c-mux-pinctrl.c @@ -62,7 +62,7 @@ dev_err(dev, "Cannot parse i2c-parent\n"); return ERR_PTR(-ENODEV); } - parent = of_find_i2c_adapter_by_node(parent_np); + parent = of_get_i2c_adapter_by_node(parent_np); of_node_put(parent_np); if (!parent) return ERR_PTR(-EPROBE_DEFER); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i3c/master.c +++ linux-aws-6.5-6.5.0/drivers/i3c/master.c @@ -1521,9 +1521,11 @@ desc->dev->dev.of_node = desc->boardinfo->of_node; ret = device_register(&desc->dev->dev); - if (ret) + if (ret) { dev_err(&master->dev, "Failed to add I3C device (err = %d)\n", ret); + put_device(&desc->dev->dev); + } } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i3c/master/i3c-master-cdns.c +++ linux-aws-6.5-6.5.0/drivers/i3c/master/i3c-master-cdns.c @@ -192,7 +192,7 @@ #define SLV_STATUS1_HJ_DIS BIT(18) #define SLV_STATUS1_MR_DIS BIT(17) #define SLV_STATUS1_PROT_ERR BIT(16) -#define SLV_STATUS1_DA(x) (((s) & GENMASK(15, 9)) >> 9) +#define SLV_STATUS1_DA(s) (((s) & GENMASK(15, 9)) >> 9) #define SLV_STATUS1_HAS_DA BIT(8) #define SLV_STATUS1_DDR_RX_FULL BIT(7) #define SLV_STATUS1_DDR_TX_FULL BIT(6) @@ -1624,13 +1624,13 @@ /* Device ID0 is reserved to describe this master. */ master->maxdevs = CONF_STATUS0_DEVS_NUM(val); master->free_rr_slots = GENMASK(master->maxdevs, 1); + master->caps.ibirfifodepth = CONF_STATUS0_IBIR_DEPTH(val); + master->caps.cmdrfifodepth = CONF_STATUS0_CMDR_DEPTH(val); val = readl(master->regs + CONF_STATUS1); master->caps.cmdfifodepth = CONF_STATUS1_CMD_DEPTH(val); master->caps.rxfifodepth = CONF_STATUS1_RX_DEPTH(val); master->caps.txfifodepth = CONF_STATUS1_TX_DEPTH(val); - master->caps.ibirfifodepth = CONF_STATUS0_IBIR_DEPTH(val); - master->caps.cmdrfifodepth = CONF_STATUS0_CMDR_DEPTH(val); spin_lock_init(&master->ibi.lock); master->ibi.num_slots = CONF_STATUS1_IBI_HW_RES(val); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i3c/master/mipi-i3c-hci/dat_v1.c +++ linux-aws-6.5-6.5.0/drivers/i3c/master/mipi-i3c-hci/dat_v1.c @@ -64,15 +64,17 @@ return -EOPNOTSUPP; } - /* use a bitmap for faster free slot search */ - hci->DAT_data = bitmap_zalloc(hci->DAT_entries, GFP_KERNEL); - if (!hci->DAT_data) - return -ENOMEM; - - /* clear them */ - for (dat_idx = 0; dat_idx < hci->DAT_entries; dat_idx++) { - dat_w0_write(dat_idx, 0); - dat_w1_write(dat_idx, 0); + if (!hci->DAT_data) { + /* use a bitmap for faster free slot search */ + hci->DAT_data = bitmap_zalloc(hci->DAT_entries, GFP_KERNEL); + if (!hci->DAT_data) + return -ENOMEM; + + /* clear them */ + for (dat_idx = 0; dat_idx < hci->DAT_entries; dat_idx++) { + dat_w0_write(dat_idx, 0); + dat_w1_write(dat_idx, 0); + } } return 0; @@ -87,7 +89,13 @@ static int hci_dat_v1_alloc_entry(struct i3c_hci *hci) { unsigned int dat_idx; + int ret; + if (!hci->DAT_data) { + ret = hci_dat_v1_init(hci); + if (ret) + return ret; + } dat_idx = find_first_zero_bit(hci->DAT_data, hci->DAT_entries); if (dat_idx >= hci->DAT_entries) return -ENOENT; @@ -103,7 +111,8 @@ { dat_w0_write(dat_idx, 0); dat_w1_write(dat_idx, 0); - __clear_bit(dat_idx, hci->DAT_data); + if (hci->DAT_data) + __clear_bit(dat_idx, hci->DAT_data); } static void hci_dat_v1_set_dynamic_addr(struct i3c_hci *hci, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/i3c/master/mipi-i3c-hci/dma.c +++ linux-aws-6.5-6.5.0/drivers/i3c/master/mipi-i3c-hci/dma.c @@ -734,7 +734,7 @@ unsigned int i; bool handled = false; - for (i = 0; mask && i < 8; i++) { + for (i = 0; mask && i < rings->total; i++) { struct hci_rh_data *rh; u32 status; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iio/adc/exynos_adc.c +++ linux-aws-6.5-6.5.0/drivers/iio/adc/exynos_adc.c @@ -826,16 +826,26 @@ } } + /* leave out any TS related code if unreachable */ + if (IS_REACHABLE(CONFIG_INPUT)) { + has_ts = of_property_read_bool(pdev->dev.of_node, + "has-touchscreen") || pdata; + } + irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; info->irq = irq; - irq = platform_get_irq(pdev, 1); - if (irq == -EPROBE_DEFER) - return irq; - - info->tsirq = irq; + if (has_ts) { + irq = platform_get_irq(pdev, 1); + if (irq == -EPROBE_DEFER) + return irq; + + info->tsirq = irq; + } else { + info->tsirq = -1; + } info->dev = &pdev->dev; @@ -900,12 +910,6 @@ if (info->data->init_hw) info->data->init_hw(info); - /* leave out any TS related code if unreachable */ - if (IS_REACHABLE(CONFIG_INPUT)) { - has_ts = of_property_read_bool(pdev->dev.of_node, - "has-touchscreen") || pdata; - } - if (pdata) info->delay = pdata->delay; else only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iio/adc/stm32-adc-core.c +++ linux-aws-6.5-6.5.0/drivers/iio/adc/stm32-adc-core.c @@ -706,6 +706,8 @@ struct stm32_adc_priv *priv; struct device *dev = &pdev->dev; struct device_node *np = pdev->dev.of_node; + const struct of_device_id *of_id; + struct resource *res; u32 max_rate; int ret; @@ -718,8 +720,11 @@ return -ENOMEM; platform_set_drvdata(pdev, &priv->common); - priv->cfg = (const struct stm32_adc_priv_cfg *) - of_match_device(dev->driver->of_match_table, dev)->data; + of_id = of_match_device(dev->driver->of_match_table, dev); + if (!of_id) + return -ENODEV; + + priv->cfg = (const struct stm32_adc_priv_cfg *)of_id->data; priv->nb_adc_max = priv->cfg->num_adcs; spin_lock_init(&priv->common.lock); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iio/adc/xilinx-xadc-core.c +++ linux-aws-6.5-6.5.0/drivers/iio/adc/xilinx-xadc-core.c @@ -456,6 +456,9 @@ .interrupt_handler = xadc_zynq_interrupt_handler, .update_alarm = xadc_zynq_update_alarm, .type = XADC_TYPE_S7, + /* Temp in C = (val * 503.975) / 2**bits - 273.15 */ + .temp_scale = 503975, + .temp_offset = 273150, }; static const unsigned int xadc_axi_reg_offsets[] = { @@ -566,6 +569,9 @@ .interrupt_handler = xadc_axi_interrupt_handler, .flags = XADC_FLAGS_BUFFERED | XADC_FLAGS_IRQ_OPTIONAL, .type = XADC_TYPE_S7, + /* Temp in C = (val * 503.975) / 2**bits - 273.15 */ + .temp_scale = 503975, + .temp_offset = 273150, }; static const struct xadc_ops xadc_us_axi_ops = { @@ -577,6 +583,12 @@ .interrupt_handler = xadc_axi_interrupt_handler, .flags = XADC_FLAGS_BUFFERED | XADC_FLAGS_IRQ_OPTIONAL, .type = XADC_TYPE_US, + /** + * Values below are for UltraScale+ (SYSMONE4) using internal reference. + * See https://docs.xilinx.com/v/u/en-US/ug580-ultrascale-sysmon + */ + .temp_scale = 509314, + .temp_offset = 280231, }; static int _xadc_update_adc_reg(struct xadc *xadc, unsigned int reg, @@ -945,8 +957,7 @@ *val2 = bits; return IIO_VAL_FRACTIONAL_LOG2; case IIO_TEMP: - /* Temp in C = (val * 503.975) / 2**bits - 273.15 */ - *val = 503975; + *val = xadc->ops->temp_scale; *val2 = bits; return IIO_VAL_FRACTIONAL_LOG2; default: @@ -954,7 +965,7 @@ } case IIO_CHAN_INFO_OFFSET: /* Only the temperature channel has an offset */ - *val = -((273150 << bits) / 503975); + *val = -((xadc->ops->temp_offset << bits) / xadc->ops->temp_scale); return IIO_VAL_INT; case IIO_CHAN_INFO_SAMP_FREQ: ret = xadc_read_samplerate(xadc); @@ -1423,28 +1434,6 @@ if (ret) return ret; - /* Disable all alarms */ - ret = xadc_update_adc_reg(xadc, XADC_REG_CONF1, XADC_CONF1_ALARM_MASK, - XADC_CONF1_ALARM_MASK); - if (ret) - return ret; - - /* Set thresholds to min/max */ - for (i = 0; i < 16; i++) { - /* - * Set max voltage threshold and both temperature thresholds to - * 0xffff, min voltage threshold to 0. - */ - if (i % 8 < 4 || i == 7) - xadc->threshold[i] = 0xffff; - else - xadc->threshold[i] = 0; - ret = xadc_write_adc_reg(xadc, XADC_REG_THRESHOLD(i), - xadc->threshold[i]); - if (ret) - return ret; - } - /* Go to non-buffered mode */ xadc_postdisable(indio_dev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iio/adc/xilinx-xadc.h +++ linux-aws-6.5-6.5.0/drivers/iio/adc/xilinx-xadc.h @@ -85,6 +85,8 @@ unsigned int flags; enum xadc_type type; + int temp_scale; + int temp_offset; }; static inline int _xadc_read_adc_reg(struct xadc *xadc, unsigned int reg, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iio/afe/iio-rescale.c +++ linux-aws-6.5-6.5.0/drivers/iio/afe/iio-rescale.c @@ -214,8 +214,18 @@ return ret < 0 ? ret : -EOPNOTSUPP; } - ret = iio_read_channel_scale(rescale->source, &scale, &scale2); - return rescale_process_offset(rescale, ret, scale, scale2, + if (iio_channel_has_info(rescale->source->channel, + IIO_CHAN_INFO_SCALE)) { + ret = iio_read_channel_scale(rescale->source, &scale, &scale2); + return rescale_process_offset(rescale, ret, scale, scale2, + schan_off, val, val2); + } + + /* + * If we get here we have no scale so scale 1:1 but apply + * rescaler and offset, if any. + */ + return rescale_process_offset(rescale, IIO_VAL_FRACTIONAL, 1, 1, schan_off, val, val2); default: return -EINVAL; @@ -280,8 +290,9 @@ chan->type = rescale->cfg->type; if (iio_channel_has_info(schan, IIO_CHAN_INFO_RAW) && - iio_channel_has_info(schan, IIO_CHAN_INFO_SCALE)) { - dev_info(dev, "using raw+scale source channel\n"); + (iio_channel_has_info(schan, IIO_CHAN_INFO_SCALE) || + iio_channel_has_info(schan, IIO_CHAN_INFO_OFFSET))) { + dev_info(dev, "using raw+scale/offset source channel\n"); } else if (iio_channel_has_info(schan, IIO_CHAN_INFO_PROCESSED)) { dev_info(dev, "using processed channel\n"); rescale->chan_processed = true; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iio/frequency/adf4350.c +++ linux-aws-6.5-6.5.0/drivers/iio/frequency/adf4350.c @@ -33,7 +33,6 @@ struct adf4350_state { struct spi_device *spi; - struct regulator *reg; struct gpio_desc *lock_detect_gpiod; struct adf4350_platform_data *pdata; struct clk *clk; @@ -469,6 +468,15 @@ return pdata; } +static void adf4350_power_down(void *data) +{ + struct iio_dev *indio_dev = data; + struct adf4350_state *st = iio_priv(indio_dev); + + st->regs[ADF4350_REG2] |= ADF4350_REG2_POWER_DOWN_EN; + adf4350_sync_config(st); +} + static int adf4350_probe(struct spi_device *spi) { struct adf4350_platform_data *pdata; @@ -491,31 +499,21 @@ } if (!pdata->clkin) { - clk = devm_clk_get(&spi->dev, "clkin"); + clk = devm_clk_get_enabled(&spi->dev, "clkin"); if (IS_ERR(clk)) - return -EPROBE_DEFER; - - ret = clk_prepare_enable(clk); - if (ret < 0) - return ret; + return PTR_ERR(clk); } indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); - if (indio_dev == NULL) { - ret = -ENOMEM; - goto error_disable_clk; - } + if (indio_dev == NULL) + return -ENOMEM; st = iio_priv(indio_dev); - st->reg = devm_regulator_get(&spi->dev, "vcc"); - if (!IS_ERR(st->reg)) { - ret = regulator_enable(st->reg); - if (ret) - goto error_disable_clk; - } + ret = devm_regulator_get_enable(&spi->dev, "vcc"); + if (ret) + return ret; - spi_set_drvdata(spi, indio_dev); st->spi = spi; st->pdata = pdata; @@ -544,47 +542,21 @@ st->lock_detect_gpiod = devm_gpiod_get_optional(&spi->dev, NULL, GPIOD_IN); - if (IS_ERR(st->lock_detect_gpiod)) { - ret = PTR_ERR(st->lock_detect_gpiod); - goto error_disable_reg; - } + if (IS_ERR(st->lock_detect_gpiod)) + return PTR_ERR(st->lock_detect_gpiod); if (pdata->power_up_frequency) { ret = adf4350_set_freq(st, pdata->power_up_frequency); if (ret) - goto error_disable_reg; + return ret; } - ret = iio_device_register(indio_dev); + ret = devm_add_action_or_reset(&spi->dev, adf4350_power_down, indio_dev); if (ret) - goto error_disable_reg; - - return 0; - -error_disable_reg: - if (!IS_ERR(st->reg)) - regulator_disable(st->reg); -error_disable_clk: - clk_disable_unprepare(clk); - - return ret; -} - -static void adf4350_remove(struct spi_device *spi) -{ - struct iio_dev *indio_dev = spi_get_drvdata(spi); - struct adf4350_state *st = iio_priv(indio_dev); - struct regulator *reg = st->reg; - - st->regs[ADF4350_REG2] |= ADF4350_REG2_POWER_DOWN_EN; - adf4350_sync_config(st); - - iio_device_unregister(indio_dev); - - clk_disable_unprepare(st->clk); + return dev_err_probe(&spi->dev, ret, + "Failed to add action to managed power down\n"); - if (!IS_ERR(reg)) - regulator_disable(reg); + return devm_iio_device_register(&spi->dev, indio_dev); } static const struct of_device_id adf4350_of_match[] = { @@ -607,7 +579,6 @@ .of_match_table = adf4350_of_match, }, .probe = adf4350_probe, - .remove = adf4350_remove, .id_table = adf4350_id, }; module_spi_driver(adf4350_driver); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iio/light/vcnl4000.c +++ linux-aws-6.5-6.5.0/drivers/iio/light/vcnl4000.c @@ -994,7 +994,6 @@ out: mutex_unlock(&data->vcnl4000_lock); - data->chip_spec->set_power_state(data, data->ps_int != 0); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/core/device.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/core/device.c @@ -804,7 +804,7 @@ * empty slots at the beginning. */ pdata_rcu = kzalloc(struct_size(pdata_rcu, pdata, - rdma_end_port(device) + 1), + size_add(rdma_end_port(device), 1)), GFP_KERNEL); if (!pdata_rcu) return -ENOMEM; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/core/sa_query.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/core/sa_query.c @@ -2159,7 +2159,9 @@ s = rdma_start_port(device); e = rdma_end_port(device); - sa_dev = kzalloc(struct_size(sa_dev, port, e - s + 1), GFP_KERNEL); + sa_dev = kzalloc(struct_size(sa_dev, port, + size_add(size_sub(e, s), 1)), + GFP_KERNEL); if (!sa_dev) return -ENOMEM; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/core/sysfs.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/core/sysfs.c @@ -903,7 +903,7 @@ * Two extra attribue elements here, one for the lifespan entry and * one to NULL terminate the list for the sysfs core code */ - data = kzalloc(struct_size(data, attrs, stats->num_counters + 1), + data = kzalloc(struct_size(data, attrs, size_add(stats->num_counters, 1)), GFP_KERNEL); if (!data) goto err_free_stats; @@ -1009,7 +1009,7 @@ * Two extra attribue elements here, one for the lifespan entry and * one to NULL terminate the list for the sysfs core code */ - data = kzalloc(struct_size(data, attrs, stats->num_counters + 1), + data = kzalloc(struct_size(data, attrs, size_add(stats->num_counters, 1)), GFP_KERNEL); if (!data) goto err_free_stats; @@ -1140,7 +1140,7 @@ int ret; gid_attr_group = kzalloc(struct_size(gid_attr_group, attrs_list, - attr->gid_tbl_len * 2), + size_mul(attr->gid_tbl_len, 2)), GFP_KERNEL); if (!gid_attr_group) return -ENOMEM; @@ -1205,8 +1205,8 @@ int ret; p = kvzalloc(struct_size(p, attrs_list, - attr->gid_tbl_len + attr->pkey_tbl_len), - GFP_KERNEL); + size_add(attr->gid_tbl_len, attr->pkey_tbl_len)), + GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); p->ibdev = device; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/core/umem.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/core/umem.c @@ -96,12 +96,6 @@ return page_size; } - /* rdma_for_each_block() has a bug if the page size is smaller than the - * page size used to build the umem. For now prevent smaller page sizes - * from being returned. - */ - pgsz_bitmap &= GENMASK(BITS_PER_LONG - 1, PAGE_SHIFT); - /* The best result is the smallest page size that results in the minimum * number of required pages. Compute the largest page size that could * work based on VA address bits that don't change. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/core/user_mad.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/core/user_mad.c @@ -1378,7 +1378,9 @@ s = rdma_start_port(device); e = rdma_end_port(device); - umad_dev = kzalloc(struct_size(umad_dev, ports, e - s + 1), GFP_KERNEL); + umad_dev = kzalloc(struct_size(umad_dev, ports, + size_add(size_sub(e, s), 1)), + GFP_KERNEL); if (!umad_dev) return -ENOMEM; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/core/verbs.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/core/verbs.c @@ -1885,7 +1885,7 @@ int rc; u32 netdev_speed; struct net_device *netdev; - struct ethtool_link_ksettings lksettings; + struct ethtool_link_ksettings lksettings = {}; if (rdma_port_get_link_layer(dev, port_num) != IB_LINK_LAYER_ETHERNET) return -EINVAL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/hw/hfi1/efivar.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/hfi1/efivar.c @@ -112,7 +112,7 @@ unsigned long *size, void **return_data) { char prefix_name[64]; - char name[64]; + char name[128]; int result; /* create a common prefix */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/hw/hfi1/pcie.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/hfi1/pcie.c @@ -3,6 +3,7 @@ * Copyright(c) 2015 - 2019 Intel Corporation. */ +#include #include #include #include @@ -210,12 +211,6 @@ return speed; } -/* return the PCIe link speed from the given link status */ -static u32 extract_width(u16 linkstat) -{ - return (linkstat & PCI_EXP_LNKSTA_NLW) >> PCI_EXP_LNKSTA_NLW_SHIFT; -} - /* read the link status and set dd->{lbus_width,lbus_speed,lbus_info} */ static void update_lbus_info(struct hfi1_devdata *dd) { @@ -228,7 +223,7 @@ return; } - dd->lbus_width = extract_width(linkstat); + dd->lbus_width = FIELD_GET(PCI_EXP_LNKSTA_NLW, linkstat); dd->lbus_speed = extract_speed(linkstat); snprintf(dd->lbus_info, sizeof(dd->lbus_info), "PCIe,%uMHz,x%u", dd->lbus_speed, dd->lbus_width); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/hw/hns/hns_roce_ah.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/hns/hns_roce_ah.c @@ -33,7 +33,9 @@ #include #include #include +#include "hnae3.h" #include "hns_roce_device.h" +#include "hns_roce_hw_v2.h" static inline u16 get_ah_udp_sport(const struct rdma_ah_attr *ah_attr) { @@ -57,6 +59,7 @@ struct hns_roce_dev *hr_dev = to_hr_dev(ibah->device); struct hns_roce_ah *ah = to_hr_ah(ibah); int ret = 0; + u32 max_sl; if (hr_dev->pci_dev->revision == PCI_REVISION_ID_HIP08 && udata) return -EOPNOTSUPP; @@ -70,9 +73,17 @@ ah->av.hop_limit = grh->hop_limit; ah->av.flowlabel = grh->flow_label; ah->av.udp_sport = get_ah_udp_sport(ah_attr); - ah->av.sl = rdma_ah_get_sl(ah_attr); ah->av.tclass = get_tclass(grh); + ah->av.sl = rdma_ah_get_sl(ah_attr); + max_sl = min_t(u32, MAX_SERVICE_LEVEL, hr_dev->caps.sl_num - 1); + if (unlikely(ah->av.sl > max_sl)) { + ibdev_err_ratelimited(&hr_dev->ib_dev, + "failed to set sl, sl (%u) shouldn't be larger than %u.\n", + ah->av.sl, max_sl); + return -EINVAL; + } + memcpy(ah->av.dgid, grh->dgid.raw, HNS_ROCE_GID_SIZE); memcpy(ah->av.mac, ah_attr->roce.dmac, ETH_ALEN); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/hw/irdma/hw.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/hw.c @@ -322,7 +322,11 @@ break; case IRDMA_AE_QP_SUSPEND_COMPLETE: if (iwqp->iwdev->vsi.tc_change_pending) { - atomic_dec(&iwqp->sc_qp.vsi->qp_suspend_reqs); + if (!atomic_dec_return(&qp->vsi->qp_suspend_reqs)) + wake_up(&iwqp->iwdev->suspend_wq); + } + if (iwqp->suspend_pending) { + iwqp->suspend_pending = false; wake_up(&iwqp->iwdev->suspend_wq); } break; @@ -568,16 +572,13 @@ * Issue destroy cqp request and * free the resources associated with the cqp */ -static void irdma_destroy_cqp(struct irdma_pci_f *rf, bool free_hwcqp) +static void irdma_destroy_cqp(struct irdma_pci_f *rf) { struct irdma_sc_dev *dev = &rf->sc_dev; struct irdma_cqp *cqp = &rf->cqp; int status = 0; - if (rf->cqp_cmpl_wq) - destroy_workqueue(rf->cqp_cmpl_wq); - if (free_hwcqp) - status = irdma_sc_cqp_destroy(dev->cqp); + status = irdma_sc_cqp_destroy(dev->cqp); if (status) ibdev_dbg(to_ibdev(dev), "ERR: Destroy CQP failed %d\n", status); @@ -741,6 +742,9 @@ struct irdma_ccq *ccq = &rf->ccq; int status = 0; + if (rf->cqp_cmpl_wq) + destroy_workqueue(rf->cqp_cmpl_wq); + if (!rf->reset) status = irdma_sc_ccq_destroy(dev->ccq, 0, true); if (status) @@ -921,8 +925,8 @@ cqp->scratch_array = kcalloc(sqsize, sizeof(*cqp->scratch_array), GFP_KERNEL); if (!cqp->scratch_array) { - kfree(cqp->cqp_requests); - return -ENOMEM; + status = -ENOMEM; + goto err_scratch; } dev->cqp = &cqp->sc_cqp; @@ -932,15 +936,14 @@ cqp->sq.va = dma_alloc_coherent(dev->hw->device, cqp->sq.size, &cqp->sq.pa, GFP_KERNEL); if (!cqp->sq.va) { - kfree(cqp->scratch_array); - kfree(cqp->cqp_requests); - return -ENOMEM; + status = -ENOMEM; + goto err_sq; } status = irdma_obj_aligned_mem(rf, &mem, sizeof(struct irdma_cqp_ctx), IRDMA_HOST_CTX_ALIGNMENT_M); if (status) - goto exit; + goto err_ctx; dev->cqp->host_ctx_pa = mem.pa; dev->cqp->host_ctx = mem.va; @@ -966,7 +969,7 @@ status = irdma_sc_cqp_init(dev->cqp, &cqp_init_info); if (status) { ibdev_dbg(to_ibdev(dev), "ERR: cqp init status %d\n", status); - goto exit; + goto err_ctx; } spin_lock_init(&cqp->req_lock); @@ -977,7 +980,7 @@ ibdev_dbg(to_ibdev(dev), "ERR: cqp create failed - status %d maj_err %d min_err %d\n", status, maj_err, min_err); - goto exit; + goto err_ctx; } INIT_LIST_HEAD(&cqp->cqp_avail_reqs); @@ -991,8 +994,16 @@ init_waitqueue_head(&cqp->remove_wq); return 0; -exit: - irdma_destroy_cqp(rf, false); +err_ctx: + dma_free_coherent(dev->hw->device, cqp->sq.size, + cqp->sq.va, cqp->sq.pa); + cqp->sq.va = NULL; +err_sq: + kfree(cqp->scratch_array); + cqp->scratch_array = NULL; +err_scratch: + kfree(cqp->cqp_requests); + cqp->cqp_requests = NULL; return status; } @@ -1166,7 +1177,6 @@ int status; struct irdma_ceq_init_info info = {}; struct irdma_sc_dev *dev = &rf->sc_dev; - u64 scratch; u32 ceq_size; info.ceq_id = ceq_id; @@ -1187,14 +1197,13 @@ iwceq->sc_ceq.ceq_id = ceq_id; info.dev = dev; info.vsi = vsi; - scratch = (uintptr_t)&rf->cqp.sc_cqp; status = irdma_sc_ceq_init(&iwceq->sc_ceq, &info); if (!status) { if (dev->ceq_valid) status = irdma_cqp_ceq_cmd(&rf->sc_dev, &iwceq->sc_ceq, IRDMA_OP_CEQ_CREATE); else - status = irdma_sc_cceq_create(&iwceq->sc_ceq, scratch); + status = irdma_sc_cceq_create(&iwceq->sc_ceq, 0); } if (status) { @@ -1747,7 +1756,7 @@ rf->reset, rf->rdma_ver); fallthrough; case CQP_CREATED: - irdma_destroy_cqp(rf, true); + irdma_destroy_cqp(rf); fallthrough; case INITIAL_STATE: irdma_del_init_mem(rf); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/hw/irdma/main.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/main.c @@ -48,7 +48,7 @@ /* Wait for all qp's to suspend */ wait_event_timeout(iwdev->suspend_wq, !atomic_read(&iwdev->vsi.qp_suspend_reqs), - IRDMA_EVENT_TIMEOUT); + msecs_to_jiffies(IRDMA_EVENT_TIMEOUT_MS)); irdma_ws_reset(&iwdev->vsi); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/hw/irdma/verbs.h +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/irdma/verbs.h @@ -193,6 +193,7 @@ u8 flush_issued : 1; u8 sig_all : 1; u8 pau_mode : 1; + u8 suspend_pending : 1; u8 rsvd : 1; u8 iwarp_state; u16 term_sq_flush_code; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/hw/mlx5/qp.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/hw/mlx5/qp.c @@ -4045,6 +4045,30 @@ return tx_affinity; } +static int __mlx5_ib_qp_set_raw_qp_counter(struct mlx5_ib_qp *qp, u32 set_id, + struct mlx5_core_dev *mdev) +{ + struct mlx5_ib_raw_packet_qp *raw_packet_qp = &qp->raw_packet_qp; + struct mlx5_ib_rq *rq = &raw_packet_qp->rq; + u32 in[MLX5_ST_SZ_DW(modify_rq_in)] = {}; + void *rqc; + + if (!qp->rq.wqe_cnt) + return 0; + + MLX5_SET(modify_rq_in, in, rq_state, rq->state); + MLX5_SET(modify_rq_in, in, uid, to_mpd(qp->ibqp.pd)->uid); + + rqc = MLX5_ADDR_OF(modify_rq_in, in, ctx); + MLX5_SET(rqc, rqc, state, MLX5_RQC_STATE_RDY); + + MLX5_SET64(modify_rq_in, in, modify_bitmask, + MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_RQ_COUNTER_SET_ID); + MLX5_SET(rqc, rqc, counter_set_id, set_id); + + return mlx5_core_modify_rq(mdev, rq->base.mqp.qpn, in); +} + static int __mlx5_ib_qp_set_counter(struct ib_qp *qp, struct rdma_counter *counter) { @@ -4060,6 +4084,9 @@ else set_id = mlx5_ib_get_counters_id(dev, mqp->port - 1); + if (mqp->type == IB_QPT_RAW_PACKET) + return __mlx5_ib_qp_set_raw_qp_counter(mqp, set_id, dev->mdev); + base = &mqp->trans_qp.base; MLX5_SET(rts2rts_qp_in, in, opcode, MLX5_CMD_OP_RTS2RTS_QP); MLX5_SET(rts2rts_qp_in, in, qpn, base->mqp.qpn); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -382,7 +382,7 @@ struct rtrs_clt_path *clt_path; int err; - if (WARN_ON(!req->in_use)) + if (!req->in_use) return; if (WARN_ON(!req->con)) return; @@ -1692,7 +1692,7 @@ clt_path->s.dev_ref++; max_send_wr = min_t(int, wr_limit, /* QD * (REQ + RSP + FR REGS or INVS) + drain */ - clt_path->queue_depth * 3 + 1); + clt_path->queue_depth * 4 + 1); max_recv_wr = min_t(int, wr_limit, clt_path->queue_depth * 3 + 1); max_send_sge = 2; @@ -2343,8 +2343,6 @@ if (err) goto destroy; - rtrs_start_hb(&clt_path->s); - return 0; destroy: @@ -2618,6 +2616,7 @@ goto out; } rtrs_clt_path_up(clt_path); + rtrs_start_hb(&clt_path->s); out: mutex_unlock(&clt_path->init_mutex); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/infiniband/ulp/rtrs/rtrs-srv.c +++ linux-aws-6.5-6.5.0/drivers/infiniband/ulp/rtrs/rtrs-srv.c @@ -63,8 +63,9 @@ { enum rtrs_srv_state old_state; bool changed = false; + unsigned long flags; - spin_lock_irq(&srv_path->state_lock); + spin_lock_irqsave(&srv_path->state_lock, flags); old_state = srv_path->state; switch (new_state) { case RTRS_SRV_CONNECTED: @@ -85,7 +86,7 @@ } if (changed) srv_path->state = new_state; - spin_unlock_irq(&srv_path->state_lock); + spin_unlock_irqrestore(&srv_path->state_lock, flags); return changed; } @@ -548,7 +549,10 @@ struct rtrs_srv_mr *srv_mr; srv_mr = &srv_path->mrs[i]; - rtrs_iu_free(srv_mr->iu, srv_path->s.dev->ib_dev, 1); + + if (always_invalidate) + rtrs_iu_free(srv_mr->iu, srv_path->s.dev->ib_dev, 1); + ib_dereg_mr(srv_mr->mr); ib_dma_unmap_sg(srv_path->s.dev->ib_dev, srv_mr->sgt.sgl, srv_mr->sgt.nents, DMA_BIDIRECTIONAL); @@ -707,20 +711,23 @@ WARN_ON(wc->opcode != IB_WC_SEND); } -static void rtrs_srv_path_up(struct rtrs_srv_path *srv_path) +static int rtrs_srv_path_up(struct rtrs_srv_path *srv_path) { struct rtrs_srv_sess *srv = srv_path->srv; struct rtrs_srv_ctx *ctx = srv->ctx; - int up; + int up, ret = 0; mutex_lock(&srv->paths_ev_mutex); up = ++srv->paths_up; if (up == 1) - ctx->ops.link_ev(srv, RTRS_SRV_LINK_EV_CONNECTED, NULL); + ret = ctx->ops.link_ev(srv, RTRS_SRV_LINK_EV_CONNECTED, NULL); mutex_unlock(&srv->paths_ev_mutex); /* Mark session as established */ - srv_path->established = true; + if (!ret) + srv_path->established = true; + + return ret; } static void rtrs_srv_path_down(struct rtrs_srv_path *srv_path) @@ -849,7 +856,12 @@ goto iu_free; kobject_get(&srv_path->kobj); get_device(&srv_path->srv->dev); - rtrs_srv_change_state(srv_path, RTRS_SRV_CONNECTED); + err = rtrs_srv_change_state(srv_path, RTRS_SRV_CONNECTED); + if (!err) { + rtrs_err(s, "rtrs_srv_change_state(), err: %d\n", err); + goto iu_free; + } + rtrs_srv_start_hb(srv_path); /* @@ -858,7 +870,11 @@ * all connections are successfully established. Thus, simply notify * listener with a proper event if we are the first path. */ - rtrs_srv_path_up(srv_path); + err = rtrs_srv_path_up(srv_path); + if (err) { + rtrs_err(s, "rtrs_srv_path_up(), err: %d\n", err); + goto iu_free; + } ib_dma_sync_single_for_device(srv_path->s.dev->ib_dev, tx_iu->dma_addr, @@ -1514,7 +1530,6 @@ srv_path = container_of(work, typeof(*srv_path), close_work); - rtrs_srv_destroy_path_files(srv_path); rtrs_srv_stop_hb(srv_path); for (i = 0; i < srv_path->s.con_num; i++) { @@ -1534,6 +1549,8 @@ /* Wait for all completion */ wait_for_completion(&srv_path->complete_done); + rtrs_srv_destroy_path_files(srv_path); + /* Notify upper layer if we are the last path */ rtrs_srv_path_down(srv_path); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/input/rmi4/rmi_bus.c +++ linux-aws-6.5-6.5.0/drivers/input/rmi4/rmi_bus.c @@ -277,11 +277,11 @@ device_del(&fn->dev); of_node_put(fn->dev.of_node); - put_device(&fn->dev); for (i = 0; i < fn->num_of_irqs; i++) irq_dispose_mapping(fn->irq[i]); + put_device(&fn->dev); } /** only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/input/rmi4/rmi_smbus.c +++ linux-aws-6.5-6.5.0/drivers/input/rmi4/rmi_smbus.c @@ -235,12 +235,29 @@ static int rmi_smb_enable_smbus_mode(struct rmi_smb_xport *rmi_smb) { - int retval; + struct i2c_client *client = rmi_smb->client; + int smbus_version; + + /* + * psmouse driver resets the controller, we only need to wait + * to give the firmware chance to fully reinitialize. + */ + if (rmi_smb->xport.pdata.reset_delay_ms) + msleep(rmi_smb->xport.pdata.reset_delay_ms); /* we need to get the smbus version to activate the touchpad */ - retval = rmi_smb_get_version(rmi_smb); - if (retval < 0) - return retval; + smbus_version = rmi_smb_get_version(rmi_smb); + if (smbus_version < 0) + return smbus_version; + + rmi_dbg(RMI_DEBUG_XPORT, &client->dev, "Smbus version is %d", + smbus_version); + + if (smbus_version != 2 && smbus_version != 3) { + dev_err(&client->dev, "Unrecognized SMB version %d\n", + smbus_version); + return -ENODEV; + } return 0; } @@ -253,11 +270,10 @@ rmi_smb_clear_state(rmi_smb); /* - * we do not call the actual reset command, it has to be handled in - * PS/2 or there will be races between PS/2 and SMBus. - * PS/2 should ensure that a psmouse_reset is called before - * intializing the device and after it has been removed to be in a known - * state. + * We do not call the actual reset command, it has to be handled in + * PS/2 or there will be races between PS/2 and SMBus. PS/2 should + * ensure that a psmouse_reset is called before initializing the + * device and after it has been removed to be in a known state. */ return rmi_smb_enable_smbus_mode(rmi_smb); } @@ -272,7 +288,6 @@ { struct rmi_device_platform_data *pdata = dev_get_platdata(&client->dev); struct rmi_smb_xport *rmi_smb; - int smbus_version; int error; if (!pdata) { @@ -311,18 +326,9 @@ rmi_smb->xport.proto_name = "smb"; rmi_smb->xport.ops = &rmi_smb_ops; - smbus_version = rmi_smb_get_version(rmi_smb); - if (smbus_version < 0) - return smbus_version; - - rmi_dbg(RMI_DEBUG_XPORT, &client->dev, "Smbus version is %d", - smbus_version); - - if (smbus_version != 2 && smbus_version != 3) { - dev_err(&client->dev, "Unrecognized SMB version %d\n", - smbus_version); - return -ENODEV; - } + error = rmi_smb_enable_smbus_mode(rmi_smb); + if (error) + return error; i2c_set_clientdata(client, rmi_smb); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/icc-rpm.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/icc-rpm.c @@ -491,7 +491,7 @@ ret = devm_clk_bulk_get(dev, qp->num_intf_clks, qp->intf_clks); if (ret) - return ret; + goto err_disable_unprepare_clk; provider = &qp->provider; provider->dev = dev; @@ -506,13 +506,15 @@ /* If this fails, bus accesses will crash the platform! */ ret = clk_bulk_prepare_enable(qp->num_intf_clks, qp->intf_clks); if (ret) - return ret; + goto err_disable_unprepare_clk; for (i = 0; i < num_nodes; i++) { size_t j; node = icc_node_create(qnodes[i]->id); if (IS_ERR(node)) { + clk_bulk_disable_unprepare(qp->num_intf_clks, + qp->intf_clks); ret = PTR_ERR(node); goto err_remove_nodes; } @@ -528,8 +530,11 @@ if (qnodes[i]->qos.ap_owned && qnodes[i]->qos.qos_mode != NOC_QOS_MODE_INVALID) { ret = qcom_icc_qos_set(node); - if (ret) - return ret; + if (ret) { + clk_bulk_disable_unprepare(qp->num_intf_clks, + qp->intf_clks); + goto err_remove_nodes; + } } data->nodes[i] = node; @@ -557,6 +562,7 @@ icc_provider_deregister(provider); err_remove_nodes: icc_nodes_remove(provider); +err_disable_unprepare_clk: clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/qdu1000.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/qdu1000.c @@ -768,6 +768,7 @@ static struct qcom_icc_bcm bcm_acv = { .name = "ACV", + .enable_mask = BIT(3), .num_nodes = 1, .nodes = { &ebi }, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/sc7180.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/sc7180.c @@ -153,30 +153,238 @@ DEFINE_QNODE(xs_qdss_stm, SC7180_SLAVE_QDSS_STM, 1, 4); DEFINE_QNODE(xs_sys_tcu_cfg, SC7180_SLAVE_TCU, 1, 8); -DEFINE_QBCM(bcm_acv, "ACV", false, &ebi); -DEFINE_QBCM(bcm_mc0, "MC0", true, &ebi); -DEFINE_QBCM(bcm_sh0, "SH0", true, &qns_llcc); -DEFINE_QBCM(bcm_mm0, "MM0", false, &qns_mem_noc_hf); -DEFINE_QBCM(bcm_ce0, "CE0", false, &qxm_crypto); -DEFINE_QBCM(bcm_cn0, "CN0", true, &qnm_snoc, &xm_qdss_dap, &qhs_a1_noc_cfg, &qhs_a2_noc_cfg, &qhs_ahb2phy0, &qhs_aop, &qhs_aoss, &qhs_boot_rom, &qhs_camera_cfg, &qhs_camera_nrt_throttle_cfg, &qhs_camera_rt_throttle_cfg, &qhs_clk_ctl, &qhs_cpr_cx, &qhs_cpr_mx, &qhs_crypto0_cfg, &qhs_dcc_cfg, &qhs_ddrss_cfg, &qhs_display_cfg, &qhs_display_rt_throttle_cfg, &qhs_display_throttle_cfg, &qhs_glm, &qhs_gpuss_cfg, &qhs_imem_cfg, &qhs_ipa, &qhs_mnoc_cfg, &qhs_mss_cfg, &qhs_npu_cfg, &qhs_npu_dma_throttle_cfg, &qhs_npu_dsp_throttle_cfg, &qhs_pimem_cfg, &qhs_prng, &qhs_qdss_cfg, &qhs_qm_cfg, &qhs_qm_mpu_cfg, &qhs_qup0, &qhs_qup1, &qhs_security, &qhs_snoc_cfg, &qhs_tcsr, &qhs_tlmm_1, &qhs_tlmm_2, &qhs_tlmm_3, &qhs_ufs_mem_cfg, &qhs_usb3, &qhs_venus_cfg, &qhs_venus_throttle_cfg, &qhs_vsense_ctrl_cfg, &srvc_cnoc); -DEFINE_QBCM(bcm_mm1, "MM1", false, &qxm_camnoc_hf0_uncomp, &qxm_camnoc_hf1_uncomp, &qxm_camnoc_sf_uncomp, &qhm_mnoc_cfg, &qxm_mdp0, &qxm_rot, &qxm_venus0, &qxm_venus_arm9); -DEFINE_QBCM(bcm_sh2, "SH2", false, &acm_sys_tcu); -DEFINE_QBCM(bcm_mm2, "MM2", false, &qns_mem_noc_sf); -DEFINE_QBCM(bcm_qup0, "QUP0", false, &qup_core_master_1, &qup_core_master_2); -DEFINE_QBCM(bcm_sh3, "SH3", false, &qnm_cmpnoc); -DEFINE_QBCM(bcm_sh4, "SH4", false, &acm_apps0); -DEFINE_QBCM(bcm_sn0, "SN0", true, &qns_gemnoc_sf); -DEFINE_QBCM(bcm_co0, "CO0", false, &qns_cdsp_gemnoc); -DEFINE_QBCM(bcm_sn1, "SN1", false, &qxs_imem); -DEFINE_QBCM(bcm_cn1, "CN1", false, &qhm_qspi, &xm_sdc2, &xm_emmc, &qhs_ahb2phy2, &qhs_emmc_cfg, &qhs_pdm, &qhs_qspi, &qhs_sdc2); -DEFINE_QBCM(bcm_sn2, "SN2", false, &qxm_pimem, &qns_gemnoc_gc); -DEFINE_QBCM(bcm_co2, "CO2", false, &qnm_npu); -DEFINE_QBCM(bcm_sn3, "SN3", false, &qxs_pimem); -DEFINE_QBCM(bcm_co3, "CO3", false, &qxm_npu_dsp); -DEFINE_QBCM(bcm_sn4, "SN4", false, &xs_qdss_stm); -DEFINE_QBCM(bcm_sn7, "SN7", false, &qnm_aggre1_noc); -DEFINE_QBCM(bcm_sn9, "SN9", false, &qnm_aggre2_noc); -DEFINE_QBCM(bcm_sn12, "SN12", false, &qnm_gemnoc); +static struct qcom_icc_bcm bcm_acv = { + .name = "ACV", + .enable_mask = BIT(3), + .keepalive = false, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_mc0 = { + .name = "MC0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_sh0 = { + .name = "SH0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_llcc }, +}; + +static struct qcom_icc_bcm bcm_mm0 = { + .name = "MM0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_mem_noc_hf }, +}; + +static struct qcom_icc_bcm bcm_ce0 = { + .name = "CE0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_crypto }, +}; + +static struct qcom_icc_bcm bcm_cn0 = { + .name = "CN0", + .keepalive = true, + .num_nodes = 48, + .nodes = { &qnm_snoc, + &xm_qdss_dap, + &qhs_a1_noc_cfg, + &qhs_a2_noc_cfg, + &qhs_ahb2phy0, + &qhs_aop, + &qhs_aoss, + &qhs_boot_rom, + &qhs_camera_cfg, + &qhs_camera_nrt_throttle_cfg, + &qhs_camera_rt_throttle_cfg, + &qhs_clk_ctl, + &qhs_cpr_cx, + &qhs_cpr_mx, + &qhs_crypto0_cfg, + &qhs_dcc_cfg, + &qhs_ddrss_cfg, + &qhs_display_cfg, + &qhs_display_rt_throttle_cfg, + &qhs_display_throttle_cfg, + &qhs_glm, + &qhs_gpuss_cfg, + &qhs_imem_cfg, + &qhs_ipa, + &qhs_mnoc_cfg, + &qhs_mss_cfg, + &qhs_npu_cfg, + &qhs_npu_dma_throttle_cfg, + &qhs_npu_dsp_throttle_cfg, + &qhs_pimem_cfg, + &qhs_prng, + &qhs_qdss_cfg, + &qhs_qm_cfg, + &qhs_qm_mpu_cfg, + &qhs_qup0, + &qhs_qup1, + &qhs_security, + &qhs_snoc_cfg, + &qhs_tcsr, + &qhs_tlmm_1, + &qhs_tlmm_2, + &qhs_tlmm_3, + &qhs_ufs_mem_cfg, + &qhs_usb3, + &qhs_venus_cfg, + &qhs_venus_throttle_cfg, + &qhs_vsense_ctrl_cfg, + &srvc_cnoc + }, +}; + +static struct qcom_icc_bcm bcm_mm1 = { + .name = "MM1", + .keepalive = false, + .num_nodes = 8, + .nodes = { &qxm_camnoc_hf0_uncomp, + &qxm_camnoc_hf1_uncomp, + &qxm_camnoc_sf_uncomp, + &qhm_mnoc_cfg, + &qxm_mdp0, + &qxm_rot, + &qxm_venus0, + &qxm_venus_arm9 + }, +}; + +static struct qcom_icc_bcm bcm_sh2 = { + .name = "SH2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &acm_sys_tcu }, +}; + +static struct qcom_icc_bcm bcm_mm2 = { + .name = "MM2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_mem_noc_sf }, +}; + +static struct qcom_icc_bcm bcm_qup0 = { + .name = "QUP0", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qup_core_master_1, &qup_core_master_2 }, +}; + +static struct qcom_icc_bcm bcm_sh3 = { + .name = "SH3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_cmpnoc }, +}; + +static struct qcom_icc_bcm bcm_sh4 = { + .name = "SH4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &acm_apps0 }, +}; + +static struct qcom_icc_bcm bcm_sn0 = { + .name = "SN0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_gemnoc_sf }, +}; + +static struct qcom_icc_bcm bcm_co0 = { + .name = "CO0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_cdsp_gemnoc }, +}; + +static struct qcom_icc_bcm bcm_sn1 = { + .name = "SN1", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_imem }, +}; + +static struct qcom_icc_bcm bcm_cn1 = { + .name = "CN1", + .keepalive = false, + .num_nodes = 8, + .nodes = { &qhm_qspi, + &xm_sdc2, + &xm_emmc, + &qhs_ahb2phy2, + &qhs_emmc_cfg, + &qhs_pdm, + &qhs_qspi, + &qhs_sdc2 + }, +}; + +static struct qcom_icc_bcm bcm_sn2 = { + .name = "SN2", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qxm_pimem, &qns_gemnoc_gc }, +}; + +static struct qcom_icc_bcm bcm_co2 = { + .name = "CO2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_npu }, +}; + +static struct qcom_icc_bcm bcm_sn3 = { + .name = "SN3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_pimem }, +}; + +static struct qcom_icc_bcm bcm_co3 = { + .name = "CO3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_npu_dsp }, +}; + +static struct qcom_icc_bcm bcm_sn4 = { + .name = "SN4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &xs_qdss_stm }, +}; + +static struct qcom_icc_bcm bcm_sn7 = { + .name = "SN7", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_aggre1_noc }, +}; + +static struct qcom_icc_bcm bcm_sn9 = { + .name = "SN9", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_aggre2_noc }, +}; + +static struct qcom_icc_bcm bcm_sn12 = { + .name = "SN12", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_gemnoc }, +}; static struct qcom_icc_bcm * const aggre1_noc_bcms[] = { &bcm_cn1, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/sc7280.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/sc7280.c @@ -1284,6 +1284,7 @@ static struct qcom_icc_bcm bcm_acv = { .name = "ACV", + .enable_mask = BIT(3), .num_nodes = 1, .nodes = { &ebi }, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/sc8180x.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/sc8180x.c @@ -1344,6 +1344,7 @@ static struct qcom_icc_bcm bcm_acv = { .name = "ACV", + .enable_mask = BIT(3), .num_nodes = 1, .nodes = { &slv_ebi } }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/sc8280xp.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/sc8280xp.c @@ -1711,6 +1711,7 @@ static struct qcom_icc_bcm bcm_acv = { .name = "ACV", + .enable_mask = BIT(3), .num_nodes = 1, .nodes = { &ebi }, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/sdm670.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/sdm670.c @@ -131,30 +131,222 @@ DEFINE_QNODE(xs_qdss_stm, SDM670_SLAVE_QDSS_STM, 1, 4); DEFINE_QNODE(xs_sys_tcu_cfg, SDM670_SLAVE_TCU, 1, 8); -DEFINE_QBCM(bcm_acv, "ACV", false, &ebi); -DEFINE_QBCM(bcm_mc0, "MC0", true, &ebi); -DEFINE_QBCM(bcm_sh0, "SH0", true, &qns_llcc); -DEFINE_QBCM(bcm_mm0, "MM0", true, &qns_mem_noc_hf); -DEFINE_QBCM(bcm_sh1, "SH1", false, &qns_apps_io); -DEFINE_QBCM(bcm_mm1, "MM1", true, &qxm_camnoc_hf0_uncomp, &qxm_camnoc_hf1_uncomp, &qxm_camnoc_sf_uncomp, &qxm_camnoc_hf0, &qxm_camnoc_hf1, &qxm_mdp0, &qxm_mdp1); -DEFINE_QBCM(bcm_sh2, "SH2", false, &qns_memnoc_snoc); -DEFINE_QBCM(bcm_mm2, "MM2", false, &qns2_mem_noc); -DEFINE_QBCM(bcm_sh3, "SH3", false, &acm_tcu); -DEFINE_QBCM(bcm_mm3, "MM3", false, &qxm_camnoc_sf, &qxm_rot, &qxm_venus0, &qxm_venus1, &qxm_venus_arm9); -DEFINE_QBCM(bcm_sh5, "SH5", false, &qnm_apps); -DEFINE_QBCM(bcm_sn0, "SN0", true, &qns_memnoc_sf); -DEFINE_QBCM(bcm_ce0, "CE0", false, &qxm_crypto); -DEFINE_QBCM(bcm_cn0, "CN0", true, &qhm_spdm, &qnm_snoc, &qhs_a1_noc_cfg, &qhs_a2_noc_cfg, &qhs_aop, &qhs_aoss, &qhs_camera_cfg, &qhs_clk_ctl, &qhs_compute_dsp_cfg, &qhs_cpr_cx, &qhs_crypto0_cfg, &qhs_dcc_cfg, &qhs_ddrss_cfg, &qhs_display_cfg, &qhs_emmc_cfg, &qhs_glm, &qhs_gpuss_cfg, &qhs_imem_cfg, &qhs_ipa, &qhs_mnoc_cfg, &qhs_pdm, &qhs_phy_refgen_south, &qhs_pimem_cfg, &qhs_prng, &qhs_qdss_cfg, &qhs_qupv3_north, &qhs_qupv3_south, &qhs_sdc2, &qhs_sdc4, &qhs_snoc_cfg, &qhs_spdm, &qhs_tcsr, &qhs_tlmm_north, &qhs_tlmm_south, &qhs_tsif, &qhs_ufs_mem_cfg, &qhs_usb3_0, &qhs_venus_cfg, &qhs_vsense_ctrl_cfg, &qns_cnoc_a2noc, &srvc_cnoc); -DEFINE_QBCM(bcm_qup0, "QUP0", false, &qhm_qup1, &qhm_qup2); -DEFINE_QBCM(bcm_sn1, "SN1", false, &qxs_imem); -DEFINE_QBCM(bcm_sn2, "SN2", false, &qns_memnoc_gc); -DEFINE_QBCM(bcm_sn3, "SN3", false, &qns_cnoc); -DEFINE_QBCM(bcm_sn4, "SN4", false, &qxm_pimem, &qxs_pimem); -DEFINE_QBCM(bcm_sn5, "SN5", false, &xs_qdss_stm); -DEFINE_QBCM(bcm_sn8, "SN8", false, &qnm_aggre1_noc, &srvc_aggre1_noc); -DEFINE_QBCM(bcm_sn10, "SN10", false, &qnm_aggre2_noc, &srvc_aggre2_noc); -DEFINE_QBCM(bcm_sn11, "SN11", false, &qnm_gladiator_sodv, &xm_gic); -DEFINE_QBCM(bcm_sn13, "SN13", false, &qnm_memnoc); +static struct qcom_icc_bcm bcm_acv = { + .name = "ACV", + .enable_mask = BIT(3), + .keepalive = false, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_mc0 = { + .name = "MC0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_sh0 = { + .name = "SH0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_llcc }, +}; + +static struct qcom_icc_bcm bcm_mm0 = { + .name = "MM0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_mem_noc_hf }, +}; + +static struct qcom_icc_bcm bcm_sh1 = { + .name = "SH1", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_apps_io }, +}; + +static struct qcom_icc_bcm bcm_mm1 = { + .name = "MM1", + .keepalive = true, + .num_nodes = 7, + .nodes = { &qxm_camnoc_hf0_uncomp, + &qxm_camnoc_hf1_uncomp, + &qxm_camnoc_sf_uncomp, + &qxm_camnoc_hf0, + &qxm_camnoc_hf1, + &qxm_mdp0, + &qxm_mdp1 + }, +}; + +static struct qcom_icc_bcm bcm_sh2 = { + .name = "SH2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_memnoc_snoc }, +}; + +static struct qcom_icc_bcm bcm_mm2 = { + .name = "MM2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns2_mem_noc }, +}; + +static struct qcom_icc_bcm bcm_sh3 = { + .name = "SH3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &acm_tcu }, +}; + +static struct qcom_icc_bcm bcm_mm3 = { + .name = "MM3", + .keepalive = false, + .num_nodes = 5, + .nodes = { &qxm_camnoc_sf, &qxm_rot, &qxm_venus0, &qxm_venus1, &qxm_venus_arm9 }, +}; + +static struct qcom_icc_bcm bcm_sh5 = { + .name = "SH5", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_apps }, +}; + +static struct qcom_icc_bcm bcm_sn0 = { + .name = "SN0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_memnoc_sf }, +}; + +static struct qcom_icc_bcm bcm_ce0 = { + .name = "CE0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_crypto }, +}; + +static struct qcom_icc_bcm bcm_cn0 = { + .name = "CN0", + .keepalive = true, + .num_nodes = 41, + .nodes = { &qhm_spdm, + &qnm_snoc, + &qhs_a1_noc_cfg, + &qhs_a2_noc_cfg, + &qhs_aop, + &qhs_aoss, + &qhs_camera_cfg, + &qhs_clk_ctl, + &qhs_compute_dsp_cfg, + &qhs_cpr_cx, + &qhs_crypto0_cfg, + &qhs_dcc_cfg, + &qhs_ddrss_cfg, + &qhs_display_cfg, + &qhs_emmc_cfg, + &qhs_glm, + &qhs_gpuss_cfg, + &qhs_imem_cfg, + &qhs_ipa, + &qhs_mnoc_cfg, + &qhs_pdm, + &qhs_phy_refgen_south, + &qhs_pimem_cfg, + &qhs_prng, + &qhs_qdss_cfg, + &qhs_qupv3_north, + &qhs_qupv3_south, + &qhs_sdc2, + &qhs_sdc4, + &qhs_snoc_cfg, + &qhs_spdm, + &qhs_tcsr, + &qhs_tlmm_north, + &qhs_tlmm_south, + &qhs_tsif, + &qhs_ufs_mem_cfg, + &qhs_usb3_0, + &qhs_venus_cfg, + &qhs_vsense_ctrl_cfg, + &qns_cnoc_a2noc, + &srvc_cnoc + }, +}; + +static struct qcom_icc_bcm bcm_qup0 = { + .name = "QUP0", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qhm_qup1, &qhm_qup2 }, +}; + +static struct qcom_icc_bcm bcm_sn1 = { + .name = "SN1", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_imem }, +}; + +static struct qcom_icc_bcm bcm_sn2 = { + .name = "SN2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_memnoc_gc }, +}; + +static struct qcom_icc_bcm bcm_sn3 = { + .name = "SN3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_cnoc }, +}; + +static struct qcom_icc_bcm bcm_sn4 = { + .name = "SN4", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qxm_pimem, &qxs_pimem }, +}; + +static struct qcom_icc_bcm bcm_sn5 = { + .name = "SN5", + .keepalive = false, + .num_nodes = 1, + .nodes = { &xs_qdss_stm }, +}; + +static struct qcom_icc_bcm bcm_sn8 = { + .name = "SN8", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qnm_aggre1_noc, &srvc_aggre1_noc }, +}; + +static struct qcom_icc_bcm bcm_sn10 = { + .name = "SN10", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qnm_aggre2_noc, &srvc_aggre2_noc }, +}; + +static struct qcom_icc_bcm bcm_sn11 = { + .name = "SN11", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qnm_gladiator_sodv, &xm_gic }, +}; + +static struct qcom_icc_bcm bcm_sn13 = { + .name = "SN13", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_memnoc }, +}; static struct qcom_icc_bcm * const aggre1_noc_bcms[] = { &bcm_qup0, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/sdm845.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/sdm845.c @@ -146,34 +146,256 @@ DEFINE_QNODE(xs_qdss_stm, SDM845_SLAVE_QDSS_STM, 1, 4); DEFINE_QNODE(xs_sys_tcu_cfg, SDM845_SLAVE_TCU, 1, 8); -DEFINE_QBCM(bcm_acv, "ACV", false, &ebi); -DEFINE_QBCM(bcm_mc0, "MC0", true, &ebi); -DEFINE_QBCM(bcm_sh0, "SH0", true, &qns_llcc); -DEFINE_QBCM(bcm_mm0, "MM0", false, &qns_mem_noc_hf); -DEFINE_QBCM(bcm_sh1, "SH1", false, &qns_apps_io); -DEFINE_QBCM(bcm_mm1, "MM1", true, &qxm_camnoc_hf0_uncomp, &qxm_camnoc_hf1_uncomp, &qxm_camnoc_sf_uncomp, &qxm_camnoc_hf0, &qxm_camnoc_hf1, &qxm_mdp0, &qxm_mdp1); -DEFINE_QBCM(bcm_sh2, "SH2", false, &qns_memnoc_snoc); -DEFINE_QBCM(bcm_mm2, "MM2", false, &qns2_mem_noc); -DEFINE_QBCM(bcm_sh3, "SH3", false, &acm_tcu); -DEFINE_QBCM(bcm_mm3, "MM3", false, &qxm_camnoc_sf, &qxm_rot, &qxm_venus0, &qxm_venus1, &qxm_venus_arm9); -DEFINE_QBCM(bcm_sh5, "SH5", false, &qnm_apps); -DEFINE_QBCM(bcm_sn0, "SN0", true, &qns_memnoc_sf); -DEFINE_QBCM(bcm_ce0, "CE0", false, &qxm_crypto); -DEFINE_QBCM(bcm_cn0, "CN0", false, &qhm_spdm, &qhm_tic, &qnm_snoc, &xm_qdss_dap, &qhs_a1_noc_cfg, &qhs_a2_noc_cfg, &qhs_aop, &qhs_aoss, &qhs_camera_cfg, &qhs_clk_ctl, &qhs_compute_dsp_cfg, &qhs_cpr_cx, &qhs_crypto0_cfg, &qhs_dcc_cfg, &qhs_ddrss_cfg, &qhs_display_cfg, &qhs_glm, &qhs_gpuss_cfg, &qhs_imem_cfg, &qhs_ipa, &qhs_mnoc_cfg, &qhs_pcie0_cfg, &qhs_pcie_gen3_cfg, &qhs_pdm, &qhs_phy_refgen_south, &qhs_pimem_cfg, &qhs_prng, &qhs_qdss_cfg, &qhs_qupv3_north, &qhs_qupv3_south, &qhs_sdc2, &qhs_sdc4, &qhs_snoc_cfg, &qhs_spdm, &qhs_spss_cfg, &qhs_tcsr, &qhs_tlmm_north, &qhs_tlmm_south, &qhs_tsif, &qhs_ufs_card_cfg, &qhs_ufs_mem_cfg, &qhs_usb3_0, &qhs_usb3_1, &qhs_venus_cfg, &qhs_vsense_ctrl_cfg, &qns_cnoc_a2noc, &srvc_cnoc); -DEFINE_QBCM(bcm_qup0, "QUP0", false, &qhm_qup1, &qhm_qup2); -DEFINE_QBCM(bcm_sn1, "SN1", false, &qxs_imem); -DEFINE_QBCM(bcm_sn2, "SN2", false, &qns_memnoc_gc); -DEFINE_QBCM(bcm_sn3, "SN3", false, &qns_cnoc); -DEFINE_QBCM(bcm_sn4, "SN4", false, &qxm_pimem); -DEFINE_QBCM(bcm_sn5, "SN5", false, &xs_qdss_stm); -DEFINE_QBCM(bcm_sn6, "SN6", false, &qhs_apss, &srvc_snoc, &xs_sys_tcu_cfg); -DEFINE_QBCM(bcm_sn7, "SN7", false, &qxs_pcie); -DEFINE_QBCM(bcm_sn8, "SN8", false, &qxs_pcie_gen3); -DEFINE_QBCM(bcm_sn9, "SN9", false, &srvc_aggre1_noc, &qnm_aggre1_noc); -DEFINE_QBCM(bcm_sn11, "SN11", false, &srvc_aggre2_noc, &qnm_aggre2_noc); -DEFINE_QBCM(bcm_sn12, "SN12", false, &qnm_gladiator_sodv, &xm_gic); -DEFINE_QBCM(bcm_sn14, "SN14", false, &qnm_pcie_anoc); -DEFINE_QBCM(bcm_sn15, "SN15", false, &qnm_memnoc); +static struct qcom_icc_bcm bcm_acv = { + .name = "ACV", + .enable_mask = BIT(3), + .keepalive = false, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_mc0 = { + .name = "MC0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_sh0 = { + .name = "SH0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_llcc }, +}; + +static struct qcom_icc_bcm bcm_mm0 = { + .name = "MM0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_mem_noc_hf }, +}; + +static struct qcom_icc_bcm bcm_sh1 = { + .name = "SH1", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_apps_io }, +}; + +static struct qcom_icc_bcm bcm_mm1 = { + .name = "MM1", + .keepalive = true, + .num_nodes = 7, + .nodes = { &qxm_camnoc_hf0_uncomp, + &qxm_camnoc_hf1_uncomp, + &qxm_camnoc_sf_uncomp, + &qxm_camnoc_hf0, + &qxm_camnoc_hf1, + &qxm_mdp0, + &qxm_mdp1 + }, +}; + +static struct qcom_icc_bcm bcm_sh2 = { + .name = "SH2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_memnoc_snoc }, +}; + +static struct qcom_icc_bcm bcm_mm2 = { + .name = "MM2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns2_mem_noc }, +}; + +static struct qcom_icc_bcm bcm_sh3 = { + .name = "SH3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &acm_tcu }, +}; + +static struct qcom_icc_bcm bcm_mm3 = { + .name = "MM3", + .keepalive = false, + .num_nodes = 5, + .nodes = { &qxm_camnoc_sf, &qxm_rot, &qxm_venus0, &qxm_venus1, &qxm_venus_arm9 }, +}; + +static struct qcom_icc_bcm bcm_sh5 = { + .name = "SH5", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_apps }, +}; + +static struct qcom_icc_bcm bcm_sn0 = { + .name = "SN0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_memnoc_sf }, +}; + +static struct qcom_icc_bcm bcm_ce0 = { + .name = "CE0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_crypto }, +}; + +static struct qcom_icc_bcm bcm_cn0 = { + .name = "CN0", + .keepalive = false, + .num_nodes = 47, + .nodes = { &qhm_spdm, + &qhm_tic, + &qnm_snoc, + &xm_qdss_dap, + &qhs_a1_noc_cfg, + &qhs_a2_noc_cfg, + &qhs_aop, + &qhs_aoss, + &qhs_camera_cfg, + &qhs_clk_ctl, + &qhs_compute_dsp_cfg, + &qhs_cpr_cx, + &qhs_crypto0_cfg, + &qhs_dcc_cfg, + &qhs_ddrss_cfg, + &qhs_display_cfg, + &qhs_glm, + &qhs_gpuss_cfg, + &qhs_imem_cfg, + &qhs_ipa, + &qhs_mnoc_cfg, + &qhs_pcie0_cfg, + &qhs_pcie_gen3_cfg, + &qhs_pdm, + &qhs_phy_refgen_south, + &qhs_pimem_cfg, + &qhs_prng, + &qhs_qdss_cfg, + &qhs_qupv3_north, + &qhs_qupv3_south, + &qhs_sdc2, + &qhs_sdc4, + &qhs_snoc_cfg, + &qhs_spdm, + &qhs_spss_cfg, + &qhs_tcsr, + &qhs_tlmm_north, + &qhs_tlmm_south, + &qhs_tsif, + &qhs_ufs_card_cfg, + &qhs_ufs_mem_cfg, + &qhs_usb3_0, + &qhs_usb3_1, + &qhs_venus_cfg, + &qhs_vsense_ctrl_cfg, + &qns_cnoc_a2noc, + &srvc_cnoc + }, +}; + +static struct qcom_icc_bcm bcm_qup0 = { + .name = "QUP0", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qhm_qup1, &qhm_qup2 }, +}; + +static struct qcom_icc_bcm bcm_sn1 = { + .name = "SN1", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_imem }, +}; + +static struct qcom_icc_bcm bcm_sn2 = { + .name = "SN2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_memnoc_gc }, +}; + +static struct qcom_icc_bcm bcm_sn3 = { + .name = "SN3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_cnoc }, +}; + +static struct qcom_icc_bcm bcm_sn4 = { + .name = "SN4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_pimem }, +}; + +static struct qcom_icc_bcm bcm_sn5 = { + .name = "SN5", + .keepalive = false, + .num_nodes = 1, + .nodes = { &xs_qdss_stm }, +}; + +static struct qcom_icc_bcm bcm_sn6 = { + .name = "SN6", + .keepalive = false, + .num_nodes = 3, + .nodes = { &qhs_apss, &srvc_snoc, &xs_sys_tcu_cfg }, +}; + +static struct qcom_icc_bcm bcm_sn7 = { + .name = "SN7", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_pcie }, +}; + +static struct qcom_icc_bcm bcm_sn8 = { + .name = "SN8", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_pcie_gen3 }, +}; + +static struct qcom_icc_bcm bcm_sn9 = { + .name = "SN9", + .keepalive = false, + .num_nodes = 2, + .nodes = { &srvc_aggre1_noc, &qnm_aggre1_noc }, +}; + +static struct qcom_icc_bcm bcm_sn11 = { + .name = "SN11", + .keepalive = false, + .num_nodes = 2, + .nodes = { &srvc_aggre2_noc, &qnm_aggre2_noc }, +}; + +static struct qcom_icc_bcm bcm_sn12 = { + .name = "SN12", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qnm_gladiator_sodv, &xm_gic }, +}; + +static struct qcom_icc_bcm bcm_sn14 = { + .name = "SN14", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_pcie_anoc }, +}; + +static struct qcom_icc_bcm bcm_sn15 = { + .name = "SN15", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_memnoc }, +}; static struct qcom_icc_bcm * const aggre1_noc_bcms[] = { &bcm_sn9, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/sm6350.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/sm6350.c @@ -142,31 +142,233 @@ DEFINE_QNODE(xs_qdss_stm, SM6350_SLAVE_QDSS_STM, 1, 4); DEFINE_QNODE(xs_sys_tcu_cfg, SM6350_SLAVE_TCU, 1, 8); -DEFINE_QBCM(bcm_acv, "ACV", false, &ebi); -DEFINE_QBCM(bcm_ce0, "CE0", false, &qxm_crypto); -DEFINE_QBCM(bcm_cn0, "CN0", true, &qnm_snoc, &xm_qdss_dap, &qhs_a1_noc_cfg, &qhs_a2_noc_cfg, &qhs_ahb2phy0, &qhs_aoss, &qhs_boot_rom, &qhs_camera_cfg, &qhs_camera_nrt_thrott_cfg, &qhs_camera_rt_throttle_cfg, &qhs_clk_ctl, &qhs_cpr_cx, &qhs_cpr_mx, &qhs_crypto0_cfg, &qhs_dcc_cfg, &qhs_ddrss_cfg, &qhs_display_cfg, &qhs_display_throttle_cfg, &qhs_glm, &qhs_gpuss_cfg, &qhs_imem_cfg, &qhs_ipa, &qhs_mnoc_cfg, &qhs_mss_cfg, &qhs_npu_cfg, &qhs_pimem_cfg, &qhs_prng, &qhs_qdss_cfg, &qhs_qm_cfg, &qhs_qm_mpu_cfg, &qhs_qup0, &qhs_qup1, &qhs_security, &qhs_snoc_cfg, &qhs_tcsr, &qhs_ufs_mem_cfg, &qhs_usb3_0, &qhs_venus_cfg, &qhs_venus_throttle_cfg, &qhs_vsense_ctrl_cfg, &srvc_cnoc); -DEFINE_QBCM(bcm_cn1, "CN1", false, &xm_emmc, &xm_sdc2, &qhs_ahb2phy2, &qhs_emmc_cfg, &qhs_pdm, &qhs_sdc2); -DEFINE_QBCM(bcm_co0, "CO0", false, &qns_cdsp_gemnoc); -DEFINE_QBCM(bcm_co2, "CO2", false, &qnm_npu); -DEFINE_QBCM(bcm_co3, "CO3", false, &qxm_npu_dsp); -DEFINE_QBCM(bcm_mc0, "MC0", true, &ebi); -DEFINE_QBCM(bcm_mm0, "MM0", true, &qns_mem_noc_hf); -DEFINE_QBCM(bcm_mm1, "MM1", true, &qxm_camnoc_hf0_uncomp, &qxm_camnoc_icp_uncomp, &qxm_camnoc_sf_uncomp, &qxm_camnoc_hf, &qxm_mdp0); -DEFINE_QBCM(bcm_mm2, "MM2", false, &qns_mem_noc_sf); -DEFINE_QBCM(bcm_mm3, "MM3", false, &qhm_mnoc_cfg, &qnm_video0, &qnm_video_cvp, &qxm_camnoc_sf); -DEFINE_QBCM(bcm_qup0, "QUP0", false, &qup0_core_master, &qup1_core_master, &qup0_core_slave, &qup1_core_slave); -DEFINE_QBCM(bcm_sh0, "SH0", true, &qns_llcc); -DEFINE_QBCM(bcm_sh2, "SH2", false, &acm_sys_tcu); -DEFINE_QBCM(bcm_sh3, "SH3", false, &qnm_cmpnoc); -DEFINE_QBCM(bcm_sh4, "SH4", false, &acm_apps); -DEFINE_QBCM(bcm_sn0, "SN0", true, &qns_gemnoc_sf); -DEFINE_QBCM(bcm_sn1, "SN1", false, &qxs_imem); -DEFINE_QBCM(bcm_sn2, "SN2", false, &qns_gemnoc_gc); -DEFINE_QBCM(bcm_sn3, "SN3", false, &qxs_pimem); -DEFINE_QBCM(bcm_sn4, "SN4", false, &xs_qdss_stm); -DEFINE_QBCM(bcm_sn5, "SN5", false, &qnm_aggre1_noc); -DEFINE_QBCM(bcm_sn6, "SN6", false, &qnm_aggre2_noc); -DEFINE_QBCM(bcm_sn10, "SN10", false, &qnm_gemnoc); +static struct qcom_icc_bcm bcm_acv = { + .name = "ACV", + .enable_mask = BIT(3), + .keepalive = false, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_ce0 = { + .name = "CE0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_crypto }, +}; + +static struct qcom_icc_bcm bcm_cn0 = { + .name = "CN0", + .keepalive = true, + .num_nodes = 41, + .nodes = { &qnm_snoc, + &xm_qdss_dap, + &qhs_a1_noc_cfg, + &qhs_a2_noc_cfg, + &qhs_ahb2phy0, + &qhs_aoss, + &qhs_boot_rom, + &qhs_camera_cfg, + &qhs_camera_nrt_thrott_cfg, + &qhs_camera_rt_throttle_cfg, + &qhs_clk_ctl, + &qhs_cpr_cx, + &qhs_cpr_mx, + &qhs_crypto0_cfg, + &qhs_dcc_cfg, + &qhs_ddrss_cfg, + &qhs_display_cfg, + &qhs_display_throttle_cfg, + &qhs_glm, + &qhs_gpuss_cfg, + &qhs_imem_cfg, + &qhs_ipa, + &qhs_mnoc_cfg, + &qhs_mss_cfg, + &qhs_npu_cfg, + &qhs_pimem_cfg, + &qhs_prng, + &qhs_qdss_cfg, + &qhs_qm_cfg, + &qhs_qm_mpu_cfg, + &qhs_qup0, + &qhs_qup1, + &qhs_security, + &qhs_snoc_cfg, + &qhs_tcsr, + &qhs_ufs_mem_cfg, + &qhs_usb3_0, + &qhs_venus_cfg, + &qhs_venus_throttle_cfg, + &qhs_vsense_ctrl_cfg, + &srvc_cnoc + }, +}; + +static struct qcom_icc_bcm bcm_cn1 = { + .name = "CN1", + .keepalive = false, + .num_nodes = 6, + .nodes = { &xm_emmc, + &xm_sdc2, + &qhs_ahb2phy2, + &qhs_emmc_cfg, + &qhs_pdm, + &qhs_sdc2 + }, +}; + +static struct qcom_icc_bcm bcm_co0 = { + .name = "CO0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_cdsp_gemnoc }, +}; + +static struct qcom_icc_bcm bcm_co2 = { + .name = "CO2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_npu }, +}; + +static struct qcom_icc_bcm bcm_co3 = { + .name = "CO3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_npu_dsp }, +}; + +static struct qcom_icc_bcm bcm_mc0 = { + .name = "MC0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_mm0 = { + .name = "MM0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_mem_noc_hf }, +}; + +static struct qcom_icc_bcm bcm_mm1 = { + .name = "MM1", + .keepalive = true, + .num_nodes = 5, + .nodes = { &qxm_camnoc_hf0_uncomp, + &qxm_camnoc_icp_uncomp, + &qxm_camnoc_sf_uncomp, + &qxm_camnoc_hf, + &qxm_mdp0 + }, +}; + +static struct qcom_icc_bcm bcm_mm2 = { + .name = "MM2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_mem_noc_sf }, +}; + +static struct qcom_icc_bcm bcm_mm3 = { + .name = "MM3", + .keepalive = false, + .num_nodes = 4, + .nodes = { &qhm_mnoc_cfg, &qnm_video0, &qnm_video_cvp, &qxm_camnoc_sf }, +}; + +static struct qcom_icc_bcm bcm_qup0 = { + .name = "QUP0", + .keepalive = false, + .num_nodes = 4, + .nodes = { &qup0_core_master, &qup1_core_master, &qup0_core_slave, &qup1_core_slave }, +}; + +static struct qcom_icc_bcm bcm_sh0 = { + .name = "SH0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_llcc }, +}; + +static struct qcom_icc_bcm bcm_sh2 = { + .name = "SH2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &acm_sys_tcu }, +}; + +static struct qcom_icc_bcm bcm_sh3 = { + .name = "SH3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_cmpnoc }, +}; + +static struct qcom_icc_bcm bcm_sh4 = { + .name = "SH4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &acm_apps }, +}; + +static struct qcom_icc_bcm bcm_sn0 = { + .name = "SN0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_gemnoc_sf }, +}; + +static struct qcom_icc_bcm bcm_sn1 = { + .name = "SN1", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_imem }, +}; + +static struct qcom_icc_bcm bcm_sn2 = { + .name = "SN2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_gemnoc_gc }, +}; + +static struct qcom_icc_bcm bcm_sn3 = { + .name = "SN3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_pimem }, +}; + +static struct qcom_icc_bcm bcm_sn4 = { + .name = "SN4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &xs_qdss_stm }, +}; + +static struct qcom_icc_bcm bcm_sn5 = { + .name = "SN5", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_aggre1_noc }, +}; + +static struct qcom_icc_bcm bcm_sn6 = { + .name = "SN6", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_aggre2_noc }, +}; + +static struct qcom_icc_bcm bcm_sn10 = { + .name = "SN10", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_gemnoc }, +}; static struct qcom_icc_bcm * const aggre1_noc_bcms[] = { &bcm_cn1, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/sm8150.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/sm8150.c @@ -154,34 +154,262 @@ DEFINE_QNODE(xs_qdss_stm, SM8150_SLAVE_QDSS_STM, 1, 4); DEFINE_QNODE(xs_sys_tcu_cfg, SM8150_SLAVE_TCU, 1, 8); -DEFINE_QBCM(bcm_acv, "ACV", false, &ebi); -DEFINE_QBCM(bcm_mc0, "MC0", true, &ebi); -DEFINE_QBCM(bcm_sh0, "SH0", true, &qns_llcc); -DEFINE_QBCM(bcm_mm0, "MM0", true, &qns_mem_noc_hf); -DEFINE_QBCM(bcm_mm1, "MM1", false, &qxm_camnoc_hf0_uncomp, &qxm_camnoc_hf1_uncomp, &qxm_camnoc_sf_uncomp, &qxm_camnoc_hf0, &qxm_camnoc_hf1, &qxm_mdp0, &qxm_mdp1); -DEFINE_QBCM(bcm_sh2, "SH2", false, &qns_gem_noc_snoc); -DEFINE_QBCM(bcm_mm2, "MM2", false, &qxm_camnoc_sf, &qns2_mem_noc); -DEFINE_QBCM(bcm_sh3, "SH3", false, &acm_gpu_tcu, &acm_sys_tcu); -DEFINE_QBCM(bcm_mm3, "MM3", false, &qxm_rot, &qxm_venus0, &qxm_venus1, &qxm_venus_arm9); -DEFINE_QBCM(bcm_sh4, "SH4", false, &qnm_cmpnoc); -DEFINE_QBCM(bcm_sh5, "SH5", false, &acm_apps); -DEFINE_QBCM(bcm_sn0, "SN0", true, &qns_gemnoc_sf); -DEFINE_QBCM(bcm_co0, "CO0", false, &qns_cdsp_mem_noc); -DEFINE_QBCM(bcm_ce0, "CE0", false, &qxm_crypto); -DEFINE_QBCM(bcm_sn1, "SN1", false, &qxs_imem); -DEFINE_QBCM(bcm_co1, "CO1", false, &qnm_npu); -DEFINE_QBCM(bcm_cn0, "CN0", true, &qhm_spdm, &qnm_snoc, &qhs_a1_noc_cfg, &qhs_a2_noc_cfg, &qhs_ahb2phy_south, &qhs_aop, &qhs_aoss, &qhs_camera_cfg, &qhs_clk_ctl, &qhs_compute_dsp, &qhs_cpr_cx, &qhs_cpr_mmcx, &qhs_cpr_mx, &qhs_crypto0_cfg, &qhs_ddrss_cfg, &qhs_display_cfg, &qhs_emac_cfg, &qhs_glm, &qhs_gpuss_cfg, &qhs_imem_cfg, &qhs_ipa, &qhs_mnoc_cfg, &qhs_npu_cfg, &qhs_pcie0_cfg, &qhs_pcie1_cfg, &qhs_phy_refgen_north, &qhs_pimem_cfg, &qhs_prng, &qhs_qdss_cfg, &qhs_qspi, &qhs_qupv3_east, &qhs_qupv3_north, &qhs_qupv3_south, &qhs_sdc2, &qhs_sdc4, &qhs_snoc_cfg, &qhs_spdm, &qhs_spss_cfg, &qhs_ssc_cfg, &qhs_tcsr, &qhs_tlmm_east, &qhs_tlmm_north, &qhs_tlmm_south, &qhs_tlmm_west, &qhs_tsif, &qhs_ufs_card_cfg, &qhs_ufs_mem_cfg, &qhs_usb3_0, &qhs_usb3_1, &qhs_venus_cfg, &qhs_vsense_ctrl_cfg, &qns_cnoc_a2noc, &srvc_cnoc); -DEFINE_QBCM(bcm_qup0, "QUP0", false, &qhm_qup0, &qhm_qup1, &qhm_qup2); -DEFINE_QBCM(bcm_sn2, "SN2", false, &qns_gemnoc_gc); -DEFINE_QBCM(bcm_sn3, "SN3", false, &srvc_aggre1_noc, &srvc_aggre2_noc, &qns_cnoc); -DEFINE_QBCM(bcm_sn4, "SN4", false, &qxs_pimem); -DEFINE_QBCM(bcm_sn5, "SN5", false, &xs_qdss_stm); -DEFINE_QBCM(bcm_sn8, "SN8", false, &xs_pcie_0, &xs_pcie_1); -DEFINE_QBCM(bcm_sn9, "SN9", false, &qnm_aggre1_noc); -DEFINE_QBCM(bcm_sn11, "SN11", false, &qnm_aggre2_noc); -DEFINE_QBCM(bcm_sn12, "SN12", false, &qxm_pimem, &xm_gic); -DEFINE_QBCM(bcm_sn14, "SN14", false, &qns_pcie_mem_noc); -DEFINE_QBCM(bcm_sn15, "SN15", false, &qnm_gemnoc); +static struct qcom_icc_bcm bcm_acv = { + .name = "ACV", + .enable_mask = BIT(3), + .keepalive = false, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_mc0 = { + .name = "MC0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_sh0 = { + .name = "SH0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_llcc }, +}; + +static struct qcom_icc_bcm bcm_mm0 = { + .name = "MM0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_mem_noc_hf }, +}; + +static struct qcom_icc_bcm bcm_mm1 = { + .name = "MM1", + .keepalive = false, + .num_nodes = 7, + .nodes = { &qxm_camnoc_hf0_uncomp, + &qxm_camnoc_hf1_uncomp, + &qxm_camnoc_sf_uncomp, + &qxm_camnoc_hf0, + &qxm_camnoc_hf1, + &qxm_mdp0, + &qxm_mdp1 + }, +}; + +static struct qcom_icc_bcm bcm_sh2 = { + .name = "SH2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_gem_noc_snoc }, +}; + +static struct qcom_icc_bcm bcm_mm2 = { + .name = "MM2", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qxm_camnoc_sf, &qns2_mem_noc }, +}; + +static struct qcom_icc_bcm bcm_sh3 = { + .name = "SH3", + .keepalive = false, + .num_nodes = 2, + .nodes = { &acm_gpu_tcu, &acm_sys_tcu }, +}; + +static struct qcom_icc_bcm bcm_mm3 = { + .name = "MM3", + .keepalive = false, + .num_nodes = 4, + .nodes = { &qxm_rot, &qxm_venus0, &qxm_venus1, &qxm_venus_arm9 }, +}; + +static struct qcom_icc_bcm bcm_sh4 = { + .name = "SH4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_cmpnoc }, +}; + +static struct qcom_icc_bcm bcm_sh5 = { + .name = "SH5", + .keepalive = false, + .num_nodes = 1, + .nodes = { &acm_apps }, +}; + +static struct qcom_icc_bcm bcm_sn0 = { + .name = "SN0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_gemnoc_sf }, +}; + +static struct qcom_icc_bcm bcm_co0 = { + .name = "CO0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_cdsp_mem_noc }, +}; + +static struct qcom_icc_bcm bcm_ce0 = { + .name = "CE0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_crypto }, +}; + +static struct qcom_icc_bcm bcm_sn1 = { + .name = "SN1", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_imem }, +}; + +static struct qcom_icc_bcm bcm_co1 = { + .name = "CO1", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_npu }, +}; + +static struct qcom_icc_bcm bcm_cn0 = { + .name = "CN0", + .keepalive = true, + .num_nodes = 53, + .nodes = { &qhm_spdm, + &qnm_snoc, + &qhs_a1_noc_cfg, + &qhs_a2_noc_cfg, + &qhs_ahb2phy_south, + &qhs_aop, + &qhs_aoss, + &qhs_camera_cfg, + &qhs_clk_ctl, + &qhs_compute_dsp, + &qhs_cpr_cx, + &qhs_cpr_mmcx, + &qhs_cpr_mx, + &qhs_crypto0_cfg, + &qhs_ddrss_cfg, + &qhs_display_cfg, + &qhs_emac_cfg, + &qhs_glm, + &qhs_gpuss_cfg, + &qhs_imem_cfg, + &qhs_ipa, + &qhs_mnoc_cfg, + &qhs_npu_cfg, + &qhs_pcie0_cfg, + &qhs_pcie1_cfg, + &qhs_phy_refgen_north, + &qhs_pimem_cfg, + &qhs_prng, + &qhs_qdss_cfg, + &qhs_qspi, + &qhs_qupv3_east, + &qhs_qupv3_north, + &qhs_qupv3_south, + &qhs_sdc2, + &qhs_sdc4, + &qhs_snoc_cfg, + &qhs_spdm, + &qhs_spss_cfg, + &qhs_ssc_cfg, + &qhs_tcsr, + &qhs_tlmm_east, + &qhs_tlmm_north, + &qhs_tlmm_south, + &qhs_tlmm_west, + &qhs_tsif, + &qhs_ufs_card_cfg, + &qhs_ufs_mem_cfg, + &qhs_usb3_0, + &qhs_usb3_1, + &qhs_venus_cfg, + &qhs_vsense_ctrl_cfg, + &qns_cnoc_a2noc, + &srvc_cnoc + }, +}; + +static struct qcom_icc_bcm bcm_qup0 = { + .name = "QUP0", + .keepalive = false, + .num_nodes = 3, + .nodes = { &qhm_qup0, &qhm_qup1, &qhm_qup2 }, +}; + +static struct qcom_icc_bcm bcm_sn2 = { + .name = "SN2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_gemnoc_gc }, +}; + +static struct qcom_icc_bcm bcm_sn3 = { + .name = "SN3", + .keepalive = false, + .num_nodes = 3, + .nodes = { &srvc_aggre1_noc, &srvc_aggre2_noc, &qns_cnoc }, +}; + +static struct qcom_icc_bcm bcm_sn4 = { + .name = "SN4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_pimem }, +}; + +static struct qcom_icc_bcm bcm_sn5 = { + .name = "SN5", + .keepalive = false, + .num_nodes = 1, + .nodes = { &xs_qdss_stm }, +}; + +static struct qcom_icc_bcm bcm_sn8 = { + .name = "SN8", + .keepalive = false, + .num_nodes = 2, + .nodes = { &xs_pcie_0, &xs_pcie_1 }, +}; + +static struct qcom_icc_bcm bcm_sn9 = { + .name = "SN9", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_aggre1_noc }, +}; + +static struct qcom_icc_bcm bcm_sn11 = { + .name = "SN11", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_aggre2_noc }, +}; + +static struct qcom_icc_bcm bcm_sn12 = { + .name = "SN12", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qxm_pimem, &xm_gic }, +}; + +static struct qcom_icc_bcm bcm_sn14 = { + .name = "SN14", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_pcie_mem_noc }, +}; + +static struct qcom_icc_bcm bcm_sn15 = { + .name = "SN15", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_gemnoc }, +}; static struct qcom_icc_bcm * const aggre1_noc_bcms[] = { &bcm_qup0, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/interconnect/qcom/sm8350.c +++ linux-aws-6.5-6.5.0/drivers/interconnect/qcom/sm8350.c @@ -165,38 +165,283 @@ DEFINE_QNODE(qns_mem_noc_hf_disp, SM8350_SLAVE_MNOC_HF_MEM_NOC_DISP, 2, 32, SM8350_MASTER_MNOC_HF_MEM_NOC_DISP); DEFINE_QNODE(qns_mem_noc_sf_disp, SM8350_SLAVE_MNOC_SF_MEM_NOC_DISP, 2, 32, SM8350_MASTER_MNOC_SF_MEM_NOC_DISP); -DEFINE_QBCM(bcm_acv, "ACV", false, &ebi); -DEFINE_QBCM(bcm_ce0, "CE0", false, &qxm_crypto); -DEFINE_QBCM(bcm_cn0, "CN0", true, &qnm_gemnoc_cnoc, &qnm_gemnoc_pcie); -DEFINE_QBCM(bcm_cn1, "CN1", false, &xm_qdss_dap, &qhs_ahb2phy0, &qhs_ahb2phy1, &qhs_aoss, &qhs_apss, &qhs_camera_cfg, &qhs_clk_ctl, &qhs_compute_cfg, &qhs_cpr_cx, &qhs_cpr_mmcx, &qhs_cpr_mx, &qhs_crypto0_cfg, &qhs_cx_rdpm, &qhs_dcc_cfg, &qhs_display_cfg, &qhs_gpuss_cfg, &qhs_hwkm, &qhs_imem_cfg, &qhs_ipa, &qhs_ipc_router, &qhs_mss_cfg, &qhs_mx_rdpm, &qhs_pcie0_cfg, &qhs_pcie1_cfg, &qhs_pimem_cfg, &qhs_pka_wrapper_cfg, &qhs_pmu_wrapper_cfg, &qhs_qdss_cfg, &qhs_qup0, &qhs_qup1, &qhs_qup2, &qhs_security, &qhs_spss_cfg, &qhs_tcsr, &qhs_tlmm, &qhs_ufs_card_cfg, &qhs_ufs_mem_cfg, &qhs_usb3_0, &qhs_usb3_1, &qhs_venus_cfg, &qhs_vsense_ctrl_cfg, &qns_a1_noc_cfg, &qns_a2_noc_cfg, &qns_ddrss_cfg, &qns_mnoc_cfg, &qns_snoc_cfg, &srvc_cnoc); -DEFINE_QBCM(bcm_cn2, "CN2", false, &qhs_lpass_cfg, &qhs_pdm, &qhs_qspi, &qhs_sdc2, &qhs_sdc4); -DEFINE_QBCM(bcm_co0, "CO0", false, &qns_nsp_gemnoc); -DEFINE_QBCM(bcm_co3, "CO3", false, &qxm_nsp); -DEFINE_QBCM(bcm_mc0, "MC0", true, &ebi); -DEFINE_QBCM(bcm_mm0, "MM0", true, &qns_mem_noc_hf); -DEFINE_QBCM(bcm_mm1, "MM1", false, &qnm_camnoc_hf, &qxm_mdp0, &qxm_mdp1); -DEFINE_QBCM(bcm_mm4, "MM4", false, &qns_mem_noc_sf); -DEFINE_QBCM(bcm_mm5, "MM5", false, &qnm_camnoc_icp, &qnm_camnoc_sf, &qnm_video0, &qnm_video1, &qnm_video_cvp, &qxm_rot); -DEFINE_QBCM(bcm_sh0, "SH0", true, &qns_llcc); -DEFINE_QBCM(bcm_sh2, "SH2", false, &alm_gpu_tcu, &alm_sys_tcu); -DEFINE_QBCM(bcm_sh3, "SH3", false, &qnm_cmpnoc); -DEFINE_QBCM(bcm_sh4, "SH4", false, &chm_apps); -DEFINE_QBCM(bcm_sn0, "SN0", true, &qns_gemnoc_sf); -DEFINE_QBCM(bcm_sn2, "SN2", false, &qns_gemnoc_gc); -DEFINE_QBCM(bcm_sn3, "SN3", false, &qxs_pimem); -DEFINE_QBCM(bcm_sn4, "SN4", false, &xs_qdss_stm); -DEFINE_QBCM(bcm_sn5, "SN5", false, &xm_pcie3_0); -DEFINE_QBCM(bcm_sn6, "SN6", false, &xm_pcie3_1); -DEFINE_QBCM(bcm_sn7, "SN7", false, &qnm_aggre1_noc); -DEFINE_QBCM(bcm_sn8, "SN8", false, &qnm_aggre2_noc); -DEFINE_QBCM(bcm_sn14, "SN14", false, &qns_pcie_mem_noc); -DEFINE_QBCM(bcm_acv_disp, "ACV", false, &ebi_disp); -DEFINE_QBCM(bcm_mc0_disp, "MC0", false, &ebi_disp); -DEFINE_QBCM(bcm_mm0_disp, "MM0", false, &qns_mem_noc_hf_disp); -DEFINE_QBCM(bcm_mm1_disp, "MM1", false, &qxm_mdp0_disp, &qxm_mdp1_disp); -DEFINE_QBCM(bcm_mm4_disp, "MM4", false, &qns_mem_noc_sf_disp); -DEFINE_QBCM(bcm_mm5_disp, "MM5", false, &qxm_rot_disp); -DEFINE_QBCM(bcm_sh0_disp, "SH0", false, &qns_llcc_disp); +static struct qcom_icc_bcm bcm_acv = { + .name = "ACV", + .enable_mask = BIT(3), + .keepalive = false, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_ce0 = { + .name = "CE0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_crypto }, +}; + +static struct qcom_icc_bcm bcm_cn0 = { + .name = "CN0", + .keepalive = true, + .num_nodes = 2, + .nodes = { &qnm_gemnoc_cnoc, &qnm_gemnoc_pcie }, +}; + +static struct qcom_icc_bcm bcm_cn1 = { + .name = "CN1", + .keepalive = false, + .num_nodes = 47, + .nodes = { &xm_qdss_dap, + &qhs_ahb2phy0, + &qhs_ahb2phy1, + &qhs_aoss, + &qhs_apss, + &qhs_camera_cfg, + &qhs_clk_ctl, + &qhs_compute_cfg, + &qhs_cpr_cx, + &qhs_cpr_mmcx, + &qhs_cpr_mx, + &qhs_crypto0_cfg, + &qhs_cx_rdpm, + &qhs_dcc_cfg, + &qhs_display_cfg, + &qhs_gpuss_cfg, + &qhs_hwkm, + &qhs_imem_cfg, + &qhs_ipa, + &qhs_ipc_router, + &qhs_mss_cfg, + &qhs_mx_rdpm, + &qhs_pcie0_cfg, + &qhs_pcie1_cfg, + &qhs_pimem_cfg, + &qhs_pka_wrapper_cfg, + &qhs_pmu_wrapper_cfg, + &qhs_qdss_cfg, + &qhs_qup0, + &qhs_qup1, + &qhs_qup2, + &qhs_security, + &qhs_spss_cfg, + &qhs_tcsr, + &qhs_tlmm, + &qhs_ufs_card_cfg, + &qhs_ufs_mem_cfg, + &qhs_usb3_0, + &qhs_usb3_1, + &qhs_venus_cfg, + &qhs_vsense_ctrl_cfg, + &qns_a1_noc_cfg, + &qns_a2_noc_cfg, + &qns_ddrss_cfg, + &qns_mnoc_cfg, + &qns_snoc_cfg, + &srvc_cnoc + }, +}; + +static struct qcom_icc_bcm bcm_cn2 = { + .name = "CN2", + .keepalive = false, + .num_nodes = 5, + .nodes = { &qhs_lpass_cfg, &qhs_pdm, &qhs_qspi, &qhs_sdc2, &qhs_sdc4 }, +}; + +static struct qcom_icc_bcm bcm_co0 = { + .name = "CO0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_nsp_gemnoc }, +}; + +static struct qcom_icc_bcm bcm_co3 = { + .name = "CO3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_nsp }, +}; + +static struct qcom_icc_bcm bcm_mc0 = { + .name = "MC0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &ebi }, +}; + +static struct qcom_icc_bcm bcm_mm0 = { + .name = "MM0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_mem_noc_hf }, +}; + +static struct qcom_icc_bcm bcm_mm1 = { + .name = "MM1", + .keepalive = false, + .num_nodes = 3, + .nodes = { &qnm_camnoc_hf, &qxm_mdp0, &qxm_mdp1 }, +}; + +static struct qcom_icc_bcm bcm_mm4 = { + .name = "MM4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_mem_noc_sf }, +}; + +static struct qcom_icc_bcm bcm_mm5 = { + .name = "MM5", + .keepalive = false, + .num_nodes = 6, + .nodes = { &qnm_camnoc_icp, + &qnm_camnoc_sf, + &qnm_video0, + &qnm_video1, + &qnm_video_cvp, + &qxm_rot + }, +}; + +static struct qcom_icc_bcm bcm_sh0 = { + .name = "SH0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_llcc }, +}; + +static struct qcom_icc_bcm bcm_sh2 = { + .name = "SH2", + .keepalive = false, + .num_nodes = 2, + .nodes = { &alm_gpu_tcu, &alm_sys_tcu }, +}; + +static struct qcom_icc_bcm bcm_sh3 = { + .name = "SH3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_cmpnoc }, +}; + +static struct qcom_icc_bcm bcm_sh4 = { + .name = "SH4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &chm_apps }, +}; + +static struct qcom_icc_bcm bcm_sn0 = { + .name = "SN0", + .keepalive = true, + .num_nodes = 1, + .nodes = { &qns_gemnoc_sf }, +}; + +static struct qcom_icc_bcm bcm_sn2 = { + .name = "SN2", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_gemnoc_gc }, +}; + +static struct qcom_icc_bcm bcm_sn3 = { + .name = "SN3", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxs_pimem }, +}; + +static struct qcom_icc_bcm bcm_sn4 = { + .name = "SN4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &xs_qdss_stm }, +}; + +static struct qcom_icc_bcm bcm_sn5 = { + .name = "SN5", + .keepalive = false, + .num_nodes = 1, + .nodes = { &xm_pcie3_0 }, +}; + +static struct qcom_icc_bcm bcm_sn6 = { + .name = "SN6", + .keepalive = false, + .num_nodes = 1, + .nodes = { &xm_pcie3_1 }, +}; + +static struct qcom_icc_bcm bcm_sn7 = { + .name = "SN7", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_aggre1_noc }, +}; + +static struct qcom_icc_bcm bcm_sn8 = { + .name = "SN8", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qnm_aggre2_noc }, +}; + +static struct qcom_icc_bcm bcm_sn14 = { + .name = "SN14", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_pcie_mem_noc }, +}; + +static struct qcom_icc_bcm bcm_acv_disp = { + .name = "ACV", + .keepalive = false, + .num_nodes = 1, + .nodes = { &ebi_disp }, +}; + +static struct qcom_icc_bcm bcm_mc0_disp = { + .name = "MC0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &ebi_disp }, +}; + +static struct qcom_icc_bcm bcm_mm0_disp = { + .name = "MM0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_mem_noc_hf_disp }, +}; + +static struct qcom_icc_bcm bcm_mm1_disp = { + .name = "MM1", + .keepalive = false, + .num_nodes = 2, + .nodes = { &qxm_mdp0_disp, &qxm_mdp1_disp }, +}; + +static struct qcom_icc_bcm bcm_mm4_disp = { + .name = "MM4", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_mem_noc_sf_disp }, +}; + +static struct qcom_icc_bcm bcm_mm5_disp = { + .name = "MM5", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qxm_rot_disp }, +}; + +static struct qcom_icc_bcm bcm_sh0_disp = { + .name = "SH0", + .keepalive = false, + .num_nodes = 1, + .nodes = { &qns_llcc_disp }, +}; static struct qcom_icc_bcm * const aggre1_noc_bcms[] = { }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iommu/intel/dmar.c +++ linux-aws-6.5-6.5.0/drivers/iommu/intel/dmar.c @@ -1522,6 +1522,15 @@ { struct qi_desc desc; + /* + * VT-d spec, section 4.3: + * + * Software is recommended to not submit any Device-TLB invalidation + * requests while address remapping hardware is disabled. + */ + if (!(iommu->gcmd & DMA_GCMD_TE)) + return; + if (mask) { addr |= (1ULL << (VTD_PAGE_SHIFT + mask - 1)) - 1; desc.qw1 = QI_DEV_IOTLB_ADDR(addr) | QI_DEV_IOTLB_SIZE; @@ -1587,6 +1596,15 @@ unsigned long mask = 1UL << (VTD_PAGE_SHIFT + size_order - 1); struct qi_desc desc = {.qw1 = 0, .qw2 = 0, .qw3 = 0}; + /* + * VT-d spec, section 4.3: + * + * Software is recommended to not submit any Device-TLB invalidation + * requests while address remapping hardware is disabled. + */ + if (!(iommu->gcmd & DMA_GCMD_TE)) + return; + desc.qw0 = QI_DEV_EIOTLB_PASID(pasid) | QI_DEV_EIOTLB_SID(sid) | QI_DEV_EIOTLB_QDEP(qdep) | QI_DEIOTLB_TYPE | QI_DEV_IOTLB_PFSID(pfsid); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iommu/intel/svm.c +++ linux-aws-6.5-6.5.0/drivers/iommu/intel/svm.c @@ -218,6 +218,27 @@ rcu_read_unlock(); } +static void intel_flush_svm_all(struct intel_svm *svm) +{ + struct device_domain_info *info; + struct intel_svm_dev *sdev; + + rcu_read_lock(); + list_for_each_entry_rcu(sdev, &svm->devs, list) { + info = dev_iommu_priv_get(sdev->dev); + + qi_flush_piotlb(sdev->iommu, sdev->did, svm->pasid, 0, -1UL, 0); + if (info->ats_enabled) { + qi_flush_dev_iotlb_pasid(sdev->iommu, sdev->sid, info->pfsid, + svm->pasid, sdev->qdep, + 0, 64 - VTD_PAGE_SHIFT); + quirk_extra_dev_tlb_flush(info, 0, 64 - VTD_PAGE_SHIFT, + svm->pasid, sdev->qdep); + } + } + rcu_read_unlock(); +} + /* Pages have been freed at this point */ static void intel_invalidate_range(struct mmu_notifier *mn, struct mm_struct *mm, @@ -225,6 +246,11 @@ { struct intel_svm *svm = container_of(mn, struct intel_svm, notifier); + if (start == 0 && end == -1UL) { + intel_flush_svm_all(svm); + return; + } + intel_flush_svm_range(svm, start, (end - start + PAGE_SIZE - 1) >> VTD_PAGE_SHIFT, 0); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iommu/iommufd/io_pagetable.c +++ linux-aws-6.5-6.5.0/drivers/iommu/iommufd/io_pagetable.c @@ -221,6 +221,18 @@ return 0; } +static struct iopt_area *iopt_area_alloc(void) +{ + struct iopt_area *area; + + area = kzalloc(sizeof(*area), GFP_KERNEL_ACCOUNT); + if (!area) + return NULL; + RB_CLEAR_NODE(&area->node.rb); + RB_CLEAR_NODE(&area->pages_node.rb); + return area; +} + static int iopt_alloc_area_pages(struct io_pagetable *iopt, struct list_head *pages_list, unsigned long length, unsigned long *dst_iova, @@ -231,7 +243,7 @@ int rc = 0; list_for_each_entry(elm, pages_list, next) { - elm->area = kzalloc(sizeof(*elm->area), GFP_KERNEL_ACCOUNT); + elm->area = iopt_area_alloc(); if (!elm->area) return -ENOMEM; } @@ -1005,11 +1017,11 @@ iopt_area_start_byte(area, new_start) & (alignment - 1)) return -EINVAL; - lhs = kzalloc(sizeof(*area), GFP_KERNEL_ACCOUNT); + lhs = iopt_area_alloc(); if (!lhs) return -ENOMEM; - rhs = kzalloc(sizeof(*area), GFP_KERNEL_ACCOUNT); + rhs = iopt_area_alloc(); if (!rhs) { rc = -ENOMEM; goto err_free_lhs; @@ -1048,6 +1060,16 @@ if (WARN_ON(rc)) goto err_remove_lhs; + /* + * If the original area has filled a domain, domains_itree has to be + * updated. + */ + if (area->storage_domain) { + interval_tree_remove(&area->pages_node, &pages->domains_itree); + interval_tree_insert(&lhs->pages_node, &pages->domains_itree); + interval_tree_insert(&rhs->pages_node, &pages->domains_itree); + } + lhs->storage_domain = area->storage_domain; lhs->pages = area->pages; rhs->storage_domain = area->storage_domain; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iommu/iommufd/pages.c +++ linux-aws-6.5-6.5.0/drivers/iommu/iommufd/pages.c @@ -1507,6 +1507,8 @@ area, domain, iopt_area_index(area), iopt_area_last_index(area)); + if (IS_ENABLED(CONFIG_IOMMUFD_TEST)) + WARN_ON(RB_EMPTY_NODE(&area->pages_node.rb)); interval_tree_remove(&area->pages_node, &pages->domains_itree); iopt_area_unfill_domain(area, pages, area->storage_domain); area->storage_domain = NULL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/iommu/of_iommu.c +++ linux-aws-6.5-6.5.0/drivers/iommu/of_iommu.c @@ -112,16 +112,20 @@ const u32 *id) { const struct iommu_ops *ops = NULL; - struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); + struct iommu_fwspec *fwspec; int err = NO_IOMMU; if (!master_np) return NULL; + /* Serialise to make dev->iommu stable under our potential fwspec */ + mutex_lock(&iommu_probe_device_lock); + fwspec = dev_iommu_fwspec_get(dev); if (fwspec) { - if (fwspec->ops) + if (fwspec->ops) { + mutex_unlock(&iommu_probe_device_lock); return fwspec->ops; - + } /* In the deferred case, start again from scratch */ iommu_fwspec_free(dev); } @@ -155,6 +159,8 @@ fwspec = dev_iommu_fwspec_get(dev); ops = fwspec->ops; } + mutex_unlock(&iommu_probe_device_lock); + /* * If we have reason to believe the IOMMU driver missed the initial * probe for dev, replay it to get things in order. @@ -191,7 +197,7 @@ if (start == phys->start && end == phys->end) return IOMMU_RESV_DIRECT; - dev_warn(dev, "treating non-direct mapping [%pr] -> [%pap-%pap] as reservation\n", &phys, + dev_warn(dev, "treating non-direct mapping [%pr] -> [%pap-%pap] as reservation\n", phys, &start, &end); return IOMMU_RESV_RESERVED; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/irqchip/irq-gic-v3-its.c +++ linux-aws-6.5-6.5.0/drivers/irqchip/irq-gic-v3-its.c @@ -2383,12 +2383,12 @@ break; } + if (!shr) + gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order)); + its_write_baser(its, baser, val); tmp = baser->val; - if (its->flags & ITS_FLAGS_FORCE_NON_SHAREABLE) - tmp &= ~GITS_BASER_SHAREABILITY_MASK; - if ((val ^ tmp) & GITS_BASER_SHAREABILITY_MASK) { /* * Shareability didn't stick. Just use @@ -2398,10 +2398,9 @@ * non-cacheable as well. */ shr = tmp & GITS_BASER_SHAREABILITY_MASK; - if (!shr) { + if (!shr) cache = GITS_BASER_nC; - gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order)); - } + goto retry_baser; } @@ -2613,6 +2612,11 @@ /* erratum 24313: ignore memory access type */ cache = GITS_BASER_nCnB; + if (its->flags & ITS_FLAGS_FORCE_NON_SHAREABLE) { + cache = GITS_BASER_nC; + shr = 0; + } + for (i = 0; i < GITS_BASER_NR_REGS; i++) { struct its_baser *baser = its->tables + i; u64 val = its_read_baser(its, baser); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/irqchip/irq-riscv-intc.c +++ linux-aws-6.5-6.5.0/drivers/irqchip/irq-riscv-intc.c @@ -155,8 +155,16 @@ * for each INTC DT node. We only need to do INTC initialization * for the INTC DT node belonging to boot CPU (or boot HART). */ - if (riscv_hartid_to_cpuid(hartid) != smp_processor_id()) + if (riscv_hartid_to_cpuid(hartid) != smp_processor_id()) { + /* + * The INTC nodes of each CPU are suppliers for downstream + * interrupt controllers (such as PLIC, IMSIC and APLIC + * direct-mode) so we should mark an INTC node as initialized + * if we are not creating IRQ domain for it. + */ + fwnode_dev_initialized(of_fwnode_handle(node), true); return 0; + } return riscv_intc_init_common(of_node_to_fwnode(node)); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/irqchip/irq-sifive-plic.c +++ linux-aws-6.5-6.5.0/drivers/irqchip/irq-sifive-plic.c @@ -532,17 +532,18 @@ } /* - * We can have multiple PLIC instances so setup cpuhp state only - * when context handler for current/boot CPU is present. + * We can have multiple PLIC instances so setup cpuhp state + * and register syscore operations only when context handler + * for current/boot CPU is present. */ handler = this_cpu_ptr(&plic_handlers); if (handler->present && !plic_cpuhp_setup_done) { cpuhp_setup_state(CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING, "irqchip/sifive/plic:starting", plic_starting_cpu, plic_dying_cpu); + register_syscore_ops(&plic_irq_syscore_ops); plic_cpuhp_setup_done = true; } - register_syscore_ops(&plic_irq_syscore_ops); pr_info("%pOFP: mapped %d interrupts with %d handlers for" " %d contexts.\n", node, nr_irqs, nr_handlers, nr_contexts); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/irqchip/irq-stm32-exti.c +++ linux-aws-6.5-6.5.0/drivers/irqchip/irq-stm32-exti.c @@ -459,6 +459,7 @@ .map = irq_map_generic_chip, .alloc = stm32_exti_alloc, .free = stm32_exti_free, + .xlate = irq_domain_xlate_twocell, }; static void stm32_irq_ack(struct irq_data *d) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/leds/leds-turris-omnia.c +++ linux-aws-6.5-6.5.0/drivers/leds/leds-turris-omnia.c @@ -2,7 +2,7 @@ /* * CZ.NIC's Turris Omnia LEDs driver * - * 2020 by Marek Behún + * 2020, 2023 by Marek Behún */ #include @@ -41,6 +41,37 @@ struct omnia_led leds[]; }; +static int omnia_cmd_write_u8(const struct i2c_client *client, u8 cmd, u8 val) +{ + u8 buf[2] = { cmd, val }; + + return i2c_master_send(client, buf, sizeof(buf)); +} + +static int omnia_cmd_read_u8(const struct i2c_client *client, u8 cmd) +{ + struct i2c_msg msgs[2]; + u8 reply; + int ret; + + msgs[0].addr = client->addr; + msgs[0].flags = 0; + msgs[0].len = 1; + msgs[0].buf = &cmd; + msgs[1].addr = client->addr; + msgs[1].flags = I2C_M_RD; + msgs[1].len = 1; + msgs[1].buf = &reply; + + ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); + if (likely(ret == ARRAY_SIZE(msgs))) + return reply; + else if (ret < 0) + return ret; + else + return -EIO; +} + static int omnia_led_brightness_set_blocking(struct led_classdev *cdev, enum led_brightness brightness) { @@ -64,7 +95,7 @@ if (buf[2] || buf[3] || buf[4]) state |= CMD_LED_STATE_ON; - ret = i2c_smbus_write_byte_data(leds->client, CMD_LED_STATE, state); + ret = omnia_cmd_write_u8(leds->client, CMD_LED_STATE, state); if (ret >= 0 && (state & CMD_LED_STATE_ON)) ret = i2c_master_send(leds->client, buf, 5); @@ -114,9 +145,9 @@ cdev->brightness_set_blocking = omnia_led_brightness_set_blocking; /* put the LED into software mode */ - ret = i2c_smbus_write_byte_data(client, CMD_LED_MODE, - CMD_LED_MODE_LED(led->reg) | - CMD_LED_MODE_USER); + ret = omnia_cmd_write_u8(client, CMD_LED_MODE, + CMD_LED_MODE_LED(led->reg) | + CMD_LED_MODE_USER); if (ret < 0) { dev_err(dev, "Cannot set LED %pOF to software mode: %i\n", np, ret); @@ -124,8 +155,8 @@ } /* disable the LED */ - ret = i2c_smbus_write_byte_data(client, CMD_LED_STATE, - CMD_LED_STATE_LED(led->reg)); + ret = omnia_cmd_write_u8(client, CMD_LED_STATE, + CMD_LED_STATE_LED(led->reg)); if (ret < 0) { dev_err(dev, "Cannot set LED %pOF brightness: %i\n", np, ret); return ret; @@ -156,12 +187,9 @@ char *buf) { struct i2c_client *client = to_i2c_client(dev); - struct omnia_leds *leds = i2c_get_clientdata(client); int ret; - mutex_lock(&leds->lock); - ret = i2c_smbus_read_byte_data(client, CMD_LED_GET_BRIGHTNESS); - mutex_unlock(&leds->lock); + ret = omnia_cmd_read_u8(client, CMD_LED_GET_BRIGHTNESS); if (ret < 0) return ret; @@ -173,7 +201,6 @@ const char *buf, size_t count) { struct i2c_client *client = to_i2c_client(dev); - struct omnia_leds *leds = i2c_get_clientdata(client); unsigned long brightness; int ret; @@ -183,15 +210,9 @@ if (brightness > 100) return -EINVAL; - mutex_lock(&leds->lock); - ret = i2c_smbus_write_byte_data(client, CMD_LED_SET_BRIGHTNESS, - (u8)brightness); - mutex_unlock(&leds->lock); - - if (ret < 0) - return ret; + ret = omnia_cmd_write_u8(client, CMD_LED_SET_BRIGHTNESS, brightness); - return count; + return ret < 0 ? ret : count; } static DEVICE_ATTR_RW(brightness); @@ -246,8 +267,8 @@ u8 buf[5]; /* put all LEDs into default (HW triggered) mode */ - i2c_smbus_write_byte_data(client, CMD_LED_MODE, - CMD_LED_MODE_LED(OMNIA_BOARD_LEDS)); + omnia_cmd_write_u8(client, CMD_LED_MODE, + CMD_LED_MODE_LED(OMNIA_BOARD_LEDS)); /* set all LEDs color to [255, 255, 255] */ buf[0] = CMD_LED_COLOR; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/leds/trigger/ledtrig-cpu.c +++ linux-aws-6.5-6.5.0/drivers/leds/trigger/ledtrig-cpu.c @@ -130,7 +130,7 @@ static int __init ledtrig_cpu_init(void) { - int cpu; + unsigned int cpu; int ret; /* Supports up to 9999 cpu cores */ @@ -152,7 +152,7 @@ if (cpu >= 8) continue; - snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu); + snprintf(trig->name, MAX_NAME_LEN, "cpu%u", cpu); led_trigger_register_simple(trig->name, &trig->_trig); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/leds/trigger/ledtrig-netdev.c +++ linux-aws-6.5-6.5.0/drivers/leds/trigger/ledtrig-netdev.c @@ -221,8 +221,16 @@ static int set_device_name(struct led_netdev_data *trigger_data, const char *name, size_t size) { + if (size >= IFNAMSIZ) + return -EINVAL; + cancel_delayed_work_sync(&trigger_data->work); + /* + * Take RTNL lock before trigger_data lock to prevent potential + * deadlock with netdev notifier registration. + */ + rtnl_lock(); mutex_lock(&trigger_data->lock); if (trigger_data->net_dev) { @@ -242,16 +250,14 @@ trigger_data->carrier_link_up = false; trigger_data->link_speed = SPEED_UNKNOWN; trigger_data->duplex = DUPLEX_UNKNOWN; - if (trigger_data->net_dev != NULL) { - rtnl_lock(); + if (trigger_data->net_dev) get_device_state(trigger_data); - rtnl_unlock(); - } trigger_data->last_activity = 0; set_baseline_state(trigger_data); mutex_unlock(&trigger_data->lock); + rtnl_unlock(); return 0; } @@ -263,9 +269,6 @@ struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev); int ret; - if (size >= IFNAMSIZ) - return -EINVAL; - ret = set_device_name(trigger_data, buf, size); if (ret < 0) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/md/bcache/btree.c +++ linux-aws-6.5-6.5.0/drivers/md/bcache/btree.c @@ -1363,7 +1363,7 @@ memset(new_nodes, 0, sizeof(new_nodes)); closure_init_stack(&cl); - while (nodes < GC_MERGE_NODES && !IS_ERR(r[nodes].b)) + while (nodes < GC_MERGE_NODES && !IS_ERR_OR_NULL(r[nodes].b)) keys += r[nodes++].keys; blocks = btree_default_blocks(b->c) * 2 / 3; @@ -1510,7 +1510,7 @@ bch_keylist_free(&keylist); for (i = 0; i < nodes; i++) - if (!IS_ERR(new_nodes[i])) { + if (!IS_ERR_OR_NULL(new_nodes[i])) { btree_node_free(new_nodes[i]); rw_unlock(true, new_nodes[i]); } @@ -1527,6 +1527,8 @@ return 0; n = btree_node_alloc_replacement(replace, NULL); + if (IS_ERR(n)) + return 0; /* recheck reserve after allocating replacement node */ if (btree_check_reserve(b, NULL)) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/md/bcache/sysfs.c +++ linux-aws-6.5-6.5.0/drivers/md/bcache/sysfs.c @@ -1103,7 +1103,7 @@ sum += INITIAL_PRIO - cached[i]; if (n) - do_div(sum, n); + sum = div64_u64(sum, n); for (i = 0; i < ARRAY_SIZE(q); i++) q[i] = INITIAL_PRIO - cached[n * (i + 1) / only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/md/bcache/writeback.c +++ linux-aws-6.5-6.5.0/drivers/md/bcache/writeback.c @@ -977,24 +977,35 @@ void bch_sectors_dirty_init(struct bcache_device *d) { int i; + struct btree *b = NULL; struct bkey *k = NULL; struct btree_iter iter; struct sectors_dirty_init op; struct cache_set *c = d->c; struct bch_dirty_init_state state; +retry_lock: + b = c->root; + rw_lock(0, b, b->level); + if (b != c->root) { + rw_unlock(0, b); + goto retry_lock; + } + /* Just count root keys if no leaf node */ - rw_lock(0, c->root, c->root->level); if (c->root->level == 0) { bch_btree_op_init(&op.op, -1); op.inode = d->id; op.count = 0; for_each_key_filter(&c->root->keys, - k, &iter, bch_ptr_invalid) + k, &iter, bch_ptr_invalid) { + if (KEY_INODE(k) != op.inode) + continue; sectors_dirty_init_fn(&op.op, c->root, k); + } - rw_unlock(0, c->root); + rw_unlock(0, b); return; } @@ -1014,23 +1025,24 @@ if (atomic_read(&state.enough)) break; + atomic_inc(&state.started); state.infos[i].state = &state; state.infos[i].thread = kthread_run(bch_dirty_init_thread, &state.infos[i], "bch_dirtcnt[%d]", i); if (IS_ERR(state.infos[i].thread)) { pr_err("fails to run thread bch_dirty_init[%d]\n", i); + atomic_dec(&state.started); for (--i; i >= 0; i--) kthread_stop(state.infos[i].thread); goto out; } - atomic_inc(&state.started); } out: /* Must wait for all threads to stop. */ wait_event(state.wait, atomic_read(&state.started) == 0); - rw_unlock(0, c->root); + rw_unlock(0, b); } void bch_cached_dev_writeback_init(struct cached_dev *dc) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/md/dm-bufio.c +++ linux-aws-6.5-6.5.0/drivers/md/dm-bufio.c @@ -254,7 +254,7 @@ typedef enum evict_result (*le_predicate)(struct lru_entry *le, void *context); -static struct lru_entry *lru_evict(struct lru *lru, le_predicate pred, void *context) +static struct lru_entry *lru_evict(struct lru *lru, le_predicate pred, void *context, bool no_sleep) { unsigned long tested = 0; struct list_head *h = lru->cursor; @@ -295,7 +295,8 @@ h = h->next; - cond_resched(); + if (!no_sleep) + cond_resched(); } return NULL; @@ -382,7 +383,10 @@ */ struct buffer_tree { - struct rw_semaphore lock; + union { + struct rw_semaphore lock; + rwlock_t spinlock; + } u; struct rb_root root; } ____cacheline_aligned_in_smp; @@ -393,9 +397,12 @@ * on the locks. */ unsigned int num_locks; + bool no_sleep; struct buffer_tree trees[]; }; +static DEFINE_STATIC_KEY_FALSE(no_sleep_enabled); + static inline unsigned int cache_index(sector_t block, unsigned int num_locks) { return dm_hash_locks_index(block, num_locks); @@ -403,22 +410,34 @@ static inline void cache_read_lock(struct dm_buffer_cache *bc, sector_t block) { - down_read(&bc->trees[cache_index(block, bc->num_locks)].lock); + if (static_branch_unlikely(&no_sleep_enabled) && bc->no_sleep) + read_lock_bh(&bc->trees[cache_index(block, bc->num_locks)].u.spinlock); + else + down_read(&bc->trees[cache_index(block, bc->num_locks)].u.lock); } static inline void cache_read_unlock(struct dm_buffer_cache *bc, sector_t block) { - up_read(&bc->trees[cache_index(block, bc->num_locks)].lock); + if (static_branch_unlikely(&no_sleep_enabled) && bc->no_sleep) + read_unlock_bh(&bc->trees[cache_index(block, bc->num_locks)].u.spinlock); + else + up_read(&bc->trees[cache_index(block, bc->num_locks)].u.lock); } static inline void cache_write_lock(struct dm_buffer_cache *bc, sector_t block) { - down_write(&bc->trees[cache_index(block, bc->num_locks)].lock); + if (static_branch_unlikely(&no_sleep_enabled) && bc->no_sleep) + write_lock_bh(&bc->trees[cache_index(block, bc->num_locks)].u.spinlock); + else + down_write(&bc->trees[cache_index(block, bc->num_locks)].u.lock); } static inline void cache_write_unlock(struct dm_buffer_cache *bc, sector_t block) { - up_write(&bc->trees[cache_index(block, bc->num_locks)].lock); + if (static_branch_unlikely(&no_sleep_enabled) && bc->no_sleep) + write_unlock_bh(&bc->trees[cache_index(block, bc->num_locks)].u.spinlock); + else + up_write(&bc->trees[cache_index(block, bc->num_locks)].u.lock); } /* @@ -442,18 +461,32 @@ static void __lh_lock(struct lock_history *lh, unsigned int index) { - if (lh->write) - down_write(&lh->cache->trees[index].lock); - else - down_read(&lh->cache->trees[index].lock); + if (lh->write) { + if (static_branch_unlikely(&no_sleep_enabled) && lh->cache->no_sleep) + write_lock_bh(&lh->cache->trees[index].u.spinlock); + else + down_write(&lh->cache->trees[index].u.lock); + } else { + if (static_branch_unlikely(&no_sleep_enabled) && lh->cache->no_sleep) + read_lock_bh(&lh->cache->trees[index].u.spinlock); + else + down_read(&lh->cache->trees[index].u.lock); + } } static void __lh_unlock(struct lock_history *lh, unsigned int index) { - if (lh->write) - up_write(&lh->cache->trees[index].lock); - else - up_read(&lh->cache->trees[index].lock); + if (lh->write) { + if (static_branch_unlikely(&no_sleep_enabled) && lh->cache->no_sleep) + write_unlock_bh(&lh->cache->trees[index].u.spinlock); + else + up_write(&lh->cache->trees[index].u.lock); + } else { + if (static_branch_unlikely(&no_sleep_enabled) && lh->cache->no_sleep) + read_unlock_bh(&lh->cache->trees[index].u.spinlock); + else + up_read(&lh->cache->trees[index].u.lock); + } } /* @@ -502,14 +535,18 @@ return le_to_buffer(le); } -static void cache_init(struct dm_buffer_cache *bc, unsigned int num_locks) +static void cache_init(struct dm_buffer_cache *bc, unsigned int num_locks, bool no_sleep) { unsigned int i; bc->num_locks = num_locks; + bc->no_sleep = no_sleep; for (i = 0; i < bc->num_locks; i++) { - init_rwsem(&bc->trees[i].lock); + if (no_sleep) + rwlock_init(&bc->trees[i].u.spinlock); + else + init_rwsem(&bc->trees[i].u.lock); bc->trees[i].root = RB_ROOT; } @@ -648,7 +685,7 @@ struct lru_entry *le; struct dm_buffer *b; - le = lru_evict(&bc->lru[list_mode], __evict_pred, &w); + le = lru_evict(&bc->lru[list_mode], __evict_pred, &w, bc->no_sleep); if (!le) return NULL; @@ -702,7 +739,7 @@ struct evict_wrapper w = {.lh = lh, .pred = pred, .context = context}; while (true) { - le = lru_evict(&bc->lru[old_mode], __evict_pred, &w); + le = lru_evict(&bc->lru[old_mode], __evict_pred, &w, bc->no_sleep); if (!le) break; @@ -915,10 +952,11 @@ { unsigned int i; + BUG_ON(bc->no_sleep); for (i = 0; i < bc->num_locks; i++) { - down_write(&bc->trees[i].lock); + down_write(&bc->trees[i].u.lock); __remove_range(bc, &bc->trees[i].root, begin, end, pred, release); - up_write(&bc->trees[i].lock); + up_write(&bc->trees[i].u.lock); } } @@ -979,8 +1017,6 @@ struct dm_buffer_cache cache; /* must be last member */ }; -static DEFINE_STATIC_KEY_FALSE(no_sleep_enabled); - /*----------------------------------------------------------------*/ #define dm_bufio_in_request() (!!current->bio_list) @@ -1871,7 +1907,8 @@ if (need_submit) submit_io(b, REQ_OP_READ, read_endio); - wait_on_bit_io(&b->state, B_READING, TASK_UNINTERRUPTIBLE); + if (nf != NF_GET) /* we already tested this condition above */ + wait_on_bit_io(&b->state, B_READING, TASK_UNINTERRUPTIBLE); if (b->read_error) { int error = blk_status_to_errno(b->read_error); @@ -2421,7 +2458,7 @@ r = -ENOMEM; goto bad_client; } - cache_init(&c->cache, num_locks); + cache_init(&c->cache, num_locks, (flags & DM_BUFIO_CLIENT_NO_SLEEP) != 0); c->bdev = bdev; c->block_size = block_size; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/md/dm-delay.c +++ linux-aws-6.5-6.5.0/drivers/md/dm-delay.c @@ -31,7 +31,7 @@ struct workqueue_struct *kdelayd_wq; struct work_struct flush_expired_bios; struct list_head delayed_bios; - atomic_t may_delay; + bool may_delay; struct delay_class read; struct delay_class write; @@ -192,7 +192,7 @@ INIT_WORK(&dc->flush_expired_bios, flush_expired_bios); INIT_LIST_HEAD(&dc->delayed_bios); mutex_init(&dc->timer_lock); - atomic_set(&dc->may_delay, 1); + dc->may_delay = true; dc->argc = argc; ret = delay_class_ctr(ti, &dc->read, argv); @@ -247,7 +247,7 @@ struct dm_delay_info *delayed; unsigned long expires = 0; - if (!c->delay || !atomic_read(&dc->may_delay)) + if (!c->delay) return DM_MAPIO_REMAPPED; delayed = dm_per_bio_data(bio, sizeof(struct dm_delay_info)); @@ -256,6 +256,10 @@ delayed->expires = expires = jiffies + msecs_to_jiffies(c->delay); mutex_lock(&delayed_bios_lock); + if (unlikely(!dc->may_delay)) { + mutex_unlock(&delayed_bios_lock); + return DM_MAPIO_REMAPPED; + } c->ops++; list_add_tail(&delayed->list, &dc->delayed_bios); mutex_unlock(&delayed_bios_lock); @@ -269,7 +273,10 @@ { struct delay_c *dc = ti->private; - atomic_set(&dc->may_delay, 0); + mutex_lock(&delayed_bios_lock); + dc->may_delay = false; + mutex_unlock(&delayed_bios_lock); + del_timer_sync(&dc->delay_timer); flush_bios(flush_delayed_bios(dc, 1)); } @@ -278,7 +285,7 @@ { struct delay_c *dc = ti->private; - atomic_set(&dc->may_delay, 1); + dc->may_delay = true; } static int delay_map(struct dm_target *ti, struct bio *bio) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/md/dm-verity-fec.c +++ linux-aws-6.5-6.5.0/drivers/md/dm-verity-fec.c @@ -24,7 +24,8 @@ */ static inline struct dm_verity_fec_io *fec_io(struct dm_verity_io *io) { - return (struct dm_verity_fec_io *) verity_io_digest_end(io->v, io); + return (struct dm_verity_fec_io *) + ((char *)io + io->v->ti->per_io_data_size - sizeof(struct dm_verity_fec_io)); } /* @@ -185,7 +186,7 @@ { if (unlikely(verity_hash(v, verity_io_hash_req(v, io), data, 1 << v->data_dev_block_bits, - verity_io_real_digest(v, io)))) + verity_io_real_digest(v, io), true))) return 0; return memcmp(verity_io_real_digest(v, io), want_digest, @@ -386,7 +387,7 @@ /* Always re-validate the corrected block against the expected hash */ r = verity_hash(v, verity_io_hash_req(v, io), fio->output, 1 << v->data_dev_block_bits, - verity_io_real_digest(v, io)); + verity_io_real_digest(v, io), true); if (unlikely(r < 0)) return r; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/md/dm-verity-target.c +++ linux-aws-6.5-6.5.0/drivers/md/dm-verity-target.c @@ -135,20 +135,21 @@ * Wrapper for crypto_ahash_init, which handles verity salting. */ static int verity_hash_init(struct dm_verity *v, struct ahash_request *req, - struct crypto_wait *wait) + struct crypto_wait *wait, bool may_sleep) { int r; ahash_request_set_tfm(req, v->tfm); - ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP | - CRYPTO_TFM_REQ_MAY_BACKLOG, - crypto_req_done, (void *)wait); + ahash_request_set_callback(req, + may_sleep ? CRYPTO_TFM_REQ_MAY_SLEEP | CRYPTO_TFM_REQ_MAY_BACKLOG : 0, + crypto_req_done, (void *)wait); crypto_init_wait(wait); r = crypto_wait_req(crypto_ahash_init(req), wait); if (unlikely(r < 0)) { - DMERR("crypto_ahash_init failed: %d", r); + if (r != -ENOMEM) + DMERR("crypto_ahash_init failed: %d", r); return r; } @@ -179,12 +180,12 @@ } int verity_hash(struct dm_verity *v, struct ahash_request *req, - const u8 *data, size_t len, u8 *digest) + const u8 *data, size_t len, u8 *digest, bool may_sleep) { int r; struct crypto_wait wait; - r = verity_hash_init(v, req, &wait); + r = verity_hash_init(v, req, &wait, may_sleep); if (unlikely(r < 0)) goto out; @@ -322,7 +323,7 @@ r = verity_hash(v, verity_io_hash_req(v, io), data, 1 << v->hash_dev_block_bits, - verity_io_real_digest(v, io)); + verity_io_real_digest(v, io), !io->in_tasklet); if (unlikely(r < 0)) goto release_ret_r; @@ -556,7 +557,7 @@ continue; } - r = verity_hash_init(v, req, &wait); + r = verity_hash_init(v, req, &wait, !io->in_tasklet); if (unlikely(r < 0)) return r; @@ -641,7 +642,6 @@ io->in_tasklet = false; - verity_fec_init_io(io); verity_finish_io(io, errno_to_blk_status(verity_verify_io(io))); } @@ -652,7 +652,7 @@ io->in_tasklet = true; err = verity_verify_io(io); - if (err == -EAGAIN) { + if (err == -EAGAIN || err == -ENOMEM) { /* fallback to retrying with work-queue */ INIT_WORK(&io->work, verity_work); queue_work(io->v->verify_wq, &io->work); @@ -667,7 +667,9 @@ struct dm_verity_io *io = bio->bi_private; if (bio->bi_status && - (!verity_fec_is_enabled(io->v) || verity_is_system_shutting_down())) { + (!verity_fec_is_enabled(io->v) || + verity_is_system_shutting_down() || + (bio->bi_opf & REQ_RAHEAD))) { verity_finish_io(io, bio->bi_status); return; } @@ -791,6 +793,8 @@ bio->bi_private = io; io->iter = bio->bi_iter; + verity_fec_init_io(io); + verity_submit_prefetch(v, io); submit_bio_noacct(bio); @@ -1033,7 +1037,7 @@ goto out; r = verity_hash(v, req, zero_data, 1 << v->data_dev_block_bits, - v->zero_digest); + v->zero_digest, true); out: kfree(req); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/md/dm-verity.h +++ linux-aws-6.5-6.5.0/drivers/md/dm-verity.h @@ -115,12 +115,6 @@ return (u8 *)(io + 1) + v->ahash_reqsize + v->digest_size; } -static inline u8 *verity_io_digest_end(struct dm_verity *v, - struct dm_verity_io *io) -{ - return verity_io_want_digest(v, io) + v->digest_size; -} - extern int verity_for_bv_block(struct dm_verity *v, struct dm_verity_io *io, struct bvec_iter *iter, int (*process)(struct dm_verity *v, @@ -128,7 +122,7 @@ u8 *data, size_t len)); extern int verity_hash(struct dm_verity *v, struct ahash_request *req, - const u8 *data, size_t len, u8 *digest); + const u8 *data, size_t len, u8 *digest, bool may_sleep); extern int verity_hash_for_block(struct dm_verity *v, struct dm_verity_io *io, sector_t block, u8 *digest, bool *is_zero); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/cec/platform/Makefile +++ linux-aws-6.5-6.5.0/drivers/media/cec/platform/Makefile @@ -6,7 +6,7 @@ # Please keep it in alphabetic order obj-$(CONFIG_CEC_CROS_EC) += cros-ec/ obj-$(CONFIG_CEC_GPIO) += cec-gpio/ -obj-$(CONFIG_CEC_MESON_AO) += meson/ +obj-y += meson/ obj-$(CONFIG_CEC_SAMSUNG_S5P) += s5p/ obj-$(CONFIG_CEC_SECO) += seco/ obj-$(CONFIG_CEC_STI) += sti/ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/i2c/ccs/ccs-core.c +++ linux-aws-6.5-6.5.0/drivers/media/i2c/ccs/ccs-core.c @@ -3097,7 +3097,7 @@ try_fmt->code = sensor->internal_csi_format->code; try_fmt->field = V4L2_FIELD_NONE; - if (ssd != sensor->pixel_array) + if (ssd == sensor->pixel_array) continue; try_comp = v4l2_subdev_get_try_compose(sd, fh->state, i); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/i2c/ccs/ccs-quirk.h +++ linux-aws-6.5-6.5.0/drivers/media/i2c/ccs/ccs-quirk.h @@ -32,12 +32,10 @@ * @reg: Pointer to the register to access * @value: Register value, set by the caller on write, or * by the quirk on read - * - * @flags: Quirk flags - * * @return: 0 on success, -ENOIOCTLCMD if no register * access may be done by the caller (default read * value is zero), else negative error code on error + * @flags: Quirk flags */ struct ccs_quirk { int (*limits)(struct ccs_sensor *sensor); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/i2c/max9286.c +++ linux-aws-6.5-6.5.0/drivers/media/i2c/max9286.c @@ -1461,7 +1461,6 @@ i2c_mux_mask |= BIT(id); } - of_node_put(node); of_node_put(i2c_mux); /* Parse the endpoints */ @@ -1525,7 +1524,6 @@ priv->source_mask |= BIT(ep.port); priv->nsources++; } - of_node_put(node); of_property_read_u32(dev->of_node, "maxim,bus-width", &priv->bus_width); switch (priv->bus_width) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/i2c/ov8858.c +++ linux-aws-6.5-6.5.0/drivers/media/i2c/ov8858.c @@ -1850,9 +1850,9 @@ } ret = v4l2_fwnode_endpoint_parse(endpoint, &vep); + fwnode_handle_put(endpoint); if (ret) { dev_err(dev, "Failed to parse endpoint: %d\n", ret); - fwnode_handle_put(endpoint); return ret; } @@ -1864,12 +1864,9 @@ default: dev_err(dev, "Unsupported number of data lanes %u\n", ov8858->num_lanes); - fwnode_handle_put(endpoint); return -EINVAL; } - ov8858->subdev.fwnode = endpoint; - return 0; } @@ -1913,7 +1910,7 @@ ret = ov8858_init_ctrls(ov8858); if (ret) - goto err_put_fwnode; + return ret; sd = &ov8858->subdev; sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; @@ -1964,8 +1961,6 @@ media_entity_cleanup(&sd->entity); err_free_handler: v4l2_ctrl_handler_free(&ov8858->ctrl_handler); -err_put_fwnode: - fwnode_handle_put(ov8858->subdev.fwnode); return ret; } @@ -1978,7 +1973,6 @@ v4l2_async_unregister_subdev(sd); media_entity_cleanup(&sd->entity); v4l2_ctrl_handler_free(&ov8858->ctrl_handler); - fwnode_handle_put(ov8858->subdev.fwnode); pm_runtime_disable(&client->dev); if (!pm_runtime_status_suspended(&client->dev)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/pci/bt8xx/bttv-driver.c +++ linux-aws-6.5-6.5.0/drivers/media/pci/bt8xx/bttv-driver.c @@ -3830,6 +3830,7 @@ /* free resources */ free_irq(btv->c.pci->irq,btv); + del_timer_sync(&btv->timeout); iounmap(btv->bt848_mmio); release_mem_region(pci_resource_start(btv->c.pci,0), pci_resource_len(btv->c.pci,0)); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/pci/cobalt/cobalt-driver.c +++ linux-aws-6.5-6.5.0/drivers/media/pci/cobalt/cobalt-driver.c @@ -8,6 +8,7 @@ * All rights reserved. */ +#include #include #include #include @@ -210,17 +211,17 @@ pcie_capability_read_word(pci_dev, PCI_EXP_LNKSTA, &stat); cobalt_info("PCIe link capability 0x%08x: %s per lane and %u lanes\n", capa, get_link_speed(capa), - (capa & PCI_EXP_LNKCAP_MLW) >> 4); + FIELD_GET(PCI_EXP_LNKCAP_MLW, capa)); cobalt_info("PCIe link control 0x%04x\n", ctrl); cobalt_info("PCIe link status 0x%04x: %s per lane and %u lanes\n", stat, get_link_speed(stat), - (stat & PCI_EXP_LNKSTA_NLW) >> 4); + FIELD_GET(PCI_EXP_LNKSTA_NLW, stat)); /* Bus */ pcie_capability_read_dword(pci_bus_dev, PCI_EXP_LNKCAP, &capa); cobalt_info("PCIe bus link capability 0x%08x: %s per lane and %u lanes\n", capa, get_link_speed(capa), - (capa & PCI_EXP_LNKCAP_MLW) >> 4); + FIELD_GET(PCI_EXP_LNKCAP_MLW, capa)); /* Slot */ pcie_capability_read_dword(pci_dev, PCI_EXP_SLTCAP, &capa); @@ -239,7 +240,7 @@ if (!pci_is_pcie(pci_dev)) return 0; pcie_capability_read_word(pci_dev, PCI_EXP_LNKSTA, &link); - return (link & PCI_EXP_LNKSTA_NLW) >> 4; + return FIELD_GET(PCI_EXP_LNKSTA_NLW, link); } static unsigned pcie_bus_link_get_lanes(struct cobalt *cobalt) @@ -250,7 +251,7 @@ if (!pci_is_pcie(pci_dev)) return 0; pcie_capability_read_dword(pci_dev, PCI_EXP_LNKCAP, &link); - return (link & PCI_EXP_LNKCAP_MLW) >> 4; + return FIELD_GET(PCI_EXP_LNKCAP_MLW, link); } static void msi_config_show(struct cobalt *cobalt, struct pci_dev *pci_dev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/amphion/vpu_defs.h +++ linux-aws-6.5-6.5.0/drivers/media/platform/amphion/vpu_defs.h @@ -71,6 +71,7 @@ VPU_MSG_ID_TIMESTAMP_INFO, VPU_MSG_ID_FIRMWARE_XCPT, VPU_MSG_ID_PIC_SKIPPED, + VPU_MSG_ID_DBG_MSG, }; enum VPU_ENC_MEMORY_RESOURSE { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/amphion/vpu_malone.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/amphion/vpu_malone.c @@ -747,6 +747,7 @@ {VPU_MSG_ID_UNSUPPORTED, VID_API_EVENT_UNSUPPORTED_STREAM}, {VPU_MSG_ID_FIRMWARE_XCPT, VID_API_EVENT_FIRMWARE_XCPT}, {VPU_MSG_ID_PIC_SKIPPED, VID_API_EVENT_PIC_SKIPPED}, + {VPU_MSG_ID_DBG_MSG, VID_API_EVENT_DBG_MSG_DEC}, }; static void vpu_malone_pack_fs_alloc(struct vpu_rpc_event *pkt, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/cadence/cdns-csi2rx.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/cadence/cdns-csi2rx.c @@ -404,8 +404,10 @@ asd = v4l2_async_nf_add_fwnode_remote(&csi2rx->notifier, fwh, struct v4l2_async_subdev); of_node_put(ep); - if (IS_ERR(asd)) + if (IS_ERR(asd)) { + v4l2_async_nf_cleanup(&csi2rx->notifier); return PTR_ERR(asd); + } csi2rx->notifier.ops = &csi2rx_notifier_ops; @@ -467,6 +469,7 @@ return 0; err_cleanup: + v4l2_async_nf_unregister(&csi2rx->notifier); v4l2_async_nf_cleanup(&csi2rx->notifier); err_free_priv: kfree(csi2rx); @@ -477,6 +480,8 @@ { struct csi2rx_priv *csi2rx = platform_get_drvdata(pdev); + v4l2_async_nf_unregister(&csi2rx->notifier); + v4l2_async_nf_cleanup(&csi2rx->notifier); v4l2_async_unregister_subdev(&csi2rx->subdev); kfree(csi2rx); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c @@ -127,6 +127,7 @@ u32 img_stride; u32 mem_stride; u32 i, enc_quality; + u32 nr_enc_quality = ARRAY_SIZE(mtk_jpeg_enc_quality); value = width << 16 | height; writel(value, base + JPEG_ENC_IMG_SIZE); @@ -157,8 +158,8 @@ writel(img_stride, base + JPEG_ENC_IMG_STRIDE); writel(mem_stride, base + JPEG_ENC_STRIDE); - enc_quality = mtk_jpeg_enc_quality[0].hardware_value; - for (i = 0; i < ARRAY_SIZE(mtk_jpeg_enc_quality); i++) { + enc_quality = mtk_jpeg_enc_quality[nr_enc_quality - 1].hardware_value; + for (i = 0; i < nr_enc_quality; i++) { if (ctx->enc_quality <= mtk_jpeg_enc_quality[i].quality_param) { enc_quality = mtk_jpeg_enc_quality[i].hardware_value; break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c @@ -261,11 +261,11 @@ const struct v4l2_rect *compose; u32 out = 0; + ctx = &path->comps[index]; if (CFG_CHECK(MT8183, p_id)) out = CFG_COMP(MT8183, ctx->param, outputs[0]); compose = path->composes[out]; - ctx = &path->comps[index]; ret = call_op(ctx, config_frame, cmd, compose); if (ret) return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c @@ -1322,6 +1322,20 @@ return false; } +static void mxc_jpeg_set_last_buffer(struct mxc_jpeg_ctx *ctx) +{ + struct vb2_v4l2_buffer *next_dst_buf; + + next_dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); + if (!next_dst_buf) { + ctx->fh.m2m_ctx->is_draining = true; + ctx->fh.m2m_ctx->next_buf_last = true; + return; + } + + v4l2_m2m_last_buffer_done(ctx->fh.m2m_ctx, next_dst_buf); +} + static bool mxc_jpeg_source_change(struct mxc_jpeg_ctx *ctx, struct mxc_jpeg_src_buf *jpeg_src_buf) { @@ -1334,7 +1348,8 @@ q_data_cap = mxc_jpeg_get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE); if (mxc_jpeg_compare_format(q_data_cap->fmt, jpeg_src_buf->fmt)) jpeg_src_buf->fmt = q_data_cap->fmt; - if (q_data_cap->fmt != jpeg_src_buf->fmt || + if (ctx->need_initial_source_change_evt || + q_data_cap->fmt != jpeg_src_buf->fmt || q_data_cap->w != jpeg_src_buf->w || q_data_cap->h != jpeg_src_buf->h) { dev_dbg(dev, "Detected jpeg res=(%dx%d)->(%dx%d), pixfmt=%c%c%c%c\n", @@ -1378,6 +1393,9 @@ mxc_jpeg_sizeimage(q_data_cap); notify_src_chg(ctx); ctx->source_change = 1; + ctx->need_initial_source_change_evt = false; + if (vb2_is_streaming(v4l2_m2m_get_dst_vq(ctx->fh.m2m_ctx))) + mxc_jpeg_set_last_buffer(ctx); } return ctx->source_change ? true : false; @@ -1595,6 +1613,9 @@ for (i = 0; i < *nplanes; i++) sizes[i] = mxc_jpeg_get_plane_size(q_data, i); + if (V4L2_TYPE_IS_OUTPUT(q->type)) + ctx->need_initial_source_change_evt = true; + return 0; } @@ -1638,8 +1659,13 @@ v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR); } - if (V4L2_TYPE_IS_OUTPUT(q->type) || !ctx->source_change) - v4l2_m2m_update_stop_streaming_state(ctx->fh.m2m_ctx, q); + v4l2_m2m_update_stop_streaming_state(ctx->fh.m2m_ctx, q); + /* if V4L2_DEC_CMD_STOP is sent before the source change triggered, + * restore the is_draining flag + */ + if (V4L2_TYPE_IS_CAPTURE(q->type) && ctx->source_change && ctx->fh.m2m_ctx->last_src_buf) + ctx->fh.m2m_ctx->is_draining = true; + if (V4L2_TYPE_IS_OUTPUT(q->type) && v4l2_m2m_has_stopped(ctx->fh.m2m_ctx)) { notify_eos(ctx); @@ -1916,7 +1942,7 @@ return -EINVAL; for (i = 0; i < q_data->fmt->mem_planes; i++) { sizeimage = mxc_jpeg_get_plane_size(q_data, i); - if (vb2_plane_size(vb, i) < sizeimage) { + if (!ctx->source_change && vb2_plane_size(vb, i) < sizeimage) { dev_err(dev, "plane %d too small (%lu < %lu)", i, vb2_plane_size(vb, i), sizeimage); return -EINVAL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h +++ linux-aws-6.5-6.5.0/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h @@ -99,6 +99,7 @@ enum mxc_jpeg_enc_state enc_state; int slot; unsigned int source_change; + bool need_initial_source_change_evt; bool header_parsed; struct v4l2_ctrl_handler ctrl_handler; u8 jpeg_quality; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/qcom/camss/camss-csid-gen2.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/qcom/camss/camss-csid-gen2.c @@ -355,9 +355,6 @@ u8 dt_id = vc; if (tg->enabled) { - /* Config Test Generator */ - vc = 0xa; - /* configure one DT, infinite frames */ val = vc << TPG_VC_CFG0_VC_NUM; val |= INTELEAVING_MODE_ONE_SHOT << TPG_VC_CFG0_LINE_INTERLEAVING_MODE; @@ -370,14 +367,14 @@ writel_relaxed(0x12345678, csid->base + CSID_TPG_LFSR_SEED); - val = input_format->height & 0x1fff << TPG_DT_n_CFG_0_FRAME_HEIGHT; - val |= input_format->width & 0x1fff << TPG_DT_n_CFG_0_FRAME_WIDTH; + val = (input_format->height & 0x1fff) << TPG_DT_n_CFG_0_FRAME_HEIGHT; + val |= (input_format->width & 0x1fff) << TPG_DT_n_CFG_0_FRAME_WIDTH; writel_relaxed(val, csid->base + CSID_TPG_DT_n_CFG_0(0)); val = format->data_type << TPG_DT_n_CFG_1_DATA_TYPE; writel_relaxed(val, csid->base + CSID_TPG_DT_n_CFG_1(0)); - val = tg->mode << TPG_DT_n_CFG_2_PAYLOAD_MODE; + val = (tg->mode - 1) << TPG_DT_n_CFG_2_PAYLOAD_MODE; val |= 0xBE << TPG_DT_n_CFG_2_USER_SPECIFIED_PAYLOAD; val |= format->decode_format << TPG_DT_n_CFG_2_ENCODE_FORMAT; writel_relaxed(val, csid->base + CSID_TPG_DT_n_CFG_2(0)); @@ -449,6 +446,8 @@ writel_relaxed(val, csid->base + CSID_CSI2_RX_CFG0); val = 1 << CSI2_RX_CFG1_PACKET_ECC_CORRECTION_EN; + if (vc > 3) + val |= 1 << CSI2_RX_CFG1_VC_MODE; val |= 1 << CSI2_RX_CFG1_MISR_EN; writel_relaxed(val, csid->base + CSID_CSI2_RX_CFG1); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c @@ -476,7 +476,7 @@ settle_cnt = csiphy_settle_cnt_calc(link_freq, csiphy->timer_clk_rate); - val = is_gen2 ? BIT(7) : CSIPHY_3PH_CMN_CSI_COMMON_CTRL5_CLK_ENABLE; + val = CSIPHY_3PH_CMN_CSI_COMMON_CTRL5_CLK_ENABLE; for (i = 0; i < c->num_data; i++) val |= BIT(c->data[i].pos * 2); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/qcom/camss/camss-vfe-170.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/qcom/camss/camss-vfe-170.c @@ -7,7 +7,6 @@ * Copyright (C) 2020-2021 Linaro Ltd. */ -#include #include #include #include @@ -494,35 +493,20 @@ return 0; } -static int vfe_disable_output(struct vfe_line *line) +static void vfe_disable_output(struct vfe_line *line) { struct vfe_device *vfe = to_vfe(line); struct vfe_output *output = &line->output; unsigned long flags; unsigned int i; - bool done; - int timeout = 0; - - do { - spin_lock_irqsave(&vfe->output_lock, flags); - done = !output->gen2.active_num; - spin_unlock_irqrestore(&vfe->output_lock, flags); - usleep_range(10000, 20000); - - if (timeout++ == 100) { - dev_err(vfe->camss->dev, "VFE idle timeout - resetting\n"); - vfe_reset(vfe); - output->gen2.active_num = 0; - return 0; - } - } while (!done); spin_lock_irqsave(&vfe->output_lock, flags); for (i = 0; i < output->wm_num; i++) vfe_wm_stop(vfe, output->wm_idx[i]); + output->gen2.active_num = 0; spin_unlock_irqrestore(&vfe->output_lock, flags); - return 0; + vfe_reset(vfe); } /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/qcom/camss/camss-vfe-480.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/qcom/camss/camss-vfe-480.c @@ -8,7 +8,6 @@ * Copyright (C) 2021 Jonathan Marek */ -#include #include #include #include @@ -328,35 +327,20 @@ return 0; } -static int vfe_disable_output(struct vfe_line *line) +static void vfe_disable_output(struct vfe_line *line) { struct vfe_device *vfe = to_vfe(line); struct vfe_output *output = &line->output; unsigned long flags; unsigned int i; - bool done; - int timeout = 0; - - do { - spin_lock_irqsave(&vfe->output_lock, flags); - done = !output->gen2.active_num; - spin_unlock_irqrestore(&vfe->output_lock, flags); - usleep_range(10000, 20000); - - if (timeout++ == 100) { - dev_err(vfe->camss->dev, "VFE idle timeout - resetting\n"); - vfe_reset(vfe); - output->gen2.active_num = 0; - return 0; - } - } while (!done); spin_lock_irqsave(&vfe->output_lock, flags); for (i = 0; i < output->wm_num; i++) vfe_wm_stop(vfe, output->wm_idx[i]); + output->gen2.active_num = 0; spin_unlock_irqrestore(&vfe->output_lock, flags); - return 0; + vfe_reset(vfe); } /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/qcom/camss/camss-vfe.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/qcom/camss/camss-vfe.c @@ -535,7 +535,8 @@ struct camss_clock *clock = &vfe->clock[i]; if (!strcmp(clock->name, "vfe0") || - !strcmp(clock->name, "vfe1")) { + !strcmp(clock->name, "vfe1") || + !strcmp(clock->name, "vfe_lite")) { u64 min_rate = 0; unsigned long rate; @@ -611,7 +612,7 @@ } else { ret = vfe_check_clock_rates(vfe); if (ret < 0) - goto error_pm_runtime_get; + goto error_pm_domain; } vfe->power_count++; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/qcom/camss/camss.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/qcom/camss/camss.c @@ -1538,6 +1538,20 @@ return 0; } +static void camss_genpd_cleanup(struct camss *camss) +{ + int i; + + if (camss->genpd_num == 1) + return; + + if (camss->genpd_num > camss->vfe_num) + device_link_del(camss->genpd_link[camss->genpd_num - 1]); + + for (i = 0; i < camss->genpd_num; i++) + dev_pm_domain_detach(camss->genpd[i], true); +} + /* * camss_probe - Probe CAMSS platform device * @pdev: Pointer to CAMSS platform device @@ -1615,25 +1629,23 @@ if (!camss->vfe) return -ENOMEM; - v4l2_async_nf_init(&camss->notifier); - - num_subdevs = camss_of_parse_ports(camss); - if (num_subdevs < 0) { - ret = num_subdevs; - goto err_cleanup; - } - ret = camss_icc_get(camss); if (ret < 0) - goto err_cleanup; + return ret; + + ret = camss_configure_pd(camss); + if (ret < 0) { + dev_err(dev, "Failed to configure power domains: %d\n", ret); + return ret; + } ret = camss_init_subdevices(camss); if (ret < 0) - goto err_cleanup; + goto err_genpd_cleanup; ret = dma_set_mask_and_coherent(dev, 0xffffffff); if (ret) - goto err_cleanup; + goto err_genpd_cleanup; camss->media_dev.dev = camss->dev; strscpy(camss->media_dev.model, "Qualcomm Camera Subsystem", @@ -1645,12 +1657,20 @@ ret = v4l2_device_register(camss->dev, &camss->v4l2_dev); if (ret < 0) { dev_err(dev, "Failed to register V4L2 device: %d\n", ret); - goto err_cleanup; + goto err_genpd_cleanup; + } + + v4l2_async_nf_init(&camss->notifier); + + num_subdevs = camss_of_parse_ports(camss); + if (num_subdevs < 0) { + ret = num_subdevs; + goto err_v4l2_device_unregister; } ret = camss_register_entities(camss); if (ret < 0) - goto err_register_entities; + goto err_v4l2_device_unregister; if (num_subdevs) { camss->notifier.ops = &camss_subdev_notifier_ops; @@ -1679,44 +1699,28 @@ } } - ret = camss_configure_pd(camss); - if (ret < 0) { - dev_err(dev, "Failed to configure power domains: %d\n", ret); - return ret; - } - pm_runtime_enable(dev); return 0; err_register_subdevs: camss_unregister_entities(camss); -err_register_entities: +err_v4l2_device_unregister: v4l2_device_unregister(&camss->v4l2_dev); -err_cleanup: v4l2_async_nf_cleanup(&camss->notifier); +err_genpd_cleanup: + camss_genpd_cleanup(camss); return ret; } void camss_delete(struct camss *camss) { - int i; - v4l2_device_unregister(&camss->v4l2_dev); media_device_unregister(&camss->media_dev); media_device_cleanup(&camss->media_dev); pm_runtime_disable(camss->dev); - - if (camss->genpd_num == 1) - return; - - if (camss->genpd_num > camss->vfe_num) - device_link_del(camss->genpd_link[camss->genpd_num - 1]); - - for (i = 0; i < camss->genpd_num; i++) - dev_pm_domain_detach(camss->genpd[i], true); } /* @@ -1735,6 +1739,8 @@ if (atomic_read(&camss->ref_count) == 0) camss_delete(camss); + + camss_genpd_cleanup(camss); } static const struct of_device_id camss_dt_match[] = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/qcom/venus/hfi_msgs.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -398,7 +398,7 @@ memcpy(&bufreq[idx], buf_req, sizeof(*bufreq)); idx++; - if (idx > HFI_BUFFER_TYPE_MAX) + if (idx >= HFI_BUFFER_TYPE_MAX) return HFI_ERR_SESSION_INVALID_PARAMETER; req_bytes -= sizeof(struct hfi_buffer_requirements); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/qcom/venus/hfi_parser.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/qcom/venus/hfi_parser.c @@ -19,6 +19,9 @@ struct hfi_plat_caps *caps = core->caps, *cap; unsigned long bit; + if (hweight_long(core->dec_codecs) + hweight_long(core->enc_codecs) > MAX_CODEC_NUM) + return; + for_each_set_bit(bit, &core->dec_codecs, MAX_CODEC_NUM) { cap = &caps[core->codecs_count++]; cap->codec = BIT(bit); @@ -86,6 +89,9 @@ { const struct hfi_profile_level *pl = data; + if (cap->num_pl + num >= HFI_MAX_PROFILE_COUNT) + return; + memcpy(&cap->pl[cap->num_pl], pl, num * sizeof(*pl)); cap->num_pl += num; } @@ -111,6 +117,9 @@ { const struct hfi_capability *caps = data; + if (cap->num_caps + num >= MAX_CAP_ENTRIES) + return; + memcpy(&cap->caps[cap->num_caps], caps, num * sizeof(*caps)); cap->num_caps += num; } @@ -137,6 +146,9 @@ { const struct raw_formats *formats = fmts; + if (cap->num_fmts + num_fmts >= MAX_FMT_ENTRIES) + return; + memcpy(&cap->fmts[cap->num_fmts], formats, num_fmts * sizeof(*formats)); cap->num_fmts += num_fmts; } @@ -159,6 +171,9 @@ rawfmts[i].buftype = fmt->buffer_type; i++; + if (i >= MAX_FMT_ENTRIES) + return; + if (pinfo->num_planes > MAX_PLANES) break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/samsung/s3c-camif/camif-capture.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/samsung/s3c-camif/camif-capture.c @@ -1133,12 +1133,12 @@ ret = vb2_queue_init(q); if (ret) - goto err_vd_rel; + return ret; vp->pad.flags = MEDIA_PAD_FL_SINK; ret = media_entity_pads_init(&vfd->entity, 1, &vp->pad); if (ret) - goto err_vd_rel; + return ret; video_set_drvdata(vfd, vp); @@ -1171,8 +1171,6 @@ v4l2_ctrl_handler_free(&vp->ctrl_handler); err_me_cleanup: media_entity_cleanup(&vfd->entity); -err_vd_rel: - video_device_release(vfd); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/verisilicon/hantro_drv.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/verisilicon/hantro_drv.c @@ -125,7 +125,8 @@ ctx = v4l2_m2m_get_curr_priv(vpu->m2m_dev); if (ctx) { vpu_err("frame processing timed out!\n"); - ctx->codec_ops->reset(ctx); + if (ctx->codec_ops->reset) + ctx->codec_ops->reset(ctx); hantro_job_finish(vpu, ctx, VB2_BUF_STATE_ERROR); } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/verisilicon/hantro_postproc.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/verisilicon/hantro_postproc.c @@ -107,7 +107,7 @@ static int down_scale_factor(struct hantro_ctx *ctx) { - if (ctx->src_fmt.width == ctx->dst_fmt.width) + if (ctx->src_fmt.width <= ctx->dst_fmt.width) return 0; return DIV_ROUND_CLOSEST(ctx->src_fmt.width, ctx->dst_fmt.width); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/platform/verisilicon/rockchip_vpu_hw.c +++ linux-aws-6.5-6.5.0/drivers/media/platform/verisilicon/rockchip_vpu_hw.c @@ -648,7 +648,7 @@ }; static const char * const rk3588_vpu981_vpu_clk_names[] = { - "aclk", "hclk", "aclk_vdpu_root", "hclk_vdpu_root" + "aclk", "hclk", }; /* VDPU1/VEPU1 */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/rc/imon.c +++ linux-aws-6.5-6.5.0/drivers/media/rc/imon.c @@ -2427,6 +2427,12 @@ goto fail; } + if (first_if->dev.driver != interface->dev.driver) { + dev_err(&interface->dev, "inconsistent driver matching\n"); + ret = -EINVAL; + goto fail; + } + if (ifnum == 0) { ictx = imon_init_intf0(interface, id); if (!ictx) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/rc/ir-sharp-decoder.c +++ linux-aws-6.5-6.5.0/drivers/media/rc/ir-sharp-decoder.c @@ -15,7 +15,9 @@ #define SHARP_UNIT 40 /* us */ #define SHARP_BIT_PULSE (8 * SHARP_UNIT) /* 320us */ #define SHARP_BIT_0_PERIOD (25 * SHARP_UNIT) /* 1ms (680us space) */ -#define SHARP_BIT_1_PERIOD (50 * SHARP_UNIT) /* 2ms (1680ms space) */ +#define SHARP_BIT_1_PERIOD (50 * SHARP_UNIT) /* 2ms (1680us space) */ +#define SHARP_BIT_0_SPACE (17 * SHARP_UNIT) /* 680us space */ +#define SHARP_BIT_1_SPACE (42 * SHARP_UNIT) /* 1680us space */ #define SHARP_ECHO_SPACE (1000 * SHARP_UNIT) /* 40 ms */ #define SHARP_TRAILER_SPACE (125 * SHARP_UNIT) /* 5 ms (even longer) */ @@ -168,8 +170,8 @@ .header_pulse = 0, .header_space = 0, .bit_pulse = SHARP_BIT_PULSE, - .bit_space[0] = SHARP_BIT_0_PERIOD, - .bit_space[1] = SHARP_BIT_1_PERIOD, + .bit_space[0] = SHARP_BIT_0_SPACE, + .bit_space[1] = SHARP_BIT_1_SPACE, .trailer_pulse = SHARP_BIT_PULSE, .trailer_space = SHARP_ECHO_SPACE, .msb_first = 1, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/rc/lirc_dev.c +++ linux-aws-6.5-6.5.0/drivers/media/rc/lirc_dev.c @@ -276,7 +276,11 @@ if (ret < 0) goto out_kfree_raw; - count = ret; + /* drop trailing space */ + if (!(ret % 2)) + count = ret - 1; + else + count = ret; txbuf = kmalloc_array(count, sizeof(unsigned int), GFP_KERNEL); if (!txbuf) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/test-drivers/vidtv/vidtv_mux.c +++ linux-aws-6.5-6.5.0/drivers/media/test-drivers/vidtv/vidtv_mux.c @@ -504,13 +504,16 @@ m->priv = args->priv; m->network_id = args->network_id; m->network_name = kstrdup(args->network_name, GFP_KERNEL); + if (!m->network_name) + goto free_mux_buf; + m->timing.current_jiffies = get_jiffies_64(); if (args->channels) m->channels = args->channels; else if (vidtv_channels_init(m) < 0) - goto free_mux_buf; + goto free_mux_network_name; /* will alloc data for pmt_sections after initializing pat */ if (vidtv_channel_si_init(m) < 0) @@ -527,6 +530,8 @@ vidtv_channel_si_destroy(m); free_channels: vidtv_channels_destroy(m); +free_mux_network_name: + kfree(m->network_name); free_mux_buf: vfree(m->mux_buf); free_mux: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/test-drivers/vidtv/vidtv_psi.c +++ linux-aws-6.5-6.5.0/drivers/media/test-drivers/vidtv/vidtv_psi.c @@ -301,16 +301,29 @@ desc->service_name_len = service_name_len; - if (service_name && service_name_len) + if (service_name && service_name_len) { desc->service_name = kstrdup(service_name, GFP_KERNEL); + if (!desc->service_name) + goto free_desc; + } desc->provider_name_len = provider_name_len; - if (provider_name && provider_name_len) + if (provider_name && provider_name_len) { desc->provider_name = kstrdup(provider_name, GFP_KERNEL); + if (!desc->provider_name) + goto free_desc_service_name; + } vidtv_psi_desc_chain(head, (struct vidtv_psi_desc *)desc); return desc; + +free_desc_service_name: + if (service_name && service_name_len) + kfree(desc->service_name); +free_desc: + kfree(desc); + return NULL; } struct vidtv_psi_desc_registration @@ -355,8 +368,13 @@ desc->length = network_name_len; - if (network_name && network_name_len) + if (network_name && network_name_len) { desc->network_name = kstrdup(network_name, GFP_KERNEL); + if (!desc->network_name) { + kfree(desc); + return NULL; + } + } vidtv_psi_desc_chain(head, (struct vidtv_psi_desc *)desc); return desc; @@ -442,15 +460,32 @@ iso_language_code = "eng"; desc->iso_language_code = kstrdup(iso_language_code, GFP_KERNEL); + if (!desc->iso_language_code) + goto free_desc; - if (event_name && event_name_len) + if (event_name && event_name_len) { desc->event_name = kstrdup(event_name, GFP_KERNEL); + if (!desc->event_name) + goto free_desc_language_code; + } - if (text && text_len) + if (text && text_len) { desc->text = kstrdup(text, GFP_KERNEL); + if (!desc->text) + goto free_desc_event_name; + } vidtv_psi_desc_chain(head, (struct vidtv_psi_desc *)desc); return desc; + +free_desc_event_name: + if (event_name && event_name_len) + kfree(desc->event_name); +free_desc_language_code: + kfree(desc->iso_language_code); +free_desc: + kfree(desc); + return NULL; } struct vidtv_psi_desc *vidtv_psi_desc_clone(struct vidtv_psi_desc *desc) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/test-drivers/vivid/vivid-rds-gen.c +++ linux-aws-6.5-6.5.0/drivers/media/test-drivers/vivid/vivid-rds-gen.c @@ -145,7 +145,7 @@ rds->ta = alt; rds->ms = true; snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d", - freq / 16, ((freq & 0xf) * 10) / 16); + (freq / 16) % 1000000, (((freq & 0xf) * 10) / 16) % 10); if (alt) strscpy(rds->radiotext, " The Radio Data System can switch between different Radio Texts ", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/media/usb/gspca/cpia1.c +++ linux-aws-6.5-6.5.0/drivers/media/usb/gspca/cpia1.c @@ -18,6 +18,7 @@ #include #include +#include #include "gspca.h" @@ -1028,6 +1029,8 @@ sd->params.exposure.expMode = 2; sd->exposure_status = EXPOSURE_NORMAL; } + if (sd->params.exposure.gain >= BITS_PER_TYPE(currentexp)) + return -EINVAL; currentexp = currentexp << sd->params.exposure.gain; sd->params.exposure.gain = 0; /* round down current exposure to nearest value */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/memory/tegra/tegra234.c +++ linux-aws-6.5-6.5.0/drivers/memory/tegra/tegra234.c @@ -852,6 +852,10 @@ msg.rx.data = &bwmgr_resp; msg.rx.size = sizeof(bwmgr_resp); + if (pclient->bpmp_id >= TEGRA_ICC_BPMP_CPU_CLUSTER0 && + pclient->bpmp_id <= TEGRA_ICC_BPMP_CPU_CLUSTER2) + msg.flags = TEGRA_BPMP_MESSAGE_RESET; + ret = tegra_bpmp_transfer(mc->bpmp, &msg); if (ret < 0) { dev_err(mc->dev, "BPMP transfer failed: %d\n", ret); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mfd/arizona-spi.c +++ linux-aws-6.5-6.5.0/drivers/mfd/arizona-spi.c @@ -159,6 +159,9 @@ arizona->pdata.micd_ranges = arizona_micd_aosp_ranges; arizona->pdata.num_micd_ranges = ARRAY_SIZE(arizona_micd_aosp_ranges); + /* Use left headphone speaker for HP vs line-out detection */ + arizona->pdata.hpdet_channel = ARIZONA_ACCDET_MODE_HPL; + return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mfd/dln2.c +++ linux-aws-6.5-6.5.0/drivers/mfd/dln2.c @@ -826,7 +826,6 @@ dln2_stop_rx_urbs(dln2); out_free: - usb_put_dev(dln2->usb_dev); dln2_free(dln2); return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mfd/intel-lpss-pci.c +++ linux-aws-6.5-6.5.0/drivers/mfd/intel-lpss-pci.c @@ -561,6 +561,19 @@ { PCI_VDEVICE(INTEL, 0xa3e2), (kernel_ulong_t)&spt_i2c_info }, { PCI_VDEVICE(INTEL, 0xa3e3), (kernel_ulong_t)&spt_i2c_info }, { PCI_VDEVICE(INTEL, 0xa3e6), (kernel_ulong_t)&spt_uart_info }, + /* LNL-M */ + { PCI_VDEVICE(INTEL, 0xa825), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0xa826), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0xa827), (kernel_ulong_t)&tgl_info }, + { PCI_VDEVICE(INTEL, 0xa830), (kernel_ulong_t)&tgl_info }, + { PCI_VDEVICE(INTEL, 0xa846), (kernel_ulong_t)&tgl_info }, + { PCI_VDEVICE(INTEL, 0xa850), (kernel_ulong_t)&ehl_i2c_info }, + { PCI_VDEVICE(INTEL, 0xa851), (kernel_ulong_t)&ehl_i2c_info }, + { PCI_VDEVICE(INTEL, 0xa852), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0xa878), (kernel_ulong_t)&ehl_i2c_info }, + { PCI_VDEVICE(INTEL, 0xa879), (kernel_ulong_t)&ehl_i2c_info }, + { PCI_VDEVICE(INTEL, 0xa87a), (kernel_ulong_t)&ehl_i2c_info }, + { PCI_VDEVICE(INTEL, 0xa87b), (kernel_ulong_t)&ehl_i2c_info }, { } }; MODULE_DEVICE_TABLE(pci, intel_lpss_pci_ids); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mfd/mfd-core.c +++ linux-aws-6.5-6.5.0/drivers/mfd/mfd-core.c @@ -146,6 +146,7 @@ struct platform_device *pdev; struct device_node *np = NULL; struct mfd_of_node_entry *of_entry, *tmp; + bool disabled = false; int ret = -ENOMEM; int platform_id; int r; @@ -183,11 +184,10 @@ if (IS_ENABLED(CONFIG_OF) && parent->of_node && cell->of_compatible) { for_each_child_of_node(parent->of_node, np) { if (of_device_is_compatible(np, cell->of_compatible)) { - /* Ignore 'disabled' devices error free */ + /* Skip 'disabled' devices */ if (!of_device_is_available(np)) { - of_node_put(np); - ret = 0; - goto fail_alias; + disabled = true; + continue; } ret = mfd_match_of_node_to_dev(pdev, np, cell); @@ -197,10 +197,17 @@ if (ret) goto fail_alias; - break; + goto match; } } + if (disabled) { + /* Ignore 'disabled' devices error free */ + ret = 0; + goto fail_alias; + } + +match: if (!pdev->dev.of_node) pr_warn("%s: Failed to locate of_node [id: %d]\n", cell->name, platform_id); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mfd/qcom-spmi-pmic.c +++ linux-aws-6.5-6.5.0/drivers/mfd/qcom-spmi-pmic.c @@ -30,6 +30,8 @@ struct qcom_spmi_pmic pmic; }; +static DEFINE_MUTEX(pmic_spmi_revid_lock); + #define N_USIDS(n) ((void *)n) static const struct of_device_id pmic_spmi_id_table[] = { @@ -76,24 +78,21 @@ * * This only supports PMICs with 1 or 2 USIDs. */ -static struct spmi_device *qcom_pmic_get_base_usid(struct device *dev) +static struct spmi_device *qcom_pmic_get_base_usid(struct spmi_device *sdev, struct qcom_spmi_dev *ctx) { - struct spmi_device *sdev; - struct qcom_spmi_dev *ctx; struct device_node *spmi_bus; - struct device_node *other_usid = NULL; + struct device_node *child; int function_parent_usid, ret; u32 pmic_addr; - sdev = to_spmi_device(dev); - ctx = dev_get_drvdata(&sdev->dev); - /* * Quick return if the function device is already in the base * USID. This will always be hit for PMICs with only 1 USID. */ - if (sdev->usid % ctx->num_usids == 0) + if (sdev->usid % ctx->num_usids == 0) { + get_device(&sdev->dev); return sdev; + } function_parent_usid = sdev->usid; @@ -105,28 +104,61 @@ * device for USID 2. */ spmi_bus = of_get_parent(sdev->dev.of_node); - do { - other_usid = of_get_next_child(spmi_bus, other_usid); - - ret = of_property_read_u32_index(other_usid, "reg", 0, &pmic_addr); - if (ret) - return ERR_PTR(ret); + sdev = ERR_PTR(-ENODATA); + for_each_child_of_node(spmi_bus, child) { + ret = of_property_read_u32_index(child, "reg", 0, &pmic_addr); + if (ret) { + of_node_put(child); + sdev = ERR_PTR(ret); + break; + } - sdev = spmi_device_from_of(other_usid); if (pmic_addr == function_parent_usid - (ctx->num_usids - 1)) { - if (!sdev) + sdev = spmi_device_from_of(child); + if (!sdev) { /* - * If the base USID for this PMIC hasn't probed yet - * but the secondary USID has, then we need to defer - * the function driver so that it will attempt to - * probe again when the base USID is ready. + * If the base USID for this PMIC hasn't been + * registered yet then we need to defer. */ - return ERR_PTR(-EPROBE_DEFER); - return sdev; + sdev = ERR_PTR(-EPROBE_DEFER); + } + of_node_put(child); + break; } - } while (other_usid->sibling); + } + + of_node_put(spmi_bus); + + return sdev; +} + +static int pmic_spmi_get_base_revid(struct spmi_device *sdev, struct qcom_spmi_dev *ctx) +{ + struct qcom_spmi_dev *base_ctx; + struct spmi_device *base; + int ret = 0; + + base = qcom_pmic_get_base_usid(sdev, ctx); + if (IS_ERR(base)) + return PTR_ERR(base); - return ERR_PTR(-ENODATA); + /* + * Copy revid info from base device if it has probed and is still + * bound to its driver. + */ + mutex_lock(&pmic_spmi_revid_lock); + base_ctx = spmi_device_get_drvdata(base); + if (!base_ctx) { + ret = -EPROBE_DEFER; + goto out_unlock; + } + memcpy(&ctx->pmic, &base_ctx->pmic, sizeof(ctx->pmic)); +out_unlock: + mutex_unlock(&pmic_spmi_revid_lock); + + put_device(&base->dev); + + return ret; } static int pmic_spmi_load_revid(struct regmap *map, struct device *dev, @@ -204,11 +236,7 @@ if (!of_match_device(pmic_spmi_id_table, dev->parent)) return ERR_PTR(-EINVAL); - sdev = qcom_pmic_get_base_usid(dev->parent); - - if (IS_ERR(sdev)) - return ERR_CAST(sdev); - + sdev = to_spmi_device(dev->parent); spmi = dev_get_drvdata(&sdev->dev); return &spmi->pmic; @@ -243,16 +271,31 @@ ret = pmic_spmi_load_revid(regmap, &sdev->dev, &ctx->pmic); if (ret < 0) return ret; + } else { + ret = pmic_spmi_get_base_revid(sdev, ctx); + if (ret) + return ret; } + + mutex_lock(&pmic_spmi_revid_lock); spmi_device_set_drvdata(sdev, ctx); + mutex_unlock(&pmic_spmi_revid_lock); return devm_of_platform_populate(&sdev->dev); } +static void pmic_spmi_remove(struct spmi_device *sdev) +{ + mutex_lock(&pmic_spmi_revid_lock); + spmi_device_set_drvdata(sdev, NULL); + mutex_unlock(&pmic_spmi_revid_lock); +} + MODULE_DEVICE_TABLE(of, pmic_spmi_id_table); static struct spmi_driver pmic_spmi_driver = { .probe = pmic_spmi_probe, + .remove = pmic_spmi_remove, .driver = { .name = "pmic-spmi", .of_match_table = pmic_spmi_id_table, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/misc/mei/client.c +++ linux-aws-6.5-6.5.0/drivers/misc/mei/client.c @@ -2011,7 +2011,7 @@ mei_hdr = mei_msg_hdr_init(cb); if (IS_ERR(mei_hdr)) { - rets = -PTR_ERR(mei_hdr); + rets = PTR_ERR(mei_hdr); mei_hdr = NULL; goto err; } @@ -2032,7 +2032,7 @@ hbuf_slots = mei_hbuf_empty_slots(dev); if (hbuf_slots < 0) { - rets = -EOVERFLOW; + buf_len = -EOVERFLOW; goto out; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/misc/pci_endpoint_test.c +++ linux-aws-6.5-6.5.0/drivers/misc/pci_endpoint_test.c @@ -71,6 +71,7 @@ #define PCI_DEVICE_ID_TI_AM654 0xb00c #define PCI_DEVICE_ID_TI_J7200 0xb00f #define PCI_DEVICE_ID_TI_AM64 0xb010 +#define PCI_DEVICE_ID_TI_J721S2 0xb013 #define PCI_DEVICE_ID_LS1088A 0x80c0 #define PCI_DEVICE_ID_IMX8 0x0808 @@ -81,6 +82,7 @@ #define PCI_DEVICE_ID_RENESAS_R8A774B1 0x002b #define PCI_DEVICE_ID_RENESAS_R8A774C0 0x002d #define PCI_DEVICE_ID_RENESAS_R8A774E1 0x0025 +#define PCI_DEVICE_ID_RENESAS_R8A779F0 0x0031 static DEFINE_IDA(pci_endpoint_test_ida); @@ -990,6 +992,9 @@ { PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774B1),}, { PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774C0),}, { PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774E1),}, + { PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A779F0), + .driver_data = (kernel_ulong_t)&default_data, + }, { PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_J721E), .driver_data = (kernel_ulong_t)&j721e_data, }, @@ -999,6 +1004,9 @@ { PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_AM64), .driver_data = (kernel_ulong_t)&j721e_data, }, + { PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_J721S2), + .driver_data = (kernel_ulong_t)&j721e_data, + }, { } }; MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/misc/ti-st/st_core.c +++ linux-aws-6.5-6.5.0/drivers/misc/ti-st/st_core.c @@ -15,6 +15,7 @@ #include #include +#include extern void st_kim_recv(void *, const unsigned char *, long); void st_int_recv(void *, const unsigned char *, long); @@ -435,7 +436,7 @@ case ST_LL_AWAKE_TO_ASLEEP: pr_err("ST LL is illegal state(%ld)," "purging received skb.", st_ll_getstate(st_gdata)); - kfree_skb(skb); + dev_kfree_skb_irq(skb); break; case ST_LL_ASLEEP: skb_queue_tail(&st_gdata->tx_waitq, skb); @@ -444,7 +445,7 @@ default: pr_err("ST LL is illegal state(%ld)," "purging received skb.", st_ll_getstate(st_gdata)); - kfree_skb(skb); + dev_kfree_skb_irq(skb); break; } @@ -498,7 +499,7 @@ spin_unlock_irqrestore(&st_data->lock, flags); break; } - kfree_skb(skb); + dev_kfree_skb_irq(skb); spin_unlock_irqrestore(&st_data->lock, flags); } /* if wake-up is set in another context- restart sending */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/core/block.c +++ linux-aws-6.5-6.5.0/drivers/mmc/core/block.c @@ -179,6 +179,7 @@ struct mmc_queue *mq); static void mmc_blk_hsq_req_done(struct mmc_request *mrq); static int mmc_spi_err_check(struct mmc_card *card); +static int mmc_blk_busy_cb(void *cb_data, bool *busy); static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk) { @@ -470,7 +471,7 @@ struct mmc_data data = {}; struct mmc_request mrq = {}; struct scatterlist sg; - bool r1b_resp, use_r1b_resp = false; + bool r1b_resp; unsigned int busy_timeout_ms; int err; unsigned int target_part; @@ -551,8 +552,7 @@ busy_timeout_ms = idata->ic.cmd_timeout_ms ? : MMC_BLK_TIMEOUT_MS; r1b_resp = (cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B; if (r1b_resp) - use_r1b_resp = mmc_prepare_busy_cmd(card->host, &cmd, - busy_timeout_ms); + mmc_prepare_busy_cmd(card->host, &cmd, busy_timeout_ms); mmc_wait_for_req(card->host, &mrq); memcpy(&idata->ic.response, cmd.resp, sizeof(cmd.resp)); @@ -605,19 +605,28 @@ if (idata->ic.postsleep_min_us) usleep_range(idata->ic.postsleep_min_us, idata->ic.postsleep_max_us); - /* No need to poll when using HW busy detection. */ - if ((card->host->caps & MMC_CAP_WAIT_WHILE_BUSY) && use_r1b_resp) - return 0; - if (mmc_host_is_spi(card->host)) { if (idata->ic.write_flag || r1b_resp || cmd.flags & MMC_RSP_SPI_BUSY) return mmc_spi_err_check(card); return err; } - /* Ensure RPMB/R1B command has completed by polling with CMD13. */ - if (idata->rpmb || r1b_resp) - err = mmc_poll_for_busy(card, busy_timeout_ms, false, - MMC_BUSY_IO); + + /* + * Ensure RPMB, writes and R1B responses are completed by polling with + * CMD13. Note that, usually we don't need to poll when using HW busy + * detection, but here it's needed since some commands may indicate the + * error through the R1 status bits. + */ + if (idata->rpmb || idata->ic.write_flag || r1b_resp) { + struct mmc_blk_busy_data cb_data = { + .card = card, + }; + + err = __mmc_poll_for_busy(card->host, 0, busy_timeout_ms, + &mmc_blk_busy_cb, &cb_data); + + idata->ic.response[0] = cb_data.status; + } return err; } @@ -1481,6 +1490,8 @@ blk_mq_requeue_request(req, true); else __blk_mq_end_request(req, BLK_STS_OK); + } else if (mq->in_recovery) { + blk_mq_requeue_request(req, true); } else { blk_mq_end_request(req, BLK_STS_OK); } @@ -2380,8 +2391,10 @@ } ret = mmc_blk_cqe_issue_flush(mq, req); break; - case REQ_OP_READ: case REQ_OP_WRITE: + card->written_flag = true; + fallthrough; + case REQ_OP_READ: if (host->cqe_enabled) ret = mmc_blk_cqe_issue_rw_rq(mq, req); else only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/core/card.h +++ linux-aws-6.5-6.5.0/drivers/mmc/core/card.h @@ -280,4 +280,8 @@ return c->quirks & MMC_QUIRK_BROKEN_SD_CACHE; } +static inline int mmc_card_broken_cache_flush(const struct mmc_card *c) +{ + return c->quirks & MMC_QUIRK_BROKEN_CACHE_FLUSH; +} #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/core/core.c +++ linux-aws-6.5-6.5.0/drivers/mmc/core/core.c @@ -551,7 +551,9 @@ cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; cmd.flags &= ~MMC_RSP_CRC; /* Ignore CRC */ cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT; - mmc_wait_for_cmd(host, &cmd, 0); + mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); + + mmc_poll_for_busy(host->card, MMC_CQE_RECOVERY_TIMEOUT, true, MMC_BUSY_IO); memset(&cmd, 0, sizeof(cmd)); cmd.opcode = MMC_CMDQ_TASK_MGMT; @@ -559,10 +561,13 @@ cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; cmd.flags &= ~MMC_RSP_CRC; /* Ignore CRC */ cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT; - err = mmc_wait_for_cmd(host, &cmd, 0); + err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); host->cqe_ops->cqe_recovery_finish(host); + if (err) + err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); + mmc_retune_release(host); return err; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/core/mmc.c +++ linux-aws-6.5-6.5.0/drivers/mmc/core/mmc.c @@ -2081,13 +2081,17 @@ { int err = 0; + if (mmc_card_broken_cache_flush(host->card) && !host->card->written_flag) + return 0; + if (_mmc_cache_enabled(host)) { err = mmc_switch(host->card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_FLUSH_CACHE, 1, CACHE_FLUSH_TIMEOUT_MS); if (err) - pr_err("%s: cache flush error %d\n", - mmc_hostname(host), err); + pr_err("%s: cache flush error %d\n", mmc_hostname(host), err); + else + host->card->written_flag = false; } return err; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/core/quirks.h +++ linux-aws-6.5-6.5.0/drivers/mmc/core/quirks.h @@ -110,11 +110,12 @@ MMC_QUIRK_TRIM_BROKEN), /* - * Micron MTFC4GACAJCN-1M advertises TRIM but it does not seems to - * support being used to offload WRITE_ZEROES. + * Micron MTFC4GACAJCN-1M supports TRIM but does not appear to support + * WRITE_ZEROES offloading. It also supports caching, but the cache can + * only be flushed after a write has occurred. */ MMC_FIXUP("Q2J54A", CID_MANFID_MICRON, 0x014e, add_quirk_mmc, - MMC_QUIRK_TRIM_BROKEN), + MMC_QUIRK_TRIM_BROKEN | MMC_QUIRK_BROKEN_CACHE_FLUSH), /* * Kingston EMMC04G-M627 advertises TRIM but it does not seems to only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/core/sdio.c +++ linux-aws-6.5-6.5.0/drivers/mmc/core/sdio.c @@ -1089,8 +1089,14 @@ } err = mmc_sdio_reinit_card(host); } else if (mmc_card_wake_sdio_irq(host)) { - /* We may have switched to 1-bit mode during suspend */ + /* + * We may have switched to 1-bit mode during suspend, + * need to hold retuning, because tuning only supprt + * 4-bit mode or 8 bit mode. + */ + mmc_retune_hold_now(host); err = sdio_enable_4bit_bus(host->card); + mmc_retune_release(host); } if (err) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/host/cqhci-core.c +++ linux-aws-6.5-6.5.0/drivers/mmc/host/cqhci-core.c @@ -942,8 +942,8 @@ ret = cqhci_tasks_cleared(cq_host); if (!ret) - pr_debug("%s: cqhci: Failed to clear tasks\n", - mmc_hostname(mmc)); + pr_warn("%s: cqhci: Failed to clear tasks\n", + mmc_hostname(mmc)); return ret; } @@ -976,7 +976,7 @@ ret = cqhci_halted(cq_host); if (!ret) - pr_debug("%s: cqhci: Failed to halt\n", mmc_hostname(mmc)); + pr_warn("%s: cqhci: Failed to halt\n", mmc_hostname(mmc)); return ret; } @@ -984,10 +984,10 @@ /* * After halting we expect to be able to use the command line. We interpret the * failure to halt to mean the data lines might still be in use (and the upper - * layers will need to send a STOP command), so we set the timeout based on a - * generous command timeout. + * layers will need to send a STOP command), however failing to halt complicates + * the recovery, so set a timeout that would reasonably allow I/O to complete. */ -#define CQHCI_START_HALT_TIMEOUT 5 +#define CQHCI_START_HALT_TIMEOUT 500 static void cqhci_recovery_start(struct mmc_host *mmc) { @@ -1075,28 +1075,28 @@ ok = cqhci_halt(mmc, CQHCI_FINISH_HALT_TIMEOUT); - if (!cqhci_clear_all_tasks(mmc, CQHCI_CLEAR_TIMEOUT)) - ok = false; - /* * The specification contradicts itself, by saying that tasks cannot be * cleared if CQHCI does not halt, but if CQHCI does not halt, it should * be disabled/re-enabled, but not to disable before clearing tasks. * Have a go anyway. */ - if (!ok) { - pr_debug("%s: cqhci: disable / re-enable\n", mmc_hostname(mmc)); - cqcfg = cqhci_readl(cq_host, CQHCI_CFG); - cqcfg &= ~CQHCI_ENABLE; - cqhci_writel(cq_host, cqcfg, CQHCI_CFG); - cqcfg |= CQHCI_ENABLE; - cqhci_writel(cq_host, cqcfg, CQHCI_CFG); - /* Be sure that there are no tasks */ - ok = cqhci_halt(mmc, CQHCI_FINISH_HALT_TIMEOUT); - if (!cqhci_clear_all_tasks(mmc, CQHCI_CLEAR_TIMEOUT)) - ok = false; - WARN_ON(!ok); - } + if (!cqhci_clear_all_tasks(mmc, CQHCI_CLEAR_TIMEOUT)) + ok = false; + + /* Disable to make sure tasks really are cleared */ + cqcfg = cqhci_readl(cq_host, CQHCI_CFG); + cqcfg &= ~CQHCI_ENABLE; + cqhci_writel(cq_host, cqcfg, CQHCI_CFG); + + cqcfg = cqhci_readl(cq_host, CQHCI_CFG); + cqcfg |= CQHCI_ENABLE; + cqhci_writel(cq_host, cqcfg, CQHCI_CFG); + + cqhci_halt(mmc, CQHCI_FINISH_HALT_TIMEOUT); + + if (!ok) + cqhci_clear_all_tasks(mmc, CQHCI_CLEAR_TIMEOUT); cqhci_recover_mrqs(cq_host); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/host/meson-gx-mmc.c +++ linux-aws-6.5-6.5.0/drivers/mmc/host/meson-gx-mmc.c @@ -801,7 +801,6 @@ cmd_cfg |= FIELD_PREP(CMD_CFG_CMD_INDEX_MASK, cmd->opcode); cmd_cfg |= CMD_CFG_OWNER; /* owned by CPU */ - cmd_cfg |= CMD_CFG_ERROR; /* stop in case of error */ meson_mmc_set_response_bits(cmd, &cmd_cfg); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/host/mtk-sd.c +++ linux-aws-6.5-6.5.0/drivers/mmc/host/mtk-sd.c @@ -671,11 +671,11 @@ u32 val; sdr_set_bits(host->base + MSDC_CFG, MSDC_CFG_RST); - readl_poll_timeout(host->base + MSDC_CFG, val, !(val & MSDC_CFG_RST), 0, 0); + readl_poll_timeout_atomic(host->base + MSDC_CFG, val, !(val & MSDC_CFG_RST), 0, 0); sdr_set_bits(host->base + MSDC_FIFOCS, MSDC_FIFOCS_CLR); - readl_poll_timeout(host->base + MSDC_FIFOCS, val, - !(val & MSDC_FIFOCS_CLR), 0, 0); + readl_poll_timeout_atomic(host->base + MSDC_FIFOCS, val, + !(val & MSDC_FIFOCS_CLR), 0, 0); val = readl(host->base + MSDC_INT); writel(val, host->base + MSDC_INT); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/host/sdhci-pci-gli.c +++ linux-aws-6.5-6.5.0/drivers/mmc/host/sdhci-pci-gli.c @@ -25,6 +25,12 @@ #define GLI_9750_WT_EN_ON 0x1 #define GLI_9750_WT_EN_OFF 0x0 +#define PCI_GLI_9750_PM_CTRL 0xFC +#define PCI_GLI_9750_PM_STATE GENMASK(1, 0) + +#define PCI_GLI_9750_CORRERR_MASK 0x214 +#define PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT BIT(12) + #define SDHCI_GLI_9750_CFG2 0x848 #define SDHCI_GLI_9750_CFG2_L1DLY GENMASK(28, 24) #define GLI_9750_CFG2_L1DLY_VALUE 0x1F @@ -149,6 +155,9 @@ #define PCI_GLI_9755_PM_CTRL 0xFC #define PCI_GLI_9755_PM_STATE GENMASK(1, 0) +#define PCI_GLI_9755_CORRERR_MASK 0x214 +#define PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT BIT(12) + #define SDHCI_GLI_9767_GM_BURST_SIZE 0x510 #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) @@ -536,8 +545,12 @@ static void gl9750_hw_setting(struct sdhci_host *host) { + struct sdhci_pci_slot *slot = sdhci_priv(host); + struct pci_dev *pdev; u32 value; + pdev = slot->chip->pdev; + gl9750_wt_on(host); value = sdhci_readl(host, SDHCI_GLI_9750_CFG2); @@ -547,6 +560,18 @@ GLI_9750_CFG2_L1DLY_VALUE); sdhci_writel(host, value, SDHCI_GLI_9750_CFG2); + /* toggle PM state to allow GL9750 to enter ASPM L1.2 */ + pci_read_config_dword(pdev, PCI_GLI_9750_PM_CTRL, &value); + value |= PCI_GLI_9750_PM_STATE; + pci_write_config_dword(pdev, PCI_GLI_9750_PM_CTRL, value); + value &= ~PCI_GLI_9750_PM_STATE; + pci_write_config_dword(pdev, PCI_GLI_9750_PM_CTRL, value); + + /* mask the replay timer timeout of AER */ + pci_read_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, &value); + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); + gl9750_wt_off(host); } @@ -756,6 +781,11 @@ value &= ~PCI_GLI_9755_PM_STATE; pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, value); + /* mask the replay timer timeout of AER */ + pci_read_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, &value); + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); + gl9755_wt_off(pdev); } @@ -1144,42 +1174,6 @@ return value; } -#ifdef CONFIG_PM_SLEEP -static int sdhci_pci_gli_resume(struct sdhci_pci_chip *chip) -{ - struct sdhci_pci_slot *slot = chip->slots[0]; - - pci_free_irq_vectors(slot->chip->pdev); - gli_pcie_enable_msi(slot); - - return sdhci_pci_resume_host(chip); -} - -static int sdhci_cqhci_gli_resume(struct sdhci_pci_chip *chip) -{ - struct sdhci_pci_slot *slot = chip->slots[0]; - int ret; - - ret = sdhci_pci_gli_resume(chip); - if (ret) - return ret; - - return cqhci_resume(slot->host->mmc); -} - -static int sdhci_cqhci_gli_suspend(struct sdhci_pci_chip *chip) -{ - struct sdhci_pci_slot *slot = chip->slots[0]; - int ret; - - ret = cqhci_suspend(slot->host->mmc); - if (ret) - return ret; - - return sdhci_suspend_host(slot->host); -} -#endif - static void gl9763e_hs400_enhanced_strobe(struct mmc_host *mmc, struct mmc_ios *ios) { @@ -1195,6 +1189,32 @@ sdhci_writel(host, val, SDHCI_GLI_9763E_HS400_ES_REG); } +static void gl9763e_set_low_power_negotiation(struct sdhci_pci_slot *slot, + bool enable) +{ + struct pci_dev *pdev = slot->chip->pdev; + u32 value; + + pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value); + value &= ~GLI_9763E_VHS_REV; + value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_W); + pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value); + + pci_read_config_dword(pdev, PCIE_GLI_9763E_CFG, &value); + + if (enable) + value &= ~GLI_9763E_CFG_LPSN_DIS; + else + value |= GLI_9763E_CFG_LPSN_DIS; + + pci_write_config_dword(pdev, PCIE_GLI_9763E_CFG, value); + + pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value); + value &= ~GLI_9763E_VHS_REV; + value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_R); + pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value); +} + static void sdhci_set_gl9763e_signaling(struct sdhci_host *host, unsigned int timing) { @@ -1303,6 +1323,9 @@ if (ret) goto cleanup; + /* Disable LPM negotiation to avoid entering L1 state. */ + gl9763e_set_low_power_negotiation(slot, false); + return 0; cleanup: @@ -1346,31 +1369,6 @@ } #ifdef CONFIG_PM -static void gl9763e_set_low_power_negotiation(struct sdhci_pci_slot *slot, bool enable) -{ - struct pci_dev *pdev = slot->chip->pdev; - u32 value; - - pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value); - value &= ~GLI_9763E_VHS_REV; - value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_W); - pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value); - - pci_read_config_dword(pdev, PCIE_GLI_9763E_CFG, &value); - - if (enable) - value &= ~GLI_9763E_CFG_LPSN_DIS; - else - value |= GLI_9763E_CFG_LPSN_DIS; - - pci_write_config_dword(pdev, PCIE_GLI_9763E_CFG, value); - - pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value); - value &= ~GLI_9763E_VHS_REV; - value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_R); - pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value); -} - static int gl9763e_runtime_suspend(struct sdhci_pci_chip *chip) { struct sdhci_pci_slot *slot = chip->slots[0]; @@ -1420,6 +1418,70 @@ } #endif +#ifdef CONFIG_PM_SLEEP +static int sdhci_pci_gli_resume(struct sdhci_pci_chip *chip) +{ + struct sdhci_pci_slot *slot = chip->slots[0]; + + pci_free_irq_vectors(slot->chip->pdev); + gli_pcie_enable_msi(slot); + + return sdhci_pci_resume_host(chip); +} + +static int gl9763e_resume(struct sdhci_pci_chip *chip) +{ + struct sdhci_pci_slot *slot = chip->slots[0]; + int ret; + + ret = sdhci_pci_gli_resume(chip); + if (ret) + return ret; + + ret = cqhci_resume(slot->host->mmc); + if (ret) + return ret; + + /* + * Disable LPM negotiation to bring device back in sync + * with its runtime_pm state. + */ + gl9763e_set_low_power_negotiation(slot, false); + + return 0; +} + +static int gl9763e_suspend(struct sdhci_pci_chip *chip) +{ + struct sdhci_pci_slot *slot = chip->slots[0]; + int ret; + + /* + * Certain SoCs can suspend only with the bus in low- + * power state, notably x86 SoCs when using S0ix. + * Re-enable LPM negotiation to allow entering L1 state + * and entering system suspend. + */ + gl9763e_set_low_power_negotiation(slot, true); + + ret = cqhci_suspend(slot->host->mmc); + if (ret) + goto err_suspend; + + ret = sdhci_suspend_host(slot->host); + if (ret) + goto err_suspend_host; + + return 0; + +err_suspend_host: + cqhci_resume(slot->host->mmc); +err_suspend: + gl9763e_set_low_power_negotiation(slot, false); + return ret; +} +#endif + static int gli_probe_slot_gl9763e(struct sdhci_pci_slot *slot) { struct pci_dev *pdev = slot->chip->pdev; @@ -1527,8 +1589,8 @@ .probe_slot = gli_probe_slot_gl9763e, .ops = &sdhci_gl9763e_ops, #ifdef CONFIG_PM_SLEEP - .resume = sdhci_cqhci_gli_resume, - .suspend = sdhci_cqhci_gli_suspend, + .resume = gl9763e_resume, + .suspend = gl9763e_suspend, #endif #ifdef CONFIG_PM .runtime_suspend = gl9763e_runtime_suspend, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/host/sdhci-sprd.c +++ linux-aws-6.5-6.5.0/drivers/mmc/host/sdhci-sprd.c @@ -405,12 +405,33 @@ mmc_request_done(host->mmc, mrq); } +static void sdhci_sprd_set_power(struct sdhci_host *host, unsigned char mode, + unsigned short vdd) +{ + struct mmc_host *mmc = host->mmc; + + switch (mode) { + case MMC_POWER_OFF: + mmc_regulator_set_ocr(host->mmc, mmc->supply.vmmc, 0); + + mmc_regulator_disable_vqmmc(mmc); + break; + case MMC_POWER_ON: + mmc_regulator_enable_vqmmc(mmc); + break; + case MMC_POWER_UP: + mmc_regulator_set_ocr(host->mmc, mmc->supply.vmmc, vdd); + break; + } +} + static struct sdhci_ops sdhci_sprd_ops = { .read_l = sdhci_sprd_readl, .write_l = sdhci_sprd_writel, .write_w = sdhci_sprd_writew, .write_b = sdhci_sprd_writeb, .set_clock = sdhci_sprd_set_clock, + .set_power = sdhci_sprd_set_power, .get_max_clock = sdhci_sprd_get_max_clock, .get_min_clock = sdhci_sprd_get_min_clock, .set_bus_width = sdhci_set_bus_width, @@ -674,6 +695,10 @@ host->caps1 &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_DDR50); + ret = mmc_regulator_get_supply(host->mmc); + if (ret) + goto pm_runtime_disable; + ret = sdhci_setup_host(host); if (ret) goto pm_runtime_disable; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/host/sdhci_am654.c +++ linux-aws-6.5-6.5.0/drivers/mmc/host/sdhci_am654.c @@ -598,7 +598,7 @@ return 0; } - for (i = MMC_TIMING_MMC_HS; i <= MMC_TIMING_MMC_HS400; i++) { + for (i = MMC_TIMING_LEGACY; i <= MMC_TIMING_MMC_HS400; i++) { ret = device_property_read_u32(dev, td[i].otap_binding, &sdhci_am654->otap_del_sel[i]); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mmc/host/vub300.c +++ linux-aws-6.5-6.5.0/drivers/mmc/host/vub300.c @@ -2309,6 +2309,7 @@ vub300->read_only = (0x0010 & vub300->system_port_status.port_flags) ? 1 : 0; } else { + retval = -EINVAL; goto error5; } usb_set_intfdata(interface, vub300); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/chips/cfi_cmdset_0001.c +++ linux-aws-6.5-6.5.0/drivers/mtd/chips/cfi_cmdset_0001.c @@ -422,9 +422,25 @@ extra_size = 0; /* Protection Register info */ - if (extp->NumProtectionFields) + if (extp->NumProtectionFields) { + struct cfi_intelext_otpinfo *otp = + (struct cfi_intelext_otpinfo *)&extp->extra[0]; + extra_size += (extp->NumProtectionFields - 1) * - sizeof(struct cfi_intelext_otpinfo); + sizeof(struct cfi_intelext_otpinfo); + + if (extp_size >= sizeof(*extp) + extra_size) { + int i; + + /* Do some byteswapping if necessary */ + for (i = 0; i < extp->NumProtectionFields - 1; i++) { + otp->ProtRegAddr = le32_to_cpu(otp->ProtRegAddr); + otp->FactGroups = le16_to_cpu(otp->FactGroups); + otp->UserGroups = le16_to_cpu(otp->UserGroups); + otp++; + } + } + } } if (extp->MinorVersion >= '1') { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/maps/physmap-core.c +++ linux-aws-6.5-6.5.0/drivers/mtd/maps/physmap-core.c @@ -552,6 +552,17 @@ if (info->probe_type) { info->mtds[i] = do_map_probe(info->probe_type, &info->maps[i]); + + /* Fall back to mapping region as ROM */ + if (!info->mtds[i] && IS_ENABLED(CONFIG_MTD_ROM) && + strcmp(info->probe_type, "map_rom")) { + dev_warn(&dev->dev, + "map_probe() failed for type %s\n", + info->probe_type); + + info->mtds[i] = do_map_probe("map_rom", + &info->maps[i]); + } } else { int j; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/raw/arasan-nand-controller.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/raw/arasan-nand-controller.c @@ -515,6 +515,7 @@ struct mtd_info *mtd = nand_to_mtd(chip); unsigned int len = mtd->writesize + (oob_required ? mtd->oobsize : 0); dma_addr_t dma_addr; + u8 status; int ret; struct anfc_op nfc_op = { .pkt_reg = @@ -561,10 +562,21 @@ } /* Spare data is not protected */ - if (oob_required) + if (oob_required) { ret = nand_write_oob_std(chip, page); + if (ret) + return ret; + } + + /* Check write status on the chip side */ + ret = nand_status_op(chip, &status); + if (ret) + return ret; + + if (status & NAND_STATUS_FAIL) + return -EIO; - return ret; + return 0; } static int anfc_sel_write_page_hw_ecc(struct nand_chip *chip, const u8 *buf, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/raw/intel-nand-controller.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/raw/intel-nand-controller.c @@ -619,6 +619,11 @@ ebu_host->cs_num = cs; resname = devm_kasprintf(dev, GFP_KERNEL, "nand_cs%d", cs); + if (!resname) { + ret = -ENOMEM; + goto err_of_node_put; + } + ebu_host->cs[cs].chipaddr = devm_platform_ioremap_resource_byname(pdev, resname); if (IS_ERR(ebu_host->cs[cs].chipaddr)) { @@ -655,6 +660,11 @@ } resname = devm_kasprintf(dev, GFP_KERNEL, "addr_sel%d", cs); + if (!resname) { + ret = -ENOMEM; + goto err_cleanup_dma; + } + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, resname); if (!res) { ret = -EINVAL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/raw/marvell_nand.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/raw/marvell_nand.c @@ -1162,6 +1162,7 @@ .ndcb[2] = NDCB2_ADDR5_PAGE(page), }; unsigned int oob_bytes = lt->spare_bytes + (raw ? lt->ecc_bytes : 0); + u8 status; int ret; /* NFCv2 needs more information about the operation being executed */ @@ -1195,7 +1196,18 @@ ret = marvell_nfc_wait_op(chip, PSEC_TO_MSEC(sdr->tPROG_max)); - return ret; + if (ret) + return ret; + + /* Check write status on the chip side */ + ret = nand_status_op(chip, &status); + if (ret) + return ret; + + if (status & NAND_STATUS_FAIL) + return -EIO; + + return 0; } static int marvell_nfc_hw_ecc_hmg_write_page_raw(struct nand_chip *chip, @@ -1624,6 +1636,7 @@ int data_len = lt->data_bytes; int spare_len = lt->spare_bytes; int chunk, ret; + u8 status; marvell_nfc_select_target(chip, chip->cur_cs); @@ -1660,6 +1673,14 @@ if (ret) return ret; + /* Check write status on the chip side */ + ret = nand_status_op(chip, &status); + if (ret) + return ret; + + if (status & NAND_STATUS_FAIL) + return -EIO; + return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/raw/meson_nand.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/raw/meson_nand.c @@ -1115,6 +1115,9 @@ init.name = devm_kasprintf(nfc->dev, GFP_KERNEL, "%s#div", dev_name(nfc->dev)); + if (!init.name) + return -ENOMEM; + init.ops = &clk_divider_ops; nfc_divider_parent_data[0].fw_name = "device"; init.parent_data = nfc_divider_parent_data; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/raw/nand_base.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/raw/nand_base.c @@ -5109,6 +5109,9 @@ { struct mtd_info *mtd = nand_to_mtd(chip); + if (!chip->parameters.supports_read_cache) + return; + if (chip->read_retries) return; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/raw/nand_jedec.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/raw/nand_jedec.c @@ -94,6 +94,9 @@ goto free_jedec_param_page; } + if (p->opt_cmd[0] & JEDEC_OPT_CMD_READ_CACHE) + chip->parameters.supports_read_cache = true; + memorg->pagesize = le32_to_cpu(p->byte_per_page); mtd->writesize = memorg->pagesize; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/raw/nand_onfi.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/raw/nand_onfi.c @@ -303,6 +303,9 @@ ONFI_FEATURE_ADDR_TIMING_MODE, 1); } + if (le16_to_cpu(p->opt_cmd) & ONFI_OPT_CMD_READ_CACHE) + chip->parameters.supports_read_cache = true; + onfi = kzalloc(sizeof(*onfi), GFP_KERNEL); if (!onfi) { ret = -ENOMEM; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/raw/pl35x-nand-controller.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/raw/pl35x-nand-controller.c @@ -513,6 +513,7 @@ u32 addr1 = 0, addr2 = 0, row; u32 cmd_addr; int i, ret; + u8 status; ret = pl35x_smc_set_ecc_mode(nfc, chip, PL35X_SMC_ECC_CFG_MODE_APB); if (ret) @@ -565,6 +566,14 @@ if (ret) goto disable_ecc_engine; + /* Check write status on the chip side */ + ret = nand_status_op(chip, &status); + if (ret) + goto disable_ecc_engine; + + if (status & NAND_STATUS_FAIL) + ret = -EIO; + disable_ecc_engine: pl35x_smc_set_ecc_mode(nfc, chip, PL35X_SMC_ECC_CFG_MODE_BYPASS); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/raw/qcom_nandc.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/raw/qcom_nandc.c @@ -3309,7 +3309,7 @@ err_aon_clk: clk_disable_unprepare(nandc->core_clk); err_core_clk: - dma_unmap_resource(dev, res->start, resource_size(res), + dma_unmap_resource(dev, nandc->base_dma, resource_size(res), DMA_BIDIRECTIONAL, 0); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/raw/tegra_nand.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/raw/tegra_nand.c @@ -1197,6 +1197,10 @@ init_completion(&ctrl->dma_complete); ctrl->irq = platform_get_irq(pdev, 0); + if (ctrl->irq < 0) { + err = ctrl->irq; + goto err_put_pm; + } err = devm_request_irq(&pdev->dev, ctrl->irq, tegra_nand_irq, 0, dev_name(&pdev->dev), ctrl); if (err) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/mtd/nand/spi/micron.c +++ linux-aws-6.5-6.5.0/drivers/mtd/nand/spi/micron.c @@ -12,7 +12,7 @@ #define SPINAND_MFR_MICRON 0x2c -#define MICRON_STATUS_ECC_MASK GENMASK(7, 4) +#define MICRON_STATUS_ECC_MASK GENMASK(6, 4) #define MICRON_STATUS_ECC_NO_BITFLIPS (0 << 4) #define MICRON_STATUS_ECC_1TO3_BITFLIPS (1 << 4) #define MICRON_STATUS_ECC_4TO6_BITFLIPS (3 << 4) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/arcnet/arcdevice.h +++ linux-aws-6.5-6.5.0/drivers/net/arcnet/arcdevice.h @@ -186,6 +186,8 @@ #define ARC_IS_5MBIT 1 /* card default speed is 5MBit */ #define ARC_CAN_10MBIT 2 /* card uses COM20022, supporting 10MBit, but default is 2.5MBit. */ +#define ARC_HAS_LED 4 /* card has software controlled LEDs */ +#define ARC_HAS_ROTARY 8 /* card has rotary encoder */ /* information needed to define an encapsulation driver */ struct ArcProto { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/arcnet/com20020-pci.c +++ linux-aws-6.5-6.5.0/drivers/net/arcnet/com20020-pci.c @@ -213,12 +213,13 @@ if (!strncmp(ci->name, "EAE PLX-PCI FB2", 15)) lp->backplane = 1; - /* Get the dev_id from the PLX rotary coder */ - if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15)) - dev_id_mask = 0x3; - dev->dev_id = (inb(priv->misc + ci->rotary) >> 4) & dev_id_mask; - - snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i); + if (ci->flags & ARC_HAS_ROTARY) { + /* Get the dev_id from the PLX rotary coder */ + if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15)) + dev_id_mask = 0x3; + dev->dev_id = (inb(priv->misc + ci->rotary) >> 4) & dev_id_mask; + snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i); + } if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) { pr_err("IO address %Xh is empty!\n", ioaddr); @@ -230,6 +231,10 @@ goto err_free_arcdev; } + ret = com20020_found(dev, IRQF_SHARED); + if (ret) + goto err_free_arcdev; + card = devm_kzalloc(&pdev->dev, sizeof(struct com20020_dev), GFP_KERNEL); if (!card) { @@ -239,41 +244,39 @@ card->index = i; card->pci_priv = priv; - card->tx_led.brightness_set = led_tx_set; - card->tx_led.default_trigger = devm_kasprintf(&pdev->dev, - GFP_KERNEL, "arc%d-%d-tx", - dev->dev_id, i); - card->tx_led.name = devm_kasprintf(&pdev->dev, GFP_KERNEL, - "pci:green:tx:%d-%d", - dev->dev_id, i); - - card->tx_led.dev = &dev->dev; - card->recon_led.brightness_set = led_recon_set; - card->recon_led.default_trigger = devm_kasprintf(&pdev->dev, - GFP_KERNEL, "arc%d-%d-recon", - dev->dev_id, i); - card->recon_led.name = devm_kasprintf(&pdev->dev, GFP_KERNEL, - "pci:red:recon:%d-%d", - dev->dev_id, i); - card->recon_led.dev = &dev->dev; - card->dev = dev; - - ret = devm_led_classdev_register(&pdev->dev, &card->tx_led); - if (ret) - goto err_free_arcdev; - - ret = devm_led_classdev_register(&pdev->dev, &card->recon_led); - if (ret) - goto err_free_arcdev; - - dev_set_drvdata(&dev->dev, card); - ret = com20020_found(dev, IRQF_SHARED); - if (ret) - goto err_free_arcdev; + if (ci->flags & ARC_HAS_LED) { + card->tx_led.brightness_set = led_tx_set; + card->tx_led.default_trigger = devm_kasprintf(&pdev->dev, + GFP_KERNEL, "arc%d-%d-tx", + dev->dev_id, i); + card->tx_led.name = devm_kasprintf(&pdev->dev, GFP_KERNEL, + "pci:green:tx:%d-%d", + dev->dev_id, i); + + card->tx_led.dev = &dev->dev; + card->recon_led.brightness_set = led_recon_set; + card->recon_led.default_trigger = devm_kasprintf(&pdev->dev, + GFP_KERNEL, "arc%d-%d-recon", + dev->dev_id, i); + card->recon_led.name = devm_kasprintf(&pdev->dev, GFP_KERNEL, + "pci:red:recon:%d-%d", + dev->dev_id, i); + card->recon_led.dev = &dev->dev; + + ret = devm_led_classdev_register(&pdev->dev, &card->tx_led); + if (ret) + goto err_free_arcdev; + + ret = devm_led_classdev_register(&pdev->dev, &card->recon_led); + if (ret) + goto err_free_arcdev; - devm_arcnet_led_init(dev, dev->dev_id, i); + dev_set_drvdata(&dev->dev, card); + devm_arcnet_led_init(dev, dev->dev_id, i); + } + card->dev = dev; list_add(&card->list, &priv->list_dev); continue; @@ -329,7 +332,7 @@ }; static struct com20020_pci_card_info card_info_sohard = { - .name = "PLX-PCI", + .name = "SOHARD SH ARC-PCI", .devcount = 1, /* SOHARD needs PCI base addr 4 */ .chan_map_tbl = { @@ -364,7 +367,7 @@ }, }, .rotary = 0x0, - .flags = ARC_CAN_10MBIT, + .flags = ARC_HAS_ROTARY | ARC_HAS_LED | ARC_CAN_10MBIT, }; static struct com20020_pci_card_info card_info_eae_ma1 = { @@ -396,7 +399,7 @@ }, }, .rotary = 0x0, - .flags = ARC_CAN_10MBIT, + .flags = ARC_HAS_ROTARY | ARC_HAS_LED | ARC_CAN_10MBIT, }; static struct com20020_pci_card_info card_info_eae_fb2 = { @@ -421,7 +424,7 @@ }, }, .rotary = 0x0, - .flags = ARC_CAN_10MBIT, + .flags = ARC_HAS_ROTARY | ARC_HAS_LED | ARC_CAN_10MBIT, }; static const struct pci_device_id com20020pci_id_table[] = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/bonding/bond_main.c +++ linux-aws-6.5-6.5.0/drivers/net/bonding/bond_main.c @@ -1499,6 +1499,10 @@ static void bond_setup_by_slave(struct net_device *bond_dev, struct net_device *slave_dev) { + bool was_up = !!(bond_dev->flags & IFF_UP); + + dev_close(bond_dev); + bond_dev->header_ops = slave_dev->header_ops; bond_dev->type = slave_dev->type; @@ -1513,6 +1517,8 @@ bond_dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST); bond_dev->flags |= (IFF_POINTOPOINT | IFF_NOARP); } + if (was_up) + dev_open(bond_dev, NULL); } /* On bonding slaves other than the currently active slave, suppress @@ -4022,7 +4028,7 @@ if (likely(n <= hlen)) return data; else if (skb && likely(pskb_may_pull(skb, n))) - return skb->head; + return skb->data; return NULL; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/can/dev/dev.c +++ linux-aws-6.5-6.5.0/drivers/net/can/dev/dev.c @@ -132,7 +132,8 @@ struct can_frame *cf; int err; - BUG_ON(netif_carrier_ok(dev)); + if (netif_carrier_ok(dev)) + netdev_err(dev, "Attempt to restart for bus-off recovery, but carrier is OK?\n"); /* No synchronization needed because the device is bus-off and * no messages can come in or go out. @@ -153,11 +154,12 @@ priv->can_stats.restarts++; /* Now restart the device */ - err = priv->do_set_mode(dev, CAN_MODE_START); - netif_carrier_on(dev); - if (err) + err = priv->do_set_mode(dev, CAN_MODE_START); + if (err) { netdev_err(dev, "Error %d during restart", err); + netif_carrier_off(dev); + } } static void can_restart_work(struct work_struct *work) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/can/dev/skb.c +++ linux-aws-6.5-6.5.0/drivers/net/can/dev/skb.c @@ -49,7 +49,11 @@ { struct can_priv *priv = netdev_priv(dev); - BUG_ON(idx >= priv->echo_skb_max); + if (idx >= priv->echo_skb_max) { + netdev_err(dev, "%s: BUG! Trying to access can_priv::echo_skb out of bounds (%u/max %u)\n", + __func__, idx, priv->echo_skb_max); + return -EINVAL; + } /* check flag whether this packet has to be looped back */ if (!(dev->flags & IFF_ECHO) || only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/can/flexcan/flexcan-core.c +++ linux-aws-6.5-6.5.0/drivers/net/can/flexcan/flexcan-core.c @@ -348,7 +348,7 @@ static struct flexcan_devtype_data fsl_imx93_devtype_data = { .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_RX_MAILBOX | - FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_AUTO_STOP_MODE | + FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR | FLEXCAN_QUIRK_SUPPORT_FD | FLEXCAN_QUIRK_SUPPORT_ECC | FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX | FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR, @@ -544,11 +544,6 @@ } else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) { regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr, 1 << priv->stm.req_bit, 1 << priv->stm.req_bit); - } else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE) { - /* For the auto stop mode, software do nothing, hardware will cover - * all the operation automatically after system go into low power mode. - */ - return 0; } return flexcan_low_power_enter_ack(priv); @@ -574,12 +569,6 @@ reg_mcr &= ~FLEXCAN_MCR_SLF_WAK; priv->write(reg_mcr, ®s->mcr); - /* For the auto stop mode, hardware will exist stop mode - * automatically after system go out of low power mode. - */ - if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE) - return 0; - return flexcan_low_power_exit_ack(priv); } @@ -1994,13 +1983,18 @@ ret = flexcan_setup_stop_mode_scfw(pdev); else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) ret = flexcan_setup_stop_mode_gpr(pdev); - else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE) - ret = 0; else /* return 0 directly if doesn't support stop mode feature */ return 0; - if (ret) + /* If ret is -EINVAL, this means SoC claim to support stop mode, but + * dts file lack the stop mode property definition. For this case, + * directly return 0, this will skip the wakeup capable setting and + * will not block the driver probe. + */ + if (ret == -EINVAL) + return 0; + else if (ret) return ret; device_set_wakeup_capable(&pdev->dev, true); @@ -2320,16 +2314,8 @@ if (netif_running(dev)) { int err; - if (device_may_wakeup(device)) { + if (device_may_wakeup(device)) flexcan_enable_wakeup_irq(priv, true); - /* For auto stop mode, need to keep the clock on before - * system go into low power mode. After system go into - * low power mode, hardware will config the flexcan into - * stop mode, and gate off the clock automatically. - */ - if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE) - return 0; - } err = pm_runtime_force_suspend(device); if (err) @@ -2347,15 +2333,9 @@ if (netif_running(dev)) { int err; - /* For the wakeup in auto stop mode, no need to gate on the - * clock here, hardware will do this automatically. - */ - if (!(device_may_wakeup(device) && - priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE)) { - err = pm_runtime_force_resume(device); - if (err) - return err; - } + err = pm_runtime_force_resume(device); + if (err) + return err; if (device_may_wakeup(device)) flexcan_enable_wakeup_irq(priv, false); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/can/flexcan/flexcan.h +++ linux-aws-6.5-6.5.0/drivers/net/can/flexcan/flexcan.h @@ -68,8 +68,6 @@ #define FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR BIT(15) /* Device supports RX via FIFO */ #define FLEXCAN_QUIRK_SUPPORT_RX_FIFO BIT(16) -/* auto enter stop mode to support wakeup */ -#define FLEXCAN_QUIRK_AUTO_STOP_MODE BIT(17) struct flexcan_devtype_data { u32 quirks; /* quirks needed for different IP cores */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/can/usb/etas_es58x/es58x_core.c +++ linux-aws-6.5-6.5.0/drivers/net/can/usb/etas_es58x/es58x_core.c @@ -2230,6 +2230,7 @@ for (ch_idx = 0; ch_idx < es58x_dev->num_can_ch; ch_idx++) { int ret = es58x_init_netdev(es58x_dev, ch_idx); + if (ret) { es58x_free_netdevs(es58x_dev); return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/can/usb/etas_es58x/es58x_core.h +++ linux-aws-6.5-6.5.0/drivers/net/can/usb/etas_es58x/es58x_core.h @@ -378,13 +378,13 @@ /** * struct es58x_hw_revision - Hardware revision number. - * @letter: Revision letter. + * @letter: Revision letter, an alphanumeric character. * @major: Version major number, represented on three digits. * @minor: Version minor number, represented on three digits. * * The hardware revision uses its own format: "axxx/xxx" where 'a' is - * a letter and 'x' a digit. It can be retrieved from the product - * information string. + * an alphanumeric character and 'x' a digit. It can be retrieved from + * the product information string. */ struct es58x_hw_revision { char letter; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/can/usb/etas_es58x/es58x_devlink.c +++ linux-aws-6.5-6.5.0/drivers/net/can/usb/etas_es58x/es58x_devlink.c @@ -125,14 +125,28 @@ * firmware version, the bootloader version and the hardware * revision. * - * If the function fails, simply emit a log message and continue - * because product information is not critical for the driver to - * operate. + * If the function fails, set the version or revision to an invalid + * value and emit an informal message. Continue probing because the + * product information is not critical for the driver to operate. */ void es58x_parse_product_info(struct es58x_device *es58x_dev) { + static const struct es58x_sw_version sw_version_not_set = { + .major = -1, + .minor = -1, + .revision = -1, + }; + static const struct es58x_hw_revision hw_revision_not_set = { + .letter = '\0', + .major = -1, + .minor = -1, + }; char *prod_info; + es58x_dev->firmware_version = sw_version_not_set; + es58x_dev->bootloader_version = sw_version_not_set; + es58x_dev->hardware_revision = hw_revision_not_set; + prod_info = usb_cache_string(es58x_dev->udev, ES58X_PROD_INFO_IDX); if (!prod_info) { dev_warn(es58x_dev->dev, @@ -150,29 +164,36 @@ } /** - * es58x_sw_version_is_set() - Check if the version is a valid number. + * es58x_sw_version_is_valid() - Check if the version is a valid number. * @sw_ver: Version number of either the firmware or the bootloader. * - * If &es58x_sw_version.major, &es58x_sw_version.minor and - * &es58x_sw_version.revision are all zero, the product string could - * not be parsed and the version number is invalid. + * If any of the software version sub-numbers do not fit on two + * digits, the version is invalid, most probably because the product + * string could not be parsed. + * + * Return: @true if the software version is valid, @false otherwise. */ -static inline bool es58x_sw_version_is_set(struct es58x_sw_version *sw_ver) +static inline bool es58x_sw_version_is_valid(struct es58x_sw_version *sw_ver) { - return sw_ver->major || sw_ver->minor || sw_ver->revision; + return sw_ver->major < 100 && sw_ver->minor < 100 && + sw_ver->revision < 100; } /** - * es58x_hw_revision_is_set() - Check if the revision is a valid number. + * es58x_hw_revision_is_valid() - Check if the revision is a valid number. * @hw_rev: Revision number of the hardware. * - * If &es58x_hw_revision.letter is the null character, the product - * string could not be parsed and the hardware revision number is - * invalid. + * If &es58x_hw_revision.letter is not a alphanumeric character or if + * any of the hardware revision sub-numbers do not fit on three + * digits, the revision is invalid, most probably because the product + * string could not be parsed. + * + * Return: @true if the hardware revision is valid, @false otherwise. */ -static inline bool es58x_hw_revision_is_set(struct es58x_hw_revision *hw_rev) +static inline bool es58x_hw_revision_is_valid(struct es58x_hw_revision *hw_rev) { - return hw_rev->letter != '\0'; + return isalnum(hw_rev->letter) && hw_rev->major < 1000 && + hw_rev->minor < 1000; } /** @@ -197,7 +218,7 @@ char buf[max(sizeof("xx.xx.xx"), sizeof("axxx/xxx"))]; int ret = 0; - if (es58x_sw_version_is_set(fw_ver)) { + if (es58x_sw_version_is_valid(fw_ver)) { snprintf(buf, sizeof(buf), "%02u.%02u.%02u", fw_ver->major, fw_ver->minor, fw_ver->revision); ret = devlink_info_version_running_put(req, @@ -207,7 +228,7 @@ return ret; } - if (es58x_sw_version_is_set(bl_ver)) { + if (es58x_sw_version_is_valid(bl_ver)) { snprintf(buf, sizeof(buf), "%02u.%02u.%02u", bl_ver->major, bl_ver->minor, bl_ver->revision); ret = devlink_info_version_running_put(req, @@ -217,7 +238,7 @@ return ret; } - if (es58x_hw_revision_is_set(hw_rev)) { + if (es58x_hw_revision_is_valid(hw_rev)) { snprintf(buf, sizeof(buf), "%c%03u/%03u", hw_rev->letter, hw_rev->major, hw_rev->minor); ret = devlink_info_version_fixed_put(req, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/dsa/bcm_sf2.c +++ linux-aws-6.5-6.5.0/drivers/net/dsa/bcm_sf2.c @@ -617,17 +617,16 @@ dn = of_find_compatible_node(NULL, NULL, "brcm,unimac-mdio"); priv->master_mii_bus = of_mdio_find_bus(dn); if (!priv->master_mii_bus) { - of_node_put(dn); - return -EPROBE_DEFER; + err = -EPROBE_DEFER; + goto err_of_node_put; } - get_device(&priv->master_mii_bus->dev); priv->master_mii_dn = dn; priv->slave_mii_bus = mdiobus_alloc(); if (!priv->slave_mii_bus) { - of_node_put(dn); - return -ENOMEM; + err = -ENOMEM; + goto err_put_master_mii_bus_dev; } priv->slave_mii_bus->priv = priv; @@ -684,11 +683,17 @@ } err = mdiobus_register(priv->slave_mii_bus); - if (err && dn) { - mdiobus_free(priv->slave_mii_bus); - of_node_put(dn); - } + if (err && dn) + goto err_free_slave_mii_bus; + + return 0; +err_free_slave_mii_bus: + mdiobus_free(priv->slave_mii_bus); +err_put_master_mii_bus_dev: + put_device(&priv->master_mii_bus->dev); +err_of_node_put: + of_node_put(dn); return err; } @@ -696,6 +701,7 @@ { mdiobus_unregister(priv->slave_mii_bus); mdiobus_free(priv->slave_mii_bus); + put_device(&priv->master_mii_bus->dev); of_node_put(priv->master_mii_dn); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/dsa/lan9303_mdio.c +++ linux-aws-6.5-6.5.0/drivers/net/dsa/lan9303_mdio.c @@ -32,7 +32,7 @@ struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx; reg <<= 2; /* reg num to offset */ - mutex_lock(&sw_dev->device->bus->mdio_lock); + mutex_lock_nested(&sw_dev->device->bus->mdio_lock, MDIO_MUTEX_NESTED); lan9303_mdio_real_write(sw_dev->device, reg, val & 0xffff); lan9303_mdio_real_write(sw_dev->device, reg + 2, (val >> 16) & 0xffff); mutex_unlock(&sw_dev->device->bus->mdio_lock); @@ -50,7 +50,7 @@ struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx; reg <<= 2; /* reg num to offset */ - mutex_lock(&sw_dev->device->bus->mdio_lock); + mutex_lock_nested(&sw_dev->device->bus->mdio_lock, MDIO_MUTEX_NESTED); *val = lan9303_mdio_real_read(sw_dev->device, reg); *val |= (lan9303_mdio_real_read(sw_dev->device, reg + 2) << 16); mutex_unlock(&sw_dev->device->bus->mdio_lock); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/amd/pds_core/adminq.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/pds_core/adminq.c @@ -146,7 +146,7 @@ } queue_work(pdsc->wq, &qcq->work); - pds_core_intr_mask(&pdsc->intr_ctrl[irq], PDS_CORE_INTR_MASK_CLEAR); + pds_core_intr_mask(&pdsc->intr_ctrl[qcq->intx], PDS_CORE_INTR_MASK_CLEAR); return IRQ_HANDLED; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/amd/pds_core/core.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/pds_core/core.h @@ -15,7 +15,7 @@ #define PDSC_DRV_DESCRIPTION "AMD/Pensando Core Driver" #define PDSC_WATCHDOG_SECS 5 -#define PDSC_QUEUE_NAME_MAX_SZ 32 +#define PDSC_QUEUE_NAME_MAX_SZ 16 #define PDSC_ADMINQ_MIN_LENGTH 16 /* must be a power of two */ #define PDSC_NOTIFYQ_LENGTH 64 /* must be a power of two */ #define PDSC_TEARDOWN_RECOVERY false only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -682,10 +682,24 @@ static void xgbe_service_timer(struct timer_list *t) { struct xgbe_prv_data *pdata = from_timer(pdata, t, service_timer); + struct xgbe_channel *channel; + unsigned int i; queue_work(pdata->dev_workqueue, &pdata->service_work); mod_timer(&pdata->service_timer, jiffies + HZ); + + if (!pdata->tx_usecs) + return; + + for (i = 0; i < pdata->channel_count; i++) { + channel = pdata->channel[i]; + if (!channel->tx_ring || channel->tx_timer_active) + break; + channel->tx_timer_active = 1; + mod_timer(&channel->tx_timer, + jiffies + usecs_to_jiffies(pdata->tx_usecs)); + } } static void xgbe_init_timers(struct xgbe_prv_data *pdata) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c @@ -314,10 +314,15 @@ cmd->base.phy_address = pdata->phy.address; - cmd->base.autoneg = pdata->phy.autoneg; - cmd->base.speed = pdata->phy.speed; - cmd->base.duplex = pdata->phy.duplex; + if (netif_carrier_ok(netdev)) { + cmd->base.speed = pdata->phy.speed; + cmd->base.duplex = pdata->phy.duplex; + } else { + cmd->base.speed = SPEED_UNKNOWN; + cmd->base.duplex = DUPLEX_UNKNOWN; + } + cmd->base.autoneg = pdata->phy.autoneg; cmd->base.port = PORT_NONE; XGBE_LM_COPY(cmd, supported, lks, supported); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c @@ -1193,7 +1193,19 @@ if (pdata->phy.duplex != DUPLEX_FULL) return -EINVAL; - xgbe_set_mode(pdata, mode); + /* Force the mode change for SFI in Fixed PHY config. + * Fixed PHY configs needs PLL to be enabled while doing mode set. + * When the SFP module isn't connected during boot, driver assumes + * AN is ON and attempts autonegotiation. However, if the connected + * SFP comes up in Fixed PHY config, the link will not come up as + * PLL isn't enabled while the initial mode set command is issued. + * So, force the mode change for SFI in Fixed PHY configuration to + * fix link issues. + */ + if (mode == XGBE_MODE_SFI) + xgbe_change_mode(pdata, mode); + else + xgbe_set_mode(pdata, mode); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c @@ -553,17 +553,17 @@ /* aq_ptp_rx_hwtstamp - utility function which checks for RX time stamp * @adapter: pointer to adapter struct - * @skb: particular skb to send timestamp with + * @shhwtstamps: particular skb_shared_hwtstamps to save timestamp * * if the timestamp is valid, we convert it into the timecounter ns * value, then store that result into the hwtstamps structure which * is passed up the network stack */ -static void aq_ptp_rx_hwtstamp(struct aq_ptp_s *aq_ptp, struct sk_buff *skb, +static void aq_ptp_rx_hwtstamp(struct aq_ptp_s *aq_ptp, struct skb_shared_hwtstamps *shhwtstamps, u64 timestamp) { timestamp -= atomic_read(&aq_ptp->offset_ingress); - aq_ptp_convert_to_hwtstamp(aq_ptp, skb_hwtstamps(skb), timestamp); + aq_ptp_convert_to_hwtstamp(aq_ptp, shhwtstamps, timestamp); } void aq_ptp_hwtstamp_config_get(struct aq_ptp_s *aq_ptp, @@ -639,7 +639,7 @@ &aq_ptp->ptp_rx == ring || &aq_ptp->hwts_rx == ring; } -u16 aq_ptp_extract_ts(struct aq_nic_s *aq_nic, struct sk_buff *skb, u8 *p, +u16 aq_ptp_extract_ts(struct aq_nic_s *aq_nic, struct skb_shared_hwtstamps *shhwtstamps, u8 *p, unsigned int len) { struct aq_ptp_s *aq_ptp = aq_nic->aq_ptp; @@ -648,7 +648,7 @@ p, len, ×tamp); if (ret > 0) - aq_ptp_rx_hwtstamp(aq_ptp, skb, timestamp); + aq_ptp_rx_hwtstamp(aq_ptp, shhwtstamps, timestamp); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/aquantia/atlantic/aq_ptp.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ptp.h @@ -67,7 +67,7 @@ /* Return either ring is belong to PTP or not*/ bool aq_ptp_ring(struct aq_nic_s *aq_nic, struct aq_ring_s *ring); -u16 aq_ptp_extract_ts(struct aq_nic_s *aq_nic, struct sk_buff *skb, u8 *p, +u16 aq_ptp_extract_ts(struct aq_nic_s *aq_nic, struct skb_shared_hwtstamps *shhwtstamps, u8 *p, unsigned int len); struct ptp_clock *aq_ptp_get_ptp_clock(struct aq_ptp_s *aq_ptp); @@ -143,7 +143,7 @@ } static inline u16 aq_ptp_extract_ts(struct aq_nic_s *aq_nic, - struct sk_buff *skb, u8 *p, + struct skb_shared_hwtstamps *shhwtstamps, u8 *p, unsigned int len) { return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/aquantia/atlantic/aq_ring.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ring.c @@ -647,7 +647,7 @@ } if (is_ptp_ring) buff->len -= - aq_ptp_extract_ts(self->aq_nic, skb, + aq_ptp_extract_ts(self->aq_nic, skb_hwtstamps(skb), aq_buf_vaddr(&buff->rxdata), buff->len); @@ -742,6 +742,8 @@ struct aq_ring_buff_s *buff = &rx_ring->buff_ring[rx_ring->sw_head]; bool is_ptp_ring = aq_ptp_ring(rx_ring->aq_nic, rx_ring); struct aq_ring_buff_s *buff_ = NULL; + u16 ptp_hwtstamp_len = 0; + struct skb_shared_hwtstamps shhwtstamps; struct sk_buff *skb = NULL; unsigned int next_ = 0U; struct xdp_buff xdp; @@ -810,11 +812,12 @@ hard_start = page_address(buff->rxdata.page) + buff->rxdata.pg_off - rx_ring->page_offset; - if (is_ptp_ring) - buff->len -= - aq_ptp_extract_ts(rx_ring->aq_nic, skb, - aq_buf_vaddr(&buff->rxdata), - buff->len); + if (is_ptp_ring) { + ptp_hwtstamp_len = aq_ptp_extract_ts(rx_ring->aq_nic, &shhwtstamps, + aq_buf_vaddr(&buff->rxdata), + buff->len); + buff->len -= ptp_hwtstamp_len; + } xdp_init_buff(&xdp, frame_sz, &rx_ring->xdp_rxq); xdp_prepare_buff(&xdp, hard_start, rx_ring->page_offset, @@ -834,6 +837,9 @@ if (IS_ERR(skb) || !skb) continue; + if (ptp_hwtstamp_len > 0) + *skb_hwtstamps(skb) = shhwtstamps; + if (buff->is_vlan) __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), buff->vlan_rx_tag); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/atheros/atl1c/atl1c.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/atheros/atl1c/atl1c.h @@ -504,15 +504,12 @@ u16 next_to_use; u16 next_to_clean; struct napi_struct napi; - struct page *rx_page; - unsigned int rx_page_offset; }; /* board specific private data structure */ struct atl1c_adapter { struct net_device *netdev; struct pci_dev *pdev; - unsigned int rx_frag_size; struct atl1c_hw hw; struct atl1c_hw_stats hw_stats; struct mii_if_info mii; /* MII interface info */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/atheros/atl1c/atl1c_main.c @@ -483,15 +483,10 @@ static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter, struct net_device *dev) { - unsigned int head_size; int mtu = dev->mtu; adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ? roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; - - head_size = SKB_DATA_ALIGN(adapter->rx_buffer_len + NET_SKB_PAD + NET_IP_ALIGN) + - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); - adapter->rx_frag_size = roundup_pow_of_two(head_size); } static netdev_features_t atl1c_fix_features(struct net_device *netdev, @@ -964,7 +959,6 @@ static void atl1c_free_ring_resources(struct atl1c_adapter *adapter) { struct pci_dev *pdev = adapter->pdev; - int i; dma_free_coherent(&pdev->dev, adapter->ring_header.size, adapter->ring_header.desc, adapter->ring_header.dma); @@ -977,12 +971,6 @@ kfree(adapter->tpd_ring[0].buffer_info); adapter->tpd_ring[0].buffer_info = NULL; } - for (i = 0; i < adapter->rx_queue_count; ++i) { - if (adapter->rrd_ring[i].rx_page) { - put_page(adapter->rrd_ring[i].rx_page); - adapter->rrd_ring[i].rx_page = NULL; - } - } } /** @@ -1754,48 +1742,11 @@ skb_checksum_none_assert(skb); } -static struct sk_buff *atl1c_alloc_skb(struct atl1c_adapter *adapter, - u32 queue, bool napi_mode) -{ - struct atl1c_rrd_ring *rrd_ring = &adapter->rrd_ring[queue]; - struct sk_buff *skb; - struct page *page; - - if (adapter->rx_frag_size > PAGE_SIZE) { - if (likely(napi_mode)) - return napi_alloc_skb(&rrd_ring->napi, - adapter->rx_buffer_len); - else - return netdev_alloc_skb_ip_align(adapter->netdev, - adapter->rx_buffer_len); - } - - page = rrd_ring->rx_page; - if (!page) { - page = alloc_page(GFP_ATOMIC); - if (unlikely(!page)) - return NULL; - rrd_ring->rx_page = page; - rrd_ring->rx_page_offset = 0; - } - - skb = build_skb(page_address(page) + rrd_ring->rx_page_offset, - adapter->rx_frag_size); - if (likely(skb)) { - skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN); - rrd_ring->rx_page_offset += adapter->rx_frag_size; - if (rrd_ring->rx_page_offset >= PAGE_SIZE) - rrd_ring->rx_page = NULL; - else - get_page(page); - } - return skb; -} - static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter, u32 queue, bool napi_mode) { struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring[queue]; + struct atl1c_rrd_ring *rrd_ring = &adapter->rrd_ring[queue]; struct pci_dev *pdev = adapter->pdev; struct atl1c_buffer *buffer_info, *next_info; struct sk_buff *skb; @@ -1814,13 +1765,27 @@ while (next_info->flags & ATL1C_BUFFER_FREE) { rfd_desc = ATL1C_RFD_DESC(rfd_ring, rfd_next_to_use); - skb = atl1c_alloc_skb(adapter, queue, napi_mode); + /* When DMA RX address is set to something like + * 0x....fc0, it will be very likely to cause DMA + * RFD overflow issue. + * + * To work around it, we apply rx skb with 64 bytes + * longer space, and offset the address whenever + * 0x....fc0 is detected. + */ + if (likely(napi_mode)) + skb = napi_alloc_skb(&rrd_ring->napi, adapter->rx_buffer_len + 64); + else + skb = netdev_alloc_skb(adapter->netdev, adapter->rx_buffer_len + 64); if (unlikely(!skb)) { if (netif_msg_rx_err(adapter)) dev_warn(&pdev->dev, "alloc rx buffer failed\n"); break; } + if (((unsigned long)skb->data & 0xfff) == 0xfc0) + skb_reserve(skb, 64); + /* * Make buffer alignment 2 beyond a 16 byte boundary * this will result in a 16 byte aligned IP header after only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/broadcom/tg3.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/broadcom/tg3.c @@ -6846,7 +6846,7 @@ desc_idx, *post_ptr); drop_it_no_recycle: /* Other statistics kept track of by card. */ - tp->rx_dropped++; + tnapi->rx_dropped++; goto next_pkt; } @@ -7875,8 +7875,10 @@ segs = skb_gso_segment(skb, tp->dev->features & ~(NETIF_F_TSO | NETIF_F_TSO6)); - if (IS_ERR(segs) || !segs) + if (IS_ERR(segs) || !segs) { + tnapi->tx_dropped++; goto tg3_tso_bug_end; + } skb_list_walk_safe(segs, seg, next) { skb_mark_not_on_list(seg); @@ -8147,7 +8149,7 @@ drop: dev_kfree_skb_any(skb); drop_nofree: - tp->tx_dropped++; + tnapi->tx_dropped++; return NETDEV_TX_OK; } @@ -9326,7 +9328,7 @@ /* tp->lock is held. */ static int tg3_halt(struct tg3 *tp, int kind, bool silent) { - int err; + int err, i; tg3_stop_fw(tp); @@ -9347,6 +9349,13 @@ /* And make sure the next sample is new data */ memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats)); + + for (i = 0; i < TG3_IRQ_MAX_VECS; ++i) { + struct tg3_napi *tnapi = &tp->napi[i]; + + tnapi->rx_dropped = 0; + tnapi->tx_dropped = 0; + } } return err; @@ -11896,6 +11905,9 @@ { struct rtnl_link_stats64 *old_stats = &tp->net_stats_prev; struct tg3_hw_stats *hw_stats = tp->hw_stats; + unsigned long rx_dropped; + unsigned long tx_dropped; + int i; stats->rx_packets = old_stats->rx_packets + get_stat64(&hw_stats->rx_ucast_packets) + @@ -11942,8 +11954,26 @@ stats->rx_missed_errors = old_stats->rx_missed_errors + get_stat64(&hw_stats->rx_discards); - stats->rx_dropped = tp->rx_dropped; - stats->tx_dropped = tp->tx_dropped; + /* Aggregate per-queue counters. The per-queue counters are updated + * by a single writer, race-free. The result computed by this loop + * might not be 100% accurate (counters can be updated in the middle of + * the loop) but the next tg3_get_nstats() will recompute the current + * value so it is acceptable. + * + * Note that these counters wrap around at 4G on 32bit machines. + */ + rx_dropped = (unsigned long)(old_stats->rx_dropped); + tx_dropped = (unsigned long)(old_stats->tx_dropped); + + for (i = 0; i < tp->irq_cnt; i++) { + struct tg3_napi *tnapi = &tp->napi[i]; + + rx_dropped += tnapi->rx_dropped; + tx_dropped += tnapi->tx_dropped; + } + + stats->rx_dropped = rx_dropped; + stats->tx_dropped = tx_dropped; } static int tg3_get_regs_len(struct net_device *dev) @@ -18082,7 +18112,8 @@ if (netif_running(dev)) dev_close(dev); - tg3_power_down(tp); + if (system_state == SYSTEM_POWER_OFF) + tg3_power_down(tp); rtnl_unlock(); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/broadcom/tg3.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/broadcom/tg3.h @@ -3018,6 +3018,7 @@ u16 *rx_rcb_prod_idx; struct tg3_rx_prodring_set prodring; struct tg3_rx_buffer_desc *rx_rcb; + unsigned long rx_dropped; u32 tx_prod ____cacheline_aligned; u32 tx_cons; @@ -3026,6 +3027,7 @@ u32 prodmbox; struct tg3_tx_buffer_desc *tx_ring; struct tg3_tx_ring_info *tx_buffers; + unsigned long tx_dropped; dma_addr_t status_mapping; dma_addr_t rx_rcb_mapping; @@ -3219,8 +3221,6 @@ /* begin "everything else" cacheline(s) section */ - unsigned long rx_dropped; - unsigned long tx_dropped; struct rtnl_link_stats64 net_stats_prev; struct tg3_ethtool_stats estats_prev; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c @@ -3816,6 +3816,8 @@ FW_PARAMS_PARAM_Z_V(FW_PARAMS_PARAM_DEV_PHYFW_DOWNLOAD)); ret = t4_set_params_timeout(adap, adap->mbox, adap->pf, 0, 1, ¶m, &val, 30000); + if (ret) + return ret; /* If we have version number support, then check to see that the new * firmware got loaded properly. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c @@ -2259,7 +2259,7 @@ if (tp->snd_una != snd_una) { tp->snd_una = snd_una; - tp->rcv_tstamp = tcp_time_stamp(tp); + tp->rcv_tstamp = tcp_jiffies32; if (tp->snd_una == tp->snd_nxt && !csk_flag_nochk(csk, CSK_TX_FAILOVER)) csk_reset_flag(csk, CSK_TX_WAIT_IDLE); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c @@ -911,7 +911,7 @@ struct sock *sk, long *timeo_p) { DEFINE_WAIT_FUNC(wait, woken_wake_function); - int err = 0; + int ret, err = 0; long current_timeo; long vm_wait = 0; bool noblock; @@ -942,10 +942,13 @@ set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); sk->sk_write_pending++; - sk_wait_event(sk, ¤t_timeo, sk->sk_err || - (sk->sk_shutdown & SEND_SHUTDOWN) || - (csk_mem_free(cdev, sk) && !vm_wait), &wait); + ret = sk_wait_event(sk, ¤t_timeo, sk->sk_err || + (sk->sk_shutdown & SEND_SHUTDOWN) || + (csk_mem_free(cdev, sk) && !vm_wait), + &wait); sk->sk_write_pending--; + if (ret < 0) + goto do_error; if (vm_wait) { vm_wait -= current_timeo; @@ -1348,6 +1351,7 @@ int copied = 0; int target; long timeo; + int ret; buffers_freed = 0; @@ -1423,7 +1427,11 @@ if (copied >= target) break; chtls_cleanup_rbuf(sk, copied); - sk_wait_data(sk, &timeo, NULL); + ret = sk_wait_data(sk, &timeo, NULL); + if (ret < 0) { + copied = copied ? : ret; + goto unlock; + } continue; found_ok_skb: if (!skb->len) { @@ -1518,6 +1526,8 @@ if (buffers_freed) chtls_cleanup_rbuf(sk, copied); + +unlock: release_sock(sk); return copied; } @@ -1534,6 +1544,7 @@ int copied = 0; size_t avail; /* amount of available data in current skb */ long timeo; + int ret; lock_sock(sk); timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT); @@ -1585,7 +1596,12 @@ release_sock(sk); lock_sock(sk); } else { - sk_wait_data(sk, &timeo, NULL); + ret = sk_wait_data(sk, &timeo, NULL); + if (ret < 0) { + /* here 'copied' is 0 due to previous checks */ + copied = ret; + break; + } } if (unlikely(peek_seq != tp->copied_seq)) { @@ -1656,6 +1672,7 @@ int copied = 0; long timeo; int target; /* Read at least this many bytes */ + int ret; buffers_freed = 0; @@ -1747,7 +1764,11 @@ if (copied >= target) break; chtls_cleanup_rbuf(sk, copied); - sk_wait_data(sk, &timeo, NULL); + ret = sk_wait_data(sk, &timeo, NULL); + if (ret < 0) { + copied = copied ? : ret; + goto unlock; + } continue; found_ok_skb: @@ -1816,6 +1837,7 @@ if (buffers_freed) chtls_cleanup_rbuf(sk, copied); +unlock: release_sock(sk); return copied; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/cortina/gemini.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/cortina/gemini.c @@ -432,8 +432,8 @@ .val = CONFIG0_MAXLEN_1536, }, { - .max_l3_len = 1542, - .val = CONFIG0_MAXLEN_1542, + .max_l3_len = 1548, + .val = CONFIG0_MAXLEN_1548, }, { .max_l3_len = 9212, @@ -1145,6 +1145,7 @@ dma_addr_t mapping; unsigned short mtu; void *buffer; + int ret; mtu = ETH_HLEN; mtu += netdev->mtu; @@ -1159,9 +1160,30 @@ word3 |= mtu; } - if (skb->ip_summed != CHECKSUM_NONE) { + if (skb->len >= ETH_FRAME_LEN) { + /* Hardware offloaded checksumming isn't working on frames + * bigger than 1514 bytes. A hypothesis about this is that the + * checksum buffer is only 1518 bytes, so when the frames get + * bigger they get truncated, or the last few bytes get + * overwritten by the FCS. + * + * Just use software checksumming and bypass on bigger frames. + */ + if (skb->ip_summed == CHECKSUM_PARTIAL) { + ret = skb_checksum_help(skb); + if (ret) + return ret; + } + word1 |= TSS_BYPASS_BIT; + } else if (skb->ip_summed == CHECKSUM_PARTIAL) { int tcp = 0; + /* We do not switch off the checksumming on non TCP/UDP + * frames: as is shown from tests, the checksumming engine + * is smart enough to see that a frame is not actually TCP + * or UDP and then just pass it through without any changes + * to the frame. + */ if (skb->protocol == htons(ETH_P_IP)) { word1 |= TSS_IP_CHKSUM_BIT; tcp = ip_hdr(skb)->protocol == IPPROTO_TCP; @@ -1978,15 +2000,6 @@ return 0; } -static netdev_features_t gmac_fix_features(struct net_device *netdev, - netdev_features_t features) -{ - if (netdev->mtu + ETH_HLEN + VLAN_HLEN > MTU_SIZE_BIT_MASK) - features &= ~GMAC_OFFLOAD_FEATURES; - - return features; -} - static int gmac_set_features(struct net_device *netdev, netdev_features_t features) { @@ -2212,7 +2225,6 @@ .ndo_set_mac_address = gmac_set_mac_address, .ndo_get_stats64 = gmac_get_stats64, .ndo_change_mtu = gmac_change_mtu, - .ndo_fix_features = gmac_fix_features, .ndo_set_features = gmac_set_features, }; @@ -2464,11 +2476,12 @@ netdev->hw_features = GMAC_OFFLOAD_FEATURES; netdev->features |= GMAC_OFFLOAD_FEATURES | NETIF_F_GRO; - /* We can handle jumbo frames up to 10236 bytes so, let's accept - * payloads of 10236 bytes minus VLAN and ethernet header + /* We can receive jumbo frames up to 10236 bytes but only + * transmit 2047 bytes so, let's accept payloads of 2047 + * bytes minus VLAN and ethernet header */ netdev->min_mtu = ETH_MIN_MTU; - netdev->max_mtu = 10236 - VLAN_ETH_HLEN; + netdev->max_mtu = MTU_SIZE_BIT_MASK - VLAN_ETH_HLEN; port->freeq_refill = 0; netif_napi_add(netdev, &port->napi, gmac_napi_poll); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/cortina/gemini.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/cortina/gemini.h @@ -502,7 +502,7 @@ #define SOF_BIT 0x80000000 #define EOF_BIT 0x40000000 #define EOFIE_BIT BIT(29) -#define MTU_SIZE_BIT_MASK 0x1fff +#define MTU_SIZE_BIT_MASK 0x7ff /* Max MTU 2047 bytes */ /* GMAC Tx Descriptor */ struct gmac_txdesc { @@ -787,7 +787,7 @@ #define CONFIG0_MAXLEN_1536 0 #define CONFIG0_MAXLEN_1518 1 #define CONFIG0_MAXLEN_1522 2 -#define CONFIG0_MAXLEN_1542 3 +#define CONFIG0_MAXLEN_1548 3 #define CONFIG0_MAXLEN_9k 4 /* 9212 */ #define CONFIG0_MAXLEN_10k 5 /* 10236 */ #define CONFIG0_MAXLEN_1518__6 6 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/engleder/tsnep.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/engleder/tsnep.h @@ -142,7 +142,7 @@ struct tsnep_queue { struct tsnep_adapter *adapter; - char name[IFNAMSIZ + 9]; + char name[IFNAMSIZ + 16]; struct tsnep_tx *tx; struct tsnep_rx *rx; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -516,8 +516,6 @@ memcpy(skb->data, fd_vaddr + fd_offset, fd_length); - dpaa2_eth_recycle_buf(priv, ch, dpaa2_fd_get_addr(fd)); - return skb; } @@ -589,6 +587,7 @@ struct rtnl_link_stats64 *percpu_stats; struct dpaa2_eth_drv_stats *percpu_extras; struct device *dev = priv->net_dev->dev.parent; + bool recycle_rx_buf = false; void *buf_data; u32 xdp_act; @@ -618,6 +617,8 @@ dma_unmap_page(dev, addr, priv->rx_buf_size, DMA_BIDIRECTIONAL); skb = dpaa2_eth_build_linear_skb(ch, fd, vaddr); + } else { + recycle_rx_buf = true; } } else if (fd_format == dpaa2_fd_sg) { WARN_ON(priv->xdp_prog); @@ -637,6 +638,9 @@ goto err_build_skb; dpaa2_eth_receive_skb(priv, ch, fd, vaddr, fq, percpu_stats, skb); + + if (recycle_rx_buf) + dpaa2_eth_recycle_buf(priv, ch, dpaa2_fd_get_addr(fd)); return; err_build_skb: @@ -1073,14 +1077,12 @@ dma_addr_t addr; buffer_start = skb->data - dpaa2_eth_needed_headroom(skb); - - /* If there's enough room to align the FD address, do it. - * It will help hardware optimize accesses. - */ aligned_start = PTR_ALIGN(buffer_start - DPAA2_ETH_TX_BUF_ALIGN, DPAA2_ETH_TX_BUF_ALIGN); if (aligned_start >= skb->head) buffer_start = aligned_start; + else + return -ENOMEM; /* Store a backpointer to the skb at the beginning of the buffer * (in the private data area) such that we can release it @@ -4967,6 +4969,8 @@ if (err) goto err_dl_port_add; + net_dev->needed_headroom = DPAA2_ETH_SWA_SIZE + DPAA2_ETH_TX_BUF_ALIGN; + err = register_netdev(net_dev); if (err < 0) { dev_err(dev, "register_netdev() failed\n"); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h @@ -739,7 +739,7 @@ static inline unsigned int dpaa2_eth_needed_headroom(struct sk_buff *skb) { - unsigned int headroom = DPAA2_ETH_SWA_SIZE; + unsigned int headroom = DPAA2_ETH_SWA_SIZE + DPAA2_ETH_TX_BUF_ALIGN; /* If we don't have an skb (e.g. XDP buffer), we only need space for * the software annotation area only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/freescale/enetc/enetc.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/freescale/enetc/enetc.c @@ -2769,7 +2769,7 @@ if (priv->min_num_stack_tx_queues + num_xdp_tx_queues > priv->num_tx_rings) { NL_SET_ERR_MSG_FMT_MOD(extack, - "Reserving %d XDP TXQs does not leave a minimum of %d TXQs for network stack (total %d available)", + "Reserving %d XDP TXQs does not leave a minimum of %d for stack (total %d)", num_xdp_tx_queues, priv->min_num_stack_tx_queues, priv->num_tx_rings); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/google/gve/gve_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/google/gve/gve_main.c @@ -191,7 +191,7 @@ rx_stats_num = (GVE_RX_STATS_REPORT_NUM + NIC_RX_STATS_REPORT_NUM) * priv->rx_cfg.num_queues; priv->stats_report_len = struct_size(priv->stats_report, stats, - tx_stats_num + rx_stats_num); + size_add(tx_stats_num, rx_stats_num)); priv->stats_report = dma_alloc_coherent(&priv->pdev->dev, priv->stats_report_len, &priv->stats_report_bus, GFP_KERNEL); @@ -255,10 +255,13 @@ if (block->tx) { if (block->tx->q_num < priv->tx_cfg.num_queues) reschedule |= gve_tx_poll(block, budget); - else + else if (budget) reschedule |= gve_xdp_poll(block, budget); } + if (!budget) + return 0; + if (block->rx) { work_done = gve_rx_poll(block, budget); reschedule |= work_done == budget; @@ -299,6 +302,9 @@ if (block->tx) reschedule |= gve_tx_poll_dqo(block, /*do_clean=*/true); + if (!budget) + return 0; + if (block->rx) { work_done = gve_rx_poll_dqo(block, budget); reschedule |= work_done == budget; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/google/gve/gve_rx.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/google/gve/gve_rx.c @@ -146,7 +146,7 @@ err = gve_rx_alloc_buffer(priv, &priv->pdev->dev, &rx->data.page_info[i], &rx->data.data_ring[i]); if (err) - goto alloc_err; + goto alloc_err_rda; } if (!rx->data.raw_addressing) { @@ -171,12 +171,26 @@ return slots; alloc_err_qpl: + /* Fully free the copy pool pages. */ while (j--) { page_ref_sub(rx->qpl_copy_pool[j].page, rx->qpl_copy_pool[j].pagecnt_bias - 1); put_page(rx->qpl_copy_pool[j].page); } -alloc_err: + + /* Do not fully free QPL pages - only remove the bias added in this + * function with gve_setup_rx_buffer. + */ + while (i--) + page_ref_sub(rx->data.page_info[i].page, + rx->data.page_info[i].pagecnt_bias - 1); + + gve_unassign_qpl(priv, rx->data.qpl->id); + rx->data.qpl = NULL; + + return err; + +alloc_err_rda: while (i--) gve_rx_free_buffer(&priv->pdev->dev, &rx->data.page_info[i], @@ -993,10 +1007,6 @@ feat = block->napi.dev->features; - /* If budget is 0, do all the work */ - if (budget == 0) - budget = INT_MAX; - if (budget > 0) work_done = gve_clean_rx_done(rx, budget, feat); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/google/gve/gve_tx.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/google/gve/gve_tx.c @@ -925,10 +925,6 @@ bool repoll; u32 to_do; - /* If budget is 0, do all the work */ - if (budget == 0) - budget = INT_MAX; - /* Find out how much work there is to be done */ nic_done = gve_tx_load_event_counter(priv, tx); to_do = min_t(u32, (nic_done - tx->done), budget); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c @@ -66,6 +66,27 @@ } } +static u32 hns_mac_link_anti_shake(struct mac_driver *mac_ctrl_drv) +{ +#define HNS_MAC_LINK_WAIT_TIME 5 +#define HNS_MAC_LINK_WAIT_CNT 40 + + u32 link_status = 0; + int i; + + if (!mac_ctrl_drv->get_link_status) + return link_status; + + for (i = 0; i < HNS_MAC_LINK_WAIT_CNT; i++) { + msleep(HNS_MAC_LINK_WAIT_TIME); + mac_ctrl_drv->get_link_status(mac_ctrl_drv, &link_status); + if (!link_status) + break; + } + + return link_status; +} + void hns_mac_get_link_status(struct hns_mac_cb *mac_cb, u32 *link_status) { struct mac_driver *mac_ctrl_drv; @@ -83,6 +104,14 @@ &sfp_prsnt); if (!ret) *link_status = *link_status && sfp_prsnt; + + /* for FIBER port, it may have a fake link up. + * when the link status changes from down to up, we need to do + * anti-shake. the anti-shake time is base on tests. + * only FIBER port need to do this. + */ + if (*link_status && !mac_cb->link) + *link_status = hns_mac_link_anti_shake(mac_ctrl_drv); } mac_cb->link = *link_status; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/hisilicon/hns/hns_enet.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns/hns_enet.c @@ -142,7 +142,8 @@ static void fill_desc(struct hnae_ring *ring, void *priv, int size, dma_addr_t dma, int frag_end, - int buf_num, enum hns_desc_type type, int mtu) + int buf_num, enum hns_desc_type type, int mtu, + bool is_gso) { struct hnae_desc *desc = &ring->desc[ring->next_to_use]; struct hnae_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_use]; @@ -275,6 +276,15 @@ return 0; } +static int hns_nic_maybe_stop_tx_v2(struct sk_buff **out_skb, int *bnum, + struct hnae_ring *ring) +{ + if (skb_is_gso(*out_skb)) + return hns_nic_maybe_stop_tso(out_skb, bnum, ring); + else + return hns_nic_maybe_stop_tx(out_skb, bnum, ring); +} + static void fill_tso_desc(struct hnae_ring *ring, void *priv, int size, dma_addr_t dma, int frag_end, int buf_num, enum hns_desc_type type, int mtu) @@ -300,6 +310,19 @@ mtu); } +static void fill_desc_v2(struct hnae_ring *ring, void *priv, + int size, dma_addr_t dma, int frag_end, + int buf_num, enum hns_desc_type type, int mtu, + bool is_gso) +{ + if (is_gso) + fill_tso_desc(ring, priv, size, dma, frag_end, buf_num, type, + mtu); + else + fill_v2_desc(ring, priv, size, dma, frag_end, buf_num, type, + mtu); +} + netdev_tx_t hns_nic_net_xmit_hw(struct net_device *ndev, struct sk_buff *skb, struct hns_nic_ring_data *ring_data) @@ -313,6 +336,7 @@ int seg_num; dma_addr_t dma; int size, next_to_use; + bool is_gso; int i; switch (priv->ops.maybe_stop_tx(&skb, &buf_num, ring)) { @@ -339,8 +363,9 @@ ring->stats.sw_err_cnt++; goto out_err_tx_ok; } + is_gso = skb_is_gso(skb); priv->ops.fill_desc(ring, skb, size, dma, seg_num == 1 ? 1 : 0, - buf_num, DESC_TYPE_SKB, ndev->mtu); + buf_num, DESC_TYPE_SKB, ndev->mtu, is_gso); /* fill the fragments */ for (i = 1; i < seg_num; i++) { @@ -354,7 +379,7 @@ } priv->ops.fill_desc(ring, skb_frag_page(frag), size, dma, seg_num - 1 == i ? 1 : 0, buf_num, - DESC_TYPE_PAGE, ndev->mtu); + DESC_TYPE_PAGE, ndev->mtu, is_gso); } /*complete translate all packets*/ @@ -1776,15 +1801,6 @@ netdev_info(netdev, "enet v1 do not support tso!\n"); break; default: - if (features & (NETIF_F_TSO | NETIF_F_TSO6)) { - priv->ops.fill_desc = fill_tso_desc; - priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tso; - /* The chip only support 7*4096 */ - netif_set_tso_max_size(netdev, 7 * 4096); - } else { - priv->ops.fill_desc = fill_v2_desc; - priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tx; - } break; } netdev->features = features; @@ -2159,16 +2175,9 @@ priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tx; } else { priv->ops.get_rxd_bnum = get_v2rx_desc_bnum; - if ((netdev->features & NETIF_F_TSO) || - (netdev->features & NETIF_F_TSO6)) { - priv->ops.fill_desc = fill_tso_desc; - priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tso; - /* This chip only support 7*4096 */ - netif_set_tso_max_size(netdev, 7 * 4096); - } else { - priv->ops.fill_desc = fill_v2_desc; - priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tx; - } + priv->ops.fill_desc = fill_desc_v2; + priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tx_v2; + netif_set_tso_max_size(netdev, 7 * 4096); /* enable tso when init * control tso on/off through TSE bit in bd */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/hisilicon/hns/hns_enet.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns/hns_enet.h @@ -44,7 +44,8 @@ struct hns_nic_ops { void (*fill_desc)(struct hnae_ring *ring, void *priv, int size, dma_addr_t dma, int frag_end, - int buf_num, enum hns_desc_type type, int mtu); + int buf_num, enum hns_desc_type type, int mtu, + bool is_gso); int (*maybe_stop_tx)(struct sk_buff **out_skb, int *bnum, struct hnae_ring *ring); void (*get_rxd_bnum)(u32 bnum_flag, int *out_bnum); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c @@ -63,6 +63,9 @@ i++; } + /* ensure additional_info will be seen after received_resp */ + smp_rmb(); + if (i >= HCLGEVF_MAX_TRY_TIMES) { dev_err(&hdev->pdev->dev, "VF could not get mbx(%u,%u) resp(=%d) from PF in %d tries\n", @@ -178,6 +181,10 @@ resp->resp_status = hclgevf_resp_to_errno(resp_status); memcpy(resp->additional_info, req->msg.resp_data, HCLGE_MBX_MAX_RESP_DATA_SIZE * sizeof(u8)); + + /* ensure additional_info will be seen before setting received_resp */ + smp_wmb(); + if (match_id) { /* If match_id is not zero, it means PF support match_id. * if the match_id is right, VF get the right response, or only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/i40e/i40e.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/i40e/i40e.h @@ -580,7 +580,6 @@ #define I40E_FLAG_DISABLE_FW_LLDP BIT(24) #define I40E_FLAG_RS_FEC BIT(25) #define I40E_FLAG_BASE_R_FEC BIT(26) -#define I40E_FLAG_VF_VLAN_PRUNING BIT(27) /* TOTAL_PORT_SHUTDOWN * Allows to physically disable the link on the NIC's port. * If enabled, (after link down request from the OS) @@ -603,6 +602,7 @@ * in abilities field of i40e_aq_set_phy_config structure */ #define I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED BIT(27) +#define I40E_FLAG_VF_VLAN_PRUNING BIT(28) struct i40e_client_instance *cinst; bool stat_offsets_loaded; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/i40e/i40e_common.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/i40e/i40e_common.c @@ -1082,7 +1082,7 @@ I40E_PFLAN_QALLOC_FIRSTQ_SHIFT; j = (val & I40E_PFLAN_QALLOC_LASTQ_MASK) >> I40E_PFLAN_QALLOC_LASTQ_SHIFT; - if (val & I40E_PFLAN_QALLOC_VALID_MASK) + if (val & I40E_PFLAN_QALLOC_VALID_MASK && j >= base_queue) num_queues = (j - base_queue) + 1; else num_queues = 0; @@ -1092,7 +1092,7 @@ I40E_PF_VT_PFALLOC_FIRSTVF_SHIFT; j = (val & I40E_PF_VT_PFALLOC_LASTVF_MASK) >> I40E_PF_VT_PFALLOC_LASTVF_SHIFT; - if (val & I40E_PF_VT_PFALLOC_VALID_MASK) + if (val & I40E_PF_VT_PFALLOC_VALID_MASK && j >= i) num_vfs = (j - i) + 1; else num_vfs = 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/i40e/i40e_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -16199,7 +16199,7 @@ I40E_PRTGL_SAH_MFS_MASK) >> I40E_PRTGL_SAH_MFS_SHIFT; if (val < MAX_FRAME_SIZE_DEFAULT) dev_warn(&pdev->dev, "MFS for port %x has been set below the default: %x\n", - i, val); + pf->hw.port, val); /* Add a filter to drop all Flow control frames from any VSI from being * transmitted. By doing so we stop a malicious VF from sending out @@ -16324,11 +16324,15 @@ i40e_switch_branch_release(pf->veb[i]); } - /* Now we can shutdown the PF's VSI, just before we kill + /* Now we can shutdown the PF's VSIs, just before we kill * adminq and hmc. */ - if (pf->vsi[pf->lan_vsi]) - i40e_vsi_release(pf->vsi[pf->lan_vsi]); + for (i = pf->num_alloc_vsi; i--;) + if (pf->vsi[i]) { + i40e_vsi_close(pf->vsi[i]); + i40e_vsi_release(pf->vsi[i]); + pf->vsi[i] = NULL; + } i40e_cloud_filter_exit(pf); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -2544,7 +2544,14 @@ rx_buffer = i40e_rx_bi(rx_ring, ntp); i40e_inc_ntp(rx_ring); i40e_reuse_rx_page(rx_ring, rx_buffer); - cleaned_count++; + /* Update ntc and bump cleaned count if not in the + * middle of mb packet. + */ + if (rx_ring->next_to_clean == ntp) { + rx_ring->next_to_clean = + rx_ring->next_to_process; + cleaned_count++; + } continue; } @@ -2847,7 +2854,7 @@ return budget; } - if (vsi->back->flags & I40E_TXR_FLAGS_WB_ON_ITR) + if (q_vector->tx.ring[0].flags & I40E_TXR_FLAGS_WB_ON_ITR) q_vector->arm_wb_state = false; /* Exit the polling mode, but don't re-enable interrupts if stack might only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/iavf/iavf_txrx.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf_txrx.h @@ -15,7 +15,6 @@ */ #define IAVF_ITR_DYNAMIC 0x8000 /* use top bit as a flag */ #define IAVF_ITR_MASK 0x1FFE /* mask for ITR register value */ -#define IAVF_MIN_ITR 2 /* reg uses 2 usec resolution */ #define IAVF_ITR_100K 10 /* all values below must be even */ #define IAVF_ITR_50K 20 #define IAVF_ITR_20K 50 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c @@ -948,14 +948,14 @@ /** * iavf_set_promiscuous * @adapter: adapter structure - * @flags: bitmask to control unicast/multicast promiscuous. * * Request that the PF enable promiscuous mode for our VSI. **/ -void iavf_set_promiscuous(struct iavf_adapter *adapter, int flags) +void iavf_set_promiscuous(struct iavf_adapter *adapter) { + struct net_device *netdev = adapter->netdev; struct virtchnl_promisc_info vpi; - int promisc_all; + unsigned int flags; if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { /* bail because we already have a command pending */ @@ -964,36 +964,57 @@ return; } - promisc_all = FLAG_VF_UNICAST_PROMISC | - FLAG_VF_MULTICAST_PROMISC; - if ((flags & promisc_all) == promisc_all) { - adapter->flags |= IAVF_FLAG_PROMISC_ON; - adapter->aq_required &= ~IAVF_FLAG_AQ_REQUEST_PROMISC; - dev_info(&adapter->pdev->dev, "Entering promiscuous mode\n"); - } + /* prevent changes to promiscuous flags */ + spin_lock_bh(&adapter->current_netdev_promisc_flags_lock); - if (flags & FLAG_VF_MULTICAST_PROMISC) { - adapter->flags |= IAVF_FLAG_ALLMULTI_ON; - adapter->aq_required &= ~IAVF_FLAG_AQ_REQUEST_ALLMULTI; - dev_info(&adapter->pdev->dev, "%s is entering multicast promiscuous mode\n", - adapter->netdev->name); + /* sanity check to prevent duplicate AQ calls */ + if (!iavf_promiscuous_mode_changed(adapter)) { + adapter->aq_required &= ~IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE; + dev_dbg(&adapter->pdev->dev, "No change in promiscuous mode\n"); + /* allow changes to promiscuous flags */ + spin_unlock_bh(&adapter->current_netdev_promisc_flags_lock); + return; } - if (!flags) { - if (adapter->flags & IAVF_FLAG_PROMISC_ON) { - adapter->flags &= ~IAVF_FLAG_PROMISC_ON; - adapter->aq_required &= ~IAVF_FLAG_AQ_RELEASE_PROMISC; - dev_info(&adapter->pdev->dev, "Leaving promiscuous mode\n"); - } - - if (adapter->flags & IAVF_FLAG_ALLMULTI_ON) { - adapter->flags &= ~IAVF_FLAG_ALLMULTI_ON; - adapter->aq_required &= ~IAVF_FLAG_AQ_RELEASE_ALLMULTI; - dev_info(&adapter->pdev->dev, "%s is leaving multicast promiscuous mode\n", - adapter->netdev->name); - } + /* there are 2 bits, but only 3 states */ + if (!(netdev->flags & IFF_PROMISC) && + netdev->flags & IFF_ALLMULTI) { + /* State 1 - only multicast promiscuous mode enabled + * - !IFF_PROMISC && IFF_ALLMULTI + */ + flags = FLAG_VF_MULTICAST_PROMISC; + adapter->current_netdev_promisc_flags |= IFF_ALLMULTI; + adapter->current_netdev_promisc_flags &= ~IFF_PROMISC; + dev_info(&adapter->pdev->dev, "Entering multicast promiscuous mode\n"); + } else if (!(netdev->flags & IFF_PROMISC) && + !(netdev->flags & IFF_ALLMULTI)) { + /* State 2 - unicast/multicast promiscuous mode disabled + * - !IFF_PROMISC && !IFF_ALLMULTI + */ + flags = 0; + adapter->current_netdev_promisc_flags &= + ~(IFF_PROMISC | IFF_ALLMULTI); + dev_info(&adapter->pdev->dev, "Leaving promiscuous mode\n"); + } else { + /* State 3 - unicast/multicast promiscuous mode enabled + * - IFF_PROMISC && IFF_ALLMULTI + * - IFF_PROMISC && !IFF_ALLMULTI + */ + flags = FLAG_VF_UNICAST_PROMISC | FLAG_VF_MULTICAST_PROMISC; + adapter->current_netdev_promisc_flags |= IFF_PROMISC; + if (netdev->flags & IFF_ALLMULTI) + adapter->current_netdev_promisc_flags |= IFF_ALLMULTI; + else + adapter->current_netdev_promisc_flags &= ~IFF_ALLMULTI; + + dev_info(&adapter->pdev->dev, "Entering promiscuous mode\n"); } + adapter->aq_required &= ~IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE; + + /* allow changes to promiscuous flags */ + spin_unlock_bh(&adapter->current_netdev_promisc_flags_lock); + adapter->current_op = VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE; vpi.vsi_id = adapter->vsi_res->vsi_id; vpi.flags = flags; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/ice/ice.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice.h @@ -200,6 +200,8 @@ ICE_F_PTP_EXTTS, ICE_F_SMA_CTRL, ICE_F_GNSS, + ICE_F_ROCE_LAG, + ICE_F_SRIOV_LAG, ICE_F_MAX }; @@ -567,6 +569,7 @@ struct mutex sw_mutex; /* lock for protecting VSI alloc flow */ struct mutex tc_mutex; /* lock to protect TC changes */ struct mutex adev_mutex; /* lock to protect aux device access */ + struct mutex lag_mutex; /* protect ice_lag struct in PF */ u32 msg_enable; struct ice_ptp ptp; struct gnss_serial *gnss_serial; @@ -636,6 +639,8 @@ struct ice_agg_node vf_agg_node[ICE_MAX_VF_AGG_NODES]; }; +extern struct workqueue_struct *ice_lag_wq; + struct ice_netdev_priv { struct ice_vsi *vsi; struct ice_repr *repr; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h @@ -120,6 +120,9 @@ #define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076 #define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077 #define ICE_AQC_CAPS_NVM_MGMT 0x0080 +#define ICE_AQC_CAPS_FW_LAG_SUPPORT 0x0092 +#define ICE_AQC_BIT_ROCEV2_LAG 0x01 +#define ICE_AQC_BIT_SRIOV_LAG 0x02 u8 major_ver; u8 minor_ver; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/ice/ice_common.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice_common.c @@ -2241,6 +2241,14 @@ "%s: reset_restrict_support = %d\n", prefix, caps->reset_restrict_support); break; + case ICE_AQC_CAPS_FW_LAG_SUPPORT: + caps->roce_lag = !!(number & ICE_AQC_BIT_ROCEV2_LAG); + ice_debug(hw, ICE_DBG_INIT, "%s: roce_lag = %u\n", + prefix, caps->roce_lag); + caps->sriov_lag = !!(number & ICE_AQC_BIT_SRIOV_LAG); + ice_debug(hw, ICE_DBG_INIT, "%s: sriov_lag = %u\n", + prefix, caps->sriov_lag); + break; default: /* Not one of the recognized common capabilities */ found = false; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/ice/ice_lag.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice_lag.c @@ -4,8 +4,12 @@ /* Link Aggregation code */ #include "ice.h" +#include "ice_lib.h" #include "ice_lag.h" +#define ICE_LAG_RES_SHARED BIT(14) +#define ICE_LAG_RES_VALID BIT(15) + /** * ice_lag_set_primary - set PF LAG state as Primary * @lag: LAG info struct @@ -226,6 +230,26 @@ } /** + * ice_lag_init_feature_support_flag - Check for NVM support for LAG + * @pf: PF struct + */ +static void ice_lag_init_feature_support_flag(struct ice_pf *pf) +{ + struct ice_hw_common_caps *caps; + + caps = &pf->hw.dev_caps.common_cap; + if (caps->roce_lag) + ice_set_feature_support(pf, ICE_F_ROCE_LAG); + else + ice_clear_feature_support(pf, ICE_F_ROCE_LAG); + + if (caps->sriov_lag) + ice_set_feature_support(pf, ICE_F_SRIOV_LAG); + else + ice_clear_feature_support(pf, ICE_F_SRIOV_LAG); +} + +/** * ice_lag_changeupper_event - handle LAG changeupper event * @lag: LAG info struct * @ptr: opaque pointer data @@ -265,26 +289,6 @@ } /** - * ice_lag_changelower_event - handle LAG changelower event - * @lag: LAG info struct - * @ptr: opaque data pointer - * - * ptr to be cast to netdev_notifier_changelowerstate_info - */ -static void ice_lag_changelower_event(struct ice_lag *lag, void *ptr) -{ - struct net_device *netdev = netdev_notifier_info_to_dev(ptr); - - if (netdev != lag->netdev) - return; - - netdev_dbg(netdev, "bonding info\n"); - - if (!netif_is_lag_port(netdev)) - netdev_dbg(netdev, "CHANGELOWER rcvd, but netdev not in LAG. Bail\n"); -} - -/** * ice_lag_event_handler - handle LAG events from netdev * @notif_blk: notifier block registered by this netdev * @event: event type @@ -310,9 +314,6 @@ case NETDEV_CHANGEUPPER: ice_lag_changeupper_event(lag, ptr); break; - case NETDEV_CHANGELOWERSTATE: - ice_lag_changelower_event(lag, ptr); - break; case NETDEV_BONDING_INFO: ice_lag_info_event(lag, ptr); break; @@ -379,6 +380,10 @@ struct ice_vsi *vsi; int err; + ice_lag_init_feature_support_flag(pf); + if (!ice_is_feature_supported(pf, ICE_F_SRIOV_LAG)) + return 0; + pf->lag = kzalloc(sizeof(*lag), GFP_KERNEL); if (!pf->lag) return -ENOMEM; @@ -435,9 +440,7 @@ if (lag->pf) ice_unregister_lag_handler(lag); - dev_put(lag->upper_netdev); - - dev_put(lag->peer_netdev); + flush_workqueue(ice_lag_wq); kfree(lag); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/ice/ice_lib.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice_lib.c @@ -1201,8 +1201,7 @@ ctxt->info.q_opt_rss = ((lut_type << ICE_AQ_VSI_Q_OPT_RSS_LUT_S) & ICE_AQ_VSI_Q_OPT_RSS_LUT_M) | - ((hash_type << ICE_AQ_VSI_Q_OPT_RSS_HASH_S) & - ICE_AQ_VSI_Q_OPT_RSS_HASH_M); + (hash_type & ICE_AQ_VSI_Q_OPT_RSS_HASH_M); } static void @@ -3970,7 +3969,7 @@ * @pf: pointer to the struct ice_pf instance * @f: feature enum to set */ -static void ice_set_feature_support(struct ice_pf *pf, enum ice_feature f) +void ice_set_feature_support(struct ice_pf *pf, enum ice_feature f) { if (f < 0 || f >= ICE_F_MAX) return; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/ice/ice_lib.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice_lib.h @@ -162,6 +162,7 @@ bool ice_vsi_has_non_zero_vlans(struct ice_vsi *vsi); u16 ice_vsi_num_non_zero_vlans(struct ice_vsi *vsi); bool ice_is_feature_supported(struct ice_pf *pf, enum ice_feature f); +void ice_set_feature_support(struct ice_pf *pf, enum ice_feature f); void ice_clear_feature_support(struct ice_pf *pf, enum ice_feature f); void ice_init_feature_support(struct ice_pf *pf); bool ice_vsi_is_rx_queue_active(struct ice_vsi *vsi); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/ice/ice_type.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/ice/ice_type.h @@ -277,6 +277,8 @@ u8 dcb; u8 ieee_1588; u8 rdma; + u8 roce_lag; + u8 sriov_lag; bool nvm_update_pending_nvm; bool nvm_update_pending_orom; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -2978,11 +2978,15 @@ if (err) goto err_out_w_lock; - igb_update_ethtool_nfc_entry(adapter, input, input->sw_idx); + err = igb_update_ethtool_nfc_entry(adapter, input, input->sw_idx); + if (err) + goto err_out_input_filter; spin_unlock(&adapter->nfc_lock); return 0; +err_out_input_filter: + igb_erase_filter(adapter, input); err_out_w_lock: spin_unlock(&adapter->nfc_lock); err_out: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/mvneta.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/mvneta.c @@ -4790,14 +4790,17 @@ u8 *data) { if (sset == ETH_SS_STATS) { + struct mvneta_port *pp = netdev_priv(netdev); int i; for (i = 0; i < ARRAY_SIZE(mvneta_statistics); i++) memcpy(data + i * ETH_GSTRING_LEN, mvneta_statistics[i].name, ETH_GSTRING_LEN); - data += ETH_GSTRING_LEN * ARRAY_SIZE(mvneta_statistics); - page_pool_ethtool_stats_get_strings(data); + if (!pp->bm_priv) { + data += ETH_GSTRING_LEN * ARRAY_SIZE(mvneta_statistics); + page_pool_ethtool_stats_get_strings(data); + } } } @@ -4915,8 +4918,10 @@ struct page_pool_stats stats = {}; int i; - for (i = 0; i < rxq_number; i++) - page_pool_get_stats(pp->rxqs[i].page_pool, &stats); + for (i = 0; i < rxq_number; i++) { + if (pp->rxqs[i].page_pool) + page_pool_get_stats(pp->rxqs[i].page_pool, &stats); + } page_pool_ethtool_stats_get(data, &stats); } @@ -4932,14 +4937,21 @@ for (i = 0; i < ARRAY_SIZE(mvneta_statistics); i++) *data++ = pp->ethtool_stats[i]; - mvneta_ethtool_pp_stats(pp, data); + if (!pp->bm_priv) + mvneta_ethtool_pp_stats(pp, data); } static int mvneta_ethtool_get_sset_count(struct net_device *dev, int sset) { - if (sset == ETH_SS_STATS) - return ARRAY_SIZE(mvneta_statistics) + - page_pool_ethtool_stats_get_count(); + if (sset == ETH_SS_STATS) { + int count = ARRAY_SIZE(mvneta_statistics); + struct mvneta_port *pp = netdev_priv(dev); + + if (!pp->bm_priv) + count += page_pool_ethtool_stats_get_count(); + + return count; + } return -EOPNOTSUPP; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/mbox.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/mbox.h @@ -235,7 +235,7 @@ M(NPC_INSTALL_FLOW, 0x600d, npc_install_flow, \ npc_install_flow_req, npc_install_flow_rsp) \ M(NPC_DELETE_FLOW, 0x600e, npc_delete_flow, \ - npc_delete_flow_req, msg_rsp) \ + npc_delete_flow_req, npc_delete_flow_rsp) \ M(NPC_MCAM_READ_ENTRY, 0x600f, npc_mcam_read_entry, \ npc_mcam_read_entry_req, \ npc_mcam_read_entry_rsp) \ @@ -1491,6 +1491,8 @@ u8 vtag0_op; u16 vtag1_def; u8 vtag1_op; + /* old counter value */ + u16 cntr_val; }; struct npc_install_flow_rsp { @@ -1506,6 +1508,11 @@ u8 all; /* PF + VFs */ }; +struct npc_delete_flow_rsp { + struct mbox_msghdr hdr; + u16 cntr_val; +}; + struct npc_mcam_read_entry_req { struct mbox_msghdr hdr; u16 entry; /* MCAM entry to read */ @@ -1914,7 +1921,7 @@ u8 tcam_entries; /* RX/TX Tcam entries per mcs block */ u8 secy_entries; /* RX/TX SECY entries per mcs block */ u8 sc_entries; /* RX/TX SC CAM entries per mcs block */ - u8 sa_entries; /* PN table entries = SA entries */ + u16 sa_entries; /* PN table entries = SA entries */ u64 rsvd[16]; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/mcs.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/mcs.c @@ -117,7 +117,7 @@ reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYTAGGEDCTLX(id); stats->pkt_tagged_ctl_cnt = mcs_reg_read(mcs, reg); - reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDORNOTAGX(id); + reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDX(id); stats->pkt_untaged_cnt = mcs_reg_read(mcs, reg); reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYCTLX(id); @@ -215,7 +215,7 @@ reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSCNOTVALIDX(id); stats->pkt_notvalid_cnt = mcs_reg_read(mcs, reg); - reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDOROKX(id); + reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDX(id); stats->pkt_unchecked_cnt = mcs_reg_read(mcs, reg); if (mcs->hw->mcs_blks > 1) { @@ -1219,6 +1219,17 @@ return NULL; } +bool is_mcs_bypass(int mcs_id) +{ + struct mcs *mcs_dev; + + list_for_each_entry(mcs_dev, &mcs_list, mcs_list) { + if (mcs_dev->mcs_id == mcs_id) + return mcs_dev->bypass; + } + return true; +} + void mcs_set_port_cfg(struct mcs *mcs, struct mcs_port_cfg_set_req *req) { u64 val = 0; @@ -1436,7 +1447,7 @@ return err; } -static void mcs_set_external_bypass(struct mcs *mcs, u8 bypass) +static void mcs_set_external_bypass(struct mcs *mcs, bool bypass) { u64 val; @@ -1447,6 +1458,7 @@ else val &= ~BIT_ULL(6); mcs_reg_write(mcs, MCSX_MIL_GLOBAL, val); + mcs->bypass = bypass; } static void mcs_global_cfg(struct mcs *mcs) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/mcs.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/mcs.h @@ -149,6 +149,7 @@ u16 num_vec; void *rvu; u16 *tx_sa_active; + bool bypass; }; struct mcs_ops { @@ -206,6 +207,7 @@ int mcs_alloc_ctrlpktrule(struct rsrc_bmap *rsrc, u16 *pf_map, u16 offset, u16 pcifunc); int mcs_free_ctrlpktrule(struct mcs *mcs, struct mcs_free_ctrl_pkt_rule_req *req); int mcs_ctrlpktrule_write(struct mcs *mcs, struct mcs_ctrl_pkt_rule_write_req *req); +bool is_mcs_bypass(int mcs_id); /* CN10K-B APIs */ void cn10kb_mcs_set_hw_capabilities(struct mcs *mcs); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/mcs_reg.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/mcs_reg.h @@ -810,14 +810,37 @@ offset = 0x9d8ull; \ offset; }) +#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDX(a) ({ \ + u64 offset; \ + \ + offset = 0xee80ull; \ + if (mcs->hw->mcs_blks > 1) \ + offset = 0xe818ull; \ + offset += (a) * 0x8ull; \ + offset; }) + +#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDX(a) ({ \ + u64 offset; \ + \ + offset = 0xa680ull; \ + if (mcs->hw->mcs_blks > 1) \ + offset = 0xd018ull; \ + offset += (a) * 0x8ull; \ + offset; }) + +#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCLATEORDELAYEDX(a) ({ \ + u64 offset; \ + \ + offset = 0xf680ull; \ + if (mcs->hw->mcs_blks > 1) \ + offset = 0xe018ull; \ + offset += (a) * 0x8ull; \ + offset; }) + #define MCSX_CSE_RX_MEM_SLAVE_INOCTETSSCDECRYPTEDX(a) (0xe680ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INOCTETSSCVALIDATEX(a) (0xde80ull + (a) * 0x8ull) -#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDORNOTAGX(a) (0xa680ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYNOTAGX(a) (0xd218 + (a) * 0x8ull) -#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDX(a) (0xd018ull + (a) * 0x8ull) -#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDOROKX(a) (0xee80ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYCTLX(a) (0xb680ull + (a) * 0x8ull) -#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCLATEORDELAYEDX(a) (0xf680ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INPKTSSAINVALIDX(a) (0x12680ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INPKTSSANOTUSINGSAERRORX(a) (0x15680ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INPKTSSANOTVALIDX(a) (0x13680ull + (a) * 0x8ull) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/rvu.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu.c @@ -2631,6 +2631,9 @@ rvu_npc_free_mcam_entries(rvu, pcifunc, -1); rvu_mac_reset(rvu, pcifunc); + if (rvu->mcs_blk_cnt) + rvu_mcs_flr_handler(rvu, pcifunc); + mutex_unlock(&rvu->flr_lock); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/rvu.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu.h @@ -343,6 +343,7 @@ struct nix_txvlan txvlan; struct nix_ipolicer *ipolicer; u64 *tx_credits; + u8 cc_mcs_cnt; }; /* RVU block's capabilities or functionality, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c @@ -1285,7 +1285,7 @@ rvu_dl->devlink_wq = create_workqueue("rvu_devlink_wq"); if (!rvu_dl->devlink_wq) - goto err; + return -ENOMEM; INIT_WORK(&rvu_reporters->intr_work, rvu_npa_intr_work); INIT_WORK(&rvu_reporters->err_work, rvu_npa_err_work); @@ -1293,9 +1293,6 @@ INIT_WORK(&rvu_reporters->ras_work, rvu_npa_ras_work); return 0; -err: - rvu_npa_health_reporters_destroy(rvu_dl); - return -ENOMEM; } static int rvu_npa_health_reporters_create(struct rvu_devlink *rvu_dl) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -389,7 +389,13 @@ int bank, nixlf, index; /* get ucast entry rule entry index */ - nix_get_nixlf(rvu, pf_func, &nixlf, NULL); + if (nix_get_nixlf(rvu, pf_func, &nixlf, NULL)) { + dev_err(rvu->dev, "%s: nixlf not attached to pcifunc:0x%x\n", + __func__, pf_func); + /* Action 0 is drop */ + return 0; + } + index = npc_get_nixlf_mcam_index(mcam, pf_func, nixlf, NIXLF_UCAST_ENTRY); bank = npc_get_bank(mcam, index); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c @@ -1192,7 +1192,7 @@ write_req.enable_entry = (u8)enable; /* if counter is available then clear and use it */ if (req->set_cntr && rule->has_cntr) { - rvu_write64(rvu, blkaddr, NPC_AF_MATCH_STATX(rule->cntr), 0x00); + rvu_write64(rvu, blkaddr, NPC_AF_MATCH_STATX(rule->cntr), req->cntr_val); write_req.set_cntr = 1; write_req.cntr = rule->cntr; } @@ -1407,12 +1407,13 @@ int rvu_mbox_handler_npc_delete_flow(struct rvu *rvu, struct npc_delete_flow_req *req, - struct msg_rsp *rsp) + struct npc_delete_flow_rsp *rsp) { struct npc_mcam *mcam = &rvu->hw->mcam; struct rvu_npc_mcam_rule *iter, *tmp; u16 pcifunc = req->hdr.pcifunc; struct list_head del_list; + int blkaddr; INIT_LIST_HEAD(&del_list); @@ -1428,6 +1429,10 @@ list_move_tail(&iter->list, &del_list); /* single rule */ } else if (req->entry == iter->entry) { + blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); + if (blkaddr) + rsp->cntr_val = rvu_read64(rvu, blkaddr, + NPC_AF_MATCH_STATX(iter->cntr)); list_move_tail(&iter->list, &del_list); break; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.c @@ -31,8 +31,8 @@ {NIX_TXSCH_LVL_TL4, 3, 0xFFFF, {{0x0B00, 0x0B08}, {0x0B10, 0x0B18}, {0x1200, 0x12E0} } }, {NIX_TXSCH_LVL_TL3, 4, 0xFFFF, {{0x1000, 0x10E0}, {0x1600, 0x1608}, - {0x1610, 0x1618}, {0x1700, 0x17B0} } }, - {NIX_TXSCH_LVL_TL2, 2, 0xFFFF, {{0x0E00, 0x0EE0}, {0x1700, 0x17B0} } }, + {0x1610, 0x1618}, {0x1700, 0x17C8} } }, + {NIX_TXSCH_LVL_TL2, 2, 0xFFFF, {{0x0E00, 0x0EE0}, {0x1700, 0x17C8} } }, {NIX_TXSCH_LVL_TL1, 1, 0xFFFF, {{0x0C00, 0x0D98} } }, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h @@ -437,6 +437,7 @@ #define NIX_AF_LINKX_BASE_MASK GENMASK_ULL(11, 0) #define NIX_AF_LINKX_RANGE_MASK GENMASK_ULL(19, 16) +#define NIX_AF_LINKX_MCS_CNT_MASK GENMASK_ULL(33, 32) /* SSO */ #define SSO_AF_CONST (0x1000) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/af/rvu_switch.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_switch.c @@ -158,6 +158,7 @@ struct npc_mcam_alloc_entry_req alloc_req = { 0 }; struct npc_mcam_alloc_entry_rsp alloc_rsp = { 0 }; struct npc_delete_flow_req uninstall_req = { 0 }; + struct npc_delete_flow_rsp uninstall_rsp = { 0 }; struct npc_mcam_free_entry_req free_req = { 0 }; struct rvu_switch *rswitch = &rvu->rswitch; struct msg_rsp rsp; @@ -197,7 +198,7 @@ uninstall_rules: uninstall_req.start = rswitch->start_entry; uninstall_req.end = rswitch->start_entry + rswitch->used_entries - 1; - rvu_mbox_handler_npc_delete_flow(rvu, &uninstall_req, &rsp); + rvu_mbox_handler_npc_delete_flow(rvu, &uninstall_req, &uninstall_rsp); kfree(rswitch->entry2pcifunc); free_entries: free_req.all = 1; @@ -209,6 +210,7 @@ void rvu_switch_disable(struct rvu *rvu) { struct npc_delete_flow_req uninstall_req = { 0 }; + struct npc_delete_flow_rsp uninstall_rsp = { 0 }; struct npc_mcam_free_entry_req free_req = { 0 }; struct rvu_switch *rswitch = &rvu->rswitch; struct rvu_hwinfo *hw = rvu->hw; @@ -250,7 +252,7 @@ uninstall_req.start = rswitch->start_entry; uninstall_req.end = rswitch->start_entry + rswitch->used_entries - 1; free_req.all = 1; - rvu_mbox_handler_npc_delete_flow(rvu, &uninstall_req, &rsp); + rvu_mbox_handler_npc_delete_flow(rvu, &uninstall_req, &uninstall_rsp); rvu_mbox_handler_npc_mcam_free_entry(rvu, &free_req, &rsp); rswitch->used_entries = 0; kfree(rswitch->entry2pcifunc); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c @@ -41,7 +41,6 @@ return 0; otx2_alloc_mcam_entries(pfvf, ctx->val.vu16); - otx2_tc_alloc_ent_bitmap(pfvf); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c @@ -334,9 +334,12 @@ if (is_otx2_lbkvf(pfvf->pdev)) return; + mutex_lock(&pfvf->mbox.lock); req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox); - if (!req) + if (!req) { + mutex_unlock(&pfvf->mbox.lock); return; + } if (!otx2_sync_mbox_msg(&pfvf->mbox)) { rsp = (struct cgx_pause_frm_cfg *) @@ -344,6 +347,7 @@ pause->rx_pause = rsp->rx_pause; pause->tx_pause = rsp->tx_pause; } + mutex_unlock(&pfvf->mbox.lock); } static int otx2_set_pauseparam(struct net_device *netdev, @@ -764,6 +768,7 @@ struct otx2_nic *pfvf = netdev_priv(dev); int ret = -EOPNOTSUPP; + pfvf->flow_cfg->ntuple = ntuple; switch (nfc->cmd) { case ETHTOOL_SRXFH: ret = otx2_set_rss_hash_opts(pfvf, nfc); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c @@ -276,6 +276,7 @@ flow_cfg = pfvf->flow_cfg; INIT_LIST_HEAD(&flow_cfg->flow_list); + INIT_LIST_HEAD(&flow_cfg->flow_list_tc); flow_cfg->max_flows = 0; return 0; @@ -298,6 +299,7 @@ return -ENOMEM; INIT_LIST_HEAD(&pf->flow_cfg->flow_list); + INIT_LIST_HEAD(&pf->flow_cfg->flow_list_tc); /* Allocate bare minimum number of MCAM entries needed for * unicast and ntuple filters. @@ -1086,6 +1088,7 @@ struct ethhdr *eth_hdr; bool new = false; int err = 0; + u64 vf_num; u32 ring; if (!flow_cfg->max_flows) { @@ -1098,7 +1101,21 @@ if (!(pfvf->flags & OTX2_FLAG_NTUPLE_SUPPORT)) return -ENOMEM; - if (ring >= pfvf->hw.rx_queues && fsp->ring_cookie != RX_CLS_FLOW_DISC) + /* Number of queues on a VF can be greater or less than + * the PF's queue. Hence no need to check for the + * queue count. Hence no need to check queue count if PF + * is installing for its VF. Below is the expected vf_num value + * based on the ethtool commands. + * + * e.g. + * 1. ethtool -U ... action -1 ==> vf_num:255 + * 2. ethtool -U ... action ==> vf_num:0 + * 3. ethtool -U ... vf queue ==> + * vf_num:vf_idx+1 + */ + vf_num = ethtool_get_flow_spec_ring_vf(fsp->ring_cookie); + if (!is_otx2_vf(pfvf->pcifunc) && !vf_num && + ring >= pfvf->hw.rx_queues && fsp->ring_cookie != RX_CLS_FLOW_DISC) return -EINVAL; if (fsp->location >= otx2_get_maxflows(flow_cfg)) @@ -1180,6 +1197,9 @@ flow_cfg->nr_flows++; } + if (flow->is_vf) + netdev_info(pfvf->netdev, + "Make sure that VF's queue number is within its queue limit\n"); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/nic/otx2_struct.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_struct.h @@ -318,23 +318,23 @@ NIX_SND_STATUS_EXT_ERR = 0x6, NIX_SND_STATUS_JUMP_FAULT = 0x7, NIX_SND_STATUS_JUMP_POISON = 0x8, - NIX_SND_STATUS_CRC_ERR = 0x9, - NIX_SND_STATUS_IMM_ERR = 0x10, - NIX_SND_STATUS_SG_ERR = 0x11, - NIX_SND_STATUS_MEM_ERR = 0x12, - NIX_SND_STATUS_INVALID_SUBDC = 0x13, - NIX_SND_STATUS_SUBDC_ORDER_ERR = 0x14, - NIX_SND_STATUS_DATA_FAULT = 0x15, - NIX_SND_STATUS_DATA_POISON = 0x16, - NIX_SND_STATUS_NPC_DROP_ACTION = 0x17, - NIX_SND_STATUS_LOCK_VIOL = 0x18, - NIX_SND_STATUS_NPC_UCAST_CHAN_ERR = 0x19, - NIX_SND_STATUS_NPC_MCAST_CHAN_ERR = 0x20, - NIX_SND_STATUS_NPC_MCAST_ABORT = 0x21, - NIX_SND_STATUS_NPC_VTAG_PTR_ERR = 0x22, - NIX_SND_STATUS_NPC_VTAG_SIZE_ERR = 0x23, - NIX_SND_STATUS_SEND_MEM_FAULT = 0x24, - NIX_SND_STATUS_SEND_STATS_ERR = 0x25, + NIX_SND_STATUS_CRC_ERR = 0x10, + NIX_SND_STATUS_IMM_ERR = 0x11, + NIX_SND_STATUS_SG_ERR = 0x12, + NIX_SND_STATUS_MEM_ERR = 0x13, + NIX_SND_STATUS_INVALID_SUBDC = 0x14, + NIX_SND_STATUS_SUBDC_ORDER_ERR = 0x15, + NIX_SND_STATUS_DATA_FAULT = 0x16, + NIX_SND_STATUS_DATA_POISON = 0x17, + NIX_SND_STATUS_NPC_DROP_ACTION = 0x20, + NIX_SND_STATUS_LOCK_VIOL = 0x21, + NIX_SND_STATUS_NPC_UCAST_CHAN_ERR = 0x22, + NIX_SND_STATUS_NPC_MCAST_CHAN_ERR = 0x23, + NIX_SND_STATUS_NPC_MCAST_ABORT = 0x24, + NIX_SND_STATUS_NPC_VTAG_PTR_ERR = 0x25, + NIX_SND_STATUS_NPC_VTAG_SIZE_ERR = 0x26, + NIX_SND_STATUS_SEND_MEM_FAULT = 0x27, + NIX_SND_STATUS_SEND_STATS_ERR = 0x28, NIX_SND_STATUS_MAX, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c @@ -34,9 +34,8 @@ }; struct otx2_tc_flow { - struct rhash_head node; + struct list_head list; unsigned long cookie; - unsigned int bitpos; struct rcu_head rcu; struct otx2_tc_flow_stats stats; spinlock_t lock; /* lock for stats */ @@ -44,31 +43,13 @@ u16 entry; u16 leaf_profile; bool is_act_police; + u32 prio; + struct npc_install_flow_req req; + u64 rate; + u32 burst; + bool is_pps; }; -int otx2_tc_alloc_ent_bitmap(struct otx2_nic *nic) -{ - struct otx2_tc_info *tc = &nic->tc_info; - - if (!nic->flow_cfg->max_flows) - return 0; - - /* Max flows changed, free the existing bitmap */ - kfree(tc->tc_entries_bitmap); - - tc->tc_entries_bitmap = - kcalloc(BITS_TO_LONGS(nic->flow_cfg->max_flows), - sizeof(long), GFP_KERNEL); - if (!tc->tc_entries_bitmap) { - netdev_err(nic->netdev, - "Unable to alloc TC flow entries bitmap\n"); - return -ENOMEM; - } - - return 0; -} -EXPORT_SYMBOL(otx2_tc_alloc_ent_bitmap); - static void otx2_get_egress_burst_cfg(struct otx2_nic *nic, u32 burst, u32 *burst_exp, u32 *burst_mantissa) { @@ -304,21 +285,10 @@ return err; } -static int otx2_tc_act_set_police(struct otx2_nic *nic, - struct otx2_tc_flow *node, - struct flow_cls_offload *f, - u64 rate, u32 burst, u32 mark, - struct npc_install_flow_req *req, bool pps) +static int otx2_tc_act_set_hw_police(struct otx2_nic *nic, + struct otx2_tc_flow *node) { - struct netlink_ext_ack *extack = f->common.extack; - struct otx2_hw *hw = &nic->hw; - int rq_idx, rc; - - rq_idx = find_first_zero_bit(&nic->rq_bmap, hw->rx_queues); - if (rq_idx >= hw->rx_queues) { - NL_SET_ERR_MSG_MOD(extack, "Police action rules exceeded"); - return -EINVAL; - } + int rc; mutex_lock(&nic->mbox.lock); @@ -328,23 +298,17 @@ return rc; } - rc = cn10k_set_ipolicer_rate(nic, node->leaf_profile, burst, rate, pps); + rc = cn10k_set_ipolicer_rate(nic, node->leaf_profile, + node->burst, node->rate, node->is_pps); if (rc) goto free_leaf; - rc = cn10k_map_unmap_rq_policer(nic, rq_idx, node->leaf_profile, true); + rc = cn10k_map_unmap_rq_policer(nic, node->rq, node->leaf_profile, true); if (rc) goto free_leaf; mutex_unlock(&nic->mbox.lock); - req->match_id = mark & 0xFFFFULL; - req->index = rq_idx; - req->op = NIX_RX_ACTIONOP_UCAST; - set_bit(rq_idx, &nic->rq_bmap); - node->is_act_police = true; - node->rq = rq_idx; - return 0; free_leaf: @@ -356,6 +320,39 @@ return rc; } +static int otx2_tc_act_set_police(struct otx2_nic *nic, + struct otx2_tc_flow *node, + struct flow_cls_offload *f, + u64 rate, u32 burst, u32 mark, + struct npc_install_flow_req *req, bool pps) +{ + struct netlink_ext_ack *extack = f->common.extack; + struct otx2_hw *hw = &nic->hw; + int rq_idx, rc; + + rq_idx = find_first_zero_bit(&nic->rq_bmap, hw->rx_queues); + if (rq_idx >= hw->rx_queues) { + NL_SET_ERR_MSG_MOD(extack, "Police action rules exceeded"); + return -EINVAL; + } + + req->match_id = mark & 0xFFFFULL; + req->index = rq_idx; + req->op = NIX_RX_ACTIONOP_UCAST; + + node->is_act_police = true; + node->rq = rq_idx; + node->burst = burst; + node->rate = rate; + node->is_pps = pps; + + rc = otx2_tc_act_set_hw_police(nic, node); + if (!rc) + set_bit(rq_idx, &nic->rq_bmap); + + return rc; +} + static int otx2_tc_parse_actions(struct otx2_nic *nic, struct flow_action *flow_action, struct npc_install_flow_req *req, @@ -707,8 +704,117 @@ return otx2_tc_parse_actions(nic, &rule->action, req, f, node); } -static int otx2_del_mcam_flow_entry(struct otx2_nic *nic, u16 entry) +static void otx2_destroy_tc_flow_list(struct otx2_nic *pfvf) +{ + struct otx2_flow_config *flow_cfg = pfvf->flow_cfg; + struct otx2_tc_flow *iter, *tmp; + + if (!(pfvf->flags & OTX2_FLAG_MCAM_ENTRIES_ALLOC)) + return; + + list_for_each_entry_safe(iter, tmp, &flow_cfg->flow_list_tc, list) { + list_del(&iter->list); + kfree(iter); + flow_cfg->nr_flows--; + } +} + +static struct otx2_tc_flow *otx2_tc_get_entry_by_cookie(struct otx2_flow_config *flow_cfg, + unsigned long cookie) +{ + struct otx2_tc_flow *tmp; + + list_for_each_entry(tmp, &flow_cfg->flow_list_tc, list) { + if (tmp->cookie == cookie) + return tmp; + } + + return NULL; +} + +static struct otx2_tc_flow *otx2_tc_get_entry_by_index(struct otx2_flow_config *flow_cfg, + int index) +{ + struct otx2_tc_flow *tmp; + int i = 0; + + list_for_each_entry(tmp, &flow_cfg->flow_list_tc, list) { + if (i == index) + return tmp; + i++; + } + + return NULL; +} + +static void otx2_tc_del_from_flow_list(struct otx2_flow_config *flow_cfg, + struct otx2_tc_flow *node) +{ + struct list_head *pos, *n; + struct otx2_tc_flow *tmp; + + list_for_each_safe(pos, n, &flow_cfg->flow_list_tc) { + tmp = list_entry(pos, struct otx2_tc_flow, list); + if (node == tmp) { + list_del(&node->list); + return; + } + } +} + +static int otx2_tc_add_to_flow_list(struct otx2_flow_config *flow_cfg, + struct otx2_tc_flow *node) +{ + struct list_head *pos, *n; + struct otx2_tc_flow *tmp; + int index = 0; + + /* If the flow list is empty then add the new node */ + if (list_empty(&flow_cfg->flow_list_tc)) { + list_add(&node->list, &flow_cfg->flow_list_tc); + return index; + } + + list_for_each_safe(pos, n, &flow_cfg->flow_list_tc) { + tmp = list_entry(pos, struct otx2_tc_flow, list); + if (node->prio < tmp->prio) + break; + index++; + } + + list_add(&node->list, pos->prev); + return index; +} + +static int otx2_add_mcam_flow_entry(struct otx2_nic *nic, struct npc_install_flow_req *req) +{ + struct npc_install_flow_req *tmp_req; + int err; + + mutex_lock(&nic->mbox.lock); + tmp_req = otx2_mbox_alloc_msg_npc_install_flow(&nic->mbox); + if (!tmp_req) { + mutex_unlock(&nic->mbox.lock); + return -ENOMEM; + } + + memcpy(tmp_req, req, sizeof(struct npc_install_flow_req)); + /* Send message to AF */ + err = otx2_sync_mbox_msg(&nic->mbox); + if (err) { + netdev_err(nic->netdev, "Failed to install MCAM flow entry %d\n", + req->entry); + mutex_unlock(&nic->mbox.lock); + return -EFAULT; + } + + mutex_unlock(&nic->mbox.lock); + return 0; +} + +static int otx2_del_mcam_flow_entry(struct otx2_nic *nic, u16 entry, u16 *cntr_val) { + struct npc_delete_flow_rsp *rsp; struct npc_delete_flow_req *req; int err; @@ -729,22 +835,113 @@ mutex_unlock(&nic->mbox.lock); return -EFAULT; } + + if (cntr_val) { + rsp = (struct npc_delete_flow_rsp *)otx2_mbox_get_rsp(&nic->mbox.mbox, + 0, &req->hdr); + if (IS_ERR(rsp)) { + netdev_err(nic->netdev, "Failed to get MCAM delete response for entry %d\n", + entry); + mutex_unlock(&nic->mbox.lock); + return -EFAULT; + } + + *cntr_val = rsp->cntr_val; + } + mutex_unlock(&nic->mbox.lock); + return 0; +} + +static int otx2_tc_update_mcam_table_del_req(struct otx2_nic *nic, + struct otx2_flow_config *flow_cfg, + struct otx2_tc_flow *node) +{ + struct list_head *pos, *n; + struct otx2_tc_flow *tmp; + int i = 0, index = 0; + u16 cntr_val = 0; + + /* Find and delete the entry from the list and re-install + * all the entries from beginning to the index of the + * deleted entry to higher mcam indexes. + */ + list_for_each_safe(pos, n, &flow_cfg->flow_list_tc) { + tmp = list_entry(pos, struct otx2_tc_flow, list); + if (node == tmp) { + list_del(&tmp->list); + break; + } + + otx2_del_mcam_flow_entry(nic, tmp->entry, &cntr_val); + tmp->entry++; + tmp->req.entry = tmp->entry; + tmp->req.cntr_val = cntr_val; + index++; + } + + list_for_each_safe(pos, n, &flow_cfg->flow_list_tc) { + if (i == index) + break; + + tmp = list_entry(pos, struct otx2_tc_flow, list); + otx2_add_mcam_flow_entry(nic, &tmp->req); + i++; + } return 0; } +static int otx2_tc_update_mcam_table_add_req(struct otx2_nic *nic, + struct otx2_flow_config *flow_cfg, + struct otx2_tc_flow *node) +{ + int mcam_idx = flow_cfg->max_flows - flow_cfg->nr_flows - 1; + struct otx2_tc_flow *tmp; + int list_idx, i; + u16 cntr_val = 0; + + /* Find the index of the entry(list_idx) whose priority + * is greater than the new entry and re-install all + * the entries from beginning to list_idx to higher + * mcam indexes. + */ + list_idx = otx2_tc_add_to_flow_list(flow_cfg, node); + for (i = 0; i < list_idx; i++) { + tmp = otx2_tc_get_entry_by_index(flow_cfg, i); + if (!tmp) + return -ENOMEM; + + otx2_del_mcam_flow_entry(nic, tmp->entry, &cntr_val); + tmp->entry = flow_cfg->flow_ent[mcam_idx]; + tmp->req.entry = tmp->entry; + tmp->req.cntr_val = cntr_val; + otx2_add_mcam_flow_entry(nic, &tmp->req); + mcam_idx++; + } + + return mcam_idx; +} + +static int otx2_tc_update_mcam_table(struct otx2_nic *nic, + struct otx2_flow_config *flow_cfg, + struct otx2_tc_flow *node, + bool add_req) +{ + if (add_req) + return otx2_tc_update_mcam_table_add_req(nic, flow_cfg, node); + + return otx2_tc_update_mcam_table_del_req(nic, flow_cfg, node); +} + static int otx2_tc_del_flow(struct otx2_nic *nic, struct flow_cls_offload *tc_flow_cmd) { struct otx2_flow_config *flow_cfg = nic->flow_cfg; - struct otx2_tc_info *tc_info = &nic->tc_info; struct otx2_tc_flow *flow_node; int err; - flow_node = rhashtable_lookup_fast(&tc_info->flow_table, - &tc_flow_cmd->cookie, - tc_info->flow_ht_params); + flow_node = otx2_tc_get_entry_by_cookie(flow_cfg, tc_flow_cmd->cookie); if (!flow_node) { netdev_err(nic->netdev, "tc flow not found for cookie 0x%lx\n", tc_flow_cmd->cookie); @@ -752,6 +949,11 @@ } if (flow_node->is_act_police) { + __clear_bit(flow_node->rq, &nic->rq_bmap); + + if (nic->flags & OTX2_FLAG_INTF_DOWN) + goto free_mcam_flow; + mutex_lock(&nic->mbox.lock); err = cn10k_map_unmap_rq_policer(nic, flow_node->rq, @@ -767,21 +969,14 @@ "Unable to free leaf bandwidth profile(%d)\n", flow_node->leaf_profile); - __clear_bit(flow_node->rq, &nic->rq_bmap); - mutex_unlock(&nic->mbox.lock); } - otx2_del_mcam_flow_entry(nic, flow_node->entry); - - WARN_ON(rhashtable_remove_fast(&nic->tc_info.flow_table, - &flow_node->node, - nic->tc_info.flow_ht_params)); +free_mcam_flow: + otx2_del_mcam_flow_entry(nic, flow_node->entry, NULL); + otx2_tc_update_mcam_table(nic, flow_cfg, flow_node, false); kfree_rcu(flow_node, rcu); - - clear_bit(flow_node->bitpos, tc_info->tc_entries_bitmap); flow_cfg->nr_flows--; - return 0; } @@ -790,15 +985,19 @@ { struct netlink_ext_ack *extack = tc_flow_cmd->common.extack; struct otx2_flow_config *flow_cfg = nic->flow_cfg; - struct otx2_tc_info *tc_info = &nic->tc_info; struct otx2_tc_flow *new_node, *old_node; struct npc_install_flow_req *req, dummy; - int rc, err; + int rc, err, mcam_idx; if (!(nic->flags & OTX2_FLAG_TC_FLOWER_SUPPORT)) return -ENOMEM; - if (bitmap_full(tc_info->tc_entries_bitmap, flow_cfg->max_flows)) { + if (nic->flags & OTX2_FLAG_INTF_DOWN) { + NL_SET_ERR_MSG_MOD(extack, "Interface not initialized"); + return -EINVAL; + } + + if (flow_cfg->nr_flows == flow_cfg->max_flows) { NL_SET_ERR_MSG_MOD(extack, "Free MCAM entry not available to add the flow"); return -ENOMEM; @@ -810,6 +1009,7 @@ return -ENOMEM; spin_lock_init(&new_node->lock); new_node->cookie = tc_flow_cmd->cookie; + new_node->prio = tc_flow_cmd->common.prio; memset(&dummy, 0, sizeof(struct npc_install_flow_req)); @@ -820,12 +1020,11 @@ } /* If a flow exists with the same cookie, delete it */ - old_node = rhashtable_lookup_fast(&tc_info->flow_table, - &tc_flow_cmd->cookie, - tc_info->flow_ht_params); + old_node = otx2_tc_get_entry_by_cookie(flow_cfg, tc_flow_cmd->cookie); if (old_node) otx2_tc_del_flow(nic, tc_flow_cmd); + mcam_idx = otx2_tc_update_mcam_table(nic, flow_cfg, new_node, true); mutex_lock(&nic->mbox.lock); req = otx2_mbox_alloc_msg_npc_install_flow(&nic->mbox); if (!req) { @@ -836,11 +1035,8 @@ memcpy(&dummy.hdr, &req->hdr, sizeof(struct mbox_msghdr)); memcpy(req, &dummy, sizeof(struct npc_install_flow_req)); - - new_node->bitpos = find_first_zero_bit(tc_info->tc_entries_bitmap, - flow_cfg->max_flows); req->channel = nic->hw.rx_chan_base; - req->entry = flow_cfg->flow_ent[flow_cfg->max_flows - new_node->bitpos - 1]; + req->entry = flow_cfg->flow_ent[mcam_idx]; req->intf = NIX_INTF_RX; req->set_cntr = 1; new_node->entry = req->entry; @@ -850,26 +1046,18 @@ if (rc) { NL_SET_ERR_MSG_MOD(extack, "Failed to install MCAM flow entry"); mutex_unlock(&nic->mbox.lock); - kfree_rcu(new_node, rcu); goto free_leaf; } - mutex_unlock(&nic->mbox.lock); - /* add new flow to flow-table */ - rc = rhashtable_insert_fast(&nic->tc_info.flow_table, &new_node->node, - nic->tc_info.flow_ht_params); - if (rc) { - otx2_del_mcam_flow_entry(nic, req->entry); - kfree_rcu(new_node, rcu); - goto free_leaf; - } + mutex_unlock(&nic->mbox.lock); + memcpy(&new_node->req, req, sizeof(struct npc_install_flow_req)); - set_bit(new_node->bitpos, tc_info->tc_entries_bitmap); flow_cfg->nr_flows++; - return 0; free_leaf: + otx2_tc_del_from_flow_list(flow_cfg, new_node); + kfree_rcu(new_node, rcu); if (new_node->is_act_police) { mutex_lock(&nic->mbox.lock); @@ -896,16 +1084,13 @@ static int otx2_tc_get_flow_stats(struct otx2_nic *nic, struct flow_cls_offload *tc_flow_cmd) { - struct otx2_tc_info *tc_info = &nic->tc_info; struct npc_mcam_get_stats_req *req; struct npc_mcam_get_stats_rsp *rsp; struct otx2_tc_flow_stats *stats; struct otx2_tc_flow *flow_node; int err; - flow_node = rhashtable_lookup_fast(&tc_info->flow_table, - &tc_flow_cmd->cookie, - tc_info->flow_ht_params); + flow_node = otx2_tc_get_entry_by_cookie(nic->flow_cfg, tc_flow_cmd->cookie); if (!flow_node) { netdev_info(nic->netdev, "tc flow not found for cookie %lx", tc_flow_cmd->cookie); @@ -1053,12 +1238,20 @@ void *type_data, void *cb_priv) { struct otx2_nic *nic = cb_priv; + bool ntuple; if (!tc_cls_can_offload_and_chain0(nic->netdev, type_data)) return -EOPNOTSUPP; + ntuple = nic->netdev->features & NETIF_F_NTUPLE; switch (type) { case TC_SETUP_CLSFLOWER: + if (ntuple) { + netdev_warn(nic->netdev, + "Can't install TC flower offload rule when NTUPLE is active"); + return -EOPNOTSUPP; + } + return otx2_setup_tc_cls_flower(nic, type_data); case TC_SETUP_CLSMATCHALL: return otx2_setup_tc_ingress_matchall(nic, type_data); @@ -1143,18 +1336,8 @@ } EXPORT_SYMBOL(otx2_setup_tc); -static const struct rhashtable_params tc_flow_ht_params = { - .head_offset = offsetof(struct otx2_tc_flow, node), - .key_offset = offsetof(struct otx2_tc_flow, cookie), - .key_len = sizeof(((struct otx2_tc_flow *)0)->cookie), - .automatic_shrinking = true, -}; - int otx2_init_tc(struct otx2_nic *nic) { - struct otx2_tc_info *tc = &nic->tc_info; - int err; - /* Exclude receive queue 0 being used for police action */ set_bit(0, &nic->rq_bmap); @@ -1164,25 +1347,54 @@ return -EINVAL; } - err = otx2_tc_alloc_ent_bitmap(nic); - if (err) - return err; - - tc->flow_ht_params = tc_flow_ht_params; - err = rhashtable_init(&tc->flow_table, &tc->flow_ht_params); - if (err) { - kfree(tc->tc_entries_bitmap); - tc->tc_entries_bitmap = NULL; - } - return err; + return 0; } EXPORT_SYMBOL(otx2_init_tc); void otx2_shutdown_tc(struct otx2_nic *nic) { - struct otx2_tc_info *tc = &nic->tc_info; - - kfree(tc->tc_entries_bitmap); - rhashtable_destroy(&tc->flow_table); + otx2_destroy_tc_flow_list(nic); } EXPORT_SYMBOL(otx2_shutdown_tc); + +static void otx2_tc_config_ingress_rule(struct otx2_nic *nic, + struct otx2_tc_flow *node) +{ + struct npc_install_flow_req *req; + + if (otx2_tc_act_set_hw_police(nic, node)) + return; + + mutex_lock(&nic->mbox.lock); + + req = otx2_mbox_alloc_msg_npc_install_flow(&nic->mbox); + if (!req) + goto err; + + memcpy(req, &node->req, sizeof(struct npc_install_flow_req)); + + if (otx2_sync_mbox_msg(&nic->mbox)) + netdev_err(nic->netdev, + "Failed to install MCAM flow entry for ingress rule"); +err: + mutex_unlock(&nic->mbox.lock); +} + +void otx2_tc_apply_ingress_police_rules(struct otx2_nic *nic) +{ + struct otx2_flow_config *flow_cfg = nic->flow_cfg; + struct otx2_tc_flow *node; + + /* If any ingress policer rules exist for the interface then + * apply those rules. Ingress policer rules depend on bandwidth + * profiles linked to the receive queues. Since no receive queues + * exist when interface is down, ingress policer rules are stored + * and configured in hardware after all receive queues are allocated + * in otx2_open. + */ + list_for_each_entry(node, &flow_cfg->flow_list_tc, list) { + if (node->is_act_police) + otx2_tc_config_ingress_rule(nic, node); + } +} +EXPORT_SYMBOL(otx2_tc_apply_ingress_police_rules); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/marvell/sky2.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/marvell/sky2.h @@ -2195,7 +2195,7 @@ struct sk_buff *skb; dma_addr_t data_addr; DEFINE_DMA_UNMAP_LEN(data_size); - dma_addr_t frag_addr[ETH_JUMBO_MTU >> PAGE_SHIFT]; + dma_addr_t frag_addr[ETH_JUMBO_MTU >> PAGE_SHIFT ?: 1]; }; enum flow_control { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mediatek/mtk_wed_regs.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mediatek/mtk_wed_regs.h @@ -64,8 +64,8 @@ #define MTK_WED_EXT_INT_STATUS_TKID_TITO_INVALID BIT(4) #define MTK_WED_EXT_INT_STATUS_TX_FBUF_LO_TH BIT(8) #define MTK_WED_EXT_INT_STATUS_TX_FBUF_HI_TH BIT(9) -#define MTK_WED_EXT_INT_STATUS_RX_FBUF_LO_TH BIT(12) -#define MTK_WED_EXT_INT_STATUS_RX_FBUF_HI_TH BIT(13) +#define MTK_WED_EXT_INT_STATUS_RX_FBUF_LO_TH BIT(10) /* wed v2 */ +#define MTK_WED_EXT_INT_STATUS_RX_FBUF_HI_TH BIT(11) /* wed v2 */ #define MTK_WED_EXT_INT_STATUS_RX_DRV_R_RESP_ERR BIT(16) #define MTK_WED_EXT_INT_STATUS_RX_DRV_W_RESP_ERR BIT(17) #define MTK_WED_EXT_INT_STATUS_RX_DRV_COHERENT BIT(18) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c @@ -848,7 +848,7 @@ mlx5_core_dbg(tracer->dev, "FWTracer: ownership changed, current=(%d)\n", tracer->owner); if (tracer->owner) { - tracer->owner = false; + mlx5_fw_tracer_ownership_acquire(tracer); return; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/health.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en/health.h @@ -18,6 +18,7 @@ void mlx5e_reporter_tx_destroy(struct mlx5e_priv *priv); void mlx5e_reporter_tx_err_cqe(struct mlx5e_txqsq *sq); int mlx5e_reporter_tx_timeout(struct mlx5e_txqsq *sq); +void mlx5e_reporter_tx_ptpsq_unhealthy(struct mlx5e_ptpsq *ptpsq); int mlx5e_health_cq_diag_fmsg(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg); int mlx5e_health_cq_common_diag_fmsg(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c @@ -2,9 +2,12 @@ // Copyright (c) 2020 Mellanox Technologies #include "en/ptp.h" +#include "en/health.h" #include "en/txrx.h" #include "en/params.h" #include "en/fs_tt_redirect.h" +#include +#include struct mlx5e_ptp_fs { struct mlx5_flow_handle *l2_rule; @@ -19,6 +22,48 @@ struct mlx5e_rq_param rq_param; }; +struct mlx5e_ptp_port_ts_cqe_tracker { + u8 metadata_id; + bool inuse : 1; + struct list_head entry; +}; + +struct mlx5e_ptp_port_ts_cqe_list { + struct mlx5e_ptp_port_ts_cqe_tracker *nodes; + struct list_head tracker_list_head; + /* Sync list operations in xmit and napi_poll contexts */ + spinlock_t tracker_list_lock; +}; + +static inline void +mlx5e_ptp_port_ts_cqe_list_add(struct mlx5e_ptp_port_ts_cqe_list *list, u8 metadata) +{ + struct mlx5e_ptp_port_ts_cqe_tracker *tracker = &list->nodes[metadata]; + + WARN_ON_ONCE(tracker->inuse); + tracker->inuse = true; + spin_lock(&list->tracker_list_lock); + list_add_tail(&tracker->entry, &list->tracker_list_head); + spin_unlock(&list->tracker_list_lock); +} + +static void +mlx5e_ptp_port_ts_cqe_list_remove(struct mlx5e_ptp_port_ts_cqe_list *list, u8 metadata) +{ + struct mlx5e_ptp_port_ts_cqe_tracker *tracker = &list->nodes[metadata]; + + WARN_ON_ONCE(!tracker->inuse); + tracker->inuse = false; + spin_lock(&list->tracker_list_lock); + list_del(&tracker->entry); + spin_unlock(&list->tracker_list_lock); +} + +void mlx5e_ptpsq_track_metadata(struct mlx5e_ptpsq *ptpsq, u8 metadata) +{ + mlx5e_ptp_port_ts_cqe_list_add(ptpsq->ts_cqe_pending_list, metadata); +} + struct mlx5e_skb_cb_hwtstamp { ktime_t cqe_hwtstamp; ktime_t port_hwtstamp; @@ -79,84 +124,113 @@ memset(skb->cb, 0, sizeof(struct mlx5e_skb_cb_hwtstamp)); } -#define PTP_WQE_CTR2IDX(val) ((val) & ptpsq->ts_cqe_ctr_mask) - -static bool mlx5e_ptp_ts_cqe_drop(struct mlx5e_ptpsq *ptpsq, u16 skb_ci, u16 skb_id) +static struct sk_buff * +mlx5e_ptp_metadata_map_lookup(struct mlx5e_ptp_metadata_map *map, u16 metadata) { - return (ptpsq->ts_cqe_ctr_mask && (skb_ci != skb_id)); + return map->data[metadata]; } -static bool mlx5e_ptp_ts_cqe_ooo(struct mlx5e_ptpsq *ptpsq, u16 skb_id) +static struct sk_buff * +mlx5e_ptp_metadata_map_remove(struct mlx5e_ptp_metadata_map *map, u16 metadata) { - u16 skb_ci = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc); - u16 skb_pi = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_pc); + struct sk_buff *skb; - if (PTP_WQE_CTR2IDX(skb_id - skb_ci) >= PTP_WQE_CTR2IDX(skb_pi - skb_ci)) - return true; + skb = map->data[metadata]; + map->data[metadata] = NULL; - return false; + return skb; } -static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_ci, - u16 skb_id, int budget) +static bool mlx5e_ptp_metadata_map_unhealthy(struct mlx5e_ptp_metadata_map *map) { - struct skb_shared_hwtstamps hwts = {}; - struct sk_buff *skb; + /* Considered beginning unhealthy state if size * 15 / 2^4 cannot be reclaimed. */ + return map->undelivered_counter > (map->capacity >> 4) * 15; +} - ptpsq->cq_stats->resync_event++; +static void mlx5e_ptpsq_mark_ts_cqes_undelivered(struct mlx5e_ptpsq *ptpsq, + ktime_t port_tstamp) +{ + struct mlx5e_ptp_port_ts_cqe_list *cqe_list = ptpsq->ts_cqe_pending_list; + ktime_t timeout = ns_to_ktime(MLX5E_PTP_TS_CQE_UNDELIVERED_TIMEOUT); + struct mlx5e_ptp_metadata_map *metadata_map = &ptpsq->metadata_map; + struct mlx5e_ptp_port_ts_cqe_tracker *pos, *n; + + spin_lock(&cqe_list->tracker_list_lock); + list_for_each_entry_safe(pos, n, &cqe_list->tracker_list_head, entry) { + struct sk_buff *skb = + mlx5e_ptp_metadata_map_lookup(metadata_map, pos->metadata_id); + ktime_t dma_tstamp = mlx5e_skb_cb_get_hwts(skb)->cqe_hwtstamp; + + if (!dma_tstamp || + ktime_after(ktime_add(dma_tstamp, timeout), port_tstamp)) + break; - while (skb_ci != skb_id) { - skb = mlx5e_skb_fifo_pop(&ptpsq->skb_fifo); - hwts.hwtstamp = mlx5e_skb_cb_get_hwts(skb)->cqe_hwtstamp; - skb_tstamp_tx(skb, &hwts); - ptpsq->cq_stats->resync_cqe++; - napi_consume_skb(skb, budget); - skb_ci = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc); + metadata_map->undelivered_counter++; + WARN_ON_ONCE(!pos->inuse); + pos->inuse = false; + list_del(&pos->entry); } + spin_unlock(&cqe_list->tracker_list_lock); } +#define PTP_WQE_CTR2IDX(val) ((val) & ptpsq->ts_cqe_ctr_mask) + static void mlx5e_ptp_handle_ts_cqe(struct mlx5e_ptpsq *ptpsq, struct mlx5_cqe64 *cqe, + u8 *md_buff, + u8 *md_buff_sz, int budget) { - u16 skb_id = PTP_WQE_CTR2IDX(be16_to_cpu(cqe->wqe_counter)); - u16 skb_ci = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc); + struct mlx5e_ptp_port_ts_cqe_list *pending_cqe_list = ptpsq->ts_cqe_pending_list; + u8 metadata_id = PTP_WQE_CTR2IDX(be16_to_cpu(cqe->wqe_counter)); + bool is_err_cqe = !!MLX5E_RX_ERR_CQE(cqe); struct mlx5e_txqsq *sq = &ptpsq->txqsq; struct sk_buff *skb; ktime_t hwtstamp; - if (unlikely(MLX5E_RX_ERR_CQE(cqe))) { - skb = mlx5e_skb_fifo_pop(&ptpsq->skb_fifo); - ptpsq->cq_stats->err_cqe++; - goto out; + if (likely(pending_cqe_list->nodes[metadata_id].inuse)) { + mlx5e_ptp_port_ts_cqe_list_remove(pending_cqe_list, metadata_id); + } else { + /* Reclaim space in the unlikely event CQE was delivered after + * marking it late. + */ + ptpsq->metadata_map.undelivered_counter--; + ptpsq->cq_stats->late_cqe++; } - if (mlx5e_ptp_ts_cqe_drop(ptpsq, skb_ci, skb_id)) { - if (mlx5e_ptp_ts_cqe_ooo(ptpsq, skb_id)) { - /* already handled by a previous resync */ - ptpsq->cq_stats->ooo_cqe_drop++; - return; - } - mlx5e_ptp_skb_fifo_ts_cqe_resync(ptpsq, skb_ci, skb_id, budget); + skb = mlx5e_ptp_metadata_map_remove(&ptpsq->metadata_map, metadata_id); + + if (unlikely(is_err_cqe)) { + ptpsq->cq_stats->err_cqe++; + goto out; } - skb = mlx5e_skb_fifo_pop(&ptpsq->skb_fifo); hwtstamp = mlx5e_cqe_ts_to_ns(sq->ptp_cyc2time, sq->clock, get_cqe_ts(cqe)); mlx5e_skb_cb_hwtstamp_handler(skb, MLX5E_SKB_CB_PORT_HWTSTAMP, hwtstamp, ptpsq->cq_stats); ptpsq->cq_stats->cqe++; + mlx5e_ptpsq_mark_ts_cqes_undelivered(ptpsq, hwtstamp); out: napi_consume_skb(skb, budget); + md_buff[*md_buff_sz++] = metadata_id; + if (unlikely(mlx5e_ptp_metadata_map_unhealthy(&ptpsq->metadata_map)) && + !test_and_set_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state)) + queue_work(ptpsq->txqsq.priv->wq, &ptpsq->report_unhealthy_work); } -static bool mlx5e_ptp_poll_ts_cq(struct mlx5e_cq *cq, int budget) +static bool mlx5e_ptp_poll_ts_cq(struct mlx5e_cq *cq, int napi_budget) { struct mlx5e_ptpsq *ptpsq = container_of(cq, struct mlx5e_ptpsq, ts_cq); - struct mlx5_cqwq *cqwq = &cq->wq; + int budget = min(napi_budget, MLX5E_TX_CQ_POLL_BUDGET); + u8 metadata_buff[MLX5E_TX_CQ_POLL_BUDGET]; + u8 metadata_buff_sz = 0; + struct mlx5_cqwq *cqwq; struct mlx5_cqe64 *cqe; int work_done = 0; + cqwq = &cq->wq; + if (unlikely(!test_bit(MLX5E_SQ_STATE_ENABLED, &ptpsq->txqsq.state))) return false; @@ -167,7 +241,8 @@ do { mlx5_cqwq_pop(cqwq); - mlx5e_ptp_handle_ts_cqe(ptpsq, cqe, budget); + mlx5e_ptp_handle_ts_cqe(ptpsq, cqe, + metadata_buff, &metadata_buff_sz, napi_budget); } while ((++work_done < budget) && (cqe = mlx5_cqwq_get_cqe(cqwq))); mlx5_cqwq_update_db_record(cqwq); @@ -175,6 +250,10 @@ /* ensure cq space is freed before enabling more cqes */ wmb(); + while (metadata_buff_sz > 0) + mlx5e_ptp_metadata_fifo_push(&ptpsq->metadata_freelist, + metadata_buff[--metadata_buff_sz]); + mlx5e_txqsq_wake(&ptpsq->txqsq); return work_done == budget; @@ -291,36 +370,86 @@ static int mlx5e_ptp_alloc_traffic_db(struct mlx5e_ptpsq *ptpsq, int numa) { - int wq_sz = mlx5_wq_cyc_get_size(&ptpsq->txqsq.wq); - struct mlx5_core_dev *mdev = ptpsq->txqsq.mdev; + struct mlx5e_ptp_metadata_fifo *metadata_freelist = &ptpsq->metadata_freelist; + struct mlx5e_ptp_metadata_map *metadata_map = &ptpsq->metadata_map; + struct mlx5e_ptp_port_ts_cqe_list *cqe_list; + int db_sz; + int md; - ptpsq->skb_fifo.fifo = kvzalloc_node(array_size(wq_sz, sizeof(*ptpsq->skb_fifo.fifo)), - GFP_KERNEL, numa); - if (!ptpsq->skb_fifo.fifo) + cqe_list = kvzalloc_node(sizeof(*ptpsq->ts_cqe_pending_list), GFP_KERNEL, numa); + if (!cqe_list) return -ENOMEM; + ptpsq->ts_cqe_pending_list = cqe_list; + + db_sz = min_t(u32, mlx5_wq_cyc_get_size(&ptpsq->txqsq.wq), + 1 << MLX5_CAP_GEN_2(ptpsq->txqsq.mdev, + ts_cqe_metadata_size2wqe_counter)); + ptpsq->ts_cqe_ctr_mask = db_sz - 1; + + cqe_list->nodes = kvzalloc_node(array_size(db_sz, sizeof(*cqe_list->nodes)), + GFP_KERNEL, numa); + if (!cqe_list->nodes) + goto free_cqe_list; + INIT_LIST_HEAD(&cqe_list->tracker_list_head); + spin_lock_init(&cqe_list->tracker_list_lock); + + metadata_freelist->data = + kvzalloc_node(array_size(db_sz, sizeof(*metadata_freelist->data)), + GFP_KERNEL, numa); + if (!metadata_freelist->data) + goto free_cqe_list_nodes; + metadata_freelist->mask = ptpsq->ts_cqe_ctr_mask; + + for (md = 0; md < db_sz; ++md) { + cqe_list->nodes[md].metadata_id = md; + metadata_freelist->data[md] = md; + } + metadata_freelist->pc = db_sz; + + metadata_map->data = + kvzalloc_node(array_size(db_sz, sizeof(*metadata_map->data)), + GFP_KERNEL, numa); + if (!metadata_map->data) + goto free_metadata_freelist; + metadata_map->capacity = db_sz; - ptpsq->skb_fifo.pc = &ptpsq->skb_fifo_pc; - ptpsq->skb_fifo.cc = &ptpsq->skb_fifo_cc; - ptpsq->skb_fifo.mask = wq_sz - 1; - if (MLX5_CAP_GEN_2(mdev, ts_cqe_metadata_size2wqe_counter)) - ptpsq->ts_cqe_ctr_mask = - (1 << MLX5_CAP_GEN_2(mdev, ts_cqe_metadata_size2wqe_counter)) - 1; return 0; + +free_metadata_freelist: + kvfree(metadata_freelist->data); +free_cqe_list_nodes: + kvfree(cqe_list->nodes); +free_cqe_list: + kvfree(cqe_list); + return -ENOMEM; } -static void mlx5e_ptp_drain_skb_fifo(struct mlx5e_skb_fifo *skb_fifo) +static void mlx5e_ptp_drain_metadata_map(struct mlx5e_ptp_metadata_map *map) { - while (*skb_fifo->pc != *skb_fifo->cc) { - struct sk_buff *skb = mlx5e_skb_fifo_pop(skb_fifo); + int idx; + + for (idx = 0; idx < map->capacity; ++idx) { + struct sk_buff *skb = map->data[idx]; dev_kfree_skb_any(skb); } } -static void mlx5e_ptp_free_traffic_db(struct mlx5e_skb_fifo *skb_fifo) +static void mlx5e_ptp_free_traffic_db(struct mlx5e_ptpsq *ptpsq) { - mlx5e_ptp_drain_skb_fifo(skb_fifo); - kvfree(skb_fifo->fifo); + mlx5e_ptp_drain_metadata_map(&ptpsq->metadata_map); + kvfree(ptpsq->metadata_map.data); + kvfree(ptpsq->metadata_freelist.data); + kvfree(ptpsq->ts_cqe_pending_list->nodes); + kvfree(ptpsq->ts_cqe_pending_list); +} + +static void mlx5e_ptpsq_unhealthy_work(struct work_struct *work) +{ + struct mlx5e_ptpsq *ptpsq = + container_of(work, struct mlx5e_ptpsq, report_unhealthy_work); + + mlx5e_reporter_tx_ptpsq_unhealthy(ptpsq); } static int mlx5e_ptp_open_txqsq(struct mlx5e_ptp *c, u32 tisn, @@ -348,11 +477,12 @@ if (err) goto err_free_txqsq; - err = mlx5e_ptp_alloc_traffic_db(ptpsq, - dev_to_node(mlx5_core_dma_dev(c->mdev))); + err = mlx5e_ptp_alloc_traffic_db(ptpsq, dev_to_node(mlx5_core_dma_dev(c->mdev))); if (err) goto err_free_txqsq; + INIT_WORK(&ptpsq->report_unhealthy_work, mlx5e_ptpsq_unhealthy_work); + return 0; err_free_txqsq: @@ -366,7 +496,9 @@ struct mlx5e_txqsq *sq = &ptpsq->txqsq; struct mlx5_core_dev *mdev = sq->mdev; - mlx5e_ptp_free_traffic_db(&ptpsq->skb_fifo); + if (current_work() != &ptpsq->report_unhealthy_work) + cancel_work_sync(&ptpsq->report_unhealthy_work); + mlx5e_ptp_free_traffic_db(ptpsq); cancel_work_sync(&sq->recover_work); mlx5e_ptp_destroy_sq(mdev, sq->sqn); mlx5e_free_txqsq_descs(sq); @@ -534,7 +666,10 @@ /* SQ */ if (test_bit(MLX5E_PTP_STATE_TX, c->state)) { - params->log_sq_size = orig->log_sq_size; + params->log_sq_size = + min(MLX5_CAP_GEN_2(c->mdev, ts_cqe_metadata_size2wqe_counter), + MLX5E_PTP_MAX_LOG_SQ_SIZE); + params->log_sq_size = min(params->log_sq_size, orig->log_sq_size); mlx5e_ptp_build_sq_param(c->mdev, params, &cparams->txq_sq_param); } /* RQ */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h @@ -7,18 +7,38 @@ #include "en.h" #include "en_stats.h" #include "en/txrx.h" +#include #include +#include +#include #define MLX5E_PTP_CHANNEL_IX 0 +#define MLX5E_PTP_MAX_LOG_SQ_SIZE (8U) +#define MLX5E_PTP_TS_CQE_UNDELIVERED_TIMEOUT (1 * NSEC_PER_SEC) + +struct mlx5e_ptp_metadata_fifo { + u8 cc; + u8 pc; + u8 mask; + u8 *data; +}; + +struct mlx5e_ptp_metadata_map { + u16 undelivered_counter; + u16 capacity; + struct sk_buff **data; +}; struct mlx5e_ptpsq { struct mlx5e_txqsq txqsq; struct mlx5e_cq ts_cq; - u16 skb_fifo_cc; - u16 skb_fifo_pc; - struct mlx5e_skb_fifo skb_fifo; struct mlx5e_ptp_cq_stats *cq_stats; u16 ts_cqe_ctr_mask; + + struct work_struct report_unhealthy_work; + struct mlx5e_ptp_port_ts_cqe_list *ts_cqe_pending_list; + struct mlx5e_ptp_metadata_fifo metadata_freelist; + struct mlx5e_ptp_metadata_map metadata_map; }; enum { @@ -69,12 +89,35 @@ fk.ports.dst == htons(PTP_EV_PORT)); } -static inline bool mlx5e_ptpsq_fifo_has_room(struct mlx5e_txqsq *sq) +static inline void mlx5e_ptp_metadata_fifo_push(struct mlx5e_ptp_metadata_fifo *fifo, u8 metadata) { - if (!sq->ptpsq) - return true; + fifo->data[fifo->mask & fifo->pc++] = metadata; +} - return mlx5e_skb_fifo_has_room(&sq->ptpsq->skb_fifo); +static inline u8 +mlx5e_ptp_metadata_fifo_pop(struct mlx5e_ptp_metadata_fifo *fifo) +{ + return fifo->data[fifo->mask & fifo->cc++]; +} + +static inline void +mlx5e_ptp_metadata_map_put(struct mlx5e_ptp_metadata_map *map, + struct sk_buff *skb, u8 metadata) +{ + WARN_ON_ONCE(map->data[metadata]); + map->data[metadata] = skb; +} + +static inline bool mlx5e_ptpsq_metadata_freelist_empty(struct mlx5e_ptpsq *ptpsq) +{ + struct mlx5e_ptp_metadata_fifo *freelist; + + if (likely(!ptpsq)) + return false; + + freelist = &ptpsq->metadata_freelist; + + return freelist->pc == freelist->cc; } int mlx5e_ptp_open(struct mlx5e_priv *priv, struct mlx5e_params *params, @@ -89,6 +132,8 @@ const struct mlx5e_profile *profile); int mlx5e_ptp_rx_manage_fs(struct mlx5e_priv *priv, bool set); +void mlx5e_ptpsq_track_metadata(struct mlx5e_ptpsq *ptpsq, u8 metadata); + enum { MLX5E_SKB_CB_CQE_HWTSTAMP = BIT(0), MLX5E_SKB_CB_PORT_HWTSTAMP = BIT(1), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c @@ -463,6 +463,17 @@ /* only handle the event on peers */ if (mlx5_esw_bridge_is_local(dev, rep, esw)) break; + + fdb_info = container_of(info, + struct switchdev_notifier_fdb_info, + info); + /* Mark for deletion to prevent the update wq task from + * spuriously refreshing the entry which would mark it again as + * offloaded in SW bridge. After this fallthrough to regular + * async delete code. + */ + mlx5_esw_bridge_fdb_mark_deleted(dev, vport_num, esw_owner_vhca_id, br_offloads, + fdb_info); fallthrough; case SWITCHDEV_FDB_ADD_TO_DEVICE: case SWITCHDEV_FDB_DEL_TO_DEVICE: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c @@ -702,11 +702,11 @@ void mlx5e_reporter_rx_timeout(struct mlx5e_rq *rq) { - char icosq_str[MLX5E_REPORTER_PER_Q_MAX_LEN] = {}; char err_str[MLX5E_REPORTER_PER_Q_MAX_LEN]; struct mlx5e_icosq *icosq = rq->icosq; struct mlx5e_priv *priv = rq->priv; struct mlx5e_err_ctx err_ctx = {}; + char icosq_str[32] = {}; err_ctx.ctx = rq; err_ctx.recover = mlx5e_rx_reporter_timeout_recover; @@ -715,7 +715,7 @@ if (icosq) snprintf(icosq_str, sizeof(icosq_str), "ICOSQ: 0x%x, ", icosq->sqn); snprintf(err_str, sizeof(err_str), - "RX timeout on channel: %d, %sRQ: 0x%x, CQ: 0x%x", + "RX timeout on channel: %d, %s RQ: 0x%x, CQ: 0x%x", rq->ix, icosq_str, rq->rqn, rq->cq.mcq.cqn); mlx5e_health_report(priv, priv->rx_reporter, err_str, &err_ctx); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c @@ -164,6 +164,43 @@ return err; } +static int mlx5e_tx_reporter_ptpsq_unhealthy_recover(void *ctx) +{ + struct mlx5e_ptpsq *ptpsq = ctx; + struct mlx5e_channels *chs; + struct net_device *netdev; + struct mlx5e_priv *priv; + int carrier_ok; + int err; + + if (!test_bit(MLX5E_SQ_STATE_RECOVERING, &ptpsq->txqsq.state)) + return 0; + + priv = ptpsq->txqsq.priv; + + mutex_lock(&priv->state_lock); + chs = &priv->channels; + netdev = priv->netdev; + + carrier_ok = netif_carrier_ok(netdev); + netif_carrier_off(netdev); + + mlx5e_deactivate_priv_channels(priv); + + mlx5e_ptp_close(chs->ptp); + err = mlx5e_ptp_open(priv, &chs->params, chs->c[0]->lag_port, &chs->ptp); + + mlx5e_activate_priv_channels(priv); + + /* return carrier back if needed */ + if (carrier_ok) + netif_carrier_on(netdev); + + mutex_unlock(&priv->state_lock); + + return err; +} + /* state lock cannot be grabbed within this function. * It can cause a dead lock or a read-after-free. */ @@ -516,6 +553,15 @@ return mlx5e_tx_reporter_dump_sq(priv, fmsg, to_ctx->sq); } +static int mlx5e_tx_reporter_ptpsq_unhealthy_dump(struct mlx5e_priv *priv, + struct devlink_fmsg *fmsg, + void *ctx) +{ + struct mlx5e_ptpsq *ptpsq = ctx; + + return mlx5e_tx_reporter_dump_sq(priv, fmsg, &ptpsq->txqsq); +} + static int mlx5e_tx_reporter_dump_all_sqs(struct mlx5e_priv *priv, struct devlink_fmsg *fmsg) { @@ -621,6 +667,25 @@ return to_ctx.status; } +void mlx5e_reporter_tx_ptpsq_unhealthy(struct mlx5e_ptpsq *ptpsq) +{ + struct mlx5e_ptp_metadata_map *map = &ptpsq->metadata_map; + char err_str[MLX5E_REPORTER_PER_Q_MAX_LEN]; + struct mlx5e_txqsq *txqsq = &ptpsq->txqsq; + struct mlx5e_cq *ts_cq = &ptpsq->ts_cq; + struct mlx5e_priv *priv = txqsq->priv; + struct mlx5e_err_ctx err_ctx = {}; + + err_ctx.ctx = ptpsq; + err_ctx.recover = mlx5e_tx_reporter_ptpsq_unhealthy_recover; + err_ctx.dump = mlx5e_tx_reporter_ptpsq_unhealthy_dump; + snprintf(err_str, sizeof(err_str), + "Unhealthy TX port TS queue: %d, SQ: 0x%x, CQ: 0x%x, Undelivered CQEs: %u Map Capacity: %u", + txqsq->ch_ix, txqsq->sqn, ts_cq->mcq.cqn, map->undelivered_counter, map->capacity); + + mlx5e_health_report(priv, priv->tx_reporter, err_str, &err_ctx); +} + static const struct devlink_health_reporter_ops mlx5_tx_reporter_ops = { .name = "tx", .recover = mlx5e_tx_reporter_recover, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c @@ -300,9 +300,6 @@ if (err) goto destroy_neigh_entry; - e->encap_size = ipv4_encap_size; - e->encap_header = encap_header; - if (!(nud_state & NUD_VALID)) { neigh_event_send(attr.n, NULL); /* the encap entry will be made valid on neigh update event @@ -322,6 +319,8 @@ goto destroy_neigh_entry; } + e->encap_size = ipv4_encap_size; + e->encap_header = encap_header; e->flags |= MLX5_ENCAP_ENTRY_VALID; mlx5e_rep_queue_neigh_stats_work(netdev_priv(attr.out_dev)); mlx5e_route_lookup_ipv4_put(&attr); @@ -404,16 +403,12 @@ if (err) goto free_encap; - e->encap_size = ipv4_encap_size; - kfree(e->encap_header); - e->encap_header = encap_header; - if (!(nud_state & NUD_VALID)) { neigh_event_send(attr.n, NULL); /* the encap entry will be made valid on neigh update event * and not used before that. */ - goto release_neigh; + goto free_encap; } memset(&reformat_params, 0, sizeof(reformat_params)); @@ -427,6 +422,10 @@ goto free_encap; } + e->encap_size = ipv4_encap_size; + kfree(e->encap_header); + e->encap_header = encap_header; + e->flags |= MLX5_ENCAP_ENTRY_VALID; mlx5e_rep_queue_neigh_stats_work(netdev_priv(attr.out_dev)); mlx5e_route_lookup_ipv4_put(&attr); @@ -568,9 +567,6 @@ if (err) goto destroy_neigh_entry; - e->encap_size = ipv6_encap_size; - e->encap_header = encap_header; - if (!(nud_state & NUD_VALID)) { neigh_event_send(attr.n, NULL); /* the encap entry will be made valid on neigh update event @@ -590,6 +586,8 @@ goto destroy_neigh_entry; } + e->encap_size = ipv6_encap_size; + e->encap_header = encap_header; e->flags |= MLX5_ENCAP_ENTRY_VALID; mlx5e_rep_queue_neigh_stats_work(netdev_priv(attr.out_dev)); mlx5e_route_lookup_ipv6_put(&attr); @@ -671,16 +669,12 @@ if (err) goto free_encap; - e->encap_size = ipv6_encap_size; - kfree(e->encap_header); - e->encap_header = encap_header; - if (!(nud_state & NUD_VALID)) { neigh_event_send(attr.n, NULL); /* the encap entry will be made valid on neigh update event * and not used before that. */ - goto release_neigh; + goto free_encap; } memset(&reformat_params, 0, sizeof(reformat_params)); @@ -694,6 +688,10 @@ goto free_encap; } + e->encap_size = ipv6_encap_size; + kfree(e->encap_header); + e->encap_header = encap_header; + e->flags |= MLX5_ENCAP_ENTRY_VALID; mlx5e_rep_queue_neigh_stats_work(netdev_priv(attr.out_dev)); mlx5e_route_lookup_ipv6_put(&attr); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c @@ -24,7 +24,8 @@ route_dev = dev_get_by_index(dev_net(e->out_dev), e->route_dev_ifindex); - if (!route_dev || !netif_is_ovs_master(route_dev)) + if (!route_dev || !netif_is_ovs_master(route_dev) || + attr->parse_attr->filter_dev == e->out_dev) goto out; err = mlx5e_set_fwd_to_int_port_actions(priv, attr, e->route_dev_ifindex, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c @@ -873,11 +873,11 @@ } out: - if (flags & XDP_XMIT_FLUSH) { - if (sq->mpwqe.wqe) - mlx5e_xdp_mpwqe_complete(sq); + if (sq->mpwqe.wqe) + mlx5e_xdp_mpwqe_complete(sq); + + if (flags & XDP_XMIT_FLUSH) mlx5e_xmit_xdp_doorbell(sq); - } return nxmit; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -43,12 +43,17 @@ struct ethtool_drvinfo *drvinfo) { struct mlx5_core_dev *mdev = priv->mdev; + int count; strscpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver)); - snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), - "%d.%d.%04d (%.16s)", - fw_rev_maj(mdev), fw_rev_min(mdev), fw_rev_sub(mdev), - mdev->board_id); + count = snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), + "%d.%d.%04d (%.16s)", fw_rev_maj(mdev), + fw_rev_min(mdev), fw_rev_sub(mdev), mdev->board_id); + if (count == sizeof(drvinfo->fw_version)) + snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), + "%d.%d.%04d", fw_rev_maj(mdev), + fw_rev_min(mdev), fw_rev_sub(mdev)); + strscpy(drvinfo->bus_info, dev_name(mdev->device), sizeof(drvinfo->bus_info)); } @@ -2061,7 +2066,8 @@ struct mlx5e_params new_params; int err; - if (!MLX5_CAP_GEN(mdev, ts_cqe_to_dest_cqn)) + if (!MLX5_CAP_GEN(mdev, ts_cqe_to_dest_cqn) || + !MLX5_CAP_GEN_2(mdev, ts_cqe_metadata_size2wqe_counter)) return -EOPNOTSUPP; /* Don't allow changing the PTP state if HTB offload is active, because only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -71,13 +71,17 @@ { struct mlx5e_priv *priv = netdev_priv(dev); struct mlx5_core_dev *mdev = priv->mdev; + int count; strscpy(drvinfo->driver, mlx5e_rep_driver_name, sizeof(drvinfo->driver)); - snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), - "%d.%d.%04d (%.16s)", - fw_rev_maj(mdev), fw_rev_min(mdev), - fw_rev_sub(mdev), mdev->board_id); + count = snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), + "%d.%d.%04d (%.16s)", fw_rev_maj(mdev), + fw_rev_min(mdev), fw_rev_sub(mdev), mdev->board_id); + if (count == sizeof(drvinfo->fw_version)) + snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), + "%d.%d.%04d", fw_rev_maj(mdev), + fw_rev_min(mdev), fw_rev_sub(mdev)); } static const struct counter_desc sw_rep_stats_desc[] = { @@ -704,7 +708,7 @@ /* update HW stats in background for next time */ mlx5e_queue_update_stats(priv); - memcpy(stats, &priv->stats.vf_vport, sizeof(*stats)); + mlx5e_stats_copy_rep_stats(stats, &priv->stats.rep_stats); } static int mlx5e_rep_change_mtu(struct net_device *netdev, int new_mtu) @@ -772,6 +776,7 @@ static void mlx5e_build_rep_params(struct net_device *netdev) { + const bool take_rtnl = netdev->reg_state == NETREG_REGISTERED; struct mlx5e_priv *priv = netdev_priv(netdev); struct mlx5e_rep_priv *rpriv = priv->ppriv; struct mlx5_eswitch_rep *rep = rpriv->rep; @@ -797,8 +802,15 @@ /* RQ */ mlx5e_build_rq_params(mdev, params); + /* If netdev is already registered (e.g. move from nic profile to uplink, + * RTNL lock must be held before triggering netdev notifiers. + */ + if (take_rtnl) + rtnl_lock(); /* update XDP supported features */ mlx5e_set_xdp_feature(netdev); + if (take_rtnl) + rtnl_unlock(); /* CQ moderation params */ params->rx_dim_enabled = MLX5_CAP_GEN(mdev, cq_moderation); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -457,26 +457,41 @@ static int mlx5e_refill_rx_wqes(struct mlx5e_rq *rq, u16 ix, int wqe_bulk) { int remaining = wqe_bulk; - int i = 0; + int total_alloc = 0; + int refill_alloc; + int refill; /* The WQE bulk is split into smaller bulks that are sized * according to the page pool cache refill size to avoid overflowing * the page pool cache due to too many page releases at once. */ do { - int refill = min_t(u16, rq->wqe.info.refill_unit, remaining); - int alloc_count; + refill = min_t(u16, rq->wqe.info.refill_unit, remaining); - mlx5e_free_rx_wqes(rq, ix + i, refill); - alloc_count = mlx5e_alloc_rx_wqes(rq, ix + i, refill); - i += alloc_count; - if (unlikely(alloc_count != refill)) - break; + mlx5e_free_rx_wqes(rq, ix + total_alloc, refill); + refill_alloc = mlx5e_alloc_rx_wqes(rq, ix + total_alloc, refill); + if (unlikely(refill_alloc != refill)) + goto err_free; + total_alloc += refill_alloc; remaining -= refill; } while (remaining); - return i; + return total_alloc; + +err_free: + mlx5e_free_rx_wqes(rq, ix, total_alloc + refill_alloc); + + for (int i = 0; i < total_alloc + refill; i++) { + int j = mlx5_wq_cyc_ctr2ix(&rq->wqe.wq, ix + i); + struct mlx5e_wqe_frag_info *frag; + + frag = get_frag(rq, j); + for (int k = 0; k < rq->wqe.info.num_frags; k++, frag++) + frag->flags |= BIT(MLX5E_WQE_FRAG_SKIP_RELEASE); + } + + return 0; } static void @@ -816,6 +831,8 @@ mlx5e_page_release_fragmented(rq, frag_page); } + bitmap_fill(wi->skip_release_bitmap, rq->mpwqe.pages_per_wqe); + err: rq->stats->buff_alloc_err++; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -2142,9 +2142,7 @@ { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, err_cqe) }, { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, abort) }, { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, abort_abs_diff_ns) }, - { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, resync_cqe) }, - { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, resync_event) }, - { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, ooo_cqe_drop) }, + { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, late_cqe) }, }; static const struct counter_desc ptp_rq_stats_desc[] = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h @@ -449,9 +449,7 @@ u64 err_cqe; u64 abort; u64 abort_abs_diff_ns; - u64 resync_cqe; - u64 resync_event; - u64 ooo_cqe_drop; + u64 late_cqe; }; struct mlx5e_rep_stats { @@ -475,11 +473,20 @@ struct mlx5e_vnic_env_stats vnic; struct mlx5e_vport_stats vport; struct mlx5e_pport_stats pport; - struct rtnl_link_stats64 vf_vport; struct mlx5e_pcie_stats pcie; struct mlx5e_rep_stats rep_stats; }; +static inline void mlx5e_stats_copy_rep_stats(struct rtnl_link_stats64 *vf_vport, + struct mlx5e_rep_stats *rep_stats) +{ + memset(vf_vport, 0, sizeof(*vf_vport)); + vf_vport->rx_packets = rep_stats->vport_rx_packets; + vf_vport->tx_packets = rep_stats->vport_tx_packets; + vf_vport->rx_bytes = rep_stats->vport_rx_bytes; + vf_vport->tx_bytes = rep_stats->vport_tx_bytes; +} + extern mlx5e_stats_grp_t mlx5e_nic_stats_grps[]; unsigned int mlx5e_nic_stats_grps_num(struct mlx5e_priv *priv); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -372,7 +372,7 @@ const struct mlx5e_tx_attr *attr, const struct mlx5e_tx_wqe_attr *wqe_attr, u8 num_dma, struct mlx5e_tx_wqe_info *wi, struct mlx5_wqe_ctrl_seg *cseg, - bool xmit_more) + struct mlx5_wqe_eth_seg *eseg, bool xmit_more) { struct mlx5_wq_cyc *wq = &sq->wq; bool send_doorbell; @@ -394,11 +394,16 @@ mlx5e_tx_check_stop(sq); - if (unlikely(sq->ptpsq)) { + if (unlikely(sq->ptpsq && + (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP))) { + u8 metadata_index = be32_to_cpu(eseg->flow_table_metadata); + mlx5e_skb_cb_hwtstamp_init(skb); - mlx5e_skb_fifo_push(&sq->ptpsq->skb_fifo, skb); + mlx5e_ptp_metadata_map_put(&sq->ptpsq->metadata_map, skb, + metadata_index); + mlx5e_ptpsq_track_metadata(sq->ptpsq, metadata_index); if (!netif_tx_queue_stopped(sq->txq) && - !mlx5e_skb_fifo_has_room(&sq->ptpsq->skb_fifo)) { + mlx5e_ptpsq_metadata_freelist_empty(sq->ptpsq)) { netif_tx_stop_queue(sq->txq); sq->stats->stopped++; } @@ -483,12 +488,15 @@ if (unlikely(num_dma < 0)) goto err_drop; - mlx5e_txwqe_complete(sq, skb, attr, wqe_attr, num_dma, wi, cseg, xmit_more); + mlx5e_txwqe_complete(sq, skb, attr, wqe_attr, num_dma, wi, cseg, eseg, xmit_more); return; err_drop: stats->dropped++; + if (unlikely(sq->ptpsq && (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP))) + mlx5e_ptp_metadata_fifo_push(&sq->ptpsq->metadata_freelist, + be32_to_cpu(eseg->flow_table_metadata)); dev_kfree_skb_any(skb); mlx5e_tx_flush(sq); } @@ -645,9 +653,9 @@ static void mlx5e_cqe_ts_id_eseg(struct mlx5e_ptpsq *ptpsq, struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg) { - if (ptpsq->ts_cqe_ctr_mask && unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) - eseg->flow_table_metadata = cpu_to_be32(ptpsq->skb_fifo_pc & - ptpsq->ts_cqe_ctr_mask); + if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) + eseg->flow_table_metadata = + cpu_to_be32(mlx5e_ptp_metadata_fifo_pop(&ptpsq->metadata_freelist)); } static void mlx5e_txwqe_build_eseg(struct mlx5e_priv *priv, struct mlx5e_txqsq *sq, @@ -766,7 +774,7 @@ { if (netif_tx_queue_stopped(sq->txq) && mlx5e_wqc_has_room_for(&sq->wq, sq->cc, sq->pc, sq->stop_room) && - mlx5e_ptpsq_fifo_has_room(sq) && + !mlx5e_ptpsq_metadata_freelist_empty(sq->ptpsq) && !test_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state)) { netif_tx_wake_queue(sq->txq); sq->stats->wake++; @@ -1031,7 +1039,7 @@ if (unlikely(num_dma < 0)) goto err_drop; - mlx5e_txwqe_complete(sq, skb, &attr, &wqe_attr, num_dma, wi, cseg, xmit_more); + mlx5e_txwqe_complete(sq, skb, &attr, &wqe_attr, num_dma, wi, cseg, eseg, xmit_more); return; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c @@ -1748,6 +1748,28 @@ entry->lastuse = jiffies; } +void mlx5_esw_bridge_fdb_mark_deleted(struct net_device *dev, u16 vport_num, u16 esw_owner_vhca_id, + struct mlx5_esw_bridge_offloads *br_offloads, + struct switchdev_notifier_fdb_info *fdb_info) +{ + struct mlx5_esw_bridge_fdb_entry *entry; + struct mlx5_esw_bridge *bridge; + + bridge = mlx5_esw_bridge_from_port_lookup(vport_num, esw_owner_vhca_id, br_offloads); + if (!bridge) + return; + + entry = mlx5_esw_bridge_fdb_lookup(bridge, fdb_info->addr, fdb_info->vid); + if (!entry) { + esw_debug(br_offloads->esw->dev, + "FDB mark deleted entry with specified key not found (MAC=%pM,vid=%u,vport=%u)\n", + fdb_info->addr, fdb_info->vid, vport_num); + return; + } + + entry->flags |= MLX5_ESW_BRIDGE_FLAG_DELETED; +} + void mlx5_esw_bridge_fdb_create(struct net_device *dev, u16 vport_num, u16 esw_owner_vhca_id, struct mlx5_esw_bridge_offloads *br_offloads, struct switchdev_notifier_fdb_info *fdb_info) @@ -1810,7 +1832,8 @@ unsigned long lastuse = (unsigned long)mlx5_fc_query_lastuse(entry->ingress_counter); - if (entry->flags & MLX5_ESW_BRIDGE_FLAG_ADDED_BY_USER) + if (entry->flags & (MLX5_ESW_BRIDGE_FLAG_ADDED_BY_USER | + MLX5_ESW_BRIDGE_FLAG_DELETED)) continue; if (time_after(lastuse, entry->lastuse)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.h @@ -62,6 +62,9 @@ void mlx5_esw_bridge_fdb_update_used(struct net_device *dev, u16 vport_num, u16 esw_owner_vhca_id, struct mlx5_esw_bridge_offloads *br_offloads, struct switchdev_notifier_fdb_info *fdb_info); +void mlx5_esw_bridge_fdb_mark_deleted(struct net_device *dev, u16 vport_num, u16 esw_owner_vhca_id, + struct mlx5_esw_bridge_offloads *br_offloads, + struct switchdev_notifier_fdb_info *fdb_info); void mlx5_esw_bridge_fdb_create(struct net_device *dev, u16 vport_num, u16 esw_owner_vhca_id, struct mlx5_esw_bridge_offloads *br_offloads, struct switchdev_notifier_fdb_info *fdb_info); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_priv.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_priv.h @@ -133,6 +133,7 @@ enum { MLX5_ESW_BRIDGE_FLAG_ADDED_BY_USER = BIT(0), MLX5_ESW_BRIDGE_FLAG_PEER = BIT(1), + MLX5_ESW_BRIDGE_FLAG_DELETED = BIT(2), }; enum { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c @@ -28,7 +28,7 @@ struct mlx5_irq { struct atomic_notifier_head nh; cpumask_var_t mask; - char name[MLX5_MAX_IRQ_NAME]; + char name[MLX5_MAX_IRQ_FORMATTED_NAME]; struct mlx5_irq_pool *pool; int refcount; struct msi_map map; @@ -289,8 +289,8 @@ else irq_sf_set_name(pool, name, i); ATOMIC_INIT_NOTIFIER_HEAD(&irq->nh); - snprintf(irq->name, MLX5_MAX_IRQ_NAME, - "%s@pci:%s", name, pci_name(dev->pdev)); + snprintf(irq->name, MLX5_MAX_IRQ_FORMATTED_NAME, + MLX5_IRQ_NAME_FORMAT_STR, name, pci_name(dev->pdev)); err = request_irq(irq->map.virq, irq_int_handler, 0, irq->name, &irq->nh); if (err) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.h @@ -7,6 +7,9 @@ #include #define MLX5_MAX_IRQ_NAME (32) +#define MLX5_IRQ_NAME_FORMAT_STR ("%s@pci:%s") +#define MLX5_MAX_IRQ_FORMATTED_NAME \ + (MLX5_MAX_IRQ_NAME + sizeof(MLX5_IRQ_NAME_FORMAT_STR)) /* max irq_index is 2047, so four chars */ #define MLX5_MAX_IRQ_IDX_CHARS (4) #define MLX5_EQ_REFS_PER_IRQ (2) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c @@ -496,7 +496,7 @@ * is 2^ACL_MAX_BF_LOG */ bf_bank_size = 1 << MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_BF_LOG); - bf = kzalloc(struct_size(bf, refcnt, bf_bank_size * num_erp_banks), + bf = kzalloc(struct_size(bf, refcnt, size_mul(bf_bank_size, num_erp_banks)), GFP_KERNEL); if (!bf) return ERR_PTR(-ENOMEM); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c @@ -160,6 +160,18 @@ u8 addr[ETH_ALEN]; }; +/** + * struct nfp_neigh_update_work - update neighbour information to nfp + * @work: Work queue for writing neigh to the nfp + * @n: neighbour entry + * @app: Back pointer to app + */ +struct nfp_neigh_update_work { + struct work_struct work; + struct neighbour *n; + struct nfp_app *app; +}; + enum nfp_flower_mac_offload_cmd { NFP_TUNNEL_MAC_OFFLOAD_ADD = 0, NFP_TUNNEL_MAC_OFFLOAD_DEL = 1, @@ -607,38 +619,30 @@ nfp_flower_cmsg_warn(app, "Neighbour configuration failed.\n"); } -static int -nfp_tun_neigh_event_handler(struct notifier_block *nb, unsigned long event, - void *ptr) +static void +nfp_tun_release_neigh_update_work(struct nfp_neigh_update_work *update_work) { - struct nfp_flower_priv *app_priv; - struct netevent_redirect *redir; - struct neighbour *n; + neigh_release(update_work->n); + kfree(update_work); +} + +static void nfp_tun_neigh_update(struct work_struct *work) +{ + struct nfp_neigh_update_work *update_work; struct nfp_app *app; + struct neighbour *n; bool neigh_invalid; int err; - switch (event) { - case NETEVENT_REDIRECT: - redir = (struct netevent_redirect *)ptr; - n = redir->neigh; - break; - case NETEVENT_NEIGH_UPDATE: - n = (struct neighbour *)ptr; - break; - default: - return NOTIFY_DONE; - } - - neigh_invalid = !(n->nud_state & NUD_VALID) || n->dead; - - app_priv = container_of(nb, struct nfp_flower_priv, tun.neigh_nb); - app = app_priv->app; + update_work = container_of(work, struct nfp_neigh_update_work, work); + app = update_work->app; + n = update_work->n; if (!nfp_flower_get_port_id_from_netdev(app, n->dev)) - return NOTIFY_DONE; + goto out; #if IS_ENABLED(CONFIG_INET) + neigh_invalid = !(n->nud_state & NUD_VALID) || n->dead; if (n->tbl->family == AF_INET6) { #if IS_ENABLED(CONFIG_IPV6) struct flowi6 flow6 = {}; @@ -655,13 +659,11 @@ dst = ip6_dst_lookup_flow(dev_net(n->dev), NULL, &flow6, NULL); if (IS_ERR(dst)) - return NOTIFY_DONE; + goto out; dst_release(dst); } nfp_tun_write_neigh(n->dev, app, &flow6, n, true, false); -#else - return NOTIFY_DONE; #endif /* CONFIG_IPV6 */ } else { struct flowi4 flow4 = {}; @@ -678,17 +680,71 @@ rt = ip_route_output_key(dev_net(n->dev), &flow4); err = PTR_ERR_OR_ZERO(rt); if (err) - return NOTIFY_DONE; + goto out; ip_rt_put(rt); } nfp_tun_write_neigh(n->dev, app, &flow4, n, false, false); } -#else - return NOTIFY_DONE; #endif /* CONFIG_INET */ +out: + nfp_tun_release_neigh_update_work(update_work); +} + +static struct nfp_neigh_update_work * +nfp_tun_alloc_neigh_update_work(struct nfp_app *app, struct neighbour *n) +{ + struct nfp_neigh_update_work *update_work; + + update_work = kzalloc(sizeof(*update_work), GFP_ATOMIC); + if (!update_work) + return NULL; + + INIT_WORK(&update_work->work, nfp_tun_neigh_update); + neigh_hold(n); + update_work->n = n; + update_work->app = app; - return NOTIFY_OK; + return update_work; +} + +static int +nfp_tun_neigh_event_handler(struct notifier_block *nb, unsigned long event, + void *ptr) +{ + struct nfp_neigh_update_work *update_work; + struct nfp_flower_priv *app_priv; + struct netevent_redirect *redir; + struct neighbour *n; + struct nfp_app *app; + + switch (event) { + case NETEVENT_REDIRECT: + redir = (struct netevent_redirect *)ptr; + n = redir->neigh; + break; + case NETEVENT_NEIGH_UPDATE: + n = (struct neighbour *)ptr; + break; + default: + return NOTIFY_DONE; + } +#if IS_ENABLED(CONFIG_IPV6) + if (n->tbl != ipv6_stub->nd_tbl && n->tbl != &arp_tbl) +#else + if (n->tbl != &arp_tbl) +#endif + return NOTIFY_DONE; + + app_priv = container_of(nb, struct nfp_flower_priv, tun.neigh_nb); + app = app_priv->app; + update_work = nfp_tun_alloc_neigh_update_work(app, n); + if (!update_work) + return NOTIFY_DONE; + + queue_work(system_highpri_wq, &update_work->work); + + return NOTIFY_DONE; } void nfp_tunnel_request_route_v4(struct nfp_app *app, struct sk_buff *skb) @@ -706,6 +762,7 @@ netdev = nfp_app_dev_get(app, be32_to_cpu(payload->ingress_port), NULL); if (!netdev) goto fail_rcu_unlock; + dev_hold(netdev); flow.daddr = payload->ipv4_addr; flow.flowi4_proto = IPPROTO_UDP; @@ -725,13 +782,16 @@ ip_rt_put(rt); if (!n) goto fail_rcu_unlock; + rcu_read_unlock(); + nfp_tun_write_neigh(n->dev, app, &flow, n, false, true); neigh_release(n); - rcu_read_unlock(); + dev_put(netdev); return; fail_rcu_unlock: rcu_read_unlock(); + dev_put(netdev); nfp_flower_cmsg_warn(app, "Requested route not found.\n"); } @@ -749,6 +809,7 @@ netdev = nfp_app_dev_get(app, be32_to_cpu(payload->ingress_port), NULL); if (!netdev) goto fail_rcu_unlock; + dev_hold(netdev); flow.daddr = payload->ipv6_addr; flow.flowi6_proto = IPPROTO_UDP; @@ -766,14 +827,16 @@ dst_release(dst); if (!n) goto fail_rcu_unlock; + rcu_read_unlock(); nfp_tun_write_neigh(n->dev, app, &flow, n, true, true); neigh_release(n); - rcu_read_unlock(); + dev_put(netdev); return; fail_rcu_unlock: rcu_read_unlock(); + dev_put(netdev); nfp_flower_cmsg_warn(app, "Requested IPv6 route not found.\n"); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -49,24 +49,24 @@ static void ionic_dim_work(struct work_struct *work) { struct dim *dim = container_of(work, struct dim, work); + struct ionic_intr_info *intr; struct dim_cq_moder cur_moder; struct ionic_qcq *qcq; + struct ionic_lif *lif; u32 new_coal; cur_moder = net_dim_get_rx_moderation(dim->mode, dim->profile_ix); qcq = container_of(dim, struct ionic_qcq, dim); - new_coal = ionic_coal_usec_to_hw(qcq->q.lif->ionic, cur_moder.usec); + lif = qcq->q.lif; + new_coal = ionic_coal_usec_to_hw(lif->ionic, cur_moder.usec); new_coal = new_coal ? new_coal : 1; - if (qcq->intr.dim_coal_hw != new_coal) { - unsigned int qi = qcq->cq.bound_q->index; - struct ionic_lif *lif = qcq->q.lif; - - qcq->intr.dim_coal_hw = new_coal; + intr = &qcq->intr; + if (intr->dim_coal_hw != new_coal) { + intr->dim_coal_hw = new_coal; ionic_intr_coal_init(lif->ionic->idev.intr_ctrl, - lif->rxqcqs[qi]->intr.index, - qcq->intr.dim_coal_hw); + intr->index, intr->dim_coal_hw); } dim->state = DIM_START_MEASURE; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/qlogic/qed/qed_ll2.c @@ -113,7 +113,10 @@ static int qed_ll2_alloc_buffer(struct qed_dev *cdev, u8 **data, dma_addr_t *phys_addr) { - *data = kmalloc(cdev->ll2->rx_size, GFP_ATOMIC); + size_t size = cdev->ll2->rx_size + NET_SKB_PAD + + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); + + *data = kmalloc(size, GFP_ATOMIC); if (!(*data)) { DP_INFO(cdev, "Failed to allocate LL2 buffer data\n"); return -ENOMEM; @@ -2589,7 +2592,7 @@ INIT_LIST_HEAD(&cdev->ll2->list); spin_lock_init(&cdev->ll2->lock); - cdev->ll2->rx_size = NET_SKB_PAD + ETH_HLEN + + cdev->ll2->rx_size = PRM_DMA_PAD_BYTES_NUM + ETH_HLEN + L1_CACHE_BYTES + params->mtu; /* Allocate memory for LL2. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/stmicro/stmmac/dwmac5.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwmac5.c @@ -710,28 +710,22 @@ } } -void dwmac5_fpe_configure(void __iomem *ioaddr, u32 num_txq, u32 num_rxq, +void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, + u32 num_txq, u32 num_rxq, bool enable) { u32 value; - if (!enable) { - value = readl(ioaddr + MAC_FPE_CTRL_STS); - - value &= ~EFPE; - - writel(value, ioaddr + MAC_FPE_CTRL_STS); - return; + if (enable) { + cfg->fpe_csr = EFPE; + value = readl(ioaddr + GMAC_RXQ_CTRL1); + value &= ~GMAC_RXQCTRL_FPRQ; + value |= (num_rxq - 1) << GMAC_RXQCTRL_FPRQ_SHIFT; + writel(value, ioaddr + GMAC_RXQ_CTRL1); + } else { + cfg->fpe_csr = 0; } - - value = readl(ioaddr + GMAC_RXQ_CTRL1); - value &= ~GMAC_RXQCTRL_FPRQ; - value |= (num_rxq - 1) << GMAC_RXQCTRL_FPRQ_SHIFT; - writel(value, ioaddr + GMAC_RXQ_CTRL1); - - value = readl(ioaddr + MAC_FPE_CTRL_STS); - value |= EFPE; - writel(value, ioaddr + MAC_FPE_CTRL_STS); + writel(cfg->fpe_csr, ioaddr + MAC_FPE_CTRL_STS); } int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev) @@ -741,6 +735,9 @@ status = FPE_EVENT_UNKNOWN; + /* Reads from the MAC_FPE_CTRL_STS register should only be performed + * here, since the status flags of MAC_FPE_CTRL_STS are "clear on read" + */ value = readl(ioaddr + MAC_FPE_CTRL_STS); if (value & TRSP) { @@ -766,19 +763,15 @@ return status; } -void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, enum stmmac_mpacket_type type) +void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, + enum stmmac_mpacket_type type) { - u32 value; - - value = readl(ioaddr + MAC_FPE_CTRL_STS); + u32 value = cfg->fpe_csr; - if (type == MPACKET_VERIFY) { - value &= ~SRSP; + if (type == MPACKET_VERIFY) value |= SVER; - } else { - value &= ~SVER; + else if (type == MPACKET_RESPONSE) value |= SRSP; - } writel(value, ioaddr + MAC_FPE_CTRL_STS); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/stmicro/stmmac/dwmac5.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwmac5.h @@ -153,9 +153,11 @@ unsigned int ptp_rate); void dwmac5_est_irq_status(void __iomem *ioaddr, struct net_device *dev, struct stmmac_extra_stats *x, u32 txqcnt); -void dwmac5_fpe_configure(void __iomem *ioaddr, u32 num_txq, u32 num_rxq, +void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, + u32 num_txq, u32 num_rxq, bool enable); void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, + struct stmmac_fpe_cfg *cfg, enum stmmac_mpacket_type type); int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h @@ -222,7 +222,7 @@ ((val) << XGMAC_PPS_MINIDX(x)) #define XGMAC_PPSCMD_START 0x2 #define XGMAC_PPSCMD_STOP 0x5 -#define XGMAC_PPSEN0 BIT(4) +#define XGMAC_PPSENx(x) BIT(4 + (x) * 8) #define XGMAC_PPSx_TARGET_TIME_SEC(x) (0x00000d80 + (x) * 0x10) #define XGMAC_PPSx_TARGET_TIME_NSEC(x) (0x00000d84 + (x) * 0x10) #define XGMAC_TRGTBUSY0 BIT(31) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -1138,7 +1138,19 @@ val |= XGMAC_PPSCMDx(index, XGMAC_PPSCMD_START); val |= XGMAC_TRGTMODSELx(index, XGMAC_PPSCMD_START); - val |= XGMAC_PPSEN0; + + /* XGMAC Core has 4 PPS outputs at most. + * + * Prior XGMAC Core 3.20, Fixed mode or Flexible mode are selectable for + * PPS0 only via PPSEN0. PPS{1,2,3} are in Flexible mode by default, + * and can not be switched to Fixed mode, since PPSEN{1,2,3} are + * read-only reserved to 0. + * But we always set PPSEN{1,2,3} do not make things worse ;-) + * + * From XGMAC Core 3.20 and later, PPSEN{0,1,2,3} are writable and must + * be set, or the PPS outputs stay in Fixed PPS mode by default. + */ + val |= XGMAC_PPSENx(index); writel(cfg->start.tv_sec, ioaddr + XGMAC_PPSx_TARGET_TIME_SEC(index)); @@ -1432,7 +1444,8 @@ return 0; } -static void dwxgmac3_fpe_configure(void __iomem *ioaddr, u32 num_txq, +static void dwxgmac3_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, + u32 num_txq, u32 num_rxq, bool enable) { u32 value; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -414,9 +414,11 @@ unsigned int ptp_rate); void (*est_irq_status)(void __iomem *ioaddr, struct net_device *dev, struct stmmac_extra_stats *x, u32 txqcnt); - void (*fpe_configure)(void __iomem *ioaddr, u32 num_txq, u32 num_rxq, + void (*fpe_configure)(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, + u32 num_txq, u32 num_rxq, bool enable); void (*fpe_send_mpacket)(void __iomem *ioaddr, + struct stmmac_fpe_cfg *cfg, enum stmmac_mpacket_type type); int (*fpe_irq_status)(void __iomem *ioaddr, struct net_device *dev); }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/stmicro/stmmac/mmc_core.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/mmc_core.c @@ -177,8 +177,10 @@ #define MMC_XGMAC_RX_DISCARD_OCT_GB 0x1b4 #define MMC_XGMAC_RX_ALIGN_ERR_PKT 0x1bc +#define MMC_XGMAC_TX_FPE_INTR_MASK 0x204 #define MMC_XGMAC_TX_FPE_FRAG 0x208 #define MMC_XGMAC_TX_HOLD_REQ 0x20c +#define MMC_XGMAC_RX_FPE_INTR_MASK 0x224 #define MMC_XGMAC_RX_PKT_ASSEMBLY_ERR 0x228 #define MMC_XGMAC_RX_PKT_SMD_ERR 0x22c #define MMC_XGMAC_RX_PKT_ASSEMBLY_OK 0x230 @@ -352,6 +354,8 @@ { writel(0x0, mmcaddr + MMC_RX_INTR_MASK); writel(0x0, mmcaddr + MMC_TX_INTR_MASK); + writel(MMC_DEFAULT_MASK, mmcaddr + MMC_XGMAC_TX_FPE_INTR_MASK); + writel(MMC_DEFAULT_MASK, mmcaddr + MMC_XGMAC_RX_FPE_INTR_MASK); writel(MMC_DEFAULT_MASK, mmcaddr + MMC_XGMAC_RX_IPC_INTR_MASK); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c @@ -1079,6 +1079,7 @@ priv->plat->fpe_cfg->enable = false; stmmac_fpe_configure(priv, priv->ioaddr, + priv->plat->fpe_cfg, priv->plat->tx_queues_to_use, priv->plat->rx_queues_to_use, false); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c @@ -1217,7 +1217,7 @@ key_index = wl->current_key; if (!enc->length && (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)) { - /* reques to change default key index */ + /* request to change default key index */ pr_debug("%s: request to change default key to %d\n", __func__, key_index); wl->current_key = key_index; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/toshiba/spider_net.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/toshiba/spider_net.c @@ -2332,7 +2332,7 @@ struct spider_net_card *card; netdev = alloc_etherdev(struct_size(card, darray, - tx_descriptors + rx_descriptors)); + size_add(tx_descriptors, rx_descriptors))); if (!netdev) return NULL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/wangxun/libwx/wx_hw.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/wangxun/libwx/wx_hw.c @@ -1741,10 +1741,12 @@ wx->subsystem_device_id = pdev->subsystem_device; } else { err = wx_flash_read_dword(wx, 0xfffdc, &ssid); - if (!err) - wx->subsystem_device_id = swab16((u16)ssid); + if (err < 0) { + wx_err(wx, "read of internal subsystem device id failed\n"); + return err; + } - return err; + wx->subsystem_device_id = swab16((u16)ssid); } wx->mac_table = kcalloc(wx->mac.num_rar_entries, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/wangxun/libwx/wx_lib.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/wangxun/libwx/wx_lib.c @@ -1965,11 +1965,11 @@ if (!pdev->msi_enabled && !pdev->msix_enabled) return; - pci_free_irq_vectors(wx->pdev); if (pdev->msix_enabled) { kfree(wx->msix_entries); wx->msix_entries = NULL; } + pci_free_irq_vectors(wx->pdev); } EXPORT_SYMBOL(wx_reset_interrupt_capability); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c @@ -121,10 +121,8 @@ /* PCI config space info */ err = wx_sw_init(wx); - if (err < 0) { - wx_err(wx, "read of internal subsystem device id failed\n"); + if (err < 0) return err; - } /* mac type, phy type , oem type */ ngbe_init_type_code(wx); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c @@ -319,10 +319,8 @@ /* PCI config space info */ err = wx_sw_init(wx); - if (err < 0) { - wx_err(wx, "read of internal subsystem device id failed\n"); + if (err < 0) return err; - } switch (wx->device_id) { case TXGBE_DEV_ID_SP1000: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -821,7 +821,7 @@ if (lp->features & XAE_FEATURE_FULL_TX_CSUM) { /* Tx Full Checksum Offload Enabled */ cur_p->app0 |= 2; - } else if (lp->features & XAE_FEATURE_PARTIAL_RX_CSUM) { + } else if (lp->features & XAE_FEATURE_PARTIAL_TX_CSUM) { csum_start_off = skb_transport_offset(skb); csum_index_off = csum_start_off + skb->csum_offset; /* Tx Partial Checksum Offload Enabled */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/gtp.c +++ linux-aws-6.5-6.5.0/drivers/net/gtp.c @@ -629,7 +629,7 @@ gtp->sk0 = NULL; else gtp->sk1u = NULL; - udp_sk(sk)->encap_type = 0; + WRITE_ONCE(udp_sk(sk)->encap_type, 0); rcu_assign_sk_user_data(sk, NULL); release_sock(sk); sock_put(sk); @@ -681,7 +681,7 @@ netdev_dbg(gtp->dev, "encap_recv sk=%p\n", sk); - switch (udp_sk(sk)->encap_type) { + switch (READ_ONCE(udp_sk(sk)->encap_type)) { case UDP_ENCAP_GTP0: netdev_dbg(gtp->dev, "received GTP0 packet\n"); ret = gtp0_udp_encap_recv(gtp, skb); @@ -871,8 +871,9 @@ skb_dst_update_pmtu_no_confirm(skb, mtu); - if (!skb_is_gso(skb) && (iph->frag_off & htons(IP_DF)) && - mtu < ntohs(iph->tot_len)) { + if (iph->frag_off & htons(IP_DF) && + ((!skb_is_gso(skb) && skb->len > mtu) || + (skb_is_gso(skb) && !skb_gso_validate_network_len(skb, mtu)))) { netdev_dbg(dev, "packet too big, fragmentation needed\n"); icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu)); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/hyperv/Kconfig +++ linux-aws-6.5-6.5.0/drivers/net/hyperv/Kconfig @@ -3,5 +3,6 @@ tristate "Microsoft Hyper-V virtual network driver" depends on HYPERV select UCS2_STRING + select NLS help Select this option to enable the Hyper-V virtual network driver. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/hyperv/netvsc_drv.c +++ linux-aws-6.5-6.5.0/drivers/net/hyperv/netvsc_drv.c @@ -2206,9 +2206,6 @@ goto upper_link_failed; } - /* set slave flag before open to prevent IPv6 addrconf */ - vf_netdev->flags |= IFF_SLAVE; - schedule_delayed_work(&ndev_ctx->vf_takeover, VF_TAKEOVER_INT); call_netdevice_notifiers(NETDEV_JOIN, vf_netdev); @@ -2315,16 +2312,18 @@ } - /* Fallback path to check synthetic vf with - * help of mac addr + /* Fallback path to check synthetic vf with help of mac addr. + * Because this function can be called before vf_netdev is + * initialized (NETDEV_POST_INIT) when its perm_addr has not been copied + * from dev_addr, also try to match to its dev_addr. + * Note: On Hyper-V and Azure, it's not possible to set a MAC address + * on a VF that matches to the MAC of a unrelated NETVSC device. */ list_for_each_entry(ndev_ctx, &netvsc_dev_list, list) { ndev = hv_get_drvdata(ndev_ctx->device_ctx); - if (ether_addr_equal(vf_netdev->perm_addr, ndev->perm_addr)) { - netdev_notice(vf_netdev, - "falling back to mac addr based matching\n"); + if (ether_addr_equal(vf_netdev->perm_addr, ndev->perm_addr) || + ether_addr_equal(vf_netdev->dev_addr, ndev->perm_addr)) return ndev; - } } netdev_notice(vf_netdev, @@ -2332,6 +2331,19 @@ return NULL; } +static int netvsc_prepare_bonding(struct net_device *vf_netdev) +{ + struct net_device *ndev; + + ndev = get_netvsc_byslot(vf_netdev); + if (!ndev) + return NOTIFY_DONE; + + /* set slave flag before open to prevent IPv6 addrconf */ + vf_netdev->flags |= IFF_SLAVE; + return NOTIFY_DONE; +} + static int netvsc_register_vf(struct net_device *vf_netdev) { struct net_device_context *net_device_ctx; @@ -2531,15 +2543,6 @@ goto devinfo_failed; } - nvdev = rndis_filter_device_add(dev, device_info); - if (IS_ERR(nvdev)) { - ret = PTR_ERR(nvdev); - netdev_err(net, "unable to add netvsc device (ret %d)\n", ret); - goto rndis_failed; - } - - eth_hw_addr_set(net, device_info->mac_adr); - /* We must get rtnl lock before scheduling nvdev->subchan_work, * otherwise netvsc_subchan_work() can get rtnl lock first and wait * all subchannels to show up, but that may not happen because @@ -2547,9 +2550,23 @@ * -> ... -> device_add() -> ... -> __device_attach() can't get * the device lock, so all the subchannels can't be processed -- * finally netvsc_subchan_work() hangs forever. + * + * The rtnl lock also needs to be held before rndis_filter_device_add() + * which advertises nvsp_2_vsc_capability / sriov bit, and triggers + * VF NIC offering and registering. If VF NIC finished register_netdev() + * earlier it may cause name based config failure. */ rtnl_lock(); + nvdev = rndis_filter_device_add(dev, device_info); + if (IS_ERR(nvdev)) { + ret = PTR_ERR(nvdev); + netdev_err(net, "unable to add netvsc device (ret %d)\n", ret); + goto rndis_failed; + } + + eth_hw_addr_set(net, device_info->mac_adr); + if (nvdev->num_chn > 1) schedule_work(&nvdev->subchan_work); @@ -2586,9 +2603,9 @@ return 0; register_failed: - rtnl_unlock(); rndis_filter_device_remove(dev, nvdev); rndis_failed: + rtnl_unlock(); netvsc_devinfo_put(device_info); devinfo_failed: free_percpu(net_device_ctx->vf_stats); @@ -2753,6 +2770,8 @@ return NOTIFY_DONE; switch (event) { + case NETDEV_POST_INIT: + return netvsc_prepare_bonding(event_dev); case NETDEV_REGISTER: return netvsc_register_vf(event_dev); case NETDEV_UNREGISTER: @@ -2788,12 +2807,17 @@ } netvsc_ring_bytes = ring_size * PAGE_SIZE; + register_netdevice_notifier(&netvsc_netdev_notifier); + ret = vmbus_driver_register(&netvsc_drv); if (ret) - return ret; + goto err_vmbus_reg; - register_netdevice_notifier(&netvsc_netdev_notifier); return 0; + +err_vmbus_reg: + unregister_netdevice_notifier(&netvsc_netdev_notifier); + return ret; } MODULE_LICENSE("GPL"); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ieee802154/adf7242.c +++ linux-aws-6.5-6.5.0/drivers/net/ieee802154/adf7242.c @@ -1162,9 +1162,10 @@ static void adf7242_debugfs_init(struct adf7242_local *lp) { - char debugfs_dir_name[DNAME_INLINE_LEN + 1] = "adf7242-"; + char debugfs_dir_name[DNAME_INLINE_LEN + 1]; - strncat(debugfs_dir_name, dev_name(&lp->spi->dev), DNAME_INLINE_LEN); + snprintf(debugfs_dir_name, sizeof(debugfs_dir_name), + "adf7242-%s", dev_name(&lp->spi->dev)); lp->debugfs_root = debugfs_create_dir(debugfs_dir_name, NULL); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ipa/reg/gsi_reg-v5.0.c +++ linux-aws-6.5-6.5.0/drivers/net/ipa/reg/gsi_reg-v5.0.c @@ -78,7 +78,7 @@ 0x0001c000 + 0x12000 * GSI_EE_AP, 0x80); static const u32 reg_ev_ch_e_cntxt_1_fmask[] = { - [R_LENGTH] = GENMASK(19, 0), + [R_LENGTH] = GENMASK(23, 0), }; REG_STRIDE_FIELDS(EV_CH_E_CNTXT_1, ev_ch_e_cntxt_1, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ipvlan/ipvlan_core.c +++ linux-aws-6.5-6.5.0/drivers/net/ipvlan/ipvlan_core.c @@ -411,7 +411,7 @@ return addr; } -static int ipvlan_process_v4_outbound(struct sk_buff *skb) +static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb) { const struct iphdr *ip4h = ip_hdr(skb); struct net_device *dev = skb->dev; @@ -441,25 +441,23 @@ err = ip_local_out(net, skb->sk, skb); if (unlikely(net_xmit_eval(err))) - dev->stats.tx_errors++; + DEV_STATS_INC(dev, tx_errors); else ret = NET_XMIT_SUCCESS; goto out; err: - dev->stats.tx_errors++; + DEV_STATS_INC(dev, tx_errors); kfree_skb(skb); out: return ret; } #if IS_ENABLED(CONFIG_IPV6) -static int ipvlan_process_v6_outbound(struct sk_buff *skb) + +static noinline_for_stack int +ipvlan_route_v6_outbound(struct net_device *dev, struct sk_buff *skb) { const struct ipv6hdr *ip6h = ipv6_hdr(skb); - struct net_device *dev = skb->dev; - struct net *net = dev_net(dev); - struct dst_entry *dst; - int err, ret = NET_XMIT_DROP; struct flowi6 fl6 = { .flowi6_oif = dev->ifindex, .daddr = ip6h->daddr, @@ -469,27 +467,38 @@ .flowi6_mark = skb->mark, .flowi6_proto = ip6h->nexthdr, }; + struct dst_entry *dst; + int err; - dst = ip6_route_output(net, NULL, &fl6); - if (dst->error) { - ret = dst->error; + dst = ip6_route_output(dev_net(dev), NULL, &fl6); + err = dst->error; + if (err) { dst_release(dst); - goto err; + return err; } skb_dst_set(skb, dst); + return 0; +} + +static int ipvlan_process_v6_outbound(struct sk_buff *skb) +{ + struct net_device *dev = skb->dev; + int err, ret = NET_XMIT_DROP; + + err = ipvlan_route_v6_outbound(dev, skb); + if (unlikely(err)) { + DEV_STATS_INC(dev, tx_errors); + kfree_skb(skb); + return err; + } memset(IP6CB(skb), 0, sizeof(*IP6CB(skb))); - err = ip6_local_out(net, skb->sk, skb); + err = ip6_local_out(dev_net(dev), skb->sk, skb); if (unlikely(net_xmit_eval(err))) - dev->stats.tx_errors++; + DEV_STATS_INC(dev, tx_errors); else ret = NET_XMIT_SUCCESS; - goto out; -err: - dev->stats.tx_errors++; - kfree_skb(skb); -out: return ret; } #else only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ipvlan/ipvlan_main.c +++ linux-aws-6.5-6.5.0/drivers/net/ipvlan/ipvlan_main.c @@ -324,6 +324,7 @@ s->rx_dropped = rx_errs; s->tx_dropped = tx_drps; } + s->tx_errors = DEV_STATS_READ(dev, tx_errors); } static int ipvlan_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/macvlan.c +++ linux-aws-6.5-6.5.0/drivers/net/macvlan.c @@ -780,7 +780,7 @@ if (dev->flags & IFF_UP) { if (change & IFF_ALLMULTI) dev_set_allmulti(lowerdev, dev->flags & IFF_ALLMULTI ? 1 : -1); - if (change & IFF_PROMISC) + if (!macvlan_passthru(vlan->port) && change & IFF_PROMISC) dev_set_promiscuity(lowerdev, dev->flags & IFF_PROMISC ? 1 : -1); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/mdio/mdio-mux.c +++ linux-aws-6.5-6.5.0/drivers/net/mdio/mdio-mux.c @@ -55,6 +55,27 @@ return r; } +static int mdio_mux_read_c45(struct mii_bus *bus, int phy_id, int dev_addr, + int regnum) +{ + struct mdio_mux_child_bus *cb = bus->priv; + struct mdio_mux_parent_bus *pb = cb->parent; + int r; + + mutex_lock_nested(&pb->mii_bus->mdio_lock, MDIO_MUTEX_MUX); + r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); + if (r) + goto out; + + pb->current_child = cb->bus_number; + + r = pb->mii_bus->read_c45(pb->mii_bus, phy_id, dev_addr, regnum); +out: + mutex_unlock(&pb->mii_bus->mdio_lock); + + return r; +} + /* * The parent bus' lock is used to order access to the switch_fn. */ @@ -80,6 +101,28 @@ return r; } +static int mdio_mux_write_c45(struct mii_bus *bus, int phy_id, int dev_addr, + int regnum, u16 val) +{ + struct mdio_mux_child_bus *cb = bus->priv; + struct mdio_mux_parent_bus *pb = cb->parent; + + int r; + + mutex_lock_nested(&pb->mii_bus->mdio_lock, MDIO_MUTEX_MUX); + r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); + if (r) + goto out; + + pb->current_child = cb->bus_number; + + r = pb->mii_bus->write_c45(pb->mii_bus, phy_id, dev_addr, regnum, val); +out: + mutex_unlock(&pb->mii_bus->mdio_lock); + + return r; +} + static int parent_count; static void mdio_mux_uninit_children(struct mdio_mux_parent_bus *pb) @@ -173,6 +216,10 @@ cb->mii_bus->parent = dev; cb->mii_bus->read = mdio_mux_read; cb->mii_bus->write = mdio_mux_write; + if (parent_bus->read_c45) + cb->mii_bus->read_c45 = mdio_mux_read_c45; + if (parent_bus->write_c45) + cb->mii_bus->write_c45 = mdio_mux_write_c45; r = of_mdiobus_register(cb->mii_bus, child_bus_node); if (r) { mdiobus_free(cb->mii_bus); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/netdevsim/bpf.c +++ linux-aws-6.5-6.5.0/drivers/net/netdevsim/bpf.c @@ -93,7 +93,7 @@ { struct nsim_bpf_bound_prog *state; - if (!prog || !prog->aux->offload) + if (!prog || !bpf_prog_is_offloaded(prog->aux)) return; state = prog->aux->offload->dev_priv; @@ -311,7 +311,7 @@ if (!bpf->prog) return 0; - if (!bpf->prog->aux->offload) { + if (!bpf_prog_is_offloaded(bpf->prog->aux)) { NSIM_EA(bpf->extack, "xdpoffload of non-bound program"); return -EINVAL; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/phy/bcm7xxx.c +++ linux-aws-6.5-6.5.0/drivers/net/phy/bcm7xxx.c @@ -894,6 +894,9 @@ .name = _name, \ /* PHY_BASIC_FEATURES */ \ .flags = PHY_IS_INTERNAL, \ + .get_sset_count = bcm_phy_get_sset_count, \ + .get_strings = bcm_phy_get_strings, \ + .get_stats = bcm7xxx_28nm_get_phy_stats, \ .probe = bcm7xxx_28nm_probe, \ .config_init = bcm7xxx_16nm_ephy_config_init, \ .config_aneg = genphy_config_aneg, \ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/phy/phylink.c +++ linux-aws-6.5-6.5.0/drivers/net/phy/phylink.c @@ -1568,6 +1568,7 @@ pl->config = config; if (config->type == PHYLINK_NETDEV) { pl->netdev = to_net_dev(config->dev); + netif_carrier_off(pl->netdev); } else if (config->type == PHYLINK_DEV) { pl->dev = config->dev; } else { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/phy/sfp.c +++ linux-aws-6.5-6.5.0/drivers/net/phy/sfp.c @@ -452,6 +452,11 @@ // Rollball protocol to talk to the PHY. SFP_QUIRK_F("FS", "SFP-10G-T", sfp_fixup_fs_10gt), + // Fiberstore GPON-ONU-34-20BI can operate at 2500base-X, but report 1.2GBd + // NRZ in their EEPROM + SFP_QUIRK("FS", "GPON-ONU-34-20BI", sfp_quirk_2500basex, + sfp_fixup_ignore_tx_fault), + SFP_QUIRK_F("HALNy", "HL-GSFP", sfp_fixup_halny_gsfp), // HG MXPD-483II-F 2.5G supports 2500Base-X, but incorrectly reports @@ -463,6 +468,9 @@ SFP_QUIRK("HUAWEI", "MA5671A", sfp_quirk_2500basex, sfp_fixup_ignore_tx_fault), + // FS 2.5G Base-T + SFP_QUIRK_M("FS", "SFP-2.5G-T", sfp_quirk_oem_2_5g), + // Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report // 2500MBd NRZ in their EEPROM SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/ppp/ppp_synctty.c +++ linux-aws-6.5-6.5.0/drivers/net/ppp/ppp_synctty.c @@ -462,6 +462,10 @@ case PPPIOCSMRU: if (get_user(val, (int __user *) argp)) break; + if (val > U16_MAX) { + err = -EINVAL; + break; + } if (val < PPP_MRU) val = PPP_MRU; ap->mru = val; @@ -697,7 +701,7 @@ /* strip address/control field if present */ p = skb->data; - if (p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) { + if (skb->len >= 2 && p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) { /* chop off address/control */ if (skb->len < 3) goto err; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/tun.c +++ linux-aws-6.5-6.5.0/drivers/net/tun.c @@ -3068,10 +3068,11 @@ struct net *net = sock_net(&tfile->sk); struct tun_struct *tun; void __user* argp = (void __user*)arg; - unsigned int ifindex, carrier; + unsigned int carrier; struct ifreq ifr; kuid_t owner; kgid_t group; + int ifindex; int sndbuf; int vnet_hdr_sz; int le; @@ -3127,7 +3128,9 @@ ret = -EFAULT; if (copy_from_user(&ifindex, argp, sizeof(ifindex))) goto unlock; - + ret = -EINVAL; + if (ifindex < 0) + goto unlock; ret = 0; tfile->ifindex = ifindex; goto unlock; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/usb/ax88179_178a.c +++ linux-aws-6.5-6.5.0/drivers/net/usb/ax88179_178a.c @@ -1583,11 +1583,11 @@ *tmp16 = AX_PHYPWR_RSTCTL_IPRL; ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_PHYPWR_RSTCTL, 2, 2, tmp16); - msleep(200); + msleep(500); *tmp = AX_CLK_SELECT_ACS | AX_CLK_SELECT_BCS; ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_CLK_SELECT, 1, 1, tmp); - msleep(100); + msleep(200); /* Ethernet PHY Auto Detach*/ ax88179_auto_detach(dev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/usb/smsc95xx.c +++ linux-aws-6.5-6.5.0/drivers/net/usb/smsc95xx.c @@ -95,7 +95,9 @@ ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 0, index, &buf, 4); - if (ret < 0) { + if (ret < 4) { + ret = ret < 0 ? ret : -ENODATA; + if (ret != -ENODEV) netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n", index, ret); @@ -897,7 +899,7 @@ if (timeout >= 100) { netdev_warn(dev->net, "timeout waiting for completion of Lite Reset\n"); - return ret; + return -ETIMEDOUT; } ret = smsc95xx_set_mac_address(dev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/virtio_net.c +++ linux-aws-6.5-6.5.0/drivers/net/virtio_net.c @@ -80,24 +80,24 @@ struct virtnet_sq_stats { struct u64_stats_sync syncp; - u64 packets; - u64 bytes; - u64 xdp_tx; - u64 xdp_tx_drops; - u64 kicks; - u64 tx_timeouts; + u64_stats_t packets; + u64_stats_t bytes; + u64_stats_t xdp_tx; + u64_stats_t xdp_tx_drops; + u64_stats_t kicks; + u64_stats_t tx_timeouts; }; struct virtnet_rq_stats { struct u64_stats_sync syncp; - u64 packets; - u64 bytes; - u64 drops; - u64 xdp_packets; - u64 xdp_tx; - u64 xdp_redirects; - u64 xdp_drops; - u64 kicks; + u64_stats_t packets; + u64_stats_t bytes; + u64_stats_t drops; + u64_stats_t xdp_packets; + u64_stats_t xdp_tx; + u64_stats_t xdp_redirects; + u64_stats_t xdp_drops; + u64_stats_t kicks; }; #define VIRTNET_SQ_STAT(m) offsetof(struct virtnet_sq_stats, m) @@ -593,8 +593,8 @@ return; u64_stats_update_begin(&sq->stats.syncp); - sq->stats.bytes += bytes; - sq->stats.packets += packets; + u64_stats_add(&sq->stats.bytes, bytes); + u64_stats_add(&sq->stats.packets, packets); u64_stats_update_end(&sq->stats.syncp); } @@ -793,11 +793,11 @@ } out: u64_stats_update_begin(&sq->stats.syncp); - sq->stats.bytes += bytes; - sq->stats.packets += packets; - sq->stats.xdp_tx += n; - sq->stats.xdp_tx_drops += n - nxmit; - sq->stats.kicks += kicks; + u64_stats_add(&sq->stats.bytes, bytes); + u64_stats_add(&sq->stats.packets, packets); + u64_stats_add(&sq->stats.xdp_tx, n); + u64_stats_add(&sq->stats.xdp_tx_drops, n - nxmit); + u64_stats_add(&sq->stats.kicks, kicks); u64_stats_update_end(&sq->stats.syncp); virtnet_xdp_put_sq(vi, sq); @@ -829,14 +829,14 @@ u32 act; act = bpf_prog_run_xdp(xdp_prog, xdp); - stats->xdp_packets++; + u64_stats_inc(&stats->xdp_packets); switch (act) { case XDP_PASS: return act; case XDP_TX: - stats->xdp_tx++; + u64_stats_inc(&stats->xdp_tx); xdpf = xdp_convert_buff_to_frame(xdp); if (unlikely(!xdpf)) { netdev_dbg(dev, "convert buff to frame failed for xdp\n"); @@ -854,7 +854,7 @@ return act; case XDP_REDIRECT: - stats->xdp_redirects++; + u64_stats_inc(&stats->xdp_redirects); err = xdp_do_redirect(dev, xdp, xdp_prog); if (err) return XDP_DROP; @@ -1050,9 +1050,9 @@ return skb; err_xdp: - stats->xdp_drops++; + u64_stats_inc(&stats->xdp_drops); err: - stats->drops++; + u64_stats_inc(&stats->drops); put_page(page); xdp_xmit: return NULL; @@ -1071,7 +1071,7 @@ struct sk_buff *skb; len -= vi->hdr_len; - stats->bytes += len; + u64_stats_add(&stats->bytes, len); if (unlikely(len > GOOD_PACKET_LEN)) { pr_debug("%s: rx error: len %u exceeds max size %d\n", @@ -1100,7 +1100,7 @@ return skb; err: - stats->drops++; + u64_stats_inc(&stats->drops); put_page(page); return NULL; } @@ -1116,14 +1116,14 @@ struct sk_buff *skb = page_to_skb(vi, rq, page, 0, len, PAGE_SIZE, 0); - stats->bytes += len - vi->hdr_len; + u64_stats_add(&stats->bytes, len - vi->hdr_len); if (unlikely(!skb)) goto err; return skb; err: - stats->drops++; + u64_stats_inc(&stats->drops); give_pages(rq, page); return NULL; } @@ -1144,7 +1144,7 @@ dev->stats.rx_length_errors++; break; } - stats->bytes += len; + u64_stats_add(&stats->bytes, len); page = virt_to_head_page(buf); put_page(page); } @@ -1254,7 +1254,7 @@ goto err; } - stats->bytes += len; + u64_stats_add(&stats->bytes, len); page = virt_to_head_page(buf); offset = buf - page_address(page); @@ -1418,8 +1418,8 @@ put_page(page); mergeable_buf_free(rq, num_buf, dev, stats); - stats->xdp_drops++; - stats->drops++; + u64_stats_inc(&stats->xdp_drops); + u64_stats_inc(&stats->drops); return NULL; } @@ -1443,7 +1443,7 @@ unsigned int room = SKB_DATA_ALIGN(headroom + tailroom); head_skb = NULL; - stats->bytes += len - vi->hdr_len; + u64_stats_add(&stats->bytes, len - vi->hdr_len); if (unlikely(len > truesize - room)) { pr_debug("%s: rx error: len %u exceeds truesize %lu\n", @@ -1484,7 +1484,7 @@ goto err_buf; } - stats->bytes += len; + u64_stats_add(&stats->bytes, len); page = virt_to_head_page(buf); truesize = mergeable_ctx_to_truesize(ctx); @@ -1536,7 +1536,7 @@ mergeable_buf_free(rq, num_buf, dev, stats); err_buf: - stats->drops++; + u64_stats_inc(&stats->drops); dev_kfree_skb(head_skb); return NULL; } @@ -1797,7 +1797,7 @@ unsigned long flags; flags = u64_stats_update_begin_irqsave(&rq->stats.syncp); - rq->stats.kicks++; + u64_stats_inc(&rq->stats.kicks); u64_stats_update_end_irqrestore(&rq->stats.syncp, flags); } @@ -1877,22 +1877,23 @@ struct virtnet_info *vi = rq->vq->vdev->priv; struct virtnet_rq_stats stats = {}; unsigned int len; + int packets = 0; void *buf; int i; if (!vi->big_packets || vi->mergeable_rx_bufs) { void *ctx; - while (stats.packets < budget && + while (packets < budget && (buf = virtqueue_get_buf_ctx(rq->vq, &len, &ctx))) { receive_buf(vi, rq, buf, len, ctx, xdp_xmit, &stats); - stats.packets++; + packets++; } } else { - while (stats.packets < budget && + while (packets < budget && (buf = virtqueue_get_buf(rq->vq, &len)) != NULL) { receive_buf(vi, rq, buf, len, NULL, xdp_xmit, &stats); - stats.packets++; + packets++; } } @@ -1905,17 +1906,19 @@ } } + u64_stats_set(&stats.packets, packets); u64_stats_update_begin(&rq->stats.syncp); for (i = 0; i < VIRTNET_RQ_STATS_LEN; i++) { size_t offset = virtnet_rq_stats_desc[i].offset; - u64 *item; + u64_stats_t *item, *src; - item = (u64 *)((u8 *)&rq->stats + offset); - *item += *(u64 *)((u8 *)&stats + offset); + item = (u64_stats_t *)((u8 *)&rq->stats + offset); + src = (u64_stats_t *)((u8 *)&stats + offset); + u64_stats_add(item, u64_stats_read(src)); } u64_stats_update_end(&rq->stats.syncp); - return stats.packets; + return packets; } static void virtnet_poll_cleantx(struct receive_queue *rq) @@ -1970,7 +1973,7 @@ sq = virtnet_xdp_get_sq(vi); if (virtqueue_kick_prepare(sq->vq) && virtqueue_notify(sq->vq)) { u64_stats_update_begin(&sq->stats.syncp); - sq->stats.kicks++; + u64_stats_inc(&sq->stats.kicks); u64_stats_update_end(&sq->stats.syncp); } virtnet_xdp_put_sq(vi, sq); @@ -2182,7 +2185,7 @@ if (kick || netif_xmit_stopped(txq)) { if (virtqueue_kick_prepare(sq->vq) && virtqueue_notify(sq->vq)) { u64_stats_update_begin(&sq->stats.syncp); - sq->stats.kicks++; + u64_stats_inc(&sq->stats.kicks); u64_stats_update_end(&sq->stats.syncp); } } @@ -2365,16 +2368,16 @@ do { start = u64_stats_fetch_begin(&sq->stats.syncp); - tpackets = sq->stats.packets; - tbytes = sq->stats.bytes; - terrors = sq->stats.tx_timeouts; + tpackets = u64_stats_read(&sq->stats.packets); + tbytes = u64_stats_read(&sq->stats.bytes); + terrors = u64_stats_read(&sq->stats.tx_timeouts); } while (u64_stats_fetch_retry(&sq->stats.syncp, start)); do { start = u64_stats_fetch_begin(&rq->stats.syncp); - rpackets = rq->stats.packets; - rbytes = rq->stats.bytes; - rdrops = rq->stats.drops; + rpackets = u64_stats_read(&rq->stats.packets); + rbytes = u64_stats_read(&rq->stats.bytes); + rdrops = u64_stats_read(&rq->stats.drops); } while (u64_stats_fetch_retry(&rq->stats.syncp, start)); tot->rx_packets += rpackets; @@ -2976,17 +2979,19 @@ struct virtnet_info *vi = netdev_priv(dev); unsigned int idx = 0, start, i, j; const u8 *stats_base; + const u64_stats_t *p; size_t offset; for (i = 0; i < vi->curr_queue_pairs; i++) { struct receive_queue *rq = &vi->rq[i]; - stats_base = (u8 *)&rq->stats; + stats_base = (const u8 *)&rq->stats; do { start = u64_stats_fetch_begin(&rq->stats.syncp); for (j = 0; j < VIRTNET_RQ_STATS_LEN; j++) { offset = virtnet_rq_stats_desc[j].offset; - data[idx + j] = *(u64 *)(stats_base + offset); + p = (const u64_stats_t *)(stats_base + offset); + data[idx + j] = u64_stats_read(p); } } while (u64_stats_fetch_retry(&rq->stats.syncp, start)); idx += VIRTNET_RQ_STATS_LEN; @@ -2995,12 +3000,13 @@ for (i = 0; i < vi->curr_queue_pairs; i++) { struct send_queue *sq = &vi->sq[i]; - stats_base = (u8 *)&sq->stats; + stats_base = (const u8 *)&sq->stats; do { start = u64_stats_fetch_begin(&sq->stats.syncp); for (j = 0; j < VIRTNET_SQ_STATS_LEN; j++) { offset = virtnet_sq_stats_desc[j].offset; - data[idx + j] = *(u64 *)(stats_base + offset); + p = (const u64_stats_t *)(stats_base + offset); + data[idx + j] = u64_stats_read(p); } } while (u64_stats_fetch_retry(&sq->stats.syncp, start)); idx += VIRTNET_SQ_STATS_LEN; @@ -3550,7 +3556,7 @@ struct netdev_queue *txq = netdev_get_tx_queue(dev, txqueue); u64_stats_update_begin(&sq->stats.syncp); - sq->stats.tx_timeouts++; + u64_stats_inc(&sq->stats.tx_timeouts); u64_stats_update_end(&sq->stats.syncp); netdev_err(dev, "TX timeout on queue: %u, sq: %s, vq: 0x%x, name: %s, %u usecs ago\n", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/vrf.c +++ linux-aws-6.5-6.5.0/drivers/net/vrf.c @@ -121,22 +121,12 @@ int ifindex; }; -struct pcpu_dstats { - u64 tx_pkts; - u64 tx_bytes; - u64 tx_drps; - u64 rx_pkts; - u64 rx_bytes; - u64 rx_drps; - struct u64_stats_sync syncp; -}; - static void vrf_rx_stats(struct net_device *dev, int len) { struct pcpu_dstats *dstats = this_cpu_ptr(dev->dstats); u64_stats_update_begin(&dstats->syncp); - dstats->rx_pkts++; + dstats->rx_packets++; dstats->rx_bytes += len; u64_stats_update_end(&dstats->syncp); } @@ -161,10 +151,10 @@ do { start = u64_stats_fetch_begin(&dstats->syncp); tbytes = dstats->tx_bytes; - tpkts = dstats->tx_pkts; - tdrops = dstats->tx_drps; + tpkts = dstats->tx_packets; + tdrops = dstats->tx_drops; rbytes = dstats->rx_bytes; - rpkts = dstats->rx_pkts; + rpkts = dstats->rx_packets; } while (u64_stats_fetch_retry(&dstats->syncp, start)); stats->tx_bytes += tbytes; stats->tx_packets += tpkts; @@ -421,7 +411,7 @@ if (likely(__netif_rx(skb) == NET_RX_SUCCESS)) vrf_rx_stats(dev, len); else - this_cpu_inc(dev->dstats->rx_drps); + this_cpu_inc(dev->dstats->rx_drops); return NETDEV_TX_OK; } @@ -616,11 +606,11 @@ struct pcpu_dstats *dstats = this_cpu_ptr(dev->dstats); u64_stats_update_begin(&dstats->syncp); - dstats->tx_pkts++; + dstats->tx_packets++; dstats->tx_bytes += len; u64_stats_update_end(&dstats->syncp); } else { - this_cpu_inc(dev->dstats->tx_drps); + this_cpu_inc(dev->dstats->tx_drops); } return ret; @@ -1176,22 +1166,15 @@ vrf_rtable_release(dev, vrf); vrf_rt6_release(dev, vrf); - - free_percpu(dev->dstats); - dev->dstats = NULL; } static int vrf_dev_init(struct net_device *dev) { struct net_vrf *vrf = netdev_priv(dev); - dev->dstats = netdev_alloc_pcpu_stats(struct pcpu_dstats); - if (!dev->dstats) - goto out_nomem; - /* create the default dst which points back to us */ if (vrf_rtable_create(dev) != 0) - goto out_stats; + goto out_nomem; if (vrf_rt6_create(dev) != 0) goto out_rth; @@ -1205,9 +1188,6 @@ out_rth: vrf_rtable_release(dev, vrf); -out_stats: - free_percpu(dev->dstats); - dev->dstats = NULL; out_nomem: return -ENOMEM; } @@ -1706,6 +1686,8 @@ dev->min_mtu = IPV6_MIN_MTU; dev->max_mtu = IP6_MAX_MTU; dev->mtu = dev->max_mtu; + + dev->pcpu_stat_type = NETDEV_PCPU_STAT_DSTATS; } static int vrf_validate(struct nlattr *tb[], struct nlattr *data[], only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireguard/device.c +++ linux-aws-6.5-6.5.0/drivers/net/wireguard/device.c @@ -210,7 +210,7 @@ */ while (skb_queue_len(&peer->staged_packet_queue) > MAX_STAGED_PACKETS) { dev_kfree_skb(__skb_dequeue(&peer->staged_packet_queue)); - ++dev->stats.tx_dropped; + DEV_STATS_INC(dev, tx_dropped); } skb_queue_splice_tail(&packets, &peer->staged_packet_queue); spin_unlock_bh(&peer->staged_packet_queue.lock); @@ -228,7 +228,7 @@ else if (skb->protocol == htons(ETH_P_IPV6)) icmpv6_ndo_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0); err: - ++dev->stats.tx_errors; + DEV_STATS_INC(dev, tx_errors); kfree_skb(skb); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireguard/receive.c +++ linux-aws-6.5-6.5.0/drivers/net/wireguard/receive.c @@ -416,20 +416,20 @@ net_dbg_skb_ratelimited("%s: Packet has unallowed src IP (%pISc) from peer %llu (%pISpfsc)\n", dev->name, skb, peer->internal_id, &peer->endpoint.addr); - ++dev->stats.rx_errors; - ++dev->stats.rx_frame_errors; + DEV_STATS_INC(dev, rx_errors); + DEV_STATS_INC(dev, rx_frame_errors); goto packet_processed; dishonest_packet_type: net_dbg_ratelimited("%s: Packet is neither ipv4 nor ipv6 from peer %llu (%pISpfsc)\n", dev->name, peer->internal_id, &peer->endpoint.addr); - ++dev->stats.rx_errors; - ++dev->stats.rx_frame_errors; + DEV_STATS_INC(dev, rx_errors); + DEV_STATS_INC(dev, rx_frame_errors); goto packet_processed; dishonest_packet_size: net_dbg_ratelimited("%s: Packet has incorrect size from peer %llu (%pISpfsc)\n", dev->name, peer->internal_id, &peer->endpoint.addr); - ++dev->stats.rx_errors; - ++dev->stats.rx_length_errors; + DEV_STATS_INC(dev, rx_errors); + DEV_STATS_INC(dev, rx_length_errors); goto packet_processed; packet_processed: dev_kfree_skb(skb); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireguard/send.c +++ linux-aws-6.5-6.5.0/drivers/net/wireguard/send.c @@ -333,7 +333,8 @@ void wg_packet_purge_staged_packets(struct wg_peer *peer) { spin_lock_bh(&peer->staged_packet_queue.lock); - peer->device->dev->stats.tx_dropped += peer->staged_packet_queue.qlen; + DEV_STATS_ADD(peer->device->dev, tx_dropped, + peer->staged_packet_queue.qlen); __skb_queue_purge(&peer->staged_packet_queue); spin_unlock_bh(&peer->staged_packet_queue.lock); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/ath/ath10k/debug.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath10k/debug.c @@ -1140,7 +1140,7 @@ u32 sset, u8 *data) { if (sset == ETH_SS_STATS) - memcpy(data, *ath10k_gstrings_stats, + memcpy(data, ath10k_gstrings_stats, sizeof(ath10k_gstrings_stats)); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/ath/ath10k/snoc.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath10k/snoc.c @@ -828,12 +828,20 @@ static inline void ath10k_snoc_irq_disable(struct ath10k *ar) { - ath10k_ce_disable_interrupts(ar); + struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); + int id; + + for (id = 0; id < CE_COUNT_MAX; id++) + disable_irq(ar_snoc->ce_irqs[id].irq_line); } static inline void ath10k_snoc_irq_enable(struct ath10k *ar) { - ath10k_ce_enable_interrupts(ar); + struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); + int id; + + for (id = 0; id < CE_COUNT_MAX; id++) + enable_irq(ar_snoc->ce_irqs[id].irq_line); } static void ath10k_snoc_rx_pipe_cleanup(struct ath10k_snoc_pipe *snoc_pipe) @@ -1090,6 +1098,8 @@ goto err_free_rri; } + ath10k_ce_enable_interrupts(ar); + return 0; err_free_rri: @@ -1253,8 +1263,8 @@ for (id = 0; id < CE_COUNT_MAX; id++) { ret = request_irq(ar_snoc->ce_irqs[id].irq_line, - ath10k_snoc_per_engine_handler, 0, - ce_name[id], ar); + ath10k_snoc_per_engine_handler, + IRQF_NO_AUTOEN, ce_name[id], ar); if (ret) { ath10k_err(ar, "failed to register IRQ handler for CE %d: %d\n", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/ath/ath11k/mac.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath11k/mac.c @@ -9042,6 +9042,14 @@ if (ar->state != ATH11K_STATE_ON) goto err_fallback; + /* Firmware doesn't provide Tx power during CAC hence no need to fetch + * the stats. + */ + if (test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) { + mutex_unlock(&ar->conf_mutex); + return -EAGAIN; + } + req_param.pdev_id = ar->pdev->pdev_id; req_param.stats_id = WMI_REQUEST_PDEV_STAT; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/ath/ath11k/wmi.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath11k/wmi.c @@ -8337,6 +8337,8 @@ ev->detector_id, ev->segment_id, ev->timestamp, ev->is_chirp, ev->freq_offset, ev->sidx); + rcu_read_lock(); + ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); if (!ar) { @@ -8354,6 +8356,8 @@ ieee80211_radar_detected(ar->hw); exit: + rcu_read_unlock(); + kfree(tb); } @@ -8383,15 +8387,19 @@ ath11k_dbg(ab, ATH11K_DBG_WMI, "event pdev temperature ev temp %d pdev_id %d\n", ev->temp, ev->pdev_id); + rcu_read_lock(); + ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); if (!ar) { ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev->pdev_id); - kfree(tb); - return; + goto exit; } ath11k_thermal_event_temperature(ar, ev->temp); +exit: + rcu_read_unlock(); + kfree(tb); } @@ -8611,12 +8619,13 @@ return; } + rcu_read_lock(); + arvif = ath11k_mac_get_arvif_by_vdev_id(ab, ev->vdev_id); if (!arvif) { ath11k_warn(ab, "failed to get arvif for vdev_id:%d\n", ev->vdev_id); - kfree(tb); - return; + goto exit; } ath11k_dbg(ab, ATH11K_DBG_WMI, "event gtk offload refresh_cnt %d\n", @@ -8633,6 +8642,8 @@ ieee80211_gtk_rekey_notify(arvif->vif, arvif->bssid, (void *)&replay_ctr_be, GFP_ATOMIC); +exit: + rcu_read_unlock(); kfree(tb); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/ath/ath12k/dp_rx.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -1555,6 +1555,13 @@ msg = (struct ath12k_htt_ppdu_stats_msg *)skb->data; len = le32_get_bits(msg->info, HTT_T2H_PPDU_STATS_INFO_PAYLOAD_SIZE); + if (len > (skb->len - struct_size(msg, data, 0))) { + ath12k_warn(ab, + "HTT PPDU STATS event has unexpected payload size %u, should be smaller than %u\n", + len, skb->len); + return -EINVAL; + } + pdev_id = le32_get_bits(msg->info, HTT_T2H_PPDU_STATS_INFO_PDEV_ID); ppdu_id = le32_to_cpu(msg->ppdu_id); @@ -1583,6 +1590,16 @@ goto exit; } + if (ppdu_info->ppdu_stats.common.num_users >= HTT_PPDU_STATS_MAX_USERS) { + spin_unlock_bh(&ar->data_lock); + ath12k_warn(ab, + "HTT PPDU STATS event has unexpected num_users %u, should be smaller than %u\n", + ppdu_info->ppdu_stats.common.num_users, + HTT_PPDU_STATS_MAX_USERS); + ret = -EINVAL; + goto exit; + } + /* back up data rate tlv for all peers */ if (ppdu_info->frame_type == HTT_STATS_PPDU_FTYPE_DATA && (ppdu_info->tlv_bitmap & (1 << HTT_PPDU_STATS_TAG_USR_COMMON)) && @@ -1641,11 +1658,12 @@ msg = (struct ath12k_htt_mlo_offset_msg *)skb->data; pdev_id = u32_get_bits(__le32_to_cpu(msg->info), HTT_T2H_MLO_OFFSET_INFO_PDEV_ID); - ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); + rcu_read_lock(); + ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); if (!ar) { ath12k_warn(ab, "invalid pdev id %d on htt mlo offset\n", pdev_id); - return; + goto exit; } spin_lock_bh(&ar->data_lock); @@ -1661,6 +1679,8 @@ pdev->timestamp.mlo_comp_timer = __le32_to_cpu(msg->mlo_comp_timer); spin_unlock_bh(&ar->data_lock); +exit: + rcu_read_unlock(); } void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab, @@ -2747,6 +2767,7 @@ } peer->tfm_mmic = tfm; + peer->dp_setup_done = true; spin_unlock_bh(&ab->base_lock); return 0; @@ -3213,6 +3234,14 @@ ret = -ENOENT; goto out_unlock; } + + if (!peer->dp_setup_done) { + ath12k_warn(ab, "The peer %pM [%d] has uninitialized datapath\n", + peer->addr, peer_id); + ret = -ENOENT; + goto out_unlock; + } + rx_tid = &peer->rx_tid[tid]; if ((!skb_queue_empty(&rx_tid->rx_frags) && seqno != rx_tid->cur_sn) || @@ -3228,7 +3257,7 @@ goto out_unlock; } - if (frag_no > __fls(rx_tid->rx_frag_bitmap)) + if ((!rx_tid->rx_frag_bitmap || frag_no > __fls(rx_tid->rx_frag_bitmap))) __skb_queue_tail(&rx_tid->rx_frags, msdu); else ath12k_dp_rx_h_sort_frags(ab, &rx_tid->rx_frags, msdu); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/ath/ath12k/dp_tx.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/dp_tx.c @@ -330,8 +330,11 @@ fail_unmap_dma: dma_unmap_single(ab->dev, ti.paddr, ti.data_len, DMA_TO_DEVICE); - dma_unmap_single(ab->dev, skb_cb->paddr_ext_desc, - sizeof(struct hal_tx_msdu_ext_desc), DMA_TO_DEVICE); + + if (skb_cb->paddr_ext_desc) + dma_unmap_single(ab->dev, skb_cb->paddr_ext_desc, + sizeof(struct hal_tx_msdu_ext_desc), + DMA_TO_DEVICE); fail_remove_tx_buf: ath12k_dp_tx_release_txbuf(dp, tx_desc, pool_id); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/ath/ath12k/mhi.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/mhi.c @@ -370,8 +370,7 @@ ret = ath12k_mhi_get_msi(ab_pci); if (ret) { ath12k_err(ab, "failed to get msi for mhi\n"); - mhi_free_controller(mhi_ctrl); - return ret; + goto free_controller; } mhi_ctrl->iova_start = 0; @@ -388,11 +387,15 @@ ret = mhi_register_controller(mhi_ctrl, ab->hw_params->mhi_config); if (ret) { ath12k_err(ab, "failed to register to mhi bus, err = %d\n", ret); - mhi_free_controller(mhi_ctrl); - return ret; + goto free_controller; } return 0; + +free_controller: + mhi_free_controller(mhi_ctrl); + ab_pci->mhi_ctrl = NULL; + return ret; } void ath12k_mhi_unregister(struct ath12k_pci *ab_pci) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/ath/ath12k/peer.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath12k/peer.h @@ -44,6 +44,9 @@ struct ppdu_user_delayba ppdu_stats_delayba; bool delayba_flag; bool is_authorized; + + /* protected by ab->data_lock */ + bool dp_setup_done; }; void ath12k_peer_unmap_event(struct ath12k_base *ab, u16 peer_id); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/ath/ath9k/debug.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/ath9k/debug.c @@ -1333,7 +1333,7 @@ u32 sset, u8 *data) { if (sset == ETH_SS_STATS) - memcpy(data, *ath9k_gstrings_stats, + memcpy(data, ath9k_gstrings_stats, sizeof(ath9k_gstrings_stats)); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/ath/dfs_pattern_detector.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/ath/dfs_pattern_detector.c @@ -206,7 +206,7 @@ INIT_LIST_HEAD(&cd->head); cd->freq = freq; - cd->detectors = kmalloc_array(dpd->num_radar_types, + cd->detectors = kcalloc(dpd->num_radar_types, sizeof(*cd->detectors), GFP_ATOMIC); if (cd->detectors == NULL) goto fail; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/cfg/bz.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/cfg/bz.c @@ -134,12 +134,10 @@ .ht_params = &iwl_gl_a_ht_params /* - * If the device doesn't support HE, no need to have that many buffers. - * These sizes were picked according to 8 MSDUs inside 256 A-MSDUs in an + * This size was picked according to 8 MSDUs inside 512 A-MSDUs in an * A-MPDU, with additional overhead to account for processing time. */ -#define IWL_NUM_RBDS_NON_HE 512 -#define IWL_NUM_RBDS_BZ_HE 4096 +#define IWL_NUM_RBDS_BZ_EHT (512 * 16) const struct iwl_cfg_trans_params iwl_bz_trans_cfg = { .device_family = IWL_DEVICE_FAMILY_BZ, @@ -160,16 +158,16 @@ .fw_name_mac = "bz", .uhb_supported = true, IWL_DEVICE_BZ, - .features = IWL_TX_CSUM_NETIF_FLAGS_BZ | NETIF_F_RXCSUM, - .num_rbds = IWL_NUM_RBDS_BZ_HE, + .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, + .num_rbds = IWL_NUM_RBDS_BZ_EHT, }; const struct iwl_cfg iwl_cfg_gl = { .fw_name_mac = "gl", .uhb_supported = true, IWL_DEVICE_BZ, - .features = IWL_TX_CSUM_NETIF_FLAGS_BZ | NETIF_F_RXCSUM, - .num_rbds = IWL_NUM_RBDS_BZ_HE, + .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, + .num_rbds = IWL_NUM_RBDS_BZ_EHT, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/cfg/sc.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/cfg/sc.c @@ -127,12 +127,10 @@ .ht_params = &iwl_22000_ht_params /* - * If the device doesn't support HE, no need to have that many buffers. - * These sizes were picked according to 8 MSDUs inside 256 A-MSDUs in an + * This size was picked according to 8 MSDUs inside 512 A-MSDUs in an * A-MPDU, with additional overhead to account for processing time. */ -#define IWL_NUM_RBDS_NON_HE 512 -#define IWL_NUM_RBDS_SC_HE 4096 +#define IWL_NUM_RBDS_SC_EHT (512 * 16) const struct iwl_cfg_trans_params iwl_sc_trans_cfg = { .device_family = IWL_DEVICE_FAMILY_SC, @@ -153,8 +151,8 @@ .fw_name_mac = "sc", .uhb_supported = true, IWL_DEVICE_SC, - .features = IWL_TX_CSUM_NETIF_FLAGS_BZ | NETIF_F_RXCSUM, - .num_rbds = IWL_NUM_RBDS_SC_HE, + .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, + .num_rbds = IWL_NUM_RBDS_SC_EHT, }; MODULE_FIRMWARE(IWL_SC_A_FM_B_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX)); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/dvm/tx.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/dvm/tx.c @@ -3,6 +3,7 @@ * * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. * Copyright (C) 2019 Intel Corporation + * Copyright (C) 2023 Intel Corporation *****************************************************************************/ #include @@ -1169,7 +1170,7 @@ iwlagn_check_ratid_empty(priv, sta_id, tid); } - iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs); + iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs, false); freed = 0; @@ -1315,7 +1316,7 @@ * block-ack window (we assume that they've been successfully * transmitted ... if not, it's too late anyway). */ iwl_trans_reclaim(priv->trans, scd_flow, ba_resp_scd_ssn, - &reclaimed_skbs); + &reclaimed_skbs, false); IWL_DEBUG_TX_REPLY(priv, "REPLY_COMPRESSED_BA [%d] Received from %pM, " "sta_id = %d\n", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h @@ -13,6 +13,7 @@ #define IWL_FW_INI_DOMAIN_ALWAYS_ON 0 #define IWL_FW_INI_REGION_ID_MASK GENMASK(15, 0) #define IWL_FW_INI_REGION_DUMP_POLICY_MASK GENMASK(31, 16) +#define IWL_FW_INI_PRESET_DISABLE 0xff /** * struct iwl_fw_ini_hcmd only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/iwl-config.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/iwl-config.h @@ -86,10 +86,7 @@ #define IWL_DEFAULT_MAX_TX_POWER 22 #define IWL_TX_CSUM_NETIF_FLAGS (NETIF_F_IPV6_CSUM | NETIF_F_IP_CSUM |\ NETIF_F_TSO | NETIF_F_TSO6) -#define IWL_TX_CSUM_NETIF_FLAGS_BZ (NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6) -#define IWL_CSUM_NETIF_FLAGS_MASK (IWL_TX_CSUM_NETIF_FLAGS | \ - IWL_TX_CSUM_NETIF_FLAGS_BZ | \ - NETIF_F_RXCSUM) +#define IWL_CSUM_NETIF_FLAGS_MASK (IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM) /* Antenna presence definitions */ #define ANT_NONE 0x0 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation */ #ifndef __iwl_dbg_tlv_h__ #define __iwl_dbg_tlv_h__ @@ -10,7 +10,8 @@ #include #include -#define IWL_DBG_TLV_MAX_PRESET 15 +#define IWL_DBG_TLV_MAX_PRESET 15 +#define ENABLE_INI (IWL_DBG_TLV_MAX_PRESET + 1) /** * struct iwl_dbg_tlv_node - debug TLV node only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/iwl-drv.c @@ -1795,6 +1795,22 @@ #endif drv->trans->dbg.domains_bitmap = IWL_TRANS_FW_DBG_DOMAIN(drv->trans); + if (iwlwifi_mod_params.enable_ini != ENABLE_INI) { + /* We have a non-default value in the module parameter, + * take its value + */ + drv->trans->dbg.domains_bitmap &= 0xffff; + if (iwlwifi_mod_params.enable_ini != IWL_FW_INI_PRESET_DISABLE) { + if (iwlwifi_mod_params.enable_ini > ENABLE_INI) { + IWL_ERR(trans, + "invalid enable_ini module parameter value: max = %d, using 0 instead\n", + ENABLE_INI); + iwlwifi_mod_params.enable_ini = 0; + } + drv->trans->dbg.domains_bitmap = + BIT(IWL_FW_DBG_DOMAIN_POS + iwlwifi_mod_params.enable_ini); + } + } ret = iwl_request_firmware(drv, true); if (ret) { @@ -1843,8 +1859,6 @@ kfree(drv); } -#define ENABLE_INI (IWL_DBG_TLV_MAX_PRESET + 1) - /* shared module parameters */ struct iwl_mod_params iwlwifi_mod_params = { .fw_restart = true, @@ -1964,38 +1978,7 @@ MODULE_PARM_DESC(uapsd_disable, "disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3)"); -static int enable_ini_set(const char *arg, const struct kernel_param *kp) -{ - int ret = 0; - bool res; - __u32 new_enable_ini; - - /* in case the argument type is a number */ - ret = kstrtou32(arg, 0, &new_enable_ini); - if (!ret) { - if (new_enable_ini > ENABLE_INI) { - pr_err("enable_ini cannot be %d, in range 0-16\n", new_enable_ini); - return -EINVAL; - } - goto out; - } - - /* in case the argument type is boolean */ - ret = kstrtobool(arg, &res); - if (ret) - return ret; - new_enable_ini = (res ? ENABLE_INI : 0); - -out: - iwlwifi_mod_params.enable_ini = new_enable_ini; - return 0; -} - -static const struct kernel_param_ops enable_ini_ops = { - .set = enable_ini_set -}; - -module_param_cb(enable_ini, &enable_ini_ops, &iwlwifi_mod_params.enable_ini, 0644); +module_param_named(enable_ini, iwlwifi_mod_params.enable_ini, uint, 0444); MODULE_PARM_DESC(enable_ini, "0:disable, 1-15:FW_DBG_PRESET Values, 16:enabled without preset value defined," "Debug INI TLV FW debug infrastructure (default: 16)"); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/iwl-prph.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/iwl-prph.h @@ -348,8 +348,8 @@ #define RFIC_REG_RD 0xAD0470 #define WFPM_CTRL_REG 0xA03030 #define WFPM_OTP_CFG1_ADDR 0x00a03098 -#define WFPM_OTP_CFG1_IS_JACKET_BIT BIT(4) -#define WFPM_OTP_CFG1_IS_CDB_BIT BIT(5) +#define WFPM_OTP_CFG1_IS_JACKET_BIT BIT(5) +#define WFPM_OTP_CFG1_IS_CDB_BIT BIT(4) #define WFPM_OTP_BZ_BNJ_JACKET_BIT 5 #define WFPM_OTP_BZ_BNJ_CDB_BIT 4 #define WFPM_OTP_CFG1_IS_JACKET(_val) (((_val) & 0x00000020) >> WFPM_OTP_BZ_BNJ_JACKET_BIT) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/iwl-trans.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/iwl-trans.h @@ -56,6 +56,10 @@ * 6) Eventually, the free function will be called. */ +/* default preset 0 (start from bit 16)*/ +#define IWL_FW_DBG_DOMAIN_POS 16 +#define IWL_FW_DBG_DOMAIN BIT(IWL_FW_DBG_DOMAIN_POS) + #define IWL_TRANS_FW_DBG_DOMAIN(trans) IWL_FW_INI_DOMAIN_ALWAYS_ON #define FH_RSCSR_FRAME_SIZE_MSK 0x00003FFF /* bits 0-13 */ @@ -584,7 +588,7 @@ int (*tx)(struct iwl_trans *trans, struct sk_buff *skb, struct iwl_device_tx_cmd *dev_cmd, int queue); void (*reclaim)(struct iwl_trans *trans, int queue, int ssn, - struct sk_buff_head *skbs); + struct sk_buff_head *skbs, bool is_flush); void (*set_q_ptrs)(struct iwl_trans *trans, int queue, int ptr); @@ -1266,14 +1270,15 @@ } static inline void iwl_trans_reclaim(struct iwl_trans *trans, int queue, - int ssn, struct sk_buff_head *skbs) + int ssn, struct sk_buff_head *skbs, + bool is_flush) { if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) { IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); return; } - trans->ops->reclaim(trans, queue, ssn, skbs); + trans->ops->reclaim(trans, queue, ssn, skbs, is_flush); } static inline void iwl_trans_set_q_ptrs(struct iwl_trans *trans, int queue, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -2012,6 +2012,16 @@ if (IS_ERR(key_config)) return false; ieee80211_set_key_rx_seq(key_config, 0, &seq); + + if (key_config->keyidx == 4 || key_config->keyidx == 5) { + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); + int link_id = vif->active_links ? __ffs(vif->active_links) : 0; + struct iwl_mvm_vif_link_info *mvm_link = + mvmvif->link[link_id]; + + mvm_link->igtk = key_config; + } + return true; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* * Copyright (C) 2015-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation */ #include #include @@ -302,7 +302,12 @@ struct iwl_mvm_pasn_sta *sta) { list_del(&sta->list); - iwl_mvm_rm_sta_id(mvm, vif, sta->int_sta.sta_id); + + if (iwl_mvm_has_mld_api(mvm->fw)) + iwl_mvm_mld_rm_sta_id(mvm, sta->int_sta.sta_id); + else + iwl_mvm_rm_sta_id(mvm, vif, sta->int_sta.sta_id); + iwl_mvm_dealloc_int_sta(mvm, &sta->int_sta); kfree(sta); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/link.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/link.c @@ -53,7 +53,6 @@ unsigned int link_id = link_conf->link_id; struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id]; struct iwl_link_config_cmd cmd = {}; - struct iwl_mvm_phy_ctxt *phyctxt; if (WARN_ON_ONCE(!link_info)) return -EINVAL; @@ -61,7 +60,7 @@ if (link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) { link_info->fw_link_id = iwl_mvm_get_free_fw_link_id(mvm, mvmvif); - if (link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) + if (link_info->fw_link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf)) return -EINVAL; rcu_assign_pointer(mvm->link_id_to_link_conf[link_info->fw_link_id], @@ -77,12 +76,8 @@ cmd.link_id = cpu_to_le32(link_info->fw_link_id); cmd.mac_id = cpu_to_le32(mvmvif->id); cmd.spec_link_id = link_conf->link_id; - /* P2P-Device already has a valid PHY context during add */ - phyctxt = link_info->phy_ctxt; - if (phyctxt) - cmd.phy_id = cpu_to_le32(phyctxt->id); - else - cmd.phy_id = cpu_to_le32(FW_CTXT_INVALID); + WARN_ON_ONCE(link_info->phy_ctxt); + cmd.phy_id = cpu_to_le32(FW_CTXT_INVALID); memcpy(cmd.local_link_addr, link_conf->addr, ETH_ALEN); @@ -194,11 +189,14 @@ flags_mask |= LINK_FLG_MU_EDCA_CW; } - if (link_conf->eht_puncturing && !iwlwifi_mod_params.disable_11be) - cmd.puncture_mask = cpu_to_le16(link_conf->eht_puncturing); - else - /* This flag can be set only if the MAC has eht support */ - changes &= ~LINK_CONTEXT_MODIFY_EHT_PARAMS; + if (changes & LINK_CONTEXT_MODIFY_EHT_PARAMS) { + if (iwlwifi_mod_params.disable_11be || + !link_conf->eht_support) + changes &= ~LINK_CONTEXT_MODIFY_EHT_PARAMS; + else + cmd.puncture_mask = + cpu_to_le16(link_conf->eht_puncturing); + } cmd.bss_color = link_conf->he_bss_color.color; @@ -245,7 +243,7 @@ int ret; if (WARN_ON(!link_info || - link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID)) + link_info->fw_link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf))) return -EINVAL; RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id], only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -286,6 +286,10 @@ INIT_LIST_HEAD(&mvmvif->time_event_data.list); mvmvif->time_event_data.id = TE_MAX; + mvmvif->deflink.bcast_sta.sta_id = IWL_MVM_INVALID_STA; + mvmvif->deflink.mcast_sta.sta_id = IWL_MVM_INVALID_STA; + mvmvif->deflink.ap_sta_id = IWL_MVM_INVALID_STA; + /* No need to allocate data queues to P2P Device MAC and NAN.*/ if (vif->type == NL80211_IFTYPE_P2P_DEVICE) return 0; @@ -300,10 +304,6 @@ mvmvif->deflink.cab_queue = IWL_MVM_DQA_GCAST_QUEUE; } - mvmvif->deflink.bcast_sta.sta_id = IWL_MVM_INVALID_STA; - mvmvif->deflink.mcast_sta.sta_id = IWL_MVM_INVALID_STA; - mvmvif->deflink.ap_sta_id = IWL_MVM_INVALID_STA; - for (i = 0; i < NUM_IWL_MVM_SMPS_REQ; i++) mvmvif->deflink.smps_requests[i] = IEEE80211_SMPS_AUTOMATIC; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -1588,32 +1588,8 @@ IEEE80211_VIF_SUPPORTS_CQM_RSSI; } - /* - * P2P_DEVICE interface does not have a channel context assigned to it, - * so a dedicated PHY context is allocated to it and the corresponding - * MAC context is bound to it at this stage. - */ - if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { - - mvmvif->deflink.phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); - if (!mvmvif->deflink.phy_ctxt) { - ret = -ENOSPC; - goto out_free_bf; - } - - iwl_mvm_phy_ctxt_ref(mvm, mvmvif->deflink.phy_ctxt); - ret = iwl_mvm_binding_add_vif(mvm, vif); - if (ret) - goto out_unref_phy; - - ret = iwl_mvm_add_p2p_bcast_sta(mvm, vif); - if (ret) - goto out_unbind; - - /* Save a pointer to p2p device vif, so it can later be used to - * update the p2p device MAC when a GO is started/stopped */ + if (vif->type == NL80211_IFTYPE_P2P_DEVICE) mvm->p2p_device_vif = vif; - } iwl_mvm_tcm_add_vif(mvm, vif); INIT_DELAYED_WORK(&mvmvif->csa_work, @@ -1642,11 +1618,6 @@ goto out_unlock; - out_unbind: - iwl_mvm_binding_remove_vif(mvm, vif); - out_unref_phy: - iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); - out_free_bf: if (mvm->bf_allowed_vif == mvmvif) { mvm->bf_allowed_vif = NULL; vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER | @@ -1743,12 +1714,17 @@ if (iwl_mvm_mac_remove_interface_common(hw, vif)) goto out; + /* Before the interface removal, mac80211 would cancel the ROC, and the + * ROC worker would be scheduled if needed. The worker would be flushed + * in iwl_mvm_prepare_mac_removal() and thus at this point there is no + * binding etc. so nothing needs to be done here. + */ if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { + if (mvmvif->deflink.phy_ctxt) { + iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); + mvmvif->deflink.phy_ctxt = NULL; + } mvm->p2p_device_vif = NULL; - iwl_mvm_rm_p2p_bcast_sta(mvm, vif); - iwl_mvm_binding_remove_vif(mvm, vif); - iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); - mvmvif->deflink.phy_ctxt = NULL; } iwl_mvm_mac_ctxt_remove(mvm, vif); @@ -3790,6 +3766,12 @@ iwl_mvm_rs_rate_init_all_links(mvm, vif, sta); + /* MFP is set by default before the station is authorized. + * Clear it here in case it's not used. + */ + if (!sta->mfp) + return callbacks->update_sta(mvm, vif, sta); + return 0; } @@ -4530,30 +4512,20 @@ return ret; } -static int iwl_mvm_roc_switch_binding(struct iwl_mvm *mvm, - struct ieee80211_vif *vif, - struct iwl_mvm_phy_ctxt *new_phy_ctxt) +static int iwl_mvm_roc_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif) { - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); - int ret = 0; + int ret; lockdep_assert_held(&mvm->mutex); - /* Unbind the P2P_DEVICE from the current PHY context, - * and if the PHY context is not used remove it. - */ - ret = iwl_mvm_binding_remove_vif(mvm, vif); - if (WARN(ret, "Failed unbinding P2P_DEVICE\n")) + ret = iwl_mvm_binding_add_vif(mvm, vif); + if (WARN(ret, "Failed binding P2P_DEVICE\n")) return ret; - iwl_mvm_phy_ctxt_unref(mvm, mvmvif->deflink.phy_ctxt); - - /* Bind the P2P_DEVICE to the current PHY Context */ - mvmvif->deflink.phy_ctxt = new_phy_ctxt; - - ret = iwl_mvm_binding_add_vif(mvm, vif); - WARN(ret, "Failed binding P2P_DEVICE\n"); - return ret; + /* The station and queue allocation must be done only after the binding + * is done, as otherwise the FW might incorrectly configure its state. + */ + return iwl_mvm_add_p2p_bcast_sta(mvm, vif); } static int iwl_mvm_roc(struct ieee80211_hw *hw, @@ -4564,7 +4536,7 @@ { static const struct iwl_mvm_roc_ops ops = { .add_aux_sta_for_hs20 = iwl_mvm_add_aux_sta_for_hs20, - .switch_phy_ctxt = iwl_mvm_roc_switch_binding, + .link = iwl_mvm_roc_link, }; return iwl_mvm_roc_common(hw, vif, channel, duration, type, &ops); @@ -4580,7 +4552,6 @@ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct cfg80211_chan_def chandef; struct iwl_mvm_phy_ctxt *phy_ctxt; - bool band_change_removal; int ret, i; u32 lmac_id; @@ -4609,82 +4580,61 @@ /* handle below */ break; default: - IWL_ERR(mvm, "vif isn't P2P_DEVICE: %d\n", vif->type); + IWL_ERR(mvm, "ROC: Invalid vif type=%u\n", vif->type); ret = -EINVAL; goto out_unlock; } + /* Try using a PHY context that is already in use */ for (i = 0; i < NUM_PHY_CTX; i++) { phy_ctxt = &mvm->phy_ctxts[i]; - if (phy_ctxt->ref == 0 || mvmvif->deflink.phy_ctxt == phy_ctxt) + if (!phy_ctxt->ref || mvmvif->deflink.phy_ctxt == phy_ctxt) continue; - if (phy_ctxt->ref && channel == phy_ctxt->channel) { - ret = ops->switch_phy_ctxt(mvm, vif, phy_ctxt); - if (ret) - goto out_unlock; + if (channel == phy_ctxt->channel) { + if (mvmvif->deflink.phy_ctxt) + iwl_mvm_phy_ctxt_unref(mvm, + mvmvif->deflink.phy_ctxt); + mvmvif->deflink.phy_ctxt = phy_ctxt; iwl_mvm_phy_ctxt_ref(mvm, mvmvif->deflink.phy_ctxt); - goto schedule_time_event; + goto link_and_start_p2p_roc; } } - /* Need to update the PHY context only if the ROC channel changed */ - if (channel == mvmvif->deflink.phy_ctxt->channel) - goto schedule_time_event; - - cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT); - - /* - * Check if the remain-on-channel is on a different band and that - * requires context removal, see iwl_mvm_phy_ctxt_changed(). If - * so, we'll need to release and then re-configure here, since we - * must not remove a PHY context that's part of a binding. - */ - band_change_removal = - fw_has_capa(&mvm->fw->ucode_capa, - IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT) && - mvmvif->deflink.phy_ctxt->channel->band != chandef.chan->band; - - if (mvmvif->deflink.phy_ctxt->ref == 1 && !band_change_removal) { - /* - * Change the PHY context configuration as it is currently - * referenced only by the P2P Device MAC (and we can modify it) - */ - ret = iwl_mvm_phy_ctxt_changed(mvm, mvmvif->deflink.phy_ctxt, - &chandef, 1, 1); - if (ret) - goto out_unlock; + /* If the currently used PHY context is configured with a matching + * channel use it + */ + if (mvmvif->deflink.phy_ctxt) { + if (channel == mvmvif->deflink.phy_ctxt->channel) + goto link_and_start_p2p_roc; } else { - /* - * The PHY context is shared with other MACs (or we're trying to - * switch bands), so remove the P2P Device from the binding, - * allocate an new PHY context and create a new binding. - */ phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); if (!phy_ctxt) { ret = -ENOSPC; goto out_unlock; } - ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &chandef, - 1, 1); - if (ret) { - IWL_ERR(mvm, "Failed to change PHY context\n"); - goto out_unlock; - } + mvmvif->deflink.phy_ctxt = phy_ctxt; + iwl_mvm_phy_ctxt_ref(mvm, mvmvif->deflink.phy_ctxt); + } - ret = ops->switch_phy_ctxt(mvm, vif, phy_ctxt); - if (ret) - goto out_unlock; + /* Configure the PHY context */ + cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT); - iwl_mvm_phy_ctxt_ref(mvm, mvmvif->deflink.phy_ctxt); + ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &chandef, + 1, 1); + if (ret) { + IWL_ERR(mvm, "Failed to change PHY context\n"); + goto out_unlock; } -schedule_time_event: - /* Schedule the time events */ - ret = iwl_mvm_start_p2p_roc(mvm, vif, duration, type); +link_and_start_p2p_roc: + ret = ops->link(mvm, vif); + if (ret) + goto out_unlock; + ret = iwl_mvm_start_p2p_roc(mvm, vif, duration, type); out_unlock: mutex_unlock(&mvm->mutex); IWL_DEBUG_MAC80211(mvm, "leave\n"); @@ -5634,7 +5584,8 @@ WARN_ON_ONCE(sta != mvmvif->ap_sta && !sta->tdls); if (drop) { - if (iwl_mvm_flush_sta(mvm, mvmsta, false)) + if (iwl_mvm_flush_sta(mvm, mvmsta->deflink.sta_id, + mvmsta->tfd_queue_msk)) IWL_ERR(mvm, "flush request fail\n"); } else { if (iwl_mvm_has_new_tx_api(mvm)) @@ -5656,22 +5607,21 @@ void iwl_mvm_mac_flush_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta) { + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); - int i; + struct iwl_mvm_link_sta *mvm_link_sta; + struct ieee80211_link_sta *link_sta; + int link_id; mutex_lock(&mvm->mutex); - for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) { - struct iwl_mvm_sta *mvmsta; - struct ieee80211_sta *tmp; - - tmp = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], - lockdep_is_held(&mvm->mutex)); - if (tmp != sta) + for_each_sta_active_link(vif, sta, link_sta, link_id) { + mvm_link_sta = rcu_dereference_protected(mvmsta->link[link_id], + lockdep_is_held(&mvm->mutex)); + if (!mvm_link_sta) continue; - mvmsta = iwl_mvm_sta_from_mac80211(sta); - - if (iwl_mvm_flush_sta(mvm, mvmsta, false)) + if (iwl_mvm_flush_sta(mvm, mvm_link_sta->sta_id, + mvmsta->tfd_queue_msk)) IWL_ERR(mvm, "flush request fail\n"); } mutex_unlock(&mvm->mutex); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c @@ -24,10 +24,15 @@ return 0; } - /* AP group keys are per link and should be on the mcast STA */ + /* AP group keys are per link and should be on the mcast/bcast STA */ if (vif->type == NL80211_IFTYPE_AP && - !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE)) + !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE)) { + /* IGTK/BIGTK to bcast STA */ + if (keyconf->keyidx >= 4) + return BIT(link_info->bcast_sta.sta_id); + /* GTK for data to mcast STA */ return BIT(link_info->mcast_sta.sta_id); + } /* for client mode use the AP STA also for group keys */ if (!sta && vif->type == NL80211_IFTYPE_STATION) @@ -91,7 +96,12 @@ if (!sta && vif->type == NL80211_IFTYPE_STATION) sta = mvmvif->ap_sta; - if (!IS_ERR_OR_NULL(sta) && sta->mfp) + /* Set the MFP flag also for an AP interface where the key is an IGTK + * key as in such a case the station would always be NULL + */ + if ((!IS_ERR_OR_NULL(sta) && sta->mfp) || + (vif->type == NL80211_IFTYPE_AP && + (keyconf->keyidx == 4 || keyconf->keyidx == 5))) flags |= IWL_SEC_KEY_FLAG_MFP; return flags; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -347,7 +347,7 @@ return -EINVAL; if (flush) - iwl_mvm_flush_sta(mvm, int_sta, true); + iwl_mvm_flush_sta(mvm, int_sta->sta_id, int_sta->tfd_queue_msk); iwl_mvm_mld_disable_txq(mvm, BIT(int_sta->sta_id), queuptr, tid); @@ -705,8 +705,10 @@ rcu_dereference_protected(mvm_sta->link[link_id], lockdep_is_held(&mvm->mutex)); - if (WARN_ON(!link_conf || !mvm_link_sta)) + if (WARN_ON(!link_conf || !mvm_link_sta)) { + ret = -EINVAL; goto err; + } ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, link_conf, mvm_link_sta); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -1658,7 +1658,7 @@ static inline const char *iwl_mvm_get_tx_fail_reason(u32 status) { return ""; } #endif int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk); -int iwl_mvm_flush_sta(struct iwl_mvm *mvm, void *sta, bool internal); +int iwl_mvm_flush_sta(struct iwl_mvm *mvm, u32 sta_id, u32 tfd_queue_mask); int iwl_mvm_flush_sta_tids(struct iwl_mvm *mvm, u32 sta_id, u16 tids); /* Utils to extract sta related data */ @@ -1942,13 +1942,12 @@ * * @add_aux_sta_for_hs20: pointer to the function that adds an aux sta * for Hot Spot 2.0 - * @switch_phy_ctxt: pointer to the function that switches a vif from one - * phy_ctx to another + * @link: For a P2P Device interface, pointer to a function that links the + * MAC/Link to the PHY context */ struct iwl_mvm_roc_ops { int (*add_aux_sta_for_hs20)(struct iwl_mvm *mvm, u32 lmac_id); - int (*switch_phy_ctxt)(struct iwl_mvm *mvm, struct ieee80211_vif *vif, - struct iwl_mvm_phy_ctxt *new_phy_ctxt); + int (*link)(struct iwl_mvm *mvm, struct ieee80211_vif *vif); }; int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -2059,7 +2059,8 @@ *status = IWL_MVM_QUEUE_FREE; } - if (vif->type == NL80211_IFTYPE_STATION) { + if (vif->type == NL80211_IFTYPE_STATION && + mvm_link->ap_sta_id == sta_id) { /* if associated - we can't remove the AP STA now */ if (vif->cfg.assoc) return true; @@ -2097,7 +2098,8 @@ return ret; /* flush its queues here since we are freeing mvm_sta */ - ret = iwl_mvm_flush_sta(mvm, mvm_sta, false); + ret = iwl_mvm_flush_sta(mvm, mvm_sta->deflink.sta_id, + mvm_sta->tfd_queue_msk); if (ret) return ret; if (iwl_mvm_has_new_tx_api(mvm)) { @@ -2408,7 +2410,8 @@ lockdep_assert_held(&mvm->mutex); - iwl_mvm_flush_sta(mvm, &mvmvif->deflink.bcast_sta, true); + iwl_mvm_flush_sta(mvm, mvmvif->deflink.bcast_sta.sta_id, + mvmvif->deflink.bcast_sta.tfd_queue_msk); switch (vif->type) { case NL80211_IFTYPE_AP: @@ -2664,7 +2667,8 @@ lockdep_assert_held(&mvm->mutex); - iwl_mvm_flush_sta(mvm, &mvmvif->deflink.mcast_sta, true); + iwl_mvm_flush_sta(mvm, mvmvif->deflink.mcast_sta.sta_id, + mvmvif->deflink.mcast_sta.tfd_queue_msk); iwl_mvm_disable_txq(mvm, NULL, mvmvif->deflink.mcast_sta.sta_id, &mvmvif->deflink.cab_queue, 0); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c @@ -78,9 +78,29 @@ */ if (!WARN_ON(!mvm->p2p_device_vif)) { - mvmvif = iwl_mvm_vif_from_mac80211(mvm->p2p_device_vif); - iwl_mvm_flush_sta(mvm, &mvmvif->deflink.bcast_sta, - true); + struct ieee80211_vif *vif = mvm->p2p_device_vif; + + mvmvif = iwl_mvm_vif_from_mac80211(vif); + iwl_mvm_flush_sta(mvm, mvmvif->deflink.bcast_sta.sta_id, + mvmvif->deflink.bcast_sta.tfd_queue_msk); + + if (mvm->mld_api_is_used) { + iwl_mvm_mld_rm_bcast_sta(mvm, vif, + &vif->bss_conf); + + iwl_mvm_link_changed(mvm, vif, &vif->bss_conf, + LINK_CONTEXT_MODIFY_ACTIVE, + false); + } else { + iwl_mvm_rm_p2p_bcast_sta(mvm, vif); + iwl_mvm_binding_remove_vif(mvm, vif); + } + + /* Do not remove the PHY context as removing and adding + * a PHY context has timing overheads. Leaving it + * configured in FW would be useful in case the next ROC + * is with the same channel. + */ } } @@ -93,7 +113,8 @@ */ if (test_and_clear_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) { /* do the same in case of hot spot 2.0 */ - iwl_mvm_flush_sta(mvm, &mvm->aux_sta, true); + iwl_mvm_flush_sta(mvm, mvm->aux_sta.sta_id, + mvm->aux_sta.tfd_queue_msk); if (mvm->mld_api_is_used) { iwl_mvm_mld_rm_aux_sta(mvm); @@ -880,8 +901,8 @@ if (!le32_to_cpu(notif->status) || !le32_to_cpu(notif->start)) { /* End TE, notify mac80211 */ mvmvif->time_event_data.id = SESSION_PROTECT_CONF_MAX_ID; - ieee80211_remain_on_channel_expired(mvm->hw); iwl_mvm_p2p_roc_finished(mvm); + ieee80211_remain_on_channel_expired(mvm->hw); } else if (le32_to_cpu(notif->start)) { if (WARN_ON(mvmvif->time_event_data.id != le32_to_cpu(notif->conf_id))) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -536,16 +536,20 @@ flags |= IWL_TX_FLAGS_ENCRYPT_DIS; /* - * For data packets rate info comes from the fw. Only - * set rate/antenna during connection establishment or in case - * no station is given. + * For data and mgmt packets rate info comes from the fw. Only + * set rate/antenna for injected frames with fixed rate, or + * when no sta is given. */ - if (!sta || !ieee80211_is_data(hdr->frame_control) || - mvmsta->sta_state < IEEE80211_STA_AUTHORIZED) { + if (unlikely(!sta || + info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT)) { flags |= IWL_TX_FLAGS_CMD_RATE; rate_n_flags = iwl_mvm_get_tx_rate_n_flags(mvm, info, sta, hdr->frame_control); + } else if (!ieee80211_is_data(hdr->frame_control) || + mvmsta->sta_state < IEEE80211_STA_AUTHORIZED) { + /* These are important frames */ + flags |= IWL_TX_FLAGS_HIGH_PRI; } if (mvm->trans->trans_cfg->device_family >= @@ -1599,7 +1603,7 @@ seq_ctl = le16_to_cpu(tx_resp->seq_ctl); /* we can free until ssn % q.n_bd not inclusive */ - iwl_trans_reclaim(mvm->trans, txq_id, ssn, &skbs); + iwl_trans_reclaim(mvm->trans, txq_id, ssn, &skbs, false); while (!skb_queue_empty(&skbs)) { struct sk_buff *skb = __skb_dequeue(&skbs); @@ -1612,6 +1616,7 @@ iwl_trans_free_tx_cmd(mvm->trans, info->driver_data[1]); memset(&info->status, 0, sizeof(info->status)); + info->flags &= ~(IEEE80211_TX_STAT_ACK | IEEE80211_TX_STAT_TX_FILTERED); /* inform mac80211 about what happened with the frame */ switch (status & TX_STATUS_MSK) { @@ -1950,7 +1955,7 @@ * block-ack window (we assume that they've been successfully * transmitted ... if not, it's too late anyway). */ - iwl_trans_reclaim(mvm->trans, txq, index, &reclaimed_skbs); + iwl_trans_reclaim(mvm->trans, txq, index, &reclaimed_skbs, is_flush); skb_queue_walk(&reclaimed_skbs, skb) { struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); @@ -1964,6 +1969,8 @@ */ if (!is_flush) info->flags |= IEEE80211_TX_STAT_ACK; + else + info->flags &= ~IEEE80211_TX_STAT_ACK; } /* @@ -2290,24 +2297,10 @@ return ret; } -int iwl_mvm_flush_sta(struct iwl_mvm *mvm, void *sta, bool internal) +int iwl_mvm_flush_sta(struct iwl_mvm *mvm, u32 sta_id, u32 tfd_queue_mask) { - u32 sta_id, tfd_queue_msk; - - if (internal) { - struct iwl_mvm_int_sta *int_sta = sta; - - sta_id = int_sta->sta_id; - tfd_queue_msk = int_sta->tfd_queue_msk; - } else { - struct iwl_mvm_sta *mvm_sta = sta; - - sta_id = mvm_sta->deflink.sta_id; - tfd_queue_msk = mvm_sta->tfd_queue_msk; - } - if (iwl_mvm_has_new_tx_api(mvm)) return iwl_mvm_flush_sta_tids(mvm, sta_id, 0xffff); - return iwl_mvm_flush_tx_path(mvm, tfd_queue_msk); + return iwl_mvm_flush_tx_path(mvm, tfd_queue_mask); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c @@ -161,6 +161,7 @@ if (test_and_clear_bit(STATUS_DEVICE_ENABLED, &trans->status)) { IWL_DEBUG_INFO(trans, "DEVICE_ENABLED bit was set and is now cleared\n"); + iwl_pcie_synchronize_irqs(trans); iwl_pcie_rx_napi_sync(trans); iwl_txq_gen2_tx_free(trans); iwl_pcie_rx_stop(trans); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/queue/tx.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/queue/tx.c @@ -1561,7 +1561,7 @@ /* Frees buffers until index _not_ inclusive */ void iwl_txq_reclaim(struct iwl_trans *trans, int txq_id, int ssn, - struct sk_buff_head *skbs) + struct sk_buff_head *skbs, bool is_flush) { struct iwl_txq *txq = trans->txqs.txq[txq_id]; int tfd_num, read_ptr, last_to_free; @@ -1636,9 +1636,11 @@ if (iwl_txq_space(trans, txq) > txq->low_mark && test_bit(txq_id, trans->txqs.queue_stopped)) { struct sk_buff_head overflow_skbs; + struct sk_buff *skb; __skb_queue_head_init(&overflow_skbs); - skb_queue_splice_init(&txq->overflow_q, &overflow_skbs); + skb_queue_splice_init(&txq->overflow_q, + is_flush ? skbs : &overflow_skbs); /* * We are going to transmit from the overflow queue. @@ -1658,8 +1660,7 @@ */ spin_unlock_bh(&txq->lock); - while (!skb_queue_empty(&overflow_skbs)) { - struct sk_buff *skb = __skb_dequeue(&overflow_skbs); + while ((skb = __skb_dequeue(&overflow_skbs))) { struct iwl_device_tx_cmd *dev_cmd_ptr; dev_cmd_ptr = *(void **)((u8 *)skb->cb + only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/queue/tx.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/intel/iwlwifi/queue/tx.h @@ -173,7 +173,7 @@ struct iwl_txq *txq, u16 byte_cnt, int num_tbs); void iwl_txq_reclaim(struct iwl_trans *trans, int txq_id, int ssn, - struct sk_buff_head *skbs); + struct sk_buff_head *skbs, bool is_flush); void iwl_txq_set_q_ptrs(struct iwl_trans *trans, int txq_id, int ptr); void iwl_trans_txq_freeze_timer(struct iwl_trans *trans, unsigned long txqs, bool freeze); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c @@ -10,12 +10,31 @@ }; static void +mt7603_mac_stuck_beacon_recovery(struct mt7603_dev *dev) +{ + if (dev->beacon_check % 5 != 4) + return; + + mt76_clear(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_TX_DMA_EN); + mt76_set(dev, MT_SCH_4, MT_SCH_4_RESET); + mt76_clear(dev, MT_SCH_4, MT_SCH_4_RESET); + mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_TX_DMA_EN); + + mt76_set(dev, MT_WF_CFG_OFF_WOCCR, MT_WF_CFG_OFF_WOCCR_TMAC_GC_DIS); + mt76_set(dev, MT_ARB_SCR, MT_ARB_SCR_TX_DISABLE); + mt76_clear(dev, MT_ARB_SCR, MT_ARB_SCR_TX_DISABLE); + mt76_clear(dev, MT_WF_CFG_OFF_WOCCR, MT_WF_CFG_OFF_WOCCR_TMAC_GC_DIS); +} + +static void mt7603_update_beacon_iter(void *priv, u8 *mac, struct ieee80211_vif *vif) { struct mt7603_dev *dev = (struct mt7603_dev *)priv; struct mt76_dev *mdev = &dev->mt76; struct mt7603_vif *mvif = (struct mt7603_vif *)vif->drv_priv; struct sk_buff *skb = NULL; + u32 om_idx = mvif->idx; + u32 val; if (!(mdev->beacon_mask & BIT(mvif->idx))) return; @@ -24,20 +43,33 @@ if (!skb) return; - mt76_tx_queue_skb(dev, dev->mphy.q_tx[MT_TXQ_BEACON], - MT_TXQ_BEACON, skb, &mvif->sta.wcid, NULL); + if (om_idx) + om_idx |= 0x10; + val = MT_DMA_FQCR0_BUSY | MT_DMA_FQCR0_MODE | + FIELD_PREP(MT_DMA_FQCR0_TARGET_BSS, om_idx) | + FIELD_PREP(MT_DMA_FQCR0_DEST_PORT_ID, 3) | + FIELD_PREP(MT_DMA_FQCR0_DEST_QUEUE_ID, 8); spin_lock_bh(&dev->ps_lock); - mt76_wr(dev, MT_DMA_FQCR0, MT_DMA_FQCR0_BUSY | - FIELD_PREP(MT_DMA_FQCR0_TARGET_WCID, mvif->sta.wcid.idx) | - FIELD_PREP(MT_DMA_FQCR0_TARGET_QID, - dev->mphy.q_tx[MT_TXQ_CAB]->hw_idx) | - FIELD_PREP(MT_DMA_FQCR0_DEST_PORT_ID, 3) | - FIELD_PREP(MT_DMA_FQCR0_DEST_QUEUE_ID, 8)); - if (!mt76_poll(dev, MT_DMA_FQCR0, MT_DMA_FQCR0_BUSY, 0, 5000)) + mt76_wr(dev, MT_DMA_FQCR0, val | + FIELD_PREP(MT_DMA_FQCR0_TARGET_QID, MT_TX_HW_QUEUE_BCN)); + if (!mt76_poll(dev, MT_DMA_FQCR0, MT_DMA_FQCR0_BUSY, 0, 5000)) { dev->beacon_check = MT7603_WATCHDOG_TIMEOUT; + goto out; + } + + mt76_wr(dev, MT_DMA_FQCR0, val | + FIELD_PREP(MT_DMA_FQCR0_TARGET_QID, MT_TX_HW_QUEUE_BMC)); + if (!mt76_poll(dev, MT_DMA_FQCR0, MT_DMA_FQCR0_BUSY, 0, 5000)) { + dev->beacon_check = MT7603_WATCHDOG_TIMEOUT; + goto out; + } + mt76_tx_queue_skb(dev, dev->mphy.q_tx[MT_TXQ_BEACON], + MT_TXQ_BEACON, skb, &mvif->sta.wcid, NULL); + +out: spin_unlock_bh(&dev->ps_lock); } @@ -81,6 +113,18 @@ data.dev = dev; __skb_queue_head_init(&data.q); + /* Flush all previous CAB queue packets and beacons */ + mt76_wr(dev, MT_WF_ARB_CAB_FLUSH, GENMASK(30, 16) | BIT(0)); + + mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[MT_TXQ_CAB], false); + mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[MT_TXQ_BEACON], false); + + if (dev->mphy.q_tx[MT_TXQ_BEACON]->queued > 0) + dev->beacon_check++; + else + dev->beacon_check = 0; + mt7603_mac_stuck_beacon_recovery(dev); + q = dev->mphy.q_tx[MT_TXQ_BEACON]; spin_lock(&q->lock); ieee80211_iterate_active_interfaces_atomic(mt76_hw(dev), @@ -89,14 +133,9 @@ mt76_queue_kick(dev, q); spin_unlock(&q->lock); - /* Flush all previous CAB queue packets */ - mt76_wr(dev, MT_WF_ARB_CAB_FLUSH, GENMASK(30, 16) | BIT(0)); - - mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[MT_TXQ_CAB], false); - mt76_csa_check(mdev); if (mdev->csa_complete) - goto out; + return; q = dev->mphy.q_tx[MT_TXQ_CAB]; do { @@ -108,7 +147,7 @@ skb_queue_len(&data.q) < 8); if (skb_queue_empty(&data.q)) - goto out; + return; for (i = 0; i < ARRAY_SIZE(data.tail); i++) { if (!data.tail[i]) @@ -136,11 +175,6 @@ MT_WF_ARB_CAB_START_BSSn(0) | (MT_WF_ARB_CAB_START_BSS0n(1) * ((1 << (MT7603_MAX_INTERFACES - 1)) - 1))); - -out: - mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[MT_TXQ_BEACON], false); - if (dev->mphy.q_tx[MT_TXQ_BEACON]->queued > hweight8(mdev->beacon_mask)) - dev->beacon_check++; } void mt7603_beacon_set_timer(struct mt7603_dev *dev, int idx, int intval) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7603/core.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7603/core.c @@ -42,11 +42,13 @@ } if (intr & MT_INT_RX_DONE(0)) { + dev->rx_pse_check = 0; mt7603_irq_disable(dev, MT_INT_RX_DONE(0)); napi_schedule(&dev->mt76.napi[0]); } if (intr & MT_INT_RX_DONE(1)) { + dev->rx_pse_check = 0; mt7603_irq_disable(dev, MT_INT_RX_DONE(1)); napi_schedule(&dev->mt76.napi[1]); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -1430,15 +1430,6 @@ mt7603_beacon_set_timer(dev, -1, 0); - if (dev->reset_cause[RESET_CAUSE_RESET_FAILED] || - dev->cur_reset_cause == RESET_CAUSE_RX_PSE_BUSY || - dev->cur_reset_cause == RESET_CAUSE_BEACON_STUCK || - dev->cur_reset_cause == RESET_CAUSE_TX_HANG) - mt7603_pse_reset(dev); - - if (dev->reset_cause[RESET_CAUSE_RESET_FAILED]) - goto skip_dma_reset; - mt7603_mac_stop(dev); mt76_clear(dev, MT_WPDMA_GLO_CFG, @@ -1448,28 +1439,32 @@ mt7603_irq_disable(dev, mask); - mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_FORCE_TX_EOF); - mt7603_pse_client_reset(dev); mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WM], true); for (i = 0; i < __MT_TXQ_MAX; i++) mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[i], true); + mt7603_dma_sched_reset(dev); + + mt76_tx_status_check(&dev->mt76, true); + mt76_for_each_q_rx(&dev->mt76, i) { mt76_queue_rx_reset(dev, i); } - mt76_tx_status_check(&dev->mt76, true); + if (dev->reset_cause[RESET_CAUSE_RESET_FAILED] || + dev->cur_reset_cause == RESET_CAUSE_RX_PSE_BUSY) + mt7603_pse_reset(dev); - mt7603_dma_sched_reset(dev); + if (!dev->reset_cause[RESET_CAUSE_RESET_FAILED]) { + mt7603_mac_dma_start(dev); - mt7603_mac_dma_start(dev); + mt7603_irq_enable(dev, mask); - mt7603_irq_enable(dev, mask); + clear_bit(MT76_RESET, &dev->mphy.state); + } -skip_dma_reset: - clear_bit(MT76_RESET, &dev->mphy.state); mutex_unlock(&dev->mt76.mutex); mt76_worker_enable(&dev->mt76.tx_worker); @@ -1559,20 +1554,29 @@ { u32 addr, val; - if (mt76_rr(dev, MT_MCU_DEBUG_RESET) & MT_MCU_DEBUG_RESET_QUEUES) - return true; - if (mt7603_rx_fifo_busy(dev)) - return false; + goto out; addr = mt7603_reg_map(dev, MT_CLIENT_BASE_PHYS_ADDR + MT_CLIENT_STATUS); mt76_wr(dev, addr, 3); val = mt76_rr(dev, addr) >> 16; - if (is_mt7628(dev) && (val & 0x4001) == 0x4001) - return true; + if (!(val & BIT(0))) + return false; + + if (is_mt7628(dev)) + val &= 0xa000; + else + val &= 0x8000; + if (!val) + return false; + +out: + if (mt76_rr(dev, MT_INT_SOURCE_CSR) & + (MT_INT_RX_DONE(0) | MT_INT_RX_DONE(1))) + return false; - return (val & 0x8001) == 0x8001 || (val & 0xe001) == 0xe001; + return true; } static bool only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7603/regs.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7603/regs.h @@ -462,6 +462,11 @@ #define MT_WF_SEC_BASE 0x21a00 #define MT_WF_SEC(ofs) (MT_WF_SEC_BASE + (ofs)) +#define MT_WF_CFG_OFF_BASE 0x21e00 +#define MT_WF_CFG_OFF(ofs) (MT_WF_CFG_OFF_BASE + (ofs)) +#define MT_WF_CFG_OFF_WOCCR MT_WF_CFG_OFF(0x004) +#define MT_WF_CFG_OFF_WOCCR_TMAC_GC_DIS BIT(4) + #define MT_SEC_SCR MT_WF_SEC(0x004) #define MT_SEC_SCR_MASK_ORDER GENMASK(1, 0) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -2147,7 +2147,7 @@ }; if (cmd == MCU_EXT_CMD(SET_RX_PATH) || - dev->mt76.hw->conf.flags & IEEE80211_CONF_MONITOR) + phy->mt76->hw->conf.flags & IEEE80211_CONF_MONITOR) req.switch_reason = CH_SWITCH_NORMAL; else if (phy->mt76->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c @@ -106,7 +106,7 @@ else mt76_connac_write_hw_txp(mdev, tx_info, txp, id); - tx_info->skb = DMA_DUMMY_DATA; + tx_info->skb = NULL; return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt76_connac3_mac.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt76_connac3_mac.h @@ -0,0 +1,327 @@ +/* SPDX-License-Identifier: ISC */ +/* Copyright (C) 2023 MediaTek Inc. */ + +#ifndef __MT76_CONNAC3_MAC_H +#define __MT76_CONNAC3_MAC_H + +#define MT_CT_PARSE_LEN 72 +#define MT_CT_DMA_BUF_NUM 2 + +#define MT_RXD0_LENGTH GENMASK(15, 0) +#define MT_RXD0_PKT_FLAG GENMASK(19, 16) +#define MT_RXD0_PKT_TYPE GENMASK(31, 27) + +#define MT_RXD0_MESH BIT(18) +#define MT_RXD0_MHCP BIT(19) +#define MT_RXD0_NORMAL_ETH_TYPE_OFS GENMASK(22, 16) +#define MT_RXD0_NORMAL_IP_SUM BIT(23) +#define MT_RXD0_NORMAL_UDP_TCP_SUM BIT(24) + +#define MT_RXD0_SW_PKT_TYPE_MASK GENMASK(31, 16) +#define MT_RXD0_SW_PKT_TYPE_MAP 0x380F +#define MT_RXD0_SW_PKT_TYPE_FRAME 0x3801 + +/* RXD DW1 */ +#define MT_RXD1_NORMAL_WLAN_IDX GENMASK(11, 0) +#define MT_RXD1_NORMAL_GROUP_1 BIT(16) +#define MT_RXD1_NORMAL_GROUP_2 BIT(17) +#define MT_RXD1_NORMAL_GROUP_3 BIT(18) +#define MT_RXD1_NORMAL_GROUP_4 BIT(19) +#define MT_RXD1_NORMAL_GROUP_5 BIT(20) +#define MT_RXD1_NORMAL_KEY_ID GENMASK(22, 21) +#define MT_RXD1_NORMAL_CM BIT(23) +#define MT_RXD1_NORMAL_CLM BIT(24) +#define MT_RXD1_NORMAL_ICV_ERR BIT(25) +#define MT_RXD1_NORMAL_TKIP_MIC_ERR BIT(26) +#define MT_RXD1_NORMAL_BAND_IDX GENMASK(28, 27) +#define MT_RXD1_NORMAL_SPP_EN BIT(29) +#define MT_RXD1_NORMAL_ADD_OM BIT(30) +#define MT_RXD1_NORMAL_SEC_DONE BIT(31) + +/* RXD DW2 */ +#define MT_RXD2_NORMAL_BSSID GENMASK(5, 0) +#define MT_RXD2_NORMAL_MAC_HDR_LEN GENMASK(12, 8) +#define MT_RXD2_NORMAL_HDR_TRANS BIT(7) +#define MT_RXD2_NORMAL_HDR_OFFSET GENMASK(15, 13) +#define MT_RXD2_NORMAL_SEC_MODE GENMASK(20, 16) +#define MT_RXD2_NORMAL_MU_BAR BIT(21) +#define MT_RXD2_NORMAL_SW_BIT BIT(22) +#define MT_RXD2_NORMAL_AMSDU_ERR BIT(23) +#define MT_RXD2_NORMAL_MAX_LEN_ERROR BIT(24) +#define MT_RXD2_NORMAL_HDR_TRANS_ERROR BIT(25) +#define MT_RXD2_NORMAL_INT_FRAME BIT(26) +#define MT_RXD2_NORMAL_FRAG BIT(27) +#define MT_RXD2_NORMAL_NULL_FRAME BIT(28) +#define MT_RXD2_NORMAL_NDATA BIT(29) +#define MT_RXD2_NORMAL_NON_AMPDU BIT(30) +#define MT_RXD2_NORMAL_BF_REPORT BIT(31) + +/* RXD DW3 */ +#define MT_RXD3_NORMAL_RXV_SEQ GENMASK(7, 0) +#define MT_RXD3_NORMAL_CH_FREQ GENMASK(15, 8) +#define MT_RXD3_NORMAL_ADDR_TYPE GENMASK(17, 16) +#define MT_RXD3_NORMAL_U2M BIT(0) +#define MT_RXD3_NORMAL_HTC_VLD BIT(18) +#define MT_RXD3_NORMAL_BEACON_MC BIT(20) +#define MT_RXD3_NORMAL_BEACON_UC BIT(21) +#define MT_RXD3_NORMAL_CO_ANT BIT(22) +#define MT_RXD3_NORMAL_FCS_ERR BIT(24) +#define MT_RXD3_NORMAL_VLAN2ETH BIT(31) + +/* RXD DW4 */ +#define MT_RXD4_NORMAL_PAYLOAD_FORMAT GENMASK(1, 0) +#define MT_RXD4_FIRST_AMSDU_FRAME GENMASK(1, 0) +#define MT_RXD4_MID_AMSDU_FRAME BIT(1) +#define MT_RXD4_LAST_AMSDU_FRAME BIT(0) + +#define MT_RXV_HDR_BAND_IDX BIT(24) + +/* RXD GROUP4 */ +#define MT_RXD8_FRAME_CONTROL GENMASK(15, 0) + +#define MT_RXD10_SEQ_CTRL GENMASK(15, 0) +#define MT_RXD10_QOS_CTL GENMASK(31, 16) + +#define MT_RXD11_HT_CONTROL GENMASK(31, 0) + +/* P-RXV */ +#define MT_PRXV_TX_RATE GENMASK(6, 0) +#define MT_PRXV_TX_DCM BIT(4) +#define MT_PRXV_TX_ER_SU_106T BIT(5) +#define MT_PRXV_NSTS GENMASK(10, 7) +#define MT_PRXV_TXBF BIT(11) +#define MT_PRXV_HT_AD_CODE BIT(12) +#define MT_PRXV_HE_RU_ALLOC GENMASK(30, 22) +#define MT_PRXV_RCPI3 GENMASK(31, 24) +#define MT_PRXV_RCPI2 GENMASK(23, 16) +#define MT_PRXV_RCPI1 GENMASK(15, 8) +#define MT_PRXV_RCPI0 GENMASK(7, 0) +#define MT_PRXV_HT_SHORT_GI GENMASK(4, 3) +#define MT_PRXV_HT_STBC GENMASK(10, 9) +#define MT_PRXV_TX_MODE GENMASK(14, 11) +#define MT_PRXV_FRAME_MODE GENMASK(2, 0) +#define MT_PRXV_DCM BIT(5) + +/* C-RXV */ +#define MT_CRXV_HE_NUM_USER GENMASK(26, 20) +#define MT_CRXV_HE_LTF_SIZE GENMASK(28, 27) +#define MT_CRXV_HE_LDPC_EXT_SYM BIT(30) + +#define MT_CRXV_HE_PE_DISAMBIG BIT(1) +#define MT_CRXV_HE_UPLINK BIT(2) + +#define MT_CRXV_HE_MU_AID GENMASK(27, 17) +#define MT_CRXV_HE_BEAM_CHNG BIT(29) + +#define MT_CRXV_HE_DOPPLER BIT(0) +#define MT_CRXV_HE_BSS_COLOR GENMASK(15, 10) +#define MT_CRXV_HE_TXOP_DUR GENMASK(19, 17) + +#define MT_CRXV_HE_SR_MASK GENMASK(11, 8) +#define MT_CRXV_HE_SR1_MASK GENMASK(16, 12) +#define MT_CRXV_HE_SR2_MASK GENMASK(20, 17) +#define MT_CRXV_HE_SR3_MASK GENMASK(24, 21) + +#define MT_CRXV_HE_RU0 GENMASK(8, 0) +#define MT_CRXV_HE_RU1 GENMASK(17, 9) +#define MT_CRXV_HE_RU2 GENMASK(26, 18) +#define MT_CRXV_HE_RU3_L GENMASK(31, 27) +#define MT_CRXV_HE_RU3_H GENMASK(3, 0) + +enum tx_header_format { + MT_HDR_FORMAT_802_3, + MT_HDR_FORMAT_CMD, + MT_HDR_FORMAT_802_11, + MT_HDR_FORMAT_802_11_EXT, +}; + +enum tx_pkt_type { + MT_TX_TYPE_CT, + MT_TX_TYPE_SF, + MT_TX_TYPE_CMD, + MT_TX_TYPE_FW, +}; + +enum tx_port_idx { + MT_TX_PORT_IDX_LMAC, + MT_TX_PORT_IDX_MCU +}; + +enum tx_mcu_port_q_idx { + MT_TX_MCU_PORT_RX_Q0 = 0x20, + MT_TX_MCU_PORT_RX_Q1, + MT_TX_MCU_PORT_RX_Q2, + MT_TX_MCU_PORT_RX_Q3, + MT_TX_MCU_PORT_RX_FWDL = 0x3e +}; + +enum tx_mgnt_type { + MT_TX_NORMAL, + MT_TX_TIMING, + MT_TX_ADDBA, +}; + +#define MT_CT_INFO_APPLY_TXD BIT(0) +#define MT_CT_INFO_COPY_HOST_TXD_ALL BIT(1) +#define MT_CT_INFO_MGMT_FRAME BIT(2) +#define MT_CT_INFO_NONE_CIPHER_FRAME BIT(3) +#define MT_CT_INFO_HSR2_TX BIT(4) +#define MT_CT_INFO_FROM_HOST BIT(7) + +#define MT_TXD_SIZE (8 * 4) + +#define MT_TXD0_Q_IDX GENMASK(31, 25) +#define MT_TXD0_PKT_FMT GENMASK(24, 23) +#define MT_TXD0_ETH_TYPE_OFFSET GENMASK(22, 16) +#define MT_TXD0_TX_BYTES GENMASK(15, 0) + +#define MT_TXD1_FIXED_RATE BIT(31) +#define MT_TXD1_OWN_MAC GENMASK(30, 25) +#define MT_TXD1_TID GENMASK(24, 21) +#define MT_TXD1_BIP BIT(24) +#define MT_TXD1_ETH_802_3 BIT(20) +#define MT_TXD1_HDR_INFO GENMASK(20, 16) +#define MT_TXD1_HDR_FORMAT GENMASK(15, 14) +#define MT_TXD1_TGID GENMASK(13, 12) +#define MT_TXD1_WLAN_IDX GENMASK(11, 0) + +#define MT_TXD2_POWER_OFFSET GENMASK(31, 26) +#define MT_TXD2_MAX_TX_TIME GENMASK(25, 16) +#define MT_TXD2_FRAG GENMASK(15, 14) +#define MT_TXD2_HTC_VLD BIT(13) +#define MT_TXD2_DURATION BIT(12) +#define MT_TXD2_HDR_PAD GENMASK(11, 10) +#define MT_TXD2_RTS BIT(9) +#define MT_TXD2_OWN_MAC_MAP BIT(8) +#define MT_TXD2_BF_TYPE GENMASK(6, 7) +#define MT_TXD2_FRAME_TYPE GENMASK(5, 4) +#define MT_TXD2_SUB_TYPE GENMASK(3, 0) + +#define MT_TXD3_SN_VALID BIT(31) +#define MT_TXD3_PN_VALID BIT(30) +#define MT_TXD3_SW_POWER_MGMT BIT(29) +#define MT_TXD3_BA_DISABLE BIT(28) +#define MT_TXD3_SEQ GENMASK(27, 16) +#define MT_TXD3_REM_TX_COUNT GENMASK(15, 11) +#define MT_TXD3_TX_COUNT GENMASK(10, 6) +#define MT_TXD3_HW_AMSDU BIT(5) +#define MT_TXD3_BCM BIT(4) +#define MT_TXD3_EEOSP BIT(3) +#define MT_TXD3_EMRD BIT(2) +#define MT_TXD3_PROTECT_FRAME BIT(1) +#define MT_TXD3_NO_ACK BIT(0) + +#define MT_TXD4_PN_LOW GENMASK(31, 0) + +#define MT_TXD5_PN_HIGH GENMASK(31, 16) +#define MT_TXD5_FL BIT(15) +#define MT_TXD5_BYPASS_TBB BIT(14) +#define MT_TXD5_BYPASS_RBB BIT(13) +#define MT_TXD5_BSS_COLOR_ZERO BIT(12) +#define MT_TXD5_TX_STATUS_HOST BIT(10) +#define MT_TXD5_TX_STATUS_MCU BIT(9) +#define MT_TXD5_TX_STATUS_FMT BIT(8) +#define MT_TXD5_PID GENMASK(7, 0) + +#define MT_TXD6_TX_SRC GENMASK(31, 30) +#define MT_TXD6_VTA BIT(28) +#define MT_TXD6_BW GENMASK(25, 22) +#define MT_TXD6_TX_RATE GENMASK(21, 16) +#define MT_TXD6_TIMESTAMP_OFS_EN BIT(15) +#define MT_TXD6_TIMESTAMP_OFS_IDX GENMASK(14, 10) +#define MT_TXD6_MSDU_CNT GENMASK(9, 4) +#define MT_TXD6_DIS_MAT BIT(3) +#define MT_TXD6_DAS BIT(2) +#define MT_TXD6_AMSDU_CAP BIT(1) + +#define MT_TXD7_TXD_LEN GENMASK(31, 30) +#define MT_TXD7_IP_SUM BIT(29) +#define MT_TXD7_DROP_BY_SDO BIT(28) +#define MT_TXD7_MAC_TXD BIT(27) +#define MT_TXD7_CTXD BIT(26) +#define MT_TXD7_CTXD_CNT GENMASK(25, 22) +#define MT_TXD7_UDP_TCP_SUM BIT(15) +#define MT_TXD7_TX_TIME GENMASK(9, 0) + +#define MT_TXD9_WLAN_IDX GENMASK(23, 8) + +#define MT_TX_RATE_STBC BIT(14) +#define MT_TX_RATE_NSS GENMASK(13, 10) +#define MT_TX_RATE_MODE GENMASK(9, 6) +#define MT_TX_RATE_SU_EXT_TONE BIT(5) +#define MT_TX_RATE_DCM BIT(4) +/* VHT/HE only use bits 0-3 */ +#define MT_TX_RATE_IDX GENMASK(5, 0) + +#define MT_TXFREE0_PKT_TYPE GENMASK(31, 27) +#define MT_TXFREE0_MSDU_CNT GENMASK(25, 16) +#define MT_TXFREE0_RX_BYTE GENMASK(15, 0) + +#define MT_TXFREE1_VER GENMASK(18, 16) + +#define MT_TXFREE_INFO_PAIR BIT(31) +#define MT_TXFREE_INFO_HEADER BIT(30) +#define MT_TXFREE_INFO_WLAN_ID GENMASK(23, 12) +#define MT_TXFREE_INFO_MSDU_ID GENMASK(14, 0) +#define MT_TXFREE_INFO_COUNT GENMASK(27, 24) +#define MT_TXFREE_INFO_STAT GENMASK(29, 28) + +#define MT_TXS0_BW GENMASK(31, 29) +#define MT_TXS0_TID GENMASK(28, 26) +#define MT_TXS0_AMPDU BIT(25) +#define MT_TXS0_TXS_FORMAT GENMASK(24, 23) +#define MT_TXS0_BA_ERROR BIT(22) +#define MT_TXS0_PS_FLAG BIT(21) +#define MT_TXS0_TXOP_TIMEOUT BIT(20) +#define MT_TXS0_BIP_ERROR BIT(19) + +#define MT_TXS0_QUEUE_TIMEOUT BIT(18) +#define MT_TXS0_RTS_TIMEOUT BIT(17) +#define MT_TXS0_ACK_TIMEOUT BIT(16) +#define MT_TXS0_ACK_ERROR_MASK GENMASK(18, 16) + +#define MT_TXS0_TX_STATUS_HOST BIT(15) +#define MT_TXS0_TX_STATUS_MCU BIT(14) +#define MT_TXS0_TX_RATE GENMASK(13, 0) + +#define MT_TXS1_SEQNO GENMASK(31, 20) +#define MT_TXS1_RESP_RATE GENMASK(19, 16) +#define MT_TXS1_RXV_SEQNO GENMASK(15, 8) +#define MT_TXS1_TX_POWER_DBM GENMASK(7, 0) + +#define MT_TXS2_BF_STATUS GENMASK(31, 30) +#define MT_TXS2_BAND GENMASK(29, 28) +#define MT_TXS2_WCID GENMASK(27, 16) +#define MT_TXS2_TX_DELAY GENMASK(15, 0) + +#define MT_TXS3_PID GENMASK(31, 24) +#define MT_TXS3_RATE_STBC BIT(7) +#define MT_TXS3_FIXED_RATE BIT(6) +#define MT_TXS3_SRC GENMASK(5, 4) +#define MT_TXS3_SHARED_ANTENNA BIT(3) +#define MT_TXS3_LAST_TX_RATE GENMASK(2, 0) + +#define MT_TXS4_TIMESTAMP GENMASK(31, 0) + +#define MT_TXS5_F0_FINAL_MPDU BIT(31) +#define MT_TXS5_F0_QOS BIT(30) +#define MT_TXS5_F0_TX_COUNT GENMASK(29, 25) +#define MT_TXS5_F0_FRONT_TIME GENMASK(24, 0) +#define MT_TXS5_F1_MPDU_TX_COUNT GENMASK(31, 24) +#define MT_TXS5_F1_MPDU_TX_BYTES GENMASK(23, 0) + +#define MT_TXS6_F0_NOISE_3 GENMASK(31, 24) +#define MT_TXS6_F0_NOISE_2 GENMASK(23, 16) +#define MT_TXS6_F0_NOISE_1 GENMASK(15, 8) +#define MT_TXS6_F0_NOISE_0 GENMASK(7, 0) +#define MT_TXS6_F1_MPDU_FAIL_COUNT GENMASK(31, 24) +#define MT_TXS6_F1_MPDU_FAIL_BYTES GENMASK(23, 0) + +#define MT_TXS7_F0_RCPI_3 GENMASK(31, 24) +#define MT_TXS7_F0_RCPI_2 GENMASK(23, 16) +#define MT_TXS7_F0_RCPI_1 GENMASK(15, 8) +#define MT_TXS7_F0_RCPI_0 GENMASK(7, 0) +#define MT_TXS7_F1_MPDU_RETRY_COUNT GENMASK(31, 24) +#define MT_TXS7_F1_MPDU_RETRY_BYTES GENMASK(23, 0) + +#endif /* __MT76_CONNAC3_MAC_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -808,7 +808,7 @@ txp->rept_wds_wcid = cpu_to_le16(wcid->idx); else txp->rept_wds_wcid = cpu_to_le16(0x3ff); - tx_info->skb = DMA_DUMMY_DATA; + tx_info->skb = NULL; /* pass partial skb header to fw */ tx_info->buf[1].len = MT_CT_PARSE_LEN; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h @@ -495,10 +495,14 @@ SER_RECOVER }; -#define MT7915_MAX_BEACON_SIZE 512 -#define MT7915_MAX_INBAND_FRAME_SIZE 256 -#define MT7915_MAX_BSS_OFFLOAD_SIZE (MT7915_MAX_BEACON_SIZE + \ - MT7915_MAX_INBAND_FRAME_SIZE + \ +#define MT7915_MAX_BEACON_SIZE 1308 +#define MT7915_BEACON_UPDATE_SIZE (sizeof(struct sta_req_hdr) + \ + sizeof(struct bss_info_bcn) + \ + sizeof(struct bss_info_bcn_cntdwn) + \ + sizeof(struct bss_info_bcn_mbss) + \ + MT_TXD_SIZE + \ + sizeof(struct bss_info_bcn_cont)) +#define MT7915_MAX_BSS_OFFLOAD_SIZE (MT7915_MAX_BEACON_SIZE + \ MT7915_BEACON_UPDATE_SIZE) #define MT7915_BSS_UPDATE_MAX_SIZE (sizeof(struct sta_req_hdr) + \ @@ -511,12 +515,6 @@ sizeof(struct bss_info_bmc_rate) +\ sizeof(struct bss_info_ext_bss)) -#define MT7915_BEACON_UPDATE_SIZE (sizeof(struct sta_req_hdr) + \ - sizeof(struct bss_info_bcn_cntdwn) + \ - sizeof(struct bss_info_bcn_mbss) + \ - sizeof(struct bss_info_bcn_cont) + \ - sizeof(struct bss_info_inband_discovery)) - static inline s8 mt7915_get_power_bound(struct mt7915_phy *phy, s8 txpower) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7921/pci.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7921/pci.c @@ -17,6 +17,8 @@ .driver_data = (kernel_ulong_t)MT7921_FIRMWARE_WM }, { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7922), .driver_data = (kernel_ulong_t)MT7922_FIRMWARE_WM }, + { PCI_DEVICE(PCI_VENDOR_ID_ITTIM, 0x7922), + .driver_data = (kernel_ulong_t)MT7922_FIRMWARE_WM }, { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0608), .driver_data = (kernel_ulong_t)MT7921_FIRMWARE_WM }, { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0616), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c @@ -48,7 +48,7 @@ memset(txp, 0, sizeof(struct mt76_connac_hw_txp)); mt76_connac_write_hw_txp(mdev, tx_info, txp, id); - tx_info->skb = DMA_DUMMY_DATA; + tx_info->skb = NULL; return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7996/init.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/init.c @@ -729,16 +729,17 @@ IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMER | IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMEE; + val = max_t(u8, sts - 1, 3); eht_cap_elem->phy_cap_info[0] |= - u8_encode_bits(u8_get_bits(sts - 1, BIT(0)), + u8_encode_bits(u8_get_bits(val, BIT(0)), IEEE80211_EHT_PHY_CAP0_BEAMFORMEE_SS_80MHZ_MASK); eht_cap_elem->phy_cap_info[1] = - u8_encode_bits(u8_get_bits(sts - 1, GENMASK(2, 1)), + u8_encode_bits(u8_get_bits(val, GENMASK(2, 1)), IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_80MHZ_MASK) | - u8_encode_bits(sts - 1, + u8_encode_bits(val, IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK) | - u8_encode_bits(sts - 1, + u8_encode_bits(val, IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_320MHZ_MASK); eht_cap_elem->phy_cap_info[2] = only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7996/mac.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/mac.h @@ -6,320 +6,7 @@ #ifndef __MT7996_MAC_H #define __MT7996_MAC_H -#define MT_CT_PARSE_LEN 72 -#define MT_CT_DMA_BUF_NUM 2 - -#define MT_RXD0_LENGTH GENMASK(15, 0) -#define MT_RXD0_PKT_TYPE GENMASK(31, 27) - -#define MT_RXD0_MESH BIT(18) -#define MT_RXD0_MHCP BIT(19) -#define MT_RXD0_NORMAL_ETH_TYPE_OFS GENMASK(22, 16) -#define MT_RXD0_NORMAL_IP_SUM BIT(23) -#define MT_RXD0_NORMAL_UDP_TCP_SUM BIT(24) - -#define MT_RXD0_SW_PKT_TYPE_MASK GENMASK(31, 16) -#define MT_RXD0_SW_PKT_TYPE_MAP 0x380F -#define MT_RXD0_SW_PKT_TYPE_FRAME 0x3801 - -/* RXD DW1 */ -#define MT_RXD1_NORMAL_WLAN_IDX GENMASK(11, 0) -#define MT_RXD1_NORMAL_GROUP_1 BIT(16) -#define MT_RXD1_NORMAL_GROUP_2 BIT(17) -#define MT_RXD1_NORMAL_GROUP_3 BIT(18) -#define MT_RXD1_NORMAL_GROUP_4 BIT(19) -#define MT_RXD1_NORMAL_GROUP_5 BIT(20) -#define MT_RXD1_NORMAL_KEY_ID GENMASK(22, 21) -#define MT_RXD1_NORMAL_CM BIT(23) -#define MT_RXD1_NORMAL_CLM BIT(24) -#define MT_RXD1_NORMAL_ICV_ERR BIT(25) -#define MT_RXD1_NORMAL_TKIP_MIC_ERR BIT(26) -#define MT_RXD1_NORMAL_BAND_IDX GENMASK(28, 27) -#define MT_RXD1_NORMAL_SPP_EN BIT(29) -#define MT_RXD1_NORMAL_ADD_OM BIT(30) -#define MT_RXD1_NORMAL_SEC_DONE BIT(31) - -/* RXD DW2 */ -#define MT_RXD2_NORMAL_BSSID GENMASK(5, 0) -#define MT_RXD2_NORMAL_MAC_HDR_LEN GENMASK(12, 8) -#define MT_RXD2_NORMAL_HDR_TRANS BIT(7) -#define MT_RXD2_NORMAL_HDR_OFFSET GENMASK(15, 13) -#define MT_RXD2_NORMAL_SEC_MODE GENMASK(20, 16) -#define MT_RXD2_NORMAL_MU_BAR BIT(21) -#define MT_RXD2_NORMAL_SW_BIT BIT(22) -#define MT_RXD2_NORMAL_AMSDU_ERR BIT(23) -#define MT_RXD2_NORMAL_MAX_LEN_ERROR BIT(24) -#define MT_RXD2_NORMAL_HDR_TRANS_ERROR BIT(25) -#define MT_RXD2_NORMAL_INT_FRAME BIT(26) -#define MT_RXD2_NORMAL_FRAG BIT(27) -#define MT_RXD2_NORMAL_NULL_FRAME BIT(28) -#define MT_RXD2_NORMAL_NDATA BIT(29) -#define MT_RXD2_NORMAL_NON_AMPDU BIT(30) -#define MT_RXD2_NORMAL_BF_REPORT BIT(31) - -/* RXD DW3 */ -#define MT_RXD3_NORMAL_RXV_SEQ GENMASK(7, 0) -#define MT_RXD3_NORMAL_CH_FREQ GENMASK(15, 8) -#define MT_RXD3_NORMAL_ADDR_TYPE GENMASK(17, 16) -#define MT_RXD3_NORMAL_U2M BIT(0) -#define MT_RXD3_NORMAL_HTC_VLD BIT(18) -#define MT_RXD3_NORMAL_BEACON_MC BIT(20) -#define MT_RXD3_NORMAL_BEACON_UC BIT(21) -#define MT_RXD3_NORMAL_CO_ANT BIT(22) -#define MT_RXD3_NORMAL_FCS_ERR BIT(24) -#define MT_RXD3_NORMAL_VLAN2ETH BIT(31) - -/* RXD DW4 */ -#define MT_RXD4_NORMAL_PAYLOAD_FORMAT GENMASK(1, 0) -#define MT_RXD4_FIRST_AMSDU_FRAME GENMASK(1, 0) -#define MT_RXD4_MID_AMSDU_FRAME BIT(1) -#define MT_RXD4_LAST_AMSDU_FRAME BIT(0) - -#define MT_RXV_HDR_BAND_IDX BIT(24) - -/* RXD GROUP4 */ -#define MT_RXD8_FRAME_CONTROL GENMASK(15, 0) - -#define MT_RXD10_SEQ_CTRL GENMASK(15, 0) -#define MT_RXD10_QOS_CTL GENMASK(31, 16) - -#define MT_RXD11_HT_CONTROL GENMASK(31, 0) - -/* P-RXV */ -#define MT_PRXV_TX_RATE GENMASK(6, 0) -#define MT_PRXV_TX_DCM BIT(4) -#define MT_PRXV_TX_ER_SU_106T BIT(5) -#define MT_PRXV_NSTS GENMASK(10, 7) -#define MT_PRXV_TXBF BIT(11) -#define MT_PRXV_HT_AD_CODE BIT(12) -#define MT_PRXV_HE_RU_ALLOC GENMASK(30, 22) -#define MT_PRXV_RCPI3 GENMASK(31, 24) -#define MT_PRXV_RCPI2 GENMASK(23, 16) -#define MT_PRXV_RCPI1 GENMASK(15, 8) -#define MT_PRXV_RCPI0 GENMASK(7, 0) -#define MT_PRXV_HT_SHORT_GI GENMASK(4, 3) -#define MT_PRXV_HT_STBC GENMASK(10, 9) -#define MT_PRXV_TX_MODE GENMASK(14, 11) -#define MT_PRXV_FRAME_MODE GENMASK(2, 0) -#define MT_PRXV_DCM BIT(5) - -/* C-RXV */ -#define MT_CRXV_HE_NUM_USER GENMASK(26, 20) -#define MT_CRXV_HE_LTF_SIZE GENMASK(28, 27) -#define MT_CRXV_HE_LDPC_EXT_SYM BIT(30) - -#define MT_CRXV_HE_PE_DISAMBIG BIT(1) -#define MT_CRXV_HE_UPLINK BIT(2) - -#define MT_CRXV_HE_MU_AID GENMASK(27, 17) -#define MT_CRXV_HE_BEAM_CHNG BIT(29) - -#define MT_CRXV_HE_DOPPLER BIT(0) -#define MT_CRXV_HE_BSS_COLOR GENMASK(15, 10) -#define MT_CRXV_HE_TXOP_DUR GENMASK(19, 17) - -#define MT_CRXV_HE_SR_MASK GENMASK(11, 8) -#define MT_CRXV_HE_SR1_MASK GENMASK(16, 12) -#define MT_CRXV_HE_SR2_MASK GENMASK(20, 17) -#define MT_CRXV_HE_SR3_MASK GENMASK(24, 21) - -#define MT_CRXV_HE_RU0 GENMASK(8, 0) -#define MT_CRXV_HE_RU1 GENMASK(17, 9) -#define MT_CRXV_HE_RU2 GENMASK(26, 18) -#define MT_CRXV_HE_RU3_L GENMASK(31, 27) -#define MT_CRXV_HE_RU3_H GENMASK(3, 0) - -enum tx_header_format { - MT_HDR_FORMAT_802_3, - MT_HDR_FORMAT_CMD, - MT_HDR_FORMAT_802_11, - MT_HDR_FORMAT_802_11_EXT, -}; - -enum tx_pkt_type { - MT_TX_TYPE_CT, - MT_TX_TYPE_SF, - MT_TX_TYPE_CMD, - MT_TX_TYPE_FW, -}; - -enum tx_port_idx { - MT_TX_PORT_IDX_LMAC, - MT_TX_PORT_IDX_MCU -}; - -enum tx_mcu_port_q_idx { - MT_TX_MCU_PORT_RX_Q0 = 0x20, - MT_TX_MCU_PORT_RX_Q1, - MT_TX_MCU_PORT_RX_Q2, - MT_TX_MCU_PORT_RX_Q3, - MT_TX_MCU_PORT_RX_FWDL = 0x3e -}; - -enum tx_mgnt_type { - MT_TX_NORMAL, - MT_TX_TIMING, - MT_TX_ADDBA, -}; - -#define MT_CT_INFO_APPLY_TXD BIT(0) -#define MT_CT_INFO_COPY_HOST_TXD_ALL BIT(1) -#define MT_CT_INFO_MGMT_FRAME BIT(2) -#define MT_CT_INFO_NONE_CIPHER_FRAME BIT(3) -#define MT_CT_INFO_HSR2_TX BIT(4) -#define MT_CT_INFO_FROM_HOST BIT(7) - -#define MT_TXD_SIZE (8 * 4) - -#define MT_TXD0_Q_IDX GENMASK(31, 25) -#define MT_TXD0_PKT_FMT GENMASK(24, 23) -#define MT_TXD0_ETH_TYPE_OFFSET GENMASK(22, 16) -#define MT_TXD0_TX_BYTES GENMASK(15, 0) - -#define MT_TXD1_FIXED_RATE BIT(31) -#define MT_TXD1_OWN_MAC GENMASK(30, 25) -#define MT_TXD1_TID GENMASK(24, 21) -#define MT_TXD1_BIP BIT(24) -#define MT_TXD1_ETH_802_3 BIT(20) -#define MT_TXD1_HDR_INFO GENMASK(20, 16) -#define MT_TXD1_HDR_FORMAT GENMASK(15, 14) -#define MT_TXD1_TGID GENMASK(13, 12) -#define MT_TXD1_WLAN_IDX GENMASK(11, 0) - -#define MT_TXD2_POWER_OFFSET GENMASK(31, 26) -#define MT_TXD2_MAX_TX_TIME GENMASK(25, 16) -#define MT_TXD2_FRAG GENMASK(15, 14) -#define MT_TXD2_HTC_VLD BIT(13) -#define MT_TXD2_DURATION BIT(12) -#define MT_TXD2_HDR_PAD GENMASK(11, 10) -#define MT_TXD2_RTS BIT(9) -#define MT_TXD2_OWN_MAC_MAP BIT(8) -#define MT_TXD2_BF_TYPE GENMASK(6, 7) -#define MT_TXD2_FRAME_TYPE GENMASK(5, 4) -#define MT_TXD2_SUB_TYPE GENMASK(3, 0) - -#define MT_TXD3_SN_VALID BIT(31) -#define MT_TXD3_PN_VALID BIT(30) -#define MT_TXD3_SW_POWER_MGMT BIT(29) -#define MT_TXD3_BA_DISABLE BIT(28) -#define MT_TXD3_SEQ GENMASK(27, 16) -#define MT_TXD3_REM_TX_COUNT GENMASK(15, 11) -#define MT_TXD3_TX_COUNT GENMASK(10, 6) -#define MT_TXD3_HW_AMSDU BIT(5) -#define MT_TXD3_BCM BIT(4) -#define MT_TXD3_EEOSP BIT(3) -#define MT_TXD3_EMRD BIT(2) -#define MT_TXD3_PROTECT_FRAME BIT(1) -#define MT_TXD3_NO_ACK BIT(0) - -#define MT_TXD4_PN_LOW GENMASK(31, 0) - -#define MT_TXD5_PN_HIGH GENMASK(31, 16) -#define MT_TXD5_FL BIT(15) -#define MT_TXD5_BYPASS_TBB BIT(14) -#define MT_TXD5_BYPASS_RBB BIT(13) -#define MT_TXD5_BSS_COLOR_ZERO BIT(12) -#define MT_TXD5_TX_STATUS_HOST BIT(10) -#define MT_TXD5_TX_STATUS_MCU BIT(9) -#define MT_TXD5_TX_STATUS_FMT BIT(8) -#define MT_TXD5_PID GENMASK(7, 0) - -#define MT_TXD6_TX_SRC GENMASK(31, 30) -#define MT_TXD6_VTA BIT(28) -#define MT_TXD6_BW GENMASK(25, 22) -#define MT_TXD6_TX_RATE GENMASK(21, 16) -#define MT_TXD6_TIMESTAMP_OFS_EN BIT(15) -#define MT_TXD6_TIMESTAMP_OFS_IDX GENMASK(14, 10) -#define MT_TXD6_MSDU_CNT GENMASK(9, 4) -#define MT_TXD6_DIS_MAT BIT(3) -#define MT_TXD6_DAS BIT(2) -#define MT_TXD6_AMSDU_CAP BIT(1) - -#define MT_TXD7_TXD_LEN GENMASK(31, 30) -#define MT_TXD7_IP_SUM BIT(29) -#define MT_TXD7_DROP_BY_SDO BIT(28) -#define MT_TXD7_MAC_TXD BIT(27) -#define MT_TXD7_CTXD BIT(26) -#define MT_TXD7_CTXD_CNT GENMASK(25, 22) -#define MT_TXD7_UDP_TCP_SUM BIT(15) -#define MT_TXD7_TX_TIME GENMASK(9, 0) - -#define MT_TX_RATE_STBC BIT(14) -#define MT_TX_RATE_NSS GENMASK(13, 10) -#define MT_TX_RATE_MODE GENMASK(9, 6) -#define MT_TX_RATE_SU_EXT_TONE BIT(5) -#define MT_TX_RATE_DCM BIT(4) -/* VHT/HE only use bits 0-3 */ -#define MT_TX_RATE_IDX GENMASK(5, 0) - -#define MT_TXFREE0_PKT_TYPE GENMASK(31, 27) -#define MT_TXFREE0_MSDU_CNT GENMASK(25, 16) -#define MT_TXFREE0_RX_BYTE GENMASK(15, 0) - -#define MT_TXFREE1_VER GENMASK(18, 16) - -#define MT_TXFREE_INFO_PAIR BIT(31) -#define MT_TXFREE_INFO_HEADER BIT(30) -#define MT_TXFREE_INFO_WLAN_ID GENMASK(23, 12) -#define MT_TXFREE_INFO_MSDU_ID GENMASK(14, 0) - -#define MT_TXS0_BW GENMASK(31, 29) -#define MT_TXS0_TID GENMASK(28, 26) -#define MT_TXS0_AMPDU BIT(25) -#define MT_TXS0_TXS_FORMAT GENMASK(24, 23) -#define MT_TXS0_BA_ERROR BIT(22) -#define MT_TXS0_PS_FLAG BIT(21) -#define MT_TXS0_TXOP_TIMEOUT BIT(20) -#define MT_TXS0_BIP_ERROR BIT(19) - -#define MT_TXS0_QUEUE_TIMEOUT BIT(18) -#define MT_TXS0_RTS_TIMEOUT BIT(17) -#define MT_TXS0_ACK_TIMEOUT BIT(16) -#define MT_TXS0_ACK_ERROR_MASK GENMASK(18, 16) - -#define MT_TXS0_TX_STATUS_HOST BIT(15) -#define MT_TXS0_TX_STATUS_MCU BIT(14) -#define MT_TXS0_TX_RATE GENMASK(13, 0) - -#define MT_TXS1_SEQNO GENMASK(31, 20) -#define MT_TXS1_RESP_RATE GENMASK(19, 16) -#define MT_TXS1_RXV_SEQNO GENMASK(15, 8) -#define MT_TXS1_TX_POWER_DBM GENMASK(7, 0) - -#define MT_TXS2_BF_STATUS GENMASK(31, 30) -#define MT_TXS2_BAND GENMASK(29, 28) -#define MT_TXS2_WCID GENMASK(27, 16) -#define MT_TXS2_TX_DELAY GENMASK(15, 0) - -#define MT_TXS3_PID GENMASK(31, 24) -#define MT_TXS3_RATE_STBC BIT(7) -#define MT_TXS3_FIXED_RATE BIT(6) -#define MT_TXS3_SRC GENMASK(5, 4) -#define MT_TXS3_SHARED_ANTENNA BIT(3) -#define MT_TXS3_LAST_TX_RATE GENMASK(2, 0) - -#define MT_TXS4_TIMESTAMP GENMASK(31, 0) - -#define MT_TXS5_F0_FINAL_MPDU BIT(31) -#define MT_TXS5_F0_QOS BIT(30) -#define MT_TXS5_F0_TX_COUNT GENMASK(29, 25) -#define MT_TXS5_F0_FRONT_TIME GENMASK(24, 0) -#define MT_TXS5_F1_MPDU_TX_COUNT GENMASK(31, 24) -#define MT_TXS5_F1_MPDU_TX_BYTES GENMASK(23, 0) - -#define MT_TXS6_F0_NOISE_3 GENMASK(31, 24) -#define MT_TXS6_F0_NOISE_2 GENMASK(23, 16) -#define MT_TXS6_F0_NOISE_1 GENMASK(15, 8) -#define MT_TXS6_F0_NOISE_0 GENMASK(7, 0) -#define MT_TXS6_F1_MPDU_FAIL_COUNT GENMASK(31, 24) -#define MT_TXS6_F1_MPDU_FAIL_BYTES GENMASK(23, 0) - -#define MT_TXS7_F0_RCPI_3 GENMASK(31, 24) -#define MT_TXS7_F0_RCPI_2 GENMASK(23, 16) -#define MT_TXS7_F0_RCPI_1 GENMASK(15, 8) -#define MT_TXS7_F0_RCPI_0 GENMASK(7, 0) -#define MT_TXS7_F1_MPDU_RETRY_COUNT GENMASK(31, 24) -#define MT_TXS7_F1_MPDU_RETRY_BYTES GENMASK(23, 0) +#include "../mt76_connac3_mac.h" struct mt7996_dfs_pulse { u32 max_width; /* us */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7996/main.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/main.c @@ -184,7 +184,7 @@ mvif->mt76.omac_idx = idx; mvif->phy = phy; mvif->mt76.band_idx = band_idx; - mvif->mt76.wmm_idx = band_idx; + mvif->mt76.wmm_idx = vif->type != NL80211_IFTYPE_AP; ret = mt7996_mcu_add_dev_info(phy, vif, true); if (ret) @@ -414,10 +414,16 @@ const struct ieee80211_tx_queue_params *params) { struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv; + const u8 mq_to_aci[] = { + [IEEE80211_AC_VO] = 3, + [IEEE80211_AC_VI] = 2, + [IEEE80211_AC_BE] = 0, + [IEEE80211_AC_BK] = 1, + }; + /* firmware uses access class index */ + mvif->queue_params[mq_to_aci[queue]] = *params; /* no need to update right away, we'll get BSS_CHANGED_QOS */ - queue = mt76_connac_lmac_mapping(queue); - mvif->queue_params[queue] = *params; return 0; } @@ -598,8 +604,8 @@ mt7996_mcu_add_beacon(hw, vif, info->enable_beacon); } - if (changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP || - changed & BSS_CHANGED_FILS_DISCOVERY) + if (changed & (BSS_CHANGED_UNSOL_BCAST_PROBE_RESP | + BSS_CHANGED_FILS_DISCOVERY)) mt7996_mcu_beacon_inband_discov(dev, vif, changed); mutex_unlock(&dev->mt76.mutex); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h +++ linux-aws-6.5-6.5.0/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h @@ -270,8 +270,6 @@ u8 enable; __le16 wcid; __le16 prob_rsp_len; -#define MAX_INBAND_FRAME_SIZE 512 - u8 pkt[MAX_INBAND_FRAME_SIZE]; } __packed; struct bss_bcn_content_tlv { @@ -283,8 +281,6 @@ u8 enable; u8 type; __le16 pkt_len; -#define MAX_BEACON_SIZE 512 - u8 pkt[MAX_BEACON_SIZE]; } __packed; struct bss_bcn_cntdwn_tlv { @@ -574,13 +570,14 @@ sizeof(struct sta_rec_hdr_trans) + \ sizeof(struct tlv)) +#define MT7996_MAX_BEACON_SIZE 1342 #define MT7996_BEACON_UPDATE_SIZE (sizeof(struct bss_req_hdr) + \ sizeof(struct bss_bcn_content_tlv) + \ + MT_TXD_SIZE + \ sizeof(struct bss_bcn_cntdwn_tlv) + \ sizeof(struct bss_bcn_mbss_tlv)) - -#define MT7996_INBAND_FRAME_SIZE (sizeof(struct bss_req_hdr) + \ - sizeof(struct bss_inband_discovery_tlv)) +#define MT7996_MAX_BSS_OFFLOAD_SIZE (MT7996_MAX_BEACON_SIZE + \ + MT7996_BEACON_UPDATE_SIZE) enum { UNI_BAND_CONFIG_RADIO_ENABLE, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/microchip/wilc1000/wlan.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -1492,7 +1492,7 @@ } if (!wilc->vmm_table) - wilc->vmm_table = kzalloc(WILC_VMM_TBL_SIZE, GFP_KERNEL); + wilc->vmm_table = kcalloc(WILC_VMM_TBL_SIZE, sizeof(u32), GFP_KERNEL); if (!wilc->vmm_table) { ret = -ENOBUFS; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/purelifi/plfxlc/mac.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/purelifi/plfxlc/mac.c @@ -666,7 +666,7 @@ u32 sset, u8 *data) { if (sset == ETH_SS_STATS) - memcpy(data, *et_strings, sizeof(et_strings)); + memcpy(data, et_strings, sizeof(et_strings)); } static void plfxlc_get_et_stats(struct ieee80211_hw *hw, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c @@ -799,7 +799,7 @@ } if (rtlpriv->btcoexist.bt_edca_dl != 0) { - edca_be_ul = rtlpriv->btcoexist.bt_edca_dl; + edca_be_dl = rtlpriv->btcoexist.bt_edca_dl; bt_change_edca = true; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c @@ -640,7 +640,7 @@ } if (rtlpriv->btcoexist.bt_edca_dl != 0) { - edca_be_ul = rtlpriv->btcoexist.bt_edca_dl; + edca_be_dl = rtlpriv->btcoexist.bt_edca_dl; bt_change_edca = true; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/dm.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/dm.c @@ -466,7 +466,7 @@ } if (rtlpriv->btcoexist.bt_edca_dl != 0) { - edca_be_ul = rtlpriv->btcoexist.bt_edca_dl; + edca_be_dl = rtlpriv->btcoexist.bt_edca_dl; bt_change_edca = true; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/realtek/rtw88/debug.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/realtek/rtw88/debug.c @@ -1233,9 +1233,9 @@ #define rtw_debugfs_add_core(name, mode, fopname, parent) \ do { \ rtw_debug_priv_ ##name.rtwdev = rtwdev; \ - if (!debugfs_create_file(#name, mode, \ + if (IS_ERR(debugfs_create_file(#name, mode, \ parent, &rtw_debug_priv_ ##name,\ - &file_ops_ ##fopname)) \ + &file_ops_ ##fopname))) \ pr_debug("Unable to initialize debugfs:%s\n", \ #name); \ } while (0) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wireless/silabs/wfx/data_tx.c +++ linux-aws-6.5-6.5.0/drivers/net/wireless/silabs/wfx/data_tx.c @@ -226,53 +226,40 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) { - int i; - bool finished; + bool has_rate0 = false; + int i, j; - /* Firmware is not able to mix rates with different flags */ - for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { - if (rates[0].flags & IEEE80211_TX_RC_SHORT_GI) - rates[i].flags |= IEEE80211_TX_RC_SHORT_GI; - if (!(rates[0].flags & IEEE80211_TX_RC_SHORT_GI)) + for (i = 1, j = 1; j < IEEE80211_TX_MAX_RATES; j++) { + if (rates[j].idx == -1) + break; + /* The device use the rates in descending order, whatever the request from minstrel. + * We have to trade off here. Most important is to respect the primary rate + * requested by minstrel. So, we drops the entries with rate higher than the + * previous. + */ + if (rates[j].idx >= rates[i - 1].idx) { + rates[i - 1].count += rates[j].count; + rates[i - 1].count = min_t(u16, 15, rates[i - 1].count); + } else { + memcpy(rates + i, rates + j, sizeof(rates[i])); + if (rates[i].idx == 0) + has_rate0 = true; + /* The device apply Short GI only on the first rate */ rates[i].flags &= ~IEEE80211_TX_RC_SHORT_GI; - if (!(rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)) - rates[i].flags &= ~IEEE80211_TX_RC_USE_RTS_CTS; - } - - /* Sort rates and remove duplicates */ - do { - finished = true; - for (i = 0; i < IEEE80211_TX_MAX_RATES - 1; i++) { - if (rates[i + 1].idx == rates[i].idx && - rates[i].idx != -1) { - rates[i].count += rates[i + 1].count; - if (rates[i].count > 15) - rates[i].count = 15; - rates[i + 1].idx = -1; - rates[i + 1].count = 0; - - finished = false; - } - if (rates[i + 1].idx > rates[i].idx) { - swap(rates[i + 1], rates[i]); - finished = false; - } + i++; } - } while (!finished); + } /* Ensure that MCS0 or 1Mbps is present at the end of the retry list */ - for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { - if (rates[i].idx == 0) - break; - if (rates[i].idx == -1) { - rates[i].idx = 0; - rates[i].count = 8; /* == hw->max_rate_tries */ - rates[i].flags = rates[i - 1].flags & IEEE80211_TX_RC_MCS; - break; - } + if (!has_rate0 && i < IEEE80211_TX_MAX_RATES) { + rates[i].idx = 0; + rates[i].count = 8; /* == hw->max_rate_tries */ + rates[i].flags = rates[0].flags & IEEE80211_TX_RC_MCS; + i++; + } + for (; i < IEEE80211_TX_MAX_RATES; i++) { + memset(rates + i, 0, sizeof(rates[i])); + rates[i].idx = -1; } - /* All retries use long GI */ - for (i = 1; i < IEEE80211_TX_MAX_RATES; i++) - rates[i].flags &= ~IEEE80211_TX_RC_SHORT_GI; } static u8 wfx_tx_get_retry_policy_id(struct wfx_vif *wvif, struct ieee80211_tx_info *tx_info) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wwan/iosm/iosm_ipc_imem.c +++ linux-aws-6.5-6.5.0/drivers/net/wwan/iosm/iosm_ipc_imem.c @@ -4,7 +4,6 @@ */ #include -#include #include "iosm_ipc_chnl_cfg.h" #include "iosm_ipc_devlink.h" @@ -632,11 +631,6 @@ /* Complete all memory stores after setting bit */ smp_mb__after_atomic(); - if (ipc_imem->pcie->pci->device == INTEL_CP_DEVICE_7560_ID) { - pm_runtime_mark_last_busy(ipc_imem->dev); - pm_runtime_put_autosuspend(ipc_imem->dev); - } - return; err_ipc_mux_deinit: @@ -1240,7 +1234,6 @@ /* forward MDM_NOT_READY to listeners */ ipc_uevent_send(ipc_imem->dev, UEVENT_MDM_NOT_READY); - pm_runtime_get_sync(ipc_imem->dev); hrtimer_cancel(&ipc_imem->td_alloc_timer); hrtimer_cancel(&ipc_imem->tdupdate_timer); @@ -1426,16 +1419,6 @@ set_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag); } - - if (!pm_runtime_enabled(ipc_imem->dev)) - pm_runtime_enable(ipc_imem->dev); - - pm_runtime_set_autosuspend_delay(ipc_imem->dev, - IPC_MEM_AUTO_SUSPEND_DELAY_MS); - pm_runtime_use_autosuspend(ipc_imem->dev); - pm_runtime_allow(ipc_imem->dev); - pm_runtime_mark_last_busy(ipc_imem->dev); - return ipc_imem; devlink_channel_fail: ipc_devlink_deinit(ipc_imem->ipc_devlink); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wwan/iosm/iosm_ipc_imem.h +++ linux-aws-6.5-6.5.0/drivers/net/wwan/iosm/iosm_ipc_imem.h @@ -103,8 +103,6 @@ #define FULLY_FUNCTIONAL 0 #define IOSM_DEVLINK_INIT 1 -#define IPC_MEM_AUTO_SUSPEND_DELAY_MS 5000 - /* List of the supported UL/DL pipes. */ enum ipc_mem_pipes { IPC_MEM_PIPE_0 = 0, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wwan/iosm/iosm_ipc_pcie.c +++ linux-aws-6.5-6.5.0/drivers/net/wwan/iosm/iosm_ipc_pcie.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include "iosm_ipc_imem.h" @@ -438,8 +437,7 @@ return 0; } -static DEFINE_RUNTIME_DEV_PM_OPS(iosm_ipc_pm, ipc_pcie_suspend_cb, - ipc_pcie_resume_cb, NULL); +static SIMPLE_DEV_PM_OPS(iosm_ipc_pm, ipc_pcie_suspend_cb, ipc_pcie_resume_cb); static struct pci_driver iosm_ipc_driver = { .name = KBUILD_MODNAME, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wwan/iosm/iosm_ipc_port.c +++ linux-aws-6.5-6.5.0/drivers/net/wwan/iosm/iosm_ipc_port.c @@ -3,8 +3,6 @@ * Copyright (C) 2020-21 Intel Corporation. */ -#include - #include "iosm_ipc_chnl_cfg.h" #include "iosm_ipc_imem_ops.h" #include "iosm_ipc_port.h" @@ -15,16 +13,12 @@ struct iosm_cdev *ipc_port = wwan_port_get_drvdata(port); int ret = 0; - pm_runtime_get_sync(ipc_port->ipc_imem->dev); ipc_port->channel = ipc_imem_sys_port_open(ipc_port->ipc_imem, ipc_port->chl_id, IPC_HP_CDEV_OPEN); if (!ipc_port->channel) ret = -EIO; - pm_runtime_mark_last_busy(ipc_port->ipc_imem->dev); - pm_runtime_put_autosuspend(ipc_port->ipc_imem->dev); - return ret; } @@ -33,24 +27,15 @@ { struct iosm_cdev *ipc_port = wwan_port_get_drvdata(port); - pm_runtime_get_sync(ipc_port->ipc_imem->dev); ipc_imem_sys_port_close(ipc_port->ipc_imem, ipc_port->channel); - pm_runtime_mark_last_busy(ipc_port->ipc_imem->dev); - pm_runtime_put_autosuspend(ipc_port->ipc_imem->dev); } /* transfer control data to modem */ static int ipc_port_ctrl_tx(struct wwan_port *port, struct sk_buff *skb) { struct iosm_cdev *ipc_port = wwan_port_get_drvdata(port); - int ret; - pm_runtime_get_sync(ipc_port->ipc_imem->dev); - ret = ipc_imem_sys_cdev_write(ipc_port, skb); - pm_runtime_mark_last_busy(ipc_port->ipc_imem->dev); - pm_runtime_put_autosuspend(ipc_port->ipc_imem->dev); - - return ret; + return ipc_imem_sys_cdev_write(ipc_port, skb); } static const struct wwan_port_ops ipc_wwan_ctrl_ops = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wwan/iosm/iosm_ipc_trace.c +++ linux-aws-6.5-6.5.0/drivers/net/wwan/iosm/iosm_ipc_trace.c @@ -3,9 +3,7 @@ * Copyright (C) 2020-2021 Intel Corporation. */ -#include #include - #include "iosm_ipc_trace.h" /* sub buffer size and number of sub buffer */ @@ -99,8 +97,6 @@ if (ret) return ret; - pm_runtime_get_sync(ipc_trace->ipc_imem->dev); - mutex_lock(&ipc_trace->trc_mutex); if (val == TRACE_ENABLE && ipc_trace->mode != TRACE_ENABLE) { ipc_trace->channel = ipc_imem_sys_port_open(ipc_trace->ipc_imem, @@ -121,10 +117,6 @@ ret = count; unlock: mutex_unlock(&ipc_trace->trc_mutex); - - pm_runtime_mark_last_busy(ipc_trace->ipc_imem->dev); - pm_runtime_put_autosuspend(ipc_trace->ipc_imem->dev); - return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/net/wwan/iosm/iosm_ipc_wwan.c +++ linux-aws-6.5-6.5.0/drivers/net/wwan/iosm/iosm_ipc_wwan.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -52,13 +51,11 @@ struct iosm_netdev_priv *priv = wwan_netdev_drvpriv(netdev); struct iosm_wwan *ipc_wwan = priv->ipc_wwan; int if_id = priv->if_id; - int ret = 0; if (if_id < IP_MUX_SESSION_START || if_id >= ARRAY_SIZE(ipc_wwan->sub_netlist)) return -EINVAL; - pm_runtime_get_sync(ipc_wwan->ipc_imem->dev); /* get channel id */ priv->ch_id = ipc_imem_sys_wwan_open(ipc_wwan->ipc_imem, if_id); @@ -66,8 +63,7 @@ dev_err(ipc_wwan->dev, "cannot connect wwan0 & id %d to the IPC mem layer", if_id); - ret = -ENODEV; - goto err_out; + return -ENODEV; } /* enable tx path, DL data may follow */ @@ -76,11 +72,7 @@ dev_dbg(ipc_wwan->dev, "Channel id %d allocated to if_id %d", priv->ch_id, priv->if_id); -err_out: - pm_runtime_mark_last_busy(ipc_wwan->ipc_imem->dev); - pm_runtime_put_autosuspend(ipc_wwan->ipc_imem->dev); - - return ret; + return 0; } /* Bring-down the wwan net link */ @@ -90,12 +82,9 @@ netif_stop_queue(netdev); - pm_runtime_get_sync(priv->ipc_wwan->ipc_imem->dev); ipc_imem_sys_wwan_close(priv->ipc_wwan->ipc_imem, priv->if_id, priv->ch_id); priv->ch_id = -1; - pm_runtime_mark_last_busy(priv->ipc_wwan->ipc_imem->dev); - pm_runtime_put_autosuspend(priv->ipc_wwan->ipc_imem->dev); return 0; } @@ -117,7 +106,6 @@ if_id >= ARRAY_SIZE(ipc_wwan->sub_netlist)) return -EINVAL; - pm_runtime_get(ipc_wwan->ipc_imem->dev); /* Send the SKB to device for transmission */ ret = ipc_imem_sys_wwan_transmit(ipc_wwan->ipc_imem, if_id, priv->ch_id, skb); @@ -131,14 +119,9 @@ ret = NETDEV_TX_BUSY; dev_err(ipc_wwan->dev, "unable to push packets"); } else { - pm_runtime_mark_last_busy(ipc_wwan->ipc_imem->dev); - pm_runtime_put_autosuspend(ipc_wwan->ipc_imem->dev); goto exit; } - pm_runtime_mark_last_busy(ipc_wwan->ipc_imem->dev); - pm_runtime_put_autosuspend(ipc_wwan->ipc_imem->dev); - return ret; exit: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvdimm/of_pmem.c +++ linux-aws-6.5-6.5.0/drivers/nvdimm/of_pmem.c @@ -30,7 +30,13 @@ if (!priv) return -ENOMEM; - priv->bus_desc.provider_name = kstrdup(pdev->name, GFP_KERNEL); + priv->bus_desc.provider_name = devm_kstrdup(&pdev->dev, pdev->name, + GFP_KERNEL); + if (!priv->bus_desc.provider_name) { + kfree(priv); + return -ENOMEM; + } + priv->bus_desc.module = THIS_MODULE; priv->bus_desc.of_node = np; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvdimm/region_devs.c +++ linux-aws-6.5-6.5.0/drivers/nvdimm/region_devs.c @@ -938,7 +938,8 @@ { unsigned int cpu, lane; - cpu = get_cpu(); + migrate_disable(); + cpu = smp_processor_id(); if (nd_region->num_lanes < nr_cpu_ids) { struct nd_percpu_lane *ndl_lock, *ndl_count; @@ -957,16 +958,15 @@ void nd_region_release_lane(struct nd_region *nd_region, unsigned int lane) { if (nd_region->num_lanes < nr_cpu_ids) { - unsigned int cpu = get_cpu(); + unsigned int cpu = smp_processor_id(); struct nd_percpu_lane *ndl_lock, *ndl_count; ndl_count = per_cpu_ptr(nd_region->lane, cpu); ndl_lock = per_cpu_ptr(nd_region->lane, lane); if (--ndl_count->count == 0) spin_unlock(&ndl_lock->lock); - put_cpu(); } - put_cpu(); + migrate_enable(); } EXPORT_SYMBOL(nd_region_release_lane); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvme/host/auth.c +++ linux-aws-6.5-6.5.0/drivers/nvme/host/auth.c @@ -341,7 +341,7 @@ struct nvmf_auth_dhchap_success1_data *data = chap->buf; size_t size = sizeof(*data); - if (chap->ctrl_key) + if (chap->s2) size += chap->hash_len; if (size > CHAP_BUF_SIZE) { @@ -825,7 +825,7 @@ goto fail2; } - if (chap->ctrl_key) { + if (chap->s2) { /* DH-HMAC-CHAP Step 5: send success2 */ dev_dbg(ctrl->device, "%s: qid %d send success2\n", __func__, chap->qid); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvme/host/fabrics.c +++ linux-aws-6.5-6.5.0/drivers/nvme/host/fabrics.c @@ -645,8 +645,10 @@ { NVMF_OPT_TOS, "tos=%d" }, { NVMF_OPT_FAIL_FAST_TMO, "fast_io_fail_tmo=%d" }, { NVMF_OPT_DISCOVERY, "discovery" }, +#ifdef CONFIG_NVME_HOST_AUTH { NVMF_OPT_DHCHAP_SECRET, "dhchap_secret=%s" }, { NVMF_OPT_DHCHAP_CTRL_SECRET, "dhchap_ctrl_secret=%s" }, +#endif { NVMF_OPT_ERR, NULL } }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvme/host/ioctl.c +++ linux-aws-6.5-6.5.0/drivers/nvme/host/ioctl.c @@ -108,9 +108,13 @@ if (!buf) goto out; - ret = -EFAULT; - if ((req_op(req) == REQ_OP_DRV_OUT) && copy_from_user(buf, ubuf, len)) - goto out_free_meta; + if (req_op(req) == REQ_OP_DRV_OUT) { + ret = -EFAULT; + if (copy_from_user(buf, ubuf, len)) + goto out_free_meta; + } else { + memset(buf, 0, len); + } bip = bio_integrity_alloc(bio, GFP_KERNEL, 1); if (IS_ERR(bip)) { @@ -507,10 +511,13 @@ struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd); req->bio = pdu->bio; - if (nvme_req(req)->flags & NVME_REQ_CANCELLED) + if (nvme_req(req)->flags & NVME_REQ_CANCELLED) { pdu->nvme_status = -EINTR; - else + } else { pdu->nvme_status = nvme_req(req)->status; + if (!pdu->nvme_status) + pdu->nvme_status = blk_status_to_errno(err); + } pdu->u.result = le64_to_cpu(nvme_req(req)->result.u64); /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvme/host/nvme.h +++ linux-aws-6.5-6.5.0/drivers/nvme/host/nvme.h @@ -156,6 +156,11 @@ * No temperature thresholds for channels other than 0 (Composite). */ NVME_QUIRK_NO_SECONDARY_TEMP_THRESH = (1 << 19), + + /* + * Disables simple suspend/resume path. + */ + NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND = (1 << 20), }; /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvme/host/rdma.c +++ linux-aws-6.5-6.5.0/drivers/nvme/host/rdma.c @@ -638,6 +638,9 @@ static void nvme_rdma_stop_queue(struct nvme_rdma_queue *queue) { + if (!test_bit(NVME_RDMA_Q_ALLOCATED, &queue->flags)) + return; + mutex_lock(&queue->queue_lock); if (test_and_clear_bit(NVME_RDMA_Q_LIVE, &queue->flags)) __nvme_rdma_stop_queue(queue); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvme/target/fabrics-cmd-auth.c +++ linux-aws-6.5-6.5.0/drivers/nvme/target/fabrics-cmd-auth.c @@ -333,19 +333,21 @@ __func__, ctrl->cntlid, req->sq->qid, status, req->error_loc); req->cqe->result.u64 = 0; - nvmet_req_complete(req, status); if (req->sq->dhchap_step != NVME_AUTH_DHCHAP_MESSAGE_SUCCESS2 && req->sq->dhchap_step != NVME_AUTH_DHCHAP_MESSAGE_FAILURE2) { unsigned long auth_expire_secs = ctrl->kato ? ctrl->kato : 120; mod_delayed_work(system_wq, &req->sq->auth_expired_work, auth_expire_secs * HZ); - return; + goto complete; } /* Final states, clear up variables */ nvmet_auth_sq_free(req->sq); if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_FAILURE2) nvmet_ctrl_fatal_error(ctrl); + +complete: + nvmet_req_complete(req, status); } static int nvmet_auth_challenge(struct nvmet_req *req, void *d, int al) @@ -514,11 +516,12 @@ kfree(d); done: req->cqe->result.u64 = 0; - nvmet_req_complete(req, status); + if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_SUCCESS2) nvmet_auth_sq_free(req->sq); else if (req->sq->dhchap_step == NVME_AUTH_DHCHAP_MESSAGE_FAILURE1) { nvmet_auth_sq_free(req->sq); nvmet_ctrl_fatal_error(ctrl); } + nvmet_req_complete(req, status); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvme/target/fabrics-cmd.c +++ linux-aws-6.5-6.5.0/drivers/nvme/target/fabrics-cmd.c @@ -244,6 +244,8 @@ goto out; } + d->subsysnqn[NVMF_NQN_FIELD_LEN - 1] = '\0'; + d->hostnqn[NVMF_NQN_FIELD_LEN - 1] = '\0'; status = nvmet_alloc_ctrl(d->subsysnqn, d->hostnqn, req, le32_to_cpu(c->kato), &ctrl); if (status) @@ -313,6 +315,8 @@ goto out; } + d->subsysnqn[NVMF_NQN_FIELD_LEN - 1] = '\0'; + d->hostnqn[NVMF_NQN_FIELD_LEN - 1] = '\0'; ctrl = nvmet_ctrl_find_get(d->subsysnqn, d->hostnqn, le16_to_cpu(d->cntlid), req); if (!ctrl) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvmem/core.c +++ linux-aws-6.5-6.5.0/drivers/nvmem/core.c @@ -793,6 +793,12 @@ if (!layout_np) return NULL; + /* Fixed layouts don't have a matching driver */ + if (of_device_is_compatible(layout_np, "fixed-layout")) { + of_node_put(layout_np); + return NULL; + } + /* * In case the nvmem device was built-in while the layout was built as a * module, we shall manually request the layout driver loading otherwise only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/nvmem/imx-ocotp.c +++ linux-aws-6.5-6.5.0/drivers/nvmem/imx-ocotp.c @@ -499,7 +499,7 @@ }; static const struct ocotp_params imx6sll_params = { - .nregs = 128, + .nregs = 80, .bank_address_words = 0, .set_timing = imx_ocotp_set_imx6_timing, .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, @@ -513,14 +513,14 @@ }; static const struct ocotp_params imx6ul_params = { - .nregs = 128, + .nregs = 144, .bank_address_words = 0, .set_timing = imx_ocotp_set_imx6_timing, .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, }; static const struct ocotp_params imx6ull_params = { - .nregs = 64, + .nregs = 80, .bank_address_words = 0, .set_timing = imx_ocotp_set_imx6_timing, .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/of/address.c +++ linux-aws-6.5-6.5.0/drivers/of/address.c @@ -100,6 +100,32 @@ return IORESOURCE_MEM; } +static u64 of_bus_default_flags_map(__be32 *addr, const __be32 *range, int na, + int ns, int pna) +{ + u64 cp, s, da; + + /* Check that flags match */ + if (*addr != *range) + return OF_BAD_ADDR; + + /* Read address values, skipping high cell */ + cp = of_read_number(range + 1, na - 1); + s = of_read_number(range + na + pna, ns); + da = of_read_number(addr + 1, na - 1); + + pr_debug("default flags map, cp=%llx, s=%llx, da=%llx\n", cp, s, da); + + if (da < cp || da >= (cp + s)) + return OF_BAD_ADDR; + return da - cp; +} + +static int of_bus_default_flags_translate(__be32 *addr, u64 offset, int na) +{ + /* Keep "flags" part (high cell) in translated address */ + return of_bus_default_translate(addr + 1, offset, na - 1); +} #ifdef CONFIG_PCI static unsigned int of_bus_pci_get_flags(const __be32 *addr) @@ -374,8 +400,8 @@ .addresses = "reg", .match = of_bus_default_flags_match, .count_cells = of_bus_default_count_cells, - .map = of_bus_default_map, - .translate = of_bus_default_translate, + .map = of_bus_default_flags_map, + .translate = of_bus_default_flags_translate, .has_flags = true, .get_flags = of_bus_default_flags_get_flags, }, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/parisc/power.c +++ linux-aws-6.5-6.5.0/drivers/parisc/power.c @@ -197,6 +197,14 @@ .priority = INT_MAX, }; +/* qemu soft power-off function */ +static int qemu_power_off(struct sys_off_data *data) +{ + /* this turns the system off via SeaBIOS */ + gsc_writel(0, (unsigned long) data->cb_data); + pdc_soft_power_button(1); + return NOTIFY_DONE; +} static int __init power_init(void) { @@ -226,7 +234,13 @@ soft_power_reg); } - power_task = kthread_run(kpowerswd, (void*)soft_power_reg, KTHREAD_NAME); + power_task = NULL; + if (running_on_qemu && soft_power_reg) + register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_DEFAULT, + qemu_power_off, (void *)soft_power_reg); + else + power_task = kthread_run(kpowerswd, (void*)soft_power_reg, + KTHREAD_NAME); if (IS_ERR(power_task)) { printk(KERN_ERR DRIVER_NAME ": thread creation failed. Driver not loaded.\n"); pdc_soft_power_button(0); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/parport/parport_pc.c +++ linux-aws-6.5-6.5.0/drivers/parport/parport_pc.c @@ -2657,6 +2657,8 @@ netmos_9865, quatech_sppxp100, wch_ch382l, + brainboxes_uc146, + brainboxes_px203, }; @@ -2735,6 +2737,8 @@ /* netmos_9865 */ { 1, { { 0, -1 }, } }, /* quatech_sppxp100 */ { 1, { { 0, 1 }, } }, /* wch_ch382l */ { 1, { { 2, -1 }, } }, + /* brainboxes_uc146 */ { 1, { { 3, -1 }, } }, + /* brainboxes_px203 */ { 1, { { 0, -1 }, } }, }; static const struct pci_device_id parport_pc_pci_tbl[] = { @@ -2828,6 +2832,23 @@ PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 }, /* WCH CH382L PCI-E single parallel port card */ { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382l }, + /* Brainboxes IX-500/550 */ + { PCI_VENDOR_ID_INTASHIELD, 0x402a, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_pcie_pport }, + /* Brainboxes UC-146/UC-157 */ + { PCI_VENDOR_ID_INTASHIELD, 0x0be1, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc146 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0be2, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc146 }, + /* Brainboxes PX-146/PX-257 */ + { PCI_VENDOR_ID_INTASHIELD, 0x401c, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_pcie_pport }, + /* Brainboxes PX-203 */ + { PCI_VENDOR_ID_INTASHIELD, 0x4007, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_px203 }, + /* Brainboxes PX-475 */ + { PCI_VENDOR_ID_INTASHIELD, 0x401f, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_pcie_pport }, { 0, } /* terminate list */ }; MODULE_DEVICE_TABLE(pci, parport_pc_pci_tbl); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pci/controller/dwc/pci-exynos.c +++ linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pci-exynos.c @@ -375,7 +375,7 @@ return ret; } -static int __exit exynos_pcie_remove(struct platform_device *pdev) +static int exynos_pcie_remove(struct platform_device *pdev) { struct exynos_pcie *ep = platform_get_drvdata(pdev); @@ -431,7 +431,7 @@ static struct platform_driver exynos_pcie_driver = { .probe = exynos_pcie_probe, - .remove = __exit_p(exynos_pcie_remove), + .remove = exynos_pcie_remove, .driver = { .name = "exynos-pcie", .of_match_table = exynos_pcie_of_match, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pci/controller/dwc/pci-keystone.c +++ linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pci-keystone.c @@ -1101,7 +1101,7 @@ { }, }; -static int __init ks_pcie_probe(struct platform_device *pdev) +static int ks_pcie_probe(struct platform_device *pdev) { const struct dw_pcie_host_ops *host_ops; const struct dw_pcie_ep_ops *ep_ops; @@ -1303,7 +1303,7 @@ return ret; } -static int __exit ks_pcie_remove(struct platform_device *pdev) +static int ks_pcie_remove(struct platform_device *pdev) { struct keystone_pcie *ks_pcie = platform_get_drvdata(pdev); struct device_link **link = ks_pcie->link; @@ -1319,9 +1319,9 @@ return 0; } -static struct platform_driver ks_pcie_driver __refdata = { +static struct platform_driver ks_pcie_driver = { .probe = ks_pcie_probe, - .remove = __exit_p(ks_pcie_remove), + .remove = ks_pcie_remove, .driver = { .name = "keystone-pcie", .of_match_table = ks_pcie_of_match, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pci/controller/dwc/pcie-designware.c +++ linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pcie-designware.c @@ -732,6 +732,53 @@ } +static void dw_pcie_link_set_max_link_width(struct dw_pcie *pci, u32 num_lanes) +{ + u32 lnkcap, lwsc, plc; + u8 cap; + + if (!num_lanes) + return; + + /* Set the number of lanes */ + plc = dw_pcie_readl_dbi(pci, PCIE_PORT_LINK_CONTROL); + plc &= ~PORT_LINK_FAST_LINK_MODE; + plc &= ~PORT_LINK_MODE_MASK; + + /* Set link width speed control register */ + lwsc = dw_pcie_readl_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL); + lwsc &= ~PORT_LOGIC_LINK_WIDTH_MASK; + switch (num_lanes) { + case 1: + plc |= PORT_LINK_MODE_1_LANES; + lwsc |= PORT_LOGIC_LINK_WIDTH_1_LANES; + break; + case 2: + plc |= PORT_LINK_MODE_2_LANES; + lwsc |= PORT_LOGIC_LINK_WIDTH_2_LANES; + break; + case 4: + plc |= PORT_LINK_MODE_4_LANES; + lwsc |= PORT_LOGIC_LINK_WIDTH_4_LANES; + break; + case 8: + plc |= PORT_LINK_MODE_8_LANES; + lwsc |= PORT_LOGIC_LINK_WIDTH_8_LANES; + break; + default: + dev_err(pci->dev, "num-lanes %u: invalid value\n", num_lanes); + return; + } + dw_pcie_writel_dbi(pci, PCIE_PORT_LINK_CONTROL, plc); + dw_pcie_writel_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL, lwsc); + + cap = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); + lnkcap = dw_pcie_readl_dbi(pci, cap + PCI_EXP_LNKCAP); + lnkcap &= ~PCI_EXP_LNKCAP_MLW; + lnkcap |= FIELD_PREP(PCI_EXP_LNKCAP_MLW, num_lanes); + dw_pcie_writel_dbi(pci, cap + PCI_EXP_LNKCAP, lnkcap); +} + void dw_pcie_iatu_detect(struct dw_pcie *pci) { int max_region, ob, ib; @@ -1013,49 +1060,5 @@ val |= PORT_LINK_DLL_LINK_EN; dw_pcie_writel_dbi(pci, PCIE_PORT_LINK_CONTROL, val); - if (!pci->num_lanes) { - dev_dbg(pci->dev, "Using h/w default number of lanes\n"); - return; - } - - /* Set the number of lanes */ - val &= ~PORT_LINK_FAST_LINK_MODE; - val &= ~PORT_LINK_MODE_MASK; - switch (pci->num_lanes) { - case 1: - val |= PORT_LINK_MODE_1_LANES; - break; - case 2: - val |= PORT_LINK_MODE_2_LANES; - break; - case 4: - val |= PORT_LINK_MODE_4_LANES; - break; - case 8: - val |= PORT_LINK_MODE_8_LANES; - break; - default: - dev_err(pci->dev, "num-lanes %u: invalid value\n", pci->num_lanes); - return; - } - dw_pcie_writel_dbi(pci, PCIE_PORT_LINK_CONTROL, val); - - /* Set link width speed control register */ - val = dw_pcie_readl_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL); - val &= ~PORT_LOGIC_LINK_WIDTH_MASK; - switch (pci->num_lanes) { - case 1: - val |= PORT_LOGIC_LINK_WIDTH_1_LANES; - break; - case 2: - val |= PORT_LOGIC_LINK_WIDTH_2_LANES; - break; - case 4: - val |= PORT_LOGIC_LINK_WIDTH_4_LANES; - break; - case 8: - val |= PORT_LOGIC_LINK_WIDTH_8_LANES; - break; - } - dw_pcie_writel_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL, val); + dw_pcie_link_set_max_link_width(pci, pci->num_lanes); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pci/controller/dwc/pcie-kirin.c +++ linux-aws-6.5-6.5.0/drivers/pci/controller/dwc/pcie-kirin.c @@ -742,7 +742,7 @@ return ret; } -static int __exit kirin_pcie_remove(struct platform_device *pdev) +static int kirin_pcie_remove(struct platform_device *pdev) { struct kirin_pcie *kirin_pcie = platform_get_drvdata(pdev); @@ -819,7 +819,7 @@ static struct platform_driver kirin_pcie_driver = { .probe = kirin_pcie_probe, - .remove = __exit_p(kirin_pcie_remove), + .remove = kirin_pcie_remove, .driver = { .name = "kirin-pcie", .of_match_table = kirin_pcie_match, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pci/controller/pci-mvebu.c +++ linux-aws-6.5-6.5.0/drivers/pci/controller/pci-mvebu.c @@ -265,7 +265,7 @@ */ lnkcap = mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_LNKCAP); lnkcap &= ~PCI_EXP_LNKCAP_MLW; - lnkcap |= (port->is_x4 ? 4 : 1) << 4; + lnkcap |= FIELD_PREP(PCI_EXP_LNKCAP_MLW, port->is_x4 ? 4 : 1); mvebu_writel(port, lnkcap, PCIE_CAP_PCIEXP + PCI_EXP_LNKCAP); /* Disable Root Bridge I/O space, memory space and bus mastering. */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pci/endpoint/pci-epc-core.c +++ linux-aws-6.5-6.5.0/drivers/pci/endpoint/pci-epc-core.c @@ -870,7 +870,6 @@ put_dev: put_device(&epc->dev); - kfree(epc); err_ret: return ERR_PTR(ret); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pci/pci-acpi.c +++ linux-aws-6.5-6.5.0/drivers/pci/pci-acpi.c @@ -911,7 +911,7 @@ { int acpi_state, d_max; - if (pdev->no_d3cold) + if (pdev->no_d3cold || !pdev->d3cold_allowed) d_max = ACPI_STATE_D3_HOT; else d_max = ACPI_STATE_D3_COLD; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pci/pci-sysfs.c +++ linux-aws-6.5-6.5.0/drivers/pci/pci-sysfs.c @@ -12,7 +12,7 @@ * Modeled after usb's driverfs.c */ - +#include #include #include #include @@ -230,8 +230,7 @@ if (err) return -EINVAL; - return sysfs_emit(buf, "%u\n", - (linkstat & PCI_EXP_LNKSTA_NLW) >> PCI_EXP_LNKSTA_NLW_SHIFT); + return sysfs_emit(buf, "%u\n", FIELD_GET(PCI_EXP_LNKSTA_NLW, linkstat)); } static DEVICE_ATTR_RO(current_link_width); @@ -530,10 +529,7 @@ return -EINVAL; pdev->d3cold_allowed = !!val; - if (pdev->d3cold_allowed) - pci_d3cold_enable(pdev); - else - pci_d3cold_disable(pdev); + pci_bridge_d3_update(pdev); pm_runtime_resume(dev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pcmcia/cs.c +++ linux-aws-6.5-6.5.0/drivers/pcmcia/cs.c @@ -605,6 +605,7 @@ dev_warn(&skt->dev, "PCMCIA: unable to register socket\n"); skt->thread = NULL; complete(&skt->thread_done); + put_device(&skt->dev); return 0; } ret = pccard_sysfs_add_socket(&skt->dev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pcmcia/ds.c +++ linux-aws-6.5-6.5.0/drivers/pcmcia/ds.c @@ -513,9 +513,6 @@ /* by default don't allow DMA */ p_dev->dma_mask = 0; p_dev->dev.dma_mask = &p_dev->dma_mask; - dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no); - if (!dev_name(&p_dev->dev)) - goto err_free; p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev)); if (!p_dev->devname) goto err_free; @@ -573,8 +570,15 @@ pcmcia_device_query(p_dev); - if (device_register(&p_dev->dev)) - goto err_unreg; + dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no); + if (device_register(&p_dev->dev)) { + mutex_lock(&s->ops_mutex); + list_del(&p_dev->socket_device_list); + s->device_count--; + mutex_unlock(&s->ops_mutex); + put_device(&p_dev->dev); + return NULL; + } return p_dev; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/perf/arm_cspmu/arm_cspmu.c +++ linux-aws-6.5-6.5.0/drivers/perf/arm_cspmu/arm_cspmu.c @@ -635,6 +635,9 @@ cspmu = to_arm_cspmu(event->pmu); + if (event->attr.type != event->pmu->type) + return -ENOENT; + /* * Following other "uncore" PMUs, we do not support sampling mode or * attach to a task (per-process mode). only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/perf/arm_pmuv3.c +++ linux-aws-6.5-6.5.0/drivers/perf/arm_pmuv3.c @@ -428,12 +428,12 @@ #define ARMV8_IDX_TO_COUNTER(x) \ (((x) - ARMV8_IDX_COUNTER0) & ARMV8_PMU_COUNTER_MASK) -static inline u32 armv8pmu_pmcr_read(void) +static inline u64 armv8pmu_pmcr_read(void) { return read_pmcr(); } -static inline void armv8pmu_pmcr_write(u32 val) +static inline void armv8pmu_pmcr_write(u64 val) { val &= ARMV8_PMU_PMCR_MASK; isb(); @@ -978,7 +978,7 @@ static void armv8pmu_reset(void *info) { struct arm_pmu *cpu_pmu = (struct arm_pmu *)info; - u32 pmcr; + u64 pmcr; /* The counter and interrupt enable registers are unknown at reset. */ armv8pmu_disable_counter(U32_MAX); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/perf/hisilicon/hisi_pcie_pmu.c +++ linux-aws-6.5-6.5.0/drivers/perf/hisilicon/hisi_pcie_pmu.c @@ -353,6 +353,10 @@ struct hisi_pcie_pmu *pcie_pmu = to_pcie_pmu(event->pmu); struct hw_perf_event *hwc = &event->hw; + /* Check the type first before going on, otherwise it's not our event */ + if (event->attr.type != event->pmu->type) + return -ENOENT; + event->cpu = pcie_pmu->on_cpu; if (EXT_COUNTER_IS_USED(hisi_pcie_get_event(event))) @@ -360,9 +364,6 @@ else hwc->event_base = HISI_PCIE_CNT; - if (event->attr.type != event->pmu->type) - return -ENOENT; - /* Sampling is not supported. */ if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK) return -EOPNOTSUPP; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c +++ linux-aws-6.5-6.5.0/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c @@ -505,8 +505,8 @@ ret = perf_pmu_register(&pa_pmu->pmu, name, -1); if (ret) { dev_err(pa_pmu->dev, "PMU register failed, ret = %d\n", ret); - cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_HISI_PA_ONLINE, - &pa_pmu->node); + cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_PA_ONLINE, + &pa_pmu->node); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c +++ linux-aws-6.5-6.5.0/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c @@ -450,8 +450,8 @@ ret = perf_pmu_register(&sllc_pmu->pmu, name, -1); if (ret) { dev_err(sllc_pmu->dev, "PMU register failed, ret = %d\n", ret); - cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_HISI_SLLC_ONLINE, - &sllc_pmu->node); + cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_SLLC_ONLINE, + &sllc_pmu->node); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/perf/hisilicon/hns3_pmu.c +++ linux-aws-6.5-6.5.0/drivers/perf/hisilicon/hns3_pmu.c @@ -1556,8 +1556,8 @@ ret = perf_pmu_register(&hns3_pmu->pmu, hns3_pmu->pmu.name, -1); if (ret) { pci_err(pdev, "failed to register perf PMU, ret = %d.\n", ret); - cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE, - &hns3_pmu->node); + cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE, + &hns3_pmu->node); } return ret; @@ -1568,8 +1568,8 @@ struct hns3_pmu *hns3_pmu = pci_get_drvdata(pdev); perf_pmu_unregister(&hns3_pmu->pmu); - cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE, - &hns3_pmu->node); + cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE, + &hns3_pmu->node); } static int hns3_pmu_init_dev(struct pci_dev *pdev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/perf/riscv_pmu_sbi.c +++ linux-aws-6.5-6.5.0/drivers/perf/riscv_pmu_sbi.c @@ -629,6 +629,11 @@ /* Firmware counter don't support overflow yet */ fidx = find_first_bit(cpu_hw_evt->used_hw_ctrs, RISCV_MAX_COUNTERS); + if (fidx == RISCV_MAX_COUNTERS) { + csr_clear(CSR_SIP, BIT(riscv_pmu_irq_num)); + return IRQ_NONE; + } + event = cpu_hw_evt->events[fidx]; if (!event) { csr_clear(CSR_SIP, BIT(riscv_pmu_irq_num)); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/phy/motorola/phy-mapphone-mdm6600.c +++ linux-aws-6.5-6.5.0/drivers/phy/motorola/phy-mapphone-mdm6600.c @@ -122,16 +122,10 @@ { struct phy_mdm6600 *ddata = phy_get_drvdata(x); struct gpio_desc *enable_gpio = ddata->ctrl_gpios[PHY_MDM6600_ENABLE]; - int error; if (!ddata->enabled) return -ENODEV; - error = pinctrl_pm_select_default_state(ddata->dev); - if (error) - dev_warn(ddata->dev, "%s: error with default_state: %i\n", - __func__, error); - gpiod_set_value_cansleep(enable_gpio, 1); /* Allow aggressive PM for USB, it's only needed for n_gsm port */ @@ -160,11 +154,6 @@ gpiod_set_value_cansleep(enable_gpio, 0); - error = pinctrl_pm_select_sleep_state(ddata->dev); - if (error) - dev_warn(ddata->dev, "%s: error with sleep_state: %i\n", - __func__, error); - return 0; } @@ -456,6 +445,7 @@ { struct gpio_desc *reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET]; + int error; ddata->enabled = false; phy_mdm6600_cmd(ddata, PHY_MDM6600_CMD_BP_SHUTDOWN_REQ); @@ -471,6 +461,17 @@ } else { dev_err(ddata->dev, "Timed out powering down\n"); } + + /* + * Keep reset gpio high with padconf internal pull-up resistor to + * prevent modem from waking up during deeper SoC idle states. The + * gpio bank lines can have glitches if not in the always-on wkup + * domain. + */ + error = pinctrl_pm_select_sleep_state(ddata->dev); + if (error) + dev_warn(ddata->dev, "%s: error with sleep_state: %i\n", + __func__, error); } static void phy_mdm6600_deferred_power_on(struct work_struct *work) @@ -571,12 +572,6 @@ ddata->dev = &pdev->dev; platform_set_drvdata(pdev, ddata); - /* Active state selected in phy_mdm6600_power_on() */ - error = pinctrl_pm_select_sleep_state(ddata->dev); - if (error) - dev_warn(ddata->dev, "%s: error with sleep_state: %i\n", - __func__, error); - error = phy_mdm6600_init_lines(ddata); if (error) return error; @@ -627,10 +622,12 @@ pm_runtime_put_autosuspend(ddata->dev); cleanup: - if (error < 0) + if (error < 0) { phy_mdm6600_device_power_off(ddata); - pm_runtime_disable(ddata->dev); - pm_runtime_dont_use_autosuspend(ddata->dev); + pm_runtime_disable(ddata->dev); + pm_runtime_dont_use_autosuspend(ddata->dev); + } + return error; } @@ -639,6 +636,7 @@ struct phy_mdm6600 *ddata = platform_get_drvdata(pdev); struct gpio_desc *reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET]; + pm_runtime_get_noresume(ddata->dev); pm_runtime_dont_use_autosuspend(ddata->dev); pm_runtime_put_sync(ddata->dev); pm_runtime_disable(ddata->dev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c +++ linux-aws-6.5-6.5.0/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c @@ -25,23 +25,73 @@ #define EUSB2_FORCE_VAL_5 0xeD #define V_CLK_19P2M_EN BIT(6) +#define EUSB2_TUNE_USB2_CROSSOVER 0x50 #define EUSB2_TUNE_IUSB2 0x51 +#define EUSB2_TUNE_RES_FSDIF 0x52 +#define EUSB2_TUNE_HSDISC 0x53 #define EUSB2_TUNE_SQUELCH_U 0x54 +#define EUSB2_TUNE_USB2_SLEW 0x55 +#define EUSB2_TUNE_USB2_EQU 0x56 #define EUSB2_TUNE_USB2_PREEM 0x57 +#define EUSB2_TUNE_USB2_HS_COMP_CUR 0x58 +#define EUSB2_TUNE_EUSB_SLEW 0x59 +#define EUSB2_TUNE_EUSB_EQU 0x5A +#define EUSB2_TUNE_EUSB_HS_COMP_CUR 0x5B -#define QCOM_EUSB2_REPEATER_INIT_CFG(o, v) \ +#define QCOM_EUSB2_REPEATER_INIT_CFG(r, v) \ { \ - .offset = o, \ + .reg = r, \ .val = v, \ } -struct eusb2_repeater_init_tbl { - unsigned int offset; - unsigned int val; +enum reg_fields { + F_TUNE_EUSB_HS_COMP_CUR, + F_TUNE_EUSB_EQU, + F_TUNE_EUSB_SLEW, + F_TUNE_USB2_HS_COMP_CUR, + F_TUNE_USB2_PREEM, + F_TUNE_USB2_EQU, + F_TUNE_USB2_SLEW, + F_TUNE_SQUELCH_U, + F_TUNE_HSDISC, + F_TUNE_RES_FSDIF, + F_TUNE_IUSB2, + F_TUNE_USB2_CROSSOVER, + F_NUM_TUNE_FIELDS, + + F_FORCE_VAL_5 = F_NUM_TUNE_FIELDS, + F_FORCE_EN_5, + + F_EN_CTL1, + + F_RPTR_STATUS, + F_NUM_FIELDS, +}; + +static struct reg_field eusb2_repeater_tune_reg_fields[F_NUM_FIELDS] = { + [F_TUNE_EUSB_HS_COMP_CUR] = REG_FIELD(EUSB2_TUNE_EUSB_HS_COMP_CUR, 0, 1), + [F_TUNE_EUSB_EQU] = REG_FIELD(EUSB2_TUNE_EUSB_EQU, 0, 1), + [F_TUNE_EUSB_SLEW] = REG_FIELD(EUSB2_TUNE_EUSB_SLEW, 0, 1), + [F_TUNE_USB2_HS_COMP_CUR] = REG_FIELD(EUSB2_TUNE_USB2_HS_COMP_CUR, 0, 1), + [F_TUNE_USB2_PREEM] = REG_FIELD(EUSB2_TUNE_USB2_PREEM, 0, 2), + [F_TUNE_USB2_EQU] = REG_FIELD(EUSB2_TUNE_USB2_EQU, 0, 1), + [F_TUNE_USB2_SLEW] = REG_FIELD(EUSB2_TUNE_USB2_SLEW, 0, 1), + [F_TUNE_SQUELCH_U] = REG_FIELD(EUSB2_TUNE_SQUELCH_U, 0, 2), + [F_TUNE_HSDISC] = REG_FIELD(EUSB2_TUNE_HSDISC, 0, 2), + [F_TUNE_RES_FSDIF] = REG_FIELD(EUSB2_TUNE_RES_FSDIF, 0, 2), + [F_TUNE_IUSB2] = REG_FIELD(EUSB2_TUNE_IUSB2, 0, 3), + [F_TUNE_USB2_CROSSOVER] = REG_FIELD(EUSB2_TUNE_USB2_CROSSOVER, 0, 2), + + [F_FORCE_VAL_5] = REG_FIELD(EUSB2_FORCE_VAL_5, 0, 7), + [F_FORCE_EN_5] = REG_FIELD(EUSB2_FORCE_EN_5, 0, 7), + + [F_EN_CTL1] = REG_FIELD(EUSB2_EN_CTL1, 0, 7), + + [F_RPTR_STATUS] = REG_FIELD(EUSB2_RPTR_STATUS, 0, 7), }; struct eusb2_repeater_cfg { - const struct eusb2_repeater_init_tbl *init_tbl; + const u32 *init_tbl; int init_tbl_num; const char * const *vreg_list; int num_vregs; @@ -49,11 +99,10 @@ struct eusb2_repeater { struct device *dev; - struct regmap *regmap; + struct regmap_field *regs[F_NUM_FIELDS]; struct phy *phy; struct regulator_bulk_data *vregs; const struct eusb2_repeater_cfg *cfg; - u16 base; enum phy_mode mode; }; @@ -61,10 +110,10 @@ "vdd18", "vdd3", }; -static const struct eusb2_repeater_init_tbl pm8550b_init_tbl[] = { - QCOM_EUSB2_REPEATER_INIT_CFG(EUSB2_TUNE_IUSB2, 0x8), - QCOM_EUSB2_REPEATER_INIT_CFG(EUSB2_TUNE_SQUELCH_U, 0x3), - QCOM_EUSB2_REPEATER_INIT_CFG(EUSB2_TUNE_USB2_PREEM, 0x5), +static const u32 pm8550b_init_tbl[F_NUM_TUNE_FIELDS] = { + [F_TUNE_IUSB2] = 0x8, + [F_TUNE_SQUELCH_U] = 0x3, + [F_TUNE_USB2_PREEM] = 0x5, }; static const struct eusb2_repeater_cfg pm8550b_eusb2_cfg = { @@ -92,9 +141,9 @@ static int eusb2_repeater_init(struct phy *phy) { + struct reg_field *regfields = eusb2_repeater_tune_reg_fields; struct eusb2_repeater *rptr = phy_get_drvdata(phy); - const struct eusb2_repeater_init_tbl *init_tbl = rptr->cfg->init_tbl; - int num = rptr->cfg->init_tbl_num; + const u32 *init_tbl = rptr->cfg->init_tbl; u32 val; int ret; int i; @@ -103,17 +152,21 @@ if (ret) return ret; - regmap_update_bits(rptr->regmap, rptr->base + EUSB2_EN_CTL1, - EUSB2_RPTR_EN, EUSB2_RPTR_EN); + regmap_field_update_bits(rptr->regs[F_EN_CTL1], EUSB2_RPTR_EN, EUSB2_RPTR_EN); - for (i = 0; i < num; i++) - regmap_update_bits(rptr->regmap, - rptr->base + init_tbl[i].offset, - init_tbl[i].val, init_tbl[i].val); - - ret = regmap_read_poll_timeout(rptr->regmap, - rptr->base + EUSB2_RPTR_STATUS, val, - val & RPTR_OK, 10, 5); + for (i = 0; i < F_NUM_TUNE_FIELDS; i++) { + if (init_tbl[i]) { + regmap_field_update_bits(rptr->regs[i], init_tbl[i], init_tbl[i]); + } else { + /* Write 0 if there's no value set */ + u32 mask = GENMASK(regfields[i].msb, regfields[i].lsb); + + regmap_field_update_bits(rptr->regs[i], mask, 0); + } + } + + ret = regmap_field_read_poll_timeout(rptr->regs[F_RPTR_STATUS], + val, val & RPTR_OK, 10, 5); if (ret) dev_err(rptr->dev, "initialization timed-out\n"); @@ -132,10 +185,10 @@ * per eUSB 1.2 Spec. Below implement software workaround until * PHY and controller is fixing seen observation. */ - regmap_update_bits(rptr->regmap, rptr->base + EUSB2_FORCE_EN_5, - F_CLK_19P2M_EN, F_CLK_19P2M_EN); - regmap_update_bits(rptr->regmap, rptr->base + EUSB2_FORCE_VAL_5, - V_CLK_19P2M_EN, V_CLK_19P2M_EN); + regmap_field_update_bits(rptr->regs[F_FORCE_EN_5], + F_CLK_19P2M_EN, F_CLK_19P2M_EN); + regmap_field_update_bits(rptr->regs[F_FORCE_VAL_5], + V_CLK_19P2M_EN, V_CLK_19P2M_EN); break; case PHY_MODE_USB_DEVICE: /* @@ -144,10 +197,10 @@ * repeater doesn't clear previous value due to shared * regulators (say host <-> device mode switch). */ - regmap_update_bits(rptr->regmap, rptr->base + EUSB2_FORCE_EN_5, - F_CLK_19P2M_EN, 0); - regmap_update_bits(rptr->regmap, rptr->base + EUSB2_FORCE_VAL_5, - V_CLK_19P2M_EN, 0); + regmap_field_update_bits(rptr->regs[F_FORCE_EN_5], + F_CLK_19P2M_EN, 0); + regmap_field_update_bits(rptr->regs[F_FORCE_VAL_5], + V_CLK_19P2M_EN, 0); break; default: return -EINVAL; @@ -176,8 +229,9 @@ struct device *dev = &pdev->dev; struct phy_provider *phy_provider; struct device_node *np = dev->of_node; + struct regmap *regmap; + int i, ret; u32 res; - int ret; rptr = devm_kzalloc(dev, sizeof(*rptr), GFP_KERNEL); if (!rptr) @@ -190,15 +244,22 @@ if (!rptr->cfg) return -EINVAL; - rptr->regmap = dev_get_regmap(dev->parent, NULL); - if (!rptr->regmap) + regmap = dev_get_regmap(dev->parent, NULL); + if (!regmap) return -ENODEV; ret = of_property_read_u32(np, "reg", &res); if (ret < 0) return ret; - rptr->base = res; + for (i = 0; i < F_NUM_FIELDS; i++) + eusb2_repeater_tune_reg_fields[i].reg += res; + + ret = devm_regmap_field_bulk_alloc(dev, regmap, rptr->regs, + eusb2_repeater_tune_reg_fields, + F_NUM_FIELDS); + if (ret) + return ret; ret = eusb2_repeater_init_vregs(rptr); if (ret < 0) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ linux-aws-6.5-6.5.0/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -772,10 +772,10 @@ QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_PCS_TX_RX_CONFIG, 0x0c), QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG1, 0x4b), QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG5, 0x10), - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68), }; static const struct qmp_phy_init_tbl sm8550_usb3_pcs_usb_tbl[] = { + QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68), QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L, 0x40), @@ -2649,6 +2649,7 @@ void __iomem *tx2 = qmp->tx2; void __iomem *rx2 = qmp->rx2; void __iomem *pcs = qmp->pcs; + void __iomem *pcs_usb = qmp->pcs_usb; void __iomem *status; unsigned int val; int ret; @@ -2670,6 +2671,9 @@ qmp_combo_configure(pcs, cfg->pcs_tbl, cfg->pcs_tbl_num); + if (pcs_usb) + qmp_combo_configure(pcs_usb, cfg->pcs_usb_tbl, cfg->pcs_usb_tbl_num); + if (cfg->has_pwrdn_delay) usleep_range(10, 20); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h +++ linux-aws-6.5-6.5.0/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h @@ -12,7 +12,7 @@ #define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG3 0xcc #define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG6 0xd8 #define QPHY_USB_V6_PCS_REFGEN_REQ_CONFIG1 0xdc -#define QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1 0x90 +#define QPHY_USB_V6_PCS_POWER_STATE_CONFIG1 0x90 #define QPHY_USB_V6_PCS_RX_SIGDET_LVL 0x188 #define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_L 0x190 #define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_H 0x194 @@ -23,6 +23,7 @@ #define QPHY_USB_V6_PCS_EQ_CONFIG1 0x1dc #define QPHY_USB_V6_PCS_EQ_CONFIG5 0x1ec +#define QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1 0x00 #define QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL 0x18 #define QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 0x3c #define QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L 0x40 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/phy/qualcomm/phy-qcom-qmp-usb.c +++ linux-aws-6.5-6.5.0/drivers/phy/qualcomm/phy-qcom-qmp-usb.c @@ -1480,8 +1480,6 @@ QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03), QMP_PHY_INIT_CFG(QPHY_V5_PCS_RX_SIGDET_LVL, 0xaa), QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCS_TX_RX_CONFIG, 0x0c), - QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), - QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), QMP_PHY_INIT_CFG(QPHY_V5_PCS_CDR_RESET_TIME, 0x0a), QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG1, 0x88), QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13), @@ -1490,6 +1488,11 @@ QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21), }; +static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_usb_tbl[] = { + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), +}; + static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG1, 0xc4), QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG2, 0x89), @@ -1499,9 +1502,6 @@ QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03), QMP_PHY_INIT_CFG(QPHY_V5_PCS_RX_SIGDET_LVL, 0xaa), QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCS_TX_RX_CONFIG, 0x0c), - QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), - QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), - QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1, 0x6f), QMP_PHY_INIT_CFG(QPHY_V5_PCS_CDR_RESET_TIME, 0x0a), QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG1, 0x88), QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13), @@ -1510,6 +1510,12 @@ QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21), }; +static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_usb_tbl[] = { + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1, 0x6f), +}; + struct qmp_usb_offsets { u16 serdes; u16 pcs; @@ -1788,6 +1794,8 @@ .rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl), .pcs_tbl = sa8775p_usb3_uniphy_pcs_tbl, .pcs_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_tbl), + .pcs_usb_tbl = sa8775p_usb3_uniphy_pcs_usb_tbl, + .pcs_usb_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_usb_tbl), .clk_list = qmp_v4_phy_clk_l, .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), .reset_list = qcm2290_usb3phy_reset_l, @@ -1833,6 +1841,8 @@ .rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl), .pcs_tbl = sc8280xp_usb3_uniphy_pcs_tbl, .pcs_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_tbl), + .pcs_usb_tbl = sc8280xp_usb3_uniphy_pcs_usb_tbl, + .pcs_usb_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_usb_tbl), .clk_list = qmp_v4_phy_clk_l, .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), .reset_list = qcm2290_usb3phy_reset_l, @@ -2233,6 +2243,7 @@ void __iomem *tx = qmp->tx; void __iomem *rx = qmp->rx; void __iomem *pcs = qmp->pcs; + void __iomem *pcs_usb = qmp->pcs_usb; void __iomem *status; unsigned int val; int ret; @@ -2256,6 +2267,9 @@ qmp_usb_configure(pcs, cfg->pcs_tbl, cfg->pcs_tbl_num); + if (pcs_usb) + qmp_usb_configure(pcs_usb, cfg->pcs_usb_tbl, cfg->pcs_usb_tbl_num); + if (cfg->has_pwrdn_delay) usleep_range(10, 20); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pinctrl/core.c +++ linux-aws-6.5-6.5.0/drivers/pinctrl/core.c @@ -1243,17 +1243,17 @@ static int pinctrl_commit_state(struct pinctrl *p, struct pinctrl_state *state) { struct pinctrl_setting *setting, *setting2; - struct pinctrl_state *old_state = p->state; + struct pinctrl_state *old_state = READ_ONCE(p->state); int ret; - if (p->state) { + if (old_state) { /* * For each pinmux setting in the old state, forget SW's record * of mux owner for that pingroup. Any pingroups which are * still owned by the new state will be re-acquired by the call * to pinmux_enable_setting() in the loop below. */ - list_for_each_entry(setting, &p->state->settings, node) { + list_for_each_entry(setting, &old_state->settings, node) { if (setting->type != PIN_MAP_TYPE_MUX_GROUP) continue; pinmux_disable_setting(setting); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +++ linux-aws-6.5-6.5.0/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c @@ -31,7 +31,8 @@ char __iomem *tlmm_base; char __iomem *slew_base; struct clk_bulk_data clks[MAX_LPI_NUM_CLKS]; - struct mutex slew_access_lock; + /* Protects from concurrent register updates */ + struct mutex lock; DECLARE_BITMAP(ever_gpio, MAX_NR_GPIO); const struct lpi_pinctrl_variant_data *data; }; @@ -102,6 +103,7 @@ if (WARN_ON(i == g->nfuncs)) return -EINVAL; + mutex_lock(&pctrl->lock); val = lpi_gpio_read(pctrl, pin, LPI_GPIO_CFG_REG); /* @@ -127,6 +129,7 @@ u32p_replace_bits(&val, i, LPI_GPIO_FUNCTION_MASK); lpi_gpio_write(pctrl, pin, LPI_GPIO_CFG_REG, val); + mutex_unlock(&pctrl->lock); return 0; } @@ -232,14 +235,14 @@ if (slew_offset == LPI_NO_SLEW) break; - mutex_lock(&pctrl->slew_access_lock); + mutex_lock(&pctrl->lock); sval = ioread32(pctrl->slew_base + LPI_SLEW_RATE_CTL_REG); sval &= ~(LPI_SLEW_RATE_MASK << slew_offset); sval |= arg << slew_offset; iowrite32(sval, pctrl->slew_base + LPI_SLEW_RATE_CTL_REG); - mutex_unlock(&pctrl->slew_access_lock); + mutex_unlock(&pctrl->lock); break; default: return -EINVAL; @@ -255,6 +258,7 @@ lpi_gpio_write(pctrl, group, LPI_GPIO_VALUE_REG, val); } + mutex_lock(&pctrl->lock); val = lpi_gpio_read(pctrl, group, LPI_GPIO_CFG_REG); u32p_replace_bits(&val, pullup, LPI_GPIO_PULL_MASK); @@ -263,6 +267,7 @@ u32p_replace_bits(&val, output_enabled, LPI_GPIO_OE_MASK); lpi_gpio_write(pctrl, group, LPI_GPIO_CFG_REG, val); + mutex_unlock(&pctrl->lock); return 0; } @@ -464,7 +469,7 @@ pctrl->chip.label = dev_name(dev); pctrl->chip.can_sleep = false; - mutex_init(&pctrl->slew_access_lock); + mutex_init(&pctrl->lock); pctrl->ctrl = devm_pinctrl_register(dev, &pctrl->desc, pctrl); if (IS_ERR(pctrl->ctrl)) { @@ -486,7 +491,7 @@ return 0; err_pinctrl: - mutex_destroy(&pctrl->slew_access_lock); + mutex_destroy(&pctrl->lock); clk_bulk_disable_unprepare(MAX_LPI_NUM_CLKS, pctrl->clks); return ret; @@ -498,7 +503,7 @@ struct lpi_pinctrl *pctrl = platform_get_drvdata(pdev); int i; - mutex_destroy(&pctrl->slew_access_lock); + mutex_destroy(&pctrl->lock); clk_bulk_disable_unprepare(MAX_LPI_NUM_CLKS, pctrl->clks); for (i = 0; i < pctrl->data->npins; i++) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ linux-aws-6.5-6.5.0/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -1175,6 +1175,8 @@ u32 port; u8 bit; + irq_chip_disable_parent(d); + port = RZG2L_PIN_ID_TO_PORT(hwirq); bit = RZG2L_PIN_ID_TO_PIN(hwirq); @@ -1189,7 +1191,6 @@ spin_unlock_irqrestore(&pctrl->lock, flags); gpiochip_disable_irq(gc, hwirq); - irq_chip_disable_parent(d); } static void rzg2l_gpio_irq_enable(struct irq_data *d) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/chrome/cros_ec.c +++ linux-aws-6.5-6.5.0/drivers/platform/chrome/cros_ec.c @@ -320,17 +320,8 @@ EXPORT_SYMBOL(cros_ec_unregister); #ifdef CONFIG_PM_SLEEP -/** - * cros_ec_suspend() - Handle a suspend operation for the ChromeOS EC device. - * @ec_dev: Device to suspend. - * - * This can be called by drivers to handle a suspend event. - * - * Return: 0 on success or negative error code. - */ -int cros_ec_suspend(struct cros_ec_device *ec_dev) +static void cros_ec_send_suspend_event(struct cros_ec_device *ec_dev) { - struct device *dev = ec_dev->dev; int ret; u8 sleep_event; @@ -342,7 +333,26 @@ if (ret < 0) dev_dbg(ec_dev->dev, "Error %d sending suspend event to ec\n", ret); +} +/** + * cros_ec_suspend_prepare() - Handle a suspend prepare operation for the ChromeOS EC device. + * @ec_dev: Device to suspend. + * + * This can be called by drivers to handle a suspend prepare stage of suspend. + * + * Return: 0 always. + */ +int cros_ec_suspend_prepare(struct cros_ec_device *ec_dev) +{ + cros_ec_send_suspend_event(ec_dev); + return 0; +} +EXPORT_SYMBOL(cros_ec_suspend_prepare); + +static void cros_ec_disable_irq(struct cros_ec_device *ec_dev) +{ + struct device *dev = ec_dev->dev; if (device_may_wakeup(dev)) ec_dev->wake_enabled = !enable_irq_wake(ec_dev->irq); else @@ -350,7 +360,35 @@ disable_irq(ec_dev->irq); ec_dev->suspended = true; +} + +/** + * cros_ec_suspend_late() - Handle a suspend late operation for the ChromeOS EC device. + * @ec_dev: Device to suspend. + * + * This can be called by drivers to handle a suspend late stage of suspend. + * + * Return: 0 always. + */ +int cros_ec_suspend_late(struct cros_ec_device *ec_dev) +{ + cros_ec_disable_irq(ec_dev); + return 0; +} +EXPORT_SYMBOL(cros_ec_suspend_late); +/** + * cros_ec_suspend() - Handle a suspend operation for the ChromeOS EC device. + * @ec_dev: Device to suspend. + * + * This can be called by drivers to handle a suspend event. + * + * Return: 0 always. + */ +int cros_ec_suspend(struct cros_ec_device *ec_dev) +{ + cros_ec_send_suspend_event(ec_dev); + cros_ec_disable_irq(ec_dev); return 0; } EXPORT_SYMBOL(cros_ec_suspend); @@ -369,22 +407,11 @@ } } -/** - * cros_ec_resume() - Handle a resume operation for the ChromeOS EC device. - * @ec_dev: Device to resume. - * - * This can be called by drivers to handle a resume event. - * - * Return: 0 on success or negative error code. - */ -int cros_ec_resume(struct cros_ec_device *ec_dev) +static void cros_ec_send_resume_event(struct cros_ec_device *ec_dev) { int ret; u8 sleep_event; - ec_dev->suspended = false; - enable_irq(ec_dev->irq); - sleep_event = (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) ? HOST_SLEEP_EVENT_S3_RESUME : HOST_SLEEP_EVENT_S0IX_RESUME; @@ -393,6 +420,24 @@ if (ret < 0) dev_dbg(ec_dev->dev, "Error %d sending resume event to ec\n", ret); +} + +/** + * cros_ec_resume_complete() - Handle a resume complete operation for the ChromeOS EC device. + * @ec_dev: Device to resume. + * + * This can be called by drivers to handle a resume complete stage of resume. + */ +void cros_ec_resume_complete(struct cros_ec_device *ec_dev) +{ + cros_ec_send_resume_event(ec_dev); +} +EXPORT_SYMBOL(cros_ec_resume_complete); + +static void cros_ec_enable_irq(struct cros_ec_device *ec_dev) +{ + ec_dev->suspended = false; + enable_irq(ec_dev->irq); if (ec_dev->wake_enabled) disable_irq_wake(ec_dev->irq); @@ -402,8 +447,35 @@ * suspend. This way the clients know what to do with them. */ cros_ec_report_events_during_suspend(ec_dev); +} +/** + * cros_ec_resume_early() - Handle a resume early operation for the ChromeOS EC device. + * @ec_dev: Device to resume. + * + * This can be called by drivers to handle a resume early stage of resume. + * + * Return: 0 always. + */ +int cros_ec_resume_early(struct cros_ec_device *ec_dev) +{ + cros_ec_enable_irq(ec_dev); + return 0; +} +EXPORT_SYMBOL(cros_ec_resume_early); +/** + * cros_ec_resume() - Handle a resume operation for the ChromeOS EC device. + * @ec_dev: Device to resume. + * + * This can be called by drivers to handle a resume event. + * + * Return: 0 always. + */ +int cros_ec_resume(struct cros_ec_device *ec_dev) +{ + cros_ec_enable_irq(ec_dev); + cros_ec_send_resume_event(ec_dev); return 0; } EXPORT_SYMBOL(cros_ec_resume); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/chrome/cros_ec.h +++ linux-aws-6.5-6.5.0/drivers/platform/chrome/cros_ec.h @@ -14,7 +14,11 @@ void cros_ec_unregister(struct cros_ec_device *ec_dev); int cros_ec_suspend(struct cros_ec_device *ec_dev); +int cros_ec_suspend_late(struct cros_ec_device *ec_dev); +int cros_ec_suspend_prepare(struct cros_ec_device *ec_dev); int cros_ec_resume(struct cros_ec_device *ec_dev); +int cros_ec_resume_early(struct cros_ec_device *ec_dev); +void cros_ec_resume_complete(struct cros_ec_device *ec_dev); irqreturn_t cros_ec_irq_thread(int irq, void *data); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/chrome/cros_ec_proto_test.c +++ linux-aws-6.5-6.5.0/drivers/platform/chrome/cros_ec_proto_test.c @@ -2668,6 +2668,7 @@ ec_dev->dev->release = cros_ec_proto_test_release; ec_dev->cmd_xfer = cros_kunit_ec_xfer_mock; ec_dev->pkt_xfer = cros_kunit_ec_xfer_mock; + mutex_init(&ec_dev->lock); priv->msg = (struct cros_ec_command *)priv->_msg; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/mellanox/mlxbf-bootctl.c +++ linux-aws-6.5-6.5.0/drivers/platform/mellanox/mlxbf-bootctl.c @@ -19,6 +19,7 @@ #define MLXBF_BOOTCTL_SB_SECURE_MASK 0x03 #define MLXBF_BOOTCTL_SB_TEST_MASK 0x0c +#define MLXBF_BOOTCTL_SB_DEV_MASK BIT(4) #define MLXBF_SB_KEY_NUM 4 @@ -39,11 +40,18 @@ { MLXBF_BOOTCTL_NONE, "none" }, }; +enum { + MLXBF_BOOTCTL_SB_LIFECYCLE_PRODUCTION = 0, + MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE = 1, + MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE = 2, + MLXBF_BOOTCTL_SB_LIFECYCLE_RMA = 3 +}; + static const char * const mlxbf_bootctl_lifecycle_states[] = { - [0] = "Production", - [1] = "GA Secured", - [2] = "GA Non-Secured", - [3] = "RMA", + [MLXBF_BOOTCTL_SB_LIFECYCLE_PRODUCTION] = "Production", + [MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE] = "GA Secured", + [MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE] = "GA Non-Secured", + [MLXBF_BOOTCTL_SB_LIFECYCLE_RMA] = "RMA", }; /* Log header format. */ @@ -200,25 +208,30 @@ static ssize_t lifecycle_state_show(struct device *dev, struct device_attribute *attr, char *buf) { + int status_bits; + int use_dev_key; + int test_state; int lc_state; - lc_state = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS, - MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE); - if (lc_state < 0) - return lc_state; - - lc_state &= - MLXBF_BOOTCTL_SB_TEST_MASK | MLXBF_BOOTCTL_SB_SECURE_MASK; + status_bits = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS, + MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE); + if (status_bits < 0) + return status_bits; + + use_dev_key = status_bits & MLXBF_BOOTCTL_SB_DEV_MASK; + test_state = status_bits & MLXBF_BOOTCTL_SB_TEST_MASK; + lc_state = status_bits & MLXBF_BOOTCTL_SB_SECURE_MASK; /* * If the test bits are set, we specify that the current state may be * due to using the test bits. */ - if (lc_state & MLXBF_BOOTCTL_SB_TEST_MASK) { - lc_state &= MLXBF_BOOTCTL_SB_SECURE_MASK; - + if (test_state) { return sprintf(buf, "%s(test)\n", mlxbf_bootctl_lifecycle_states[lc_state]); + } else if (use_dev_key && + (lc_state == MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE)) { + return sprintf(buf, "Secured (development)\n"); } return sprintf(buf, "%s\n", mlxbf_bootctl_lifecycle_states[lc_state]); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/surface/aggregator/core.c +++ linux-aws-6.5-6.5.0/drivers/platform/surface/aggregator/core.c @@ -231,9 +231,12 @@ size_t n) { struct ssam_controller *ctrl; + int ret; ctrl = serdev_device_get_drvdata(dev); - return ssam_controller_receive_buf(ctrl, buf, n); + ret = ssam_controller_receive_buf(ctrl, buf, n); + + return ret < 0 ? 0 : ret; } static void ssam_write_wakeup(struct serdev_device *dev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/surface/surface_platform_profile.c +++ linux-aws-6.5-6.5.0/drivers/platform/surface/surface_platform_profile.c @@ -159,8 +159,7 @@ set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, tpd->handler.choices); set_bit(PLATFORM_PROFILE_PERFORMANCE, tpd->handler.choices); - platform_profile_register(&tpd->handler); - return 0; + return platform_profile_register(&tpd->handler); } static void surface_platform_profile_remove(struct ssam_device *sdev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/x86/amd/pmc-quirks.c +++ linux-aws-6.5-6.5.0/drivers/platform/x86/amd/pmc-quirks.c @@ -111,6 +111,79 @@ DMI_MATCH(DMI_PRODUCT_NAME, "21A1"), } }, + /* https://bugzilla.kernel.org/show_bug.cgi?id=218024 */ + { + .ident = "V14 G4 AMN", + .driver_data = &quirk_s2idle_bug, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82YT"), + } + }, + { + .ident = "V14 G4 AMN", + .driver_data = &quirk_s2idle_bug, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83GE"), + } + }, + { + .ident = "V15 G4 AMN", + .driver_data = &quirk_s2idle_bug, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82YU"), + } + }, + { + .ident = "V15 G4 AMN", + .driver_data = &quirk_s2idle_bug, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83CQ"), + } + }, + { + .ident = "IdeaPad 1 14AMN7", + .driver_data = &quirk_s2idle_bug, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82VF"), + } + }, + { + .ident = "IdeaPad 1 15AMN7", + .driver_data = &quirk_s2idle_bug, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82VG"), + } + }, + { + .ident = "IdeaPad 1 15AMN7", + .driver_data = &quirk_s2idle_bug, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82X5"), + } + }, + { + .ident = "IdeaPad Slim 3 14AMN8", + .driver_data = &quirk_s2idle_bug, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82XN"), + } + }, + { + .ident = "IdeaPad Slim 3 15AMN8", + .driver_data = &quirk_s2idle_bug, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82XQ"), + } + }, /* https://gitlab.freedesktop.org/drm/amd/-/issues/2684 */ { .ident = "HP Laptop 15s-eq2xxx", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/x86/amd/pmc.c +++ linux-aws-6.5-6.5.0/drivers/platform/x86/amd/pmc.c @@ -912,33 +912,6 @@ { } }; -static int amd_pmc_get_dram_size(struct amd_pmc_dev *dev) -{ - int ret; - - switch (dev->cpu_id) { - case AMD_CPU_ID_YC: - if (!(dev->major > 90 || (dev->major == 90 && dev->minor > 39))) { - ret = -EINVAL; - goto err_dram_size; - } - break; - default: - ret = -EINVAL; - goto err_dram_size; - } - - ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true); - if (ret || !dev->dram_size) - goto err_dram_size; - - return 0; - -err_dram_size: - dev_err(dev->dev, "DRAM size command not supported for this platform\n"); - return ret; -} - static int amd_pmc_s2d_init(struct amd_pmc_dev *dev) { u32 phys_addr_low, phys_addr_hi; @@ -957,8 +930,8 @@ return -EIO; /* Get DRAM size */ - ret = amd_pmc_get_dram_size(dev); - if (ret) + ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true); + if (ret || !dev->dram_size) dev->dram_size = S2D_TELEMETRY_DRAMBYTES_MAX; /* Get STB DRAM address */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/x86/apple-gmux.c +++ linux-aws-6.5-6.5.0/drivers/platform/x86/apple-gmux.c @@ -105,6 +105,8 @@ #define GMUX_BRIGHTNESS_MASK 0x00ffffff #define GMUX_MAX_BRIGHTNESS GMUX_BRIGHTNESS_MASK +# define MMIO_GMUX_MAX_BRIGHTNESS 0xffff + static u8 gmux_pio_read8(struct apple_gmux_data *gmux_data, int port) { return inb(gmux_data->iostart + port); @@ -857,7 +859,17 @@ memset(&props, 0, sizeof(props)); props.type = BACKLIGHT_PLATFORM; - props.max_brightness = gmux_read32(gmux_data, GMUX_PORT_MAX_BRIGHTNESS); + + /* + * All MMIO gmux's have 0xffff as max brightness, but some iMacs incorrectly + * report 0x03ff, despite the firmware being happy to set 0xffff as the brightness + * at boot. Force 0xffff for all MMIO gmux's so they all have the correct brightness + * range. + */ + if (type == APPLE_GMUX_TYPE_MMIO) + props.max_brightness = MMIO_GMUX_MAX_BRIGHTNESS; + else + props.max_brightness = gmux_read32(gmux_data, GMUX_PORT_MAX_BRIGHTNESS); #if IS_REACHABLE(CONFIG_ACPI_VIDEO) register_bdev = acpi_video_get_backlight_type() == acpi_backlight_apple_gmux; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/x86/asus-wmi.c +++ linux-aws-6.5-6.5.0/drivers/platform/x86/asus-wmi.c @@ -3268,7 +3268,6 @@ { unsigned int key_value = 1; bool autorelease = 1; - int orig_code = code; if (asus->driver->key_filter) { asus->driver->key_filter(asus->driver, &code, &key_value, @@ -3277,16 +3276,10 @@ return; } - if (code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNUP_MAX) - code = ASUS_WMI_BRN_UP; - else if (code >= NOTIFY_BRNDOWN_MIN && code <= NOTIFY_BRNDOWN_MAX) - code = ASUS_WMI_BRN_DOWN; - - if (code == ASUS_WMI_BRN_DOWN || code == ASUS_WMI_BRN_UP) { - if (acpi_video_get_backlight_type() == acpi_backlight_vendor) { - asus_wmi_backlight_notify(asus, orig_code); - return; - } + if (acpi_video_get_backlight_type() == acpi_backlight_vendor && + code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNDOWN_MAX) { + asus_wmi_backlight_notify(asus, code); + return; } if (code == NOTIFY_KBD_BRTUP) { @@ -3846,6 +3839,12 @@ goto fail_wmi_handler; } + if (asus->driver->quirks->i8042_filter) { + err = i8042_install_filter(asus->driver->quirks->i8042_filter); + if (err) + pr_warn("Unable to install key filter - %d\n", err); + } + asus_wmi_battery_init(asus); asus_wmi_debugfs_init(asus); @@ -3880,6 +3879,8 @@ struct asus_wmi *asus; asus = platform_get_drvdata(device); + if (asus->driver->quirks->i8042_filter) + i8042_remove_filter(asus->driver->quirks->i8042_filter); wmi_remove_notify_handler(asus->driver->event_guid); asus_wmi_backlight_exit(asus); asus_wmi_input_exit(asus); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/x86/asus-wmi.h +++ linux-aws-6.5-6.5.0/drivers/platform/x86/asus-wmi.h @@ -18,7 +18,7 @@ #include #define ASUS_WMI_KEY_IGNORE (-1) -#define ASUS_WMI_BRN_DOWN 0x20 +#define ASUS_WMI_BRN_DOWN 0x2e #define ASUS_WMI_BRN_UP 0x2f struct module; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +++ linux-aws-6.5-6.5.0/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c @@ -176,7 +176,7 @@ static int create_attr_group(struct uncore_data *data, char *name) { - int ret, index = 0; + int ret, freq, index = 0; init_attribute_rw(max_freq_khz); init_attribute_rw(min_freq_khz); @@ -197,7 +197,11 @@ data->uncore_attrs[index++] = &data->min_freq_khz_dev_attr.attr; data->uncore_attrs[index++] = &data->initial_min_freq_khz_dev_attr.attr; data->uncore_attrs[index++] = &data->initial_max_freq_khz_dev_attr.attr; - data->uncore_attrs[index++] = &data->current_freq_khz_dev_attr.attr; + + ret = uncore_read_freq(data, &freq); + if (!ret) + data->uncore_attrs[index++] = &data->current_freq_khz_dev_attr.attr; + data->uncore_attrs[index] = NULL; data->uncore_attr_group.name = name; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/x86/msi-ec.c +++ linux-aws-6.5-6.5.0/drivers/platform/x86/msi-ec.c @@ -276,14 +276,13 @@ static const char * const ALLOWED_FW_3[] __initconst = { "1592EMS1.111", - "E1592IMS.10C", NULL }; static struct msi_ec_conf CONF3 __initdata = { .allowed_fw = ALLOWED_FW_3, .charge_control = { - .address = 0xef, + .address = 0xd7, .offset_start = 0x8a, .offset_end = 0x80, .range_min = 0x8a, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/x86/thinkpad_acpi.c +++ linux-aws-6.5-6.5.0/drivers/platform/x86/thinkpad_acpi.c @@ -9810,6 +9810,7 @@ * Individual addressing is broken on models that expose the * primary battery as BAT1. */ + TPACPI_Q_LNV('8', 'F', true), /* Thinkpad X120e */ TPACPI_Q_LNV('J', '7', true), /* B5400 */ TPACPI_Q_LNV('J', 'I', true), /* Thinkpad 11e */ TPACPI_Q_LNV3('R', '0', 'B', true), /* Thinkpad 11e gen 3 */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/x86/touchscreen_dmi.c +++ linux-aws-6.5-6.5.0/drivers/platform/x86/touchscreen_dmi.c @@ -42,6 +42,21 @@ .properties = archos_101_cesium_educ_props, }; +static const struct property_entry bush_bush_windows_tablet_props[] = { + PROPERTY_ENTRY_U32("touchscreen-size-x", 1850), + PROPERTY_ENTRY_U32("touchscreen-size-y", 1280), + PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), + PROPERTY_ENTRY_U32("silead,max-fingers", 10), + PROPERTY_ENTRY_BOOL("silead,home-button"), + PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-bush-bush-windows-tablet.fw"), + { } +}; + +static const struct ts_dmi_data bush_bush_windows_tablet_data = { + .acpi_name = "MSSL1680:00", + .properties = bush_bush_windows_tablet_props, +}; + static const struct property_entry chuwi_hi8_props[] = { PROPERTY_ENTRY_U32("touchscreen-size-x", 1665), PROPERTY_ENTRY_U32("touchscreen-size-y", 1140), @@ -756,6 +771,21 @@ .properties = pipo_w11_props, }; +static const struct property_entry positivo_c4128b_props[] = { + PROPERTY_ENTRY_U32("touchscreen-min-x", 4), + PROPERTY_ENTRY_U32("touchscreen-min-y", 13), + PROPERTY_ENTRY_U32("touchscreen-size-x", 1915), + PROPERTY_ENTRY_U32("touchscreen-size-y", 1269), + PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-positivo-c4128b.fw"), + PROPERTY_ENTRY_U32("silead,max-fingers", 10), + { } +}; + +static const struct ts_dmi_data positivo_c4128b_data = { + .acpi_name = "MSSL1680:00", + .properties = positivo_c4128b_props, +}; + static const struct property_entry pov_mobii_wintab_p800w_v20_props[] = { PROPERTY_ENTRY_U32("touchscreen-min-x", 32), PROPERTY_ENTRY_U32("touchscreen-min-y", 16), @@ -1071,6 +1101,13 @@ }, }, { + /* Bush Windows tablet */ + .driver_data = (void *)&bush_bush_windows_tablet_data, + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "Bush Windows tablet"), + }, + }, + { /* Chuwi Hi8 */ .driver_data = (void *)&chuwi_hi8_data, .matches = { @@ -1481,6 +1518,14 @@ }, }, { + /* Positivo C4128B */ + .driver_data = (void *)&positivo_c4128b_data, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Positivo Tecnologia SA"), + DMI_MATCH(DMI_PRODUCT_NAME, "C4128B-1"), + }, + }, + { /* Point of View mobii wintab p800w (v2.0) */ .driver_data = (void *)&pov_mobii_wintab_p800w_v20_data, .matches = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/platform/x86/wmi.c +++ linux-aws-6.5-6.5.0/drivers/platform/x86/wmi.c @@ -911,21 +911,13 @@ } static int wmi_char_open(struct inode *inode, struct file *filp) { - const char *driver_name = filp->f_path.dentry->d_iname; - struct wmi_block *wblock; - struct wmi_block *next; - - list_for_each_entry_safe(wblock, next, &wmi_block_list, list) { - if (!wblock->dev.dev.driver) - continue; - if (strcmp(driver_name, wblock->dev.dev.driver->name) == 0) { - filp->private_data = wblock; - break; - } - } + /* + * The miscdevice already stores a pointer to itself + * inside filp->private_data + */ + struct wmi_block *wblock = container_of(filp->private_data, struct wmi_block, char_dev); - if (!filp->private_data) - return -ENODEV; + filp->private_data = wblock; return nonseekable_open(inode, filp); } @@ -1270,8 +1262,8 @@ struct wmi_block *wblock, *next; union acpi_object *obj; acpi_status status; - int retval = 0; u32 i, total; + int retval; status = acpi_evaluate_object(device->handle, "_WDG", NULL, &out); if (ACPI_FAILURE(status)) @@ -1282,8 +1274,8 @@ return -ENXIO; if (obj->type != ACPI_TYPE_BUFFER) { - retval = -ENXIO; - goto out_free_pointer; + kfree(obj); + return -ENXIO; } gblock = (const struct guid_block *)obj->buffer.pointer; @@ -1293,13 +1285,18 @@ if (debug_dump_wdg) wmi_dump_wdg(&gblock[i]); + if (!gblock[i].instance_count) { + dev_info(wmi_bus_dev, FW_INFO "%pUL has zero instances\n", &gblock[i].guid); + continue; + } + if (guid_already_parsed_for_legacy(device, &gblock[i].guid)) continue; wblock = kzalloc(sizeof(*wblock), GFP_KERNEL); if (!wblock) { - retval = -ENOMEM; - break; + dev_err(wmi_bus_dev, "Failed to allocate %pUL\n", &gblock[i].guid); + continue; } wblock->acpi_device = device; @@ -1338,9 +1335,9 @@ } } -out_free_pointer: - kfree(out.pointer); - return retval; + kfree(obj); + + return 0; } /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/power/reset/Kconfig +++ linux-aws-6.5-6.5.0/drivers/power/reset/Kconfig @@ -307,7 +307,7 @@ config POWER_MLXBF tristate "Mellanox BlueField power handling driver" - depends on (GPIO_MLXBF2 && ACPI) + depends on (GPIO_MLXBF2 || GPIO_MLXBF3) && ACPI help This driver supports reset or low power mode handling for Mellanox BlueField. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/powercap/dtpm_cpu.c +++ linux-aws-6.5-6.5.0/drivers/powercap/dtpm_cpu.c @@ -24,7 +24,6 @@ #include #include #include -#include struct dtpm_cpu { struct dtpm dtpm; @@ -104,8 +103,7 @@ if (pd->table[i].frequency < freq) continue; - return scale_pd_power_uw(pd_mask, pd->table[i].power * - MICROWATT_PER_MILLIWATT); + return scale_pd_power_uw(pd_mask, pd->table[i].power); } return 0; @@ -122,11 +120,9 @@ nr_cpus = cpumask_weight(&cpus); dtpm->power_min = em->table[0].power; - dtpm->power_min *= MICROWATT_PER_MILLIWATT; dtpm->power_min *= nr_cpus; dtpm->power_max = em->table[em->nr_perf_states - 1].power; - dtpm->power_max *= MICROWATT_PER_MILLIWATT; dtpm->power_max *= nr_cpus; return 0; @@ -144,6 +140,8 @@ if (policy) { for_each_cpu(dtpm_cpu->cpu, policy->related_cpus) per_cpu(dtpm_per_cpu, dtpm_cpu->cpu) = NULL; + + cpufreq_cpu_put(policy); } kfree(dtpm_cpu); @@ -195,12 +193,16 @@ return 0; pd = em_cpu_get(cpu); - if (!pd || em_is_artificial(pd)) - return -EINVAL; + if (!pd || em_is_artificial(pd)) { + ret = -EINVAL; + goto release_policy; + } dtpm_cpu = kzalloc(sizeof(*dtpm_cpu), GFP_KERNEL); - if (!dtpm_cpu) - return -ENOMEM; + if (!dtpm_cpu) { + ret = -ENOMEM; + goto release_policy; + } dtpm_init(&dtpm_cpu->dtpm, &dtpm_ops); dtpm_cpu->cpu = cpu; @@ -220,6 +222,7 @@ if (ret) goto out_dtpm_unregister; + cpufreq_cpu_put(policy); return 0; out_dtpm_unregister: @@ -231,6 +234,8 @@ per_cpu(dtpm_per_cpu, cpu) = NULL; kfree(dtpm_cpu); +release_policy: + cpufreq_cpu_put(policy); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/powercap/dtpm_devfreq.c +++ linux-aws-6.5-6.5.0/drivers/powercap/dtpm_devfreq.c @@ -39,10 +39,8 @@ struct em_perf_domain *pd = em_pd_get(dev); dtpm->power_min = pd->table[0].power; - dtpm->power_min *= MICROWATT_PER_MILLIWATT; dtpm->power_max = pd->table[pd->nr_perf_states - 1].power; - dtpm->power_max *= MICROWATT_PER_MILLIWATT; return 0; } @@ -54,13 +52,10 @@ struct device *dev = devfreq->dev.parent; struct em_perf_domain *pd = em_pd_get(dev); unsigned long freq; - u64 power; int i; for (i = 0; i < pd->nr_perf_states; i++) { - - power = pd->table[i].power * MICROWATT_PER_MILLIWATT; - if (power > power_limit) + if (pd->table[i].power > power_limit) break; } @@ -68,7 +63,7 @@ dev_pm_qos_update_request(&dtpm_devfreq->qos_req, freq); - power_limit = pd->table[i - 1].power * MICROWATT_PER_MILLIWATT; + power_limit = pd->table[i - 1].power; return power_limit; } @@ -110,7 +105,7 @@ if (pd->table[i].frequency < freq) continue; - power = pd->table[i].power * MICROWATT_PER_MILLIWATT; + power = pd->table[i].power; power *= status.busy_time; power >>= 10; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/ptp/ptp_chardev.c +++ linux-aws-6.5-6.5.0/drivers/ptp/ptp_chardev.c @@ -490,7 +490,8 @@ for (i = 0; i < cnt; i++) { event[i] = queue->buf[queue->head]; - queue->head = (queue->head + 1) % PTP_MAX_TIMESTAMPS; + /* Paired with READ_ONCE() in queue_cnt() */ + WRITE_ONCE(queue->head, (queue->head + 1) % PTP_MAX_TIMESTAMPS); } spin_unlock_irqrestore(&queue->lock, flags); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/ptp/ptp_private.h +++ linux-aws-6.5-6.5.0/drivers/ptp/ptp_private.h @@ -76,9 +76,13 @@ * that a writer might concurrently increment the tail does not * matter, since the queue remains nonempty nonetheless. */ -static inline int queue_cnt(struct timestamp_event_queue *q) +static inline int queue_cnt(const struct timestamp_event_queue *q) { - int cnt = q->tail - q->head; + /* + * Paired with WRITE_ONCE() in enqueue_external_timestamp(), + * ptp_read(), extts_fifo_show(). + */ + int cnt = READ_ONCE(q->tail) - READ_ONCE(q->head); return cnt < 0 ? PTP_MAX_TIMESTAMPS + cnt : cnt; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/ptp/ptp_sysfs.c +++ linux-aws-6.5-6.5.0/drivers/ptp/ptp_sysfs.c @@ -90,7 +90,8 @@ qcnt = queue_cnt(queue); if (qcnt) { event = queue->buf[queue->head]; - queue->head = (queue->head + 1) % PTP_MAX_TIMESTAMPS; + /* Paired with READ_ONCE() in queue_cnt() */ + WRITE_ONCE(queue->head, (queue->head + 1) % PTP_MAX_TIMESTAMPS); } spin_unlock_irqrestore(&queue->lock, flags); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pwm/pwm-brcmstb.c +++ linux-aws-6.5-6.5.0/drivers/pwm/pwm-brcmstb.c @@ -288,7 +288,7 @@ { struct brcmstb_pwm *p = dev_get_drvdata(dev); - clk_disable(p->clk); + clk_disable_unprepare(p->clk); return 0; } @@ -297,7 +297,7 @@ { struct brcmstb_pwm *p = dev_get_drvdata(dev); - clk_enable(p->clk); + clk_prepare_enable(p->clk); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/pwm/pwm-sti.c +++ linux-aws-6.5-6.5.0/drivers/pwm/pwm-sti.c @@ -79,6 +79,7 @@ unsigned int cpt_num_devs; unsigned int max_pwm_cnt; unsigned int max_prescale; + struct sti_cpt_ddata *ddata; }; struct sti_pwm_chip { @@ -314,7 +315,7 @@ { struct sti_pwm_chip *pc = to_sti_pwmchip(chip); struct sti_pwm_compat_data *cdata = pc->cdata; - struct sti_cpt_ddata *ddata = pwm_get_chip_data(pwm); + struct sti_cpt_ddata *ddata = &cdata->ddata[pwm->hwpwm]; struct device *dev = pc->dev; unsigned int effective_ticks; unsigned long long high, low; @@ -440,7 +441,7 @@ while (cpt_int_stat) { devicenum = ffs(cpt_int_stat) - 1; - ddata = pwm_get_chip_data(&pc->chip.pwms[devicenum]); + ddata = &pc->cdata->ddata[devicenum]; /* * Capture input: @@ -638,30 +639,28 @@ dev_err(dev, "failed to prepare clock\n"); return ret; } + + cdata->ddata = devm_kzalloc(dev, cdata->cpt_num_devs * sizeof(*cdata->ddata), GFP_KERNEL); + if (!cdata->ddata) + return -ENOMEM; } pc->chip.dev = dev; pc->chip.ops = &sti_pwm_ops; pc->chip.npwm = pc->cdata->pwm_num_devs; - ret = pwmchip_add(&pc->chip); - if (ret < 0) { - clk_unprepare(pc->pwm_clk); - clk_unprepare(pc->cpt_clk); - return ret; - } - for (i = 0; i < cdata->cpt_num_devs; i++) { - struct sti_cpt_ddata *ddata; - - ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL); - if (!ddata) - return -ENOMEM; + struct sti_cpt_ddata *ddata = &cdata->ddata[i]; init_waitqueue_head(&ddata->wait); mutex_init(&ddata->lock); + } - pwm_set_chip_data(&pc->chip.pwms[i], ddata); + ret = pwmchip_add(&pc->chip); + if (ret < 0) { + clk_unprepare(pc->pwm_clk); + clk_unprepare(pc->cpt_clk); + return ret; } platform_set_drvdata(pdev, pc); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/regulator/qcom-rpmh-regulator.c +++ linux-aws-6.5-6.5.0/drivers/regulator/qcom-rpmh-regulator.c @@ -1096,7 +1096,7 @@ RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525_lv, "vdd-s1"), RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525_lv, "vdd-s2"), RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525_lv, "vdd-s3"), - RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_lv, "vdd-s4"), + RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_mv, "vdd-s4"), RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525_lv, "vdd-s5"), RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525_lv, "vdd-s6"), RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps525_lv, "vdd-s7"), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/rtc/rtc-brcmstb-waketimer.c +++ linux-aws-6.5-6.5.0/drivers/rtc/rtc-brcmstb-waketimer.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright © 2014-2017 Broadcom + * Copyright © 2014-2023 Broadcom */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -34,6 +34,7 @@ u32 rate; unsigned long rtc_alarm; bool alarm_en; + bool alarm_expired; }; #define BRCMSTB_WKTMR_EVENT 0x00 @@ -64,6 +65,11 @@ writel_relaxed(reg - 1, timer->base + BRCMSTB_WKTMR_ALARM); writel_relaxed(WKTMR_ALARM_EVENT, timer->base + BRCMSTB_WKTMR_EVENT); (void)readl_relaxed(timer->base + BRCMSTB_WKTMR_EVENT); + if (timer->alarm_expired) { + timer->alarm_expired = false; + /* maintain call balance */ + enable_irq(timer->alarm_irq); + } } static void brcmstb_waketmr_set_alarm(struct brcmstb_waketmr *timer, @@ -105,10 +111,17 @@ return IRQ_HANDLED; if (timer->alarm_en) { - if (!device_may_wakeup(timer->dev)) + if (device_may_wakeup(timer->dev)) { + disable_irq_nosync(irq); + timer->alarm_expired = true; + } else { writel_relaxed(WKTMR_ALARM_EVENT, timer->base + BRCMSTB_WKTMR_EVENT); + } rtc_update_irq(timer->rtc, 1, RTC_IRQF | RTC_AF); + } else { + writel_relaxed(WKTMR_ALARM_EVENT, + timer->base + BRCMSTB_WKTMR_EVENT); } return IRQ_HANDLED; @@ -221,8 +234,14 @@ !brcmstb_waketmr_is_pending(timer)) return -EINVAL; timer->alarm_en = true; - if (timer->alarm_irq) + if (timer->alarm_irq) { + if (timer->alarm_expired) { + timer->alarm_expired = false; + /* maintain call balance */ + enable_irq(timer->alarm_irq); + } enable_irq(timer->alarm_irq); + } } else if (!enabled && timer->alarm_en) { if (timer->alarm_irq) disable_irq(timer->alarm_irq); @@ -352,6 +371,17 @@ return brcmstb_waketmr_prepare_suspend(timer); } +static int brcmstb_waketmr_suspend_noirq(struct device *dev) +{ + struct brcmstb_waketmr *timer = dev_get_drvdata(dev); + + /* Catch any alarms occurring prior to noirq */ + if (timer->alarm_expired && device_may_wakeup(dev)) + return -EBUSY; + + return 0; +} + static int brcmstb_waketmr_resume(struct device *dev) { struct brcmstb_waketmr *timer = dev_get_drvdata(dev); @@ -368,10 +398,17 @@ return ret; } +#else +#define brcmstb_waketmr_suspend NULL +#define brcmstb_waketmr_suspend_noirq NULL +#define brcmstb_waketmr_resume NULL #endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(brcmstb_waketmr_pm_ops, - brcmstb_waketmr_suspend, brcmstb_waketmr_resume); +static const struct dev_pm_ops brcmstb_waketmr_pm_ops = { + .suspend = brcmstb_waketmr_suspend, + .suspend_noirq = brcmstb_waketmr_suspend_noirq, + .resume = brcmstb_waketmr_resume, +}; static const __maybe_unused struct of_device_id brcmstb_waketmr_of_match[] = { { .compatible = "brcm,brcmstb-waketimer" }, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/rtc/rtc-pcf85363.c +++ linux-aws-6.5-6.5.0/drivers/rtc/rtc-pcf85363.c @@ -403,6 +403,7 @@ }, }; int ret, i, err; + bool wakeup_source; if (data) config = data; @@ -432,25 +433,36 @@ pcf85363->rtc->ops = &rtc_ops; pcf85363->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; pcf85363->rtc->range_max = RTC_TIMESTAMP_END_2099; - clear_bit(RTC_FEATURE_ALARM, pcf85363->rtc->features); + + wakeup_source = device_property_read_bool(&client->dev, + "wakeup-source"); + if (client->irq > 0 || wakeup_source) { + regmap_write(pcf85363->regmap, CTRL_FLAGS, 0); + regmap_update_bits(pcf85363->regmap, CTRL_PIN_IO, + PIN_IO_INTAPM, PIN_IO_INTA_OUT); + } if (client->irq > 0) { unsigned long irqflags = IRQF_TRIGGER_LOW; if (dev_fwnode(&client->dev)) irqflags = 0; - - regmap_write(pcf85363->regmap, CTRL_FLAGS, 0); - regmap_update_bits(pcf85363->regmap, CTRL_PIN_IO, - PIN_IO_INTA_OUT, PIN_IO_INTAPM); ret = devm_request_threaded_irq(&client->dev, client->irq, NULL, pcf85363_rtc_handle_irq, irqflags | IRQF_ONESHOT, "pcf85363", client); - if (ret) - dev_warn(&client->dev, "unable to request IRQ, alarms disabled\n"); - else - set_bit(RTC_FEATURE_ALARM, pcf85363->rtc->features); + if (ret) { + dev_warn(&client->dev, + "unable to request IRQ, alarms disabled\n"); + client->irq = 0; + } + } + + if (client->irq > 0 || wakeup_source) { + device_init_wakeup(&client->dev, true); + set_bit(RTC_FEATURE_ALARM, pcf85363->rtc->features); + } else { + clear_bit(RTC_FEATURE_ALARM, pcf85363->rtc->features); } ret = devm_rtc_register_device(pcf85363->rtc); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/s390/block/dasd.c +++ linux-aws-6.5-6.5.0/drivers/s390/block/dasd.c @@ -674,18 +674,20 @@ * we count each request only once. */ device = cqr->startdev; - if (device->profile.data) { - counter = 1; /* request is not yet queued on the start device */ - list_for_each(l, &device->ccw_queue) - if (++counter >= 31) - break; - } + if (!device->profile.data) + return; + + spin_lock(get_ccwdev_lock(device->cdev)); + counter = 1; /* request is not yet queued on the start device */ + list_for_each(l, &device->ccw_queue) + if (++counter >= 31) + break; + spin_unlock(get_ccwdev_lock(device->cdev)); + spin_lock(&device->profile.lock); - if (device->profile.data) { - device->profile.data->dasd_io_nr_req[counter]++; - if (rq_data_dir(req) == READ) - device->profile.data->dasd_read_nr_req[counter]++; - } + device->profile.data->dasd_io_nr_req[counter]++; + if (rq_data_dir(req) == READ) + device->profile.data->dasd_read_nr_req[counter]++; spin_unlock(&device->profile.lock); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/s390/cio/css.c +++ linux-aws-6.5-6.5.0/drivers/s390/cio/css.c @@ -233,17 +233,19 @@ */ ret = dma_set_coherent_mask(&sch->dev, DMA_BIT_MASK(31)); if (ret) - goto err; + goto err_lock; /* * But we don't have such restrictions imposed on the stuff that * is handled by the streaming API. */ ret = dma_set_mask(&sch->dev, DMA_BIT_MASK(64)); if (ret) - goto err; + goto err_lock; return sch; +err_lock: + kfree(sch->lock); err: kfree(sch); return ERR_PTR(ret); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/s390/crypto/ap_queue.c +++ linux-aws-6.5-6.5.0/drivers/s390/crypto/ap_queue.c @@ -1205,14 +1205,19 @@ spin_unlock_bh(&aq->lock); } -void ap_queue_init_state(struct ap_queue *aq) +void _ap_queue_init_state(struct ap_queue *aq) { - spin_lock_bh(&aq->lock); aq->dev_state = AP_DEV_STATE_OPERATING; aq->sm_state = AP_SM_STATE_RESET_START; aq->last_err_rc = 0; aq->assoc_idx = ASSOC_IDX_INVALID; ap_wait(ap_sm_event(aq, AP_SM_EVENT_POLL)); +} + +void ap_queue_init_state(struct ap_queue *aq) +{ + spin_lock_bh(&aq->lock); + _ap_queue_init_state(aq); spin_unlock_bh(&aq->lock); } EXPORT_SYMBOL(ap_queue_init_state); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/s390/net/ism_drv.c +++ linux-aws-6.5-6.5.0/drivers/s390/net/ism_drv.c @@ -30,7 +30,6 @@ MODULE_DEVICE_TABLE(pci, ism_device_table); static debug_info_t *ism_debug_info; -static const struct smcd_ops ism_ops; #define NO_CLIENT 0xff /* must be >= MAX_CLIENTS */ static struct ism_client *clients[MAX_CLIENTS]; /* use an array rather than */ @@ -289,22 +288,6 @@ return ret; } -static int ism_query_rgid(struct ism_dev *ism, u64 rgid, u32 vid_valid, - u32 vid) -{ - union ism_query_rgid cmd; - - memset(&cmd, 0, sizeof(cmd)); - cmd.request.hdr.cmd = ISM_QUERY_RGID; - cmd.request.hdr.len = sizeof(cmd.request); - - cmd.request.rgid = rgid; - cmd.request.vlan_valid = vid_valid; - cmd.request.vlan_id = vid; - - return ism_cmd(ism, &cmd); -} - static void ism_free_dmb(struct ism_dev *ism, struct ism_dmb *dmb) { clear_bit(dmb->sba_idx, ism->sba_bitmap); @@ -429,23 +412,6 @@ return ism_cmd(ism, &cmd); } -static int ism_signal_ieq(struct ism_dev *ism, u64 rgid, u32 trigger_irq, - u32 event_code, u64 info) -{ - union ism_sig_ieq cmd; - - memset(&cmd, 0, sizeof(cmd)); - cmd.request.hdr.cmd = ISM_SIGNAL_IEQ; - cmd.request.hdr.len = sizeof(cmd.request); - - cmd.request.rgid = rgid; - cmd.request.trigger_irq = trigger_irq; - cmd.request.event_code = event_code; - cmd.request.info = info; - - return ism_cmd(ism, &cmd); -} - static unsigned int max_bytes(unsigned int start, unsigned int len, unsigned int boundary) { @@ -503,14 +469,6 @@ } EXPORT_SYMBOL_GPL(ism_get_seid); -static u16 ism_get_chid(struct ism_dev *ism) -{ - if (!ism || !ism->pdev) - return 0; - - return to_zpci(ism->pdev)->pchid; -} - static void ism_handle_event(struct ism_dev *ism) { struct ism_event *entry; @@ -569,11 +527,6 @@ return IRQ_HANDLED; } -static u64 ism_get_local_gid(struct ism_dev *ism) -{ - return ism->local_gid; -} - static int ism_dev_init(struct ism_dev *ism) { struct pci_dev *pdev = ism->pdev; @@ -774,6 +727,22 @@ /*************************** SMC-D Implementation *****************************/ #if IS_ENABLED(CONFIG_SMC) +static int ism_query_rgid(struct ism_dev *ism, u64 rgid, u32 vid_valid, + u32 vid) +{ + union ism_query_rgid cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.request.hdr.cmd = ISM_QUERY_RGID; + cmd.request.hdr.len = sizeof(cmd.request); + + cmd.request.rgid = rgid; + cmd.request.vlan_valid = vid_valid; + cmd.request.vlan_id = vid; + + return ism_cmd(ism, &cmd); +} + static int smcd_query_rgid(struct smcd_dev *smcd, u64 rgid, u32 vid_valid, u32 vid) { @@ -811,6 +780,23 @@ return ism_cmd_simple(smcd->priv, ISM_RESET_VLAN); } +static int ism_signal_ieq(struct ism_dev *ism, u64 rgid, u32 trigger_irq, + u32 event_code, u64 info) +{ + union ism_sig_ieq cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.request.hdr.cmd = ISM_SIGNAL_IEQ; + cmd.request.hdr.len = sizeof(cmd.request); + + cmd.request.rgid = rgid; + cmd.request.trigger_irq = trigger_irq; + cmd.request.event_code = event_code; + cmd.request.info = info; + + return ism_cmd(ism, &cmd); +} + static int smcd_signal_ieq(struct smcd_dev *smcd, u64 rgid, u32 trigger_irq, u32 event_code, u64 info) { @@ -830,11 +816,24 @@ SYSTEM_EID.type[0] != '0'; } +static u64 ism_get_local_gid(struct ism_dev *ism) +{ + return ism->local_gid; +} + static u64 smcd_get_local_gid(struct smcd_dev *smcd) { return ism_get_local_gid(smcd->priv); } +static u16 ism_get_chid(struct ism_dev *ism) +{ + if (!ism || !ism->pdev) + return 0; + + return to_zpci(ism->pdev)->pchid; +} + static u16 smcd_get_chid(struct smcd_dev *smcd) { return ism_get_chid(smcd->priv); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/be2iscsi/be_main.c +++ linux-aws-6.5-6.5.0/drivers/scsi/be2iscsi/be_main.c @@ -2710,6 +2710,7 @@ kfree(pwrb_context->pwrb_handle_base); kfree(pwrb_context->pwrb_handle_basestd); } + kfree(phwi_ctxt->be_wrbq); return -ENOMEM; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/ibmvscsi/ibmvfc.c +++ linux-aws-6.5-6.5.0/drivers/scsi/ibmvscsi/ibmvfc.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -1519,7 +1518,11 @@ unsigned long flags; spin_lock_irqsave(&queue->l_lock, flags); - BUG_ON(list_empty(&queue->free)); + if (list_empty(&queue->free)) { + ibmvfc_log(queue->vhost, 4, "empty event pool on queue:%ld\n", queue->hwq_id); + spin_unlock_irqrestore(&queue->l_lock, flags); + return NULL; + } evt = list_entry(queue->free.next, struct ibmvfc_event, queue_list); atomic_set(&evt->free, 0); list_del(&evt->queue_list); @@ -1948,9 +1951,15 @@ if (vhost->using_channels) { scsi_channel = hwq % vhost->scsi_scrqs.active_queues; evt = ibmvfc_get_event(&vhost->scsi_scrqs.scrqs[scsi_channel]); + if (!evt) + return SCSI_MLQUEUE_HOST_BUSY; + evt->hwq = hwq % vhost->scsi_scrqs.active_queues; - } else + } else { evt = ibmvfc_get_event(&vhost->crq); + if (!evt) + return SCSI_MLQUEUE_HOST_BUSY; + } ibmvfc_init_event(evt, ibmvfc_scsi_done, IBMVFC_CMD_FORMAT); evt->cmnd = cmnd; @@ -2038,6 +2047,11 @@ vhost->aborting_passthru = 1; evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + spin_unlock_irqrestore(vhost->host->host_lock, flags); + return -ENOMEM; + } + ibmvfc_init_event(evt, ibmvfc_bsg_timeout_done, IBMVFC_MAD_FORMAT); tmf = &evt->iu.tmf; @@ -2096,6 +2110,10 @@ goto unlock_out; evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + rc = -ENOMEM; + goto unlock_out; + } ibmvfc_init_event(evt, ibmvfc_sync_completion, IBMVFC_MAD_FORMAT); plogi = &evt->iu.plogi; memset(plogi, 0, sizeof(*plogi)); @@ -2214,6 +2232,11 @@ } evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + spin_unlock_irqrestore(vhost->host->host_lock, flags); + rc = -ENOMEM; + goto out; + } ibmvfc_init_event(evt, ibmvfc_sync_completion, IBMVFC_MAD_FORMAT); mad = &evt->iu.passthru; @@ -2302,6 +2325,11 @@ else evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + spin_unlock_irqrestore(vhost->host->host_lock, flags); + return -ENOMEM; + } + ibmvfc_init_event(evt, ibmvfc_sync_completion, IBMVFC_CMD_FORMAT); tmf = ibmvfc_init_vfc_cmd(evt, sdev); iu = ibmvfc_get_fcp_iu(vhost, tmf); @@ -2505,6 +2533,8 @@ struct ibmvfc_tmf *tmf; evt = ibmvfc_get_event(queue); + if (!evt) + return NULL; ibmvfc_init_event(evt, ibmvfc_sync_completion, IBMVFC_MAD_FORMAT); tmf = &evt->iu.tmf; @@ -2561,6 +2591,11 @@ if (found_evt && vhost->logged_in) { evt = ibmvfc_init_tmf(&queues[i], sdev, type); + if (!evt) { + spin_unlock(queues[i].q_lock); + spin_unlock_irqrestore(vhost->host->host_lock, flags); + return -ENOMEM; + } evt->sync_iu = &queues[i].cancel_rsp; ibmvfc_send_event(evt, vhost, default_timeout); list_add_tail(&evt->cancel, &cancelq); @@ -2774,6 +2809,10 @@ if (vhost->state == IBMVFC_ACTIVE) { evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + spin_unlock_irqrestore(vhost->host->host_lock, flags); + return -ENOMEM; + } ibmvfc_init_event(evt, ibmvfc_sync_completion, IBMVFC_CMD_FORMAT); tmf = ibmvfc_init_vfc_cmd(evt, sdev); iu = ibmvfc_get_fcp_iu(vhost, tmf); @@ -4032,6 +4071,12 @@ kref_get(&tgt->kref); evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_NONE); + kref_put(&tgt->kref, ibmvfc_release_tgt); + __ibmvfc_reset_host(vhost); + return; + } vhost->discovery_threads++; ibmvfc_init_event(evt, ibmvfc_tgt_prli_done, IBMVFC_MAD_FORMAT); evt->tgt = tgt; @@ -4139,6 +4184,12 @@ kref_get(&tgt->kref); tgt->logo_rcvd = 0; evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_NONE); + kref_put(&tgt->kref, ibmvfc_release_tgt); + __ibmvfc_reset_host(vhost); + return; + } vhost->discovery_threads++; ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_INIT_WAIT); ibmvfc_init_event(evt, ibmvfc_tgt_plogi_done, IBMVFC_MAD_FORMAT); @@ -4215,6 +4266,8 @@ kref_get(&tgt->kref); evt = ibmvfc_get_event(&vhost->crq); + if (!evt) + return NULL; ibmvfc_init_event(evt, done, IBMVFC_MAD_FORMAT); evt->tgt = tgt; mad = &evt->iu.implicit_logout; @@ -4242,6 +4295,13 @@ vhost->discovery_threads++; evt = __ibmvfc_tgt_get_implicit_logout_evt(tgt, ibmvfc_tgt_implicit_logout_done); + if (!evt) { + vhost->discovery_threads--; + ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_NONE); + kref_put(&tgt->kref, ibmvfc_release_tgt); + __ibmvfc_reset_host(vhost); + return; + } ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_INIT_WAIT); if (ibmvfc_send_event(evt, vhost, default_timeout)) { @@ -4381,6 +4441,12 @@ kref_get(&tgt->kref); evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT); + kref_put(&tgt->kref, ibmvfc_release_tgt); + __ibmvfc_reset_host(vhost); + return; + } vhost->discovery_threads++; ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_INIT_WAIT); ibmvfc_init_event(evt, ibmvfc_tgt_move_login_done, IBMVFC_MAD_FORMAT); @@ -4547,6 +4613,14 @@ vhost->abort_threads++; kref_get(&tgt->kref); evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + tgt_err(tgt, "Failed to get cancel event for ADISC.\n"); + vhost->abort_threads--; + kref_put(&tgt->kref, ibmvfc_release_tgt); + __ibmvfc_reset_host(vhost); + spin_unlock_irqrestore(vhost->host->host_lock, flags); + return; + } ibmvfc_init_event(evt, ibmvfc_tgt_adisc_cancel_done, IBMVFC_MAD_FORMAT); evt->tgt = tgt; @@ -4597,6 +4671,12 @@ kref_get(&tgt->kref); evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_NONE); + kref_put(&tgt->kref, ibmvfc_release_tgt); + __ibmvfc_reset_host(vhost); + return; + } vhost->discovery_threads++; ibmvfc_init_event(evt, ibmvfc_tgt_adisc_done, IBMVFC_MAD_FORMAT); evt->tgt = tgt; @@ -4700,6 +4780,12 @@ kref_get(&tgt->kref); evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_NONE); + kref_put(&tgt->kref, ibmvfc_release_tgt); + __ibmvfc_reset_host(vhost); + return; + } vhost->discovery_threads++; evt->tgt = tgt; ibmvfc_init_event(evt, ibmvfc_tgt_query_target_done, IBMVFC_MAD_FORMAT); @@ -4872,6 +4958,13 @@ { struct ibmvfc_discover_targets *mad; struct ibmvfc_event *evt = ibmvfc_get_event(&vhost->crq); + int level = IBMVFC_DEFAULT_LOG_LEVEL; + + if (!evt) { + ibmvfc_log(vhost, level, "Discover Targets failed: no available events\n"); + ibmvfc_hard_reset_host(vhost); + return; + } ibmvfc_init_event(evt, ibmvfc_discover_targets_done, IBMVFC_MAD_FORMAT); mad = &evt->iu.discover_targets; @@ -4949,8 +5042,15 @@ struct ibmvfc_scsi_channels *scrqs = &vhost->scsi_scrqs; unsigned int num_channels = min(vhost->client_scsi_channels, vhost->max_vios_scsi_channels); + int level = IBMVFC_DEFAULT_LOG_LEVEL; int i; + if (!evt) { + ibmvfc_log(vhost, level, "Channel Setup failed: no available events\n"); + ibmvfc_hard_reset_host(vhost); + return; + } + memset(setup_buf, 0, sizeof(*setup_buf)); if (num_channels == 0) setup_buf->flags = cpu_to_be32(IBMVFC_CANCEL_CHANNELS); @@ -5012,6 +5112,13 @@ { struct ibmvfc_channel_enquiry *mad; struct ibmvfc_event *evt = ibmvfc_get_event(&vhost->crq); + int level = IBMVFC_DEFAULT_LOG_LEVEL; + + if (!evt) { + ibmvfc_log(vhost, level, "Channel Enquiry failed: no available events\n"); + ibmvfc_hard_reset_host(vhost); + return; + } ibmvfc_init_event(evt, ibmvfc_channel_enquiry_done, IBMVFC_MAD_FORMAT); mad = &evt->iu.channel_enquiry; @@ -5134,6 +5241,12 @@ struct ibmvfc_npiv_login_mad *mad; struct ibmvfc_event *evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + ibmvfc_dbg(vhost, "NPIV Login failed: no available events\n"); + ibmvfc_hard_reset_host(vhost); + return; + } + ibmvfc_gather_partition_info(vhost); ibmvfc_set_login_info(vhost); ibmvfc_init_event(evt, ibmvfc_npiv_login_done, IBMVFC_MAD_FORMAT); @@ -5198,6 +5311,12 @@ struct ibmvfc_event *evt; evt = ibmvfc_get_event(&vhost->crq); + if (!evt) { + ibmvfc_dbg(vhost, "NPIV Logout failed: no available events\n"); + ibmvfc_hard_reset_host(vhost); + return; + } + ibmvfc_init_event(evt, ibmvfc_npiv_logout_done, IBMVFC_MAD_FORMAT); mad = &evt->iu.npiv_logout; @@ -5804,7 +5923,7 @@ irq_failed: do { rc = plpar_hcall_norets(H_FREE_SUB_CRQ, vdev->unit_address, scrq->cookie); - } while (rtas_busy_delay(rc)); + } while (rc == H_BUSY || H_IS_LONG_BUSY(rc)); reg_failed: LEAVE; return rc; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/libfc/fc_lport.c +++ linux-aws-6.5-6.5.0/drivers/scsi/libfc/fc_lport.c @@ -241,6 +241,12 @@ } mutex_lock(&lport->disc.disc_mutex); lport->ptp_rdata = fc_rport_create(lport, remote_fid); + if (!lport->ptp_rdata) { + printk(KERN_WARNING "libfc: Failed to setup lport 0x%x\n", + lport->port_id); + mutex_unlock(&lport->disc.disc_mutex); + return; + } kref_get(&lport->ptp_rdata->kref); lport->ptp_rdata->ids.port_name = remote_wwpn; lport->ptp_rdata->ids.node_name = remote_wwnn; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h +++ linux-aws-6.5-6.5.0/drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h @@ -1482,7 +1482,7 @@ #define MPI3_SECURITY1_KEY_RECORD_MAX 1 #endif #ifndef MPI3_SECURITY1_PAD_MAX -#define MPI3_SECURITY1_PAD_MAX 1 +#define MPI3_SECURITY1_PAD_MAX 4 #endif union mpi3_security1_key_data { __le32 dword[128]; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/mpi3mr/mpi/mpi30_ioc.h +++ linux-aws-6.5-6.5.0/drivers/scsi/mpi3mr/mpi/mpi30_ioc.h @@ -28,6 +28,7 @@ __le64 driver_information_address; }; +#define MPI3_IOCINIT_MSGFLAGS_SCSIIOSTATUSREPLY_SUPPORTED (0x04) #define MPI3_IOCINIT_MSGFLAGS_HOSTMETADATA_MASK (0x03) #define MPI3_IOCINIT_MSGFLAGS_HOSTMETADATA_NOT_USED (0x00) #define MPI3_IOCINIT_MSGFLAGS_HOSTMETADATA_SEPARATED (0x01) @@ -600,6 +601,7 @@ __le16 threshold_count; __le16 attached_dev_handle; __le16 reserved12; + __le32 reserved14; }; #define MPI3_EVENT_PCI_ERROR_RC_THRESHOLD_EXCEEDED (0x00) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/mpi3mr/mpi/mpi30_transport.h +++ linux-aws-6.5-6.5.0/drivers/scsi/mpi3mr/mpi/mpi30_transport.h @@ -18,7 +18,7 @@ #define MPI3_VERSION_MAJOR (3) #define MPI3_VERSION_MINOR (0) -#define MPI3_VERSION_UNIT (27) +#define MPI3_VERSION_UNIT (28) #define MPI3_VERSION_DEV (0) #define MPI3_DEVHANDLE_INVALID (0xffff) struct mpi3_sysif_oper_queue_indexes { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/mpi3mr/mpi3mr.h +++ linux-aws-6.5-6.5.0/drivers/scsi/mpi3mr/mpi3mr.h @@ -55,8 +55,8 @@ extern int prot_mask; extern atomic64_t event_counter; -#define MPI3MR_DRIVER_VERSION "8.4.1.0.0" -#define MPI3MR_DRIVER_RELDATE "16-March-2023" +#define MPI3MR_DRIVER_VERSION "8.5.1.0.0" +#define MPI3MR_DRIVER_RELDATE "5-December-2023" #define MPI3MR_DRIVER_NAME "mpi3mr" #define MPI3MR_DRIVER_LICENSE "GPL" @@ -66,11 +66,12 @@ #define MPI3MR_NAME_LENGTH 32 #define IOCNAME "%s: " -#define MPI3MR_MAX_SECTORS 2048 +#define MPI3MR_DEFAULT_MAX_IO_SIZE (1 * 1024 * 1024) /* Definitions for internal SGL and Chain SGL buffers */ #define MPI3MR_PAGE_SIZE_4K 4096 -#define MPI3MR_SG_DEPTH (MPI3MR_PAGE_SIZE_4K / sizeof(struct mpi3_sge_common)) +#define MPI3MR_DEFAULT_SGL_ENTRIES 256 +#define MPI3MR_MAX_SGL_ENTRIES 2048 /* Definitions for MAX values for shost */ #define MPI3MR_MAX_CMDS_LUN 128 @@ -206,6 +207,9 @@ */ #define MPI3MR_MAX_APP_XFER_SECTORS (2048 + 512) +#define MPI3MR_WRITE_SAME_MAX_LEN_256_BLKS 256 +#define MPI3MR_WRITE_SAME_MAX_LEN_2048_BLKS 2048 + /** * struct mpi3mr_nvme_pt_sge - Structure to store SGEs for NVMe * Encapsulated commands. @@ -214,14 +218,16 @@ * @length: SGE length * @rsvd: Reserved * @rsvd1: Reserved - * @sgl_type: sgl type + * @sub_type: sgl sub type + * @type: sgl type */ struct mpi3mr_nvme_pt_sge { - u64 base_addr; - u32 length; + __le64 base_addr; + __le32 length; u16 rsvd; u8 rsvd1; - u8 sgl_type; + u8 sub_type:4; + u8 type:4; }; /** @@ -243,6 +249,8 @@ u32 kern_buf_len; dma_addr_t kern_buf_dma; u8 data_dir; + u16 num_dma_desc; + struct dma_memory_desc *dma_desc; }; /* IOC State definitions */ @@ -323,6 +331,7 @@ u16 max_perids; u16 max_pds; u16 max_sasexpanders; + u32 max_data_length; u16 max_sasinitiators; u16 max_enclosures; u16 max_pcie_switches; @@ -472,6 +481,10 @@ /* HBA port flags */ #define MPI3MR_HBA_PORT_FLAG_DIRTY 0x01 +/* IOCTL data transfer sge*/ +#define MPI3MR_NUM_IOCTL_SGE 256 +#define MPI3MR_IOCTL_SGE_SIZE (8 * 1024) + /** * struct mpi3mr_hba_port - HBA's port information * @port_id: Port number @@ -501,7 +514,7 @@ u8 num_phys; u8 marked_responding; int lowest_phy; - u32 phy_mask; + u64 phy_mask; struct mpi3mr_hba_port *hba_port; struct sas_identify remote_identify; struct sas_rphy *rphy; @@ -676,6 +689,7 @@ * @io_unit_port: IO Unit port ID * @non_stl: Is this device not to be attached with SAS TL * @io_throttle_enabled: I/O throttling needed or not + * @wslen: Write same max length * @q_depth: Device specific Queue Depth * @wwid: World wide ID * @enclosure_logical_id: Enclosure logical identifier @@ -698,6 +712,7 @@ u8 io_unit_port; u8 non_stl; u8 io_throttle_enabled; + u16 wslen; u16 q_depth; u64 wwid; u64 enclosure_logical_id; @@ -751,6 +766,8 @@ * @dev_removed: Device removed in the Firmware * @dev_removedelay: Device is waiting to be removed in FW * @dev_type: Device type + * @dev_nvme_dif: Device is NVMe DIF enabled + * @wslen: Write same max length * @io_throttle_enabled: I/O throttling needed or not * @io_divert: Flag indicates io divert is on or off for the dev * @throttle_group: Pointer to throttle group info @@ -767,6 +784,8 @@ u8 dev_removed; u8 dev_removedelay; u8 dev_type; + u8 dev_nvme_dif; + u16 wslen; u8 io_throttle_enabled; u8 io_divert; struct mpi3mr_throttle_group_info *throttle_group; @@ -782,12 +801,14 @@ * @ncq_prio_enable: NCQ priority enable for SATA device * @pend_count: Counter to track pending I/Os during error * handling + * @wslen: Write same max length */ struct mpi3mr_sdev_priv_data { struct mpi3mr_stgt_priv_data *tgt_priv_data; u32 lun_id; u8 ncq_prio_enable; u32 pend_count; + u16 wslen; }; /** @@ -959,6 +980,7 @@ * @stop_drv_processing: Stop all command processing * @device_refresh_on: Don't process the events until devices are refreshed * @max_host_ios: Maximum host I/O count + * @max_sgl_entries: Max SGL entries per I/O * @chain_buf_count: Chain buffer count * @chain_buf_pool: Chain buffer pool * @chain_sgl_list: Chain SGL list @@ -1028,6 +1050,11 @@ * @sas_node_lock: Lock to protect SAS node list * @hba_port_table_list: List of HBA Ports * @enclosure_list: List of Enclosure objects + * @ioctl_dma_pool: DMA pool for IOCTL data buffers + * @ioctl_sge: DMA buffer descriptors for IOCTL data + * @ioctl_chain_sge: DMA buffer descriptor for IOCTL chain + * @ioctl_resp_sge: DMA buffer descriptor for Mgmt cmd response + * @ioctl_sges_allocated: Flag for IOCTL SGEs allocated or not */ struct mpi3mr_ioc { struct list_head list; @@ -1129,6 +1156,7 @@ u16 max_host_ios; spinlock_t tgtdev_lock; struct list_head tgtdev_list; + u16 max_sgl_entries; u32 chain_buf_count; struct dma_pool *chain_buf_pool; @@ -1212,6 +1240,12 @@ spinlock_t sas_node_lock; struct list_head hba_port_table_list; struct list_head enclosure_list; + + struct dma_pool *ioctl_dma_pool; + struct dma_memory_desc ioctl_sge[MPI3MR_NUM_IOCTL_SGE]; + struct dma_memory_desc ioctl_chain_sge; + struct dma_memory_desc ioctl_resp_sge; + bool ioctl_sges_allocated; }; /** only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/mpi3mr/mpi3mr_app.c +++ linux-aws-6.5-6.5.0/drivers/scsi/mpi3mr/mpi3mr_app.c @@ -223,6 +223,22 @@ return rval; } + if (mrioc->unrecoverable) { + dprint_bsg_err(mrioc, "%s: unrecoverable controller\n", + __func__); + return -EFAULT; + } + + if (mrioc->reset_in_progress) { + dprint_bsg_err(mrioc, "%s: reset in progress\n", __func__); + return -EAGAIN; + } + + if (mrioc->stop_bsgs) { + dprint_bsg_err(mrioc, "%s: bsgs are blocked\n", __func__); + return -EAGAIN; + } + sg_copy_to_buffer(job->request_payload.sg_list, job->request_payload.sg_cnt, &pel_enable, sizeof(pel_enable)); @@ -548,7 +564,36 @@ } /** + * mpi3mr_total_num_ioctl_sges - Count number of SGEs required + * @drv_bufs: DMA address of the buffers to be placed in sgl + * @bufcnt: Number of DMA buffers + * + * This function returns total number of data SGEs required + * including zero length SGEs and excluding management request + * and response buffer for the given list of data buffer + * descriptors + * + * Return: Number of SGE elements needed + */ +static inline u16 mpi3mr_total_num_ioctl_sges(struct mpi3mr_buf_map *drv_bufs, + u8 bufcnt) +{ + u16 i, sge_count = 0; + + for (i = 0; i < bufcnt; i++, drv_bufs++) { + if (drv_bufs->data_dir == DMA_NONE || + drv_bufs->kern_buf) + continue; + sge_count += drv_bufs->num_dma_desc; + if (!drv_bufs->num_dma_desc) + sge_count++; + } + return sge_count; +} + +/** * mpi3mr_bsg_build_sgl - SGL construction for MPI commands + * @mrioc: Adapter instance reference * @mpi_req: MPI request * @sgl_offset: offset to start sgl in the MPI request * @drv_bufs: DMA address of the buffers to be placed in sgl @@ -560,27 +605,45 @@ * This function places the DMA address of the given buffers in * proper format as SGEs in the given MPI request. * - * Return: Nothing + * Return: 0 on success,-1 on failure */ -static void mpi3mr_bsg_build_sgl(u8 *mpi_req, uint32_t sgl_offset, - struct mpi3mr_buf_map *drv_bufs, u8 bufcnt, u8 is_rmc, - u8 is_rmr, u8 num_datasges) +static int mpi3mr_bsg_build_sgl(struct mpi3mr_ioc *mrioc, u8 *mpi_req, + u32 sgl_offset, struct mpi3mr_buf_map *drv_bufs, + u8 bufcnt, u8 is_rmc, u8 is_rmr, u8 num_datasges) { + struct mpi3_request_header *mpi_header = + (struct mpi3_request_header *)mpi_req; u8 *sgl = (mpi_req + sgl_offset), count = 0; struct mpi3_mgmt_passthrough_request *rmgmt_req = (struct mpi3_mgmt_passthrough_request *)mpi_req; struct mpi3mr_buf_map *drv_buf_iter = drv_bufs; - u8 sgl_flags, sgl_flags_last; + u8 flag, sgl_flags, sgl_flag_eob, sgl_flags_last, last_chain_sgl_flag; + u16 available_sges, i, sges_needed; + u32 sge_element_size = sizeof(struct mpi3_sge_common); + bool chain_used = false; sgl_flags = MPI3_SGE_FLAGS_ELEMENT_TYPE_SIMPLE | - MPI3_SGE_FLAGS_DLAS_SYSTEM | MPI3_SGE_FLAGS_END_OF_BUFFER; - sgl_flags_last = sgl_flags | MPI3_SGE_FLAGS_END_OF_LIST; + MPI3_SGE_FLAGS_DLAS_SYSTEM; + sgl_flag_eob = sgl_flags | MPI3_SGE_FLAGS_END_OF_BUFFER; + sgl_flags_last = sgl_flag_eob | MPI3_SGE_FLAGS_END_OF_LIST; + last_chain_sgl_flag = MPI3_SGE_FLAGS_ELEMENT_TYPE_LAST_CHAIN | + MPI3_SGE_FLAGS_DLAS_SYSTEM; + + sges_needed = mpi3mr_total_num_ioctl_sges(drv_bufs, bufcnt); if (is_rmc) { mpi3mr_add_sg_single(&rmgmt_req->command_sgl, sgl_flags_last, drv_buf_iter->kern_buf_len, drv_buf_iter->kern_buf_dma); - sgl = (u8 *)drv_buf_iter->kern_buf + drv_buf_iter->bsg_buf_len; + sgl = (u8 *)drv_buf_iter->kern_buf + + drv_buf_iter->bsg_buf_len; + available_sges = (drv_buf_iter->kern_buf_len - + drv_buf_iter->bsg_buf_len) / sge_element_size; + + if (sges_needed > available_sges) + return -1; + + chain_used = true; drv_buf_iter++; count++; if (is_rmr) { @@ -592,23 +655,95 @@ } else mpi3mr_build_zero_len_sge( &rmgmt_req->response_sgl); + if (num_datasges) { + i = 0; + goto build_sges; + } + } else { + if (sgl_offset >= MPI3MR_ADMIN_REQ_FRAME_SZ) + return -1; + available_sges = (MPI3MR_ADMIN_REQ_FRAME_SZ - sgl_offset) / + sge_element_size; + if (!available_sges) + return -1; } if (!num_datasges) { mpi3mr_build_zero_len_sge(sgl); - return; + return 0; + } + if (mpi_header->function == MPI3_BSG_FUNCTION_SMP_PASSTHROUGH) { + if ((sges_needed > 2) || (sges_needed > available_sges)) + return -1; + for (; count < bufcnt; count++, drv_buf_iter++) { + if (drv_buf_iter->data_dir == DMA_NONE || + !drv_buf_iter->num_dma_desc) + continue; + mpi3mr_add_sg_single(sgl, sgl_flags_last, + drv_buf_iter->dma_desc[0].size, + drv_buf_iter->dma_desc[0].dma_addr); + sgl += sge_element_size; + } + return 0; } + i = 0; + +build_sges: for (; count < bufcnt; count++, drv_buf_iter++) { if (drv_buf_iter->data_dir == DMA_NONE) continue; - if (num_datasges == 1 || !is_rmc) - mpi3mr_add_sg_single(sgl, sgl_flags_last, - drv_buf_iter->kern_buf_len, drv_buf_iter->kern_buf_dma); - else - mpi3mr_add_sg_single(sgl, sgl_flags, - drv_buf_iter->kern_buf_len, drv_buf_iter->kern_buf_dma); - sgl += sizeof(struct mpi3_sge_common); + if (!drv_buf_iter->num_dma_desc) { + if (chain_used && !available_sges) + return -1; + if (!chain_used && (available_sges == 1) && + (sges_needed > 1)) + goto setup_chain; + flag = sgl_flag_eob; + if (num_datasges == 1) + flag = sgl_flags_last; + mpi3mr_add_sg_single(sgl, flag, 0, 0); + sgl += sge_element_size; + sges_needed--; + available_sges--; + num_datasges--; + continue; + } + for (; i < drv_buf_iter->num_dma_desc; i++) { + if (chain_used && !available_sges) + return -1; + if (!chain_used && (available_sges == 1) && + (sges_needed > 1)) + goto setup_chain; + flag = sgl_flags; + if (i == (drv_buf_iter->num_dma_desc - 1)) { + if (num_datasges == 1) + flag = sgl_flags_last; + else + flag = sgl_flag_eob; + } + + mpi3mr_add_sg_single(sgl, flag, + drv_buf_iter->dma_desc[i].size, + drv_buf_iter->dma_desc[i].dma_addr); + sgl += sge_element_size; + available_sges--; + sges_needed--; + } num_datasges--; + i = 0; } + return 0; + +setup_chain: + available_sges = mrioc->ioctl_chain_sge.size / sge_element_size; + if (sges_needed > available_sges) + return -1; + mpi3mr_add_sg_single(sgl, last_chain_sgl_flag, + (sges_needed * sge_element_size), + mrioc->ioctl_chain_sge.dma_addr); + memset(mrioc->ioctl_chain_sge.addr, 0, mrioc->ioctl_chain_sge.size); + sgl = (u8 *)mrioc->ioctl_chain_sge.addr; + chain_used = true; + goto build_sges; } /** @@ -648,14 +783,20 @@ struct mpi3mr_buf_map *drv_bufs, u8 bufcnt) { struct mpi3mr_nvme_pt_sge *nvme_sgl; - u64 sgl_ptr; + __le64 sgl_dma; u8 count; size_t length = 0; + u16 available_sges = 0, i; + u32 sge_element_size = sizeof(struct mpi3mr_nvme_pt_sge); struct mpi3mr_buf_map *drv_buf_iter = drv_bufs; u64 sgemod_mask = ((u64)((mrioc->facts.sge_mod_mask) << mrioc->facts.sge_mod_shift) << 32); u64 sgemod_val = ((u64)(mrioc->facts.sge_mod_value) << mrioc->facts.sge_mod_shift) << 32; + u32 size; + + nvme_sgl = (struct mpi3mr_nvme_pt_sge *) + ((u8 *)(nvme_encap_request->command) + MPI3MR_NVME_CMD_SGL_OFFSET); /* * Not all commands require a data transfer. If no data, just return @@ -664,27 +805,59 @@ for (count = 0; count < bufcnt; count++, drv_buf_iter++) { if (drv_buf_iter->data_dir == DMA_NONE) continue; - sgl_ptr = (u64)drv_buf_iter->kern_buf_dma; length = drv_buf_iter->kern_buf_len; break; } - if (!length) + if (!length || !drv_buf_iter->num_dma_desc) return 0; - if (sgl_ptr & sgemod_mask) { + if (drv_buf_iter->num_dma_desc == 1) { + available_sges = 1; + goto build_sges; + } + + sgl_dma = cpu_to_le64(mrioc->ioctl_chain_sge.dma_addr); + if (sgl_dma & sgemod_mask) { dprint_bsg_err(mrioc, - "%s: SGL address collides with SGE modifier\n", + "%s: SGL chain address collides with SGE modifier\n", __func__); return -1; } - sgl_ptr &= ~sgemod_mask; - sgl_ptr |= sgemod_val; - nvme_sgl = (struct mpi3mr_nvme_pt_sge *) - ((u8 *)(nvme_encap_request->command) + MPI3MR_NVME_CMD_SGL_OFFSET); + sgl_dma &= ~sgemod_mask; + sgl_dma |= sgemod_val; + + memset(mrioc->ioctl_chain_sge.addr, 0, mrioc->ioctl_chain_sge.size); + available_sges = mrioc->ioctl_chain_sge.size / sge_element_size; + if (available_sges < drv_buf_iter->num_dma_desc) + return -1; memset(nvme_sgl, 0, sizeof(struct mpi3mr_nvme_pt_sge)); - nvme_sgl->base_addr = sgl_ptr; - nvme_sgl->length = length; + nvme_sgl->base_addr = sgl_dma; + size = drv_buf_iter->num_dma_desc * sizeof(struct mpi3mr_nvme_pt_sge); + nvme_sgl->length = cpu_to_le32(size); + nvme_sgl->type = MPI3MR_NVMESGL_LAST_SEGMENT; + nvme_sgl = (struct mpi3mr_nvme_pt_sge *)mrioc->ioctl_chain_sge.addr; + +build_sges: + for (i = 0; i < drv_buf_iter->num_dma_desc; i++) { + sgl_dma = cpu_to_le64(drv_buf_iter->dma_desc[i].dma_addr); + if (sgl_dma & sgemod_mask) { + dprint_bsg_err(mrioc, + "%s: SGL address collides with SGE modifier\n", + __func__); + return -1; + } + + sgl_dma &= ~sgemod_mask; + sgl_dma |= sgemod_val; + + nvme_sgl->base_addr = sgl_dma; + nvme_sgl->length = cpu_to_le32(drv_buf_iter->dma_desc[i].size); + nvme_sgl->type = MPI3MR_NVMESGL_DATA_SEGMENT; + nvme_sgl++; + available_sges--; + } + return 0; } @@ -712,7 +885,7 @@ dma_addr_t prp_entry_dma, prp_page_dma, dma_addr; u32 offset, entry_len, dev_pgsz; u32 page_mask_result, page_mask; - size_t length = 0; + size_t length = 0, desc_len; u8 count; struct mpi3mr_buf_map *drv_buf_iter = drv_bufs; u64 sgemod_mask = ((u64)((mrioc->facts.sge_mod_mask) << @@ -721,6 +894,7 @@ mrioc->facts.sge_mod_shift) << 32; u16 dev_handle = nvme_encap_request->dev_handle; struct mpi3mr_tgt_dev *tgtdev; + u16 desc_count = 0; tgtdev = mpi3mr_get_tgtdev_by_handle(mrioc, dev_handle); if (!tgtdev) { @@ -739,6 +913,21 @@ dev_pgsz = 1 << (tgtdev->dev_spec.pcie_inf.pgsz); mpi3mr_tgtdev_put(tgtdev); + page_mask = dev_pgsz - 1; + + if (dev_pgsz > MPI3MR_IOCTL_SGE_SIZE) { + dprint_bsg_err(mrioc, + "%s: NVMe device page size(%d) is greater than ioctl data sge size(%d) for handle 0x%04x\n", + __func__, dev_pgsz, MPI3MR_IOCTL_SGE_SIZE, dev_handle); + return -1; + } + + if (MPI3MR_IOCTL_SGE_SIZE % dev_pgsz) { + dprint_bsg_err(mrioc, + "%s: ioctl data sge size(%d) is not a multiple of NVMe device page size(%d) for handle 0x%04x\n", + __func__, MPI3MR_IOCTL_SGE_SIZE, dev_pgsz, dev_handle); + return -1; + } /* * Not all commands require a data transfer. If no data, just return @@ -747,14 +936,26 @@ for (count = 0; count < bufcnt; count++, drv_buf_iter++) { if (drv_buf_iter->data_dir == DMA_NONE) continue; - dma_addr = drv_buf_iter->kern_buf_dma; length = drv_buf_iter->kern_buf_len; break; } - if (!length) + if (!length || !drv_buf_iter->num_dma_desc) return 0; + for (count = 0; count < drv_buf_iter->num_dma_desc; count++) { + dma_addr = drv_buf_iter->dma_desc[count].dma_addr; + if (dma_addr & page_mask) { + dprint_bsg_err(mrioc, + "%s:dma_addr 0x%llx is not aligned with page size 0x%x\n", + __func__, dma_addr, dev_pgsz); + return -1; + } + } + + dma_addr = drv_buf_iter->dma_desc[0].dma_addr; + desc_len = drv_buf_iter->dma_desc[0].size; + mrioc->prp_sz = 0; mrioc->prp_list_virt = dma_alloc_coherent(&mrioc->pdev->dev, dev_pgsz, &mrioc->prp_list_dma, GFP_KERNEL); @@ -784,7 +985,6 @@ * Check if we are within 1 entry of a page boundary we don't * want our first entry to be a PRP List entry. */ - page_mask = dev_pgsz - 1; page_mask_result = (uintptr_t)((u8 *)prp_page + prp_size) & page_mask; if (!page_mask_result) { dprint_bsg_err(mrioc, "%s: PRP page is not page aligned\n", @@ -898,18 +1098,31 @@ prp_entry_dma += prp_size; } - /* - * Bump the phys address of the command's data buffer by the - * entry_len. - */ - dma_addr += entry_len; - /* decrement length accounting for last partial page. */ - if (entry_len > length) + if (entry_len >= length) { length = 0; - else + } else { + if (entry_len <= desc_len) { + dma_addr += entry_len; + desc_len -= entry_len; + } + if (!desc_len) { + if ((++desc_count) >= + drv_buf_iter->num_dma_desc) { + dprint_bsg_err(mrioc, + "%s: Invalid len %ld while building PRP\n", + __func__, length); + goto err_out; + } + dma_addr = + drv_buf_iter->dma_desc[desc_count].dma_addr; + desc_len = + drv_buf_iter->dma_desc[desc_count].size; + } length -= entry_len; + } } + return 0; err_out: if (mrioc->prp_list_virt) { @@ -919,10 +1132,66 @@ } return -1; } + +/** + * mpi3mr_map_data_buffer_dma - build dma descriptors for data + * buffers + * @mrioc: Adapter instance reference + * @drv_buf: buffer map descriptor + * @desc_count: Number of already consumed dma descriptors + * + * This function computes how many pre-allocated DMA descriptors + * are required for the given data buffer and if those number of + * descriptors are free, then setup the mapping of the scattered + * DMA address to the given data buffer, if the data direction + * of the buffer is DMA_TO_DEVICE then the actual data is copied to + * the DMA buffers + * + * Return: 0 on success, -1 on failure + */ +static int mpi3mr_map_data_buffer_dma(struct mpi3mr_ioc *mrioc, + struct mpi3mr_buf_map *drv_buf, + u16 desc_count) +{ + u16 i, needed_desc = drv_buf->kern_buf_len / MPI3MR_IOCTL_SGE_SIZE; + u32 buf_len = drv_buf->kern_buf_len, copied_len = 0; + + if (drv_buf->kern_buf_len % MPI3MR_IOCTL_SGE_SIZE) + needed_desc++; + if ((needed_desc + desc_count) > MPI3MR_NUM_IOCTL_SGE) { + dprint_bsg_err(mrioc, "%s: DMA descriptor mapping error %d:%d:%d\n", + __func__, needed_desc, desc_count, MPI3MR_NUM_IOCTL_SGE); + return -1; + } + drv_buf->dma_desc = kzalloc(sizeof(*drv_buf->dma_desc) * needed_desc, + GFP_KERNEL); + if (!drv_buf->dma_desc) + return -1; + for (i = 0; i < needed_desc; i++, desc_count++) { + drv_buf->dma_desc[i].addr = mrioc->ioctl_sge[desc_count].addr; + drv_buf->dma_desc[i].dma_addr = + mrioc->ioctl_sge[desc_count].dma_addr; + if (buf_len < mrioc->ioctl_sge[desc_count].size) + drv_buf->dma_desc[i].size = buf_len; + else + drv_buf->dma_desc[i].size = + mrioc->ioctl_sge[desc_count].size; + buf_len -= drv_buf->dma_desc[i].size; + memset(drv_buf->dma_desc[i].addr, 0, + mrioc->ioctl_sge[desc_count].size); + if (drv_buf->data_dir == DMA_TO_DEVICE) { + memcpy(drv_buf->dma_desc[i].addr, + drv_buf->bsg_buf + copied_len, + drv_buf->dma_desc[i].size); + copied_len += drv_buf->dma_desc[i].size; + } + } + drv_buf->num_dma_desc = needed_desc; + return 0; +} /** * mpi3mr_bsg_process_mpt_cmds - MPI Pass through BSG handler * @job: BSG job reference - * @reply_payload_rcv_len: length of payload recvd * * This function is the top level handler for MPI Pass through * command, this does basic validation of the input data buffers, @@ -938,10 +1207,9 @@ * Return: 0 on success and proper error codes on failure */ -static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job, unsigned int *reply_payload_rcv_len) +static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job) { long rval = -EINVAL; - struct mpi3mr_ioc *mrioc = NULL; u8 *mpi_req = NULL, *sense_buff_k = NULL; u8 mpi_msg_size = 0; @@ -949,9 +1217,10 @@ struct mpi3mr_bsg_mptcmd *karg; struct mpi3mr_buf_entry *buf_entries = NULL; struct mpi3mr_buf_map *drv_bufs = NULL, *drv_buf_iter = NULL; - u8 count, bufcnt = 0, is_rmcb = 0, is_rmrb = 0, din_cnt = 0, dout_cnt = 0; - u8 invalid_be = 0, erb_offset = 0xFF, mpirep_offset = 0xFF, sg_entries = 0; - u8 block_io = 0, resp_code = 0, nvme_fmt = 0; + u8 count, bufcnt = 0, is_rmcb = 0, is_rmrb = 0; + u8 din_cnt = 0, dout_cnt = 0; + u8 invalid_be = 0, erb_offset = 0xFF, mpirep_offset = 0xFF; + u8 block_io = 0, nvme_fmt = 0, resp_code = 0; struct mpi3_request_header *mpi_header = NULL; struct mpi3_status_reply_descriptor *status_desc; struct mpi3_scsi_task_mgmt_request *tm_req; @@ -963,6 +1232,7 @@ u32 din_size = 0, dout_size = 0; u8 *din_buf = NULL, *dout_buf = NULL; u8 *sgl_iter = NULL, *sgl_din_iter = NULL, *sgl_dout_iter = NULL; + u16 rmc_size = 0, desc_count = 0; bsg_req = job->request; karg = (struct mpi3mr_bsg_mptcmd *)&bsg_req->cmd.mptcmd; @@ -971,6 +1241,12 @@ if (!mrioc) return -ENODEV; + if (!mrioc->ioctl_sges_allocated) { + dprint_bsg_err(mrioc, "%s: DMA memory was not allocated\n", + __func__); + return -ENOMEM; + } + if (karg->timeout < MPI3MR_APP_DEFAULT_TIMEOUT) karg->timeout = MPI3MR_APP_DEFAULT_TIMEOUT; @@ -1011,26 +1287,13 @@ for (count = 0; count < bufcnt; count++, buf_entries++, drv_buf_iter++) { - if (sgl_dout_iter > (dout_buf + job->request_payload.payload_len)) { - dprint_bsg_err(mrioc, "%s: data_out buffer length mismatch\n", - __func__); - rval = -EINVAL; - goto out; - } - if (sgl_din_iter > (din_buf + job->reply_payload.payload_len)) { - dprint_bsg_err(mrioc, "%s: data_in buffer length mismatch\n", - __func__); - rval = -EINVAL; - goto out; - } - switch (buf_entries->buf_type) { case MPI3MR_BSG_BUFTYPE_RAIDMGMT_CMD: sgl_iter = sgl_dout_iter; sgl_dout_iter += buf_entries->buf_len; drv_buf_iter->data_dir = DMA_TO_DEVICE; is_rmcb = 1; - if (count != 0) + if ((count != 0) || !buf_entries->buf_len) invalid_be = 1; break; case MPI3MR_BSG_BUFTYPE_RAIDMGMT_RESP: @@ -1038,7 +1301,7 @@ sgl_din_iter += buf_entries->buf_len; drv_buf_iter->data_dir = DMA_FROM_DEVICE; is_rmrb = 1; - if (count != 1 || !is_rmcb) + if (count != 1 || !is_rmcb || !buf_entries->buf_len) invalid_be = 1; break; case MPI3MR_BSG_BUFTYPE_DATA_IN: @@ -1046,7 +1309,7 @@ sgl_din_iter += buf_entries->buf_len; drv_buf_iter->data_dir = DMA_FROM_DEVICE; din_cnt++; - din_size += drv_buf_iter->bsg_buf_len; + din_size += buf_entries->buf_len; if ((din_cnt > 1) && !is_rmcb) invalid_be = 1; break; @@ -1055,7 +1318,7 @@ sgl_dout_iter += buf_entries->buf_len; drv_buf_iter->data_dir = DMA_TO_DEVICE; dout_cnt++; - dout_size += drv_buf_iter->bsg_buf_len; + dout_size += buf_entries->buf_len; if ((dout_cnt > 1) && !is_rmcb) invalid_be = 1; break; @@ -1064,12 +1327,16 @@ sgl_din_iter += buf_entries->buf_len; drv_buf_iter->data_dir = DMA_NONE; mpirep_offset = count; + if (!buf_entries->buf_len) + invalid_be = 1; break; case MPI3MR_BSG_BUFTYPE_ERR_RESPONSE: sgl_iter = sgl_din_iter; sgl_din_iter += buf_entries->buf_len; drv_buf_iter->data_dir = DMA_NONE; erb_offset = count; + if (!buf_entries->buf_len) + invalid_be = 1; break; case MPI3MR_BSG_BUFTYPE_MPI_REQUEST: sgl_iter = sgl_dout_iter; @@ -1096,21 +1363,31 @@ goto out; } - drv_buf_iter->bsg_buf = sgl_iter; - drv_buf_iter->bsg_buf_len = buf_entries->buf_len; - - } - if (!is_rmcb && (dout_cnt || din_cnt)) { - sg_entries = dout_cnt + din_cnt; - if (((mpi_msg_size) + (sg_entries * - sizeof(struct mpi3_sge_common))) > MPI3MR_ADMIN_REQ_FRAME_SZ) { - dprint_bsg_err(mrioc, - "%s:%d: invalid message size passed\n", - __func__, __LINE__); + if (sgl_dout_iter > (dout_buf + job->request_payload.payload_len)) { + dprint_bsg_err(mrioc, "%s: data_out buffer length mismatch\n", + __func__); rval = -EINVAL; goto out; } + if (sgl_din_iter > (din_buf + job->reply_payload.payload_len)) { + dprint_bsg_err(mrioc, "%s: data_in buffer length mismatch\n", + __func__); + rval = -EINVAL; + goto out; + } + + drv_buf_iter->bsg_buf = sgl_iter; + drv_buf_iter->bsg_buf_len = buf_entries->buf_len; } + + if (is_rmcb && ((din_size + dout_size) > MPI3MR_MAX_APP_XFER_SIZE)) { + dprint_bsg_err(mrioc, "%s:%d: invalid data transfer size passed for function 0x%x din_size = %d, dout_size = %d\n", + __func__, __LINE__, mpi_header->function, din_size, + dout_size); + rval = -EINVAL; + goto out; + } + if (din_size > MPI3MR_MAX_APP_XFER_SIZE) { dprint_bsg_err(mrioc, "%s:%d: invalid data transfer size passed for function 0x%x din_size=%d\n", @@ -1126,30 +1403,64 @@ goto out; } + if (mpi_header->function == MPI3_BSG_FUNCTION_SMP_PASSTHROUGH) { + if (din_size > MPI3MR_IOCTL_SGE_SIZE || + dout_size > MPI3MR_IOCTL_SGE_SIZE) { + dprint_bsg_err(mrioc, "%s:%d: invalid message size passed:%d:%d:%d:%d\n", + __func__, __LINE__, din_cnt, dout_cnt, din_size, + dout_size); + rval = -EINVAL; + goto out; + } + } + drv_buf_iter = drv_bufs; for (count = 0; count < bufcnt; count++, drv_buf_iter++) { if (drv_buf_iter->data_dir == DMA_NONE) continue; drv_buf_iter->kern_buf_len = drv_buf_iter->bsg_buf_len; - if (is_rmcb && !count) - drv_buf_iter->kern_buf_len += ((dout_cnt + din_cnt) * - sizeof(struct mpi3_sge_common)); - - if (!drv_buf_iter->kern_buf_len) - continue; - - drv_buf_iter->kern_buf = dma_alloc_coherent(&mrioc->pdev->dev, - drv_buf_iter->kern_buf_len, &drv_buf_iter->kern_buf_dma, - GFP_KERNEL); - if (!drv_buf_iter->kern_buf) { - rval = -ENOMEM; - goto out; - } - if (drv_buf_iter->data_dir == DMA_TO_DEVICE) { + if (is_rmcb && !count) { + drv_buf_iter->kern_buf_len = + mrioc->ioctl_chain_sge.size; + drv_buf_iter->kern_buf = + mrioc->ioctl_chain_sge.addr; + drv_buf_iter->kern_buf_dma = + mrioc->ioctl_chain_sge.dma_addr; + drv_buf_iter->dma_desc = NULL; + drv_buf_iter->num_dma_desc = 0; + memset(drv_buf_iter->kern_buf, 0, + drv_buf_iter->kern_buf_len); tmplen = min(drv_buf_iter->kern_buf_len, - drv_buf_iter->bsg_buf_len); + drv_buf_iter->bsg_buf_len); + rmc_size = tmplen; memcpy(drv_buf_iter->kern_buf, drv_buf_iter->bsg_buf, tmplen); + } else if (is_rmrb && (count == 1)) { + drv_buf_iter->kern_buf_len = + mrioc->ioctl_resp_sge.size; + drv_buf_iter->kern_buf = + mrioc->ioctl_resp_sge.addr; + drv_buf_iter->kern_buf_dma = + mrioc->ioctl_resp_sge.dma_addr; + drv_buf_iter->dma_desc = NULL; + drv_buf_iter->num_dma_desc = 0; + memset(drv_buf_iter->kern_buf, 0, + drv_buf_iter->kern_buf_len); + tmplen = min(drv_buf_iter->kern_buf_len, + drv_buf_iter->bsg_buf_len); + drv_buf_iter->kern_buf_len = tmplen; + memset(drv_buf_iter->bsg_buf, 0, + drv_buf_iter->bsg_buf_len); + } else { + if (!drv_buf_iter->kern_buf_len) + continue; + if (mpi3mr_map_data_buffer_dma(mrioc, drv_buf_iter, desc_count)) { + rval = -ENOMEM; + dprint_bsg_err(mrioc, "%s:%d: mapping data buffers failed\n", + __func__, __LINE__); + goto out; + } + desc_count += drv_buf_iter->num_dma_desc; } } @@ -1219,9 +1530,14 @@ goto out; } } else { - mpi3mr_bsg_build_sgl(mpi_req, (mpi_msg_size), - drv_bufs, bufcnt, is_rmcb, is_rmrb, - (dout_cnt + din_cnt)); + if (mpi3mr_bsg_build_sgl(mrioc, mpi_req, mpi_msg_size, + drv_bufs, bufcnt, is_rmcb, is_rmrb, + (dout_cnt + din_cnt))) { + dprint_bsg_err(mrioc, "%s: sgl build failed\n", __func__); + rval = -EAGAIN; + mutex_unlock(&mrioc->bsg_cmds.mutex); + goto out; + } } if (mpi_header->function == MPI3_BSG_FUNCTION_SCSI_TASK_MGMT) { @@ -1257,7 +1573,7 @@ if (mpi_header->function == MPI3_BSG_FUNCTION_MGMT_PASSTHROUGH) { drv_buf_iter = &drv_bufs[0]; dprint_dump(drv_buf_iter->kern_buf, - drv_buf_iter->kern_buf_len, "mpi3_mgmt_req"); + rmc_size, "mpi3_mgmt_req"); } } @@ -1292,10 +1608,9 @@ MPI3_BSG_FUNCTION_MGMT_PASSTHROUGH) { drv_buf_iter = &drv_bufs[0]; dprint_dump(drv_buf_iter->kern_buf, - drv_buf_iter->kern_buf_len, "mpi3_mgmt_req"); + rmc_size, "mpi3_mgmt_req"); } } - if ((mpi_header->function == MPI3_BSG_FUNCTION_NVME_ENCAPSULATED) || (mpi_header->function == MPI3_BSG_FUNCTION_SCSI_IO)) mpi3mr_issue_tm(mrioc, @@ -1366,17 +1681,27 @@ for (count = 0; count < bufcnt; count++, drv_buf_iter++) { if (drv_buf_iter->data_dir == DMA_NONE) continue; - if (drv_buf_iter->data_dir == DMA_FROM_DEVICE) { - tmplen = min(drv_buf_iter->kern_buf_len, - drv_buf_iter->bsg_buf_len); + if ((count == 1) && is_rmrb) { memcpy(drv_buf_iter->bsg_buf, - drv_buf_iter->kern_buf, tmplen); + drv_buf_iter->kern_buf, + drv_buf_iter->kern_buf_len); + } else if (drv_buf_iter->data_dir == DMA_FROM_DEVICE) { + tmplen = 0; + for (desc_count = 0; + desc_count < drv_buf_iter->num_dma_desc; + desc_count++) { + memcpy(((u8 *)drv_buf_iter->bsg_buf + tmplen), + drv_buf_iter->dma_desc[desc_count].addr, + drv_buf_iter->dma_desc[desc_count].size); + tmplen += + drv_buf_iter->dma_desc[desc_count].size; } } + } out_unlock: if (din_buf) { - *reply_payload_rcv_len = + job->reply_payload_rcv_len = sg_copy_from_buffer(job->reply_payload.sg_list, job->reply_payload.sg_cnt, din_buf, job->reply_payload.payload_len); @@ -1392,13 +1717,8 @@ kfree(mpi_req); if (drv_bufs) { drv_buf_iter = drv_bufs; - for (count = 0; count < bufcnt; count++, drv_buf_iter++) { - if (drv_buf_iter->kern_buf && drv_buf_iter->kern_buf_dma) - dma_free_coherent(&mrioc->pdev->dev, - drv_buf_iter->kern_buf_len, - drv_buf_iter->kern_buf, - drv_buf_iter->kern_buf_dma); - } + for (count = 0; count < bufcnt; count++, drv_buf_iter++) + kfree(drv_buf_iter->dma_desc); kfree(drv_bufs); } kfree(bsg_reply_buf); @@ -1457,7 +1777,7 @@ rval = mpi3mr_bsg_process_drv_cmds(job); break; case MPI3MR_MPT_CMD: - rval = mpi3mr_bsg_process_mpt_cmds(job, &reply_payload_rcv_len); + rval = mpi3mr_bsg_process_mpt_cmds(job); break; default: pr_err("%s: unsupported BSG command(0x%08x)\n", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ linux-aws-6.5-6.5.0/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -1059,6 +1059,114 @@ } /** + * mpi3mr_free_ioctl_dma_memory - free memory for ioctl dma + * @mrioc: Adapter instance reference + * + * Free the DMA memory allocated for IOCTL handling purpose. + + * + * Return: None + */ +static void mpi3mr_free_ioctl_dma_memory(struct mpi3mr_ioc *mrioc) +{ + struct dma_memory_desc *mem_desc; + u16 i; + + if (!mrioc->ioctl_dma_pool) + return; + + for (i = 0; i < MPI3MR_NUM_IOCTL_SGE; i++) { + mem_desc = &mrioc->ioctl_sge[i]; + if (mem_desc->addr) { + dma_pool_free(mrioc->ioctl_dma_pool, + mem_desc->addr, + mem_desc->dma_addr); + mem_desc->addr = NULL; + } + } + dma_pool_destroy(mrioc->ioctl_dma_pool); + mrioc->ioctl_dma_pool = NULL; + mem_desc = &mrioc->ioctl_chain_sge; + + if (mem_desc->addr) { + dma_free_coherent(&mrioc->pdev->dev, mem_desc->size, + mem_desc->addr, mem_desc->dma_addr); + mem_desc->addr = NULL; + } + mem_desc = &mrioc->ioctl_resp_sge; + if (mem_desc->addr) { + dma_free_coherent(&mrioc->pdev->dev, mem_desc->size, + mem_desc->addr, mem_desc->dma_addr); + mem_desc->addr = NULL; + } + + mrioc->ioctl_sges_allocated = false; +} + +/** + * mpi3mr_alloc_ioctl_dma_memory - Alloc memory for ioctl dma + * @mrioc: Adapter instance reference + + * + * This function allocates dmaable memory required to handle the + * application issued MPI3 IOCTL requests. + * + * Return: None + */ +static void mpi3mr_alloc_ioctl_dma_memory(struct mpi3mr_ioc *mrioc) + +{ + struct dma_memory_desc *mem_desc; + u16 i; + + mrioc->ioctl_dma_pool = dma_pool_create("ioctl dma pool", + &mrioc->pdev->dev, + MPI3MR_IOCTL_SGE_SIZE, + MPI3MR_PAGE_SIZE_4K, 0); + + if (!mrioc->ioctl_dma_pool) { + ioc_err(mrioc, "ioctl_dma_pool: dma_pool_create failed\n"); + goto out_failed; + } + + for (i = 0; i < MPI3MR_NUM_IOCTL_SGE; i++) { + mem_desc = &mrioc->ioctl_sge[i]; + mem_desc->size = MPI3MR_IOCTL_SGE_SIZE; + mem_desc->addr = dma_pool_zalloc(mrioc->ioctl_dma_pool, + GFP_KERNEL, + &mem_desc->dma_addr); + if (!mem_desc->addr) + goto out_failed; + } + + mem_desc = &mrioc->ioctl_chain_sge; + mem_desc->size = MPI3MR_PAGE_SIZE_4K; + mem_desc->addr = dma_alloc_coherent(&mrioc->pdev->dev, + mem_desc->size, + &mem_desc->dma_addr, + GFP_KERNEL); + if (!mem_desc->addr) + goto out_failed; + + mem_desc = &mrioc->ioctl_resp_sge; + mem_desc->size = MPI3MR_PAGE_SIZE_4K; + mem_desc->addr = dma_alloc_coherent(&mrioc->pdev->dev, + mem_desc->size, + &mem_desc->dma_addr, + GFP_KERNEL); + if (!mem_desc->addr) + goto out_failed; + + mrioc->ioctl_sges_allocated = true; + + return; +out_failed: + ioc_warn(mrioc, "cannot allocate DMA memory for the mpt commands\n" + "from the applications, application interface for MPT command is disabled\n"); + mpi3mr_free_ioctl_dma_memory(mrioc); +} + +/** * mpi3mr_clear_reset_history - clear reset history * @mrioc: Adapter instance reference * @@ -1163,6 +1271,12 @@ return -EPERM; } + if (mrioc->shost->max_sectors != (mrioc->facts.max_data_length / 512)) + ioc_err(mrioc, "Warning: The maximum data transfer length\n" + "\tchanged after reset: previous(%d), new(%d),\n" + "the driver cannot change this at run time\n", + mrioc->shost->max_sectors * 512, mrioc->facts.max_data_length); + if ((mrioc->sas_transport_enabled) && (mrioc->facts.ioc_capabilities & MPI3_IOCFACTS_CAPABILITY_MULTIPATH_ENABLED)) ioc_err(mrioc, @@ -1886,7 +2000,8 @@ reply_qid = qidx + 1; op_reply_q->num_replies = MPI3MR_OP_REP_Q_QD; - if (!mrioc->pdev->revision) + if ((mrioc->pdev->device == MPI3_MFGPAGE_DEVID_SAS4116) && + !mrioc->pdev->revision) op_reply_q->num_replies = MPI3MR_OP_REP_Q_QD4K; op_reply_q->ci = 0; op_reply_q->ephase = 1; @@ -2343,8 +2458,8 @@ ioc_err(mrioc, "Issue IOUCTL time_stamp: command timed out\n"); mrioc->init_cmds.is_waiting = 0; if (!(mrioc->init_cmds.state & MPI3MR_CMD_RESET)) - mpi3mr_soft_reset_handler(mrioc, - MPI3MR_RESET_FROM_TSU_TIMEOUT, 1); + mpi3mr_check_rh_fault_ioc(mrioc, + MPI3MR_RESET_FROM_TSU_TIMEOUT); retval = -1; goto out_unlock; } @@ -2856,6 +2971,7 @@ le16_to_cpu(facts_data->max_pcie_switches); mrioc->facts.max_sasexpanders = le16_to_cpu(facts_data->max_sas_expanders); + mrioc->facts.max_data_length = le16_to_cpu(facts_data->max_data_length); mrioc->facts.max_sasinitiators = le16_to_cpu(facts_data->max_sas_initiators); mrioc->facts.max_enclosures = le16_to_cpu(facts_data->max_enclosures); @@ -2893,13 +3009,18 @@ mrioc->facts.io_throttle_high = le16_to_cpu(facts_data->io_throttle_high); + if (mrioc->facts.max_data_length == + MPI3_IOCFACTS_MAX_DATA_LENGTH_NOT_REPORTED) + mrioc->facts.max_data_length = MPI3MR_DEFAULT_MAX_IO_SIZE; + else + mrioc->facts.max_data_length *= MPI3MR_PAGE_SIZE_4K; /* Store in 512b block count */ if (mrioc->facts.io_throttle_data_length) mrioc->io_throttle_data_length = (mrioc->facts.io_throttle_data_length * 2 * 4); else /* set the length to 1MB + 1K to disable throttle */ - mrioc->io_throttle_data_length = MPI3MR_MAX_SECTORS + 2; + mrioc->io_throttle_data_length = (mrioc->facts.max_data_length / 512) + 2; mrioc->io_throttle_high = (mrioc->facts.io_throttle_high * 2 * 1024); mrioc->io_throttle_low = (mrioc->facts.io_throttle_low * 2 * 1024); @@ -2914,9 +3035,9 @@ ioc_info(mrioc, "SGEModMask 0x%x SGEModVal 0x%x SGEModShift 0x%x ", mrioc->facts.sge_mod_mask, mrioc->facts.sge_mod_value, mrioc->facts.sge_mod_shift); - ioc_info(mrioc, "DMA mask %d InitialPE status 0x%x\n", + ioc_info(mrioc, "DMA mask %d InitialPE status 0x%x max_data_len (%d)\n", mrioc->facts.dma_mask, (facts_flags & - MPI3_IOCFACTS_FLAGS_INITIAL_PORT_ENABLE_MASK)); + MPI3_IOCFACTS_FLAGS_INITIAL_PORT_ENABLE_MASK), mrioc->facts.max_data_length); ioc_info(mrioc, "max_dev_per_throttle_group(%d), max_throttle_groups(%d)\n", mrioc->facts.max_dev_per_tg, mrioc->facts.max_io_throttle_group); @@ -3181,6 +3302,9 @@ current_time = ktime_get_real(); iocinit_req.time_stamp = cpu_to_le64(ktime_to_ms(current_time)); + iocinit_req.msg_flags |= + MPI3_IOCINIT_MSGFLAGS_SCSIIOSTATUSREPLY_SUPPORTED; + init_completion(&mrioc->init_cmds.done); retval = mpi3mr_admin_request_post(mrioc, &iocinit_req, sizeof(iocinit_req), 1); @@ -3359,8 +3483,8 @@ if (!(mrioc->init_cmds.state & MPI3MR_CMD_COMPLETE)) { ioc_err(mrioc, "Issue EvtNotify: command timed out\n"); if (!(mrioc->init_cmds.state & MPI3MR_CMD_RESET)) - mpi3mr_soft_reset_handler(mrioc, - MPI3MR_RESET_FROM_EVTACK_TIMEOUT, 1); + mpi3mr_check_rh_fault_ioc(mrioc, + MPI3MR_RESET_FROM_EVTACK_TIMEOUT); retval = -1; goto out_unlock; } @@ -3414,7 +3538,14 @@ if (!mrioc->chain_sgl_list) goto out_failed; - sz = MPI3MR_PAGE_SIZE_4K; + if (mrioc->max_sgl_entries > (mrioc->facts.max_data_length / + MPI3MR_PAGE_SIZE_4K)) + mrioc->max_sgl_entries = mrioc->facts.max_data_length / + MPI3MR_PAGE_SIZE_4K; + sz = mrioc->max_sgl_entries * sizeof(struct mpi3_sge_common); + ioc_info(mrioc, "number of sgl entries=%d chain buffer size=%dKB\n", + mrioc->max_sgl_entries, sz/1024); + mrioc->chain_buf_pool = dma_pool_create("chain_buf pool", &mrioc->pdev->dev, sz, 16, 0); if (!mrioc->chain_buf_pool) { @@ -3813,7 +3944,7 @@ } mrioc->max_host_ios = mrioc->facts.max_reqs - MPI3MR_INTERNAL_CMDS_RESVD; - + mrioc->shost->max_sectors = mrioc->facts.max_data_length / 512; mrioc->num_io_throttle_group = mrioc->facts.max_io_throttle_group; atomic_set(&mrioc->pend_large_data_sz, 0); @@ -3851,6 +3982,9 @@ } } + dprint_init(mrioc, "allocating ioctl dma buffers\n"); + mpi3mr_alloc_ioctl_dma_memory(mrioc); + if (!mrioc->init_cmds.reply) { retval = mpi3mr_alloc_reply_sense_bufs(mrioc); if (retval) { @@ -4270,6 +4404,7 @@ struct mpi3mr_intr_info *intr_info; mpi3mr_free_enclosure_list(mrioc); + mpi3mr_free_ioctl_dma_memory(mrioc); if (mrioc->sense_buf_pool) { if (mrioc->sense_buf) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/mpi3mr/mpi3mr_os.c +++ linux-aws-6.5-6.5.0/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -33,6 +33,12 @@ module_param(logging_level, int, 0); MODULE_PARM_DESC(logging_level, " bits for enabling additional logging info (default=0)"); +static int max_sgl_entries = MPI3MR_DEFAULT_SGL_ENTRIES; +module_param(max_sgl_entries, int, 0444); +MODULE_PARM_DESC(max_sgl_entries, + "Preferred max number of SG entries to be used for a single I/O\n" + "The actual value will be determined by the driver\n" + "(Minimum=256, Maximum=2048, default=256)"); /* Forward declarations*/ static void mpi3mr_send_event_ack(struct mpi3mr_ioc *mrioc, u8 event, @@ -424,6 +430,7 @@ tgt_priv->io_throttle_enabled = 0; tgt_priv->io_divert = 0; tgt_priv->throttle_group = NULL; + tgt_priv->wslen = 0; if (tgtdev->host_exposed) atomic_set(&tgt_priv->block_io, 1); } @@ -1034,6 +1041,20 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc) { struct mpi3mr_tgt_dev *tgtdev, *tgtdev_next; + struct mpi3mr_stgt_priv_data *tgt_priv; + + dprint_reset(mrioc, "refresh target devices: check for removals\n"); + list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list, + list) { + if ((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) && + tgtdev->is_hidden && + tgtdev->host_exposed && tgtdev->starget && + tgtdev->starget->hostdata) { + tgt_priv = tgtdev->starget->hostdata; + tgt_priv->dev_removed = 1; + atomic_set(&tgt_priv->block_io, 0); + } + } list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list, list) { @@ -1044,14 +1065,24 @@ mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev); mpi3mr_tgtdev_del_from_list(mrioc, tgtdev, true); mpi3mr_tgtdev_put(tgtdev); + } else if (tgtdev->is_hidden & tgtdev->host_exposed) { + dprint_reset(mrioc, "hiding target device with perst_id(%d)\n", + tgtdev->perst_id); + mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev); } } tgtdev = NULL; list_for_each_entry(tgtdev, &mrioc->tgtdev_list, list) { if ((tgtdev->dev_handle != MPI3MR_INVALID_DEV_HANDLE) && - !tgtdev->is_hidden && !tgtdev->host_exposed) - mpi3mr_report_tgtdev_to_host(mrioc, tgtdev->perst_id); + !tgtdev->is_hidden) { + if (!tgtdev->host_exposed) + mpi3mr_report_tgtdev_to_host(mrioc, + tgtdev->perst_id); + else if (tgtdev->starget) + starget_for_each_device(tgtdev->starget, + (void *)tgtdev, mpi3mr_update_sdev); + } } } @@ -1102,6 +1133,18 @@ tgtdev->io_throttle_enabled = (flags & MPI3_DEVICE0_FLAGS_IO_THROTTLING_REQUIRED) ? 1 : 0; + switch (flags & MPI3_DEVICE0_FLAGS_MAX_WRITE_SAME_MASK) { + case MPI3_DEVICE0_FLAGS_MAX_WRITE_SAME_256_LB: + tgtdev->wslen = MPI3MR_WRITE_SAME_MAX_LEN_256_BLKS; + break; + case MPI3_DEVICE0_FLAGS_MAX_WRITE_SAME_2048_LB: + tgtdev->wslen = MPI3MR_WRITE_SAME_MAX_LEN_2048_BLKS; + break; + case MPI3_DEVICE0_FLAGS_MAX_WRITE_SAME_NO_LIMIT: + default: + tgtdev->wslen = 0; + break; + } if (tgtdev->starget && tgtdev->starget->hostdata) { scsi_tgt_priv_data = (struct mpi3mr_stgt_priv_data *) @@ -1113,6 +1156,7 @@ tgtdev->io_throttle_enabled; if (is_added == true) atomic_set(&scsi_tgt_priv_data->block_io, 0); + scsi_tgt_priv_data->wslen = tgtdev->wslen; } switch (dev_pg0->access_status) { @@ -3161,6 +3205,7 @@ tg = stgt_priv_data->throttle_group; throttle_enabled_dev = stgt_priv_data->io_throttle_enabled; + dev_handle = stgt_priv_data->dev_handle; } } if (unlikely((data_len_blks >= mrioc->io_throttle_data_length) && @@ -3413,7 +3458,7 @@ scsi_bufflen(scmd)); return -ENOMEM; } - if (sges_left > MPI3MR_SG_DEPTH) { + if (sges_left > mrioc->max_sgl_entries) { sdev_printk(KERN_ERR, scmd->device, "scsi_dma_map returned unsupported sge count %d!\n", sges_left); @@ -3934,23 +3979,90 @@ } /** + * mpi3mr_setup_divert_ws - Setup Divert IO flag for write same + * @mrioc: Adapter instance reference + * @scmd: SCSI command reference + * @scsiio_req: MPI3 SCSI IO request + * @scsiio_flags: Pointer to MPI3 SCSI IO Flags + * @wslen: write same max length + * + * Gets values of unmap, ndob and number of blocks from write + * same scsi io and based on these values it sets divert IO flag + * and reason for diverting IO to firmware. + * + * Return: Nothing + */ +static inline void mpi3mr_setup_divert_ws(struct mpi3mr_ioc *mrioc, + struct scsi_cmnd *scmd, struct mpi3_scsi_io_request *scsiio_req, + u32 *scsiio_flags, u16 wslen) +{ + u8 unmap = 0, ndob = 0; + u8 opcode = scmd->cmnd[0]; + u32 num_blocks = 0; + u16 sa = (scmd->cmnd[8] << 8) | (scmd->cmnd[9]); + + if (opcode == WRITE_SAME_16) { + unmap = scmd->cmnd[1] & 0x08; + ndob = scmd->cmnd[1] & 0x01; + num_blocks = get_unaligned_be32(scmd->cmnd + 10); + } else if ((opcode == VARIABLE_LENGTH_CMD) && (sa == WRITE_SAME_32)) { + unmap = scmd->cmnd[10] & 0x08; + ndob = scmd->cmnd[10] & 0x01; + num_blocks = get_unaligned_be32(scmd->cmnd + 28); + } else + return; + + if ((unmap) && (ndob) && (num_blocks > wslen)) { + scsiio_req->msg_flags |= + MPI3_SCSIIO_MSGFLAGS_DIVERT_TO_FIRMWARE; + *scsiio_flags |= + MPI3_SCSIIO_FLAGS_DIVERT_REASON_WRITE_SAME_TOO_LARGE; + } +} + +/** * mpi3mr_eh_host_reset - Host reset error handling callback * @scmd: SCSI command reference * - * Issue controller reset if the scmd is for a Physical Device, - * if the scmd is for RAID volume, then wait for - * MPI3MR_RAID_ERRREC_RESET_TIMEOUT and checke whether any - * pending I/Os prior to issuing reset to the controller. + * Issue controller reset * * Return: SUCCESS of successful reset else FAILED */ static int mpi3mr_eh_host_reset(struct scsi_cmnd *scmd) { struct mpi3mr_ioc *mrioc = shost_priv(scmd->device->host); + int retval = FAILED, ret; + + ret = mpi3mr_soft_reset_handler(mrioc, + MPI3MR_RESET_FROM_EH_HOS, 1); + if (ret) + goto out; + + retval = SUCCESS; +out: + sdev_printk(KERN_INFO, scmd->device, + "Host reset is %s for scmd(%p)\n", + ((retval == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); + + return retval; +} + +/** + * mpi3mr_eh_bus_reset - Bus reset error handling callback + * @scmd: SCSI command reference + * + * Checks whether pending I/Os are present for the RAID volume; + * if not there's no need to reset the adapter. + * + * Return: SUCCESS of successful reset else FAILED + */ +static int mpi3mr_eh_bus_reset(struct scsi_cmnd *scmd) +{ + struct mpi3mr_ioc *mrioc = shost_priv(scmd->device->host); struct mpi3mr_stgt_priv_data *stgt_priv_data; struct mpi3mr_sdev_priv_data *sdev_priv_data; u8 dev_type = MPI3_DEVICE_DEVFORM_VD; - int retval = FAILED, ret; + int retval = FAILED; sdev_priv_data = scmd->device->hostdata; if (sdev_priv_data && sdev_priv_data->tgt_priv_data) { @@ -3960,25 +4072,16 @@ if (dev_type == MPI3_DEVICE_DEVFORM_VD) { mpi3mr_wait_for_host_io(mrioc, - MPI3MR_RAID_ERRREC_RESET_TIMEOUT); - if (!mpi3mr_get_fw_pending_ios(mrioc)) { + MPI3MR_RAID_ERRREC_RESET_TIMEOUT); + if (!mpi3mr_get_fw_pending_ios(mrioc)) retval = SUCCESS; - goto out; - } } + if (retval == FAILED) + mpi3mr_print_pending_host_io(mrioc); - mpi3mr_print_pending_host_io(mrioc); - ret = mpi3mr_soft_reset_handler(mrioc, - MPI3MR_RESET_FROM_EH_HOS, 1); - if (ret) - goto out; - - retval = SUCCESS; -out: sdev_printk(KERN_INFO, scmd->device, - "Host reset is %s for scmd(%p)\n", - ((retval == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); - + "Bus reset is %s for scmd(%p)\n", + ((retval == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); return retval; } @@ -4430,7 +4533,6 @@ unsigned long flags; int retval = 0; struct sas_rphy *rphy = NULL; - bool update_stgt_priv_data = false; scsi_tgt_priv_data = kzalloc(sizeof(*scsi_tgt_priv_data), GFP_KERNEL); if (!scsi_tgt_priv_data) @@ -4439,39 +4541,50 @@ starget->hostdata = scsi_tgt_priv_data; spin_lock_irqsave(&mrioc->tgtdev_lock, flags); - if (starget->channel == mrioc->scsi_device_channel) { tgt_dev = __mpi3mr_get_tgtdev_by_perst_id(mrioc, starget->id); - if (tgt_dev && !tgt_dev->is_hidden) - update_stgt_priv_data = true; - else + if (tgt_dev && !tgt_dev->is_hidden) { + scsi_tgt_priv_data->starget = starget; + scsi_tgt_priv_data->dev_handle = tgt_dev->dev_handle; + scsi_tgt_priv_data->perst_id = tgt_dev->perst_id; + scsi_tgt_priv_data->dev_type = tgt_dev->dev_type; + scsi_tgt_priv_data->tgt_dev = tgt_dev; + tgt_dev->starget = starget; + atomic_set(&scsi_tgt_priv_data->block_io, 0); + retval = 0; + if ((tgt_dev->dev_type == MPI3_DEVICE_DEVFORM_PCIE) && + ((tgt_dev->dev_spec.pcie_inf.dev_info & + MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_MASK) == + MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_NVME_DEVICE) && + ((tgt_dev->dev_spec.pcie_inf.dev_info & + MPI3_DEVICE0_PCIE_DEVICE_INFO_PITYPE_MASK) != + MPI3_DEVICE0_PCIE_DEVICE_INFO_PITYPE_0)) + scsi_tgt_priv_data->dev_nvme_dif = 1; + scsi_tgt_priv_data->io_throttle_enabled = tgt_dev->io_throttle_enabled; + scsi_tgt_priv_data->wslen = tgt_dev->wslen; + if (tgt_dev->dev_type == MPI3_DEVICE_DEVFORM_VD) + scsi_tgt_priv_data->throttle_group = tgt_dev->dev_spec.vd_inf.tg; + } else retval = -ENXIO; } else if (mrioc->sas_transport_enabled && !starget->channel) { rphy = dev_to_rphy(starget->dev.parent); tgt_dev = __mpi3mr_get_tgtdev_by_addr_and_rphy(mrioc, rphy->identify.sas_address, rphy); if (tgt_dev && !tgt_dev->is_hidden && !tgt_dev->non_stl && - (tgt_dev->dev_type == MPI3_DEVICE_DEVFORM_SAS_SATA)) - update_stgt_priv_data = true; - else + (tgt_dev->dev_type == MPI3_DEVICE_DEVFORM_SAS_SATA)) { + scsi_tgt_priv_data->starget = starget; + scsi_tgt_priv_data->dev_handle = tgt_dev->dev_handle; + scsi_tgt_priv_data->perst_id = tgt_dev->perst_id; + scsi_tgt_priv_data->dev_type = tgt_dev->dev_type; + scsi_tgt_priv_data->tgt_dev = tgt_dev; + scsi_tgt_priv_data->io_throttle_enabled = tgt_dev->io_throttle_enabled; + scsi_tgt_priv_data->wslen = tgt_dev->wslen; + tgt_dev->starget = starget; + atomic_set(&scsi_tgt_priv_data->block_io, 0); + retval = 0; + } else retval = -ENXIO; } - - if (update_stgt_priv_data) { - scsi_tgt_priv_data->starget = starget; - scsi_tgt_priv_data->dev_handle = tgt_dev->dev_handle; - scsi_tgt_priv_data->perst_id = tgt_dev->perst_id; - scsi_tgt_priv_data->dev_type = tgt_dev->dev_type; - scsi_tgt_priv_data->tgt_dev = tgt_dev; - tgt_dev->starget = starget; - atomic_set(&scsi_tgt_priv_data->block_io, 0); - retval = 0; - scsi_tgt_priv_data->io_throttle_enabled = - tgt_dev->io_throttle_enabled; - if (tgt_dev->dev_type == MPI3_DEVICE_DEVFORM_VD) - scsi_tgt_priv_data->throttle_group = - tgt_dev->dev_spec.vd_inf.tg; - } spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags); return retval; @@ -4732,6 +4845,10 @@ mpi3mr_setup_eedp(mrioc, scmd, scsiio_req); + if (stgt_priv_data->wslen) + mpi3mr_setup_divert_ws(mrioc, scmd, scsiio_req, &scsiio_flags, + stgt_priv_data->wslen); + memcpy(scsiio_req->cdb.cdb32, scmd->cmnd, scmd->cmd_len); scsiio_req->data_length = cpu_to_le32(scsi_bufflen(scmd)); scsiio_req->dev_handle = cpu_to_le16(dev_handle); @@ -4811,6 +4928,7 @@ .change_queue_depth = mpi3mr_change_queue_depth, .eh_device_reset_handler = mpi3mr_eh_dev_reset, .eh_target_reset_handler = mpi3mr_eh_target_reset, + .eh_bus_reset_handler = mpi3mr_eh_bus_reset, .eh_host_reset_handler = mpi3mr_eh_host_reset, .bios_param = mpi3mr_bios_param, .map_queues = mpi3mr_map_queues, @@ -4818,10 +4936,10 @@ .no_write_same = 1, .can_queue = 1, .this_id = -1, - .sg_tablesize = MPI3MR_SG_DEPTH, + .sg_tablesize = MPI3MR_DEFAULT_SGL_ENTRIES, /* max xfer supported is 1M (2K in 512 byte sized sectors) */ - .max_sectors = 2048, + .max_sectors = (MPI3MR_DEFAULT_MAX_IO_SIZE / 512), .cmd_per_lun = MPI3MR_MAX_CMDS_LUN, .max_segment_size = 0xffffffff, .track_queue_depth = 1, @@ -4995,7 +5113,10 @@ mpi3mr_init_drv_cmd(&mrioc->evtack_cmds[i], MPI3MR_HOSTTAG_EVTACKCMD_MIN + i); - if (pdev->revision) + if ((pdev->device == MPI3_MFGPAGE_DEVID_SAS4116) && + !pdev->revision) + mrioc->enable_segqueue = false; + else mrioc->enable_segqueue = true; init_waitqueue_head(&mrioc->reset_waitq); @@ -5004,6 +5125,16 @@ mrioc->pdev = pdev; mrioc->stop_bsgs = 1; + mrioc->max_sgl_entries = max_sgl_entries; + if (max_sgl_entries > MPI3MR_MAX_SGL_ENTRIES) + mrioc->max_sgl_entries = MPI3MR_MAX_SGL_ENTRIES; + else if (max_sgl_entries < MPI3MR_DEFAULT_SGL_ENTRIES) + mrioc->max_sgl_entries = MPI3MR_DEFAULT_SGL_ENTRIES; + else { + mrioc->max_sgl_entries /= MPI3MR_DEFAULT_SGL_ENTRIES; + mrioc->max_sgl_entries *= MPI3MR_DEFAULT_SGL_ENTRIES; + } + /* init shost parameters */ shost->max_cmd_len = MPI3MR_MAX_CDB_LENGTH; shost->max_lun = -1; @@ -5068,7 +5199,7 @@ shost->nr_maps = 3; shost->can_queue = mrioc->max_host_ios; - shost->sg_tablesize = MPI3MR_SG_DEPTH; + shost->sg_tablesize = mrioc->max_sgl_entries; shost->max_id = mrioc->facts.max_perids + 1; retval = scsi_add_host(shost, &pdev->dev); @@ -5314,6 +5445,14 @@ PCI_DEVICE_SUB(MPI3_MFGPAGE_VENDORID_BROADCOM, MPI3_MFGPAGE_DEVID_SAS4116, PCI_ANY_ID, PCI_ANY_ID) }, + { + PCI_DEVICE_SUB(MPI3_MFGPAGE_VENDORID_BROADCOM, + MPI3_MFGPAGE_DEVID_SAS5116_MPI, PCI_ANY_ID, PCI_ANY_ID) + }, + { + PCI_DEVICE_SUB(MPI3_MFGPAGE_VENDORID_BROADCOM, + MPI3_MFGPAGE_DEVID_SAS5116_MPI_MGMT, PCI_ANY_ID, PCI_ANY_ID) + }, { 0 } }; MODULE_DEVICE_TABLE(pci, mpi3mr_pci_id_table); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/mpi3mr/mpi3mr_transport.c +++ linux-aws-6.5-6.5.0/drivers/scsi/mpi3mr/mpi3mr_transport.c @@ -1587,7 +1587,7 @@ */ struct host_port { u64 sas_address; - u32 phy_mask; + u64 phy_mask; u16 handle; u8 iounit_port_id; u8 used; @@ -1611,7 +1611,7 @@ struct mpi3mr_sas_port *mr_sas_port) { struct mpi3mr_sas_phy *mr_sas_phy; - u32 phy_mask_xor; + u64 phy_mask_xor; u64 phys_to_be_added, phys_to_be_removed; int i; @@ -1619,7 +1619,7 @@ mr_sas_port->marked_responding = 1; dev_info(&mr_sas_port->port->dev, - "sas_address(0x%016llx), old: port_id %d phy_mask 0x%x, new: port_id %d phy_mask:0x%x\n", + "sas_address(0x%016llx), old: port_id %d phy_mask 0x%llx, new: port_id %d phy_mask:0x%llx\n", mr_sas_port->remote_identify.sas_address, mr_sas_port->hba_port->port_id, mr_sas_port->phy_mask, h_port->iounit_port_id, h_port->phy_mask); @@ -1637,7 +1637,7 @@ * if these phys are previously registered with another port * then delete these phys from that port first. */ - for_each_set_bit(i, (ulong *) &phys_to_be_added, BITS_PER_TYPE(u32)) { + for_each_set_bit(i, (ulong *) &phys_to_be_added, BITS_PER_TYPE(u64)) { mr_sas_phy = &mrioc->sas_hba.phy[i]; if (mr_sas_phy->phy_belongs_to_port) mpi3mr_del_phy_from_an_existing_port(mrioc, @@ -1649,7 +1649,7 @@ } /* Delete the phys which are not part of current mr_sas_port's port. */ - for_each_set_bit(i, (ulong *) &phys_to_be_removed, BITS_PER_TYPE(u32)) { + for_each_set_bit(i, (ulong *) &phys_to_be_removed, BITS_PER_TYPE(u64)) { mr_sas_phy = &mrioc->sas_hba.phy[i]; if (mr_sas_phy->phy_belongs_to_port) mpi3mr_del_phy_from_an_existing_port(mrioc, @@ -1671,7 +1671,7 @@ void mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc) { - struct host_port h_port[32]; + struct host_port h_port[64]; int i, j, found, host_port_count = 0, port_idx; u16 sz, attached_handle, ioc_status; struct mpi3_sas_io_unit_page0 *sas_io_unit_pg0 = NULL; @@ -1742,7 +1742,7 @@ list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list, port_list) { ioc_info(mrioc, - "port_id:%d, sas_address:(0x%016llx), phy_mask:(0x%x), lowest phy id:%d\n", + "port_id:%d, sas_address:(0x%016llx), phy_mask:(0x%llx), lowest phy id:%d\n", mr_sas_port->hba_port->port_id, mr_sas_port->remote_identify.sas_address, mr_sas_port->phy_mask, mr_sas_port->lowest_phy); @@ -1751,7 +1751,7 @@ ioc_info(mrioc, "Host port details after reset\n"); for (i = 0; i < host_port_count; i++) { ioc_info(mrioc, - "port_id:%d, sas_address:(0x%016llx), phy_mask:(0x%x), lowest phy id:%d\n", + "port_id:%d, sas_address:(0x%016llx), phy_mask:(0x%llx), lowest phy id:%d\n", h_port[i].iounit_port_id, h_port[i].sas_address, h_port[i].phy_mask, h_port[i].lowest_phy); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ linux-aws-6.5-6.5.0/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -12913,8 +12913,10 @@ mpt3sas_ctl_init(hbas_to_enumerate); error = pci_register_driver(&mpt3sas_driver); - if (error) + if (error) { + mpt3sas_ctl_exit(hbas_to_enumerate); scsih_exit(); + } return error; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/soc/amlogic/meson-ee-pwrc.c +++ linux-aws-6.5-6.5.0/drivers/soc/amlogic/meson-ee-pwrc.c @@ -229,7 +229,7 @@ static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_nna[] = { { G12A_HHI_NANOQ_MEM_PD_REG0, GENMASK(31, 0) }, - { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(23, 0) }, + { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(31, 0) }, }; #define VPU_PD(__name, __top_pd, __mem, __is_pwr_off, __resets, __clks) \ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/soc/bcm/bcm2835-power.c +++ linux-aws-6.5-6.5.0/drivers/soc/bcm/bcm2835-power.c @@ -175,7 +175,7 @@ } writel(PM_PASSWORD | val, base + reg); - while (readl(base + reg) & ASB_ACK) { + while (!!(readl(base + reg) & ASB_ACK) == enable) { cpu_relax(); if (ktime_get_ns() - start >= 1000) return -ETIMEDOUT; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/soc/imx/gpc.c +++ linux-aws-6.5-6.5.0/drivers/soc/imx/gpc.c @@ -498,6 +498,7 @@ pd_pdev->dev.parent = &pdev->dev; pd_pdev->dev.of_node = np; + pd_pdev->dev.fwnode = of_fwnode_handle(np); ret = platform_device_add(pd_pdev); if (ret) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/soc/qcom/llcc-qcom.c +++ linux-aws-6.5-6.5.0/drivers/soc/qcom/llcc-qcom.c @@ -945,6 +945,9 @@ u32 version; struct regmap *regmap; + if (!IS_ERR(drv_data)) + return -EBUSY; + drv_data = devm_kzalloc(dev, sizeof(*drv_data), GFP_KERNEL); if (!drv_data) { ret = -ENOMEM; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/soc/qcom/pmic_glink_altmode.c +++ linux-aws-6.5-6.5.0/drivers/soc/qcom/pmic_glink_altmode.c @@ -416,7 +416,7 @@ alt_port->bridge.funcs = &pmic_glink_altmode_bridge_funcs; alt_port->bridge.of_node = to_of_node(fwnode); alt_port->bridge.ops = DRM_BRIDGE_OP_HPD; - alt_port->bridge.type = DRM_MODE_CONNECTOR_USB; + alt_port->bridge.type = DRM_MODE_CONNECTOR_DisplayPort; ret = devm_drm_bridge_add(dev, &alt_port->bridge); if (ret) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/soundwire/dmi-quirks.c +++ linux-aws-6.5-6.5.0/drivers/soundwire/dmi-quirks.c @@ -141,7 +141,7 @@ { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16-k0xxx"), + DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16"), }, .driver_data = (void *)hp_omen_16, }, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/spi/Kconfig +++ linux-aws-6.5-6.5.0/drivers/spi/Kconfig @@ -1124,6 +1124,7 @@ config SPI_ZYNQ_QSPI tristate "Xilinx Zynq QSPI controller" depends on ARCH_ZYNQ || COMPILE_TEST + depends on SPI_MEM help This enables support for the Zynq Quad SPI controller in master mode. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/spi/spi-npcm-fiu.c +++ linux-aws-6.5-6.5.0/drivers/spi/spi-npcm-fiu.c @@ -353,8 +353,9 @@ uma_cfg |= ilog2(op->cmd.buswidth); uma_cfg |= ilog2(op->addr.buswidth) << NPCM_FIU_UMA_CFG_ADBPCK_SHIFT; - uma_cfg |= ilog2(op->dummy.buswidth) - << NPCM_FIU_UMA_CFG_DBPCK_SHIFT; + if (op->dummy.nbytes) + uma_cfg |= ilog2(op->dummy.buswidth) + << NPCM_FIU_UMA_CFG_DBPCK_SHIFT; uma_cfg |= ilog2(op->data.buswidth) << NPCM_FIU_UMA_CFG_RDBPCK_SHIFT; uma_cfg |= op->dummy.nbytes << NPCM_FIU_UMA_CFG_DBSIZ_SHIFT; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/spi/spi-omap2-mcspi.c +++ linux-aws-6.5-6.5.0/drivers/spi/spi-omap2-mcspi.c @@ -117,7 +117,7 @@ struct omap2_mcspi { struct completion txdone; - struct spi_master *master; + struct spi_controller *ctlr; /* Virtual base address of the controller */ void __iomem *base; unsigned long phys; @@ -125,10 +125,12 @@ struct omap2_mcspi_dma *dma_channels; struct device *dev; struct omap2_mcspi_regs ctx; + struct clk *ref_clk; int fifo_depth; - bool slave_aborted; + bool target_aborted; unsigned int pin_dir:1; size_t max_xfer_len; + u32 ref_clk_hz; }; struct omap2_mcspi_cs { @@ -141,17 +143,17 @@ u32 chconf0, chctrl0; }; -static inline void mcspi_write_reg(struct spi_master *master, +static inline void mcspi_write_reg(struct spi_controller *ctlr, int idx, u32 val) { - struct omap2_mcspi *mcspi = spi_master_get_devdata(master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); writel_relaxed(val, mcspi->base + idx); } -static inline u32 mcspi_read_reg(struct spi_master *master, int idx) +static inline u32 mcspi_read_reg(struct spi_controller *ctlr, int idx) { - struct omap2_mcspi *mcspi = spi_master_get_devdata(master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); return readl_relaxed(mcspi->base + idx); } @@ -235,7 +237,7 @@ static void omap2_mcspi_set_cs(struct spi_device *spi, bool enable) { - struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(spi->controller); u32 l; /* The controller handles the inverted chip selects @@ -266,24 +268,24 @@ } } -static void omap2_mcspi_set_mode(struct spi_master *master) +static void omap2_mcspi_set_mode(struct spi_controller *ctlr) { - struct omap2_mcspi *mcspi = spi_master_get_devdata(master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); struct omap2_mcspi_regs *ctx = &mcspi->ctx; u32 l; /* - * Choose master or slave mode + * Choose host or target mode */ - l = mcspi_read_reg(master, OMAP2_MCSPI_MODULCTRL); + l = mcspi_read_reg(ctlr, OMAP2_MCSPI_MODULCTRL); l &= ~(OMAP2_MCSPI_MODULCTRL_STEST); - if (spi_controller_is_slave(master)) { + if (spi_controller_is_target(ctlr)) { l |= (OMAP2_MCSPI_MODULCTRL_MS); } else { l &= ~(OMAP2_MCSPI_MODULCTRL_MS); l |= OMAP2_MCSPI_MODULCTRL_SINGLE; } - mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, l); + mcspi_write_reg(ctlr, OMAP2_MCSPI_MODULCTRL, l); ctx->modulctrl = l; } @@ -291,14 +293,14 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi, struct spi_transfer *t, int enable) { - struct spi_master *master = spi->master; + struct spi_controller *ctlr = spi->controller; struct omap2_mcspi_cs *cs = spi->controller_state; struct omap2_mcspi *mcspi; unsigned int wcnt; int max_fifo_depth, bytes_per_word; u32 chconf, xferlevel; - mcspi = spi_master_get_devdata(master); + mcspi = spi_controller_get_devdata(ctlr); chconf = mcspi_cached_chconf0(spi); if (enable) { @@ -326,7 +328,7 @@ xferlevel |= bytes_per_word - 1; } - mcspi_write_reg(master, OMAP2_MCSPI_XFERLEVEL, xferlevel); + mcspi_write_reg(ctlr, OMAP2_MCSPI_XFERLEVEL, xferlevel); mcspi_write_chconf0(spi, chconf); mcspi->fifo_depth = max_fifo_depth; @@ -364,9 +366,9 @@ static int mcspi_wait_for_completion(struct omap2_mcspi *mcspi, struct completion *x) { - if (spi_controller_is_slave(mcspi->master)) { + if (spi_controller_is_target(mcspi->ctlr)) { if (wait_for_completion_interruptible(x) || - mcspi->slave_aborted) + mcspi->target_aborted) return -EINTR; } else { wait_for_completion(x); @@ -378,7 +380,7 @@ static void omap2_mcspi_rx_callback(void *data) { struct spi_device *spi = data; - struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(spi->controller); struct omap2_mcspi_dma *mcspi_dma = &mcspi->dma_channels[spi_get_chipselect(spi, 0)]; /* We must disable the DMA RX request */ @@ -390,7 +392,7 @@ static void omap2_mcspi_tx_callback(void *data) { struct spi_device *spi = data; - struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(spi->controller); struct omap2_mcspi_dma *mcspi_dma = &mcspi->dma_channels[spi_get_chipselect(spi, 0)]; /* We must disable the DMA TX request */ @@ -407,7 +409,7 @@ struct omap2_mcspi_dma *mcspi_dma; struct dma_async_tx_descriptor *tx; - mcspi = spi_master_get_devdata(spi->master); + mcspi = spi_controller_get_devdata(spi->controller); mcspi_dma = &mcspi->dma_channels[spi_get_chipselect(spi, 0)]; dmaengine_slave_config(mcspi_dma->dma_tx, &cfg); @@ -445,13 +447,13 @@ void __iomem *chstat_reg = cs->base + OMAP2_MCSPI_CHSTAT0; struct dma_async_tx_descriptor *tx; - mcspi = spi_master_get_devdata(spi->master); + mcspi = spi_controller_get_devdata(spi->controller); mcspi_dma = &mcspi->dma_channels[spi_get_chipselect(spi, 0)]; count = xfer->len; /* * In the "End-of-Transfer Procedure" section for DMA RX in OMAP35x TRM - * it mentions reducing DMA transfer length by one element in master + * it mentions reducing DMA transfer length by one element in host * normal mode. */ if (mcspi->fifo_depth == 0) @@ -514,7 +516,7 @@ omap2_mcspi_set_dma_req(spi, 1, 1); ret = mcspi_wait_for_completion(mcspi, &mcspi_dma->dma_rx_completion); - if (ret || mcspi->slave_aborted) { + if (ret || mcspi->target_aborted) { dmaengine_terminate_sync(mcspi_dma->dma_rx); omap2_mcspi_set_dma_req(spi, 1, 0); return 0; @@ -590,7 +592,7 @@ void __iomem *irqstat_reg; int wait_res; - mcspi = spi_master_get_devdata(spi->master); + mcspi = spi_controller_get_devdata(spi->controller); mcspi_dma = &mcspi->dma_channels[spi_get_chipselect(spi, 0)]; if (cs->word_len <= 8) { @@ -617,14 +619,14 @@ rx = xfer->rx_buf; tx = xfer->tx_buf; - mcspi->slave_aborted = false; + mcspi->target_aborted = false; reinit_completion(&mcspi_dma->dma_tx_completion); reinit_completion(&mcspi_dma->dma_rx_completion); reinit_completion(&mcspi->txdone); if (tx) { - /* Enable EOW IRQ to know end of tx in slave mode */ - if (spi_controller_is_slave(spi->master)) - mcspi_write_reg(spi->master, + /* Enable EOW IRQ to know end of tx in target mode */ + if (spi_controller_is_target(spi->controller)) + mcspi_write_reg(spi->controller, OMAP2_MCSPI_IRQENABLE, OMAP2_MCSPI_IRQSTATUS_EOW); omap2_mcspi_tx_dma(spi, xfer, cfg); @@ -637,15 +639,15 @@ int ret; ret = mcspi_wait_for_completion(mcspi, &mcspi_dma->dma_tx_completion); - if (ret || mcspi->slave_aborted) { + if (ret || mcspi->target_aborted) { dmaengine_terminate_sync(mcspi_dma->dma_tx); omap2_mcspi_set_dma_req(spi, 0, 0); return 0; } - if (spi_controller_is_slave(mcspi->master)) { + if (spi_controller_is_target(mcspi->ctlr)) { ret = mcspi_wait_for_completion(mcspi, &mcspi->txdone); - if (ret || mcspi->slave_aborted) + if (ret || mcspi->target_aborted) return 0; } @@ -656,7 +658,7 @@ OMAP2_MCSPI_IRQSTATUS_EOW) < 0) dev_err(&spi->dev, "EOW timed out\n"); - mcspi_write_reg(mcspi->master, OMAP2_MCSPI_IRQSTATUS, + mcspi_write_reg(mcspi->ctlr, OMAP2_MCSPI_IRQSTATUS, OMAP2_MCSPI_IRQSTATUS_EOW); } @@ -880,12 +882,12 @@ return count - c; } -static u32 omap2_mcspi_calc_divisor(u32 speed_hz) +static u32 omap2_mcspi_calc_divisor(u32 speed_hz, u32 ref_clk_hz) { u32 div; for (div = 0; div < 15; div++) - if (speed_hz >= (OMAP2_MCSPI_MAX_FREQ >> div)) + if (speed_hz >= (ref_clk_hz >> div)) return div; return 15; @@ -897,11 +899,11 @@ { struct omap2_mcspi_cs *cs = spi->controller_state; struct omap2_mcspi *mcspi; - u32 l = 0, clkd = 0, div, extclk = 0, clkg = 0; + u32 ref_clk_hz, l = 0, clkd = 0, div, extclk = 0, clkg = 0; u8 word_len = spi->bits_per_word; u32 speed_hz = spi->max_speed_hz; - mcspi = spi_master_get_devdata(spi->master); + mcspi = spi_controller_get_devdata(spi->controller); if (t != NULL && t->bits_per_word) word_len = t->bits_per_word; @@ -911,14 +913,15 @@ if (t && t->speed_hz) speed_hz = t->speed_hz; - speed_hz = min_t(u32, speed_hz, OMAP2_MCSPI_MAX_FREQ); - if (speed_hz < (OMAP2_MCSPI_MAX_FREQ / OMAP2_MCSPI_MAX_DIVIDER)) { - clkd = omap2_mcspi_calc_divisor(speed_hz); - speed_hz = OMAP2_MCSPI_MAX_FREQ >> clkd; + ref_clk_hz = mcspi->ref_clk_hz; + speed_hz = min_t(u32, speed_hz, ref_clk_hz); + if (speed_hz < (ref_clk_hz / OMAP2_MCSPI_MAX_DIVIDER)) { + clkd = omap2_mcspi_calc_divisor(speed_hz, ref_clk_hz); + speed_hz = ref_clk_hz >> clkd; clkg = 0; } else { - div = (OMAP2_MCSPI_MAX_FREQ + speed_hz - 1) / speed_hz; - speed_hz = OMAP2_MCSPI_MAX_FREQ / div; + div = (ref_clk_hz + speed_hz - 1) / speed_hz; + speed_hz = ref_clk_hz / div; clkd = (div - 1) & 0xf; extclk = (div - 1) >> 4; clkg = OMAP2_MCSPI_CHCONF_CLKG; @@ -926,7 +929,7 @@ l = mcspi_cached_chconf0(spi); - /* standard 4-wire master mode: SCK, MOSI/out, MISO/in, nCS + /* standard 4-wire host mode: SCK, MOSI/out, MISO/in, nCS * REVISIT: this controller could support SPI_3WIRE mode. */ if (mcspi->pin_dir == MCSPI_PINDIR_D0_IN_D1_OUT) { @@ -1017,13 +1020,13 @@ return ret; } -static void omap2_mcspi_release_dma(struct spi_master *master) +static void omap2_mcspi_release_dma(struct spi_controller *ctlr) { - struct omap2_mcspi *mcspi = spi_master_get_devdata(master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); struct omap2_mcspi_dma *mcspi_dma; int i; - for (i = 0; i < master->num_chipselect; i++) { + for (i = 0; i < ctlr->num_chipselect; i++) { mcspi_dma = &mcspi->dma_channels[i]; if (mcspi_dma->dma_rx) { @@ -1054,7 +1057,7 @@ { bool initial_setup = false; int ret; - struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(spi->controller); struct omap2_mcspi_regs *ctx = &mcspi->ctx; struct omap2_mcspi_cs *cs = spi->controller_state; @@ -1096,24 +1099,24 @@ struct omap2_mcspi *mcspi = data; u32 irqstat; - irqstat = mcspi_read_reg(mcspi->master, OMAP2_MCSPI_IRQSTATUS); + irqstat = mcspi_read_reg(mcspi->ctlr, OMAP2_MCSPI_IRQSTATUS); if (!irqstat) return IRQ_NONE; - /* Disable IRQ and wakeup slave xfer task */ - mcspi_write_reg(mcspi->master, OMAP2_MCSPI_IRQENABLE, 0); + /* Disable IRQ and wakeup target xfer task */ + mcspi_write_reg(mcspi->ctlr, OMAP2_MCSPI_IRQENABLE, 0); if (irqstat & OMAP2_MCSPI_IRQSTATUS_EOW) complete(&mcspi->txdone); return IRQ_HANDLED; } -static int omap2_mcspi_slave_abort(struct spi_master *master) +static int omap2_mcspi_target_abort(struct spi_controller *ctlr) { - struct omap2_mcspi *mcspi = spi_master_get_devdata(master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); struct omap2_mcspi_dma *mcspi_dma = mcspi->dma_channels; - mcspi->slave_aborted = true; + mcspi->target_aborted = true; complete(&mcspi_dma->dma_rx_completion); complete(&mcspi_dma->dma_tx_completion); complete(&mcspi->txdone); @@ -1121,7 +1124,7 @@ return 0; } -static int omap2_mcspi_transfer_one(struct spi_master *master, +static int omap2_mcspi_transfer_one(struct spi_controller *ctlr, struct spi_device *spi, struct spi_transfer *t) { @@ -1129,7 +1132,7 @@ /* We only enable one channel at a time -- the one whose message is * -- although this controller would gladly * arbitrate among multiple channels. This corresponds to "single - * channel" master mode. As a side effect, we need to manage the + * channel" host mode. As a side effect, we need to manage the * chipselect with the FORCE bit ... CS != channel enable. */ @@ -1141,13 +1144,13 @@ int status = 0; u32 chconf; - mcspi = spi_master_get_devdata(master); + mcspi = spi_controller_get_devdata(ctlr); mcspi_dma = mcspi->dma_channels + spi_get_chipselect(spi, 0); cs = spi->controller_state; cd = spi->controller_data; /* - * The slave driver could have changed spi->mode in which case + * The target driver could have changed spi->mode in which case * it will be different from cs->mode (the current hardware setup). * If so, set par_override (even though its not a parity issue) so * omap2_mcspi_setup_transfer will be called to configure the hardware @@ -1175,7 +1178,7 @@ if (cd && cd->cs_per_word) { chconf = mcspi->ctx.modulctrl; chconf &= ~OMAP2_MCSPI_MODULCTRL_SINGLE; - mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, chconf); + mcspi_write_reg(ctlr, OMAP2_MCSPI_MODULCTRL, chconf); mcspi->ctx.modulctrl = mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL); } @@ -1201,8 +1204,8 @@ unsigned count; if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) && - master->cur_msg_mapped && - master->can_dma(master, spi, t)) + ctlr->cur_msg_mapped && + ctlr->can_dma(ctlr, spi, t)) omap2_mcspi_set_fifo(spi, t, 1); omap2_mcspi_set_enable(spi, 1); @@ -1213,8 +1216,8 @@ + OMAP2_MCSPI_TX0); if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) && - master->cur_msg_mapped && - master->can_dma(master, spi, t)) + ctlr->cur_msg_mapped && + ctlr->can_dma(ctlr, spi, t)) count = omap2_mcspi_txrx_dma(spi, t); else count = omap2_mcspi_txrx_pio(spi, t); @@ -1240,7 +1243,7 @@ if (cd && cd->cs_per_word) { chconf = mcspi->ctx.modulctrl; chconf |= OMAP2_MCSPI_MODULCTRL_SINGLE; - mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, chconf); + mcspi_write_reg(ctlr, OMAP2_MCSPI_MODULCTRL, chconf); mcspi->ctx.modulctrl = mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL); } @@ -1256,10 +1259,10 @@ return status; } -static int omap2_mcspi_prepare_message(struct spi_master *master, +static int omap2_mcspi_prepare_message(struct spi_controller *ctlr, struct spi_message *msg) { - struct omap2_mcspi *mcspi = spi_master_get_devdata(master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); struct omap2_mcspi_regs *ctx = &mcspi->ctx; struct omap2_mcspi_cs *cs; @@ -1283,29 +1286,29 @@ return 0; } -static bool omap2_mcspi_can_dma(struct spi_master *master, +static bool omap2_mcspi_can_dma(struct spi_controller *ctlr, struct spi_device *spi, struct spi_transfer *xfer) { - struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(spi->controller); struct omap2_mcspi_dma *mcspi_dma = &mcspi->dma_channels[spi_get_chipselect(spi, 0)]; if (!mcspi_dma->dma_rx || !mcspi_dma->dma_tx) return false; - if (spi_controller_is_slave(master)) + if (spi_controller_is_target(ctlr)) return true; - master->dma_rx = mcspi_dma->dma_rx; - master->dma_tx = mcspi_dma->dma_tx; + ctlr->dma_rx = mcspi_dma->dma_rx; + ctlr->dma_tx = mcspi_dma->dma_tx; return (xfer->len >= DMA_MIN_BYTES); } static size_t omap2_mcspi_max_xfer_size(struct spi_device *spi) { - struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(spi->controller); struct omap2_mcspi_dma *mcspi_dma = &mcspi->dma_channels[spi_get_chipselect(spi, 0)]; @@ -1317,7 +1320,7 @@ static int omap2_mcspi_controller_setup(struct omap2_mcspi *mcspi) { - struct spi_master *master = mcspi->master; + struct spi_controller *ctlr = mcspi->ctlr; struct omap2_mcspi_regs *ctx = &mcspi->ctx; int ret = 0; @@ -1325,11 +1328,11 @@ if (ret < 0) return ret; - mcspi_write_reg(master, OMAP2_MCSPI_WAKEUPENABLE, + mcspi_write_reg(ctlr, OMAP2_MCSPI_WAKEUPENABLE, OMAP2_MCSPI_WAKEUPENABLE_WKEN); ctx->wakeupenable = OMAP2_MCSPI_WAKEUPENABLE_WKEN; - omap2_mcspi_set_mode(master); + omap2_mcspi_set_mode(ctlr); pm_runtime_mark_last_busy(mcspi->dev); pm_runtime_put_autosuspend(mcspi->dev); return 0; @@ -1353,8 +1356,8 @@ */ static int omap_mcspi_runtime_resume(struct device *dev) { - struct spi_master *master = dev_get_drvdata(dev); - struct omap2_mcspi *mcspi = spi_master_get_devdata(master); + struct spi_controller *ctlr = dev_get_drvdata(dev); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); struct omap2_mcspi_regs *ctx = &mcspi->ctx; struct omap2_mcspi_cs *cs; int error; @@ -1364,8 +1367,8 @@ dev_warn(dev, "%s: failed to set pins: %i\n", __func__, error); /* McSPI: context restore */ - mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, ctx->modulctrl); - mcspi_write_reg(master, OMAP2_MCSPI_WAKEUPENABLE, ctx->wakeupenable); + mcspi_write_reg(ctlr, OMAP2_MCSPI_MODULCTRL, ctx->modulctrl); + mcspi_write_reg(ctlr, OMAP2_MCSPI_WAKEUPENABLE, ctx->wakeupenable); list_for_each_entry(cs, &ctx->cs, node) { /* @@ -1420,7 +1423,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev) { - struct spi_master *master; + struct spi_controller *ctlr; const struct omap2_mcspi_platform_config *pdata; struct omap2_mcspi *mcspi; struct resource *r; @@ -1430,32 +1433,30 @@ const struct of_device_id *match; if (of_property_read_bool(node, "spi-slave")) - master = spi_alloc_slave(&pdev->dev, sizeof(*mcspi)); + ctlr = spi_alloc_target(&pdev->dev, sizeof(*mcspi)); else - master = spi_alloc_master(&pdev->dev, sizeof(*mcspi)); - if (!master) + ctlr = spi_alloc_host(&pdev->dev, sizeof(*mcspi)); + if (!ctlr) return -ENOMEM; /* the spi->mode bits understood by this driver: */ - master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; - master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32); - master->setup = omap2_mcspi_setup; - master->auto_runtime_pm = true; - master->prepare_message = omap2_mcspi_prepare_message; - master->can_dma = omap2_mcspi_can_dma; - master->transfer_one = omap2_mcspi_transfer_one; - master->set_cs = omap2_mcspi_set_cs; - master->cleanup = omap2_mcspi_cleanup; - master->slave_abort = omap2_mcspi_slave_abort; - master->dev.of_node = node; - master->max_speed_hz = OMAP2_MCSPI_MAX_FREQ; - master->min_speed_hz = OMAP2_MCSPI_MAX_FREQ >> 15; - master->use_gpio_descriptors = true; + ctlr->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; + ctlr->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32); + ctlr->setup = omap2_mcspi_setup; + ctlr->auto_runtime_pm = true; + ctlr->prepare_message = omap2_mcspi_prepare_message; + ctlr->can_dma = omap2_mcspi_can_dma; + ctlr->transfer_one = omap2_mcspi_transfer_one; + ctlr->set_cs = omap2_mcspi_set_cs; + ctlr->cleanup = omap2_mcspi_cleanup; + ctlr->target_abort = omap2_mcspi_target_abort; + ctlr->dev.of_node = node; + ctlr->use_gpio_descriptors = true; - platform_set_drvdata(pdev, master); + platform_set_drvdata(pdev, ctlr); - mcspi = spi_master_get_devdata(master); - mcspi->master = master; + mcspi = spi_controller_get_devdata(ctlr); + mcspi->ctlr = ctlr; match = of_match_device(omap_mcspi_of_match, &pdev->dev); if (match) { @@ -1463,24 +1464,24 @@ pdata = match->data; of_property_read_u32(node, "ti,spi-num-cs", &num_cs); - master->num_chipselect = num_cs; + ctlr->num_chipselect = num_cs; if (of_property_read_bool(node, "ti,pindir-d0-out-d1-in")) mcspi->pin_dir = MCSPI_PINDIR_D0_OUT_D1_IN; } else { pdata = dev_get_platdata(&pdev->dev); - master->num_chipselect = pdata->num_cs; + ctlr->num_chipselect = pdata->num_cs; mcspi->pin_dir = pdata->pin_dir; } regs_offset = pdata->regs_offset; if (pdata->max_xfer_len) { mcspi->max_xfer_len = pdata->max_xfer_len; - master->max_transfer_size = omap2_mcspi_max_xfer_size; + ctlr->max_transfer_size = omap2_mcspi_max_xfer_size; } mcspi->base = devm_platform_get_and_ioremap_resource(pdev, 0, &r); if (IS_ERR(mcspi->base)) { status = PTR_ERR(mcspi->base); - goto free_master; + goto free_ctlr; } mcspi->phys = r->start + regs_offset; mcspi->base += regs_offset; @@ -1489,38 +1490,44 @@ INIT_LIST_HEAD(&mcspi->ctx.cs); - mcspi->dma_channels = devm_kcalloc(&pdev->dev, master->num_chipselect, + mcspi->dma_channels = devm_kcalloc(&pdev->dev, ctlr->num_chipselect, sizeof(struct omap2_mcspi_dma), GFP_KERNEL); if (mcspi->dma_channels == NULL) { status = -ENOMEM; - goto free_master; + goto free_ctlr; } - for (i = 0; i < master->num_chipselect; i++) { + for (i = 0; i < ctlr->num_chipselect; i++) { sprintf(mcspi->dma_channels[i].dma_rx_ch_name, "rx%d", i); sprintf(mcspi->dma_channels[i].dma_tx_ch_name, "tx%d", i); status = omap2_mcspi_request_dma(mcspi, &mcspi->dma_channels[i]); if (status == -EPROBE_DEFER) - goto free_master; + goto free_ctlr; } status = platform_get_irq(pdev, 0); - if (status < 0) { - dev_err_probe(&pdev->dev, status, "no irq resource found\n"); - goto free_master; - } + if (status < 0) + goto free_ctlr; init_completion(&mcspi->txdone); status = devm_request_irq(&pdev->dev, status, omap2_mcspi_irq_handler, 0, pdev->name, mcspi); if (status) { dev_err(&pdev->dev, "Cannot request IRQ"); - goto free_master; + goto free_ctlr; } + mcspi->ref_clk = devm_clk_get_optional_enabled(&pdev->dev, NULL); + if (mcspi->ref_clk) + mcspi->ref_clk_hz = clk_get_rate(mcspi->ref_clk); + else + mcspi->ref_clk_hz = OMAP2_MCSPI_MAX_FREQ; + ctlr->max_speed_hz = mcspi->ref_clk_hz; + ctlr->min_speed_hz = mcspi->ref_clk_hz >> 15; + pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT); pm_runtime_enable(&pdev->dev); @@ -1529,7 +1536,7 @@ if (status < 0) goto disable_pm; - status = devm_spi_register_controller(&pdev->dev, master); + status = devm_spi_register_controller(&pdev->dev, ctlr); if (status < 0) goto disable_pm; @@ -1539,18 +1546,18 @@ pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); -free_master: - omap2_mcspi_release_dma(master); - spi_master_put(master); +free_ctlr: + omap2_mcspi_release_dma(ctlr); + spi_controller_put(ctlr); return status; } static void omap2_mcspi_remove(struct platform_device *pdev) { - struct spi_master *master = platform_get_drvdata(pdev); - struct omap2_mcspi *mcspi = spi_master_get_devdata(master); + struct spi_controller *ctlr = platform_get_drvdata(pdev); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); - omap2_mcspi_release_dma(master); + omap2_mcspi_release_dma(ctlr); pm_runtime_dont_use_autosuspend(mcspi->dev); pm_runtime_put_sync(mcspi->dev); @@ -1562,8 +1569,8 @@ static int __maybe_unused omap2_mcspi_suspend(struct device *dev) { - struct spi_master *master = dev_get_drvdata(dev); - struct omap2_mcspi *mcspi = spi_master_get_devdata(master); + struct spi_controller *ctlr = dev_get_drvdata(dev); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); int error; error = pinctrl_pm_select_sleep_state(dev); @@ -1571,9 +1578,9 @@ dev_warn(mcspi->dev, "%s: failed to set pins: %i\n", __func__, error); - error = spi_master_suspend(master); + error = spi_controller_suspend(ctlr); if (error) - dev_warn(mcspi->dev, "%s: master suspend failed: %i\n", + dev_warn(mcspi->dev, "%s: controller suspend failed: %i\n", __func__, error); return pm_runtime_force_suspend(dev); @@ -1581,13 +1588,13 @@ static int __maybe_unused omap2_mcspi_resume(struct device *dev) { - struct spi_master *master = dev_get_drvdata(dev); - struct omap2_mcspi *mcspi = spi_master_get_devdata(master); + struct spi_controller *ctlr = dev_get_drvdata(dev); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); int error; - error = spi_master_resume(master); + error = spi_controller_resume(ctlr); if (error) - dev_warn(mcspi->dev, "%s: master resume failed: %i\n", + dev_warn(mcspi->dev, "%s: controller resume failed: %i\n", __func__, error); return pm_runtime_force_resume(dev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/spi/spi-tegra20-slink.c +++ linux-aws-6.5-6.5.0/drivers/spi/spi-tegra20-slink.c @@ -1093,6 +1093,8 @@ reset_control_deassert(tspi->rst); spi_irq = platform_get_irq(pdev, 0); + if (spi_irq < 0) + return spi_irq; tspi->irq = spi_irq; ret = request_threaded_irq(tspi->irq, tegra_slink_isr, tegra_slink_isr_thread, IRQF_ONESHOT, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/spi/spi.c +++ linux-aws-6.5-6.5.0/drivers/spi/spi.c @@ -3347,33 +3347,52 @@ } EXPORT_SYMBOL_GPL(spi_unregister_controller); +static inline int __spi_check_suspended(const struct spi_controller *ctlr) +{ + return ctlr->flags & SPI_CONTROLLER_SUSPENDED ? -ESHUTDOWN : 0; +} + +static inline void __spi_mark_suspended(struct spi_controller *ctlr) +{ + mutex_lock(&ctlr->bus_lock_mutex); + ctlr->flags |= SPI_CONTROLLER_SUSPENDED; + mutex_unlock(&ctlr->bus_lock_mutex); +} + +static inline void __spi_mark_resumed(struct spi_controller *ctlr) +{ + mutex_lock(&ctlr->bus_lock_mutex); + ctlr->flags &= ~SPI_CONTROLLER_SUSPENDED; + mutex_unlock(&ctlr->bus_lock_mutex); +} + int spi_controller_suspend(struct spi_controller *ctlr) { - int ret; + int ret = 0; /* Basically no-ops for non-queued controllers */ - if (!ctlr->queued) - return 0; - - ret = spi_stop_queue(ctlr); - if (ret) - dev_err(&ctlr->dev, "queue stop failed\n"); + if (ctlr->queued) { + ret = spi_stop_queue(ctlr); + if (ret) + dev_err(&ctlr->dev, "queue stop failed\n"); + } + __spi_mark_suspended(ctlr); return ret; } EXPORT_SYMBOL_GPL(spi_controller_suspend); int spi_controller_resume(struct spi_controller *ctlr) { - int ret; - - if (!ctlr->queued) - return 0; + int ret = 0; - ret = spi_start_queue(ctlr); - if (ret) - dev_err(&ctlr->dev, "queue restart failed\n"); + __spi_mark_resumed(ctlr); + if (ctlr->queued) { + ret = spi_start_queue(ctlr); + if (ret) + dev_err(&ctlr->dev, "queue restart failed\n"); + } return ret; } EXPORT_SYMBOL_GPL(spi_controller_resume); @@ -4184,8 +4203,7 @@ ctlr->cur_msg = msg; ret = __spi_pump_transfer_message(ctlr, msg, was_busy); if (ret) - goto out; - + dev_err(&ctlr->dev, "noqueue transfer failed\n"); ctlr->cur_msg = NULL; ctlr->fallback = false; @@ -4201,7 +4219,6 @@ spi_idle_runtime_pm(ctlr); } -out: mutex_unlock(&ctlr->io_mutex); } @@ -4224,6 +4241,11 @@ int status; struct spi_controller *ctlr = spi->controller; + if (__spi_check_suspended(ctlr)) { + dev_warn_once(&spi->dev, "Attempted to sync while suspend\n"); + return -ESHUTDOWN; + } + status = __spi_validate(spi, message); if (status != 0) return status; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/staging/media/sunxi/cedrus/cedrus_hw.c +++ linux-aws-6.5-6.5.0/drivers/staging/media/sunxi/cedrus/cedrus_hw.c @@ -172,12 +172,12 @@ { struct cedrus_dev *dev = dev_get_drvdata(device); - reset_control_assert(dev->rstc); - clk_disable_unprepare(dev->ram_clk); clk_disable_unprepare(dev->mod_clk); clk_disable_unprepare(dev->ahb_clk); + reset_control_assert(dev->rstc); + return 0; } @@ -186,11 +186,18 @@ struct cedrus_dev *dev = dev_get_drvdata(device); int ret; + ret = reset_control_reset(dev->rstc); + if (ret) { + dev_err(dev->dev, "Failed to apply reset\n"); + + return ret; + } + ret = clk_prepare_enable(dev->ahb_clk); if (ret) { dev_err(dev->dev, "Failed to enable AHB clock\n"); - return ret; + goto err_rst; } ret = clk_prepare_enable(dev->mod_clk); @@ -207,21 +214,14 @@ goto err_mod_clk; } - ret = reset_control_reset(dev->rstc); - if (ret) { - dev_err(dev->dev, "Failed to apply reset\n"); - - goto err_ram_clk; - } - return 0; -err_ram_clk: - clk_disable_unprepare(dev->ram_clk); err_mod_clk: clk_disable_unprepare(dev->mod_clk); err_ahb_clk: clk_disable_unprepare(dev->ahb_clk); +err_rst: + reset_control_assert(dev->rstc); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tee/optee/device.c +++ linux-aws-6.5-6.5.0/drivers/tee/optee/device.c @@ -60,7 +60,16 @@ kfree(optee_device); } -static int optee_register_device(const uuid_t *device_uuid) +static ssize_t need_supplicant_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + return 0; +} + +static DEVICE_ATTR_RO(need_supplicant); + +static int optee_register_device(const uuid_t *device_uuid, u32 func) { struct tee_client_device *optee_device = NULL; int rc; @@ -83,6 +92,10 @@ put_device(&optee_device->dev); } + if (func == PTA_CMD_GET_DEVICES_SUPP) + device_create_file(&optee_device->dev, + &dev_attr_need_supplicant); + return rc; } @@ -142,7 +155,7 @@ num_devices = shm_size / sizeof(uuid_t); for (idx = 0; idx < num_devices; idx++) { - rc = optee_register_device(&device_uuid[idx]); + rc = optee_register_device(&device_uuid[idx], func); if (rc) goto out_shm; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/thermal/intel/intel_powerclamp.c +++ linux-aws-6.5-6.5.0/drivers/thermal/intel/intel_powerclamp.c @@ -256,7 +256,7 @@ static const struct kernel_param_ops max_idle_ops = { .set = max_idle_set, - .get = param_get_int, + .get = param_get_byte, }; module_param_cb(max_idle, &max_idle_ops, &max_idle, 0644); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/thermal/mediatek/auxadc_thermal.c +++ linux-aws-6.5-6.5.0/drivers/thermal/mediatek/auxadc_thermal.c @@ -1268,7 +1268,7 @@ mtk_thermal_turn_on_buffer(mt, apmixed_base); - if (mt->conf->version != MTK_THERMAL_V2) + if (mt->conf->version != MTK_THERMAL_V1) mtk_thermal_release_periodic_ts(mt, auxadc_base); if (mt->conf->version == MTK_THERMAL_V1) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/thermal/thermal_core.c +++ linux-aws-6.5-6.5.0/drivers/thermal/thermal_core.c @@ -667,7 +667,8 @@ if (result) goto release_ida; - sprintf(dev->attr_name, "cdev%d_trip_point", dev->id); + snprintf(dev->attr_name, sizeof(dev->attr_name), "cdev%d_trip_point", + dev->id); sysfs_attr_init(&dev->attr.attr); dev->attr.attr.name = dev->attr_name; dev->attr.attr.mode = 0444; @@ -676,7 +677,8 @@ if (result) goto remove_symbol_link; - sprintf(dev->weight_attr_name, "cdev%d_weight", dev->id); + snprintf(dev->weight_attr_name, sizeof(dev->weight_attr_name), + "cdev%d_weight", dev->id); sysfs_attr_init(&dev->weight_attr.attr); dev->weight_attr.attr.name = dev->weight_attr_name; dev->weight_attr.attr.mode = S_IWUSR | S_IRUGO; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/thermal/thermal_trip.c +++ linux-aws-6.5-6.5.0/drivers/thermal/thermal_trip.c @@ -57,6 +57,7 @@ { struct thermal_trip trip; int low = -INT_MAX, high = INT_MAX; + bool same_trip = false; int i, ret; lockdep_assert_held(&tz->lock); @@ -65,6 +66,7 @@ return; for (i = 0; i < tz->num_trips; i++) { + bool low_set = false; int trip_low; ret = __thermal_zone_get_trip(tz, i , &trip); @@ -73,18 +75,31 @@ trip_low = trip.temperature - trip.hysteresis; - if (trip_low < tz->temperature && trip_low > low) + if (trip_low < tz->temperature && trip_low > low) { low = trip_low; + low_set = true; + same_trip = false; + } if (trip.temperature > tz->temperature && - trip.temperature < high) + trip.temperature < high) { high = trip.temperature; + same_trip = low_set; + } } /* No need to change trip points */ if (tz->prev_low_trip == low && tz->prev_high_trip == high) return; + /* + * If "high" and "low" are the same, skip the change unless this is the + * first time. + */ + if (same_trip && (tz->prev_low_trip != -INT_MAX || + tz->prev_high_trip != INT_MAX)) + return; + tz->prev_low_trip = low; tz->prev_high_trip = high; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/thunderbolt/quirks.c +++ linux-aws-6.5-6.5.0/drivers/thunderbolt/quirks.c @@ -31,6 +31,9 @@ { struct tb_port *port; + if (tb_switch_is_icm(sw)) + return; + tb_switch_for_each_port(sw, port) { if (!tb_port_is_usb3_down(port)) continue; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/thunderbolt/tb.c +++ linux-aws-6.5-6.5.0/drivers/thunderbolt/tb.c @@ -1907,14 +1907,14 @@ in = &sw->ports[ev->port]; if (!tb_port_is_dpin(in)) { tb_port_warn(in, "bandwidth request to non-DP IN adapter\n"); - goto unlock; + goto put_sw; } tb_port_dbg(in, "handling bandwidth allocation request\n"); if (!usb4_dp_port_bandwidth_mode_enabled(in)) { tb_port_warn(in, "bandwidth allocation mode not enabled\n"); - goto unlock; + goto put_sw; } ret = usb4_dp_port_requested_bandwidth(in); @@ -1923,7 +1923,7 @@ tb_port_dbg(in, "no bandwidth request active\n"); else tb_port_warn(in, "failed to read requested bandwidth\n"); - goto unlock; + goto put_sw; } requested_bw = ret; @@ -1932,7 +1932,7 @@ tunnel = tb_find_tunnel(tb, TB_TUNNEL_DP, in, NULL); if (!tunnel) { tb_port_warn(in, "failed to find tunnel\n"); - goto unlock; + goto put_sw; } out = tunnel->dst_port; @@ -1959,6 +1959,8 @@ tb_recalc_estimated_bandwidth(tb); } +put_sw: + tb_switch_put(sw); unlock: mutex_unlock(&tb->lock); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tty/hvc/hvc_xen.c +++ linux-aws-6.5-6.5.0/drivers/tty/hvc/hvc_xen.c @@ -377,18 +377,21 @@ #ifdef CONFIG_HVC_XEN_FRONTEND static void xencons_disconnect_backend(struct xencons_info *info) { - if (info->irq > 0) - unbind_from_irqhandler(info->irq, NULL); - info->irq = 0; + if (info->hvc != NULL) + hvc_remove(info->hvc); + info->hvc = NULL; + if (info->irq > 0) { + evtchn_put(info->evtchn); + info->irq = 0; + info->evtchn = 0; + } + /* evtchn_put() will also close it so this is only an error path */ if (info->evtchn > 0) xenbus_free_evtchn(info->xbdev, info->evtchn); info->evtchn = 0; if (info->gntref > 0) gnttab_free_grant_references(info->gntref); info->gntref = 0; - if (info->hvc != NULL) - hvc_remove(info->hvc); - info->hvc = NULL; } static void xencons_free(struct xencons_info *info) @@ -433,7 +436,7 @@ if (ret) return ret; info->evtchn = evtchn; - irq = bind_interdomain_evtchn_to_irq_lateeoi(dev, evtchn); + irq = bind_evtchn_to_irq_lateeoi(evtchn); if (irq < 0) return irq; info->irq = irq; @@ -553,10 +556,23 @@ if (dev->state == XenbusStateClosed) break; fallthrough; /* Missed the backend's CLOSING state */ - case XenbusStateClosing: + case XenbusStateClosing: { + struct xencons_info *info = dev_get_drvdata(&dev->dev);; + + /* + * Don't tear down the evtchn and grant ref before the other + * end has disconnected, but do stop userspace from trying + * to use the device before we allow the backend to close. + */ + if (info->hvc) { + hvc_remove(info->hvc); + info->hvc = NULL; + } + xenbus_frontend_closed(dev); break; } + } } static const struct xenbus_device_id xencons_ids[] = { @@ -588,7 +604,7 @@ ops = &dom0_hvc_ops; r = xen_initial_domain_console_init(); if (r < 0) - return r; + goto register_fe; info = vtermno_to_xencons(HVC_COOKIE); } else { ops = &domU_hvc_ops; @@ -597,7 +613,7 @@ else r = xen_pv_console_init(); if (r < 0) - return r; + goto register_fe; info = vtermno_to_xencons(HVC_COOKIE); info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn); @@ -616,12 +632,13 @@ list_del(&info->list); spin_unlock_irqrestore(&xencons_lock, flags); if (info->irq) - unbind_from_irqhandler(info->irq, NULL); + evtchn_put(info->evtchn); kfree(info); return r; } r = 0; + register_fe: #ifdef CONFIG_HVC_XEN_FRONTEND r = xenbus_register_frontend(&xencons_driver); #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tty/serial/8250/8250_dw.c +++ linux-aws-6.5-6.5.0/drivers/tty/serial/8250/8250_dw.c @@ -795,6 +795,7 @@ { "INT33C5", (kernel_ulong_t)&dw8250_dw_apb }, { "INT3434", (kernel_ulong_t)&dw8250_dw_apb }, { "INT3435", (kernel_ulong_t)&dw8250_dw_apb }, + { "INTC10EE", (kernel_ulong_t)&dw8250_dw_apb }, { }, }; MODULE_DEVICE_TABLE(acpi, dw8250_acpi_match); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tty/serial/8250/8250_early.c +++ linux-aws-6.5-6.5.0/drivers/tty/serial/8250/8250_early.c @@ -190,5 +190,6 @@ OF_EARLYCON_DECLARE(omap8250, "ti,omap2-uart", early_omap8250_setup); OF_EARLYCON_DECLARE(omap8250, "ti,omap3-uart", early_omap8250_setup); OF_EARLYCON_DECLARE(omap8250, "ti,omap4-uart", early_omap8250_setup); +OF_EARLYCON_DECLARE(omap8250, "ti,am654-uart", early_omap8250_setup); #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tty/serial/8250/8250_pci.c +++ linux-aws-6.5-6.5.0/drivers/tty/serial/8250/8250_pci.c @@ -2427,6 +2427,153 @@ .init = pci_oxsemi_tornado_init, .setup = pci_oxsemi_tornado_setup, }, + /* + * Brainboxes devices - all Oxsemi based + */ + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4027, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4028, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4029, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4019, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4016, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4015, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x400A, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x400E, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x400C, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x400B, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x400F, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4010, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4011, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x401D, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x401E, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4013, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4017, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTASHIELD, + .device = 0x4018, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .init = pci_oxsemi_tornado_init, + .setup = pci_oxsemi_tornado_setup, + }, { .vendor = PCI_VENDOR_ID_INTEL, .device = 0x8811, @@ -4912,6 +5059,12 @@ pbn_b1_bt_1_115200 }, /* + * IntaShield IS-100 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x0D60, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, + pbn_b2_1_115200 }, + /* * IntaShield IS-200 */ { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200, @@ -4923,6 +5076,27 @@ { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400, PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */ pbn_b2_4_115200 }, + /* + * IntaShield IX-100 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x4027, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_oxsemi_1_15625000 }, + /* + * IntaShield IX-200 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x4028, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_oxsemi_2_15625000 }, + /* + * IntaShield IX-400 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x4029, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_oxsemi_4_15625000 }, /* Brainboxes Devices */ /* * Brainboxes UC-101 @@ -4938,10 +5112,14 @@ PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b2_1_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0AA2, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_1_115200 }, /* - * Brainboxes UC-257 + * Brainboxes UC-253/UC-734 */ - { PCI_VENDOR_ID_INTASHIELD, 0x0861, + { PCI_VENDOR_ID_INTASHIELD, 0x0CA1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b2_2_115200 }, @@ -4977,6 +5155,14 @@ PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x08E2, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x08E3, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, /* * Brainboxes UC-310 */ @@ -4987,6 +5173,14 @@ /* * Brainboxes UC-313 */ + { PCI_VENDOR_ID_INTASHIELD, 0x08A1, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x08A2, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, { PCI_VENDOR_ID_INTASHIELD, 0x08A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, @@ -5001,6 +5195,10 @@ /* * Brainboxes UC-346 */ + { PCI_VENDOR_ID_INTASHIELD, 0x0B01, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_4_115200 }, { PCI_VENDOR_ID_INTASHIELD, 0x0B02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, @@ -5012,6 +5210,10 @@ PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0A82, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, { PCI_VENDOR_ID_INTASHIELD, 0x0A83, PCI_ANY_ID, PCI_ANY_ID, 0, 0, @@ -5024,13 +5226,95 @@ 0, 0, pbn_b2_4_115200 }, /* - * Brainboxes UC-420/431 + * Brainboxes UC-420 */ { PCI_VENDOR_ID_INTASHIELD, 0x0921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b2_4_115200 }, /* + * Brainboxes UC-607 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x09A1, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x09A2, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x09A3, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + /* + * Brainboxes UC-836 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x0D41, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_4_115200 }, + /* + * Brainboxes UP-189 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x0AC1, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0AC2, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0AC3, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + /* + * Brainboxes UP-200 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x0B21, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0B22, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0B23, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + /* + * Brainboxes UP-869 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x0C01, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0C02, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0C03, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + /* + * Brainboxes UP-880 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x0C21, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0C22, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x0C23, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_2_115200 }, + /* * Brainboxes PX-101 */ { PCI_VENDOR_ID_INTASHIELD, 0x4005, @@ -5062,7 +5346,7 @@ { PCI_VENDOR_ID_INTASHIELD, 0x4015, PCI_ANY_ID, PCI_ANY_ID, 0, 0, - pbn_oxsemi_4_15625000 }, + pbn_oxsemi_2_15625000 }, /* * Brainboxes PX-260/PX-701 */ @@ -5071,6 +5355,13 @@ 0, 0, pbn_oxsemi_4_15625000 }, /* + * Brainboxes PX-275/279 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x0E41, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b2_8_115200 }, + /* * Brainboxes PX-310 */ { PCI_VENDOR_ID_INTASHIELD, 0x400E, @@ -5117,16 +5408,38 @@ 0, 0, pbn_oxsemi_4_15625000 }, /* - * Brainboxes PX-803 + * Brainboxes PX-475 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x401D, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_oxsemi_1_15625000 }, + /* + * Brainboxes PX-803/PX-857 */ { PCI_VENDOR_ID_INTASHIELD, 0x4009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, - pbn_b0_1_115200 }, + pbn_b0_2_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x4018, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_oxsemi_2_15625000 }, { PCI_VENDOR_ID_INTASHIELD, 0x401E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, - pbn_oxsemi_1_15625000 }, + pbn_oxsemi_2_15625000 }, + /* + * Brainboxes PX-820 + */ + { PCI_VENDOR_ID_INTASHIELD, 0x4002, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_b0_4_115200 }, + { PCI_VENDOR_ID_INTASHIELD, 0x4013, + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, + pbn_oxsemi_4_15625000 }, /* * Brainboxes PX-846 */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tty/serial/amba-pl011.c +++ linux-aws-6.5-6.5.0/drivers/tty/serial/amba-pl011.c @@ -218,17 +218,18 @@ /* Deals with DMA transactions */ -struct pl011_sgbuf { - struct scatterlist sg; - char *buf; +struct pl011_dmabuf { + dma_addr_t dma; + size_t len; + char *buf; }; struct pl011_dmarx_data { struct dma_chan *chan; struct completion complete; bool use_buf_b; - struct pl011_sgbuf sgbuf_a; - struct pl011_sgbuf sgbuf_b; + struct pl011_dmabuf dbuf_a; + struct pl011_dmabuf dbuf_b; dma_cookie_t cookie; bool running; struct timer_list timer; @@ -241,7 +242,8 @@ struct pl011_dmatx_data { struct dma_chan *chan; - struct scatterlist sg; + dma_addr_t dma; + size_t len; char *buf; bool queued; }; @@ -365,32 +367,24 @@ #define PL011_DMA_BUFFER_SIZE PAGE_SIZE -static int pl011_sgbuf_init(struct dma_chan *chan, struct pl011_sgbuf *sg, +static int pl011_dmabuf_init(struct dma_chan *chan, struct pl011_dmabuf *db, enum dma_data_direction dir) { - dma_addr_t dma_addr; - - sg->buf = dma_alloc_coherent(chan->device->dev, - PL011_DMA_BUFFER_SIZE, &dma_addr, GFP_KERNEL); - if (!sg->buf) + db->buf = dma_alloc_coherent(chan->device->dev, PL011_DMA_BUFFER_SIZE, + &db->dma, GFP_KERNEL); + if (!db->buf) return -ENOMEM; - - sg_init_table(&sg->sg, 1); - sg_set_page(&sg->sg, phys_to_page(dma_addr), - PL011_DMA_BUFFER_SIZE, offset_in_page(dma_addr)); - sg_dma_address(&sg->sg) = dma_addr; - sg_dma_len(&sg->sg) = PL011_DMA_BUFFER_SIZE; + db->len = PL011_DMA_BUFFER_SIZE; return 0; } -static void pl011_sgbuf_free(struct dma_chan *chan, struct pl011_sgbuf *sg, +static void pl011_dmabuf_free(struct dma_chan *chan, struct pl011_dmabuf *db, enum dma_data_direction dir) { - if (sg->buf) { + if (db->buf) { dma_free_coherent(chan->device->dev, - PL011_DMA_BUFFER_SIZE, sg->buf, - sg_dma_address(&sg->sg)); + PL011_DMA_BUFFER_SIZE, db->buf, db->dma); } } @@ -551,8 +545,8 @@ spin_lock_irqsave(&uap->port.lock, flags); if (uap->dmatx.queued) - dma_unmap_sg(dmatx->chan->device->dev, &dmatx->sg, 1, - DMA_TO_DEVICE); + dma_unmap_single(dmatx->chan->device->dev, dmatx->dma, + dmatx->len, DMA_TO_DEVICE); dmacr = uap->dmacr; uap->dmacr = dmacr & ~UART011_TXDMAE; @@ -638,18 +632,19 @@ memcpy(&dmatx->buf[first], &xmit->buf[0], second); } - dmatx->sg.length = count; - - if (dma_map_sg(dma_dev->dev, &dmatx->sg, 1, DMA_TO_DEVICE) != 1) { + dmatx->len = count; + dmatx->dma = dma_map_single(dma_dev->dev, dmatx->buf, count, + DMA_TO_DEVICE); + if (dmatx->dma == DMA_MAPPING_ERROR) { uap->dmatx.queued = false; dev_dbg(uap->port.dev, "unable to map TX DMA\n"); return -EBUSY; } - desc = dmaengine_prep_slave_sg(chan, &dmatx->sg, 1, DMA_MEM_TO_DEV, + desc = dmaengine_prep_slave_single(chan, dmatx->dma, dmatx->len, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); if (!desc) { - dma_unmap_sg(dma_dev->dev, &dmatx->sg, 1, DMA_TO_DEVICE); + dma_unmap_single(dma_dev->dev, dmatx->dma, dmatx->len, DMA_TO_DEVICE); uap->dmatx.queued = false; /* * If DMA cannot be used right now, we complete this @@ -812,8 +807,8 @@ dmaengine_terminate_async(uap->dmatx.chan); if (uap->dmatx.queued) { - dma_unmap_sg(uap->dmatx.chan->device->dev, &uap->dmatx.sg, 1, - DMA_TO_DEVICE); + dma_unmap_single(uap->dmatx.chan->device->dev, uap->dmatx.dma, + uap->dmatx.len, DMA_TO_DEVICE); uap->dmatx.queued = false; uap->dmacr &= ~UART011_TXDMAE; pl011_write(uap->dmacr, uap, REG_DMACR); @@ -827,15 +822,15 @@ struct dma_chan *rxchan = uap->dmarx.chan; struct pl011_dmarx_data *dmarx = &uap->dmarx; struct dma_async_tx_descriptor *desc; - struct pl011_sgbuf *sgbuf; + struct pl011_dmabuf *dbuf; if (!rxchan) return -EIO; /* Start the RX DMA job */ - sgbuf = uap->dmarx.use_buf_b ? - &uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a; - desc = dmaengine_prep_slave_sg(rxchan, &sgbuf->sg, 1, + dbuf = uap->dmarx.use_buf_b ? + &uap->dmarx.dbuf_b : &uap->dmarx.dbuf_a; + desc = dmaengine_prep_slave_single(rxchan, dbuf->dma, dbuf->len, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); /* @@ -875,8 +870,8 @@ bool readfifo) { struct tty_port *port = &uap->port.state->port; - struct pl011_sgbuf *sgbuf = use_buf_b ? - &uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a; + struct pl011_dmabuf *dbuf = use_buf_b ? + &uap->dmarx.dbuf_b : &uap->dmarx.dbuf_a; int dma_count = 0; u32 fifotaken = 0; /* only used for vdbg() */ @@ -885,7 +880,7 @@ if (uap->dmarx.poll_rate) { /* The data can be taken by polling */ - dmataken = sgbuf->sg.length - dmarx->last_residue; + dmataken = dbuf->len - dmarx->last_residue; /* Recalculate the pending size */ if (pending >= dmataken) pending -= dmataken; @@ -899,7 +894,7 @@ * Note that tty_insert_flip_buf() tries to take as many chars * as it can. */ - dma_count = tty_insert_flip_string(port, sgbuf->buf + dmataken, + dma_count = tty_insert_flip_string(port, dbuf->buf + dmataken, pending); uap->port.icount.rx += dma_count; @@ -910,7 +905,7 @@ /* Reset the last_residue for Rx DMA poll */ if (uap->dmarx.poll_rate) - dmarx->last_residue = sgbuf->sg.length; + dmarx->last_residue = dbuf->len; /* * Only continue with trying to read the FIFO if all DMA chars have @@ -945,8 +940,8 @@ { struct pl011_dmarx_data *dmarx = &uap->dmarx; struct dma_chan *rxchan = dmarx->chan; - struct pl011_sgbuf *sgbuf = dmarx->use_buf_b ? - &dmarx->sgbuf_b : &dmarx->sgbuf_a; + struct pl011_dmabuf *dbuf = dmarx->use_buf_b ? + &dmarx->dbuf_b : &dmarx->dbuf_a; size_t pending; struct dma_tx_state state; enum dma_status dmastat; @@ -968,7 +963,7 @@ pl011_write(uap->dmacr, uap, REG_DMACR); uap->dmarx.running = false; - pending = sgbuf->sg.length - state.residue; + pending = dbuf->len - state.residue; BUG_ON(pending > PL011_DMA_BUFFER_SIZE); /* Then we terminate the transfer - we now know our residue */ dmaengine_terminate_all(rxchan); @@ -995,8 +990,8 @@ struct pl011_dmarx_data *dmarx = &uap->dmarx; struct dma_chan *rxchan = dmarx->chan; bool lastbuf = dmarx->use_buf_b; - struct pl011_sgbuf *sgbuf = dmarx->use_buf_b ? - &dmarx->sgbuf_b : &dmarx->sgbuf_a; + struct pl011_dmabuf *dbuf = dmarx->use_buf_b ? + &dmarx->dbuf_b : &dmarx->dbuf_a; size_t pending; struct dma_tx_state state; int ret; @@ -1014,7 +1009,7 @@ * the DMA irq handler. So we check the residue here. */ rxchan->device->device_tx_status(rxchan, dmarx->cookie, &state); - pending = sgbuf->sg.length - state.residue; + pending = dbuf->len - state.residue; BUG_ON(pending > PL011_DMA_BUFFER_SIZE); /* Then we terminate the transfer - we now know our residue */ dmaengine_terminate_all(rxchan); @@ -1066,16 +1061,16 @@ unsigned long flags; unsigned int dmataken = 0; unsigned int size = 0; - struct pl011_sgbuf *sgbuf; + struct pl011_dmabuf *dbuf; int dma_count; struct dma_tx_state state; - sgbuf = dmarx->use_buf_b ? &uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a; + dbuf = dmarx->use_buf_b ? &uap->dmarx.dbuf_b : &uap->dmarx.dbuf_a; rxchan->device->device_tx_status(rxchan, dmarx->cookie, &state); if (likely(state.residue < dmarx->last_residue)) { - dmataken = sgbuf->sg.length - dmarx->last_residue; + dmataken = dbuf->len - dmarx->last_residue; size = dmarx->last_residue - state.residue; - dma_count = tty_insert_flip_string(port, sgbuf->buf + dmataken, + dma_count = tty_insert_flip_string(port, dbuf->buf + dmataken, size); if (dma_count == size) dmarx->last_residue = state.residue; @@ -1122,7 +1117,7 @@ return; } - sg_init_one(&uap->dmatx.sg, uap->dmatx.buf, PL011_DMA_BUFFER_SIZE); + uap->dmatx.len = PL011_DMA_BUFFER_SIZE; /* The DMA buffer is now the FIFO the TTY subsystem can use */ uap->port.fifosize = PL011_DMA_BUFFER_SIZE; @@ -1132,7 +1127,7 @@ goto skip_rx; /* Allocate and map DMA RX buffers */ - ret = pl011_sgbuf_init(uap->dmarx.chan, &uap->dmarx.sgbuf_a, + ret = pl011_dmabuf_init(uap->dmarx.chan, &uap->dmarx.dbuf_a, DMA_FROM_DEVICE); if (ret) { dev_err(uap->port.dev, "failed to init DMA %s: %d\n", @@ -1140,12 +1135,12 @@ goto skip_rx; } - ret = pl011_sgbuf_init(uap->dmarx.chan, &uap->dmarx.sgbuf_b, + ret = pl011_dmabuf_init(uap->dmarx.chan, &uap->dmarx.dbuf_b, DMA_FROM_DEVICE); if (ret) { dev_err(uap->port.dev, "failed to init DMA %s: %d\n", "RX buffer B", ret); - pl011_sgbuf_free(uap->dmarx.chan, &uap->dmarx.sgbuf_a, + pl011_dmabuf_free(uap->dmarx.chan, &uap->dmarx.dbuf_a, DMA_FROM_DEVICE); goto skip_rx; } @@ -1199,8 +1194,9 @@ /* In theory, this should already be done by pl011_dma_flush_buffer */ dmaengine_terminate_all(uap->dmatx.chan); if (uap->dmatx.queued) { - dma_unmap_sg(uap->dmatx.chan->device->dev, &uap->dmatx.sg, 1, - DMA_TO_DEVICE); + dma_unmap_single(uap->dmatx.chan->device->dev, + uap->dmatx.dma, uap->dmatx.len, + DMA_TO_DEVICE); uap->dmatx.queued = false; } @@ -1211,8 +1207,8 @@ if (uap->using_rx_dma) { dmaengine_terminate_all(uap->dmarx.chan); /* Clean up the RX DMA */ - pl011_sgbuf_free(uap->dmarx.chan, &uap->dmarx.sgbuf_a, DMA_FROM_DEVICE); - pl011_sgbuf_free(uap->dmarx.chan, &uap->dmarx.sgbuf_b, DMA_FROM_DEVICE); + pl011_dmabuf_free(uap->dmarx.chan, &uap->dmarx.dbuf_a, DMA_FROM_DEVICE); + pl011_dmabuf_free(uap->dmarx.chan, &uap->dmarx.dbuf_b, DMA_FROM_DEVICE); if (uap->dmarx.poll_rate) del_timer_sync(&uap->dmarx.timer); uap->using_rx_dma = false; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tty/serial/ma35d1_serial.c +++ linux-aws-6.5-6.5.0/drivers/tty/serial/ma35d1_serial.c @@ -552,11 +552,19 @@ */ static void ma35d1serial_console_write(struct console *co, const char *s, u32 count) { - struct uart_ma35d1_port *up = &ma35d1serial_ports[co->index]; + struct uart_ma35d1_port *up; unsigned long flags; int locked = 1; u32 ier; + if ((co->index < 0) || (co->index >= MA35_UART_NR)) { + pr_warn("Failed to write on ononsole port %x, out of range\n", + co->index); + return; + } + + up = &ma35d1serial_ports[co->index]; + if (up->port.sysrq) locked = 0; else if (oops_in_progress) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tty/serial/meson_uart.c +++ linux-aws-6.5-6.5.0/drivers/tty/serial/meson_uart.c @@ -379,10 +379,14 @@ else val |= AML_UART_STOP_BIT_1SB; - if (cflags & CRTSCTS) - val &= ~AML_UART_TWO_WIRE_EN; - else + if (cflags & CRTSCTS) { + if (port->flags & UPF_HARD_FLOW) + val &= ~AML_UART_TWO_WIRE_EN; + else + termios->c_cflag &= ~CRTSCTS; + } else { val |= AML_UART_TWO_WIRE_EN; + } writel(val, port->membase + AML_UART_CONTROL); @@ -697,6 +701,7 @@ u32 fifosize = 64; /* Default is 64, 128 for EE UART_0 */ int ret = 0; int irq; + bool has_rtscts; if (pdev->dev.of_node) pdev->id = of_alias_get_id(pdev->dev.of_node, "serial"); @@ -724,6 +729,7 @@ return irq; of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize); + has_rtscts = of_property_read_bool(pdev->dev.of_node, "uart-has-rtscts"); if (meson_ports[pdev->id]) { dev_err(&pdev->dev, "port %d already allocated\n", pdev->id); @@ -743,6 +749,8 @@ port->mapsize = resource_size(res_mem); port->irq = irq; port->flags = UPF_BOOT_AUTOCONF | UPF_LOW_LATENCY; + if (has_rtscts) + port->flags |= UPF_HARD_FLOW; port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MESON_CONSOLE); port->dev = &pdev->dev; port->line = pdev->id; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tty/sysrq.c +++ linux-aws-6.5-6.5.0/drivers/tty/sysrq.c @@ -263,13 +263,14 @@ if (in_hardirq()) regs = get_irq_regs(); - pr_info("CPU%d:\n", smp_processor_id()); + pr_info("CPU%d:\n", get_cpu()); if (regs) show_regs(regs); else show_stack(NULL, NULL, KERN_INFO); schedule_work(&sysrq_showallcpus); + put_cpu(); } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tty/tty_jobctrl.c +++ linux-aws-6.5-6.5.0/drivers/tty/tty_jobctrl.c @@ -300,12 +300,7 @@ return; } - spin_lock_irq(¤t->sighand->siglock); - put_pid(current->signal->tty_old_pgrp); - current->signal->tty_old_pgrp = NULL; - tty = tty_kref_get(current->signal->tty); - spin_unlock_irq(¤t->sighand->siglock); - + tty = get_current_tty(); if (tty) { unsigned long flags; @@ -320,6 +315,16 @@ tty_kref_put(tty); } + /* If tty->ctrl.pgrp is not NULL, it may be assigned to + * current->signal->tty_old_pgrp in a race condition, and + * cause pid memleak. Release current->signal->tty_old_pgrp + * after tty->ctrl.pgrp set to NULL. + */ + spin_lock_irq(¤t->sighand->siglock); + put_pid(current->signal->tty_old_pgrp); + current->signal->tty_old_pgrp = NULL; + spin_unlock_irq(¤t->sighand->siglock); + /* Now clear signal->tty under the lock */ read_lock(&tasklist_lock); session_clear_tty(task_session(current)); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/tty/vcc.c +++ linux-aws-6.5-6.5.0/drivers/tty/vcc.c @@ -579,18 +579,22 @@ return -ENOMEM; name = kstrdup(dev_name(&vdev->dev), GFP_KERNEL); + if (!name) { + rv = -ENOMEM; + goto free_port; + } rv = vio_driver_init(&port->vio, vdev, VDEV_CONSOLE_CON, vcc_versions, ARRAY_SIZE(vcc_versions), NULL, name); if (rv) - goto free_port; + goto free_name; port->vio.debug = vcc_dbg_vio; vcc_ldc_cfg.debug = vcc_dbg_ldc; rv = vio_ldc_alloc(&port->vio, &vcc_ldc_cfg, port); if (rv) - goto free_port; + goto free_name; spin_lock_init(&port->lock); @@ -624,6 +628,11 @@ goto unreg_tty; } port->domain = kstrdup(domain, GFP_KERNEL); + if (!port->domain) { + rv = -ENOMEM; + goto unreg_tty; + } + mdesc_release(hp); @@ -653,8 +662,9 @@ vcc_table_remove(port->index); free_ldc: vio_ldc_free(&port->vio); -free_port: +free_name: kfree(name); +free_port: kfree(port); return rv; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/ufs/core/ufs-mcq.c +++ linux-aws-6.5-6.5.0/drivers/ufs/core/ufs-mcq.c @@ -433,7 +433,7 @@ for (i = 0; i < hba->nr_hw_queues; i++) { hwq = &hba->uhq[i]; - hwq->max_entries = hba->nutrs; + hwq->max_entries = hba->nutrs + 1; spin_lock_init(&hwq->sq_lock); spin_lock_init(&hwq->cq_lock); mutex_init(&hwq->sq_mutex); @@ -632,6 +632,7 @@ int tag = scsi_cmd_to_rq(cmd)->tag; struct ufshcd_lrb *lrbp = &hba->lrb[tag]; struct ufs_hw_queue *hwq; + unsigned long flags; int err = FAILED; if (!ufshcd_cmd_inflight(lrbp->cmd)) { @@ -672,8 +673,10 @@ } err = SUCCESS; + spin_lock_irqsave(&hwq->cq_lock, flags); if (ufshcd_cmd_inflight(lrbp->cmd)) ufshcd_release_scsi_cmd(hba, lrbp); + spin_unlock_irqrestore(&hwq->cq_lock, flags); out: return err; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/ufs/host/ufs-qcom.c +++ linux-aws-6.5-6.5.0/drivers/ufs/host/ufs-qcom.c @@ -820,8 +820,13 @@ return ret; } - /* Use the agreed gear */ - host->hs_gear = dev_req_params->gear_tx; + /* + * Update hs_gear only when the gears are scaled to a higher value. This is because, + * the PHY gear settings are backwards compatible and we only need to change the PHY + * settings while scaling to higher gears. + */ + if (dev_req_params->gear_tx > host->hs_gear) + host->hs_gear = dev_req_params->gear_tx; /* enable the device ref clock before changing to HS mode */ if (!ufshcd_is_hs_mode(&hba->pwr_info) && only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/cdns3/cdnsp-ring.c +++ linux-aws-6.5-6.5.0/drivers/usb/cdns3/cdnsp-ring.c @@ -1529,6 +1529,7 @@ unsigned long flags; int counter = 0; + local_bh_disable(); spin_lock_irqsave(&pdev->lock, flags); if (pdev->cdnsp_state & (CDNSP_STATE_HALTED | CDNSP_STATE_DYING)) { @@ -1541,6 +1542,7 @@ cdnsp_died(pdev); spin_unlock_irqrestore(&pdev->lock, flags); + local_bh_enable(); return IRQ_HANDLED; } @@ -1557,6 +1559,7 @@ cdnsp_update_erst_dequeue(pdev, event_ring_deq, 1); spin_unlock_irqrestore(&pdev->lock, flags); + local_bh_enable(); return IRQ_HANDLED; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/core/config.c +++ linux-aws-6.5-6.5.0/drivers/usb/core/config.c @@ -1047,7 +1047,7 @@ if (cap->bDescriptorType != USB_DT_DEVICE_CAPABILITY) { dev_notice(ddev, "descriptor type invalid, skip\n"); - continue; + goto skip_to_next_descriptor; } switch (cap_type) { @@ -1081,6 +1081,7 @@ break; } +skip_to_next_descriptor: total_len -= length; buffer += length; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/dwc2/hcd.c +++ linux-aws-6.5-6.5.0/drivers/usb/dwc2/hcd.c @@ -4769,8 +4769,8 @@ if (qh_allocated && qh->channel && qh->channel->qh == qh) qh->channel->qh = NULL; fail2: - spin_unlock_irqrestore(&hsotg->lock, flags); urb->hcpriv = NULL; + spin_unlock_irqrestore(&hsotg->lock, flags); kfree(qtd); fail1: if (qh_allocated) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/dwc2/hcd_intr.c +++ linux-aws-6.5-6.5.0/drivers/usb/dwc2/hcd_intr.c @@ -2015,15 +2015,17 @@ { struct dwc2_qtd *qtd; struct dwc2_host_chan *chan; - u32 hcint, hcintmsk; + u32 hcint, hcintraw, hcintmsk; chan = hsotg->hc_ptr_array[chnum]; - hcint = dwc2_readl(hsotg, HCINT(chnum)); + hcintraw = dwc2_readl(hsotg, HCINT(chnum)); hcintmsk = dwc2_readl(hsotg, HCINTMSK(chnum)); + hcint = hcintraw & hcintmsk; + dwc2_writel(hsotg, hcint, HCINT(chnum)); + if (!chan) { dev_err(hsotg->dev, "## hc_ptr_array for channel is NULL ##\n"); - dwc2_writel(hsotg, hcint, HCINT(chnum)); return; } @@ -2032,11 +2034,9 @@ chnum); dev_vdbg(hsotg->dev, " hcint 0x%08x, hcintmsk 0x%08x, hcint&hcintmsk 0x%08x\n", - hcint, hcintmsk, hcint & hcintmsk); + hcintraw, hcintmsk, hcint); } - dwc2_writel(hsotg, hcint, HCINT(chnum)); - /* * If we got an interrupt after someone called * dwc2_hcd_endpoint_disable() we don't want to crash below @@ -2046,8 +2046,7 @@ return; } - chan->hcint = hcint; - hcint &= hcintmsk; + chan->hcint = hcintraw; /* * If the channel was halted due to a dequeue, the qtd list might only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/dwc3/core.h +++ linux-aws-6.5-6.5.0/drivers/usb/dwc3/core.h @@ -211,6 +211,11 @@ #define DWC3_GRXTHRCFG_RXPKTCNT(n) (((n) & 0xf) << 24) #define DWC3_GRXTHRCFG_PKTCNTSEL BIT(29) +/* Global TX Threshold Configuration Register */ +#define DWC3_GTXTHRCFG_MAXTXBURSTSIZE(n) (((n) & 0xff) << 16) +#define DWC3_GTXTHRCFG_TXPKTCNT(n) (((n) & 0xf) << 24) +#define DWC3_GTXTHRCFG_PKTCNTSEL BIT(29) + /* Global RX Threshold Configuration Register for DWC_usb31 only */ #define DWC31_GRXTHRCFG_MAXRXBURSTSIZE(n) (((n) & 0x1f) << 16) #define DWC31_GRXTHRCFG_RXPKTCNT(n) (((n) & 0x1f) << 21) @@ -1045,6 +1050,10 @@ * @test_mode_nr: test feature selector * @lpm_nyet_threshold: LPM NYET response threshold * @hird_threshold: HIRD threshold + * @rx_thr_num_pkt: USB receive packet count + * @rx_max_burst: max USB receive burst size + * @tx_thr_num_pkt: USB transmit packet count + * @tx_max_burst: max USB transmit burst size * @rx_thr_num_pkt_prd: periodic ESS receive packet count * @rx_max_burst_prd: max periodic ESS receive burst size * @tx_thr_num_pkt_prd: periodic ESS transmit packet count @@ -1273,6 +1282,10 @@ u8 test_mode_nr; u8 lpm_nyet_threshold; u8 hird_threshold; + u8 rx_thr_num_pkt; + u8 rx_max_burst; + u8 tx_thr_num_pkt; + u8 tx_max_burst; u8 rx_thr_num_pkt_prd; u8 rx_max_burst_prd; u8 tx_thr_num_pkt_prd; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/dwc3/drd.c +++ linux-aws-6.5-6.5.0/drivers/usb/dwc3/drd.c @@ -505,6 +505,7 @@ dwc->role_switch_default_mode = USB_DR_MODE_PERIPHERAL; mode = DWC3_GCTL_PRTCAP_DEVICE; } + dwc3_set_mode(dwc, mode); dwc3_role_switch.fwnode = dev_fwnode(dwc->dev); dwc3_role_switch.set = dwc3_usb_role_switch_set; @@ -526,7 +527,6 @@ } } - dwc3_set_mode(dwc, mode); return 0; } #else only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/dwc3/dwc3-qcom.c +++ linux-aws-6.5-6.5.0/drivers/usb/dwc3/dwc3-qcom.c @@ -549,7 +549,7 @@ irq_set_status_flags(irq, IRQ_NOAUTOEN); ret = devm_request_threaded_irq(qcom->dev, irq, NULL, qcom_dwc3_resume_irq, - IRQF_TRIGGER_HIGH | IRQF_ONESHOT, + IRQF_ONESHOT, "qcom_dwc3 HS", qcom); if (ret) { dev_err(qcom->dev, "hs_phy_irq failed: %d\n", ret); @@ -564,7 +564,7 @@ irq_set_status_flags(irq, IRQ_NOAUTOEN); ret = devm_request_threaded_irq(qcom->dev, irq, NULL, qcom_dwc3_resume_irq, - IRQF_TRIGGER_HIGH | IRQF_ONESHOT, + IRQF_ONESHOT, "qcom_dwc3 DP_HS", qcom); if (ret) { dev_err(qcom->dev, "dp_hs_phy_irq failed: %d\n", ret); @@ -579,7 +579,7 @@ irq_set_status_flags(irq, IRQ_NOAUTOEN); ret = devm_request_threaded_irq(qcom->dev, irq, NULL, qcom_dwc3_resume_irq, - IRQF_TRIGGER_HIGH | IRQF_ONESHOT, + IRQF_ONESHOT, "qcom_dwc3 DM_HS", qcom); if (ret) { dev_err(qcom->dev, "dm_hs_phy_irq failed: %d\n", ret); @@ -594,7 +594,7 @@ irq_set_status_flags(irq, IRQ_NOAUTOEN); ret = devm_request_threaded_irq(qcom->dev, irq, NULL, qcom_dwc3_resume_irq, - IRQF_TRIGGER_HIGH | IRQF_ONESHOT, + IRQF_ONESHOT, "qcom_dwc3 SS", qcom); if (ret) { dev_err(qcom->dev, "ss_phy_irq failed: %d\n", ret); @@ -758,6 +758,7 @@ if (!qcom->dwc3) { ret = -ENODEV; dev_err(dev, "failed to get dwc3 platform device\n"); + of_platform_depopulate(dev); } node_put: @@ -766,9 +767,9 @@ return ret; } -static struct platform_device * -dwc3_qcom_create_urs_usb_platdev(struct device *dev) +static struct platform_device *dwc3_qcom_create_urs_usb_platdev(struct device *dev) { + struct platform_device *urs_usb = NULL; struct fwnode_handle *fwh; struct acpi_device *adev; char name[8]; @@ -788,9 +789,26 @@ adev = to_acpi_device_node(fwh); if (!adev) - return NULL; + goto err_put_handle; + + urs_usb = acpi_create_platform_device(adev, NULL); + if (IS_ERR_OR_NULL(urs_usb)) + goto err_put_handle; + + return urs_usb; + +err_put_handle: + fwnode_handle_put(fwh); + + return urs_usb; +} - return acpi_create_platform_device(adev, NULL); +static void dwc3_qcom_destroy_urs_usb_platdev(struct platform_device *urs_usb) +{ + struct fwnode_handle *fwh = urs_usb->dev.fwnode; + + platform_device_unregister(urs_usb); + fwnode_handle_put(fwh); } static int dwc3_qcom_probe(struct platform_device *pdev) @@ -874,13 +892,13 @@ qcom->qscratch_base = devm_ioremap_resource(dev, parent_res); if (IS_ERR(qcom->qscratch_base)) { ret = PTR_ERR(qcom->qscratch_base); - goto clk_disable; + goto free_urs; } ret = dwc3_qcom_setup_irq(pdev); if (ret) { dev_err(dev, "failed to setup IRQs, err=%d\n", ret); - goto clk_disable; + goto free_urs; } /* @@ -899,7 +917,7 @@ if (ret) { dev_err(dev, "failed to register DWC3 Core, err=%d\n", ret); - goto depopulate; + goto free_urs; } ret = dwc3_qcom_interconnect_init(qcom); @@ -931,10 +949,16 @@ interconnect_exit: dwc3_qcom_interconnect_exit(qcom); depopulate: - if (np) + if (np) { of_platform_depopulate(&pdev->dev); - else - platform_device_put(pdev); + } else { + device_remove_software_node(&qcom->dwc3->dev); + platform_device_del(qcom->dwc3); + } + platform_device_put(qcom->dwc3); +free_urs: + if (qcom->urs_usb) + dwc3_qcom_destroy_urs_usb_platdev(qcom->urs_usb); clk_disable: for (i = qcom->num_clocks - 1; i >= 0; i--) { clk_disable_unprepare(qcom->clks[i]); @@ -953,11 +977,16 @@ struct device *dev = &pdev->dev; int i; - device_remove_software_node(&qcom->dwc3->dev); - if (np) + if (np) { of_platform_depopulate(&pdev->dev); - else - platform_device_put(pdev); + } else { + device_remove_software_node(&qcom->dwc3->dev); + platform_device_del(qcom->dwc3); + } + platform_device_put(qcom->dwc3); + + if (qcom->urs_usb) + dwc3_qcom_destroy_urs_usb_platdev(qcom->urs_usb); for (i = qcom->num_clocks - 1; i >= 0; i--) { clk_disable_unprepare(qcom->clks[i]); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/gadget/function/f_hid.c +++ linux-aws-6.5-6.5.0/drivers/usb/gadget/function/f_hid.c @@ -92,6 +92,7 @@ { struct f_hidg *hidg = container_of(dev, struct f_hidg, dev); + kfree(hidg->report_desc); kfree(hidg->set_report_buf); kfree(hidg); } @@ -1287,9 +1288,9 @@ hidg->report_length = opts->report_length; hidg->report_desc_length = opts->report_desc_length; if (opts->report_desc) { - hidg->report_desc = devm_kmemdup(&hidg->dev, opts->report_desc, - opts->report_desc_length, - GFP_KERNEL); + hidg->report_desc = kmemdup(opts->report_desc, + opts->report_desc_length, + GFP_KERNEL); if (!hidg->report_desc) { ret = -ENOMEM; goto err_put_device; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/gadget/legacy/raw_gadget.c +++ linux-aws-6.5-6.5.0/drivers/usb/gadget/legacy/raw_gadget.c @@ -663,12 +663,12 @@ if (WARN_ON(in && dev->ep0_out_pending)) { ret = -ENODEV; dev->state = STATE_DEV_FAILED; - goto out_done; + goto out_unlock; } if (WARN_ON(!in && dev->ep0_in_pending)) { ret = -ENODEV; dev->state = STATE_DEV_FAILED; - goto out_done; + goto out_unlock; } dev->req->buf = data; @@ -683,7 +683,7 @@ "fail, usb_ep_queue returned %d\n", ret); spin_lock_irqsave(&dev->lock, flags); dev->state = STATE_DEV_FAILED; - goto out_done; + goto out_queue_failed; } ret = wait_for_completion_interruptible(&dev->ep0_done); @@ -692,13 +692,16 @@ usb_ep_dequeue(dev->gadget->ep0, dev->req); wait_for_completion(&dev->ep0_done); spin_lock_irqsave(&dev->lock, flags); - goto out_done; + if (dev->ep0_status == -ECONNRESET) + dev->ep0_status = -EINTR; + goto out_interrupted; } spin_lock_irqsave(&dev->lock, flags); - ret = dev->ep0_status; -out_done: +out_interrupted: + ret = dev->ep0_status; +out_queue_failed: dev->ep0_urb_queued = false; out_unlock: spin_unlock_irqrestore(&dev->lock, flags); @@ -1067,7 +1070,7 @@ "fail, usb_ep_queue returned %d\n", ret); spin_lock_irqsave(&dev->lock, flags); dev->state = STATE_DEV_FAILED; - goto out_done; + goto out_queue_failed; } ret = wait_for_completion_interruptible(&done); @@ -1076,13 +1079,16 @@ usb_ep_dequeue(ep->ep, ep->req); wait_for_completion(&done); spin_lock_irqsave(&dev->lock, flags); - goto out_done; + if (ep->status == -ECONNRESET) + ep->status = -EINTR; + goto out_interrupted; } spin_lock_irqsave(&dev->lock, flags); - ret = ep->status; -out_done: +out_interrupted: + ret = ep->status; +out_queue_failed: ep->urb_queued = false; out_unlock: spin_unlock_irqrestore(&dev->lock, flags); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/host/xhci-pci.c +++ linux-aws-6.5-6.5.0/drivers/usb/host/xhci-pci.c @@ -693,7 +693,9 @@ /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ pm_runtime_put_noidle(&dev->dev); - if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) + if (pci_choose_state(dev, PMSG_SUSPEND) == PCI_D0) + pm_runtime_forbid(&dev->dev); + else if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) pm_runtime_allow(&dev->dev); dma_set_max_seg_size(&dev->dev, UINT_MAX); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/host/xhci-plat.c +++ linux-aws-6.5-6.5.0/drivers/usb/host/xhci-plat.c @@ -149,7 +149,7 @@ int ret; int irq; struct xhci_plat_priv *priv = NULL; - + bool of_match; if (usb_disabled()) return -ENODEV; @@ -254,16 +254,23 @@ &xhci->imod_interval); } - hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0); - if (IS_ERR(hcd->usb_phy)) { - ret = PTR_ERR(hcd->usb_phy); - if (ret == -EPROBE_DEFER) - goto disable_clk; - hcd->usb_phy = NULL; - } else { - ret = usb_phy_init(hcd->usb_phy); - if (ret) - goto disable_clk; + /* + * Drivers such as dwc3 manages PHYs themself (and rely on driver name + * matching for the xhci platform device). + */ + of_match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev); + if (of_match) { + hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0); + if (IS_ERR(hcd->usb_phy)) { + ret = PTR_ERR(hcd->usb_phy); + if (ret == -EPROBE_DEFER) + goto disable_clk; + hcd->usb_phy = NULL; + } else { + ret = usb_phy_init(hcd->usb_phy); + if (ret) + goto disable_clk; + } } hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node); @@ -286,15 +293,17 @@ goto dealloc_usb2_hcd; } - xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, - "usb-phy", 1); - if (IS_ERR(xhci->shared_hcd->usb_phy)) { - xhci->shared_hcd->usb_phy = NULL; - } else { - ret = usb_phy_init(xhci->shared_hcd->usb_phy); - if (ret) - dev_err(sysdev, "%s init usb3phy fail (ret=%d)\n", - __func__, ret); + if (of_match) { + xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, + "usb-phy", 1); + if (IS_ERR(xhci->shared_hcd->usb_phy)) { + xhci->shared_hcd->usb_phy = NULL; + } else { + ret = usb_phy_init(xhci->shared_hcd->usb_phy); + if (ret) + dev_err(sysdev, "%s init usb3phy fail (ret=%d)\n", + __func__, ret); + } } xhci->shared_hcd->tpl_support = hcd->tpl_support; @@ -459,23 +468,38 @@ int ret; if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { - clk_prepare_enable(xhci->clk); - clk_prepare_enable(xhci->reg_clk); + ret = clk_prepare_enable(xhci->clk); + if (ret) + return ret; + + ret = clk_prepare_enable(xhci->reg_clk); + if (ret) { + clk_disable_unprepare(xhci->clk); + return ret; + } } ret = xhci_priv_resume_quirk(hcd); if (ret) - return ret; + goto disable_clks; ret = xhci_resume(xhci, PMSG_RESUME); if (ret) - return ret; + goto disable_clks; pm_runtime_disable(dev); pm_runtime_set_active(dev); pm_runtime_enable(dev); return 0; + +disable_clks: + if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { + clk_disable_unprepare(xhci->clk); + clk_disable_unprepare(xhci->reg_clk); + } + + return ret; } static int __maybe_unused xhci_plat_runtime_suspend(struct device *dev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/host/xhci.c +++ linux-aws-6.5-6.5.0/drivers/usb/host/xhci.c @@ -968,6 +968,7 @@ int retval = 0; bool comp_timer_running = false; bool pending_portevent = false; + bool suspended_usb3_devs = false; bool reinit_xhc = false; if (!hcd->state) @@ -1115,10 +1116,17 @@ /* * Resume roothubs only if there are pending events. * USB 3 devices resend U3 LFPS wake after a 100ms delay if - * the first wake signalling failed, give it that chance. + * the first wake signalling failed, give it that chance if + * there are suspended USB 3 devices. */ + if (xhci->usb3_rhub.bus_state.suspended_ports || + xhci->usb3_rhub.bus_state.bus_suspended) + suspended_usb3_devs = true; + pending_portevent = xhci_pending_portevent(xhci); - if (!pending_portevent && msg.event == PM_EVENT_AUTO_RESUME) { + + if (suspended_usb3_devs && !pending_portevent && + msg.event == PM_EVENT_AUTO_RESUME) { msleep(120); pending_portevent = xhci_pending_portevent(xhci); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/storage/unusual_cypress.h +++ linux-aws-6.5-6.5.0/drivers/usb/storage/unusual_cypress.h @@ -19,7 +19,7 @@ "Cypress ISD-300LP", USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), -UNUSUAL_DEV( 0x14cd, 0x6116, 0x0160, 0x0160, +UNUSUAL_DEV( 0x14cd, 0x6116, 0x0150, 0x0160, "Super Top", "USB 2.0 SATA BRIDGE", USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/typec/ucsi/ucsi_glink.c +++ linux-aws-6.5-6.5.0/drivers/usb/typec/ucsi/ucsi_glink.c @@ -9,9 +9,13 @@ #include #include #include +#include +#include #include #include "ucsi.h" +#define PMIC_GLINK_MAX_PORTS 2 + #define UCSI_BUF_SIZE 48 #define MSG_TYPE_REQ_RESP 1 @@ -53,6 +57,9 @@ struct pmic_glink_ucsi { struct device *dev; + struct gpio_desc *port_orientation[PMIC_GLINK_MAX_PORTS]; + struct typec_switch *port_switch[PMIC_GLINK_MAX_PORTS]; + struct pmic_glink_client *client; struct ucsi *ucsi; @@ -221,8 +228,20 @@ } con_num = UCSI_CCI_CONNECTOR(cci); - if (con_num) + if (con_num) { + if (con_num < PMIC_GLINK_MAX_PORTS && + ucsi->port_orientation[con_num - 1]) { + int orientation = gpiod_get_value(ucsi->port_orientation[con_num - 1]); + + if (orientation >= 0) { + typec_switch_set(ucsi->port_switch[con_num - 1], + orientation ? TYPEC_ORIENTATION_REVERSE + : TYPEC_ORIENTATION_NORMAL); + } + } + ucsi_connector_change(ucsi->ucsi, con_num); + } if (ucsi->sync_pending && cci & UCSI_CCI_BUSY) { ucsi->sync_val = -EBUSY; @@ -283,6 +302,7 @@ { struct pmic_glink_ucsi *ucsi; struct device *dev = &adev->dev; + struct fwnode_handle *fwnode; int ret; ucsi = devm_kzalloc(dev, sizeof(*ucsi), GFP_KERNEL); @@ -310,6 +330,38 @@ ucsi_set_drvdata(ucsi->ucsi, ucsi); + device_for_each_child_node(dev, fwnode) { + struct gpio_desc *desc; + u32 port; + + ret = fwnode_property_read_u32(fwnode, "reg", &port); + if (ret < 0) { + dev_err(dev, "missing reg property of %pOFn\n", fwnode); + return ret; + } + + if (port >= PMIC_GLINK_MAX_PORTS) { + dev_warn(dev, "invalid connector number, ignoring\n"); + continue; + } + + desc = devm_gpiod_get_index_optional(&adev->dev, "orientation", port, GPIOD_IN); + + /* If GPIO isn't found, continue */ + if (!desc) + continue; + + if (IS_ERR(desc)) + return dev_err_probe(dev, PTR_ERR(desc), + "unable to acquire orientation gpio\n"); + ucsi->port_orientation[port] = desc; + + ucsi->port_switch[port] = fwnode_typec_switch_get(fwnode); + if (IS_ERR(ucsi->port_switch[port])) + return dev_err_probe(dev, PTR_ERR(ucsi->port_switch[port]), + "failed to acquire orientation-switch\n"); + } + ucsi->client = devm_pmic_glink_register_client(dev, PMIC_GLINK_OWNER_USBC, pmic_glink_ucsi_callback, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/usb/usbip/stub_dev.c +++ linux-aws-6.5-6.5.0/drivers/usb/usbip/stub_dev.c @@ -464,8 +464,13 @@ /* release port */ rc = usb_hub_release_port(udev->parent, udev->portnum, (struct usb_dev_state *) udev); - if (rc) { - dev_dbg(&udev->dev, "unable to release port\n"); + /* + * NOTE: If a HUB disconnect triggered disconnect of the down stream + * device usb_hub_release_port will return -ENODEV so we can safely ignore + * that error here. + */ + if (rc && (rc != -ENODEV)) { + dev_dbg(&udev->dev, "unable to release port (%i)\n", rc); return; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/vdpa/mlx5/net/debug.c +++ linux-aws-6.5-6.5.0/drivers/vdpa/mlx5/net/debug.c @@ -146,7 +146,8 @@ ndev->rx_dent = debugfs_create_dir("rx", ndev->debugfs); } -void mlx5_vdpa_remove_debugfs(struct dentry *dbg) +void mlx5_vdpa_remove_debugfs(struct mlx5_vdpa_net *ndev) { - debugfs_remove_recursive(dbg); + debugfs_remove_recursive(ndev->debugfs); + ndev->debugfs = NULL; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ linux-aws-6.5-6.5.0/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -625,30 +625,70 @@ mlx5_db_free(ndev->mvdev.mdev, &vcq->db); } +static int read_umem_params(struct mlx5_vdpa_net *ndev) +{ + u32 in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {}; + u16 opmod = (MLX5_CAP_VDPA_EMULATION << 1) | (HCA_CAP_OPMOD_GET_CUR & 0x01); + struct mlx5_core_dev *mdev = ndev->mvdev.mdev; + int out_size; + void *caps; + void *out; + int err; + + out_size = MLX5_ST_SZ_BYTES(query_hca_cap_out); + out = kzalloc(out_size, GFP_KERNEL); + if (!out) + return -ENOMEM; + + MLX5_SET(query_hca_cap_in, in, opcode, MLX5_CMD_OP_QUERY_HCA_CAP); + MLX5_SET(query_hca_cap_in, in, op_mod, opmod); + err = mlx5_cmd_exec_inout(mdev, query_hca_cap, in, out); + if (err) { + mlx5_vdpa_warn(&ndev->mvdev, + "Failed reading vdpa umem capabilities with err %d\n", err); + goto out; + } + + caps = MLX5_ADDR_OF(query_hca_cap_out, out, capability); + + ndev->umem_1_buffer_param_a = MLX5_GET(virtio_emulation_cap, caps, umem_1_buffer_param_a); + ndev->umem_1_buffer_param_b = MLX5_GET(virtio_emulation_cap, caps, umem_1_buffer_param_b); + + ndev->umem_2_buffer_param_a = MLX5_GET(virtio_emulation_cap, caps, umem_2_buffer_param_a); + ndev->umem_2_buffer_param_b = MLX5_GET(virtio_emulation_cap, caps, umem_2_buffer_param_b); + + ndev->umem_3_buffer_param_a = MLX5_GET(virtio_emulation_cap, caps, umem_3_buffer_param_a); + ndev->umem_3_buffer_param_b = MLX5_GET(virtio_emulation_cap, caps, umem_3_buffer_param_b); + +out: + kfree(out); + return 0; +} + static void set_umem_size(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue *mvq, int num, struct mlx5_vdpa_umem **umemp) { - struct mlx5_core_dev *mdev = ndev->mvdev.mdev; - int p_a; - int p_b; + u32 p_a; + u32 p_b; switch (num) { case 1: - p_a = MLX5_CAP_DEV_VDPA_EMULATION(mdev, umem_1_buffer_param_a); - p_b = MLX5_CAP_DEV_VDPA_EMULATION(mdev, umem_1_buffer_param_b); + p_a = ndev->umem_1_buffer_param_a; + p_b = ndev->umem_1_buffer_param_b; *umemp = &mvq->umem1; break; case 2: - p_a = MLX5_CAP_DEV_VDPA_EMULATION(mdev, umem_2_buffer_param_a); - p_b = MLX5_CAP_DEV_VDPA_EMULATION(mdev, umem_2_buffer_param_b); + p_a = ndev->umem_2_buffer_param_a; + p_b = ndev->umem_2_buffer_param_b; *umemp = &mvq->umem2; break; case 3: - p_a = MLX5_CAP_DEV_VDPA_EMULATION(mdev, umem_3_buffer_param_a); - p_b = MLX5_CAP_DEV_VDPA_EMULATION(mdev, umem_3_buffer_param_b); + p_a = ndev->umem_3_buffer_param_a; + p_b = ndev->umem_3_buffer_param_b; *umemp = &mvq->umem3; break; } + (*umemp)->size = p_a * mvq->num_ent + p_b; } @@ -2679,6 +2719,11 @@ goto out; } mlx5_vdpa_add_debugfs(ndev); + + err = read_umem_params(ndev); + if (err) + goto err_setup; + err = setup_virtqueues(mvdev); if (err) { mlx5_vdpa_warn(mvdev, "setup_virtqueues\n"); @@ -2713,7 +2758,7 @@ err_rqt: teardown_virtqueues(ndev); err_setup: - mlx5_vdpa_remove_debugfs(ndev->debugfs); + mlx5_vdpa_remove_debugfs(ndev); out: return err; } @@ -2727,8 +2772,7 @@ if (!ndev->setup) return; - mlx5_vdpa_remove_debugfs(ndev->debugfs); - ndev->debugfs = NULL; + mlx5_vdpa_remove_debugfs(ndev); teardown_steering(ndev); destroy_tir(ndev); destroy_rqt(ndev); @@ -2751,13 +2795,18 @@ struct mlx5_control_vq *cvq = &mvdev->cvq; int err = 0; - if (mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ)) + if (mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ)) { + u16 idx = cvq->vring.last_avail_idx; + err = vringh_init_iotlb(&cvq->vring, mvdev->actual_features, MLX5_CVQ_MAX_ENT, false, (struct vring_desc *)(uintptr_t)cvq->desc_addr, (struct vring_avail *)(uintptr_t)cvq->driver_addr, (struct vring_used *)(uintptr_t)cvq->device_addr); + if (!err) + cvq->vring.last_avail_idx = cvq->vring.last_used_idx = idx; + } return err; } @@ -3489,8 +3538,6 @@ struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); struct workqueue_struct *wq; - mlx5_vdpa_remove_debugfs(ndev->debugfs); - ndev->debugfs = NULL; unregister_link_notifier(ndev); _vdpa_unregister_device(dev); wq = mvdev->wq; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/vdpa/mlx5/net/mlx5_vnet.h +++ linux-aws-6.5-6.5.0/drivers/vdpa/mlx5/net/mlx5_vnet.h @@ -65,6 +65,15 @@ struct hlist_head macvlan_hash[MLX5V_MACVLAN_SIZE]; struct mlx5_vdpa_irq_pool irqp; struct dentry *debugfs; + + u32 umem_1_buffer_param_a; + u32 umem_1_buffer_param_b; + + u32 umem_2_buffer_param_a; + u32 umem_2_buffer_param_b; + + u32 umem_3_buffer_param_a; + u32 umem_3_buffer_param_b; }; struct mlx5_vdpa_counter { @@ -88,7 +97,7 @@ }; void mlx5_vdpa_add_debugfs(struct mlx5_vdpa_net *ndev); -void mlx5_vdpa_remove_debugfs(struct dentry *dbg); +void mlx5_vdpa_remove_debugfs(struct mlx5_vdpa_net *ndev); void mlx5_vdpa_add_rx_flow_table(struct mlx5_vdpa_net *ndev); void mlx5_vdpa_remove_rx_flow_table(struct mlx5_vdpa_net *ndev); void mlx5_vdpa_add_tirn(struct mlx5_vdpa_net *ndev); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c +++ linux-aws-6.5-6.5.0/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c @@ -437,7 +437,7 @@ if (blk->shared_backend) { blk->buffer = shared_buffer; } else { - blk->buffer = kvmalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT, + blk->buffer = kvzalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT, GFP_KERNEL); if (!blk->buffer) { ret = -ENOMEM; @@ -495,16 +495,17 @@ goto parent_err; if (shared_backend) { - shared_buffer = kvmalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT, + shared_buffer = kvzalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT, GFP_KERNEL); if (!shared_buffer) { ret = -ENOMEM; - goto parent_err; + goto mgmt_dev_err; } } return 0; - +mgmt_dev_err: + vdpa_mgmtdev_unregister(&mgmt_dev); parent_err: device_unregister(&vdpasim_blk_mgmtdev); return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/vhost/vdpa.c +++ linux-aws-6.5-6.5.0/drivers/vhost/vdpa.c @@ -1498,7 +1498,6 @@ err: put_device(&v->dev); - ida_simple_remove(&vhost_vdpa_ida, v->minor); return r; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/vhost/vhost.c +++ linux-aws-6.5-6.5.0/drivers/vhost/vhost.c @@ -1458,9 +1458,7 @@ goto done; } - if ((msg.type == VHOST_IOTLB_UPDATE || - msg.type == VHOST_IOTLB_INVALIDATE) && - msg.size == 0) { + if (msg.type == VHOST_IOTLB_UPDATE && msg.size == 0) { ret = -EINVAL; goto done; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/video/backlight/pwm_bl.c +++ linux-aws-6.5-6.5.0/drivers/video/backlight/pwm_bl.c @@ -626,9 +626,14 @@ { struct backlight_device *bl = platform_get_drvdata(pdev); struct pwm_bl_data *pb = bl_get_data(bl); + struct pwm_state state; backlight_device_unregister(bl); pwm_backlight_power_off(pb); + pwm_get_state(pb->pwm, &state); + state.duty_cycle = 0; + state.enabled = false; + pwm_apply_state(pb->pwm, &state); if (pb->exit) pb->exit(&pdev->dev); @@ -638,8 +643,13 @@ { struct backlight_device *bl = platform_get_drvdata(pdev); struct pwm_bl_data *pb = bl_get_data(bl); + struct pwm_state state; pwm_backlight_power_off(pb); + pwm_get_state(pb->pwm, &state); + state.duty_cycle = 0; + state.enabled = false; + pwm_apply_state(pb->pwm, &state); } #ifdef CONFIG_PM_SLEEP @@ -647,12 +657,24 @@ { struct backlight_device *bl = dev_get_drvdata(dev); struct pwm_bl_data *pb = bl_get_data(bl); + struct pwm_state state; if (pb->notify) pb->notify(pb->dev, 0); pwm_backlight_power_off(pb); + /* + * Note that disabling the PWM doesn't guarantee that the output stays + * at its inactive state. However without the PWM disabled, the PWM + * driver refuses to suspend. So disable here even though this might + * enable the backlight on poorly designed boards. + */ + pwm_get_state(pb->pwm, &state); + state.duty_cycle = 0; + state.enabled = false; + pwm_apply_state(pb->pwm, &state); + if (pb->notify_after) pb->notify_after(pb->dev, 0); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/video/fbdev/aty/atyfb_base.c +++ linux-aws-6.5-6.5.0/drivers/video/fbdev/aty/atyfb_base.c @@ -3440,11 +3440,15 @@ } info->fix.mmio_start = raddr; +#if defined(__i386__) || defined(__ia64__) /* * By using strong UC we force the MTRR to never have an * effect on the MMIO region on both non-PAT and PAT systems. */ par->ati_regbase = ioremap_uc(info->fix.mmio_start, 0x1000); +#else + par->ati_regbase = ioremap(info->fix.mmio_start, 0x1000); +#endif if (par->ati_regbase == NULL) return -ENOMEM; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/video/fbdev/fsl-diu-fb.c +++ linux-aws-6.5-6.5.0/drivers/video/fbdev/fsl-diu-fb.c @@ -490,7 +490,7 @@ * Workaround for failed writing desc register of planes. * Needed with MPC5121 DIU rev 2.0 silicon. */ -void wr_reg_wa(u32 *reg, u32 val) +static void wr_reg_wa(u32 *reg, u32 val) { do { out_be32(reg, val); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/video/fbdev/imsttfb.c +++ linux-aws-6.5-6.5.0/drivers/video/fbdev/imsttfb.c @@ -1419,7 +1419,6 @@ if ((info->var.xres * info->var.yres) * (info->var.bits_per_pixel >> 3) > info->fix.smem_len || !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) { printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel); - framebuffer_release(info); return -ENODEV; } @@ -1452,14 +1451,11 @@ FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_YPAN; - if (fb_alloc_cmap(&info->cmap, 0, 0)) { - framebuffer_release(info); + if (fb_alloc_cmap(&info->cmap, 0, 0)) return -ENODEV; - } if (register_framebuffer(info) < 0) { fb_dealloc_cmap(&info->cmap); - framebuffer_release(info); return -ENODEV; } @@ -1499,8 +1495,8 @@ if (!request_mem_region(addr, size, "imsttfb")) { printk(KERN_ERR "imsttfb: Can't reserve memory region\n"); - framebuffer_release(info); - return -ENODEV; + ret = -ENODEV; + goto release_info; } switch (pdev->device) { @@ -1517,36 +1513,39 @@ printk(KERN_INFO "imsttfb: Device 0x%x unknown, " "contact maintainer.\n", pdev->device); ret = -ENODEV; - goto error; + goto release_mem_region; } info->fix.smem_start = addr; info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ? 0x400000 : 0x800000); if (!info->screen_base) - goto error; + goto release_mem_region; info->fix.mmio_start = addr + 0x800000; par->dc_regs = ioremap(addr + 0x800000, 0x1000); if (!par->dc_regs) - goto error; + goto unmap_screen_base; par->cmap_regs_phys = addr + 0x840000; par->cmap_regs = (__u8 *)ioremap(addr + 0x840000, 0x1000); if (!par->cmap_regs) - goto error; + goto unmap_dc_regs; info->pseudo_palette = par->palette; ret = init_imstt(info); if (ret) - goto error; + goto unmap_cmap_regs; pci_set_drvdata(pdev, info); - return ret; + return 0; -error: - if (par->dc_regs) - iounmap(par->dc_regs); - if (info->screen_base) - iounmap(info->screen_base); +unmap_cmap_regs: + iounmap(par->cmap_regs); +unmap_dc_regs: + iounmap(par->dc_regs); +unmap_screen_base: + iounmap(info->screen_base); +release_mem_region: release_mem_region(addr, size); +release_info: framebuffer_release(info); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/video/fbdev/omap/omapfb_main.c +++ linux-aws-6.5-6.5.0/drivers/video/fbdev/omap/omapfb_main.c @@ -1648,13 +1648,13 @@ } fbdev->int_irq = platform_get_irq(pdev, 0); if (fbdev->int_irq < 0) { - r = ENXIO; + r = -ENXIO; goto cleanup; } fbdev->ext_irq = platform_get_irq(pdev, 1); if (fbdev->ext_irq < 0) { - r = ENXIO; + r = -ENXIO; goto cleanup; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/video/fbdev/uvesafb.c +++ linux-aws-6.5-6.5.0/drivers/video/fbdev/uvesafb.c @@ -1931,10 +1931,10 @@ } } - cn_del_callback(&uvesafb_cn_id); driver_remove_file(&uvesafb_driver.driver, &driver_attr_v86d); platform_device_unregister(uvesafb_device); platform_driver_unregister(&uvesafb_driver); + cn_del_callback(&uvesafb_cn_id); } module_exit(uvesafb_exit); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/virt/coco/sev-guest/sev-guest.c +++ linux-aws-6.5-6.5.0/drivers/virt/coco/sev-guest/sev-guest.c @@ -57,6 +57,11 @@ struct snp_secrets_page_layout *layout; struct snp_req_data input; + union { + struct snp_report_req report; + struct snp_derived_key_req derived_key; + struct snp_ext_report_req ext_report; + } req; u32 *os_area_msg_seqno; u8 *vmpck; }; @@ -473,8 +478,8 @@ static int get_report(struct snp_guest_dev *snp_dev, struct snp_guest_request_ioctl *arg) { struct snp_guest_crypto *crypto = snp_dev->crypto; + struct snp_report_req *req = &snp_dev->req.report; struct snp_report_resp *resp; - struct snp_report_req req; int rc, resp_len; lockdep_assert_held(&snp_cmd_mutex); @@ -482,7 +487,7 @@ if (!arg->req_data || !arg->resp_data) return -EINVAL; - if (copy_from_user(&req, (void __user *)arg->req_data, sizeof(req))) + if (copy_from_user(req, (void __user *)arg->req_data, sizeof(*req))) return -EFAULT; /* @@ -496,7 +501,7 @@ return -ENOMEM; rc = handle_guest_request(snp_dev, SVM_VMGEXIT_GUEST_REQUEST, arg, - SNP_MSG_REPORT_REQ, &req, sizeof(req), resp->data, + SNP_MSG_REPORT_REQ, req, sizeof(*req), resp->data, resp_len); if (rc) goto e_free; @@ -511,9 +516,9 @@ static int get_derived_key(struct snp_guest_dev *snp_dev, struct snp_guest_request_ioctl *arg) { + struct snp_derived_key_req *req = &snp_dev->req.derived_key; struct snp_guest_crypto *crypto = snp_dev->crypto; struct snp_derived_key_resp resp = {0}; - struct snp_derived_key_req req; int rc, resp_len; /* Response data is 64 bytes and max authsize for GCM is 16 bytes. */ u8 buf[64 + 16]; @@ -532,11 +537,11 @@ if (sizeof(buf) < resp_len) return -ENOMEM; - if (copy_from_user(&req, (void __user *)arg->req_data, sizeof(req))) + if (copy_from_user(req, (void __user *)arg->req_data, sizeof(*req))) return -EFAULT; rc = handle_guest_request(snp_dev, SVM_VMGEXIT_GUEST_REQUEST, arg, - SNP_MSG_KEY_REQ, &req, sizeof(req), buf, resp_len); + SNP_MSG_KEY_REQ, req, sizeof(*req), buf, resp_len); if (rc) return rc; @@ -552,8 +557,8 @@ static int get_ext_report(struct snp_guest_dev *snp_dev, struct snp_guest_request_ioctl *arg) { + struct snp_ext_report_req *req = &snp_dev->req.ext_report; struct snp_guest_crypto *crypto = snp_dev->crypto; - struct snp_ext_report_req req; struct snp_report_resp *resp; int ret, npages = 0, resp_len; @@ -562,18 +567,18 @@ if (!arg->req_data || !arg->resp_data) return -EINVAL; - if (copy_from_user(&req, (void __user *)arg->req_data, sizeof(req))) + if (copy_from_user(req, (void __user *)arg->req_data, sizeof(*req))) return -EFAULT; /* userspace does not want certificate data */ - if (!req.certs_len || !req.certs_address) + if (!req->certs_len || !req->certs_address) goto cmd; - if (req.certs_len > SEV_FW_BLOB_MAX_SIZE || - !IS_ALIGNED(req.certs_len, PAGE_SIZE)) + if (req->certs_len > SEV_FW_BLOB_MAX_SIZE || + !IS_ALIGNED(req->certs_len, PAGE_SIZE)) return -EINVAL; - if (!access_ok((const void __user *)req.certs_address, req.certs_len)) + if (!access_ok((const void __user *)req->certs_address, req->certs_len)) return -EFAULT; /* @@ -582,8 +587,8 @@ * the host. If host does not supply any certs in it, then copy * zeros to indicate that certificate data was not provided. */ - memset(snp_dev->certs_data, 0, req.certs_len); - npages = req.certs_len >> PAGE_SHIFT; + memset(snp_dev->certs_data, 0, req->certs_len); + npages = req->certs_len >> PAGE_SHIFT; cmd: /* * The intermediate response buffer is used while decrypting the @@ -597,14 +602,14 @@ snp_dev->input.data_npages = npages; ret = handle_guest_request(snp_dev, SVM_VMGEXIT_EXT_GUEST_REQUEST, arg, - SNP_MSG_REPORT_REQ, &req.data, - sizeof(req.data), resp->data, resp_len); + SNP_MSG_REPORT_REQ, &req->data, + sizeof(req->data), resp->data, resp_len); /* If certs length is invalid then copy the returned length */ if (arg->vmm_error == SNP_GUEST_VMM_ERR_INVALID_LEN) { - req.certs_len = snp_dev->input.data_npages << PAGE_SHIFT; + req->certs_len = snp_dev->input.data_npages << PAGE_SHIFT; - if (copy_to_user((void __user *)arg->req_data, &req, sizeof(req))) + if (copy_to_user((void __user *)arg->req_data, req, sizeof(*req))) ret = -EFAULT; } @@ -612,8 +617,8 @@ goto e_free; if (npages && - copy_to_user((void __user *)req.certs_address, snp_dev->certs_data, - req.certs_len)) { + copy_to_user((void __user *)req->certs_address, snp_dev->certs_data, + req->certs_len)) { ret = -EFAULT; goto e_free; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/virtio/virtio_balloon.c +++ linux-aws-6.5-6.5.0/drivers/virtio/virtio_balloon.c @@ -395,7 +395,11 @@ virtio_cread_le(vb->vdev, struct virtio_balloon_config, num_pages, &num_pages); - target = num_pages; + /* + * Aligned up to guest page size to avoid inflating and deflating + * balloon endlessly. + */ + target = ALIGN(num_pages, VIRTIO_BALLOON_PAGES_PER_PAGE); return target - vb->num_pages; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/virtio/virtio_mmio.c +++ linux-aws-6.5-6.5.0/drivers/virtio/virtio_mmio.c @@ -631,14 +631,17 @@ spin_lock_init(&vm_dev->lock); vm_dev->base = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(vm_dev->base)) - return PTR_ERR(vm_dev->base); + if (IS_ERR(vm_dev->base)) { + rc = PTR_ERR(vm_dev->base); + goto free_vm_dev; + } /* Check magic value */ magic = readl(vm_dev->base + VIRTIO_MMIO_MAGIC_VALUE); if (magic != ('v' | 'i' << 8 | 'r' << 16 | 't' << 24)) { dev_warn(&pdev->dev, "Wrong magic value 0x%08lx!\n", magic); - return -ENODEV; + rc = -ENODEV; + goto free_vm_dev; } /* Check device version */ @@ -646,7 +649,8 @@ if (vm_dev->version < 1 || vm_dev->version > 2) { dev_err(&pdev->dev, "Version %ld not supported!\n", vm_dev->version); - return -ENXIO; + rc = -ENXIO; + goto free_vm_dev; } vm_dev->vdev.id.device = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_ID); @@ -655,7 +659,8 @@ * virtio-mmio device with an ID 0 is a (dummy) placeholder * with no function. End probing now with no error reported. */ - return -ENODEV; + rc = -ENODEV; + goto free_vm_dev; } vm_dev->vdev.id.vendor = readl(vm_dev->base + VIRTIO_MMIO_VENDOR_ID); @@ -685,6 +690,10 @@ put_device(&vm_dev->vdev.dev); return rc; + +free_vm_dev: + kfree(vm_dev); + return rc; } static int virtio_mmio_remove(struct platform_device *pdev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/virtio/virtio_pci_modern_dev.c +++ linux-aws-6.5-6.5.0/drivers/virtio/virtio_pci_modern_dev.c @@ -291,7 +291,7 @@ err = -EINVAL; mdev->common = vp_modern_map_capability(mdev, common, sizeof(struct virtio_pci_common_cfg), 4, - 0, sizeof(struct virtio_pci_common_cfg), + 0, sizeof(struct virtio_pci_modern_common_cfg), NULL, NULL); if (!mdev->common) goto err_map_common; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/watchdog/ixp4xx_wdt.c +++ linux-aws-6.5-6.5.0/drivers/watchdog/ixp4xx_wdt.c @@ -105,6 +105,25 @@ .owner = THIS_MODULE, }; +/* + * The A0 version of the IXP422 had a bug in the watchdog making + * is useless, but we still need to use it to restart the system + * as it is the only way, so in this special case we register a + * "dummy" watchdog that doesn't really work, but will support + * the restart operation. + */ +static int ixp4xx_wdt_dummy(struct watchdog_device *wdd) +{ + return 0; +} + +static const struct watchdog_ops ixp4xx_wdt_restart_only_ops = { + .start = ixp4xx_wdt_dummy, + .stop = ixp4xx_wdt_dummy, + .restart = ixp4xx_wdt_restart, + .owner = THIS_MODULE, +}; + static const struct watchdog_info ixp4xx_wdt_info = { .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE @@ -114,14 +133,17 @@ static int ixp4xx_wdt_probe(struct platform_device *pdev) { + static const struct watchdog_ops *iwdt_ops; struct device *dev = &pdev->dev; struct ixp4xx_wdt *iwdt; struct clk *clk; int ret; if (!(read_cpuid_id() & 0xf) && !cpu_is_ixp46x()) { - dev_err(dev, "Rev. A0 IXP42x CPU detected - watchdog disabled\n"); - return -ENODEV; + dev_info(dev, "Rev. A0 IXP42x CPU detected - only restart supported\n"); + iwdt_ops = &ixp4xx_wdt_restart_only_ops; + } else { + iwdt_ops = &ixp4xx_wdt_ops; } iwdt = devm_kzalloc(dev, sizeof(*iwdt), GFP_KERNEL); @@ -141,7 +163,7 @@ iwdt->rate = IXP4XX_TIMER_FREQ; iwdt->wdd.info = &ixp4xx_wdt_info; - iwdt->wdd.ops = &ixp4xx_wdt_ops; + iwdt->wdd.ops = iwdt_ops; iwdt->wdd.min_timeout = 1; iwdt->wdd.max_timeout = U32_MAX / iwdt->rate; iwdt->wdd.parent = dev; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/watchdog/sbsa_gwdt.c +++ linux-aws-6.5-6.5.0/drivers/watchdog/sbsa_gwdt.c @@ -153,14 +153,14 @@ timeout = clamp_t(unsigned int, timeout, 1, wdd->max_hw_heartbeat_ms / 1000); if (action) - sbsa_gwdt_reg_write(gwdt->clk * timeout, gwdt); + sbsa_gwdt_reg_write((u64)gwdt->clk * timeout, gwdt); else /* * In the single stage mode, The first signal (WS0) is ignored, * the timeout is (WOR * 2), so the WOR should be configured * to half value of timeout. */ - sbsa_gwdt_reg_write(gwdt->clk / 2 * timeout, gwdt); + sbsa_gwdt_reg_write(((u64)gwdt->clk / 2) * timeout, gwdt); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/xen/platform-pci.c +++ linux-aws-6.5-6.5.0/drivers/xen/platform-pci.c @@ -64,7 +64,7 @@ static irqreturn_t do_hvm_evtchn_intr(int irq, void *dev_id) { - return xen_hvm_evtchn_do_upcall(); + return xen_evtchn_do_upcall(); } static int xen_allocate_irq(struct pci_dev *pdev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/xen/swiotlb-xen.c +++ linux-aws-6.5-6.5.0/drivers/xen/swiotlb-xen.c @@ -405,4 +405,5 @@ .get_sgtable = dma_common_get_sgtable, .alloc_pages = dma_common_alloc_pages, .free_pages = dma_common_free_pages, + .max_mapping_size = swiotlb_max_mapping_size, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/xen/xen-pciback/conf_space.c +++ linux-aws-6.5-6.5.0/drivers/xen/xen-pciback/conf_space.c @@ -288,12 +288,6 @@ u16 val; int ret = 0; - err = pci_read_config_word(dev, PCI_COMMAND, &val); - if (err) - return err; - if (!(val & PCI_COMMAND_INTX_DISABLE)) - ret |= INTERRUPT_TYPE_INTX; - /* * Do not trust dev->msi(x)_enabled here, as enabling could be done * bypassing the pci_*msi* functions, by the qemu. @@ -316,6 +310,19 @@ if (val & PCI_MSIX_FLAGS_ENABLE) ret |= INTERRUPT_TYPE_MSIX; } + + /* + * PCIe spec says device cannot use INTx if MSI/MSI-X is enabled, + * so check for INTx only when both are disabled. + */ + if (!ret) { + err = pci_read_config_word(dev, PCI_COMMAND, &val); + if (err) + return err; + if (!(val & PCI_COMMAND_INTX_DISABLE)) + ret |= INTERRUPT_TYPE_INTX; + } + return ret ?: INTERRUPT_TYPE_NONE; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/xen/xen-pciback/conf_space_capability.c +++ linux-aws-6.5-6.5.0/drivers/xen/xen-pciback/conf_space_capability.c @@ -236,10 +236,16 @@ return PCIBIOS_SET_FAILED; if (new_value & field_config->enable_bit) { - /* don't allow enabling together with other interrupt types */ + /* + * Don't allow enabling together with other interrupt type, but do + * allow enabling MSI(-X) while INTx is still active to please Linuxes + * MSI(-X) startup sequence. It is safe to do, as according to PCI + * spec, device with enabled MSI(-X) shouldn't use INTx. + */ int int_type = xen_pcibk_get_interrupt_type(dev); if (int_type == INTERRUPT_TYPE_NONE || + int_type == INTERRUPT_TYPE_INTX || int_type == field_config->int_type) goto write; return PCIBIOS_SET_FAILED; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/drivers/xen/xen-pciback/conf_space_header.c +++ linux-aws-6.5-6.5.0/drivers/xen/xen-pciback/conf_space_header.c @@ -104,24 +104,9 @@ pci_clear_mwi(dev); } - if (dev_data && dev_data->allow_interrupt_control) { - if ((cmd->val ^ value) & PCI_COMMAND_INTX_DISABLE) { - if (value & PCI_COMMAND_INTX_DISABLE) { - pci_intx(dev, 0); - } else { - /* Do not allow enabling INTx together with MSI or MSI-X. */ - switch (xen_pcibk_get_interrupt_type(dev)) { - case INTERRUPT_TYPE_NONE: - pci_intx(dev, 1); - break; - case INTERRUPT_TYPE_INTX: - break; - default: - return PCIBIOS_SET_FAILED; - } - } - } - } + if (dev_data && dev_data->allow_interrupt_control && + ((cmd->val ^ value) & PCI_COMMAND_INTX_DISABLE)) + pci_intx(dev, !(value & PCI_COMMAND_INTX_DISABLE)); cmd->val = value; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/9p/xattr.c +++ linux-aws-6.5-6.5.0/fs/9p/xattr.c @@ -68,7 +68,7 @@ struct p9_fid *fid; int ret; - p9_debug(P9_DEBUG_VFS, "name = %s value_len = %zu\n", + p9_debug(P9_DEBUG_VFS, "name = '%s' value_len = %zu\n", name, buffer_size); fid = v9fs_fid_lookup(dentry); if (IS_ERR(fid)) @@ -139,7 +139,8 @@ ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) { - return v9fs_xattr_get(dentry, NULL, buffer, buffer_size); + /* Txattrwalk with an empty string lists xattrs instead */ + return v9fs_xattr_get(dentry, "", buffer, buffer_size); } static int v9fs_xattr_handler_get(const struct xattr_handler *handler, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/afs/dynroot.c +++ linux-aws-6.5-6.5.0/fs/afs/dynroot.c @@ -132,8 +132,8 @@ ret = dns_query(net->net, "afsdb", name, len, "srv=1", NULL, NULL, false); - if (ret == -ENODATA) - ret = -EDESTADDRREQ; + if (ret == -ENODATA || ret == -ENOKEY) + ret = -ENOENT; return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/afs/internal.h +++ linux-aws-6.5-6.5.0/fs/afs/internal.h @@ -553,6 +553,7 @@ }; struct afs_server_list { + struct rcu_head rcu; afs_volid_t vids[AFS_MAXTYPES]; /* Volume IDs */ refcount_t usage; unsigned char nr_servers; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/afs/server_list.c +++ linux-aws-6.5-6.5.0/fs/afs/server_list.c @@ -17,7 +17,7 @@ for (i = 0; i < slist->nr_servers; i++) afs_unuse_server(net, slist->servers[i].server, afs_server_trace_put_slist); - kfree(slist); + kfree_rcu(slist, rcu); } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/afs/super.c +++ linux-aws-6.5-6.5.0/fs/afs/super.c @@ -407,6 +407,8 @@ return PTR_ERR(volume); ctx->volume = volume; + if (volume->type != AFSVL_RWVOL) + ctx->flock_mode = afs_flock_mode_local; } return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/afs/vl_rotate.c +++ linux-aws-6.5-6.5.0/fs/afs/vl_rotate.c @@ -58,6 +58,12 @@ } /* Status load is ordered after lookup counter load */ + if (cell->dns_status == DNS_LOOKUP_GOT_NOT_FOUND) { + pr_warn("No record of cell %s\n", cell->name); + vc->error = -ENOENT; + return false; + } + if (cell->dns_source == DNS_RECORD_UNAVAILABLE) { vc->error = -EDESTADDRREQ; return false; @@ -285,6 +291,7 @@ */ static void afs_vl_dump_edestaddrreq(const struct afs_vl_cursor *vc) { + struct afs_cell *cell = vc->cell; static int count; int i; @@ -294,6 +301,9 @@ rcu_read_lock(); pr_notice("EDESTADDR occurred\n"); + pr_notice("CELL: %s err=%d\n", cell->name, cell->error); + pr_notice("DNS: src=%u st=%u lc=%x\n", + cell->dns_source, cell->dns_status, cell->dns_lookup_count); pr_notice("VC: ut=%lx ix=%u ni=%hu fl=%hx err=%hd\n", vc->untried, vc->index, vc->nr_iterations, vc->flags, vc->error); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/backref.c +++ linux-aws-6.5-6.5.0/fs/btrfs/backref.c @@ -3196,12 +3196,14 @@ * We still need to do a tree search to find out the parents. This is for * TREE_BLOCK_REF backref (keyed or inlined). * + * @trans: Transaction handle. * @ref_key: The same as @ref_key in handle_direct_tree_backref() * @tree_key: The first key of this tree block. * @path: A clean (released) path, to avoid allocating path every time * the function get called. */ -static int handle_indirect_tree_backref(struct btrfs_backref_cache *cache, +static int handle_indirect_tree_backref(struct btrfs_trans_handle *trans, + struct btrfs_backref_cache *cache, struct btrfs_path *path, struct btrfs_key *ref_key, struct btrfs_key *tree_key, @@ -3315,7 +3317,7 @@ * If we know the block isn't shared we can avoid * checking its backrefs. */ - if (btrfs_block_can_be_shared(root, eb)) + if (btrfs_block_can_be_shared(trans, root, eb)) upper->checked = 0; else upper->checked = 1; @@ -3363,17 +3365,18 @@ * links aren't yet bi-directional. Needs to finish such links. * Use btrfs_backref_finish_upper_links() to finish such linkage. * + * @trans: Transaction handle. * @path: Released path for indirect tree backref lookup * @iter: Released backref iter for extent tree search * @node_key: The first key of the tree block */ -int btrfs_backref_add_tree_node(struct btrfs_backref_cache *cache, +int btrfs_backref_add_tree_node(struct btrfs_trans_handle *trans, + struct btrfs_backref_cache *cache, struct btrfs_path *path, struct btrfs_backref_iter *iter, struct btrfs_key *node_key, struct btrfs_backref_node *cur) { - struct btrfs_fs_info *fs_info = cache->fs_info; struct btrfs_backref_edge *edge; struct btrfs_backref_node *exist; int ret; @@ -3462,25 +3465,21 @@ ret = handle_direct_tree_backref(cache, &key, cur); if (ret < 0) goto out; - continue; - } else if (unlikely(key.type == BTRFS_EXTENT_REF_V0_KEY)) { - ret = -EINVAL; - btrfs_print_v0_err(fs_info); - btrfs_handle_fs_error(fs_info, ret, NULL); - goto out; - } else if (key.type != BTRFS_TREE_BLOCK_REF_KEY) { - continue; + } else if (key.type == BTRFS_TREE_BLOCK_REF_KEY) { + /* + * key.type == BTRFS_TREE_BLOCK_REF_KEY, inline ref + * offset means the root objectid. We need to search + * the tree to get its parent bytenr. + */ + ret = handle_indirect_tree_backref(trans, cache, path, + &key, node_key, cur); + if (ret < 0) + goto out; } - /* - * key.type == BTRFS_TREE_BLOCK_REF_KEY, inline ref offset - * means the root objectid. We need to search the tree to get - * its parent bytenr. + * Unrecognized tree backref items (if it can pass tree-checker) + * would be ignored. */ - ret = handle_indirect_tree_backref(cache, path, &key, node_key, - cur); - if (ret < 0) - goto out; } ret = 0; cur->checked = 1; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/backref.h +++ linux-aws-6.5-6.5.0/fs/btrfs/backref.h @@ -540,7 +540,8 @@ bytenr); } -int btrfs_backref_add_tree_node(struct btrfs_backref_cache *cache, +int btrfs_backref_add_tree_node(struct btrfs_trans_handle *trans, + struct btrfs_backref_cache *cache, struct btrfs_path *path, struct btrfs_backref_iter *iter, struct btrfs_key *node_key, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/ctree.c +++ linux-aws-6.5-6.5.0/fs/btrfs/ctree.c @@ -359,7 +359,7 @@ return ret; } - btrfs_mark_buffer_dirty(cow); + btrfs_mark_buffer_dirty(trans, cow); *cow_ret = cow; return 0; } @@ -367,7 +367,8 @@ /* * check if the tree block can be shared by multiple trees */ -int btrfs_block_can_be_shared(struct btrfs_root *root, +int btrfs_block_can_be_shared(struct btrfs_trans_handle *trans, + struct btrfs_root *root, struct extent_buffer *buf) { /* @@ -376,11 +377,21 @@ * not allocated by tree relocation, we know the block is not shared. */ if (test_bit(BTRFS_ROOT_SHAREABLE, &root->state) && - buf != root->node && buf != root->commit_root && + buf != root->node && (btrfs_header_generation(buf) <= btrfs_root_last_snapshot(&root->root_item) || - btrfs_header_flag(buf, BTRFS_HEADER_FLAG_RELOC))) - return 1; + btrfs_header_flag(buf, BTRFS_HEADER_FLAG_RELOC))) { + if (buf != root->commit_root) + return 1; + /* + * An extent buffer that used to be the commit root may still be + * shared because the tree height may have increased and it + * became a child of a higher level root. This can happen when + * snapshotting a subvolume created in the current transaction. + */ + if (btrfs_header_generation(buf) == trans->transid) + return 1; + } return 0; } @@ -415,7 +426,7 @@ * are only allowed for blocks use full backrefs. */ - if (btrfs_block_can_be_shared(root, buf)) { + if (btrfs_block_can_be_shared(trans, root, buf)) { ret = btrfs_lookup_extent_info(trans, fs_info, buf->start, btrfs_header_level(buf), 1, &refs, &flags); @@ -616,7 +627,7 @@ cow->start); btrfs_set_node_ptr_generation(parent, parent_slot, trans->transid); - btrfs_mark_buffer_dirty(parent); + btrfs_mark_buffer_dirty(trans, parent); if (last_ref) { ret = btrfs_tree_mod_log_free_eb(buf); if (ret) { @@ -632,7 +643,7 @@ if (unlock_orig) btrfs_tree_unlock(buf); free_extent_buffer_stale(buf); - btrfs_mark_buffer_dirty(cow); + btrfs_mark_buffer_dirty(trans, cow); *cow_ret = cow; return 0; } @@ -682,18 +693,30 @@ u64 search_start; int ret; - if (test_bit(BTRFS_ROOT_DELETING, &root->state)) - btrfs_err(fs_info, - "COW'ing blocks on a fs root that's being dropped"); - - if (trans->transaction != fs_info->running_transaction) - WARN(1, KERN_CRIT "trans %llu running %llu\n", - trans->transid, - fs_info->running_transaction->transid); - - if (trans->transid != fs_info->generation) - WARN(1, KERN_CRIT "trans %llu running %llu\n", - trans->transid, fs_info->generation); + if (unlikely(test_bit(BTRFS_ROOT_DELETING, &root->state))) { + btrfs_abort_transaction(trans, -EUCLEAN); + btrfs_crit(fs_info, + "attempt to COW block %llu on root %llu that is being deleted", + buf->start, btrfs_root_id(root)); + return -EUCLEAN; + } + + /* + * COWing must happen through a running transaction, which always + * matches the current fs generation (it's a transaction with a state + * less than TRANS_STATE_UNBLOCKED). If it doesn't, then turn the fs + * into error state to prevent the commit of any transaction. + */ + if (unlikely(trans->transaction != fs_info->running_transaction || + trans->transid != fs_info->generation)) { + btrfs_abort_transaction(trans, -EUCLEAN); + btrfs_crit(fs_info, +"unexpected transaction when attempting to COW block %llu on root %llu, transaction %llu running transaction %llu fs generation %llu", + buf->start, btrfs_root_id(root), trans->transid, + fs_info->running_transaction->transid, + fs_info->generation); + return -EUCLEAN; + } if (!should_cow_block(trans, root, buf)) { *cow_ret = buf; @@ -805,8 +828,22 @@ int progress_passed = 0; struct btrfs_disk_key disk_key; - WARN_ON(trans->transaction != fs_info->running_transaction); - WARN_ON(trans->transid != fs_info->generation); + /* + * COWing must happen through a running transaction, which always + * matches the current fs generation (it's a transaction with a state + * less than TRANS_STATE_UNBLOCKED). If it doesn't, then turn the fs + * into error state to prevent the commit of any transaction. + */ + if (unlikely(trans->transaction != fs_info->running_transaction || + trans->transid != fs_info->generation)) { + btrfs_abort_transaction(trans, -EUCLEAN); + btrfs_crit(fs_info, +"unexpected transaction when attempting to reallocate parent %llu for root %llu, transaction %llu running transaction %llu fs generation %llu", + parent->start, btrfs_root_id(root), trans->transid, + fs_info->running_transaction->transid, + fs_info->generation); + return -EUCLEAN; + } parent_nritems = btrfs_header_nritems(parent); blocksize = fs_info->nodesize; @@ -1160,7 +1197,7 @@ goto out; } btrfs_set_node_key(parent, &right_key, pslot + 1); - btrfs_mark_buffer_dirty(parent); + btrfs_mark_buffer_dirty(trans, parent); } } if (btrfs_header_nritems(mid) == 1) { @@ -1218,7 +1255,7 @@ goto out; } btrfs_set_node_key(parent, &mid_key, pslot); - btrfs_mark_buffer_dirty(parent); + btrfs_mark_buffer_dirty(trans, parent); } /* update the path */ @@ -1325,7 +1362,7 @@ return ret; } btrfs_set_node_key(parent, &disk_key, pslot); - btrfs_mark_buffer_dirty(parent); + btrfs_mark_buffer_dirty(trans, parent); if (btrfs_header_nritems(left) > orig_slot) { path->nodes[level] = left; path->slots[level + 1] -= 1; @@ -1385,7 +1422,7 @@ return ret; } btrfs_set_node_key(parent, &disk_key, pslot + 1); - btrfs_mark_buffer_dirty(parent); + btrfs_mark_buffer_dirty(trans, parent); if (btrfs_header_nritems(mid) <= orig_slot) { path->nodes[level] = right; @@ -2641,7 +2678,8 @@ * higher levels * */ -static void fixup_low_keys(struct btrfs_path *path, +static void fixup_low_keys(struct btrfs_trans_handle *trans, + struct btrfs_path *path, struct btrfs_disk_key *key, int level) { int i; @@ -2658,7 +2696,7 @@ BTRFS_MOD_LOG_KEY_REPLACE); BUG_ON(ret < 0); btrfs_set_node_key(t, key, tslot); - btrfs_mark_buffer_dirty(path->nodes[i]); + btrfs_mark_buffer_dirty(trans, path->nodes[i]); if (tslot != 0) break; } @@ -2670,10 +2708,11 @@ * This function isn't completely safe. It's the caller's responsibility * that the new key won't break the order */ -void btrfs_set_item_key_safe(struct btrfs_fs_info *fs_info, +void btrfs_set_item_key_safe(struct btrfs_trans_handle *trans, struct btrfs_path *path, const struct btrfs_key *new_key) { + struct btrfs_fs_info *fs_info = trans->fs_info; struct btrfs_disk_key disk_key; struct extent_buffer *eb; int slot; @@ -2711,9 +2750,9 @@ btrfs_cpu_key_to_disk(&disk_key, new_key); btrfs_set_item_key(eb, &disk_key, slot); - btrfs_mark_buffer_dirty(eb); + btrfs_mark_buffer_dirty(trans, eb); if (slot == 0) - fixup_low_keys(path, &disk_key, 1); + fixup_low_keys(trans, path, &disk_key, 1); } /* @@ -2844,8 +2883,8 @@ } btrfs_set_header_nritems(src, src_nritems - push_items); btrfs_set_header_nritems(dst, dst_nritems + push_items); - btrfs_mark_buffer_dirty(src); - btrfs_mark_buffer_dirty(dst); + btrfs_mark_buffer_dirty(trans, src); + btrfs_mark_buffer_dirty(trans, dst); return ret; } @@ -2920,8 +2959,8 @@ btrfs_set_header_nritems(src, src_nritems - push_items); btrfs_set_header_nritems(dst, dst_nritems + push_items); - btrfs_mark_buffer_dirty(src); - btrfs_mark_buffer_dirty(dst); + btrfs_mark_buffer_dirty(trans, src); + btrfs_mark_buffer_dirty(trans, dst); return ret; } @@ -2970,7 +3009,7 @@ btrfs_set_node_ptr_generation(c, 0, lower_gen); - btrfs_mark_buffer_dirty(c); + btrfs_mark_buffer_dirty(trans, c); old = root->node; ret = btrfs_tree_mod_log_insert_root(root->node, c, false); @@ -3042,7 +3081,7 @@ WARN_ON(trans->transid == 0); btrfs_set_node_ptr_generation(lower, slot, trans->transid); btrfs_set_header_nritems(lower, nritems + 1); - btrfs_mark_buffer_dirty(lower); + btrfs_mark_buffer_dirty(trans, lower); return 0; } @@ -3121,8 +3160,8 @@ btrfs_set_header_nritems(split, c_nritems - mid); btrfs_set_header_nritems(c, mid); - btrfs_mark_buffer_dirty(c); - btrfs_mark_buffer_dirty(split); + btrfs_mark_buffer_dirty(trans, c); + btrfs_mark_buffer_dirty(trans, split); ret = insert_ptr(trans, path, &disk_key, split->start, path->slots[level + 1] + 1, level + 1); @@ -3288,15 +3327,15 @@ btrfs_set_header_nritems(left, left_nritems); if (left_nritems) - btrfs_mark_buffer_dirty(left); + btrfs_mark_buffer_dirty(trans, left); else btrfs_clear_buffer_dirty(trans, left); - btrfs_mark_buffer_dirty(right); + btrfs_mark_buffer_dirty(trans, right); btrfs_item_key(right, &disk_key, 0); btrfs_set_node_key(upper, &disk_key, slot + 1); - btrfs_mark_buffer_dirty(upper); + btrfs_mark_buffer_dirty(trans, upper); /* then fixup the leaf pointer in the path */ if (path->slots[0] >= left_nritems) { @@ -3508,14 +3547,14 @@ btrfs_set_token_item_offset(&token, i, push_space); } - btrfs_mark_buffer_dirty(left); + btrfs_mark_buffer_dirty(trans, left); if (right_nritems) - btrfs_mark_buffer_dirty(right); + btrfs_mark_buffer_dirty(trans, right); else btrfs_clear_buffer_dirty(trans, right); btrfs_item_key(right, &disk_key, 0); - fixup_low_keys(path, &disk_key, 1); + fixup_low_keys(trans, path, &disk_key, 1); /* then fixup the leaf pointer in the path */ if (path->slots[0] < push_items) { @@ -3646,8 +3685,8 @@ if (ret < 0) return ret; - btrfs_mark_buffer_dirty(right); - btrfs_mark_buffer_dirty(l); + btrfs_mark_buffer_dirty(trans, right); + btrfs_mark_buffer_dirty(trans, l); BUG_ON(path->slots[0] != slot); if (mid <= slot) { @@ -3888,7 +3927,7 @@ path->nodes[0] = right; path->slots[0] = 0; if (path->slots[1] == 0) - fixup_low_keys(path, &disk_key, 1); + fixup_low_keys(trans, path, &disk_key, 1); } /* * We create a new leaf 'right' for the required ins_len and @@ -3987,7 +4026,8 @@ return ret; } -static noinline int split_item(struct btrfs_path *path, +static noinline int split_item(struct btrfs_trans_handle *trans, + struct btrfs_path *path, const struct btrfs_key *new_key, unsigned long split_offset) { @@ -4046,7 +4086,7 @@ write_extent_buffer(leaf, buf + split_offset, btrfs_item_ptr_offset(leaf, slot), item_size - split_offset); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); BUG_ON(btrfs_leaf_free_space(leaf) < 0); kfree(buf); @@ -4080,7 +4120,7 @@ if (ret) return ret; - ret = split_item(path, new_key, split_offset); + ret = split_item(trans, path, new_key, split_offset); return ret; } @@ -4090,7 +4130,8 @@ * off the end of the item or if we shift the item to chop bytes off * the front. */ -void btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end) +void btrfs_truncate_item(struct btrfs_trans_handle *trans, + struct btrfs_path *path, u32 new_size, int from_end) { int slot; struct extent_buffer *leaf; @@ -4166,11 +4207,11 @@ btrfs_set_disk_key_offset(&disk_key, offset + size_diff); btrfs_set_item_key(leaf, &disk_key, slot); if (slot == 0) - fixup_low_keys(path, &disk_key, 1); + fixup_low_keys(trans, path, &disk_key, 1); } btrfs_set_item_size(leaf, slot, new_size); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); if (btrfs_leaf_free_space(leaf) < 0) { btrfs_print_leaf(leaf); @@ -4181,7 +4222,8 @@ /* * make the item pointed to by the path bigger, data_size is the added size. */ -void btrfs_extend_item(struct btrfs_path *path, u32 data_size) +void btrfs_extend_item(struct btrfs_trans_handle *trans, + struct btrfs_path *path, u32 data_size) { int slot; struct extent_buffer *leaf; @@ -4231,7 +4273,7 @@ data_end = old_data; old_size = btrfs_item_size(leaf, slot); btrfs_set_item_size(leaf, slot, old_size + data_size); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); if (btrfs_leaf_free_space(leaf) < 0) { btrfs_print_leaf(leaf); @@ -4242,6 +4284,7 @@ /* * Make space in the node before inserting one or more items. * + * @trans: transaction handle * @root: root we are inserting items to * @path: points to the leaf/slot where we are going to insert new items * @batch: information about the batch of items to insert @@ -4249,7 +4292,8 @@ * Main purpose is to save stack depth by doing the bulk of the work in a * function that doesn't call btrfs_search_slot */ -static void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path, +static void setup_items_for_insert(struct btrfs_trans_handle *trans, + struct btrfs_root *root, struct btrfs_path *path, const struct btrfs_item_batch *batch) { struct btrfs_fs_info *fs_info = root->fs_info; @@ -4269,7 +4313,7 @@ */ if (path->slots[0] == 0) { btrfs_cpu_key_to_disk(&disk_key, &batch->keys[0]); - fixup_low_keys(path, &disk_key, 1); + fixup_low_keys(trans, path, &disk_key, 1); } btrfs_unlock_up_safe(path, 1); @@ -4328,7 +4372,7 @@ } btrfs_set_header_nritems(leaf, nritems + batch->nr); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); if (btrfs_leaf_free_space(leaf) < 0) { btrfs_print_leaf(leaf); @@ -4339,12 +4383,14 @@ /* * Insert a new item into a leaf. * + * @trans: Transaction handle. * @root: The root of the btree. * @path: A path pointing to the target leaf and slot. * @key: The key of the new item. * @data_size: The size of the data associated with the new key. */ -void btrfs_setup_item_for_insert(struct btrfs_root *root, +void btrfs_setup_item_for_insert(struct btrfs_trans_handle *trans, + struct btrfs_root *root, struct btrfs_path *path, const struct btrfs_key *key, u32 data_size) @@ -4356,7 +4402,7 @@ batch.total_data_size = data_size; batch.nr = 1; - setup_items_for_insert(root, path, &batch); + setup_items_for_insert(trans, root, path, &batch); } /* @@ -4382,7 +4428,7 @@ slot = path->slots[0]; BUG_ON(slot < 0); - setup_items_for_insert(root, path, batch); + setup_items_for_insert(trans, root, path, batch); return 0; } @@ -4407,7 +4453,7 @@ leaf = path->nodes[0]; ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); write_extent_buffer(leaf, data, ptr, data_size); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); } btrfs_free_path(path); return ret; @@ -4438,7 +4484,7 @@ return ret; path->slots[0]++; - btrfs_setup_item_for_insert(root, path, new_key, item_size); + btrfs_setup_item_for_insert(trans, root, path, new_key, item_size); leaf = path->nodes[0]; memcpy_extent_buffer(leaf, btrfs_item_ptr_offset(leaf, path->slots[0]), @@ -4496,9 +4542,9 @@ struct btrfs_disk_key disk_key; btrfs_node_key(parent, &disk_key, 0); - fixup_low_keys(path, &disk_key, level + 1); + fixup_low_keys(trans, path, &disk_key, level + 1); } - btrfs_mark_buffer_dirty(parent); + btrfs_mark_buffer_dirty(trans, parent); return 0; } @@ -4595,7 +4641,7 @@ struct btrfs_disk_key disk_key; btrfs_item_key(leaf, &disk_key, 0); - fixup_low_keys(path, &disk_key, 1); + fixup_low_keys(trans, path, &disk_key, 1); } /* @@ -4660,11 +4706,11 @@ * dirtied this buffer */ if (path->nodes[0] == leaf) - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); free_extent_buffer(leaf); } } else { - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); } } return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/ctree.h +++ linux-aws-6.5-6.5.0/fs/btrfs/ctree.h @@ -518,7 +518,7 @@ int type); int btrfs_previous_extent_item(struct btrfs_root *root, struct btrfs_path *path, u64 min_objectid); -void btrfs_set_item_key_safe(struct btrfs_fs_info *fs_info, +void btrfs_set_item_key_safe(struct btrfs_trans_handle *trans, struct btrfs_path *path, const struct btrfs_key *new_key); struct extent_buffer *btrfs_root_node(struct btrfs_root *root); @@ -540,12 +540,15 @@ struct btrfs_root *root, struct extent_buffer *buf, struct extent_buffer **cow_ret, u64 new_root_objectid); -int btrfs_block_can_be_shared(struct btrfs_root *root, +int btrfs_block_can_be_shared(struct btrfs_trans_handle *trans, + struct btrfs_root *root, struct extent_buffer *buf); int btrfs_del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, int level, int slot); -void btrfs_extend_item(struct btrfs_path *path, u32 data_size); -void btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end); +void btrfs_extend_item(struct btrfs_trans_handle *trans, + struct btrfs_path *path, u32 data_size); +void btrfs_truncate_item(struct btrfs_trans_handle *trans, + struct btrfs_path *path, u32 new_size, int from_end); int btrfs_split_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, @@ -609,7 +612,8 @@ int nr; }; -void btrfs_setup_item_for_insert(struct btrfs_root *root, +void btrfs_setup_item_for_insert(struct btrfs_trans_handle *trans, + struct btrfs_root *root, struct btrfs_path *path, const struct btrfs_key *key, u32 data_size); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/delalloc-space.c +++ linux-aws-6.5-6.5.0/fs/btrfs/delalloc-space.c @@ -322,9 +322,6 @@ } else { if (current->journal_info) flush = BTRFS_RESERVE_FLUSH_LIMIT; - - if (btrfs_transaction_in_commit(fs_info)) - schedule_timeout(1); } num_bytes = ALIGN(num_bytes, fs_info->sectorsize); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/delayed-ref.c +++ linux-aws-6.5-6.5.0/fs/btrfs/delayed-ref.c @@ -103,24 +103,17 @@ * Transfer bytes to our delayed refs rsv. * * @fs_info: the filesystem - * @src: source block rsv to transfer from * @num_bytes: number of bytes to transfer * - * This transfers up to the num_bytes amount from the src rsv to the + * This transfers up to the num_bytes amount, previously reserved, to the * delayed_refs_rsv. Any extra bytes are returned to the space info. */ void btrfs_migrate_to_delayed_refs_rsv(struct btrfs_fs_info *fs_info, - struct btrfs_block_rsv *src, u64 num_bytes) { struct btrfs_block_rsv *delayed_refs_rsv = &fs_info->delayed_refs_rsv; u64 to_free = 0; - spin_lock(&src->lock); - src->reserved -= num_bytes; - src->size -= num_bytes; - spin_unlock(&src->lock); - spin_lock(&delayed_refs_rsv->lock); if (delayed_refs_rsv->size > delayed_refs_rsv->reserved) { u64 delta = delayed_refs_rsv->size - @@ -163,6 +156,8 @@ struct btrfs_block_rsv *block_rsv = &fs_info->delayed_refs_rsv; u64 limit = btrfs_calc_delayed_ref_bytes(fs_info, 1); u64 num_bytes = 0; + u64 refilled_bytes; + u64 to_free; int ret = -ENOSPC; spin_lock(&block_rsv->lock); @@ -178,9 +173,38 @@ ret = btrfs_reserve_metadata_bytes(fs_info, block_rsv, num_bytes, flush); if (ret) return ret; - btrfs_block_rsv_add_bytes(block_rsv, num_bytes, false); - trace_btrfs_space_reservation(fs_info, "delayed_refs_rsv", - 0, num_bytes, 1); + + /* + * We may have raced with someone else, so check again if we the block + * reserve is still not full and release any excess space. + */ + spin_lock(&block_rsv->lock); + if (block_rsv->reserved < block_rsv->size) { + u64 needed = block_rsv->size - block_rsv->reserved; + + if (num_bytes >= needed) { + block_rsv->reserved += needed; + block_rsv->full = true; + to_free = num_bytes - needed; + refilled_bytes = needed; + } else { + block_rsv->reserved += num_bytes; + to_free = 0; + refilled_bytes = num_bytes; + } + } else { + to_free = num_bytes; + refilled_bytes = 0; + } + spin_unlock(&block_rsv->lock); + + if (to_free > 0) + btrfs_space_info_free_bytes_may_use(fs_info, block_rsv->space_info, + to_free); + + if (refilled_bytes > 0) + trace_btrfs_space_reservation(fs_info, "delayed_refs_rsv", 0, + refilled_bytes, 1); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/delayed-ref.h +++ linux-aws-6.5-6.5.0/fs/btrfs/delayed-ref.h @@ -407,7 +407,6 @@ int btrfs_delayed_refs_rsv_refill(struct btrfs_fs_info *fs_info, enum btrfs_reserve_flush_enum flush); void btrfs_migrate_to_delayed_refs_rsv(struct btrfs_fs_info *fs_info, - struct btrfs_block_rsv *src, u64 num_bytes); bool btrfs_check_space_for_delayed_refs(struct btrfs_fs_info *fs_info); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/dev-replace.c +++ linux-aws-6.5-6.5.0/fs/btrfs/dev-replace.c @@ -442,7 +442,7 @@ dev_replace->item_needs_writeback = 0; up_write(&dev_replace->rwsem); - btrfs_mark_buffer_dirty(eb); + btrfs_mark_buffer_dirty(trans, eb); out: btrfs_free_path(path); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/dir-item.c +++ linux-aws-6.5-6.5.0/fs/btrfs/dir-item.c @@ -38,7 +38,7 @@ di = btrfs_match_dir_item_name(fs_info, path, name, name_len); if (di) return ERR_PTR(-EEXIST); - btrfs_extend_item(path, data_size); + btrfs_extend_item(trans, path, data_size); } else if (ret < 0) return ERR_PTR(ret); WARN_ON(ret > 0); @@ -93,7 +93,7 @@ write_extent_buffer(leaf, name, name_ptr, name_len); write_extent_buffer(leaf, data, data_ptr, data_len); - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); return ret; } @@ -153,7 +153,7 @@ name_ptr = (unsigned long)(dir_item + 1); write_extent_buffer(leaf, name->name, name_ptr, name->len); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); second_insert: /* FIXME, use some real flag for selecting the extra index */ @@ -439,7 +439,7 @@ start = btrfs_item_ptr_offset(leaf, path->slots[0]); memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, item_len - (ptr + sub_item_len - start)); - btrfs_truncate_item(path, item_len - sub_item_len, 1); + btrfs_truncate_item(trans, path, item_len - sub_item_len, 1); } return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/disk-io.h +++ linux-aws-6.5-6.5.0/fs/btrfs/disk-io.h @@ -105,7 +105,8 @@ } void btrfs_put_root(struct btrfs_root *root); -void btrfs_mark_buffer_dirty(struct extent_buffer *buf); +void btrfs_mark_buffer_dirty(struct btrfs_trans_handle *trans, + struct extent_buffer *buf); int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid, int atomic); int btrfs_read_extent_buffer(struct extent_buffer *buf, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/free-space-cache.c +++ linux-aws-6.5-6.5.0/fs/btrfs/free-space-cache.c @@ -195,7 +195,7 @@ btrfs_set_inode_nlink(leaf, inode_item, 1); btrfs_set_inode_transid(leaf, inode_item, trans->transid); btrfs_set_inode_block_group(leaf, inode_item, offset); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); key.objectid = BTRFS_FREE_SPACE_OBJECTID; @@ -213,7 +213,7 @@ struct btrfs_free_space_header); memzero_extent_buffer(leaf, (unsigned long)header, sizeof(*header)); btrfs_set_free_space_key(leaf, header, &disk_key); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); return 0; @@ -1185,7 +1185,7 @@ btrfs_set_free_space_entries(leaf, header, entries); btrfs_set_free_space_bitmaps(leaf, header, bitmaps); btrfs_set_free_space_generation(leaf, header, trans->transid); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/free-space-tree.c +++ linux-aws-6.5-6.5.0/fs/btrfs/free-space-tree.c @@ -89,7 +89,7 @@ struct btrfs_free_space_info); btrfs_set_free_space_extent_count(leaf, info, 0); btrfs_set_free_space_flags(leaf, info, 0); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); ret = 0; out: @@ -287,7 +287,7 @@ flags |= BTRFS_FREE_SPACE_USING_BITMAPS; btrfs_set_free_space_flags(leaf, info, flags); expected_extent_count = btrfs_free_space_extent_count(leaf, info); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); if (extent_count != expected_extent_count) { @@ -324,7 +324,7 @@ ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); write_extent_buffer(leaf, bitmap_cursor, ptr, data_size); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); i += extent_size; @@ -430,7 +430,7 @@ flags &= ~BTRFS_FREE_SPACE_USING_BITMAPS; btrfs_set_free_space_flags(leaf, info, flags); expected_extent_count = btrfs_free_space_extent_count(leaf, info); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); nrbits = block_group->length >> block_group->fs_info->sectorsize_bits; @@ -495,7 +495,7 @@ extent_count += new_extents; btrfs_set_free_space_extent_count(path->nodes[0], info, extent_count); - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); btrfs_release_path(path); if (!(flags & BTRFS_FREE_SPACE_USING_BITMAPS) && @@ -533,7 +533,8 @@ return !!extent_buffer_test_bit(leaf, ptr, i); } -static void free_space_set_bits(struct btrfs_block_group *block_group, +static void free_space_set_bits(struct btrfs_trans_handle *trans, + struct btrfs_block_group *block_group, struct btrfs_path *path, u64 *start, u64 *size, int bit) { @@ -563,7 +564,7 @@ extent_buffer_bitmap_set(leaf, ptr, first, last - first); else extent_buffer_bitmap_clear(leaf, ptr, first, last - first); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); *size -= end - *start; *start = end; @@ -656,7 +657,7 @@ cur_start = start; cur_size = size; while (1) { - free_space_set_bits(block_group, path, &cur_start, &cur_size, + free_space_set_bits(trans, block_group, path, &cur_start, &cur_size, !remove); if (cur_size == 0) break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/inode-item.c +++ linux-aws-6.5-6.5.0/fs/btrfs/inode-item.c @@ -167,7 +167,7 @@ memmove_extent_buffer(leaf, ptr, ptr + del_len, item_size - (ptr + del_len - item_start)); - btrfs_truncate_item(path, item_size - del_len, 1); + btrfs_truncate_item(trans, path, item_size - del_len, 1); out: btrfs_free_path(path); @@ -229,7 +229,7 @@ item_start = btrfs_item_ptr_offset(leaf, path->slots[0]); memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, item_size - (ptr + sub_item_len - item_start)); - btrfs_truncate_item(path, item_size - sub_item_len, 1); + btrfs_truncate_item(trans, path, item_size - sub_item_len, 1); out: btrfs_free_path(path); @@ -282,7 +282,7 @@ name)) goto out; - btrfs_extend_item(path, ins_len); + btrfs_extend_item(trans, path, ins_len); ret = 0; } if (ret < 0) @@ -299,7 +299,7 @@ ptr = (unsigned long)&extref->name; write_extent_buffer(path->nodes[0], name->name, ptr, name->len); - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); out: btrfs_free_path(path); @@ -338,7 +338,7 @@ goto out; old_size = btrfs_item_size(path->nodes[0], path->slots[0]); - btrfs_extend_item(path, ins_len); + btrfs_extend_item(trans, path, ins_len); ref = btrfs_item_ptr(path->nodes[0], path->slots[0], struct btrfs_inode_ref); ref = (struct btrfs_inode_ref *)((unsigned long)ref + old_size); @@ -364,7 +364,7 @@ ptr = (unsigned long)(ref + 1); } write_extent_buffer(path->nodes[0], name->name, ptr, name->len); - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); out: btrfs_free_path(path); @@ -591,7 +591,7 @@ num_dec = (orig_num_bytes - extent_num_bytes); if (extent_start != 0) control->sub_bytes += num_dec; - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); } else { extent_num_bytes = btrfs_file_extent_disk_num_bytes(leaf, fi); @@ -617,7 +617,7 @@ btrfs_set_file_extent_ram_bytes(leaf, fi, size); size = btrfs_file_extent_calc_inline_size(size); - btrfs_truncate_item(path, size, 1); + btrfs_truncate_item(trans, path, size, 1); } else if (!del_item) { /* * We have to bail so the last_size is set to only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/messages.c +++ linux-aws-6.5-6.5.0/fs/btrfs/messages.c @@ -252,12 +252,6 @@ } #endif -void __cold btrfs_print_v0_err(struct btrfs_fs_info *fs_info) -{ - btrfs_err(fs_info, -"Unsupported V0 extent filesystem detected. Aborting. Please re-create your filesystem with a newer kernel"); -} - #if BITS_PER_LONG == 32 void __cold btrfs_warn_32bit_limit(struct btrfs_fs_info *fs_info) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/messages.h +++ linux-aws-6.5-6.5.0/fs/btrfs/messages.h @@ -181,8 +181,6 @@ #define ASSERT(expr) (void)(expr) #endif -void __cold btrfs_print_v0_err(struct btrfs_fs_info *fs_info); - __printf(5, 6) __cold void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/print-tree.c +++ linux-aws-6.5-6.5.0/fs/btrfs/print-tree.c @@ -95,8 +95,10 @@ int ref_index = 0; if (unlikely(item_size < sizeof(*ei))) { - btrfs_print_v0_err(eb->fs_info); - btrfs_handle_fs_error(eb->fs_info, -EINVAL, NULL); + btrfs_err(eb->fs_info, + "unexpected extent item size, has %u expect >= %zu", + item_size, sizeof(*ei)); + btrfs_handle_fs_error(eb->fs_info, -EUCLEAN, NULL); } ei = btrfs_item_ptr(eb, slot, struct btrfs_extent_item); @@ -291,10 +293,6 @@ btrfs_file_extent_num_bytes(l, fi), btrfs_file_extent_ram_bytes(l, fi)); break; - case BTRFS_EXTENT_REF_V0_KEY: - btrfs_print_v0_err(fs_info); - btrfs_handle_fs_error(fs_info, -EINVAL, NULL); - break; case BTRFS_BLOCK_GROUP_ITEM_KEY: bi = btrfs_item_ptr(l, i, struct btrfs_block_group_item); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/qgroup.c +++ linux-aws-6.5-6.5.0/fs/btrfs/qgroup.c @@ -622,7 +622,7 @@ ret = btrfs_insert_empty_item(trans, quota_root, path, &key, 0); - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); btrfs_free_path(path); return ret; @@ -700,7 +700,7 @@ btrfs_set_qgroup_info_excl(leaf, qgroup_info, 0); btrfs_set_qgroup_info_excl_cmpr(leaf, qgroup_info, 0); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); @@ -719,7 +719,7 @@ btrfs_set_qgroup_limit_rsv_rfer(leaf, qgroup_limit, 0); btrfs_set_qgroup_limit_rsv_excl(leaf, qgroup_limit, 0); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); ret = 0; out: @@ -808,7 +808,7 @@ btrfs_set_qgroup_limit_rsv_rfer(l, qgroup_limit, qgroup->rsv_rfer); btrfs_set_qgroup_limit_rsv_excl(l, qgroup_limit, qgroup->rsv_excl); - btrfs_mark_buffer_dirty(l); + btrfs_mark_buffer_dirty(trans, l); out: btrfs_free_path(path); @@ -854,7 +854,7 @@ btrfs_set_qgroup_info_excl(l, qgroup_info, qgroup->excl); btrfs_set_qgroup_info_excl_cmpr(l, qgroup_info, qgroup->excl_cmpr); - btrfs_mark_buffer_dirty(l); + btrfs_mark_buffer_dirty(trans, l); out: btrfs_free_path(path); @@ -896,7 +896,7 @@ btrfs_set_qgroup_status_rescan(l, ptr, fs_info->qgroup_rescan_progress.objectid); - btrfs_mark_buffer_dirty(l); + btrfs_mark_buffer_dirty(trans, l); out: btrfs_free_path(path); @@ -1069,7 +1069,7 @@ BTRFS_QGROUP_STATUS_FLAGS_MASK); btrfs_set_qgroup_status_rescan(leaf, ptr, 0); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); key.objectid = 0; key.type = BTRFS_ROOT_REF_KEY; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/ref-verify.c +++ linux-aws-6.5-6.5.0/fs/btrfs/ref-verify.c @@ -791,6 +791,7 @@ dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } else if (be->num_refs == 0) { btrfs_err(fs_info, @@ -800,6 +801,7 @@ dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/root-tree.c +++ linux-aws-6.5-6.5.0/fs/btrfs/root-tree.c @@ -191,7 +191,7 @@ btrfs_set_root_generation_v2(item, btrfs_root_generation(item)); write_extent_buffer(l, item, ptr, sizeof(*item)); - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); out: btrfs_free_path(path); return ret; @@ -438,7 +438,7 @@ btrfs_set_root_ref_name_len(leaf, ref, name->len); ptr = (unsigned long)(ref + 1); write_extent_buffer(leaf, name->name, ptr, name->len); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); if (key.type == BTRFS_ROOT_BACKREF_KEY) { btrfs_release_path(path); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/send.c +++ linux-aws-6.5-6.5.0/fs/btrfs/send.c @@ -8160,7 +8160,7 @@ } sctx->send_filp = fget(arg->send_fd); - if (!sctx->send_filp) { + if (!sctx->send_filp || !(sctx->send_filp->f_mode & FMODE_WRITE)) { ret = -EBADF; goto out; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/tests/extent-buffer-tests.c +++ linux-aws-6.5-6.5.0/fs/btrfs/tests/extent-buffer-tests.c @@ -61,7 +61,11 @@ key.type = BTRFS_EXTENT_CSUM_KEY; key.offset = 0; - btrfs_setup_item_for_insert(root, path, &key, value_len); + /* + * Passing a NULL trans handle is fine here, we have a dummy root eb + * and the tree is a single node (level 0). + */ + btrfs_setup_item_for_insert(NULL, root, path, &key, value_len); write_extent_buffer(eb, value, btrfs_item_ptr_offset(eb, 0), value_len); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/tests/inode-tests.c +++ linux-aws-6.5-6.5.0/fs/btrfs/tests/inode-tests.c @@ -34,7 +34,11 @@ key.type = BTRFS_EXTENT_DATA_KEY; key.offset = start; - btrfs_setup_item_for_insert(root, &path, &key, value_len); + /* + * Passing a NULL trans handle is fine here, we have a dummy root eb + * and the tree is a single node (level 0). + */ + btrfs_setup_item_for_insert(NULL, root, &path, &key, value_len); fi = btrfs_item_ptr(leaf, slot, struct btrfs_file_extent_item); btrfs_set_file_extent_generation(leaf, fi, 1); btrfs_set_file_extent_type(leaf, fi, type); @@ -64,7 +68,11 @@ key.type = BTRFS_INODE_ITEM_KEY; key.offset = 0; - btrfs_setup_item_for_insert(root, &path, &key, value_len); + /* + * Passing a NULL trans handle is fine here, we have a dummy root eb + * and the tree is a single node (level 0). + */ + btrfs_setup_item_for_insert(NULL, root, &path, &key, value_len); } /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/tree-log.c +++ linux-aws-6.5-6.5.0/fs/btrfs/tree-log.c @@ -504,9 +504,9 @@ found_size = btrfs_item_size(path->nodes[0], path->slots[0]); if (found_size > item_size) - btrfs_truncate_item(path, item_size, 1); + btrfs_truncate_item(trans, path, item_size, 1); else if (found_size < item_size) - btrfs_extend_item(path, item_size - found_size); + btrfs_extend_item(trans, path, item_size - found_size); } else if (ret) { return ret; } @@ -574,7 +574,7 @@ } } no_copy: - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); btrfs_release_path(path); return 0; } @@ -3530,7 +3530,7 @@ last_offset = max(last_offset, curr_end); } btrfs_set_dir_log_end(path->nodes[0], item, last_offset); - btrfs_mark_buffer_dirty(path->nodes[0]); + btrfs_mark_buffer_dirty(trans, path->nodes[0]); btrfs_release_path(path); return 0; } @@ -4488,7 +4488,7 @@ dst_index++; } - btrfs_mark_buffer_dirty(dst_path->nodes[0]); + btrfs_mark_buffer_dirty(trans, dst_path->nodes[0]); btrfs_release_path(dst_path); out: kfree(ins_data); @@ -4693,7 +4693,7 @@ write_extent_buffer(leaf, &fi, btrfs_item_ptr_offset(leaf, path->slots[0]), sizeof(fi)); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); btrfs_release_path(path); @@ -4722,7 +4722,7 @@ struct extent_buffer *leaf; int slot; int ins_nr = 0; - int start_slot; + int start_slot = 0; int ret; if (!(inode->flags & BTRFS_INODE_PREALLOC)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/uuid-tree.c +++ linux-aws-6.5-6.5.0/fs/btrfs/uuid-tree.c @@ -124,7 +124,7 @@ * An item with that type already exists. * Extend the item and store the new subid at the end. */ - btrfs_extend_item(path, sizeof(subid_le)); + btrfs_extend_item(trans, path, sizeof(subid_le)); eb = path->nodes[0]; slot = path->slots[0]; offset = btrfs_item_ptr_offset(eb, slot); @@ -139,7 +139,7 @@ ret = 0; subid_le = cpu_to_le64(subid_cpu); write_extent_buffer(eb, &subid_le, offset, sizeof(subid_le)); - btrfs_mark_buffer_dirty(eb); + btrfs_mark_buffer_dirty(trans, eb); out: btrfs_free_path(path); @@ -221,7 +221,7 @@ move_src = offset + sizeof(subid); move_len = item_size - (move_src - btrfs_item_ptr_offset(eb, slot)); memmove_extent_buffer(eb, move_dst, move_src, move_len); - btrfs_truncate_item(path, item_size - sizeof(subid), 1); + btrfs_truncate_item(trans, path, item_size - sizeof(subid), 1); out: btrfs_free_path(path); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/btrfs/xattr.c +++ linux-aws-6.5-6.5.0/fs/btrfs/xattr.c @@ -188,15 +188,15 @@ if (old_data_len + name_len + sizeof(*di) == item_size) { /* No other xattrs packed in the same leaf item. */ if (size > old_data_len) - btrfs_extend_item(path, size - old_data_len); + btrfs_extend_item(trans, path, size - old_data_len); else if (size < old_data_len) - btrfs_truncate_item(path, data_size, 1); + btrfs_truncate_item(trans, path, data_size, 1); } else { /* There are other xattrs packed in the same item. */ ret = btrfs_delete_one_dir_name(trans, root, path, di); if (ret) goto out; - btrfs_extend_item(path, data_size); + btrfs_extend_item(trans, path, data_size); } ptr = btrfs_item_ptr(leaf, slot, char); @@ -205,7 +205,7 @@ btrfs_set_dir_data_len(leaf, di, size); data_ptr = ((unsigned long)(di + 1)) + name_len; write_extent_buffer(leaf, value, data_ptr, size); - btrfs_mark_buffer_dirty(leaf); + btrfs_mark_buffer_dirty(trans, leaf); } else { /* * Insert, and we had space for the xattr, so path->slots[0] is only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/dlm/midcomms.c +++ linux-aws-6.5-6.5.0/fs/dlm/midcomms.c @@ -1119,15 +1119,15 @@ break; case DLM_VERSION_3_2: + /* send ack back if necessary */ + dlm_send_ack_threshold(node, DLM_SEND_ACK_BACK_MSG_THRESHOLD); + msg = dlm_midcomms_get_msg_3_2(mh, nodeid, len, allocation, ppc); if (!msg) { dlm_free_mhandle(mh); goto err; } - - /* send ack back if necessary */ - dlm_send_ack_threshold(node, DLM_SEND_ACK_BACK_MSG_THRESHOLD); break; default: dlm_free_mhandle(mh); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ecryptfs/inode.c +++ linux-aws-6.5-6.5.0/fs/ecryptfs/inode.c @@ -998,6 +998,14 @@ return rc; } +static int ecryptfs_do_getattr(const struct path *path, struct kstat *stat, + u32 request_mask, unsigned int flags) +{ + if (flags & AT_GETATTR_NOSEC) + return vfs_getattr_nosec(path, stat, request_mask, flags); + return vfs_getattr(path, stat, request_mask, flags); +} + static int ecryptfs_getattr(struct mnt_idmap *idmap, const struct path *path, struct kstat *stat, u32 request_mask, unsigned int flags) @@ -1006,8 +1014,8 @@ struct kstat lower_stat; int rc; - rc = vfs_getattr(ecryptfs_dentry_to_lower_path(dentry), &lower_stat, - request_mask, flags); + rc = ecryptfs_do_getattr(ecryptfs_dentry_to_lower_path(dentry), + &lower_stat, request_mask, flags); if (!rc) { fsstack_copy_attr_all(d_inode(dentry), ecryptfs_inode_to_lower(d_inode(dentry))); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/erofs/utils.c +++ linux-aws-6.5-6.5.0/fs/erofs/utils.c @@ -77,12 +77,7 @@ struct erofs_sb_info *const sbi = EROFS_SB(sb); struct erofs_workgroup *pre; - /* - * Bump up before making this visible to others for the XArray in order - * to avoid potential UAF without serialized by xa_lock. - */ - lockref_get(&grp->lockref); - + DBG_BUGON(grp->lockref.count < 1); repeat: xa_lock(&sbi->managed_pslots); pre = __xa_cmpxchg(&sbi->managed_pslots, grp->index, @@ -96,7 +91,6 @@ cond_resched(); goto repeat; } - lockref_put_return(&grp->lockref); grp = pre; } xa_unlock(&sbi->managed_pslots); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/exfat/namei.c +++ linux-aws-6.5-6.5.0/fs/exfat/namei.c @@ -351,14 +351,20 @@ if (exfat_check_max_dentries(inode)) return -ENOSPC; - /* we trust p_dir->size regardless of FAT type */ - if (exfat_find_last_cluster(sb, p_dir, &last_clu)) - return -EIO; - /* * Allocate new cluster to this directory */ - exfat_chain_set(&clu, last_clu + 1, 0, p_dir->flags); + if (ei->start_clu != EXFAT_EOF_CLUSTER) { + /* we trust p_dir->size regardless of FAT type */ + if (exfat_find_last_cluster(sb, p_dir, &last_clu)) + return -EIO; + + exfat_chain_set(&clu, last_clu + 1, 0, p_dir->flags); + } else { + /* This directory is empty */ + exfat_chain_set(&clu, EXFAT_EOF_CLUSTER, 0, + ALLOC_NO_FAT_CHAIN); + } /* allocate a cluster */ ret = exfat_alloc_cluster(inode, 1, &clu, IS_DIRSYNC(inode)); @@ -368,6 +374,11 @@ if (exfat_zeroed_cluster(inode, clu.dir)) return -EIO; + if (ei->start_clu == EXFAT_EOF_CLUSTER) { + ei->start_clu = clu.dir; + p_dir->dir = clu.dir; + } + /* append to the FAT chain */ if (clu.flags != p_dir->flags) { /* no-fat-chain bit is disabled, @@ -646,7 +657,7 @@ info->type = exfat_get_entry_type(ep); info->attr = le16_to_cpu(ep->dentry.file.attr); info->size = le64_to_cpu(ep2->dentry.stream.valid_size); - if ((info->type == TYPE_FILE) && (info->size == 0)) { + if (info->size == 0) { info->flags = ALLOC_NO_FAT_CHAIN; info->start_clu = EXFAT_EOF_CLUSTER; } else { @@ -890,6 +901,9 @@ dentries_per_clu = sbi->dentries_per_clu; + if (p_dir->dir == EXFAT_EOF_CLUSTER) + return 0; + exfat_chain_dup(&clu, p_dir); while (clu.dir != EXFAT_EOF_CLUSTER) { @@ -1257,7 +1271,8 @@ } /* Free the clusters if new_inode is a dir(as if exfat_rmdir) */ - if (new_entry_type == TYPE_DIR) { + if (new_entry_type == TYPE_DIR && + new_ei->start_clu != EXFAT_EOF_CLUSTER) { /* new_ei, new_clu_to_free */ struct exfat_chain new_clu_to_free; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ext2/file.c +++ linux-aws-6.5-6.5.0/fs/ext2/file.c @@ -258,7 +258,6 @@ goto out_unlock; } - iocb->ki_pos += status; ret += status; endbyte = pos + status - 1; ret2 = filemap_write_and_wait_range(inode->i_mapping, pos, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ext4/acl.h +++ linux-aws-6.5-6.5.0/fs/ext4/acl.h @@ -68,6 +68,11 @@ static inline int ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir) { + /* usually, the umask is applied by posix_acl_create(), but if + ext4 ACL support is disabled at compile time, we need to do + it here, because posix_acl_create() will never be called */ + inode->i_mode &= ~current_umask(); + return 0; } #endif /* CONFIG_EXT4_FS_POSIX_ACL */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ext4/extents.c +++ linux-aws-6.5-6.5.0/fs/ext4/extents.c @@ -1010,6 +1010,11 @@ ix = curp->p_idx; } + if (unlikely(ix > EXT_MAX_INDEX(curp->p_hdr))) { + EXT4_ERROR_INODE(inode, "ix > EXT_MAX_INDEX!"); + return -EFSCORRUPTED; + } + len = EXT_LAST_INDEX(curp->p_hdr) - ix + 1; BUG_ON(len < 0); if (len > 0) { @@ -1019,11 +1024,6 @@ memmove(ix + 1, ix, len * sizeof(struct ext4_extent_idx)); } - if (unlikely(ix > EXT_MAX_INDEX(curp->p_hdr))) { - EXT4_ERROR_INODE(inode, "ix > EXT_MAX_INDEX!"); - return -EFSCORRUPTED; - } - ix->ei_block = cpu_to_le32(logical); ext4_idx_store_pblock(ix, ptr); le16_add_cpu(&curp->p_hdr->eh_entries, 1); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ext4/inode.c +++ linux-aws-6.5-6.5.0/fs/ext4/inode.c @@ -789,10 +789,22 @@ int ext4_get_block_unwritten(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create) { + int ret = 0; + ext4_debug("ext4_get_block_unwritten: inode %lu, create flag %d\n", inode->i_ino, create); - return _ext4_get_block(inode, iblock, bh_result, + ret = _ext4_get_block(inode, iblock, bh_result, EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT); + + /* + * If the buffer is marked unwritten, mark it as new to make sure it is + * zeroed out correctly in case of partial writes. Otherwise, there is + * a chance of stale data getting exposed. + */ + if (ret == 0 && buffer_unwritten(bh_result)) + set_buffer_new(bh_result); + + return ret; } /* Maximum number of blocks we map for direct IO at once. */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ext4/resize.c +++ linux-aws-6.5-6.5.0/fs/ext4/resize.c @@ -560,13 +560,8 @@ if (meta_bg == 0 && !ext4_bg_has_super(sb, group)) goto handle_itb; - if (meta_bg == 1) { - ext4_group_t first_group; - first_group = ext4_meta_bg_first_group(sb, group); - if (first_group != group + 1 && - first_group != group + EXT4_DESC_PER_BLOCK(sb) - 1) - goto handle_itb; - } + if (meta_bg == 1) + goto handle_itb; block = start + ext4_bg_has_super(sb, group); /* Copy all of the GDT blocks into the backup in this group */ @@ -1191,8 +1186,10 @@ ext4_group_first_block_no(sb, group)); BUFFER_TRACE(bh, "get_write_access"); if ((err = ext4_journal_get_write_access(handle, sb, bh, - EXT4_JTR_NONE))) + EXT4_JTR_NONE))) { + brelse(bh); break; + } lock_buffer(bh); memcpy(bh->b_data, data, size); if (rest) @@ -1601,6 +1598,8 @@ int gdb_num_end = ((group + flex_gd->count - 1) / EXT4_DESC_PER_BLOCK(sb)); int meta_bg = ext4_has_feature_meta_bg(sb); + sector_t padding_blocks = meta_bg ? 0 : sbi->s_sbh->b_blocknr - + ext4_group_first_block_no(sb, 0); sector_t old_gdb = 0; update_backups(sb, ext4_group_first_block_no(sb, 0), @@ -1612,8 +1611,8 @@ gdb_num); if (old_gdb == gdb_bh->b_blocknr) continue; - update_backups(sb, gdb_bh->b_blocknr, gdb_bh->b_data, - gdb_bh->b_size, meta_bg); + update_backups(sb, gdb_bh->b_blocknr - padding_blocks, + gdb_bh->b_data, gdb_bh->b_size, meta_bg); old_gdb = gdb_bh->b_blocknr; } } @@ -1980,9 +1979,7 @@ errout: ret = ext4_journal_stop(handle); - if (!err) - err = ret; - return ret; + return err ? err : ret; invalid_resize_inode: ext4_error(sb, "corrupted/inconsistent resize inode"); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ext4/super.c +++ linux-aws-6.5-6.5.0/fs/ext4/super.c @@ -6425,6 +6425,7 @@ struct ext4_mount_options old_opts; ext4_group_t g; int err = 0; + int alloc_ctx; #ifdef CONFIG_QUOTA int enable_quota = 0; int i, j; @@ -6465,7 +6466,16 @@ } + /* + * Changing the DIOREAD_NOLOCK or DELALLOC mount options may cause + * two calls to ext4_should_dioread_nolock() to return inconsistent + * values, triggering WARN_ON in ext4_add_complete_io(). we grab + * here s_writepages_rwsem to avoid race between writepages ops and + * remount. + */ + alloc_ctx = ext4_writepages_down_write(sb); ext4_apply_options(fc, sb); + ext4_writepages_up_write(sb, alloc_ctx); if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^ test_opt(sb, JOURNAL_CHECKSUM)) { @@ -6683,6 +6693,8 @@ if ((sb->s_flags & SB_RDONLY) && !(old_sb_flags & SB_RDONLY) && sb_any_quota_suspended(sb)) dquot_resume(sb, -1); + + alloc_ctx = ext4_writepages_down_write(sb); sb->s_flags = old_sb_flags; sbi->s_mount_opt = old_opts.s_mount_opt; sbi->s_mount_opt2 = old_opts.s_mount_opt2; @@ -6691,6 +6703,8 @@ sbi->s_commit_interval = old_opts.s_commit_interval; sbi->s_min_batch_time = old_opts.s_min_batch_time; sbi->s_max_batch_time = old_opts.s_max_batch_time; + ext4_writepages_up_write(sb, alloc_ctx); + if (!test_opt(sb, BLOCK_VALIDITY) && sbi->s_system_blks) ext4_release_system_zone(sb); #ifdef CONFIG_QUOTA only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/f2fs/compress.c +++ linux-aws-6.5-6.5.0/fs/f2fs/compress.c @@ -1988,7 +1988,7 @@ int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi) { dev_t dev = sbi->sb->s_bdev->bd_dev; - char slab_name[32]; + char slab_name[35]; if (!f2fs_sb_has_compression(sbi)) return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/f2fs/extent_cache.c +++ linux-aws-6.5-6.5.0/fs/f2fs/extent_cache.c @@ -74,40 +74,14 @@ } } -static bool __may_read_extent_tree(struct inode *inode) -{ - struct f2fs_sb_info *sbi = F2FS_I_SB(inode); - - if (!test_opt(sbi, READ_EXTENT_CACHE)) - return false; - if (is_inode_flag_set(inode, FI_NO_EXTENT)) - return false; - if (is_inode_flag_set(inode, FI_COMPRESSED_FILE) && - !f2fs_sb_has_readonly(sbi)) - return false; - return S_ISREG(inode->i_mode); -} - -static bool __may_age_extent_tree(struct inode *inode) -{ - struct f2fs_sb_info *sbi = F2FS_I_SB(inode); - - if (!test_opt(sbi, AGE_EXTENT_CACHE)) - return false; - if (is_inode_flag_set(inode, FI_COMPRESSED_FILE)) - return false; - if (file_is_cold(inode)) - return false; - - return S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode); -} - static bool __init_may_extent_tree(struct inode *inode, enum extent_type type) { if (type == EX_READ) - return __may_read_extent_tree(inode); - else if (type == EX_BLOCK_AGE) - return __may_age_extent_tree(inode); + return test_opt(F2FS_I_SB(inode), READ_EXTENT_CACHE) && + S_ISREG(inode->i_mode); + if (type == EX_BLOCK_AGE) + return test_opt(F2FS_I_SB(inode), AGE_EXTENT_CACHE) && + (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)); return false; } @@ -120,7 +94,22 @@ if (list_empty(&F2FS_I_SB(inode)->s_list)) return false; - return __init_may_extent_tree(inode, type); + if (!__init_may_extent_tree(inode, type)) + return false; + + if (type == EX_READ) { + if (is_inode_flag_set(inode, FI_NO_EXTENT)) + return false; + if (is_inode_flag_set(inode, FI_COMPRESSED_FILE) && + !f2fs_sb_has_readonly(F2FS_I_SB(inode))) + return false; + } else if (type == EX_BLOCK_AGE) { + if (is_inode_flag_set(inode, FI_COMPRESSED_FILE)) + return false; + if (file_is_cold(inode)) + return false; + } + return true; } static void __try_update_largest_extent(struct extent_tree *et, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/f2fs/node.c +++ linux-aws-6.5-6.5.0/fs/f2fs/node.c @@ -1467,7 +1467,8 @@ ofs_of_node(page), cpver_of_node(page), next_blkaddr_of_node(page)); set_sbi_flag(sbi, SBI_NEED_FSCK); - err = -EINVAL; + f2fs_handle_error(sbi, ERROR_INCONSISTENT_FOOTER); + err = -EFSCORRUPTED; out_err: ClearPageUptodate(page); out_put_err: @@ -2389,7 +2390,7 @@ blk_addr = le32_to_cpu(nat_blk->entries[i].block_addr); if (blk_addr == NEW_ADDR) - return -EINVAL; + return -EFSCORRUPTED; if (blk_addr == NULL_ADDR) { add_free_nid(sbi, start_nid, true, true); @@ -2504,7 +2505,14 @@ if (ret) { f2fs_up_read(&nm_i->nat_tree_lock); - f2fs_err(sbi, "NAT is corrupt, run fsck to fix it"); + + if (ret == -EFSCORRUPTED) { + f2fs_err(sbi, "NAT is corrupt, run fsck to fix it"); + set_sbi_flag(sbi, SBI_NEED_FSCK); + f2fs_handle_error(sbi, + ERROR_INCONSISTENT_NAT); + } + return ret; } } @@ -2743,7 +2751,9 @@ f2fs_update_inode_page(inode); /* 3: update and set xattr node page dirty */ - memcpy(F2FS_NODE(xpage), F2FS_NODE(page), VALID_XATTR_BLOCK_SIZE); + if (page) + memcpy(F2FS_NODE(xpage), F2FS_NODE(page), + VALID_XATTR_BLOCK_SIZE); set_page_dirty(xpage); f2fs_put_page(xpage, 1); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/f2fs/xattr.c +++ linux-aws-6.5-6.5.0/fs/f2fs/xattr.c @@ -364,10 +364,10 @@ *xe = __find_xattr(cur_addr, last_txattr_addr, NULL, index, len, name); if (!*xe) { - f2fs_err(F2FS_I_SB(inode), "inode (%lu) has corrupted xattr", + f2fs_err(F2FS_I_SB(inode), "lookup inode (%lu) has corrupted xattr", inode->i_ino); set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_FSCK); - err = -EFSCORRUPTED; + err = -ENODATA; f2fs_handle_error(F2FS_I_SB(inode), ERROR_CORRUPTED_XATTR); goto out; @@ -584,13 +584,12 @@ if ((void *)(entry) + sizeof(__u32) > last_base_addr || (void *)XATTR_NEXT_ENTRY(entry) > last_base_addr) { - f2fs_err(F2FS_I_SB(inode), "inode (%lu) has corrupted xattr", + f2fs_err(F2FS_I_SB(inode), "list inode (%lu) has corrupted xattr", inode->i_ino); set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_FSCK); - error = -EFSCORRUPTED; f2fs_handle_error(F2FS_I_SB(inode), ERROR_CORRUPTED_XATTR); - goto cleanup; + break; } if (!prefix) @@ -650,7 +649,7 @@ if (size > MAX_VALUE_LEN(inode)) return -E2BIG; - +retry: error = read_all_xattrs(inode, ipage, &base_addr); if (error) return error; @@ -660,7 +659,14 @@ /* find entry with wanted name. */ here = __find_xattr(base_addr, last_base_addr, NULL, index, len, name); if (!here) { - f2fs_err(F2FS_I_SB(inode), "inode (%lu) has corrupted xattr", + if (!F2FS_I(inode)->i_xattr_nid) { + f2fs_notice(F2FS_I_SB(inode), + "recover xattr in inode (%lu)", inode->i_ino); + f2fs_recover_xattr_data(inode, NULL); + kfree(base_addr); + goto retry; + } + f2fs_err(F2FS_I_SB(inode), "set inode (%lu) has corrupted xattr", inode->i_ino); set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_FSCK); error = -EFSCORRUPTED; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/fs-writeback.c +++ linux-aws-6.5-6.5.0/fs/fs-writeback.c @@ -613,6 +613,24 @@ kfree(isw); } +static bool isw_prepare_wbs_switch(struct inode_switch_wbs_context *isw, + struct list_head *list, int *nr) +{ + struct inode *inode; + + list_for_each_entry(inode, list, i_io_list) { + if (!inode_prepare_wbs_switch(inode, isw->new_wb)) + continue; + + isw->inodes[*nr] = inode; + (*nr)++; + + if (*nr >= WB_MAX_INODES_PER_ISW - 1) + return true; + } + return false; +} + /** * cleanup_offline_cgwb - detach associated inodes * @wb: target wb @@ -625,7 +643,6 @@ { struct cgroup_subsys_state *memcg_css; struct inode_switch_wbs_context *isw; - struct inode *inode; int nr; bool restart = false; @@ -647,17 +664,17 @@ nr = 0; spin_lock(&wb->list_lock); - list_for_each_entry(inode, &wb->b_attached, i_io_list) { - if (!inode_prepare_wbs_switch(inode, isw->new_wb)) - continue; - - isw->inodes[nr++] = inode; - - if (nr >= WB_MAX_INODES_PER_ISW - 1) { - restart = true; - break; - } - } + /* + * In addition to the inodes that have completed writeback, also switch + * cgwbs for those inodes only with dirty timestamps. Otherwise, those + * inodes won't be written back for a long time when lazytime is + * enabled, and thus pinning the dying cgwbs. It won't break the + * bandwidth restrictions, as writeback of inode metadata is not + * accounted for. + */ + restart = isw_prepare_wbs_switch(isw, &wb->b_attached, &nr); + if (!restart) + restart = isw_prepare_wbs_switch(isw, &wb->b_dirty_time, &nr); spin_unlock(&wb->list_lock); /* no attached inodes? bail out */ @@ -1535,10 +1552,15 @@ if (wbc->pages_skipped) { /* - * writeback is not making progress due to locked - * buffers. Skip this inode for now. + * Writeback is not making progress due to locked buffers. + * Skip this inode for now. Although having skipped pages + * is odd for clean inodes, it can happen for some + * filesystems so handle that gracefully. */ - redirty_tail_locked(inode, wb); + if (inode->i_state & I_DIRTY_ALL) + redirty_tail_locked(inode, wb); + else + inode_cgwb_move_to_attached(inode, wb); return; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/gfs2/inode.c +++ linux-aws-6.5-6.5.0/fs/gfs2/inode.c @@ -1860,16 +1860,24 @@ int gfs2_permission(struct mnt_idmap *idmap, struct inode *inode, int mask) { + int may_not_block = mask & MAY_NOT_BLOCK; struct gfs2_inode *ip; struct gfs2_holder i_gh; + struct gfs2_glock *gl; int error; gfs2_holder_mark_uninitialized(&i_gh); ip = GFS2_I(inode); - if (gfs2_glock_is_locked_by_me(ip->i_gl) == NULL) { - if (mask & MAY_NOT_BLOCK) + gl = rcu_dereference_check(ip->i_gl, !may_not_block); + if (unlikely(!gl)) { + /* inode is getting torn down, must be RCU mode */ + WARN_ON_ONCE(!may_not_block); + return -ECHILD; + } + if (gfs2_glock_is_locked_by_me(gl) == NULL) { + if (may_not_block) return -ECHILD; - error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); + error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); if (error) return error; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/gfs2/ops_fstype.c +++ linux-aws-6.5-6.5.0/fs/gfs2/ops_fstype.c @@ -1261,10 +1261,8 @@ if (!sb_rdonly(sb)) { error = init_threads(sdp); - if (error) { - gfs2_withdraw_delayed(sdp); + if (error) goto fail_per_node; - } } error = gfs2_freeze_lock_shared(sdp); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/gfs2/quota.c +++ linux-aws-6.5-6.5.0/fs/gfs2/quota.c @@ -441,6 +441,17 @@ (sync_gen && (qd->qd_sync_gen >= *sync_gen))) return 0; + /* + * If qd_change is 0 it means a pending quota change was negated. + * We should not sync it, but we still have a qd reference and slot + * reference taken by gfs2_quota_change -> do_qc that need to be put. + */ + if (!qd->qd_change && test_and_clear_bit(QDF_CHANGE, &qd->qd_flags)) { + slot_put(qd); + qd_put(qd); + return 0; + } + if (!lockref_get_not_dead(&qd->qd_lockref)) return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/gfs2/super.c +++ linux-aws-6.5-6.5.0/fs/gfs2/super.c @@ -1558,7 +1558,7 @@ wait_on_bit_io(&ip->i_flags, GIF_GLOP_PENDING, TASK_UNINTERRUPTIBLE); gfs2_glock_add_to_lru(ip->i_gl); gfs2_glock_put_eventually(ip->i_gl); - ip->i_gl = NULL; + rcu_assign_pointer(ip->i_gl, NULL); } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/inode.c +++ linux-aws-6.5-6.5.0/fs/inode.c @@ -215,6 +215,8 @@ lockdep_set_class_and_name(&mapping->invalidate_lock, &sb->s_type->invalidate_lock_key, "mapping.invalidate_lock"); + if (sb->s_iflags & SB_I_STABLE_WRITES) + mapping_set_stable_writes(mapping); inode->i_private = NULL; inode->i_mapping = mapping; INIT_HLIST_HEAD(&inode->i_dentry); /* buggered by rcu freeing */ @@ -2499,6 +2501,22 @@ EXPORT_SYMBOL(current_time); /** + * inode_set_ctime_current - set the ctime to current_time + * @inode: inode + * + * Set the inode->i_ctime to the current value for the inode. Returns + * the current value that was assigned to i_ctime. + */ +struct timespec64 inode_set_ctime_current(struct inode *inode) +{ + struct timespec64 now = current_time(inode); + + inode_set_ctime(inode, now.tv_sec, now.tv_nsec); + return now; +} +EXPORT_SYMBOL(inode_set_ctime_current); + +/** * in_group_or_capable - check whether caller is CAP_FSETID privileged * @idmap: idmap of the mount @inode was found from * @inode: inode to check only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/nfs/pnfs.c +++ linux-aws-6.5-6.5.0/fs/nfs/pnfs.c @@ -2634,31 +2634,44 @@ return mode == 0; } -static int -pnfs_layout_return_unused_byserver(struct nfs_server *server, void *data) +static int pnfs_layout_return_unused_byserver(struct nfs_server *server, + void *data) { const struct pnfs_layout_range *range = data; + const struct cred *cred; struct pnfs_layout_hdr *lo; struct inode *inode; + nfs4_stateid stateid; + enum pnfs_iomode iomode; + restart: rcu_read_lock(); list_for_each_entry_rcu(lo, &server->layouts, plh_layouts) { - if (!pnfs_layout_can_be_returned(lo) || + inode = lo->plh_inode; + if (!inode || !pnfs_layout_can_be_returned(lo) || test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags)) continue; - inode = lo->plh_inode; spin_lock(&inode->i_lock); - if (!pnfs_should_return_unused_layout(lo, range)) { + if (!lo->plh_inode || + !pnfs_should_return_unused_layout(lo, range)) { spin_unlock(&inode->i_lock); continue; } + pnfs_get_layout_hdr(lo); + pnfs_set_plh_return_info(lo, range->iomode, 0); + if (pnfs_mark_matching_lsegs_return(lo, &lo->plh_return_segs, + range, 0) != 0 || + !pnfs_prepare_layoutreturn(lo, &stateid, &cred, &iomode)) { + spin_unlock(&inode->i_lock); + rcu_read_unlock(); + pnfs_put_layout_hdr(lo); + cond_resched(); + goto restart; + } spin_unlock(&inode->i_lock); - inode = pnfs_grab_inode_layout_hdr(lo); - if (!inode) - continue; rcu_read_unlock(); - pnfs_mark_layout_for_return(inode, range); - iput(inode); + pnfs_send_layoutreturn(lo, &stateid, &cred, iomode, false); + pnfs_put_layout_hdr(lo); cond_resched(); goto restart; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/nfsd/cache.h +++ linux-aws-6.5-6.5.0/fs/nfsd/cache.h @@ -84,7 +84,8 @@ void nfsd_net_reply_cache_destroy(struct nfsd_net *nn); int nfsd_reply_cache_init(struct nfsd_net *); void nfsd_reply_cache_shutdown(struct nfsd_net *); -int nfsd_cache_lookup(struct svc_rqst *); +int nfsd_cache_lookup(struct svc_rqst *rqstp, unsigned int start, + unsigned int len); void nfsd_cache_update(struct svc_rqst *, int, __be32 *); int nfsd_reply_cache_stats_show(struct seq_file *m, void *v); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/nfsd/filecache.c +++ linux-aws-6.5-6.5.0/fs/nfsd/filecache.c @@ -989,22 +989,21 @@ unsigned char need = may_flags & NFSD_FILE_MAY_MASK; struct net *net = SVC_NET(rqstp); struct nfsd_file *new, *nf; - const struct cred *cred; + bool stale_retry = true; bool open_retry = true; struct inode *inode; __be32 status; int ret; +retry: status = fh_verify(rqstp, fhp, S_IFREG, may_flags|NFSD_MAY_OWNER_OVERRIDE); if (status != nfs_ok) return status; inode = d_inode(fhp->fh_dentry); - cred = get_current_cred(); -retry: rcu_read_lock(); - nf = nfsd_file_lookup_locked(net, cred, inode, need, want_gc); + nf = nfsd_file_lookup_locked(net, current_cred(), inode, need, want_gc); rcu_read_unlock(); if (nf) { @@ -1026,7 +1025,7 @@ rcu_read_lock(); spin_lock(&inode->i_lock); - nf = nfsd_file_lookup_locked(net, cred, inode, need, want_gc); + nf = nfsd_file_lookup_locked(net, current_cred(), inode, need, want_gc); if (unlikely(nf)) { spin_unlock(&inode->i_lock); rcu_read_unlock(); @@ -1058,6 +1057,7 @@ goto construction_err; } open_retry = false; + fh_put(fhp); goto retry; } this_cpu_inc(nfsd_file_cache_hits); @@ -1074,7 +1074,6 @@ nfsd_file_check_write_error(nf); *pnf = nf; } - put_cred(cred); trace_nfsd_file_acquire(rqstp, inode, may_flags, nf, status); return status; @@ -1088,8 +1087,20 @@ status = nfs_ok; trace_nfsd_file_opened(nf, status); } else { - status = nfsd_open_verified(rqstp, fhp, may_flags, - &nf->nf_file); + ret = nfsd_open_verified(rqstp, fhp, may_flags, + &nf->nf_file); + if (ret == -EOPENSTALE && stale_retry) { + stale_retry = false; + nfsd_file_unhash(nf); + clear_and_wake_up_bit(NFSD_FILE_PENDING, + &nf->nf_flags); + if (refcount_dec_and_test(&nf->nf_ref)) + nfsd_file_free(nf); + nf = NULL; + fh_put(fhp); + goto retry; + } + status = nfserrno(ret); trace_nfsd_file_open(nf, status); } } else only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/nfsd/nfs4state.c +++ linux-aws-6.5-6.5.0/fs/nfsd/nfs4state.c @@ -2785,7 +2785,7 @@ /* XXX: alternatively, we could get/drop in seq start/stop */ drop_client(clp); - return 0; + return seq_release(inode, file); } static const struct file_operations client_states_fops = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/nfsd/nfscache.c +++ linux-aws-6.5-6.5.0/fs/nfsd/nfscache.c @@ -314,33 +314,53 @@ return prune_cache_entries(nn); } -/* - * Walk an xdr_buf and get a CRC for at most the first RC_CSUMLEN bytes + +/** + * nfsd_cache_csum - Checksum incoming NFS Call arguments + * @buf: buffer containing a whole RPC Call message + * @start: starting byte of the NFS Call header + * @remaining: size of the NFS Call header, in bytes + * + * Compute a weak checksum of the leading bytes of an NFS procedure + * call header to help verify that a retransmitted Call matches an + * entry in the duplicate reply cache. + * + * To avoid assumptions about how the RPC message is laid out in + * @buf and what else it might contain (eg, a GSS MIC suffix), the + * caller passes us the exact location and length of the NFS Call + * header. + * + * Returns a 32-bit checksum value, as defined in RFC 793. */ -static __wsum -nfsd_cache_csum(struct svc_rqst *rqstp) +static __wsum nfsd_cache_csum(struct xdr_buf *buf, unsigned int start, + unsigned int remaining) { + unsigned int base, len; + struct xdr_buf subbuf; + __wsum csum = 0; + void *p; int idx; - unsigned int base; - __wsum csum; - struct xdr_buf *buf = &rqstp->rq_arg; - const unsigned char *p = buf->head[0].iov_base; - size_t csum_len = min_t(size_t, buf->head[0].iov_len + buf->page_len, - RC_CSUMLEN); - size_t len = min(buf->head[0].iov_len, csum_len); + + if (remaining > RC_CSUMLEN) + remaining = RC_CSUMLEN; + if (xdr_buf_subsegment(buf, &subbuf, start, remaining)) + return csum; /* rq_arg.head first */ - csum = csum_partial(p, len, 0); - csum_len -= len; + if (subbuf.head[0].iov_len) { + len = min_t(unsigned int, subbuf.head[0].iov_len, remaining); + csum = csum_partial(subbuf.head[0].iov_base, len, csum); + remaining -= len; + } /* Continue into page array */ - idx = buf->page_base / PAGE_SIZE; - base = buf->page_base & ~PAGE_MASK; - while (csum_len) { - p = page_address(buf->pages[idx]) + base; - len = min_t(size_t, PAGE_SIZE - base, csum_len); + idx = subbuf.page_base / PAGE_SIZE; + base = subbuf.page_base & ~PAGE_MASK; + while (remaining) { + p = page_address(subbuf.pages[idx]) + base; + len = min_t(unsigned int, PAGE_SIZE - base, remaining); csum = csum_partial(p, len, csum); - csum_len -= len; + remaining -= len; base = 0; ++idx; } @@ -411,6 +431,8 @@ /** * nfsd_cache_lookup - Find an entry in the duplicate reply cache * @rqstp: Incoming Call to find + * @start: starting byte in @rqstp->rq_arg of the NFS Call header + * @len: size of the NFS Call header, in bytes * * Try to find an entry matching the current call in the cache. When none * is found, we try to grab the oldest expired entry off the LRU list. If @@ -423,7 +445,8 @@ * %RC_REPLY: Reply from cache * %RC_DROPIT: Do not process the request further */ -int nfsd_cache_lookup(struct svc_rqst *rqstp) +int nfsd_cache_lookup(struct svc_rqst *rqstp, unsigned int start, + unsigned int len) { struct nfsd_net *nn; struct svc_cacherep *rp, *found; @@ -438,7 +461,7 @@ goto out; } - csum = nfsd_cache_csum(rqstp); + csum = nfsd_cache_csum(&rqstp->rq_arg, start, len); /* * Since the common case is a cache miss followed by an insert, @@ -582,24 +605,17 @@ return; } -/* - * Copy cached reply to current reply buffer. Should always fit. - * FIXME as reply is in a page, we should just attach the page, and - * keep a refcount.... - */ static int nfsd_cache_append(struct svc_rqst *rqstp, struct kvec *data) { - struct kvec *vec = &rqstp->rq_res.head[0]; + __be32 *p; - if (vec->iov_len + data->iov_len > PAGE_SIZE) { - printk(KERN_WARNING "nfsd: cached reply too large (%zd).\n", - data->iov_len); - return 0; - } - memcpy((char*)vec->iov_base + vec->iov_len, data->iov_base, data->iov_len); - vec->iov_len += data->iov_len; - return 1; + p = xdr_reserve_space(&rqstp->rq_res_stream, data->iov_len); + if (unlikely(!p)) + return false; + memcpy(p, data->iov_base, data->iov_len); + xdr_commit_encode(&rqstp->rq_res_stream); + return true; } /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/nfsd/nfssvc.c +++ linux-aws-6.5-6.5.0/fs/nfsd/nfssvc.c @@ -1046,6 +1046,8 @@ { const struct svc_procedure *proc = rqstp->rq_procinfo; __be32 *statp = rqstp->rq_accept_statp; + unsigned int start, len; + __be32 *nfs_reply; /* * Give the xdr decoder a chance to change this if it wants @@ -1053,10 +1055,17 @@ */ rqstp->rq_cachetype = proc->pc_cachetype; + /* + * ->pc_decode advances the argument stream past the NFS + * Call header, so grab the header's starting location and + * size now for the call to nfsd_cache_lookup(). + */ + start = xdr_stream_pos(&rqstp->rq_arg_stream); + len = xdr_stream_remaining(&rqstp->rq_arg_stream); if (!proc->pc_decode(rqstp, &rqstp->rq_arg_stream)) goto out_decode_err; - switch (nfsd_cache_lookup(rqstp)) { + switch (nfsd_cache_lookup(rqstp, start, len)) { case RC_DOIT: break; case RC_REPLY: @@ -1065,6 +1074,7 @@ goto out_dropit; } + nfs_reply = xdr_inline_decode(&rqstp->rq_res_stream, 0); *statp = proc->pc_func(rqstp); if (test_bit(RQ_DROPME, &rqstp->rq_flags)) goto out_update_drop; @@ -1072,7 +1082,7 @@ if (!proc->pc_encode(rqstp, &rqstp->rq_res_stream)) goto out_encode_err; - nfsd_cache_update(rqstp, rqstp->rq_cachetype, statp + 1); + nfsd_cache_update(rqstp, rqstp->rq_cachetype, nfs_reply); out_cached_reply: return 1; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/nfsd/vfs.c +++ linux-aws-6.5-6.5.0/fs/nfsd/vfs.c @@ -823,7 +823,7 @@ * and additional flags. * N.B. After this call fhp needs an fh_put */ -static __be32 +static int __nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, int may_flags, struct file **filp) { @@ -831,14 +831,12 @@ struct inode *inode; struct file *file; int flags = O_RDONLY|O_LARGEFILE; - __be32 err; - int host_err = 0; + int host_err = -EPERM; path.mnt = fhp->fh_export->ex_path.mnt; path.dentry = fhp->fh_dentry; inode = d_inode(path.dentry); - err = nfserr_perm; if (IS_APPEND(inode) && (may_flags & NFSD_MAY_WRITE)) goto out; @@ -847,7 +845,7 @@ host_err = nfsd_open_break_lease(inode, may_flags); if (host_err) /* NOMEM or WOULDBLOCK */ - goto out_nfserr; + goto out; if (may_flags & NFSD_MAY_WRITE) { if (may_flags & NFSD_MAY_READ) @@ -859,13 +857,13 @@ file = dentry_open(&path, flags, current_cred()); if (IS_ERR(file)) { host_err = PTR_ERR(file); - goto out_nfserr; + goto out; } host_err = ima_file_check(file, may_flags); if (host_err) { fput(file); - goto out_nfserr; + goto out; } if (may_flags & NFSD_MAY_64BIT_COOKIE) @@ -874,10 +872,8 @@ file->f_mode |= FMODE_32BITHASH; *filp = file; -out_nfserr: - err = nfserrno(host_err); out: - return err; + return host_err; } __be32 @@ -885,6 +881,7 @@ int may_flags, struct file **filp) { __be32 err; + int host_err; bool retried = false; validate_process_creds(); @@ -904,12 +901,13 @@ retry: err = fh_verify(rqstp, fhp, type, may_flags); if (!err) { - err = __nfsd_open(rqstp, fhp, type, may_flags, filp); - if (err == nfserr_stale && !retried) { + host_err = __nfsd_open(rqstp, fhp, type, may_flags, filp); + if (host_err == -EOPENSTALE && !retried) { retried = true; fh_put(fhp); goto retry; } + err = nfserrno(host_err); } validate_process_creds(); return err; @@ -922,13 +920,13 @@ * @may_flags: internal permission flags * @filp: OUT: open "struct file *" * - * Returns an nfsstat value in network byte order. + * Returns zero on success, or a negative errno value. */ -__be32 +int nfsd_open_verified(struct svc_rqst *rqstp, struct svc_fh *fhp, int may_flags, struct file **filp) { - __be32 err; + int err; validate_process_creds(); err = __nfsd_open(rqstp, fhp, S_IFREG, may_flags, filp); @@ -1781,6 +1779,12 @@ if (!flen || isdotent(fname, flen) || !tlen || isdotent(tname, tlen)) goto out; + err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev; + if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt) + goto out; + if (ffhp->fh_export->ex_path.dentry != tfhp->fh_export->ex_path.dentry) + goto out; + retry: host_err = fh_want_write(ffhp); if (host_err) { @@ -1812,12 +1816,6 @@ if (ndentry == trap) goto out_dput_new; - host_err = -EXDEV; - if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt) - goto out_dput_new; - if (ffhp->fh_export->ex_path.dentry != tfhp->fh_export->ex_path.dentry) - goto out_dput_new; - if ((ndentry->d_sb->s_export_op->flags & EXPORT_OP_CLOSE_BEFORE_UNLINK) && nfsd_has_cached_files(ndentry)) { close_cached = true; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/nfsd/vfs.h +++ linux-aws-6.5-6.5.0/fs/nfsd/vfs.h @@ -104,8 +104,8 @@ int nfsd_open_break_lease(struct inode *, int); __be32 nfsd_open(struct svc_rqst *, struct svc_fh *, umode_t, int, struct file **); -__be32 nfsd_open_verified(struct svc_rqst *, struct svc_fh *, - int, struct file **); +int nfsd_open_verified(struct svc_rqst *rqstp, struct svc_fh *fhp, + int may_flags, struct file **filp); __be32 nfsd_splice_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, loff_t offset, unsigned long *count, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/nilfs2/sufile.c +++ linux-aws-6.5-6.5.0/fs/nilfs2/sufile.c @@ -501,15 +501,38 @@ down_write(&NILFS_MDT(sufile)->mi_sem); ret = nilfs_sufile_get_segment_usage_block(sufile, segnum, 0, &bh); - if (!ret) { - mark_buffer_dirty(bh); - nilfs_mdt_mark_dirty(sufile); - kaddr = kmap_atomic(bh->b_page); - su = nilfs_sufile_block_get_segment_usage(sufile, segnum, bh, kaddr); + if (ret) + goto out_sem; + + kaddr = kmap_atomic(bh->b_page); + su = nilfs_sufile_block_get_segment_usage(sufile, segnum, bh, kaddr); + if (unlikely(nilfs_segment_usage_error(su))) { + struct the_nilfs *nilfs = sufile->i_sb->s_fs_info; + + kunmap_atomic(kaddr); + brelse(bh); + if (nilfs_segment_is_active(nilfs, segnum)) { + nilfs_error(sufile->i_sb, + "active segment %llu is erroneous", + (unsigned long long)segnum); + } else { + /* + * Segments marked erroneous are never allocated by + * nilfs_sufile_alloc(); only active segments, ie, + * the segments indexed by ns_segnum or ns_nextnum, + * can be erroneous here. + */ + WARN_ON_ONCE(1); + } + ret = -EIO; + } else { nilfs_segment_usage_set_dirty(su); kunmap_atomic(kaddr); + mark_buffer_dirty(bh); + nilfs_mdt_mark_dirty(sufile); brelse(bh); } +out_sem: up_write(&NILFS_MDT(sufile)->mi_sem); return ret; } @@ -536,9 +559,14 @@ kaddr = kmap_atomic(bh->b_page); su = nilfs_sufile_block_get_segment_usage(sufile, segnum, bh, kaddr); - WARN_ON(nilfs_segment_usage_error(su)); - if (modtime) + if (modtime) { + /* + * Check segusage error and set su_lastmod only when updating + * this entry with a valid timestamp, not for cancellation. + */ + WARN_ON_ONCE(nilfs_segment_usage_error(su)); su->su_lastmod = cpu_to_le64(modtime); + } su->su_nblocks = cpu_to_le32(nblocks); kunmap_atomic(kaddr); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/nilfs2/the_nilfs.c +++ linux-aws-6.5-6.5.0/fs/nilfs2/the_nilfs.c @@ -716,7 +716,11 @@ goto failed_sbh; } nilfs_release_super_block(nilfs); - sb_set_blocksize(sb, blocksize); + if (!sb_set_blocksize(sb, blocksize)) { + nilfs_err(sb, "bad blocksize %d", blocksize); + err = -EINVAL; + goto out; + } err = nilfs_load_super_block(nilfs, sb, blocksize, &sbp); if (err) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/notify/fanotify/fanotify_user.c +++ linux-aws-6.5-6.5.0/fs/notify/fanotify/fanotify_user.c @@ -1585,16 +1585,25 @@ } /* Check if filesystem can encode a unique fid */ -static int fanotify_test_fid(struct dentry *dentry) +static int fanotify_test_fid(struct dentry *dentry, unsigned int flags) { + unsigned int mark_type = flags & FANOTIFY_MARK_TYPE_BITS; + const struct export_operations *nop = dentry->d_sb->s_export_op; + + /* + * We need to make sure that the filesystem supports encoding of + * file handles so user can use name_to_handle_at() to compare fids + * reported with events to the file handle of watched objects. + */ + if (!nop) + return -EOPNOTSUPP; + /* - * We need to make sure that the file system supports at least - * encoding a file handle so user can use name_to_handle_at() to - * compare fid returned with event to the file handle of watched - * objects. However, even the relaxed AT_HANDLE_FID flag requires - * at least empty export_operations for ecoding unique file ids. + * For sb/mount mark, we also need to make sure that the filesystem + * supports decoding file handles, so user has a way to map back the + * reported fids to filesystem objects. */ - if (!dentry->d_sb->s_export_op) + if (mark_type != FAN_MARK_INODE && !nop->fh_to_dentry) return -EOPNOTSUPP; return 0; @@ -1812,7 +1821,7 @@ if (ret) goto path_put_and_out; - ret = fanotify_test_fid(path.dentry); + ret = fanotify_test_fid(path.dentry, flags); if (ret) goto path_put_and_out; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/attrib.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/attrib.c @@ -1736,10 +1736,8 @@ le_b = NULL; attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA, NULL, 0, NULL, &mi_b); - if (!attr_b) { - err = -ENOENT; - goto out; - } + if (!attr_b) + return -ENOENT; attr = attr_b; le = le_b; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/attrlist.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/attrlist.c @@ -52,7 +52,8 @@ if (!attr->non_res) { lsize = le32_to_cpu(attr->res.data_size); - le = kmalloc(al_aligned(lsize), GFP_NOFS | __GFP_NOWARN); + /* attr is resident: lsize < record_size (1K or 4K) */ + le = kvmalloc(al_aligned(lsize), GFP_KERNEL); if (!le) { err = -ENOMEM; goto out; @@ -80,7 +81,17 @@ if (err < 0) goto out; - le = kmalloc(al_aligned(lsize), GFP_NOFS | __GFP_NOWARN); + /* attr is nonresident. + * The worst case: + * 1T (2^40) extremely fragmented file. + * cluster = 4K (2^12) => 2^28 fragments + * 2^9 fragments per one record => 2^19 records + * 2^5 bytes of ATTR_LIST_ENTRY per one record => 2^24 bytes. + * + * the result is 16M bytes per attribute list. + * Use kvmalloc to allocate in range [several Kbytes - dozen Mbytes] + */ + le = kvmalloc(al_aligned(lsize), GFP_KERNEL); if (!le) { err = -ENOMEM; goto out; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/bitmap.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/bitmap.c @@ -659,7 +659,8 @@ wnd->bits_last = wbits; wnd->free_bits = - kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN); + kvmalloc_array(wnd->nwnd, sizeof(u16), GFP_KERNEL | __GFP_ZERO); + if (!wnd->free_bits) return -ENOMEM; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/dir.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/dir.c @@ -309,7 +309,11 @@ return 0; } - dt_type = (fname->dup.fa & FILE_ATTRIBUTE_DIRECTORY) ? DT_DIR : DT_REG; + /* NTFS: symlinks are "dir + reparse" or "file + reparse" */ + if (fname->dup.fa & FILE_ATTRIBUTE_REPARSE_POINT) + dt_type = DT_LNK; + else + dt_type = (fname->dup.fa & FILE_ATTRIBUTE_DIRECTORY) ? DT_DIR : DT_REG; return !dir_emit(ctx, (s8 *)name, name_len, ino, dt_type); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/frecord.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/frecord.c @@ -2148,7 +2148,7 @@ for (i = 0; i < pages_per_frame; i++) { pg = pages[i]; - if (i == idx) + if (i == idx || !pg) continue; unlock_page(pg); put_page(pg); @@ -3208,6 +3208,12 @@ if (!fname || !memcmp(&fname->dup, dup, sizeof(fname->dup))) continue; + /* Check simple case when parent inode equals current inode. */ + if (ino_get(&fname->home) == ni->vfs_inode.i_ino) { + ntfs_set_state(sbi, NTFS_DIRTY_ERROR); + continue; + } + /* ntfs_iget5 may sleep. */ dir = ntfs_iget5(sb, &fname->home, NULL); if (IS_ERR(dir)) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/fslog.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/fslog.c @@ -2168,8 +2168,10 @@ if (!page) { page = kmalloc(log->page_size, GFP_NOFS); - if (!page) - return -ENOMEM; + if (!page) { + err = -ENOMEM; + goto out; + } } /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/fsntfs.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/fsntfs.c @@ -983,18 +983,11 @@ if (err) return err; - mark_inode_dirty(&ni->vfs_inode); + mark_inode_dirty_sync(&ni->vfs_inode); /* verify(!ntfs_update_mftmirr()); */ - /* - * If we used wait=1, sync_inode_metadata waits for the io for the - * inode to finish. It hangs when media is removed. - * So wait=0 is sent down to sync_inode_metadata - * and filemap_fdatawrite is used for the data blocks. - */ - err = sync_inode_metadata(&ni->vfs_inode, 0); - if (!err) - err = filemap_fdatawrite(ni->vfs_inode.i_mapping); + /* write mft record on disk. */ + err = _ni_write_inode(&ni->vfs_inode, 1); return err; } @@ -2461,10 +2454,12 @@ { CLST end, i, zone_len, zlen; struct wnd_bitmap *wnd = &sbi->used.bitmap; + bool dirty = false; down_write_nested(&wnd->rw_lock, BITMAP_MUTEX_CLUSTERS); if (!wnd_is_used(wnd, lcn, len)) { - ntfs_set_state(sbi, NTFS_DIRTY_ERROR); + /* mark volume as dirty out of wnd->rw_lock */ + dirty = true; end = lcn + len; len = 0; @@ -2518,6 +2513,8 @@ out: up_write(&wnd->rw_lock); + if (dirty) + ntfs_set_state(sbi, NTFS_DIRTY_ERROR); } /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/index.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/index.c @@ -729,6 +729,9 @@ u32 total = le32_to_cpu(hdr->total); u16 offs[128]; + if (unlikely(!cmp)) + return NULL; + fill_table: if (end > total) return NULL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/ntfs_fs.h +++ linux-aws-6.5-6.5.0/fs/ntfs3/ntfs_fs.h @@ -42,9 +42,11 @@ #define MINUS_ONE_T ((size_t)(-1)) /* Biggest MFT / smallest cluster */ #define MAXIMUM_BYTES_PER_MFT 4096 +#define MAXIMUM_SHIFT_BYTES_PER_MFT 12 #define NTFS_BLOCKS_PER_MFT_RECORD (MAXIMUM_BYTES_PER_MFT / 512) #define MAXIMUM_BYTES_PER_INDEX 4096 +#define MAXIMUM_SHIFT_BYTES_PER_INDEX 12 #define NTFS_BLOCKS_PER_INODE (MAXIMUM_BYTES_PER_INDEX / 512) /* NTFS specific error code when fixup failed. */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/record.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/record.c @@ -193,8 +193,9 @@ { const struct MFT_REC *rec = mi->mrec; u32 used = le32_to_cpu(rec->used); - u32 t32, off, asize; + u32 t32, off, asize, prev_type; u16 t16; + u64 data_size, alloc_size, tot_size; if (!attr) { u32 total = le32_to_cpu(rec->total); @@ -213,6 +214,7 @@ if (!is_rec_inuse(rec)) return NULL; + prev_type = 0; attr = Add2Ptr(rec, off); } else { /* Check if input attr inside record. */ @@ -226,11 +228,11 @@ return NULL; } - if (off + asize < off) { - /* Overflow check. */ + /* Overflow check. */ + if (off + asize < off) return NULL; - } + prev_type = le32_to_cpu(attr->type); attr = Add2Ptr(attr, asize); off += asize; } @@ -250,7 +252,11 @@ /* 0x100 is last known attribute for now. */ t32 = le32_to_cpu(attr->type); - if ((t32 & 0xf) || (t32 > 0x100)) + if (!t32 || (t32 & 0xf) || (t32 > 0x100)) + return NULL; + + /* attributes in record must be ordered by type */ + if (t32 < prev_type) return NULL; /* Check overflow and boundary. */ @@ -259,16 +265,15 @@ /* Check size of attribute. */ if (!attr->non_res) { + /* Check resident fields. */ if (asize < SIZEOF_RESIDENT) return NULL; t16 = le16_to_cpu(attr->res.data_off); - if (t16 > asize) return NULL; - t32 = le32_to_cpu(attr->res.data_size); - if (t16 + t32 > asize) + if (t16 + le32_to_cpu(attr->res.data_size) > asize) return NULL; t32 = sizeof(short) * attr->name_len; @@ -278,21 +283,52 @@ return attr; } - /* Check some nonresident fields. */ - if (attr->name_len && - le16_to_cpu(attr->name_off) + sizeof(short) * attr->name_len > - le16_to_cpu(attr->nres.run_off)) { + /* Check nonresident fields. */ + if (attr->non_res != 1) + return NULL; + + t16 = le16_to_cpu(attr->nres.run_off); + if (t16 > asize) + return NULL; + + t32 = sizeof(short) * attr->name_len; + if (t32 && le16_to_cpu(attr->name_off) + t32 > t16) + return NULL; + + /* Check start/end vcn. */ + if (le64_to_cpu(attr->nres.svcn) > le64_to_cpu(attr->nres.evcn) + 1) + return NULL; + + data_size = le64_to_cpu(attr->nres.data_size); + if (le64_to_cpu(attr->nres.valid_size) > data_size) return NULL; - } - if (attr->nres.svcn || !is_attr_ext(attr)) { + alloc_size = le64_to_cpu(attr->nres.alloc_size); + if (data_size > alloc_size) + return NULL; + + t32 = mi->sbi->cluster_mask; + if (alloc_size & t32) + return NULL; + + if (!attr->nres.svcn && is_attr_ext(attr)) { + /* First segment of sparse/compressed attribute */ + if (asize + 8 < SIZEOF_NONRESIDENT_EX) + return NULL; + + tot_size = le64_to_cpu(attr->nres.total_size); + if (tot_size & t32) + return NULL; + + if (tot_size > alloc_size) + return NULL; + } else { if (asize + 8 < SIZEOF_NONRESIDENT) return NULL; if (attr->nres.c_unit) return NULL; - } else if (asize + 8 < SIZEOF_NONRESIDENT_EX) - return NULL; + } return attr; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/super.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/super.c @@ -453,15 +453,23 @@ * ntfs3.1 * cluster size * number of clusters + * total number of mft records + * number of used mft records ~= number of files + folders + * real state of ntfs "dirty"/"clean" + * current state of ntfs "dirty"/"clean" */ static int ntfs3_volinfo(struct seq_file *m, void *o) { struct super_block *sb = m->private; struct ntfs_sb_info *sbi = sb->s_fs_info; - seq_printf(m, "ntfs%d.%d\n%u\n%zu\n", sbi->volume.major_ver, - sbi->volume.minor_ver, sbi->cluster_size, - sbi->used.bitmap.nbits); + seq_printf(m, "ntfs%d.%d\n%u\n%zu\n\%zu\n%zu\n%s\n%s\n", + sbi->volume.major_ver, sbi->volume.minor_ver, + sbi->cluster_size, sbi->used.bitmap.nbits, + sbi->mft.bitmap.nbits, + sbi->mft.bitmap.nbits - wnd_zeroes(&sbi->mft.bitmap), + sbi->volume.real_dirty ? "dirty" : "clean", + (sbi->volume.flags & VOLUME_FLAG_DIRTY) ? "dirty" : "clean"); return 0; } @@ -490,7 +498,12 @@ struct super_block *sb = pde_data(file_inode(file)); struct ntfs_sb_info *sbi = sb->s_fs_info; ssize_t ret = count; - u8 *label = kmalloc(count, GFP_NOFS); + u8 *label; + + if (sb_rdonly(sb)) + return -EROFS; + + label = kmalloc(count, GFP_NOFS); if (!label) return -ENOMEM; @@ -838,7 +851,7 @@ struct ntfs_sb_info *sbi = sb->s_fs_info; int err; u32 mb, gb, boot_sector_size, sct_per_clst, record_size; - u64 sectors, clusters, mlcn, mlcn2; + u64 sectors, clusters, mlcn, mlcn2, dev_size0; struct NTFS_BOOT *boot; struct buffer_head *bh; struct MFT_REC *rec; @@ -847,6 +860,9 @@ u32 boot_off = 0; const char *hint = "Primary boot"; + /* Save original dev_size. Used with alternative boot. */ + dev_size0 = dev_size; + sbi->volume.blocks = dev_size >> PAGE_SHIFT; bh = ntfs_bread(sb, 0); @@ -855,6 +871,11 @@ check_boot: err = -EINVAL; + + /* Corrupted image; do not read OOB */ + if (bh->b_size - sizeof(*boot) < boot_off) + goto out; + boot = (struct NTFS_BOOT *)Add2Ptr(bh->b_data, boot_off); if (memcmp(boot->system_id, "NTFS ", sizeof("NTFS ") - 1)) { @@ -901,9 +922,17 @@ goto out; } - sbi->record_size = record_size = - boot->record_size < 0 ? 1 << (-boot->record_size) : - (u32)boot->record_size << cluster_bits; + if (boot->record_size >= 0) { + record_size = (u32)boot->record_size << cluster_bits; + } else if (-boot->record_size <= MAXIMUM_SHIFT_BYTES_PER_MFT) { + record_size = 1u << (-boot->record_size); + } else { + ntfs_err(sb, "%s: invalid record size %d.", hint, + boot->record_size); + goto out; + } + + sbi->record_size = record_size; sbi->record_bits = blksize_bits(record_size); sbi->attr_size_tr = (5 * record_size >> 4); // ~320 bytes @@ -920,9 +949,15 @@ goto out; } - sbi->index_size = boot->index_size < 0 ? - 1u << (-boot->index_size) : - (u32)boot->index_size << cluster_bits; + if (boot->index_size >= 0) { + sbi->index_size = (u32)boot->index_size << cluster_bits; + } else if (-boot->index_size <= MAXIMUM_SHIFT_BYTES_PER_INDEX) { + sbi->index_size = 1u << (-boot->index_size); + } else { + ntfs_err(sb, "%s: invalid index size %d.", hint, + boot->index_size); + goto out; + } /* Check index record size. */ if (sbi->index_size < SECTOR_SIZE || !is_power_of_2(sbi->index_size)) { @@ -1065,9 +1100,9 @@ } out: - if (err == -EINVAL && !bh->b_blocknr && dev_size > PAGE_SHIFT) { + if (err == -EINVAL && !bh->b_blocknr && dev_size0 > PAGE_SHIFT) { u32 block_size = min_t(u32, sector_size, PAGE_SIZE); - u64 lbo = dev_size - sizeof(*boot); + u64 lbo = dev_size0 - sizeof(*boot); /* * Try alternative boot (last sector) @@ -1081,6 +1116,7 @@ boot_off = lbo & (block_size - 1); hint = "Alternative boot"; + dev_size = dev_size0; /* restore original size. */ goto check_boot; } brelse(bh); @@ -1369,7 +1405,7 @@ } bytes = inode->i_size; - sbi->def_table = t = kmalloc(bytes, GFP_NOFS | __GFP_NOWARN); + sbi->def_table = t = kvmalloc(bytes, GFP_KERNEL); if (!t) { err = -ENOMEM; goto put_inode_out; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/ntfs3/xattr.c +++ linux-aws-6.5-6.5.0/fs/ntfs3/xattr.c @@ -211,7 +211,8 @@ size = le32_to_cpu(info->size); /* Enumerate all xattrs. */ - for (ret = 0, off = 0; off < size; off += ea_size) { + ret = 0; + for (off = 0; off + sizeof(struct EA_FULL) < size; off += ea_size) { ea = Add2Ptr(ea_all, off); ea_size = unpacked_ea_size(ea); @@ -219,6 +220,10 @@ break; if (buffer) { + /* Check if we can use field ea->name */ + if (off + ea_size > size) + break; + if (ret + ea->name_len + 1 > bytes_per_buffer) { err = -ERANGE; goto out; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/overlayfs/inode.c +++ linux-aws-6.5-6.5.0/fs/overlayfs/inode.c @@ -171,7 +171,7 @@ type = ovl_path_real(dentry, &realpath); old_cred = ovl_override_creds(dentry->d_sb); - err = vfs_getattr(&realpath, stat, request_mask, flags); + err = ovl_do_getattr(&realpath, stat, request_mask, flags); if (err) goto out; @@ -196,8 +196,8 @@ (!is_dir ? STATX_NLINK : 0); ovl_path_lower(dentry, &realpath); - err = vfs_getattr(&realpath, &lowerstat, - lowermask, flags); + err = ovl_do_getattr(&realpath, &lowerstat, lowermask, + flags); if (err) goto out; @@ -249,8 +249,8 @@ ovl_path_lowerdata(dentry, &realpath); if (realpath.dentry) { - err = vfs_getattr(&realpath, &lowerdatastat, - lowermask, flags); + err = ovl_do_getattr(&realpath, &lowerdatastat, + lowermask, flags); if (err) goto out; } else { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/overlayfs/overlayfs.h +++ linux-aws-6.5-6.5.0/fs/overlayfs/overlayfs.h @@ -360,6 +360,14 @@ return ((OPEN_FMODE(flags) & FMODE_WRITE) || (flags & O_TRUNC)); } +static inline int ovl_do_getattr(const struct path *path, struct kstat *stat, + u32 request_mask, unsigned int flags) +{ + if (flags & AT_GETATTR_NOSEC) + return vfs_getattr_nosec(path, stat, request_mask, flags); + return vfs_getattr(path, stat, request_mask, flags); +} + /* util.c */ int ovl_want_write(struct dentry *dentry); void ovl_drop_write(struct dentry *dentry); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/proc/proc_sysctl.c +++ linux-aws-6.5-6.5.0/fs/proc/proc_sysctl.c @@ -1574,7 +1574,6 @@ {"hung_task_panic", "kernel.hung_task_panic" }, {"numa_zonelist_order", "vm.numa_zonelist_order" }, {"softlockup_all_cpu_backtrace", "kernel.softlockup_all_cpu_backtrace" }, - {"softlockup_panic", "kernel.softlockup_panic" }, { } }; @@ -1590,6 +1589,13 @@ return NULL; } +bool sysctl_is_alias(char *param) +{ + const char *alias = sysctl_find_alias(param); + + return alias != NULL; +} + /* Set sysctl value passed on kernel command line. */ static int process_sysctl_arg(char *param, char *val, const char *unused, void *arg) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/pstore/platform.c +++ linux-aws-6.5-6.5.0/fs/pstore/platform.c @@ -573,6 +573,8 @@ */ int pstore_register(struct pstore_info *psi) { + char *new_backend; + if (backend && strcmp(backend, psi->name)) { pr_warn("backend '%s' already in use: ignoring '%s'\n", backend, psi->name); @@ -593,11 +595,16 @@ return -EINVAL; } + new_backend = kstrdup(psi->name, GFP_KERNEL); + if (!new_backend) + return -ENOMEM; + mutex_lock(&psinfo_lock); if (psinfo) { pr_warn("backend '%s' already loaded: ignoring '%s'\n", psinfo->name, psi->name); mutex_unlock(&psinfo_lock); + kfree(new_backend); return -EBUSY; } @@ -630,7 +637,7 @@ * Update the module parameter backend, so it is visible * through /sys/module/pstore/parameters/backend */ - backend = kstrdup(psi->name, GFP_KERNEL); + backend = new_backend; pr_info("Registered %s as persistent store backend\n", psi->name); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/cached_dir.h +++ linux-aws-6.5-6.5.0/fs/smb/client/cached_dir.h @@ -49,7 +49,7 @@ struct cached_dirents dirents; }; -#define MAX_CACHED_FIDS 16 +/* default MAX_CACHED_FIDS is 16 */ struct cached_fids { /* Must be held when: * - accessing the cfids->entries list @@ -57,7 +57,7 @@ spinlock_t cfid_list_lock; int num_entries; struct list_head entries; - struct task_struct *laundromat; + struct delayed_work laundromat_work; }; extern struct cached_fids *init_cached_dirs(void); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/cifs_debug.c +++ linux-aws-6.5-6.5.0/fs/smb/client/cifs_debug.c @@ -279,6 +279,8 @@ struct cifs_ses *ses; struct cifs_tcon *tcon; struct cifs_server_iface *iface; + size_t iface_weight = 0, iface_min_speed = 0; + struct cifs_server_iface *last_iface = NULL; int c, i, j; seq_puts(m, @@ -452,6 +454,11 @@ seq_printf(m, "\n\n\tSessions: "); i = 0; list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { + spin_lock(&ses->ses_lock); + if (ses->ses_status == SES_EXITING) { + spin_unlock(&ses->ses_lock); + continue; + } i++; if ((ses->serverDomain == NULL) || (ses->serverOS == NULL) || @@ -472,6 +479,7 @@ ses->ses_count, ses->serverOS, ses->serverNOS, ses->capabilities, ses->ses_status); } + spin_unlock(&ses->ses_lock); seq_printf(m, "\n\tSecurity type: %s ", get_security_type_str(server->ops->select_sectype(server, ses->sectype))); @@ -536,11 +544,25 @@ "\tLast updated: %lu seconds ago", ses->iface_count, (jiffies - ses->iface_last_update) / HZ); + + last_iface = list_last_entry(&ses->iface_list, + struct cifs_server_iface, + iface_head); + iface_min_speed = last_iface->speed; + j = 0; list_for_each_entry(iface, &ses->iface_list, iface_head) { seq_printf(m, "\n\t%d)", ++j); cifs_dump_iface(m, iface); + + iface_weight = iface->speed / iface_min_speed; + seq_printf(m, "\t\tWeight (cur,total): (%zu,%zu)" + "\n\t\tAllocated channels: %u\n", + iface->weight_fulfilled, + iface_weight, + iface->num_channels); + if (is_ses_using_iface(ses, iface)) seq_puts(m, "\t\t[CONNECTED]\n"); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/cifs_ioctl.h +++ linux-aws-6.5-6.5.0/fs/smb/client/cifs_ioctl.h @@ -26,6 +26,11 @@ __u64 cifs_posix_caps; } __packed; +struct smb_mnt_tcon_info { + __u32 tid; + __u64 session_id; +} __packed; + struct smb_snapshot_array { __u32 number_of_snapshots; __u32 number_of_snapshots_returned; @@ -108,6 +113,7 @@ #define CIFS_IOC_NOTIFY _IOW(CIFS_IOCTL_MAGIC, 9, struct smb3_notify) #define CIFS_DUMP_FULL_KEY _IOWR(CIFS_IOCTL_MAGIC, 10, struct smb3_full_key_debug_info) #define CIFS_IOC_NOTIFY_INFO _IOWR(CIFS_IOCTL_MAGIC, 11, struct smb3_notify_info) +#define CIFS_IOC_GET_TCON_INFO _IOR(CIFS_IOCTL_MAGIC, 12, struct smb_mnt_tcon_info) #define CIFS_IOC_SHUTDOWN _IOR('X', 125, __u32) /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/cifs_spnego.c +++ linux-aws-6.5-6.5.0/fs/smb/client/cifs_spnego.c @@ -64,8 +64,8 @@ * strlen(";sec=ntlmsspi") */ #define MAX_MECH_STR_LEN 13 -/* strlen of "host=" */ -#define HOST_KEY_LEN 5 +/* strlen of ";host=" */ +#define HOST_KEY_LEN 6 /* strlen of ";ip4=" or ";ip6=" */ #define IP_KEY_LEN 5 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/cifsfs.c +++ linux-aws-6.5-6.5.0/fs/smb/client/cifsfs.c @@ -117,6 +117,10 @@ MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server for " "CIFS/SMB1 dialect (N/A for SMB3) " "Default: 32767 Range: 2 to 32767."); +unsigned int dir_cache_timeout = 30; +module_param(dir_cache_timeout, uint, 0644); +MODULE_PARM_DESC(dir_cache_timeout, "Number of seconds to cache directory contents for which we have a lease. Default: 30 " + "Range: 1 to 65000 seconds, 0 to disable caching dir contents"); #ifdef CONFIG_CIFS_STATS2 unsigned int slow_rsp_threshold = 1; module_param(slow_rsp_threshold, uint, 0644); @@ -695,6 +699,8 @@ seq_printf(s, ",snapshot=%llu", tcon->snapshot_time); if (tcon->handle_timeout) seq_printf(s, ",handletimeout=%u", tcon->handle_timeout); + if (tcon->max_cached_dirs != MAX_CACHED_FIDS) + seq_printf(s, ",max_cached_dirs=%u", tcon->max_cached_dirs); /* * Display file and directory attribute timeout in seconds. @@ -1185,36 +1191,108 @@ const struct inode_operations cifs_symlink_inode_ops = { .get_link = cifs_get_link, + .setattr = cifs_setattr, .permission = cifs_permission, .listxattr = cifs_listxattr, }; +/* + * Advance the EOF marker to after the source range. + */ +static int cifs_precopy_set_eof(struct inode *src_inode, struct cifsInodeInfo *src_cifsi, + struct cifs_tcon *src_tcon, + unsigned int xid, loff_t src_end) +{ + struct cifsFileInfo *writeable_srcfile; + int rc = -EINVAL; + + writeable_srcfile = find_writable_file(src_cifsi, FIND_WR_FSUID_ONLY); + if (writeable_srcfile) { + if (src_tcon->ses->server->ops->set_file_size) + rc = src_tcon->ses->server->ops->set_file_size( + xid, src_tcon, writeable_srcfile, + src_inode->i_size, true /* no need to set sparse */); + else + rc = -ENOSYS; + cifsFileInfo_put(writeable_srcfile); + cifs_dbg(FYI, "SetFSize for copychunk rc = %d\n", rc); + } + + if (rc < 0) + goto set_failed; + + netfs_resize_file(&src_cifsi->netfs, src_end); + fscache_resize_cookie(cifs_inode_cookie(src_inode), src_end); + return 0; + +set_failed: + return filemap_write_and_wait(src_inode->i_mapping); +} + +/* + * Flush out either the folio that overlaps the beginning of a range in which + * pos resides or the folio that overlaps the end of a range unless that folio + * is entirely within the range we're going to invalidate. We extend the flush + * bounds to encompass the folio. + */ +static int cifs_flush_folio(struct inode *inode, loff_t pos, loff_t *_fstart, loff_t *_fend, + bool first) +{ + struct folio *folio; + unsigned long long fpos, fend; + pgoff_t index = pos / PAGE_SIZE; + size_t size; + int rc = 0; + + folio = filemap_get_folio(inode->i_mapping, index); + if (IS_ERR(folio)) + return 0; + + size = folio_size(folio); + fpos = folio_pos(folio); + fend = fpos + size - 1; + *_fstart = min_t(unsigned long long, *_fstart, fpos); + *_fend = max_t(unsigned long long, *_fend, fend); + if ((first && pos == fpos) || (!first && pos == fend)) + goto out; + + rc = filemap_write_and_wait_range(inode->i_mapping, fpos, fend); +out: + folio_put(folio); + return rc; +} + static loff_t cifs_remap_file_range(struct file *src_file, loff_t off, struct file *dst_file, loff_t destoff, loff_t len, unsigned int remap_flags) { struct inode *src_inode = file_inode(src_file); struct inode *target_inode = file_inode(dst_file); + struct cifsInodeInfo *src_cifsi = CIFS_I(src_inode); + struct cifsInodeInfo *target_cifsi = CIFS_I(target_inode); struct cifsFileInfo *smb_file_src = src_file->private_data; - struct cifsFileInfo *smb_file_target; - struct cifs_tcon *target_tcon; + struct cifsFileInfo *smb_file_target = dst_file->private_data; + struct cifs_tcon *target_tcon, *src_tcon; + unsigned long long destend, fstart, fend, new_size; unsigned int xid; int rc; - if (remap_flags & ~(REMAP_FILE_DEDUP | REMAP_FILE_ADVISORY)) + if (remap_flags & REMAP_FILE_DEDUP) + return -EOPNOTSUPP; + if (remap_flags & ~REMAP_FILE_ADVISORY) return -EINVAL; cifs_dbg(FYI, "clone range\n"); xid = get_xid(); - if (!src_file->private_data || !dst_file->private_data) { + if (!smb_file_src || !smb_file_target) { rc = -EBADF; cifs_dbg(VFS, "missing cifsFileInfo on copy range src file\n"); goto out; } - smb_file_target = dst_file->private_data; + src_tcon = tlink_tcon(smb_file_src->tlink); target_tcon = tlink_tcon(smb_file_target->tlink); /* @@ -1227,20 +1305,63 @@ if (len == 0) len = src_inode->i_size - off; - cifs_dbg(FYI, "about to flush pages\n"); - /* should we flush first and last page first */ - truncate_inode_pages_range(&target_inode->i_data, destoff, - PAGE_ALIGN(destoff + len)-1); + cifs_dbg(FYI, "clone range\n"); + + /* Flush the source buffer */ + rc = filemap_write_and_wait_range(src_inode->i_mapping, off, + off + len - 1); + if (rc) + goto unlock; - if (target_tcon->ses->server->ops->duplicate_extents) + /* The server-side copy will fail if the source crosses the EOF marker. + * Advance the EOF marker after the flush above to the end of the range + * if it's short of that. + */ + if (src_cifsi->netfs.remote_i_size < off + len) { + rc = cifs_precopy_set_eof(src_inode, src_cifsi, src_tcon, xid, off + len); + if (rc < 0) + goto unlock; + } + + new_size = destoff + len; + destend = destoff + len - 1; + + /* Flush the folios at either end of the destination range to prevent + * accidental loss of dirty data outside of the range. + */ + fstart = destoff; + fend = destend; + + rc = cifs_flush_folio(target_inode, destoff, &fstart, &fend, true); + if (rc) + goto unlock; + rc = cifs_flush_folio(target_inode, destend, &fstart, &fend, false); + if (rc) + goto unlock; + + /* Discard all the folios that overlap the destination region. */ + cifs_dbg(FYI, "about to discard pages %llx-%llx\n", fstart, fend); + truncate_inode_pages_range(&target_inode->i_data, fstart, fend); + + fscache_invalidate(cifs_inode_cookie(target_inode), NULL, + i_size_read(target_inode), 0); + + rc = -EOPNOTSUPP; + if (target_tcon->ses->server->ops->duplicate_extents) { rc = target_tcon->ses->server->ops->duplicate_extents(xid, smb_file_src, smb_file_target, off, len, destoff); - else - rc = -EOPNOTSUPP; + if (rc == 0 && new_size > i_size_read(target_inode)) { + truncate_setsize(target_inode, new_size); + netfs_resize_file(&target_cifsi->netfs, new_size); + fscache_resize_cookie(cifs_inode_cookie(target_inode), + new_size); + } + } /* force revalidate of size and timestamps of target file now that target is updated on the server */ CIFS_I(target_inode)->time = 0; +unlock: /* although unlocking in the reverse order from locking is not strictly necessary here it is a little cleaner to be consistent */ unlock_two_nondirectories(src_inode, target_inode); @@ -1256,10 +1377,12 @@ { struct inode *src_inode = file_inode(src_file); struct inode *target_inode = file_inode(dst_file); + struct cifsInodeInfo *src_cifsi = CIFS_I(src_inode); struct cifsFileInfo *smb_file_src; struct cifsFileInfo *smb_file_target; struct cifs_tcon *src_tcon; struct cifs_tcon *target_tcon; + unsigned long long destend, fstart, fend; ssize_t rc; cifs_dbg(FYI, "copychunk range\n"); @@ -1299,13 +1422,41 @@ if (rc) goto unlock; - /* should we flush first and last page first */ - truncate_inode_pages(&target_inode->i_data, 0); + /* The server-side copy will fail if the source crosses the EOF marker. + * Advance the EOF marker after the flush above to the end of the range + * if it's short of that. + */ + if (src_cifsi->server_eof < off + len) { + rc = cifs_precopy_set_eof(src_inode, src_cifsi, src_tcon, xid, off + len); + if (rc < 0) + goto unlock; + } + + destend = destoff + len - 1; + + /* Flush the folios at either end of the destination range to prevent + * accidental loss of dirty data outside of the range. + */ + fstart = destoff; + fend = destend; + + rc = cifs_flush_folio(target_inode, destoff, &fstart, &fend, true); + if (rc) + goto unlock; + rc = cifs_flush_folio(target_inode, destend, &fstart, &fend, false); + if (rc) + goto unlock; + + /* Discard all the folios that overlap the destination region. */ + truncate_inode_pages_range(&target_inode->i_data, fstart, fend); rc = file_modified(dst_file); - if (!rc) + if (!rc) { rc = target_tcon->ses->server->ops->copychunk_range(xid, smb_file_src, smb_file_target, off, len, destoff); + if (rc > 0 && destoff + rc > i_size_read(target_inode)) + truncate_setsize(target_inode, destoff + rc); + } file_accessed(src_file); @@ -1679,6 +1830,12 @@ CIFS_MAX_REQ); } + /* Limit max to about 18 hours, and setting to zero disables directory entry caching */ + if (dir_cache_timeout > 65000) { + dir_cache_timeout = 65000; + cifs_dbg(VFS, "dir_cache_timeout set to max of 65000 seconds\n"); + } + cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); if (!cifsiod_wq) { rc = -ENOMEM; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/cifspdu.h +++ linux-aws-6.5-6.5.0/fs/smb/client/cifspdu.h @@ -2570,7 +2570,7 @@ struct win_dev { - unsigned char type[8]; /* IntxCHR or IntxBLK */ + unsigned char type[8]; /* IntxCHR or IntxBLK or LnxFIFO*/ __le64 major; __le64 minor; } __attribute__((packed)); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/cifsproto.h +++ linux-aws-6.5-6.5.0/fs/smb/client/cifsproto.h @@ -81,7 +81,7 @@ extern char *build_wildcard_path_from_dentry(struct dentry *direntry); char *cifs_build_devname(char *nodename, const char *prepath); extern void delete_mid(struct mid_q_entry *mid); -extern void release_mid(struct mid_q_entry *mid); +void __release_mid(struct kref *refcount); extern void cifs_wake_up_task(struct mid_q_entry *mid); extern int cifs_handle_standard(struct TCP_Server_Info *server, struct mid_q_entry *mid); @@ -513,7 +513,7 @@ extern struct cifs_ses *sesInfoAlloc(void); extern void sesInfoFree(struct cifs_ses *); -extern struct cifs_tcon *tconInfoAlloc(void); +extern struct cifs_tcon *tcon_info_alloc(bool dir_leases_enabled); extern void tconInfoFree(struct cifs_tcon *); extern int cifs_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server, @@ -741,4 +741,9 @@ return true; } +static inline void release_mid(struct mid_q_entry *mid) +{ + kref_put(&mid->refcount, __release_mid); +} + #endif /* _CIFSPROTO_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/fs_context.h +++ linux-aws-6.5-6.5.0/fs/smb/client/fs_context.h @@ -128,6 +128,7 @@ Opt_closetimeo, Opt_echo_interval, Opt_max_credits, + Opt_max_cached_dirs, Opt_snapshot, Opt_max_channels, Opt_handletimeout, @@ -261,6 +262,7 @@ __u32 handle_timeout; /* persistent and durable handle timeout in ms */ unsigned int max_credits; /* smb3 max_credits 10 < credits < 60000 */ unsigned int max_channels; + unsigned int max_cached_dirs; __u16 compression; /* compression algorithm 0xFFFF default 0=disabled */ bool rootfs:1; /* if it's a SMB root file system */ bool witness:1; /* use witness protocol */ @@ -287,7 +289,7 @@ */ #define SMB3_MAX_DCLOSETIMEO (1 << 30) #define SMB3_DEF_DCLOSETIMEO (1 * HZ) /* even 1 sec enough to help eg open/write/close/open/read */ - +#define MAX_CACHED_FIDS 16 extern char *cifs_sanitize_prepath(char *prepath, gfp_t gfp); #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/ioctl.c +++ linux-aws-6.5-6.5.0/fs/smb/client/ioctl.c @@ -117,6 +117,20 @@ return rc; } +static long smb_mnt_get_tcon_info(struct cifs_tcon *tcon, void __user *arg) +{ + int rc = 0; + struct smb_mnt_tcon_info tcon_inf; + + tcon_inf.tid = tcon->tid; + tcon_inf.session_id = tcon->ses->Suid; + + if (copy_to_user(arg, &tcon_inf, sizeof(struct smb_mnt_tcon_info))) + rc = -EFAULT; + + return rc; +} + static long smb_mnt_get_fsinfo(unsigned int xid, struct cifs_tcon *tcon, void __user *arg) { @@ -414,6 +428,17 @@ tcon = tlink_tcon(pSMBFile->tlink); rc = smb_mnt_get_fsinfo(xid, tcon, (void __user *)arg); break; + case CIFS_IOC_GET_TCON_INFO: + cifs_sb = CIFS_SB(inode->i_sb); + tlink = cifs_sb_tlink(cifs_sb); + if (IS_ERR(tlink)) { + rc = PTR_ERR(tlink); + break; + } + tcon = tlink_tcon(tlink); + rc = smb_mnt_get_tcon_info(tcon, (void __user *)arg); + cifs_put_tlink(tlink); + break; case CIFS_ENUMERATE_SNAPSHOTS: if (pSMBFile == NULL) break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/sess.c +++ linux-aws-6.5-6.5.0/fs/smb/client/sess.c @@ -164,7 +164,9 @@ int left; int rc = 0; int tries = 0; + size_t iface_weight = 0, iface_min_speed = 0; struct cifs_server_iface *iface = NULL, *niface = NULL; + struct cifs_server_iface *last_iface = NULL; spin_lock(&ses->chan_lock); @@ -186,28 +188,17 @@ } if (!(server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) { - ses->chan_max = 1; spin_unlock(&ses->chan_lock); cifs_server_dbg(VFS, "no multichannel support\n"); return 0; } spin_unlock(&ses->chan_lock); - /* - * Keep connecting to same, fastest, iface for all channels as - * long as its RSS. Try next fastest one if not RSS or channel - * creation fails. - */ - spin_lock(&ses->iface_lock); - iface = list_first_entry(&ses->iface_list, struct cifs_server_iface, - iface_head); - spin_unlock(&ses->iface_lock); - while (left > 0) { tries++; if (tries > 3*ses->chan_max) { - cifs_dbg(FYI, "too many channel open attempts (%d channels left to open)\n", + cifs_dbg(VFS, "too many channel open attempts (%d channels left to open)\n", left); break; } @@ -215,17 +206,35 @@ spin_lock(&ses->iface_lock); if (!ses->iface_count) { spin_unlock(&ses->iface_lock); + cifs_dbg(VFS, "server %s does not advertise interfaces\n", + ses->server->hostname); break; } + if (!iface) + iface = list_first_entry(&ses->iface_list, struct cifs_server_iface, + iface_head); + last_iface = list_last_entry(&ses->iface_list, struct cifs_server_iface, + iface_head); + iface_min_speed = last_iface->speed; + list_for_each_entry_safe_from(iface, niface, &ses->iface_list, iface_head) { + /* do not mix rdma and non-rdma interfaces */ + if (iface->rdma_capable != ses->server->rdma) + continue; + /* skip ifaces that are unusable */ if (!iface->is_active || (is_ses_using_iface(ses, iface) && - !iface->rss_capable)) { + !iface->rss_capable)) + continue; + + /* check if we already allocated enough channels */ + iface_weight = iface->speed / iface_min_speed; + + if (iface->weight_fulfilled >= iface_weight) continue; - } /* take ref before unlock */ kref_get(&iface->refcount); @@ -242,10 +251,21 @@ continue; } - cifs_dbg(FYI, "successfully opened new channel on iface:%pIS\n", + iface->num_channels++; + iface->weight_fulfilled++; + cifs_dbg(VFS, "successfully opened new channel on iface:%pIS\n", &iface->sockaddr); break; } + + /* reached end of list. reset weight_fulfilled and start over */ + if (list_entry_is_head(iface, &ses->iface_list, iface_head)) { + list_for_each_entry(iface, &ses->iface_list, iface_head) + iface->weight_fulfilled = 0; + spin_unlock(&ses->iface_lock); + iface = NULL; + continue; + } spin_unlock(&ses->iface_lock); left--; @@ -264,8 +284,11 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) { unsigned int chan_index; + size_t iface_weight = 0, iface_min_speed = 0; struct cifs_server_iface *iface = NULL; struct cifs_server_iface *old_iface = NULL; + struct cifs_server_iface *last_iface = NULL; + struct sockaddr_storage ss; int rc = 0; spin_lock(&ses->chan_lock); @@ -284,14 +307,49 @@ } spin_unlock(&ses->chan_lock); + spin_lock(&server->srv_lock); + ss = server->dstaddr; + spin_unlock(&server->srv_lock); + spin_lock(&ses->iface_lock); + if (!ses->iface_count) { + spin_unlock(&ses->iface_lock); + cifs_dbg(VFS, "server %s does not advertise interfaces\n", ses->server->hostname); + return 0; + } + + last_iface = list_last_entry(&ses->iface_list, struct cifs_server_iface, + iface_head); + iface_min_speed = last_iface->speed; + /* then look for a new one */ list_for_each_entry(iface, &ses->iface_list, iface_head) { + if (!chan_index) { + /* if we're trying to get the updated iface for primary channel */ + if (!cifs_match_ipaddr((struct sockaddr *) &ss, + (struct sockaddr *) &iface->sockaddr)) + continue; + + kref_get(&iface->refcount); + break; + } + + /* do not mix rdma and non-rdma interfaces */ + if (iface->rdma_capable != server->rdma) + continue; + if (!iface->is_active || (is_ses_using_iface(ses, iface) && !iface->rss_capable)) { continue; } + + /* check if we already allocated enough channels */ + iface_weight = iface->speed / iface_min_speed; + + if (iface->weight_fulfilled >= iface_weight) + continue; + kref_get(&iface->refcount); break; } @@ -302,16 +360,41 @@ cifs_dbg(FYI, "unable to find a suitable iface\n"); } + if (!chan_index && !iface) { + cifs_dbg(FYI, "unable to get the interface matching: %pIS\n", + &ss); + spin_unlock(&ses->iface_lock); + return 0; + } + /* now drop the ref to the current iface */ if (old_iface && iface) { cifs_dbg(FYI, "replacing iface: %pIS with %pIS\n", &old_iface->sockaddr, &iface->sockaddr); + + old_iface->num_channels--; + if (old_iface->weight_fulfilled) + old_iface->weight_fulfilled--; + iface->num_channels++; + iface->weight_fulfilled++; + kref_put(&old_iface->refcount, release_iface); } else if (old_iface) { cifs_dbg(FYI, "releasing ref to iface: %pIS\n", &old_iface->sockaddr); + + old_iface->num_channels--; + if (old_iface->weight_fulfilled) + old_iface->weight_fulfilled--; + kref_put(&old_iface->refcount, release_iface); + } else if (!chan_index) { + /* special case: update interface for primary channel */ + cifs_dbg(FYI, "referencing primary channel iface: %pIS\n", + &iface->sockaddr); + iface->num_channels++; + iface->weight_fulfilled++; } else { WARN_ON(!iface); cifs_dbg(FYI, "adding new iface: %pIS\n", &iface->sockaddr); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/smb2misc.c +++ linux-aws-6.5-6.5.0/fs/smb/client/smb2misc.c @@ -787,7 +787,7 @@ { struct close_cancelled_open *cancelled; - cancelled = kzalloc(sizeof(*cancelled), GFP_ATOMIC); + cancelled = kzalloc(sizeof(*cancelled), GFP_KERNEL); if (!cancelled) return -ENOMEM; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/smb2transport.c +++ linux-aws-6.5-6.5.0/fs/smb/client/smb2transport.c @@ -452,6 +452,8 @@ ptriplet->encryption.context, ses->smb3encryptionkey, SMB3_ENC_DEC_KEY_SIZE); + if (rc) + return rc; rc = generate_key(ses, ptriplet->decryption.label, ptriplet->decryption.context, ses->smb3decryptionkey, @@ -460,9 +462,6 @@ return rc; } - if (rc) - return rc; - #ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS cifs_dbg(VFS, "%s: dumping generated AES session keys\n", __func__); /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/client/xattr.c +++ linux-aws-6.5-6.5.0/fs/smb/client/xattr.c @@ -150,10 +150,13 @@ if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) goto out; - if (pTcon->ses->server->ops->set_EA) + if (pTcon->ses->server->ops->set_EA) { rc = pTcon->ses->server->ops->set_EA(xid, pTcon, full_path, name, value, (__u16)size, cifs_sb->local_nls, cifs_sb); + if (rc == 0) + inode_set_ctime_current(inode); + } break; case XATTR_CIFS_ACL: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/server/smb_common.c +++ linux-aws-6.5-6.5.0/fs/smb/server/smb_common.c @@ -372,11 +372,22 @@ return 0; } +/** + * set_smb1_rsp_status() - set error type in smb response header + * @work: smb work containing smb response header + * @err: error code to set in response + */ +static void set_smb1_rsp_status(struct ksmbd_work *work, __le32 err) +{ + work->send_no_response = 1; +} + static struct smb_version_ops smb1_server_ops = { .get_cmd_val = get_smb1_cmd_val, .init_rsp_hdr = init_smb1_rsp_hdr, .allocate_rsp_buf = smb1_allocate_rsp_buf, .check_user_session = smb1_check_user_session, + .set_rsp_status = set_smb1_rsp_status, }; static int smb1_negotiate(struct ksmbd_work *work) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/server/smbacl.c +++ linux-aws-6.5-6.5.0/fs/smb/server/smbacl.c @@ -1107,6 +1107,7 @@ struct smb_acl *pdacl; struct smb_sid *powner_sid = NULL, *pgroup_sid = NULL; int powner_sid_size = 0, pgroup_sid_size = 0, pntsd_size; + int pntsd_alloc_size; if (parent_pntsd->osidoffset) { powner_sid = (struct smb_sid *)((char *)parent_pntsd + @@ -1119,9 +1120,10 @@ pgroup_sid_size = 1 + 1 + 6 + (pgroup_sid->num_subauth * 4); } - pntsd = kzalloc(sizeof(struct smb_ntsd) + powner_sid_size + - pgroup_sid_size + sizeof(struct smb_acl) + - nt_size, GFP_KERNEL); + pntsd_alloc_size = sizeof(struct smb_ntsd) + powner_sid_size + + pgroup_sid_size + sizeof(struct smb_acl) + nt_size; + + pntsd = kzalloc(pntsd_alloc_size, GFP_KERNEL); if (!pntsd) { rc = -ENOMEM; goto free_aces_base; @@ -1136,6 +1138,27 @@ pntsd->gsidoffset = parent_pntsd->gsidoffset; pntsd->dacloffset = parent_pntsd->dacloffset; + if ((u64)le32_to_cpu(pntsd->osidoffset) + powner_sid_size > + pntsd_alloc_size) { + rc = -EINVAL; + kfree(pntsd); + goto free_aces_base; + } + + if ((u64)le32_to_cpu(pntsd->gsidoffset) + pgroup_sid_size > + pntsd_alloc_size) { + rc = -EINVAL; + kfree(pntsd); + goto free_aces_base; + } + + if ((u64)le32_to_cpu(pntsd->dacloffset) + sizeof(struct smb_acl) + nt_size > + pntsd_alloc_size) { + rc = -EINVAL; + kfree(pntsd); + goto free_aces_base; + } + if (pntsd->osidoffset) { struct smb_sid *owner_sid = (struct smb_sid *)((char *)pntsd + le32_to_cpu(pntsd->osidoffset)); @@ -1162,7 +1185,7 @@ pntsd_size += sizeof(struct smb_acl) + nt_size; } - ksmbd_vfs_set_sd_xattr(conn, idmap, path, pntsd, pntsd_size); + ksmbd_vfs_set_sd_xattr(conn, idmap, path, pntsd, pntsd_size, false); kfree(pntsd); } @@ -1354,7 +1377,7 @@ int set_info_sec(struct ksmbd_conn *conn, struct ksmbd_tree_connect *tcon, const struct path *path, struct smb_ntsd *pntsd, int ntsd_len, - bool type_check) + bool type_check, bool get_write) { int rc; struct smb_fattr fattr = {{0}}; @@ -1414,7 +1437,8 @@ if (test_share_config_flag(tcon->share_conf, KSMBD_SHARE_FLAG_ACL_XATTR)) { /* Update WinACL in xattr */ ksmbd_vfs_remove_sd_xattrs(idmap, path); - ksmbd_vfs_set_sd_xattr(conn, idmap, path, pntsd, ntsd_len); + ksmbd_vfs_set_sd_xattr(conn, idmap, path, pntsd, ntsd_len, + get_write); } out: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/server/smbacl.h +++ linux-aws-6.5-6.5.0/fs/smb/server/smbacl.h @@ -207,7 +207,7 @@ __le32 *pdaccess, int uid); int set_info_sec(struct ksmbd_conn *conn, struct ksmbd_tree_connect *tcon, const struct path *path, struct smb_ntsd *pntsd, int ntsd_len, - bool type_check); + bool type_check, bool get_write); void id_to_sid(unsigned int cid, uint sidtype, struct smb_sid *ssid); void ksmbd_init_domain(u32 *sub_auth); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/server/vfs.c +++ linux-aws-6.5-6.5.0/fs/smb/server/vfs.c @@ -97,6 +97,13 @@ return -ENOENT; } + err = mnt_want_write(parent_path->mnt); + if (err) { + path_put(parent_path); + putname(filename); + return -ENOENT; + } + inode_lock_nested(parent_path->dentry->d_inode, I_MUTEX_PARENT); d = lookup_one_qstr_excl(&last, parent_path->dentry, 0); if (IS_ERR(d)) @@ -123,6 +130,7 @@ err_out: inode_unlock(d_inode(parent_path->dentry)); + mnt_drop_write(parent_path->mnt); path_put(parent_path); putname(filename); return -ENOENT; @@ -173,10 +181,6 @@ return err; } - err = mnt_want_write(path.mnt); - if (err) - goto out_err; - mode |= S_IFREG; err = vfs_create(mnt_idmap(path.mnt), d_inode(path.dentry), dentry, mode, true); @@ -186,9 +190,7 @@ } else { pr_err("File(%s): creation failed (err:%d)\n", name, err); } - mnt_drop_write(path.mnt); -out_err: done_path_create(&path, dentry); return err; } @@ -219,10 +221,6 @@ return err; } - err = mnt_want_write(path.mnt); - if (err) - goto out_err2; - idmap = mnt_idmap(path.mnt); mode |= S_IFDIR; err = vfs_mkdir(idmap, d_inode(path.dentry), dentry, mode); @@ -233,21 +231,19 @@ dentry->d_name.len); if (IS_ERR(d)) { err = PTR_ERR(d); - goto out_err1; + goto out_err; } if (unlikely(d_is_negative(d))) { dput(d); err = -ENOENT; - goto out_err1; + goto out_err; } ksmbd_vfs_inherit_owner(work, d_inode(path.dentry), d_inode(d)); dput(d); } -out_err1: - mnt_drop_write(path.mnt); -out_err2: +out_err: done_path_create(&path, dentry); if (err) pr_err("mkdir(%s): creation failed (err:%d)\n", name, err); @@ -463,7 +459,8 @@ fp->stream.name, (void *)stream_buf, size, - 0); + 0, + true); if (err < 0) goto out; @@ -605,10 +602,6 @@ goto out_err; } - err = mnt_want_write(path->mnt); - if (err) - goto out_err; - idmap = mnt_idmap(path->mnt); if (S_ISDIR(d_inode(path->dentry)->i_mode)) { err = vfs_rmdir(idmap, d_inode(parent), path->dentry); @@ -619,7 +612,6 @@ if (err) ksmbd_debug(VFS, "unlink failed, err %d\n", err); } - mnt_drop_write(path->mnt); out_err: ksmbd_revert_fsids(work); @@ -665,16 +657,11 @@ goto out3; } - err = mnt_want_write(newpath.mnt); - if (err) - goto out3; - err = vfs_link(oldpath.dentry, mnt_idmap(newpath.mnt), d_inode(newpath.dentry), dentry, NULL); if (err) ksmbd_debug(VFS, "vfs_link failed err %d\n", err); - mnt_drop_write(newpath.mnt); out3: done_path_create(&newpath, dentry); @@ -924,18 +911,22 @@ * @attr_value: xattr value to set * @attr_size: size of xattr value * @flags: destination buffer length + * @get_write: get write access to a mount * * Return: 0 on success, otherwise error */ int ksmbd_vfs_setxattr(struct mnt_idmap *idmap, const struct path *path, const char *attr_name, - void *attr_value, size_t attr_size, int flags) + void *attr_value, size_t attr_size, int flags, + bool get_write) { int err; - err = mnt_want_write(path->mnt); - if (err) - return err; + if (get_write == true) { + err = mnt_want_write(path->mnt); + if (err) + return err; + } err = vfs_setxattr(idmap, path->dentry, @@ -945,7 +936,8 @@ flags); if (err) ksmbd_debug(VFS, "setxattr failed, err %d\n", err); - mnt_drop_write(path->mnt); + if (get_write == true) + mnt_drop_write(path->mnt); return err; } @@ -1268,6 +1260,13 @@ } if (!err) { + err = mnt_want_write(parent_path->mnt); + if (err) { + path_put(path); + path_put(parent_path); + return err; + } + err = ksmbd_vfs_lock_parent(parent_path->dentry, path->dentry); if (err) { path_put(path); @@ -1277,6 +1276,14 @@ return err; } +void ksmbd_vfs_kern_path_unlock(struct path *parent_path, struct path *path) +{ + inode_unlock(d_inode(parent_path->dentry)); + mnt_drop_write(parent_path->mnt); + path_put(path); + path_put(parent_path); +} + struct dentry *ksmbd_vfs_kern_path_create(struct ksmbd_work *work, const char *name, unsigned int flags, @@ -1431,7 +1438,8 @@ int ksmbd_vfs_set_sd_xattr(struct ksmbd_conn *conn, struct mnt_idmap *idmap, const struct path *path, - struct smb_ntsd *pntsd, int len) + struct smb_ntsd *pntsd, int len, + bool get_write) { int rc; struct ndr sd_ndr = {0}, acl_ndr = {0}; @@ -1491,7 +1499,7 @@ rc = ksmbd_vfs_setxattr(idmap, path, XATTR_NAME_SD, sd_ndr.data, - sd_ndr.offset, 0); + sd_ndr.offset, 0, get_write); if (rc < 0) pr_err("Failed to store XATTR ntacl :%d\n", rc); @@ -1580,7 +1588,8 @@ int ksmbd_vfs_set_dos_attrib_xattr(struct mnt_idmap *idmap, const struct path *path, - struct xattr_dos_attrib *da) + struct xattr_dos_attrib *da, + bool get_write) { struct ndr n; int err; @@ -1590,7 +1599,7 @@ return err; err = ksmbd_vfs_setxattr(idmap, path, XATTR_NAME_DOS_ATTRIBUTE, - (void *)n.data, n.offset, 0); + (void *)n.data, n.offset, 0, get_write); if (err) ksmbd_debug(SMB, "failed to store dos attribute in xattr\n"); kfree(n.data); @@ -1861,10 +1870,6 @@ } posix_state_to_acl(&acl_state, acls->a_entries); - rc = mnt_want_write(path->mnt); - if (rc) - goto out_err; - rc = set_posix_acl(idmap, dentry, ACL_TYPE_ACCESS, acls); if (rc < 0) ksmbd_debug(SMB, "Set posix acl(ACL_TYPE_ACCESS) failed, rc : %d\n", @@ -1876,9 +1881,7 @@ ksmbd_debug(SMB, "Set posix acl(ACL_TYPE_DEFAULT) failed, rc : %d\n", rc); } - mnt_drop_write(path->mnt); -out_err: free_acl_state(&acl_state); posix_acl_release(acls); return rc; @@ -1908,10 +1911,6 @@ } } - rc = mnt_want_write(path->mnt); - if (rc) - goto out_err; - rc = set_posix_acl(idmap, dentry, ACL_TYPE_ACCESS, acls); if (rc < 0) ksmbd_debug(SMB, "Set posix acl(ACL_TYPE_ACCESS) failed, rc : %d\n", @@ -1923,9 +1922,7 @@ ksmbd_debug(SMB, "Set posix acl(ACL_TYPE_DEFAULT) failed, rc : %d\n", rc); } - mnt_drop_write(path->mnt); -out_err: posix_acl_release(acls); return rc; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/smb/server/vfs.h +++ linux-aws-6.5-6.5.0/fs/smb/server/vfs.h @@ -109,7 +109,8 @@ int attr_name_len); int ksmbd_vfs_setxattr(struct mnt_idmap *idmap, const struct path *path, const char *attr_name, - void *attr_value, size_t attr_size, int flags); + void *attr_value, size_t attr_size, int flags, + bool get_write); int ksmbd_vfs_xattr_stream_name(char *stream_name, char **xattr_stream_name, size_t *xattr_stream_name_size, int s_type); int ksmbd_vfs_remove_xattr(struct mnt_idmap *idmap, @@ -117,6 +118,7 @@ int ksmbd_vfs_kern_path_locked(struct ksmbd_work *work, char *name, unsigned int flags, struct path *parent_path, struct path *path, bool caseless); +void ksmbd_vfs_kern_path_unlock(struct path *parent_path, struct path *path); struct dentry *ksmbd_vfs_kern_path_create(struct ksmbd_work *work, const char *name, unsigned int flags, @@ -144,14 +146,16 @@ int ksmbd_vfs_set_sd_xattr(struct ksmbd_conn *conn, struct mnt_idmap *idmap, const struct path *path, - struct smb_ntsd *pntsd, int len); + struct smb_ntsd *pntsd, int len, + bool get_write); int ksmbd_vfs_get_sd_xattr(struct ksmbd_conn *conn, struct mnt_idmap *idmap, struct dentry *dentry, struct smb_ntsd **pntsd); int ksmbd_vfs_set_dos_attrib_xattr(struct mnt_idmap *idmap, const struct path *path, - struct xattr_dos_attrib *da); + struct xattr_dos_attrib *da, + bool get_write); int ksmbd_vfs_get_dos_attrib_xattr(struct mnt_idmap *idmap, struct dentry *dentry, struct xattr_dos_attrib *da); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/stat.c +++ linux-aws-6.5-6.5.0/fs/stat.c @@ -131,7 +131,8 @@ idmap = mnt_idmap(path->mnt); if (inode->i_op->getattr) return inode->i_op->getattr(idmap, path, stat, - request_mask, query_flags); + request_mask, + query_flags | AT_GETATTR_NOSEC); generic_fillattr(idmap, inode, stat); return 0; @@ -164,6 +165,9 @@ { int retval; + if (WARN_ON_ONCE(query_flags & AT_GETATTR_NOSEC)) + return -EPERM; + retval = security_inode_getattr(path); if (retval) return retval; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/fs/xfs/xfs_inode_item_recover.c +++ linux-aws-6.5-6.5.0/fs/xfs/xfs_inode_item_recover.c @@ -369,24 +369,26 @@ * superblock flag to determine whether we need to look at di_flushiter * to skip replay when the on disk inode is newer than the log one */ - if (!xfs_has_v3inodes(mp) && - ldip->di_flushiter < be16_to_cpu(dip->di_flushiter)) { - /* - * Deal with the wrap case, DI_MAX_FLUSH is less - * than smaller numbers - */ - if (be16_to_cpu(dip->di_flushiter) == DI_MAX_FLUSH && - ldip->di_flushiter < (DI_MAX_FLUSH >> 1)) { - /* do nothing */ - } else { - trace_xfs_log_recover_inode_skip(log, in_f); - error = 0; - goto out_release; + if (!xfs_has_v3inodes(mp)) { + if (ldip->di_flushiter < be16_to_cpu(dip->di_flushiter)) { + /* + * Deal with the wrap case, DI_MAX_FLUSH is less + * than smaller numbers + */ + if (be16_to_cpu(dip->di_flushiter) == DI_MAX_FLUSH && + ldip->di_flushiter < (DI_MAX_FLUSH >> 1)) { + /* do nothing */ + } else { + trace_xfs_log_recover_inode_skip(log, in_f); + error = 0; + goto out_release; + } } + + /* Take the opportunity to reset the flush iteration count */ + ldip->di_flushiter = 0; } - /* Take the opportunity to reset the flush iteration count */ - ldip->di_flushiter = 0; if (unlikely(S_ISREG(ldip->di_mode))) { if ((ldip->di_format != XFS_DINODE_FMT_EXTENTS) && only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/acpi/ghes.h +++ linux-aws-6.5-6.5.0/include/acpi/ghes.h @@ -73,8 +73,12 @@ void ghes_unregister_vendor_record_notifier(struct notifier_block *nb); struct list_head *ghes_get_devices(void); + +void ghes_estatus_pool_region_free(unsigned long addr, u32 size); #else static inline struct list_head *ghes_get_devices(void) { return NULL; } + +static inline void ghes_estatus_pool_region_free(unsigned long addr, u32 size) { return; } #endif int ghes_estatus_pool_init(unsigned int num_ghes); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/drm/bridge/samsung-dsim.h +++ linux-aws-6.5-6.5.0/include/drm/bridge/samsung-dsim.h @@ -53,6 +53,7 @@ unsigned int plltmr_reg; unsigned int has_freqband:1; unsigned int has_clklane_stop:1; + unsigned int has_broken_fifoctrl_emptyhdr:1; unsigned int num_clks; unsigned int min_freq; unsigned int max_freq; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/drm/drm_atomic_helper.h +++ linux-aws-6.5-6.5.0/include/drm/drm_atomic_helper.h @@ -97,6 +97,8 @@ int drm_atomic_helper_prepare_planes(struct drm_device *dev, struct drm_atomic_state *state); +void drm_atomic_helper_unprepare_planes(struct drm_device *dev, + struct drm_atomic_state *state); #define DRM_PLANE_COMMIT_ACTIVE_ONLY BIT(0) #define DRM_PLANE_COMMIT_NO_DISABLE_AFTER_MODESET BIT(1) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/drm/gpu_scheduler.h +++ linux-aws-6.5-6.5.0/include/drm/gpu_scheduler.h @@ -68,8 +68,7 @@ DRM_SCHED_PRIORITY_HIGH, DRM_SCHED_PRIORITY_KERNEL, - DRM_SCHED_PRIORITY_COUNT, - DRM_SCHED_PRIORITY_UNSET = -2 + DRM_SCHED_PRIORITY_COUNT }; /* Used to chose between FIFO and RR jobs scheduling */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/amd-pstate.h +++ linux-aws-6.5-6.5.0/include/linux/amd-pstate.h @@ -70,6 +70,10 @@ u32 nominal_perf; u32 lowest_nonlinear_perf; u32 lowest_perf; + u32 min_limit_perf; + u32 max_limit_perf; + u32 min_limit_freq; + u32 max_limit_freq; u32 max_freq; u32 min_freq; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/clk-provider.h +++ linux-aws-6.5-6.5.0/include/linux/clk-provider.h @@ -74,7 +74,7 @@ unsigned long parent_rate); /** - * struct clk_duty - Struture encoding the duty cycle ratio of a clock + * struct clk_duty - Structure encoding the duty cycle ratio of a clock * * @num: Numerator of the duty cycle ratio * @den: Denominator of the duty cycle ratio @@ -129,7 +129,7 @@ * @restore_context: Restore the context of the clock after a restoration * of power. * - * @recalc_rate Recalculate the rate of this clock, by querying hardware. The + * @recalc_rate: Recalculate the rate of this clock, by querying hardware. The * parent rate is an input parameter. It is up to the caller to * ensure that the prepare_mutex is held across this call. If the * driver cannot figure out a rate for this clock, it must return @@ -456,7 +456,7 @@ * clock with the clock framework * @dev: device that is registering this clock * @name: name of this clock - * @parent_name: name of clock's parent + * @parent_data: name of clock's parent * @flags: framework-specific flags * @fixed_rate: non-adjustable clock rate * @fixed_accuracy: non-adjustable clock accuracy @@ -471,7 +471,7 @@ * the clock framework * @dev: device that is registering this clock * @name: name of this clock - * @parent_name: name of clock's parent + * @parent_data: name of clock's parent * @flags: framework-specific flags * @fixed_rate: non-adjustable clock rate */ @@ -649,7 +649,7 @@ * Clock with an adjustable divider affecting its output frequency. Implements * .recalc_rate, .set_rate and .round_rate * - * Flags: + * @flags: * CLK_DIVIDER_ONE_BASED - by default the divisor is the value read from the * register plus one. If CLK_DIVIDER_ONE_BASED is set then the divider is * the raw value read from the register, with the value of zero considered @@ -1130,11 +1130,12 @@ * @mwidth: width of the numerator bit field * @nshift: shift to the denominator bit field * @nwidth: width of the denominator bit field + * @approximation: clk driver's callback for calculating the divider clock * @lock: register lock * * Clock with adjustable fractional divider affecting its output frequency. * - * Flags: + * @flags: * CLK_FRAC_DIVIDER_ZERO_BASED - by default the numerator and denominator * is the value read from the register. If CLK_FRAC_DIVIDER_ZERO_BASED * is set then the numerator and denominator are both the value read @@ -1191,7 +1192,7 @@ * Clock with an adjustable multiplier affecting its output frequency. * Implements .recalc_rate, .set_rate and .round_rate * - * Flags: + * @flags: * CLK_MULTIPLIER_ZERO_BYPASS - By default, the multiplier is the value read * from the register, with 0 being a valid value effectively * zeroing the output clock rate. If CLK_MULTIPLIER_ZERO_BYPASS is only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/cpuhotplug.h +++ linux-aws-6.5-6.5.0/include/linux/cpuhotplug.h @@ -190,10 +190,12 @@ /* Must be the last timer callback */ CPUHP_AP_DUMMY_TIMER_STARTING, CPUHP_AP_ARM_XEN_STARTING, + CPUHP_AP_ARM_XEN_RUNSTATE_STARTING, CPUHP_AP_ARM_CORESIGHT_STARTING, CPUHP_AP_ARM_CORESIGHT_CTI_STARTING, CPUHP_AP_ARM64_ISNDEP_STARTING, CPUHP_AP_SMPCFD_DYING, + CPUHP_AP_HRTIMERS_DYING, CPUHP_AP_X86_TBOOT_DYING, CPUHP_AP_ARM_CACHE_B15_RAC_DYING, CPUHP_AP_ONLINE, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/damon.h +++ linux-aws-6.5-6.5.0/include/linux/damon.h @@ -626,6 +626,13 @@ return ctx->ops.id == DAMON_OPS_VADDR || ctx->ops.id == DAMON_OPS_FVADDR; } +static inline unsigned int damon_max_nr_accesses(const struct damon_attrs *attrs) +{ + /* {aggr,sample}_interval are unsigned long, hence could overflow */ + return min(attrs->aggr_interval / attrs->sample_interval, + (unsigned long)UINT_MAX); +} + int damon_start(struct damon_ctx **ctxs, int nr_ctxs, bool exclusive); int damon_stop(struct damon_ctx **ctxs, int nr_ctxs); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/ethtool.h +++ linux-aws-6.5-6.5.0/include/linux/ethtool.h @@ -1045,10 +1045,10 @@ /** * ethtool_sprintf - Write formatted string to ethtool string data - * @data: Pointer to start of string to update + * @data: Pointer to a pointer to the start of string to update * @fmt: Format of string to write * - * Write formatted string to data. Update data to point at start of + * Write formatted string to *data. Update *data to point at start of * next string. */ extern __printf(2, 3) void ethtool_sprintf(u8 **data, const char *fmt, ...); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/f2fs_fs.h +++ linux-aws-6.5-6.5.0/include/linux/f2fs_fs.h @@ -104,6 +104,7 @@ ERROR_CORRUPTED_VERITY_XATTR, ERROR_CORRUPTED_XATTR, ERROR_INVALID_NODE_REFERENCE, + ERROR_INCONSISTENT_NAT, ERROR_MAX, }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/generic-radix-tree.h +++ linux-aws-6.5-6.5.0/include/linux/generic-radix-tree.h @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -184,6 +185,12 @@ static inline void __genradix_iter_advance(struct genradix_iter *iter, size_t obj_size) { + if (iter->offset + obj_size < iter->offset) { + iter->offset = SIZE_MAX; + iter->pos = SIZE_MAX; + return; + } + iter->offset += obj_size; if (!is_power_of_2(obj_size) && only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/hisi_acc_qm.h +++ linux-aws-6.5-6.5.0/include/linux/hisi_acc_qm.h @@ -144,6 +144,13 @@ QM_NOT_READY, }; +enum qm_misc_ctl_bits { + QM_DRIVER_REMOVING = 0x0, + QM_RST_SCHED, + QM_RESETTING, + QM_MODULE_PARAM, +}; + enum qm_cap_bits { QM_SUPPORT_DB_ISOLATION = 0x0, QM_SUPPORT_FUNC_QOS, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/hrtimer.h +++ linux-aws-6.5-6.5.0/include/linux/hrtimer.h @@ -531,9 +531,9 @@ int hrtimers_prepare_cpu(unsigned int cpu); #ifdef CONFIG_HOTPLUG_CPU -int hrtimers_dead_cpu(unsigned int cpu); +int hrtimers_cpu_dying(unsigned int cpu); #else -#define hrtimers_dead_cpu NULL +#define hrtimers_cpu_dying NULL #endif #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/hugetlb.h +++ linux-aws-6.5-6.5.0/include/linux/hugetlb.h @@ -58,6 +58,7 @@ long adds_in_progress; struct list_head region_cache; long region_cache_count; + struct rw_semaphore rw_sema; #ifdef CONFIG_CGROUP_HUGETLB /* * On private mappings, the counter to uncharge reservations is stored @@ -1245,6 +1246,8 @@ return (vma->vm_flags & VM_MAYSHARE) && vma->vm_private_data; } +bool __vma_private_lock(struct vm_area_struct *vma); + /* * Safe version of huge_pte_offset() to check the locks. See comments * above huge_pte_offset(). only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/hw_random.h +++ linux-aws-6.5-6.5.0/include/linux/hw_random.h @@ -63,5 +63,6 @@ extern void devm_hwrng_unregister(struct device *dve, struct hwrng *rng); extern long hwrng_msleep(struct hwrng *rng, unsigned int msecs); +extern long hwrng_yield(struct hwrng *rng); #endif /* LINUX_HWRANDOM_H_ */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/idr.h +++ linux-aws-6.5-6.5.0/include/linux/idr.h @@ -200,7 +200,7 @@ */ #define idr_for_each_entry_ul(idr, entry, tmp, id) \ for (tmp = 0, id = 0; \ - tmp <= id && ((entry) = idr_get_next_ul(idr, &(id))) != NULL; \ + ((entry) = tmp <= id ? idr_get_next_ul(idr, &(id)) : NULL) != NULL; \ tmp = id, ++id) /** @@ -224,10 +224,12 @@ * @id: Entry ID. * * Continue to iterate over entries, continuing after the current position. + * After normal termination @entry is left with the value NULL. This + * is convenient for a "not found" value. */ #define idr_for_each_entry_continue_ul(idr, entry, tmp, id) \ for (tmp = id; \ - tmp <= id && ((entry) = idr_get_next_ul(idr, &(id))) != NULL; \ + ((entry) = tmp <= id ? idr_get_next_ul(idr, &(id)) : NULL) != NULL; \ tmp = id, ++id) /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/ieee80211.h +++ linux-aws-6.5-6.5.0/include/linux/ieee80211.h @@ -4237,6 +4237,35 @@ } /** + * ieee80211_is_protected_dual_of_public_action - check if skb contains a + * protected dual of public action management frame + * @skb: the skb containing the frame, length will be checked + * + * Return: true if the skb contains a protected dual of public action + * management frame, false otherwise. + */ +static inline bool +ieee80211_is_protected_dual_of_public_action(struct sk_buff *skb) +{ + u8 action; + + if (!ieee80211_is_public_action((void *)skb->data, skb->len) || + skb->len < IEEE80211_MIN_ACTION_SIZE + 1) + return false; + + action = *(u8 *)(skb->data + IEEE80211_MIN_ACTION_SIZE); + + return action != WLAN_PUB_ACTION_20_40_BSS_COEX && + action != WLAN_PUB_ACTION_DSE_REG_LOC_ANN && + action != WLAN_PUB_ACTION_MSMT_PILOT && + action != WLAN_PUB_ACTION_TDLS_DISCOVER_RES && + action != WLAN_PUB_ACTION_LOC_TRACK_NOTI && + action != WLAN_PUB_ACTION_FTM_REQUEST && + action != WLAN_PUB_ACTION_FTM_RESPONSE && + action != WLAN_PUB_ACTION_FILS_DISCOVERY; +} + +/** * _ieee80211_is_group_privacy_action - check if frame is a group addressed * privacy action frame * @hdr: the frame only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/iommu.h +++ linux-aws-6.5-6.5.0/include/linux/iommu.h @@ -703,6 +703,7 @@ dev->iommu->priv = priv; } +extern struct mutex iommu_probe_device_lock; int iommu_probe_device(struct device *dev); int iommu_dev_enable_feature(struct device *dev, enum iommu_dev_features f); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/kasan.h +++ linux-aws-6.5-6.5.0/include/linux/kasan.h @@ -464,10 +464,10 @@ #endif /* (CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS) && !CONFIG_KASAN_VMALLOC */ -#ifdef CONFIG_KASAN_INLINE +#ifdef CONFIG_KASAN void kasan_non_canonical_hook(unsigned long addr); -#else /* CONFIG_KASAN_INLINE */ +#else /* CONFIG_KASAN */ static inline void kasan_non_canonical_hook(unsigned long addr) { } -#endif /* CONFIG_KASAN_INLINE */ +#endif /* CONFIG_KASAN */ #endif /* LINUX_KASAN_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/kprobes.h +++ linux-aws-6.5-6.5.0/include/linux/kprobes.h @@ -140,7 +140,7 @@ * */ struct kretprobe_holder { - struct kretprobe *rp; + struct kretprobe __rcu *rp; refcount_t ref; }; @@ -202,10 +202,8 @@ #ifdef CONFIG_KRETPROBE_ON_RETHOOK static nokprobe_inline struct kretprobe *get_kretprobe(struct kretprobe_instance *ri) { - RCU_LOCKDEP_WARN(!rcu_read_lock_any_held(), - "Kretprobe is accessed from instance under preemptive context"); - - return (struct kretprobe *)READ_ONCE(ri->node.rethook->data); + /* rethook::data is non-changed field, so that you can access it freely. */ + return (struct kretprobe *)ri->node.rethook->data; } static nokprobe_inline unsigned long get_kretprobe_retaddr(struct kretprobe_instance *ri) { @@ -250,10 +248,7 @@ static nokprobe_inline struct kretprobe *get_kretprobe(struct kretprobe_instance *ri) { - RCU_LOCKDEP_WARN(!rcu_read_lock_any_held(), - "Kretprobe is accessed from instance under preemptive context"); - - return READ_ONCE(ri->rph->rp); + return rcu_dereference_check(ri->rph->rp, rcu_read_lock_any_held()); } static nokprobe_inline unsigned long get_kretprobe_retaddr(struct kretprobe_instance *ri) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/mfd/core.h +++ linux-aws-6.5-6.5.0/include/linux/mfd/core.h @@ -92,7 +92,7 @@ * (above) when matching OF nodes with devices that have identical * compatible strings */ - const u64 of_reg; + u64 of_reg; /* Set to 'true' to use 'of_reg' (above) - allows for of_reg=0 */ bool use_of_reg; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/mmc/card.h +++ linux-aws-6.5-6.5.0/include/linux/mmc/card.h @@ -295,7 +295,9 @@ #define MMC_QUIRK_BROKEN_HPI (1<<13) /* Disable broken HPI support */ #define MMC_QUIRK_BROKEN_SD_DISCARD (1<<14) /* Disable broken SD discard support */ #define MMC_QUIRK_BROKEN_SD_CACHE (1<<15) /* Disable broken SD cache support */ +#define MMC_QUIRK_BROKEN_CACHE_FLUSH (1<<16) /* Don't flush cache until the write has occurred */ + bool written_flag; /* Indicates eMMC has been written since power on */ bool reenable_cmdq; /* Re-enable Command Queue */ unsigned int erase_size; /* erase size in sectors */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/msi.h +++ linux-aws-6.5-6.5.0/include/linux/msi.h @@ -547,12 +547,6 @@ MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS = (1 << 5), /* Free MSI descriptors */ MSI_FLAG_FREE_MSI_DESCS = (1 << 6), - /* - * Quirk to handle MSI implementations which do not provide - * masking. Currently known to affect x86, but has to be partially - * handled in the core MSI code. - */ - MSI_FLAG_NOMASK_QUIRK = (1 << 7), /* Mask for the generic functionality */ MSI_GENERIC_FLAGS_MASK = GENMASK(15, 0), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/mtd/jedec.h +++ linux-aws-6.5-6.5.0/include/linux/mtd/jedec.h @@ -21,6 +21,9 @@ /* JEDEC features */ #define JEDEC_FEATURE_16_BIT_BUS (1 << 0) +/* JEDEC Optional Commands */ +#define JEDEC_OPT_CMD_READ_CACHE BIT(1) + struct nand_jedec_params { /* rev info and features block */ /* 'J' 'E' 'S' 'D' */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/mtd/onfi.h +++ linux-aws-6.5-6.5.0/include/linux/mtd/onfi.h @@ -55,6 +55,7 @@ #define ONFI_SUBFEATURE_PARAM_LEN 4 /* ONFI optional commands SET/GET FEATURES supported? */ +#define ONFI_OPT_CMD_READ_CACHE BIT(1) #define ONFI_OPT_CMD_SET_GET_FEATURES BIT(2) struct nand_onfi_params { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/mtd/rawnand.h +++ linux-aws-6.5-6.5.0/include/linux/mtd/rawnand.h @@ -225,6 +225,7 @@ * struct nand_parameters - NAND generic parameters from the parameter page * @model: Model name * @supports_set_get_features: The NAND chip supports setting/getting features + * @supports_read_cache: The NAND chip supports read cache operations * @set_feature_list: Bitmap of features that can be set * @get_feature_list: Bitmap of features that can be get * @onfi: ONFI specific parameters @@ -233,6 +234,7 @@ /* Generic parameters */ const char *model; bool supports_set_get_features; + bool supports_read_cache; DECLARE_BITMAP(set_feature_list, ONFI_FEATURE_NUMBER); DECLARE_BITMAP(get_feature_list, ONFI_FEATURE_NUMBER); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/netdevice.h +++ linux-aws-6.5-6.5.0/include/linux/netdevice.h @@ -1783,6 +1783,13 @@ ML_PRIV_CAN, }; +enum netdev_stat_type { + NETDEV_PCPU_STAT_NONE, + NETDEV_PCPU_STAT_LSTATS, /* struct pcpu_lstats */ + NETDEV_PCPU_STAT_TSTATS, /* struct pcpu_sw_netstats */ + NETDEV_PCPU_STAT_DSTATS, /* struct pcpu_dstats */ +}; + /** * struct net_device - The DEVICE structure. * @@ -1979,10 +1986,14 @@ * * @ml_priv: Mid-layer private * @ml_priv_type: Mid-layer private type - * @lstats: Loopback statistics - * @tstats: Tunnel statistics - * @dstats: Dummy statistics - * @vstats: Virtual ethernet statistics + * + * @pcpu_stat_type: Type of device statistics which the core should + * allocate/free: none, lstats, tstats, dstats. none + * means the driver is handling statistics allocation/ + * freeing internally. + * @lstats: Loopback statistics: packets, bytes + * @tstats: Tunnel statistics: RX/TX packets, RX/TX bytes + * @dstats: Dummy statistics: RX/TX/drop packets, RX/TX bytes * * @garp_port: GARP * @mrp_port: MRP @@ -2337,6 +2348,7 @@ void *ml_priv; enum netdev_ml_priv_type ml_priv_type; + enum netdev_stat_type pcpu_stat_type:8; union { struct pcpu_lstats __percpu *lstats; struct pcpu_sw_netstats __percpu *tstats; @@ -2734,6 +2746,16 @@ struct u64_stats_sync syncp; } __aligned(4 * sizeof(u64)); +struct pcpu_dstats { + u64 rx_packets; + u64 rx_bytes; + u64 rx_drops; + u64 tx_packets; + u64 tx_bytes; + u64 tx_drops; + struct u64_stats_sync syncp; +} __aligned(8 * sizeof(u64)); + struct pcpu_lstats { u64_stats_t packets; u64_stats_t bytes; @@ -5230,5 +5252,6 @@ #define DEV_STATS_INC(DEV, FIELD) atomic_long_inc(&(DEV)->stats.__##FIELD) #define DEV_STATS_ADD(DEV, FIELD, VAL) \ atomic_long_add((VAL), &(DEV)->stats.__##FIELD) +#define DEV_STATS_READ(DEV, FIELD) atomic_long_read(&(DEV)->stats.__##FIELD) #endif /* _LINUX_NETDEVICE_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/numa.h +++ linux-aws-6.5-6.5.0/include/linux/numa.h @@ -12,6 +12,7 @@ #define MAX_NUMNODES (1 << NODES_SHIFT) #define NUMA_NO_NODE (-1) +#define NUMA_NO_MEMBLK (-1) /* optionally keep NUMA memory info available post init */ #ifdef CONFIG_NUMA_KEEP_MEMINFO @@ -25,7 +26,7 @@ #include /* Generic implementation available */ -int numa_map_to_online_node(int node); +int numa_nearest_node(int node, unsigned int state); #ifndef memory_add_physaddr_to_nid static inline int memory_add_physaddr_to_nid(u64 start) @@ -43,11 +44,18 @@ return 0; } #endif +#ifndef numa_fill_memblks +static inline int __init numa_fill_memblks(u64 start, u64 end) +{ + return NUMA_NO_MEMBLK; +} +#endif #else /* !CONFIG_NUMA */ -static inline int numa_map_to_online_node(int node) +static inline int numa_nearest_node(int node, unsigned int state) { return NUMA_NO_NODE; } + static inline int memory_add_physaddr_to_nid(u64 start) { return 0; @@ -58,6 +66,8 @@ } #endif +#define numa_map_to_online_node(node) numa_nearest_node(node, N_ONLINE) + #ifdef CONFIG_HAVE_ARCH_NODE_DEV_GROUP extern const struct attribute_group arch_node_dev_group; #endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/objtool.h +++ linux-aws-6.5-6.5.0/include/linux/objtool.h @@ -130,7 +130,8 @@ * it will be ignored. */ .macro VALIDATE_UNRET_BEGIN -#if defined(CONFIG_NOINSTR_VALIDATION) && defined(CONFIG_CPU_UNRET_ENTRY) +#if defined(CONFIG_NOINSTR_VALIDATION) && \ + (defined(CONFIG_CPU_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO)) .Lhere_\@: .pushsection .discard.validate_unret .long .Lhere_\@ - . only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/pagemap.h +++ linux-aws-6.5-6.5.0/include/linux/pagemap.h @@ -203,6 +203,8 @@ /* writeback related tags are not used */ AS_NO_WRITEBACK_TAGS = 5, AS_LARGE_FOLIO_SUPPORT = 6, + AS_STABLE_WRITES, /* must wait for writeback before modifying + folio contents */ }; /** @@ -273,6 +275,21 @@ return !test_bit(AS_NO_WRITEBACK_TAGS, &mapping->flags); } +static inline bool mapping_stable_writes(const struct address_space *mapping) +{ + return test_bit(AS_STABLE_WRITES, &mapping->flags); +} + +static inline void mapping_set_stable_writes(struct address_space *mapping) +{ + set_bit(AS_STABLE_WRITES, &mapping->flags); +} + +static inline void mapping_clear_stable_writes(struct address_space *mapping) +{ + clear_bit(AS_STABLE_WRITES, &mapping->flags); +} + static inline gfp_t mapping_gfp_mask(struct address_space * mapping) { return mapping->gfp_mask; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/pm.h +++ linux-aws-6.5-6.5.0/include/linux/pm.h @@ -374,24 +374,39 @@ RUNTIME_PM_OPS(runtime_suspend_fn, runtime_resume_fn, idle_fn) \ } -#ifdef CONFIG_PM -#define _EXPORT_DEV_PM_OPS(name, license, ns) \ +#define _EXPORT_PM_OPS(name, license, ns) \ const struct dev_pm_ops name; \ __EXPORT_SYMBOL(name, license, ns); \ const struct dev_pm_ops name -#define EXPORT_PM_FN_GPL(name) EXPORT_SYMBOL_GPL(name) -#define EXPORT_PM_FN_NS_GPL(name, ns) EXPORT_SYMBOL_NS_GPL(name, ns) -#else -#define _EXPORT_DEV_PM_OPS(name, license, ns) \ + +#define _DISCARD_PM_OPS(name, license, ns) \ static __maybe_unused const struct dev_pm_ops __static_##name + +#ifdef CONFIG_PM +#define _EXPORT_DEV_PM_OPS(name, license, ns) _EXPORT_PM_OPS(name, license, ns) +#define EXPORT_PM_FN_GPL(name) EXPORT_SYMBOL_GPL(name) +#define EXPORT_PM_FN_NS_GPL(name, ns) EXPORT_SYMBOL_NS_GPL(name, ns) +#else +#define _EXPORT_DEV_PM_OPS(name, license, ns) _DISCARD_PM_OPS(name, license, ns) #define EXPORT_PM_FN_GPL(name) #define EXPORT_PM_FN_NS_GPL(name, ns) #endif -#define EXPORT_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "", "") -#define EXPORT_GPL_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "GPL", "") -#define EXPORT_NS_DEV_PM_OPS(name, ns) _EXPORT_DEV_PM_OPS(name, "", #ns) -#define EXPORT_NS_GPL_DEV_PM_OPS(name, ns) _EXPORT_DEV_PM_OPS(name, "GPL", #ns) +#ifdef CONFIG_PM_SLEEP +#define _EXPORT_DEV_SLEEP_PM_OPS(name, license, ns) _EXPORT_PM_OPS(name, license, ns) +#else +#define _EXPORT_DEV_SLEEP_PM_OPS(name, license, ns) _DISCARD_PM_OPS(name, license, ns) +#endif + +#define EXPORT_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "", "") +#define EXPORT_GPL_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "GPL", "") +#define EXPORT_NS_DEV_PM_OPS(name, ns) _EXPORT_DEV_PM_OPS(name, "", #ns) +#define EXPORT_NS_GPL_DEV_PM_OPS(name, ns) _EXPORT_DEV_PM_OPS(name, "GPL", #ns) + +#define EXPORT_DEV_SLEEP_PM_OPS(name) _EXPORT_DEV_SLEEP_PM_OPS(name, "", "") +#define EXPORT_GPL_DEV_SLEEP_PM_OPS(name) _EXPORT_DEV_SLEEP_PM_OPS(name, "GPL", "") +#define EXPORT_NS_DEV_SLEEP_PM_OPS(name, ns) _EXPORT_DEV_SLEEP_PM_OPS(name, "", #ns) +#define EXPORT_NS_GPL_DEV_SLEEP_PM_OPS(name, ns) _EXPORT_DEV_SLEEP_PM_OPS(name, "GPL", #ns) /* * Use this if you want to use the same suspend and resume callbacks for suspend @@ -404,19 +419,19 @@ _DEFINE_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL) #define EXPORT_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ - EXPORT_DEV_PM_OPS(name) = { \ + EXPORT_DEV_SLEEP_PM_OPS(name) = { \ SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ } #define EXPORT_GPL_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ - EXPORT_GPL_DEV_PM_OPS(name) = { \ + EXPORT_GPL_DEV_SLEEP_PM_OPS(name) = { \ SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ } #define EXPORT_NS_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn, ns) \ - EXPORT_NS_DEV_PM_OPS(name, ns) = { \ + EXPORT_NS_DEV_SLEEP_PM_OPS(name, ns) = { \ SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ } #define EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn, ns) \ - EXPORT_NS_GPL_DEV_PM_OPS(name, ns) = { \ + EXPORT_NS_GPL_DEV_SLEEP_PM_OPS(name, ns) = { \ SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/preempt.h +++ linux-aws-6.5-6.5.0/include/linux/preempt.h @@ -99,14 +99,21 @@ return level; } +/* + * These macro definitions avoid redundant invocations of preempt_count() + * because such invocations would result in redundant loads given that + * preempt_count() is commonly implemented with READ_ONCE(). + */ + #define nmi_count() (preempt_count() & NMI_MASK) #define hardirq_count() (preempt_count() & HARDIRQ_MASK) #ifdef CONFIG_PREEMPT_RT # define softirq_count() (current->softirq_disable_cnt & SOFTIRQ_MASK) +# define irq_count() ((preempt_count() & (NMI_MASK | HARDIRQ_MASK)) | softirq_count()) #else # define softirq_count() (preempt_count() & SOFTIRQ_MASK) +# define irq_count() (preempt_count() & (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_MASK)) #endif -#define irq_count() (nmi_count() | hardirq_count() | softirq_count()) /* * Macros to retrieve the current execution context: @@ -119,7 +126,11 @@ #define in_nmi() (nmi_count()) #define in_hardirq() (hardirq_count()) #define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET) -#define in_task() (!(in_nmi() | in_hardirq() | in_serving_softirq())) +#ifdef CONFIG_PREEMPT_RT +# define in_task() (!((preempt_count() & (NMI_MASK | HARDIRQ_MASK)) | in_serving_softirq())) +#else +# define in_task() (!(preempt_count() & (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET))) +#endif /* * The following macros are deprecated and should not be used in new code: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/pwm.h +++ linux-aws-6.5-6.5.0/include/linux/pwm.h @@ -41,8 +41,8 @@ }; enum { - PWMF_REQUESTED = 1 << 0, - PWMF_EXPORTED = 1 << 1, + PWMF_REQUESTED = 0, + PWMF_EXPORTED = 1, }; /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/rethook.h +++ linux-aws-6.5-6.5.0/include/linux/rethook.h @@ -29,7 +29,12 @@ */ struct rethook { void *data; - rethook_handler_t handler; + /* + * To avoid sparse warnings, this uses a raw function pointer with + * __rcu, instead of rethook_handler_t. But this must be same as + * rethook_handler_t. + */ + void (__rcu *handler) (struct rethook_node *, void *, unsigned long, struct pt_regs *); struct freelist_head pool; refcount_t ref; struct rcu_head rcu; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/sched/coredump.h +++ linux-aws-6.5-6.5.0/include/linux/sched/coredump.h @@ -91,4 +91,14 @@ MMF_DISABLE_THP_MASK | MMF_HAS_MDWE_MASK) #define MMF_VM_MERGE_ANY 29 +#define MMF_HAS_MDWE_NO_INHERIT 30 + +static inline unsigned long mmf_init_flags(unsigned long flags) +{ + if (flags & (1UL << MMF_HAS_MDWE_NO_INHERIT)) + flags &= ~((1UL << MMF_HAS_MDWE) | + (1UL << MMF_HAS_MDWE_NO_INHERIT)); + return flags & MMF_INIT_MASK; +} + #endif /* _LINUX_SCHED_COREDUMP_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/scmi_protocol.h +++ linux-aws-6.5-6.5.0/include/linux/scmi_protocol.h @@ -97,10 +97,17 @@ u32 clk_id); }; +struct scmi_perf_domain_info { + char name[SCMI_MAX_STR_SIZE]; + bool set_perf; +}; + /** * struct scmi_perf_proto_ops - represents the various operations provided * by SCMI Performance Protocol * + * @num_domains_get: gets the number of supported performance domains + * @info_get: get the information of a performance domain * @limits_set: sets limits on the performance level of a domain * @limits_get: gets limits on the performance level of a domain * @level_set: sets the performance level of a domain @@ -120,6 +127,9 @@ * or in some other (abstract) scale */ struct scmi_perf_proto_ops { + int (*num_domains_get)(const struct scmi_protocol_handle *ph); + const struct scmi_perf_domain_info __must_check *(*info_get) + (const struct scmi_protocol_handle *ph, u32 domain); int (*limits_set)(const struct scmi_protocol_handle *ph, u32 domain, u32 max_perf, u32 min_perf); int (*limits_get)(const struct scmi_protocol_handle *ph, u32 domain, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/skmsg.h +++ linux-aws-6.5-6.5.0/include/linux/skmsg.h @@ -106,6 +106,7 @@ struct mutex work_mutex; struct sk_psock_work_state work_state; struct delayed_work work; + struct sock *sk_pair; struct rcu_work rwork; }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/socket.h +++ linux-aws-6.5-6.5.0/include/linux/socket.h @@ -383,6 +383,7 @@ #define SOL_MPTCP 284 #define SOL_MCTP 285 #define SOL_SMC 286 +#define SOL_VSOCK 287 /* IPX options */ #define IPX_TYPE 1 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/spi/spi.h +++ linux-aws-6.5-6.5.0/include/linux/spi/spi.h @@ -564,6 +564,7 @@ #define SPI_CONTROLLER_MUST_TX BIT(4) /* Requires tx */ #define SPI_MASTER_GPIO_SS BIT(5) /* GPIO CS must select slave */ +#define SPI_CONTROLLER_SUSPENDED BIT(6) /* Currently suspended */ /* Flag indicating if the allocation of this struct is devres-managed */ bool devm_allocated; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/stmmac.h +++ linux-aws-6.5-6.5.0/include/linux/stmmac.h @@ -172,6 +172,7 @@ bool hs_enable; /* FPE handshake enable */ enum stmmac_fpe_state lp_fpe_state; /* Link Partner FPE state */ enum stmmac_fpe_state lo_fpe_state; /* Local station FPE state */ + u32 fpe_csr; /* MAC_FPE_CTRL_STS reg cache */ }; struct stmmac_safety_feature_cfg { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/string.h +++ linux-aws-6.5-6.5.0/include/linux/string.h @@ -5,7 +5,9 @@ #include /* for inline */ #include /* for size_t */ #include /* for NULL */ +#include /* for ERR_PTR() */ #include /* for E2BIG */ +#include /* for check_mul_overflow() */ #include #include @@ -14,6 +16,44 @@ extern void *vmemdup_user(const void __user *, size_t); extern void *memdup_user_nul(const void __user *, size_t); +/** + * memdup_array_user - duplicate array from user space + * @src: source address in user space + * @n: number of array members to copy + * @size: size of one array member + * + * Return: an ERR_PTR() on failure. Result is physically + * contiguous, to be freed by kfree(). + */ +static inline void *memdup_array_user(const void __user *src, size_t n, size_t size) +{ + size_t nbytes; + + if (check_mul_overflow(n, size, &nbytes)) + return ERR_PTR(-EOVERFLOW); + + return memdup_user(src, nbytes); +} + +/** + * vmemdup_array_user - duplicate array from user space + * @src: source address in user space + * @n: number of array members to copy + * @size: size of one array member + * + * Return: an ERR_PTR() on failure. Result may be not + * physically contiguous. Use kvfree() to free. + */ +static inline void *vmemdup_array_user(const void __user *src, size_t n, size_t size) +{ + size_t nbytes; + + if (check_mul_overflow(n, size, &nbytes)) + return ERR_PTR(-EOVERFLOW); + + return vmemdup_user(src, nbytes); +} + /* * Include machine specific inline routines */ @@ -277,10 +317,12 @@ */ #define strtomem_pad(dest, src, pad) do { \ const size_t _dest_len = __builtin_object_size(dest, 1); \ + const size_t _src_len = __builtin_object_size(src, 1); \ \ BUILD_BUG_ON(!__builtin_constant_p(_dest_len) || \ _dest_len == (size_t)-1); \ - memcpy_and_pad(dest, _dest_len, src, strnlen(src, _dest_len), pad); \ + memcpy_and_pad(dest, _dest_len, src, \ + strnlen(src, min(_src_len, _dest_len)), pad); \ } while (0) /** @@ -298,10 +340,11 @@ */ #define strtomem(dest, src) do { \ const size_t _dest_len = __builtin_object_size(dest, 1); \ + const size_t _src_len = __builtin_object_size(src, 1); \ \ BUILD_BUG_ON(!__builtin_constant_p(_dest_len) || \ _dest_len == (size_t)-1); \ - memcpy(dest, src, min(_dest_len, strnlen(src, _dest_len))); \ + memcpy(dest, src, strnlen(src, min(_src_len, _dest_len))); \ } while (0) /** only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/sunrpc/clnt.h +++ linux-aws-6.5-6.5.0/include/linux/sunrpc/clnt.h @@ -92,6 +92,7 @@ }; const struct cred *cl_cred; unsigned int cl_max_connect; /* max number of transports not to the same IP */ + struct super_block *pipefs_sb; }; /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/sysctl.h +++ linux-aws-6.5-6.5.0/include/linux/sysctl.h @@ -227,6 +227,7 @@ extern struct ctl_table_header *register_sysctl_mount_point(const char *path); void do_sysctl_args(void); +bool sysctl_is_alias(char *param); int do_proc_douintvec(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos, int (*conv)(unsigned long *lvalp, @@ -270,6 +271,11 @@ static inline void do_sysctl_args(void) { } + +static inline bool sysctl_is_alias(char *param) +{ + return false; +} #endif /* CONFIG_SYSCTL */ int sysctl_max_threads(struct ctl_table *table, int write, void *buffer, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/topology.h +++ linux-aws-6.5-6.5.0/include/linux/topology.h @@ -251,7 +251,7 @@ #else static __always_inline int sched_numa_find_nth_cpu(const struct cpumask *cpus, int cpu, int node) { - return cpumask_nth(cpu, cpus); + return cpumask_nth_and(cpu, cpus, cpu_online_mask); } static inline const struct cpumask * only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/torture.h +++ linux-aws-6.5-6.5.0/include/linux/torture.h @@ -81,7 +81,8 @@ } /* Definitions for high-resolution-timer sleeps. */ -int torture_hrtimeout_ns(ktime_t baset_ns, u32 fuzzt_ns, struct torture_random_state *trsp); +int torture_hrtimeout_ns(ktime_t baset_ns, u32 fuzzt_ns, const enum hrtimer_mode mode, + struct torture_random_state *trsp); int torture_hrtimeout_us(u32 baset_us, u32 fuzzt_ns, struct torture_random_state *trsp); int torture_hrtimeout_ms(u32 baset_ms, u32 fuzzt_us, struct torture_random_state *trsp); int torture_hrtimeout_jiffies(u32 baset_j, struct torture_random_state *trsp); @@ -108,12 +109,15 @@ bool torture_must_stop_irq(void); void torture_kthread_stopping(char *title); int _torture_create_kthread(int (*fn)(void *arg), void *arg, char *s, char *m, - char *f, struct task_struct **tp); + char *f, struct task_struct **tp, void (*cbf)(struct task_struct *tp)); void _torture_stop_kthread(char *m, struct task_struct **tp); #define torture_create_kthread(n, arg, tp) \ _torture_create_kthread(n, (arg), #n, "Creating " #n " task", \ - "Failed to create " #n, &(tp)) + "Failed to create " #n, &(tp), NULL) +#define torture_create_kthread_cb(n, arg, tp, cbf) \ + _torture_create_kthread(n, (arg), #n, "Creating " #n " task", \ + "Failed to create " #n, &(tp), cbf) #define torture_stop_kthread(n, tp) \ _torture_stop_kthread("Stopping " #n " task", &(tp)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/udp.h +++ linux-aws-6.5-6.5.0/include/linux/udp.h @@ -32,25 +32,30 @@ return (num + net_hash_mix(net)) & mask; } +enum { + UDP_FLAGS_CORK, /* Cork is required */ + UDP_FLAGS_NO_CHECK6_TX, /* Send zero UDP6 checksums on TX? */ + UDP_FLAGS_NO_CHECK6_RX, /* Allow zero UDP6 checksums on RX? */ + UDP_FLAGS_GRO_ENABLED, /* Request GRO aggregation */ + UDP_FLAGS_ACCEPT_FRAGLIST, + UDP_FLAGS_ACCEPT_L4, + UDP_FLAGS_ENCAP_ENABLED, /* This socket enabled encap */ + UDP_FLAGS_UDPLITE_SEND_CC, /* set via udplite setsockopt */ + UDP_FLAGS_UDPLITE_RECV_CC, /* set via udplite setsockopt */ +}; + struct udp_sock { /* inet_sock has to be the first member */ struct inet_sock inet; #define udp_port_hash inet.sk.__sk_common.skc_u16hashes[0] #define udp_portaddr_hash inet.sk.__sk_common.skc_u16hashes[1] #define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node + + unsigned long udp_flags; + int pending; /* Any pending frames ? */ - unsigned int corkflag; /* Cork is required */ __u8 encap_type; /* Is this an Encapsulation socket? */ - unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */ - no_check6_rx:1,/* Allow zero UDP6 checksums on RX? */ - encap_enabled:1, /* This socket enabled encap - * processing; UDP tunnels and - * different encapsulation layer set - * this - */ - gro_enabled:1, /* Request GRO aggregation */ - accept_udp_l4:1, - accept_udp_fraglist:1; + /* * Following member retains the information to create a UDP header * when the socket is uncorked. @@ -62,12 +67,6 @@ */ __u16 pcslen; __u16 pcrlen; -/* indicator bits used by pcflag: */ -#define UDPLITE_BIT 0x1 /* set by udplite proto init function */ -#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */ -#define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */ - __u8 pcflag; /* marks socket as UDP-Lite if > 0 */ - __u8 unused[3]; /* * For encapsulation sockets. */ @@ -95,28 +94,39 @@ int forward_threshold; }; +#define udp_test_bit(nr, sk) \ + test_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags) +#define udp_set_bit(nr, sk) \ + set_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags) +#define udp_test_and_set_bit(nr, sk) \ + test_and_set_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags) +#define udp_clear_bit(nr, sk) \ + clear_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags) +#define udp_assign_bit(nr, sk, val) \ + assign_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags, val) + #define UDP_MAX_SEGMENTS (1 << 6UL) #define udp_sk(ptr) container_of_const(ptr, struct udp_sock, inet.sk) static inline void udp_set_no_check6_tx(struct sock *sk, bool val) { - udp_sk(sk)->no_check6_tx = val; + udp_assign_bit(NO_CHECK6_TX, sk, val); } static inline void udp_set_no_check6_rx(struct sock *sk, bool val) { - udp_sk(sk)->no_check6_rx = val; + udp_assign_bit(NO_CHECK6_RX, sk, val); } -static inline bool udp_get_no_check6_tx(struct sock *sk) +static inline bool udp_get_no_check6_tx(const struct sock *sk) { - return udp_sk(sk)->no_check6_tx; + return udp_test_bit(NO_CHECK6_TX, sk); } -static inline bool udp_get_no_check6_rx(struct sock *sk) +static inline bool udp_get_no_check6_rx(const struct sock *sk) { - return udp_sk(sk)->no_check6_rx; + return udp_test_bit(NO_CHECK6_RX, sk); } static inline void udp_cmsg_recv(struct msghdr *msg, struct sock *sk, @@ -135,10 +145,12 @@ if (!skb_is_gso(skb)) return false; - if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4 && !udp_sk(sk)->accept_udp_l4) + if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4 && + !udp_test_bit(ACCEPT_L4, sk)) return true; - if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST && !udp_sk(sk)->accept_udp_fraglist) + if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST && + !udp_test_bit(ACCEPT_FRAGLIST, sk)) return true; return false; @@ -146,8 +158,8 @@ static inline void udp_allow_gso(struct sock *sk) { - udp_sk(sk)->accept_udp_l4 = 1; - udp_sk(sk)->accept_udp_fraglist = 1; + udp_set_bit(ACCEPT_L4, sk); + udp_set_bit(ACCEPT_FRAGLIST, sk); } #define udp_portaddr_for_each_entry(__sk, list) \ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/verification.h +++ linux-aws-6.5-6.5.0/include/linux/verification.h @@ -8,6 +8,7 @@ #ifndef _LINUX_VERIFICATION_H #define _LINUX_VERIFICATION_H +#include #include /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/virtio_net.h +++ linux-aws-6.5-6.5.0/include/linux/virtio_net.h @@ -3,8 +3,8 @@ #define _LINUX_VIRTIO_NET_H #include +#include #include -#include #include static inline bool virtio_net_hdr_match_proto(__be16 protocol, __u8 gso_type) @@ -151,9 +151,22 @@ unsigned int nh_off = p_off; struct skb_shared_info *shinfo = skb_shinfo(skb); - /* UFO may not include transport header in gso_size. */ - if (gso_type & SKB_GSO_UDP) + switch (gso_type & ~SKB_GSO_TCP_ECN) { + case SKB_GSO_UDP: + /* UFO may not include transport header in gso_size. */ nh_off -= thlen; + break; + case SKB_GSO_UDP_L4: + if (!(hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM)) + return -EINVAL; + if (skb->csum_offset != offsetof(struct udphdr, check)) + return -EINVAL; + if (skb->len - p_off > gso_size * UDP_MAX_SEGMENTS) + return -EINVAL; + if (gso_type != SKB_GSO_UDP_L4) + return -EINVAL; + break; + } /* Kernel has a special handling for GSO_BY_FRAGS. */ if (gso_size == GSO_BY_FRAGS) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/linux/workqueue.h +++ linux-aws-6.5-6.5.0/include/linux/workqueue.h @@ -222,18 +222,16 @@ * to generate better code. */ #ifdef CONFIG_LOCKDEP -#define __INIT_WORK(_work, _func, _onstack) \ +#define __INIT_WORK_KEY(_work, _func, _onstack, _key) \ do { \ - static struct lock_class_key __key; \ - \ __init_work((_work), _onstack); \ (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ - lockdep_init_map(&(_work)->lockdep_map, "(work_completion)"#_work, &__key, 0); \ + lockdep_init_map(&(_work)->lockdep_map, "(work_completion)"#_work, (_key), 0); \ INIT_LIST_HEAD(&(_work)->entry); \ (_work)->func = (_func); \ } while (0) #else -#define __INIT_WORK(_work, _func, _onstack) \ +#define __INIT_WORK_KEY(_work, _func, _onstack, _key) \ do { \ __init_work((_work), _onstack); \ (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ @@ -242,12 +240,22 @@ } while (0) #endif +#define __INIT_WORK(_work, _func, _onstack) \ + do { \ + static __maybe_unused struct lock_class_key __key; \ + \ + __INIT_WORK_KEY(_work, _func, _onstack, &__key); \ + } while (0) + #define INIT_WORK(_work, _func) \ __INIT_WORK((_work), (_func), 0) #define INIT_WORK_ONSTACK(_work, _func) \ __INIT_WORK((_work), (_func), 1) +#define INIT_WORK_ONSTACK_KEY(_work, _func, _key) \ + __INIT_WORK_KEY((_work), (_func), 1, _key) + #define __INIT_DELAYED_WORK(_work, _func, _tflags) \ do { \ INIT_WORK(&(_work)->work, (_func)); \ @@ -683,8 +691,32 @@ return fn(arg); } #else -long work_on_cpu(int cpu, long (*fn)(void *), void *arg); -long work_on_cpu_safe(int cpu, long (*fn)(void *), void *arg); +long work_on_cpu_key(int cpu, long (*fn)(void *), + void *arg, struct lock_class_key *key); +/* + * A new key is defined for each caller to make sure the work + * associated with the function doesn't share its locking class. + */ +#define work_on_cpu(_cpu, _fn, _arg) \ +({ \ + static struct lock_class_key __key; \ + \ + work_on_cpu_key(_cpu, _fn, _arg, &__key); \ +}) + +long work_on_cpu_safe_key(int cpu, long (*fn)(void *), + void *arg, struct lock_class_key *key); + +/* + * A new key is defined for each caller to make sure the work + * associated with the function doesn't share its locking class. + */ +#define work_on_cpu_safe(_cpu, _fn, _arg) \ +({ \ + static struct lock_class_key __key; \ + \ + work_on_cpu_safe_key(_cpu, _fn, _arg, &__key); \ +}) #endif /* CONFIG_SMP */ #ifdef CONFIG_FREEZER only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/net/af_unix.h +++ linux-aws-6.5-6.5.0/include/net/af_unix.h @@ -75,6 +75,7 @@ }; #define unix_sk(ptr) container_of_const(ptr, struct unix_sock, sk) +#define unix_peer(sk) (unix_sk(sk)->peer) #define peer_wait peer_wq.wait only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/net/bluetooth/hci_mon.h +++ linux-aws-6.5-6.5.0/include/net/bluetooth/hci_mon.h @@ -56,7 +56,7 @@ __u8 type; __u8 bus; bdaddr_t bdaddr; - char name[8]; + char name[8] __nonstring; } __packed; #define HCI_MON_NEW_INDEX_SIZE 16 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/net/flow.h +++ linux-aws-6.5-6.5.0/include/net/flow.h @@ -40,8 +40,8 @@ #define FLOWI_FLAG_KNOWN_NH 0x02 __u32 flowic_secid; kuid_t flowic_uid; - struct flowi_tunnel flowic_tun_key; __u32 flowic_multipath_hash; + struct flowi_tunnel flowic_tun_key; }; union flowi_uli { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/net/genetlink.h +++ linux-aws-6.5-6.5.0/include/net/genetlink.h @@ -12,10 +12,12 @@ * struct genl_multicast_group - generic netlink multicast group * @name: name of the multicast group, names are per-family * @flags: GENL_* flags (%GENL_ADMIN_PERM or %GENL_UNS_ADMIN_PERM) + * @cap_sys_admin: whether %CAP_SYS_ADMIN is required for binding */ struct genl_multicast_group { char name[GENL_NAMSIZ]; u8 flags; + u8 cap_sys_admin:1; }; struct genl_split_ops; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/net/netfilter/nf_conntrack_act_ct.h +++ linux-aws-6.5-6.5.0/include/net/netfilter/nf_conntrack_act_ct.h @@ -20,7 +20,22 @@ #endif } -static inline struct nf_conn_act_ct_ext *nf_conn_act_ct_ext_add(struct nf_conn *ct) +static inline void nf_conn_act_ct_ext_fill(struct sk_buff *skb, struct nf_conn *ct, + enum ip_conntrack_info ctinfo) +{ +#if IS_ENABLED(CONFIG_NET_ACT_CT) + struct nf_conn_act_ct_ext *act_ct_ext; + + act_ct_ext = nf_conn_act_ct_ext_find(ct); + if (dev_net(skb->dev) == &init_net && act_ct_ext) + act_ct_ext->ifindex[CTINFO2DIR(ctinfo)] = skb->dev->ifindex; +#endif +} + +static inline struct +nf_conn_act_ct_ext *nf_conn_act_ct_ext_add(struct sk_buff *skb, + struct nf_conn *ct, + enum ip_conntrack_info ctinfo) { #if IS_ENABLED(CONFIG_NET_ACT_CT) struct nf_conn_act_ct_ext *act_ct = nf_ct_ext_find(ct, NF_CT_EXT_ACT_CT); @@ -29,22 +44,11 @@ return act_ct; act_ct = nf_ct_ext_add(ct, NF_CT_EXT_ACT_CT, GFP_ATOMIC); + nf_conn_act_ct_ext_fill(skb, ct, ctinfo); return act_ct; #else return NULL; #endif } -static inline void nf_conn_act_ct_ext_fill(struct sk_buff *skb, struct nf_conn *ct, - enum ip_conntrack_info ctinfo) -{ -#if IS_ENABLED(CONFIG_NET_ACT_CT) - struct nf_conn_act_ct_ext *act_ct_ext; - - act_ct_ext = nf_conn_act_ct_ext_find(ct); - if (dev_net(skb->dev) == &init_net && act_ct_ext) - act_ct_ext->ifindex[CTINFO2DIR(ctinfo)] = skb->dev->ifindex; -#endif -} - #endif /* _NF_CONNTRACK_ACT_CT_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/net/netfilter/nf_flow_table.h +++ linux-aws-6.5-6.5.0/include/net/netfilter/nf_flow_table.h @@ -53,6 +53,7 @@ struct list_head list; int family; int (*init)(struct nf_flowtable *ft); + bool (*gc)(const struct flow_offload *flow); int (*setup)(struct nf_flowtable *ft, struct net_device *dev, enum flow_block_command cmd); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/net/netns/xfrm.h +++ linux-aws-6.5-6.5.0/include/net/netns/xfrm.h @@ -50,6 +50,7 @@ struct list_head policy_all; struct hlist_head *policy_byidx; unsigned int policy_idx_hmask; + unsigned int idx_generator; struct hlist_head policy_inexact[XFRM_POLICY_MAX]; struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX]; unsigned int policy_count[XFRM_POLICY_MAX * 2]; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/net/tc_act/tc_ct.h +++ linux-aws-6.5-6.5.0/include/net/tc_act/tc_ct.h @@ -57,6 +57,11 @@ return to_ct_params(a)->nf_ft; } +static inline struct nf_conntrack_helper *tcf_ct_helper(const struct tc_action *a) +{ + return to_ct_params(a)->helper; +} + #else static inline uint16_t tcf_ct_zone(const struct tc_action *a) { return 0; } static inline int tcf_ct_action(const struct tc_action *a) { return 0; } @@ -64,6 +69,10 @@ { return NULL; } +static inline struct nf_conntrack_helper *tcf_ct_helper(const struct tc_action *a) +{ + return NULL; +} #endif /* CONFIG_NF_CONNTRACK */ #if IS_ENABLED(CONFIG_NET_ACT_CT) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/net/udp_tunnel.h +++ linux-aws-6.5-6.5.0/include/net/udp_tunnel.h @@ -174,16 +174,13 @@ } #endif -static inline void udp_tunnel_encap_enable(struct socket *sock) +static inline void udp_tunnel_encap_enable(struct sock *sk) { - struct udp_sock *up = udp_sk(sock->sk); - - if (up->encap_enabled) + if (udp_test_and_set_bit(ENCAP_ENABLED, sk)) return; - up->encap_enabled = 1; #if IS_ENABLED(CONFIG_IPV6) - if (sock->sk->sk_family == PF_INET6) + if (READ_ONCE(sk->sk_family) == PF_INET6) ipv6_stub->udpv6_encap_enable(); #endif udp_encap_enable(); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/net/udplite.h +++ linux-aws-6.5-6.5.0/include/net/udplite.h @@ -66,14 +66,18 @@ /* Fast-path computation of checksum. Socket may not be locked. */ static inline __wsum udplite_csum(struct sk_buff *skb) { - const struct udp_sock *up = udp_sk(skb->sk); const int off = skb_transport_offset(skb); + const struct sock *sk = skb->sk; int len = skb->len - off; - if ((up->pcflag & UDPLITE_SEND_CC) && up->pcslen < len) { - if (0 < up->pcslen) - len = up->pcslen; - udp_hdr(skb)->len = htons(up->pcslen); + if (udp_test_bit(UDPLITE_SEND_CC, sk)) { + u16 pcslen = READ_ONCE(udp_sk(sk)->pcslen); + + if (pcslen < len) { + if (pcslen > 0) + len = pcslen; + udp_hdr(skb)->len = htons(pcslen); + } } skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/rdma/ib_umem.h +++ linux-aws-6.5-6.5.0/include/rdma/ib_umem.h @@ -77,6 +77,13 @@ { __rdma_block_iter_start(biter, umem->sgt_append.sgt.sgl, umem->sgt_append.sgt.nents, pgsz); + biter->__sg_advance = ib_umem_offset(umem) & ~(pgsz - 1); + biter->__sg_numblocks = ib_umem_num_dma_blocks(umem, pgsz); +} + +static inline bool __rdma_umem_block_iter_next(struct ib_block_iter *biter) +{ + return __rdma_block_iter_next(biter) && biter->__sg_numblocks--; } /** @@ -92,7 +99,7 @@ */ #define rdma_umem_for_each_dma_block(umem, biter, pgsz) \ for (__rdma_umem_block_iter_start(biter, umem, pgsz); \ - __rdma_block_iter_next(biter);) + __rdma_umem_block_iter_next(biter);) #ifdef CONFIG_INFINIBAND_USER_MEM only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/rdma/ib_verbs.h +++ linux-aws-6.5-6.5.0/include/rdma/ib_verbs.h @@ -2846,6 +2846,7 @@ /* internal states */ struct scatterlist *__sg; /* sg holding the current aligned block */ dma_addr_t __dma_addr; /* unaligned DMA address of this block */ + size_t __sg_numblocks; /* ib_umem_num_dma_blocks() */ unsigned int __sg_nents; /* number of SG entries */ unsigned int __sg_advance; /* number of bytes to advance in sg in next step */ unsigned int __pg_bit; /* alignment of current block */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/soc/tegra/bpmp.h +++ linux-aws-6.5-6.5.0/include/soc/tegra/bpmp.h @@ -102,8 +102,12 @@ #ifdef CONFIG_DEBUG_FS struct dentry *debugfs_mirror; #endif + + bool suspended; }; +#define TEGRA_BPMP_MESSAGE_RESET BIT(0) + struct tegra_bpmp_message { unsigned int mrq; @@ -117,6 +121,8 @@ size_t size; int ret; } rx; + + unsigned long flags; }; #if IS_ENABLED(CONFIG_TEGRA_BPMP) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/sound/soc-acpi.h +++ linux-aws-6.5-6.5.0/include/sound/soc-acpi.h @@ -67,6 +67,10 @@ * @i2s_link_mask: I2S/TDM links enabled on the board * @num_dai_drivers: number of elements in @dai_drivers * @dai_drivers: pointer to dai_drivers, used e.g. in nocodec mode + * @subsystem_vendor: optional PCI SSID vendor value + * @subsystem_device: optional PCI SSID device value + * @subsystem_id_set: true if a value has been written to + * subsystem_vendor and subsystem_device. */ struct snd_soc_acpi_mach_params { u32 acpi_ipc_irq_index; @@ -79,6 +83,9 @@ u32 i2s_link_mask; u32 num_dai_drivers; struct snd_soc_dai_driver *dai_drivers; + unsigned short subsystem_vendor; + unsigned short subsystem_device; + bool subsystem_id_set; }; /** only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/sound/soc-card.h +++ linux-aws-6.5-6.5.0/include/sound/soc-card.h @@ -59,6 +59,43 @@ void snd_soc_card_remove_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); +#ifdef CONFIG_PCI +static inline void snd_soc_card_set_pci_ssid(struct snd_soc_card *card, + unsigned short vendor, + unsigned short device) +{ + card->pci_subsystem_vendor = vendor; + card->pci_subsystem_device = device; + card->pci_subsystem_set = true; +} + +static inline int snd_soc_card_get_pci_ssid(struct snd_soc_card *card, + unsigned short *vendor, + unsigned short *device) +{ + if (!card->pci_subsystem_set) + return -ENOENT; + + *vendor = card->pci_subsystem_vendor; + *device = card->pci_subsystem_device; + + return 0; +} +#else /* !CONFIG_PCI */ +static inline void snd_soc_card_set_pci_ssid(struct snd_soc_card *card, + unsigned short vendor, + unsigned short device) +{ +} + +static inline int snd_soc_card_get_pci_ssid(struct snd_soc_card *card, + unsigned short *vendor, + unsigned short *device) +{ + return -ENOENT; +} +#endif /* CONFIG_PCI */ + /* device driver data */ static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card, void *data) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/sound/soc-dai.h +++ linux-aws-6.5-6.5.0/include/sound/soc-dai.h @@ -355,6 +355,7 @@ /* bit field */ unsigned int no_capture_mute:1; + unsigned int mute_unmute_on_trigger:1; }; struct snd_soc_cdai_ops { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/sound/soc-dapm.h +++ linux-aws-6.5-6.5.0/include/sound/soc-dapm.h @@ -423,6 +423,7 @@ int snd_soc_dapm_update_dai(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai); +int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s); /* dapm path setup */ int snd_soc_dapm_new_widgets(struct snd_soc_card *card); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/sound/soc.h +++ linux-aws-6.5-6.5.0/include/sound/soc.h @@ -931,6 +931,17 @@ #ifdef CONFIG_DMI char dmi_longname[80]; #endif /* CONFIG_DMI */ + +#ifdef CONFIG_PCI + /* + * PCI does not define 0 as invalid, so pci_subsystem_set indicates + * whether a value has been written to these fields. + */ + unsigned short pci_subsystem_vendor; + unsigned short pci_subsystem_device; + bool pci_subsystem_set; +#endif /* CONFIG_PCI */ + char topology_shortname[32]; struct device *dev; @@ -1125,6 +1136,8 @@ unsigned int pop_wait:1; unsigned int fe_compr:1; /* for Dynamic PCM */ + bool initialized; + int num_components; struct snd_soc_component *components[]; /* CPU/Codec/Platform */ }; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/sound/sof.h +++ linux-aws-6.5-6.5.0/include/sound/sof.h @@ -64,6 +64,14 @@ const char *name; const char *platform; + /* + * PCI SSID. As PCI does not define 0 as invalid, the subsystem_id_set + * flag indicates that a value has been written to these members. + */ + unsigned short subsystem_vendor; + unsigned short subsystem_device; + bool subsystem_id_set; + struct device *dev; /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/trace/events/btrfs.h +++ linux-aws-6.5-6.5.0/include/trace/events/btrfs.h @@ -38,7 +38,6 @@ __print_symbolic(type, \ { BTRFS_TREE_BLOCK_REF_KEY, "TREE_BLOCK_REF" }, \ { BTRFS_EXTENT_DATA_REF_KEY, "EXTENT_DATA_REF" }, \ - { BTRFS_EXTENT_REF_V0_KEY, "EXTENT_REF_V0" }, \ { BTRFS_SHARED_BLOCK_REF_KEY, "SHARED_BLOCK_REF" }, \ { BTRFS_SHARED_DATA_REF_KEY, "SHARED_DATA_REF" }) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/trace/events/neigh.h +++ linux-aws-6.5-6.5.0/include/trace/events/neigh.h @@ -39,7 +39,6 @@ ), TP_fast_assign( - struct in6_addr *pin6; __be32 *p32; __entry->family = tbl->family; @@ -47,7 +46,6 @@ __entry->entries = atomic_read(&tbl->gc_entries); __entry->created = n != NULL; __entry->gc_exempt = exempt_from_gc; - pin6 = (struct in6_addr *)__entry->primary_key6; p32 = (__be32 *)__entry->primary_key4; if (tbl->family == AF_INET) @@ -57,6 +55,8 @@ #if IS_ENABLED(CONFIG_IPV6) if (tbl->family == AF_INET6) { + struct in6_addr *pin6; + pin6 = (struct in6_addr *)__entry->primary_key6; *pin6 = *(struct in6_addr *)pkey; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/trace/events/rxrpc.h +++ linux-aws-6.5-6.5.0/include/trace/events/rxrpc.h @@ -328,7 +328,7 @@ E_(rxrpc_rtt_tx_ping, "PING") #define rxrpc_rtt_rx_traces \ - EM(rxrpc_rtt_rx_cancel, "CNCL") \ + EM(rxrpc_rtt_rx_other_ack, "OACK") \ EM(rxrpc_rtt_rx_obsolete, "OBSL") \ EM(rxrpc_rtt_rx_lost, "LOST") \ EM(rxrpc_rtt_rx_ping_response, "PONG") \ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/uapi/linux/btrfs_tree.h +++ linux-aws-6.5-6.5.0/include/uapi/linux/btrfs_tree.h @@ -220,7 +220,11 @@ #define BTRFS_EXTENT_DATA_REF_KEY 178 -#define BTRFS_EXTENT_REF_V0_KEY 180 +/* + * Obsolete key. Defintion removed in 6.6, value may be reused in the future. + * + * #define BTRFS_EXTENT_REF_V0_KEY 180 + */ #define BTRFS_SHARED_BLOCK_REF_KEY 182 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/uapi/linux/fcntl.h +++ linux-aws-6.5-6.5.0/include/uapi/linux/fcntl.h @@ -116,5 +116,8 @@ #define AT_HANDLE_FID AT_REMOVEDIR /* file handle is needed to compare object identity and may not be usable to open_by_handle_at(2) */ +#if defined(__KERNEL__) +#define AT_GETATTR_NOSEC 0x80000000 +#endif #endif /* _UAPI_LINUX_FCNTL_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/uapi/linux/gtp.h +++ linux-aws-6.5-6.5.0/include/uapi/linux/gtp.h @@ -33,6 +33,6 @@ GTPA_PAD, __GTPA_MAX, }; -#define GTPA_MAX (__GTPA_MAX + 1) +#define GTPA_MAX (__GTPA_MAX - 1) #endif /* _UAPI_LINUX_GTP_H_ */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/uapi/linux/v4l2-subdev.h +++ linux-aws-6.5-6.5.0/include/uapi/linux/v4l2-subdev.h @@ -239,7 +239,7 @@ * set (which is the default), the 'stream' fields will be forced to 0 by the * kernel. */ - #define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1U << 0) + #define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1ULL << 0) /** * struct v4l2_subdev_client_capability - Capabilities of the client accessing only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/uapi/linux/vm_sockets.h +++ linux-aws-6.5-6.5.0/include/uapi/linux/vm_sockets.h @@ -191,4 +191,21 @@ #define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9) +/* MSG_ZEROCOPY notifications are encoded in the standard error format, + * sock_extended_err. See Documentation/networking/msg_zerocopy.rst in + * kernel source tree for more details. + */ + +/* 'cmsg_level' field value of 'struct cmsghdr' for notification parsing + * when MSG_ZEROCOPY flag is used on transmissions. + */ + +#define SOL_VSOCK 287 + +/* 'cmsg_type' field value of 'struct cmsghdr' for notification parsing + * when MSG_ZEROCOPY flag is used on transmissions. + */ + +#define VSOCK_RECVERR 1 + #endif /* _UAPI_VM_SOCKETS_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/uapi/scsi/scsi_bsg_mpi3mr.h +++ linux-aws-6.5-6.5.0/include/uapi/scsi/scsi_bsg_mpi3mr.h @@ -491,6 +491,8 @@ #define MPI3MR_NVME_DATA_FORMAT_PRP 0 #define MPI3MR_NVME_DATA_FORMAT_SGL1 1 #define MPI3MR_NVME_DATA_FORMAT_SGL2 2 +#define MPI3MR_NVMESGL_DATA_SEGMENT 0x00 +#define MPI3MR_NVMESGL_LAST_SEGMENT 0x03 /* MPI3: task management related definitions */ struct mpi3_scsi_task_mgmt_request { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/include/video/sticore.h +++ linux-aws-6.5-6.5.0/include/video/sticore.h @@ -232,7 +232,7 @@ u8 height; u8 font_type; /* language type */ u8 bytes_per_char; - u32 next_font; + s32 next_font; /* note: signed int */ u8 underline_height; u8 underline_pos; u8 res008[2]; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/init/Makefile +++ linux-aws-6.5-6.5.0/init/Makefile @@ -60,4 +60,5 @@ $(obj)/version-timestamp.o: include/generated/utsversion.h CFLAGS_version-timestamp.o := -include include/generated/utsversion.h KASAN_SANITIZE_version-timestamp.o := n +KCSAN_SANITIZE_version-timestamp.o := n GCOV_PROFILE_version-timestamp.o := n only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/init/main.c +++ linux-aws-6.5-6.5.0/init/main.c @@ -530,6 +530,10 @@ { size_t len = strlen(param); + /* Handle params aliased to sysctls */ + if (sysctl_is_alias(param)) + return 0; + repair_env_string(param, val); /* Handle obsolete-style parameters */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/audit_watch.c +++ linux-aws-6.5-6.5.0/kernel/audit_watch.c @@ -527,11 +527,18 @@ unsigned long ino; dev_t dev; - exe_file = get_task_exe_file(tsk); + /* only do exe filtering if we are recording @current events/records */ + if (tsk != current) + return 0; + + if (!current->mm) + return 0; + exe_file = get_mm_exe_file(current->mm); if (!exe_file) return 0; ino = file_inode(exe_file)->i_ino; dev = file_inode(exe_file)->i_sb->s_dev; fput(exe_file); + return audit_mark_compare(mark, ino, dev); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/bpf/hashtab.c +++ linux-aws-6.5-6.5.0/kernel/bpf/hashtab.c @@ -155,13 +155,15 @@ hash = hash & min_t(u32, HASHTAB_MAP_LOCK_MASK, htab->n_buckets - 1); preempt_disable(); + local_irq_save(flags); if (unlikely(__this_cpu_inc_return(*(htab->map_locked[hash])) != 1)) { __this_cpu_dec(*(htab->map_locked[hash])); + local_irq_restore(flags); preempt_enable(); return -EBUSY; } - raw_spin_lock_irqsave(&b->raw_lock, flags); + raw_spin_lock(&b->raw_lock); *pflags = flags; return 0; @@ -172,8 +174,9 @@ unsigned long flags) { hash = hash & min_t(u32, HASHTAB_MAP_LOCK_MASK, htab->n_buckets - 1); - raw_spin_unlock_irqrestore(&b->raw_lock, flags); + raw_spin_unlock(&b->raw_lock); __this_cpu_dec(*(htab->map_locked[hash])); + local_irq_restore(flags); preempt_enable(); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/bpf/memalloc.c +++ linux-aws-6.5-6.5.0/kernel/bpf/memalloc.c @@ -712,6 +712,8 @@ memcg = get_memcg(c); old_memcg = set_active_memcg(memcg); ret = __alloc(c, NUMA_NO_NODE, GFP_KERNEL | __GFP_NOWARN | __GFP_ACCOUNT); + if (ret) + *(struct bpf_mem_cache **)ret = c; set_active_memcg(old_memcg); mem_cgroup_put(memcg); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/cgroup/cgroup.c +++ linux-aws-6.5-6.5.0/kernel/cgroup/cgroup.c @@ -3836,14 +3836,6 @@ return psi_trigger_poll(&ctx->psi.trigger, of->file, pt); } -static int cgroup_pressure_open(struct kernfs_open_file *of) -{ - if (of->file->f_mode & FMODE_WRITE && !capable(CAP_SYS_RESOURCE)) - return -EPERM; - - return 0; -} - static void cgroup_pressure_release(struct kernfs_open_file *of) { struct cgroup_file_ctx *ctx = of->priv; @@ -5243,7 +5235,6 @@ { .name = "io.pressure", .file_offset = offsetof(struct cgroup, psi_files[PSI_IO]), - .open = cgroup_pressure_open, .seq_show = cgroup_io_pressure_show, .write = cgroup_io_pressure_write, .poll = cgroup_pressure_poll, @@ -5252,7 +5243,6 @@ { .name = "memory.pressure", .file_offset = offsetof(struct cgroup, psi_files[PSI_MEM]), - .open = cgroup_pressure_open, .seq_show = cgroup_memory_pressure_show, .write = cgroup_memory_pressure_write, .poll = cgroup_pressure_poll, @@ -5261,7 +5251,6 @@ { .name = "cpu.pressure", .file_offset = offsetof(struct cgroup, psi_files[PSI_CPU]), - .open = cgroup_pressure_open, .seq_show = cgroup_cpu_pressure_show, .write = cgroup_cpu_pressure_write, .poll = cgroup_pressure_poll, @@ -5271,7 +5260,6 @@ { .name = "irq.pressure", .file_offset = offsetof(struct cgroup, psi_files[PSI_IRQ]), - .open = cgroup_pressure_open, .seq_show = cgroup_irq_pressure_show, .write = cgroup_irq_pressure_write, .poll = cgroup_pressure_poll, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/cgroup/legacy_freezer.c +++ linux-aws-6.5-6.5.0/kernel/cgroup/legacy_freezer.c @@ -66,9 +66,15 @@ bool cgroup_freezing(struct task_struct *task) { bool ret; + unsigned int state; rcu_read_lock(); - ret = task_freezer(task)->state & CGROUP_FREEZING; + /* Check if the cgroup is still FREEZING, but not FROZEN. The extra + * !FROZEN check is required, because the FREEZING bit is not cleared + * when the state FROZEN is reached. + */ + state = task_freezer(task)->state; + ret = (state & CGROUP_FREEZING) && !(state & CGROUP_FROZEN); rcu_read_unlock(); return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/debug/debug_core.c +++ linux-aws-6.5-6.5.0/kernel/debug/debug_core.c @@ -1006,6 +1006,9 @@ if (panic_timeout) return; + debug_locks_off(); + console_flush_on_panic(CONSOLE_FLUSH_PENDING); + if (dbg_kdb_mode) kdb_printf("PANIC: %s\n", msg); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/events/ring_buffer.c +++ linux-aws-6.5-6.5.0/kernel/events/ring_buffer.c @@ -699,6 +699,12 @@ watermark = 0; } + /* + * kcalloc_node() is unable to allocate buffer if the size is larger + * than: PAGE_SIZE << MAX_ORDER; directly bail out in this case. + */ + if (get_order((unsigned long)nr_pages * sizeof(void *)) > MAX_ORDER) + return -ENOMEM; rb->aux_pages = kcalloc_node(nr_pages, sizeof(void *), GFP_KERNEL, node); if (!rb->aux_pages) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/futex/core.c +++ linux-aws-6.5-6.5.0/kernel/futex/core.c @@ -248,7 +248,17 @@ * but access_ok() should be faster than find_vma() */ if (!fshared) { - key->private.mm = mm; + /* + * On no-MMU, shared futexes are treated as private, therefore + * we must not include the current process in the key. Since + * there is only one address space, the address is a unique key + * on its own. + */ + if (IS_ENABLED(CONFIG_MMU)) + key->private.mm = mm; + else + key->private.mm = NULL; + key->private.address = address; return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/irq/debugfs.c +++ linux-aws-6.5-6.5.0/kernel/irq/debugfs.c @@ -121,7 +121,6 @@ BIT_MASK_DESCR(IRQD_AFFINITY_ON_ACTIVATE), BIT_MASK_DESCR(IRQD_MANAGED_SHUTDOWN), BIT_MASK_DESCR(IRQD_CAN_RESERVE), - BIT_MASK_DESCR(IRQD_MSI_NOMASK_QUIRK), BIT_MASK_DESCR(IRQD_FORWARDED_TO_VCPU), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/irq/generic-chip.c +++ linux-aws-6.5-6.5.0/kernel/irq/generic-chip.c @@ -544,21 +544,34 @@ void irq_remove_generic_chip(struct irq_chip_generic *gc, u32 msk, unsigned int clr, unsigned int set) { - unsigned int i = gc->irq_base; + unsigned int i, virq; raw_spin_lock(&gc_lock); list_del(&gc->list); raw_spin_unlock(&gc_lock); - for (; msk; msk >>= 1, i++) { + for (i = 0; msk; msk >>= 1, i++) { if (!(msk & 0x01)) continue; + /* + * Interrupt domain based chips store the base hardware + * interrupt number in gc::irq_base. Otherwise gc::irq_base + * contains the base Linux interrupt number. + */ + if (gc->domain) { + virq = irq_find_mapping(gc->domain, gc->irq_base + i); + if (!virq) + continue; + } else { + virq = gc->irq_base + i; + } + /* Remove handler first. That will mask the irq line */ - irq_set_handler(i, NULL); - irq_set_chip(i, &no_irq_chip); - irq_set_chip_data(i, NULL); - irq_modify_status(i, clr, set); + irq_set_handler(virq, NULL); + irq_set_chip(virq, &no_irq_chip); + irq_set_chip_data(virq, NULL); + irq_modify_status(virq, clr, set); } } EXPORT_SYMBOL_GPL(irq_remove_generic_chip); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/irq/matrix.c +++ linux-aws-6.5-6.5.0/kernel/irq/matrix.c @@ -466,16 +466,16 @@ } /** - * irq_matrix_allocated - Get the number of allocated irqs on the local cpu + * irq_matrix_allocated - Get the number of allocated non-managed irqs on the local CPU * @m: Pointer to the matrix to search * - * This returns number of allocated irqs + * This returns number of allocated non-managed interrupts. */ unsigned int irq_matrix_allocated(struct irq_matrix *m) { struct cpumap *cm = this_cpu_ptr(m->maps); - return cm->allocated; + return cm->allocated - cm->managed_allocated; } #ifdef CONFIG_GENERIC_IRQ_DEBUGFS only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/irq/msi.c +++ linux-aws-6.5-6.5.0/kernel/irq/msi.c @@ -1204,7 +1204,6 @@ #define VIRQ_CAN_RESERVE 0x01 #define VIRQ_ACTIVATE 0x02 -#define VIRQ_NOMASK_QUIRK 0x04 static int msi_init_virq(struct irq_domain *domain, int virq, unsigned int vflags) { @@ -1213,8 +1212,6 @@ if (!(vflags & VIRQ_CAN_RESERVE)) { irqd_clr_can_reserve(irqd); - if (vflags & VIRQ_NOMASK_QUIRK) - irqd_set_msi_nomask_quirk(irqd); /* * If the interrupt is managed but no CPU is available to @@ -1275,15 +1272,8 @@ * Interrupt can use a reserved vector and will not occupy * a real device vector until the interrupt is requested. */ - if (msi_check_reservation_mode(domain, info, dev)) { + if (msi_check_reservation_mode(domain, info, dev)) vflags |= VIRQ_CAN_RESERVE; - /* - * MSI affinity setting requires a special quirk (X86) when - * reservation mode is active. - */ - if (info->flags & MSI_FLAG_NOMASK_QUIRK) - vflags |= VIRQ_NOMASK_QUIRK; - } xa_for_each_range(xa, idx, desc, ctrl->first, ctrl->last) { if (!msi_desc_match(desc, MSI_DESC_NOTASSOCIATED)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/kexec.c +++ linux-aws-6.5-6.5.0/kernel/kexec.c @@ -242,7 +242,7 @@ ((flags & KEXEC_ARCH_MASK) != KEXEC_ARCH_DEFAULT)) return -EINVAL; - ksegments = memdup_user(segments, nr_segments * sizeof(ksegments[0])); + ksegments = memdup_array_user(segments, nr_segments, sizeof(ksegments[0])); if (IS_ERR(ksegments)) return PTR_ERR(ksegments); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/kprobes.c +++ linux-aws-6.5-6.5.0/kernel/kprobes.c @@ -2254,7 +2254,7 @@ if (!rp->rph) return -ENOMEM; - rp->rph->rp = rp; + rcu_assign_pointer(rp->rph->rp, rp); for (i = 0; i < rp->maxactive; i++) { inst = kzalloc(sizeof(struct kretprobe_instance) + rp->data_size, GFP_KERNEL); @@ -2315,7 +2315,7 @@ #ifdef CONFIG_KRETPROBE_ON_RETHOOK rethook_free(rps[i]->rh); #else - rps[i]->rph->rp = NULL; + rcu_assign_pointer(rps[i]->rph->rp, NULL); #endif } mutex_unlock(&kprobe_mutex); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/livepatch/core.c +++ linux-aws-6.5-6.5.0/kernel/livepatch/core.c @@ -243,7 +243,7 @@ * symbols are exported and normal relas can be used instead. */ if (!sec_vmlinux && sym_vmlinux) { - pr_err("invalid access to vmlinux symbol '%s' from module-specific livepatch relocation section", + pr_err("invalid access to vmlinux symbol '%s' from module-specific livepatch relocation section\n", sym_name); return -EINVAL; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/locking/locktorture.c +++ linux-aws-6.5-6.5.0/kernel/locking/locktorture.c @@ -45,6 +45,7 @@ torture_param(int, rt_boost, 2, "Do periodic rt-boost. 0=Disable, 1=Only for rt_mutex, 2=For all lock types."); torture_param(int, rt_boost_factor, 50, "A factor determining how often rt-boost happens."); +torture_param(int, writer_fifo, 0, "Run writers at sched_set_fifo() priority"); torture_param(int, verbose, 1, "Enable verbose debugging printk()s"); torture_param(int, nested_locks, 0, "Number of nested locks (max = 8)"); /* Going much higher trips "BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low!" errors */ @@ -809,7 +810,8 @@ bool skip_main_lock; VERBOSE_TOROUT_STRING("lock_torture_writer task started"); - set_user_nice(current, MAX_NICE); + if (!rt_task(current)) + set_user_nice(current, MAX_NICE); do { if ((torture_random(&rand) & 0xfffff) == 0) @@ -1015,8 +1017,7 @@ if (writer_tasks) { for (i = 0; i < cxt.nrealwriters_stress; i++) - torture_stop_kthread(lock_torture_writer, - writer_tasks[i]); + torture_stop_kthread(lock_torture_writer, writer_tasks[i]); kfree(writer_tasks); writer_tasks = NULL; } @@ -1244,8 +1245,9 @@ goto create_reader; /* Create writer. */ - firsterr = torture_create_kthread(lock_torture_writer, &cxt.lwsa[i], - writer_tasks[i]); + firsterr = torture_create_kthread_cb(lock_torture_writer, &cxt.lwsa[i], + writer_tasks[i], + writer_fifo ? sched_set_fifo : NULL); if (torture_init_error(firsterr)) goto unwind; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/locking/test-ww_mutex.c +++ linux-aws-6.5-6.5.0/kernel/locking/test-ww_mutex.c @@ -466,7 +466,6 @@ } while (!time_after(jiffies, stress->timeout)); kfree(order); - kfree(stress); } struct reorder_lock { @@ -531,7 +530,6 @@ list_for_each_entry_safe(ll, ln, &locks, link) kfree(ll); kfree(order); - kfree(stress); } static void stress_one_work(struct work_struct *work) @@ -552,8 +550,6 @@ break; } } while (!time_after(jiffies, stress->timeout)); - - kfree(stress); } #define STRESS_INORDER BIT(0) @@ -564,15 +560,24 @@ static int stress(int nlocks, int nthreads, unsigned int flags) { struct ww_mutex *locks; - int n; + struct stress *stress_array; + int n, count; locks = kmalloc_array(nlocks, sizeof(*locks), GFP_KERNEL); if (!locks) return -ENOMEM; + stress_array = kmalloc_array(nthreads, sizeof(*stress_array), + GFP_KERNEL); + if (!stress_array) { + kfree(locks); + return -ENOMEM; + } + for (n = 0; n < nlocks; n++) ww_mutex_init(&locks[n], &ww_class); + count = 0; for (n = 0; nthreads; n++) { struct stress *stress; void (*fn)(struct work_struct *work); @@ -596,9 +601,7 @@ if (!fn) continue; - stress = kmalloc(sizeof(*stress), GFP_KERNEL); - if (!stress) - break; + stress = &stress_array[count++]; INIT_WORK(&stress->work, fn); stress->locks = locks; @@ -613,6 +616,7 @@ for (n = 0; n < nlocks; n++) ww_mutex_destroy(&locks[n]); + kfree(stress_array); kfree(locks); return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/padata.c +++ linux-aws-6.5-6.5.0/kernel/padata.c @@ -202,7 +202,7 @@ *cb_cpu = cpu; } - err = -EBUSY; + err = -EBUSY; if ((pinst->flags & PADATA_RESET)) goto out; @@ -1102,12 +1102,16 @@ */ void padata_free_shell(struct padata_shell *ps) { + struct parallel_data *pd; + if (!ps) return; mutex_lock(&ps->pinst->lock); list_del(&ps->list); - padata_free_pd(rcu_dereference_protected(ps->pd, 1)); + pd = rcu_dereference_protected(ps->pd, 1); + if (refcount_dec_and_test(&pd->refcnt)) + padata_free_pd(pd); mutex_unlock(&ps->pinst->lock); kfree(ps); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/power/snapshot.c +++ linux-aws-6.5-6.5.0/kernel/power/snapshot.c @@ -2474,8 +2474,9 @@ pbe->copy_page = tmp; } else { /* Copy of the page will be stored in normal memory */ - kaddr = safe_pages_list; - safe_pages_list = safe_pages_list->next; + kaddr = __get_safe_page(ca->gfp_mask); + if (!kaddr) + return ERR_PTR(-ENOMEM); pbe->copy_page = virt_to_page(kaddr); } pbe->next = highmem_pblist; @@ -2655,8 +2656,9 @@ return ERR_PTR(-ENOMEM); } pbe->orig_address = page_address(page); - pbe->address = safe_pages_list; - safe_pages_list = safe_pages_list->next; + pbe->address = __get_safe_page(ca->gfp_mask); + if (!pbe->address) + return ERR_PTR(-ENOMEM); pbe->next = restore_pblist; restore_pblist = pbe; return pbe->address; @@ -2687,8 +2689,6 @@ if (handle->cur > 1 && handle->cur > nr_meta_pages + nr_copy_pages) return 0; - handle->sync_read = 1; - if (!handle->cur) { if (!buffer) /* This makes the buffer be freed by swsusp_free() */ @@ -2724,7 +2724,6 @@ memory_bm_position_reset(&orig_bm); restore_pblist = NULL; handle->buffer = get_buffer(&orig_bm, &ca); - handle->sync_read = 0; if (IS_ERR(handle->buffer)) return PTR_ERR(handle->buffer); } @@ -2734,9 +2733,8 @@ handle->buffer = get_buffer(&orig_bm, &ca); if (IS_ERR(handle->buffer)) return PTR_ERR(handle->buffer); - if (handle->buffer != buffer) - handle->sync_read = 0; } + handle->sync_read = (handle->buffer == buffer); handle->cur++; return PAGE_SIZE; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/rcu/srcutree.c +++ linux-aws-6.5-6.5.0/kernel/rcu/srcutree.c @@ -223,7 +223,7 @@ snp->grplo = cpu; snp->grphi = cpu; } - sdp->grpmask = 1 << (cpu - sdp->mynode->grplo); + sdp->grpmask = 1UL << (cpu - sdp->mynode->grplo); } smp_store_release(&ssp->srcu_sup->srcu_size_state, SRCU_SIZE_WAIT_BARRIER); return true; @@ -782,8 +782,7 @@ spin_lock_rcu_node(sdp); /* Interrupts already disabled. */ rcu_segcblist_advance(&sdp->srcu_cblist, rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq)); - (void)rcu_segcblist_accelerate(&sdp->srcu_cblist, - rcu_seq_snap(&ssp->srcu_sup->srcu_gp_seq)); + WARN_ON_ONCE(!rcu_segcblist_segempty(&sdp->srcu_cblist, RCU_NEXT_TAIL)); spin_unlock_rcu_node(sdp); /* Interrupts remain disabled. */ WRITE_ONCE(ssp->srcu_sup->srcu_gp_start, jiffies); WRITE_ONCE(ssp->srcu_sup->srcu_n_exp_nodelay, 0); @@ -833,7 +832,7 @@ int cpu; for (cpu = snp->grplo; cpu <= snp->grphi; cpu++) { - if (!(mask & (1 << (cpu - snp->grplo)))) + if (!(mask & (1UL << (cpu - snp->grplo)))) continue; srcu_schedule_cbs_sdp(per_cpu_ptr(ssp->sda, cpu), delay); } @@ -1242,10 +1241,37 @@ spin_lock_irqsave_sdp_contention(sdp, &flags); if (rhp) rcu_segcblist_enqueue(&sdp->srcu_cblist, rhp); + /* + * The snapshot for acceleration must be taken _before_ the read of the + * current gp sequence used for advancing, otherwise advancing may fail + * and acceleration may then fail too. + * + * This could happen if: + * + * 1) The RCU_WAIT_TAIL segment has callbacks (gp_num = X + 4) and the + * RCU_NEXT_READY_TAIL also has callbacks (gp_num = X + 8). + * + * 2) The grace period for RCU_WAIT_TAIL is seen as started but not + * completed so rcu_seq_current() returns X + SRCU_STATE_SCAN1. + * + * 3) This value is passed to rcu_segcblist_advance() which can't move + * any segment forward and fails. + * + * 4) srcu_gp_start_if_needed() still proceeds with callback acceleration. + * But then the call to rcu_seq_snap() observes the grace period for the + * RCU_WAIT_TAIL segment as completed and the subsequent one for the + * RCU_NEXT_READY_TAIL segment as started (ie: X + 4 + SRCU_STATE_SCAN1) + * so it returns a snapshot of the next grace period, which is X + 12. + * + * 5) The value of X + 12 is passed to rcu_segcblist_accelerate() but the + * freshly enqueued callback in RCU_NEXT_TAIL can't move to + * RCU_NEXT_READY_TAIL which already has callbacks for a previous grace + * period (gp_num = X + 8). So acceleration fails. + */ + s = rcu_seq_snap(&ssp->srcu_sup->srcu_gp_seq); rcu_segcblist_advance(&sdp->srcu_cblist, rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq)); - s = rcu_seq_snap(&ssp->srcu_sup->srcu_gp_seq); - (void)rcu_segcblist_accelerate(&sdp->srcu_cblist, s); + WARN_ON_ONCE(!rcu_segcblist_accelerate(&sdp->srcu_cblist, s) && rhp); if (ULONG_CMP_LT(sdp->srcu_gp_seq_needed, s)) { sdp->srcu_gp_seq_needed = s; needgp = true; @@ -1692,6 +1718,7 @@ ssp = sdp->ssp; rcu_cblist_init(&ready_cbs); spin_lock_irq_rcu_node(sdp); + WARN_ON_ONCE(!rcu_segcblist_segempty(&sdp->srcu_cblist, RCU_NEXT_TAIL)); rcu_segcblist_advance(&sdp->srcu_cblist, rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq)); if (sdp->srcu_cblist_invoking || @@ -1720,8 +1747,6 @@ */ spin_lock_irq_rcu_node(sdp); rcu_segcblist_add_len(&sdp->srcu_cblist, -len); - (void)rcu_segcblist_accelerate(&sdp->srcu_cblist, - rcu_seq_snap(&ssp->srcu_sup->srcu_gp_seq)); sdp->srcu_cblist_invoking = false; more = rcu_segcblist_ready_cbs(&sdp->srcu_cblist); spin_unlock_irq_rcu_node(sdp); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/rcu/tree.c +++ linux-aws-6.5-6.5.0/kernel/rcu/tree.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -1552,10 +1553,22 @@ */ static void rcu_gp_fqs(bool first_time) { + int nr_fqs = READ_ONCE(rcu_state.nr_fqs_jiffies_stall); struct rcu_node *rnp = rcu_get_root(); WRITE_ONCE(rcu_state.gp_activity, jiffies); WRITE_ONCE(rcu_state.n_force_qs, rcu_state.n_force_qs + 1); + + WARN_ON_ONCE(nr_fqs > 3); + /* Only countdown nr_fqs for stall purposes if jiffies moves. */ + if (nr_fqs) { + if (nr_fqs == 1) { + WRITE_ONCE(rcu_state.jiffies_stall, + jiffies + rcu_jiffies_till_stall_check()); + } + WRITE_ONCE(rcu_state.nr_fqs_jiffies_stall, --nr_fqs); + } + if (first_time) { /* Collect dyntick-idle snapshots. */ force_qs_rnp(dyntick_save_progress_counter); @@ -3384,6 +3397,14 @@ success = true; } + /* + * The kvfree_rcu() caller considers the pointer freed at this point + * and likely removes any references to it. Since the actual slab + * freeing (and kmemleak_free()) is deferred, tell kmemleak to ignore + * this object (no scanning or false positives reporting). + */ + kmemleak_ignore(ptr); + // Set timer to drain after KFREE_DRAIN_JIFFIES. if (rcu_scheduler_active == RCU_SCHEDULER_RUNNING) schedule_delayed_monitor_work(krcp); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/rcu/tree.h +++ linux-aws-6.5-6.5.0/kernel/rcu/tree.h @@ -386,6 +386,10 @@ /* in jiffies. */ unsigned long jiffies_stall; /* Time at which to check */ /* for CPU stalls. */ + int nr_fqs_jiffies_stall; /* Number of fqs loops after + * which read jiffies and set + * jiffies_stall. Stall + * warnings disabled if !0. */ unsigned long jiffies_resched; /* Time at which to resched */ /* a reluctant CPU. */ unsigned long n_force_qs_gpstart; /* Snapshot of n_force_qs at */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/rcu/tree_stall.h +++ linux-aws-6.5-6.5.0/kernel/rcu/tree_stall.h @@ -149,12 +149,17 @@ /** * rcu_cpu_stall_reset - restart stall-warning timeout for current grace period * + * To perform the reset request from the caller, disable stall detection until + * 3 fqs loops have passed. This is required to ensure a fresh jiffies is + * loaded. It should be safe to do from the fqs loop as enough timer + * interrupts and context switches should have passed. + * * The caller must disable hard irqs. */ void rcu_cpu_stall_reset(void) { - WRITE_ONCE(rcu_state.jiffies_stall, - jiffies + rcu_jiffies_till_stall_check()); + WRITE_ONCE(rcu_state.nr_fqs_jiffies_stall, 3); + WRITE_ONCE(rcu_state.jiffies_stall, ULONG_MAX); } ////////////////////////////////////////////////////////////////////////////// @@ -170,6 +175,7 @@ WRITE_ONCE(rcu_state.gp_start, j); j1 = rcu_jiffies_till_stall_check(); smp_mb(); // ->gp_start before ->jiffies_stall and caller's ->gp_seq. + WRITE_ONCE(rcu_state.nr_fqs_jiffies_stall, 0); WRITE_ONCE(rcu_state.jiffies_stall, j + j1); rcu_state.jiffies_resched = j + j1 / 2; rcu_state.n_force_qs_gpstart = READ_ONCE(rcu_state.n_force_qs); @@ -725,6 +731,16 @@ !rcu_gp_in_progress()) return; rcu_stall_kick_kthreads(); + + /* + * Check if it was requested (via rcu_cpu_stall_reset()) that the FQS + * loop has to set jiffies to ensure a non-stale jiffies value. This + * is required to have good jiffies value after coming out of long + * breaks of jiffies updates. Not doing so can cause false positives. + */ + if (READ_ONCE(rcu_state.nr_fqs_jiffies_stall) > 0) + return; + j = jiffies; /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/reboot.c +++ linux-aws-6.5-6.5.0/kernel/reboot.c @@ -74,6 +74,7 @@ void emergency_restart(void) { kmsg_dump(KMSG_DUMP_EMERG); + system_state = SYSTEM_RESTART; machine_emergency_restart(); } EXPORT_SYMBOL_GPL(emergency_restart); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/sched/cpufreq_schedutil.c +++ linux-aws-6.5-6.5.0/kernel/sched/cpufreq_schedutil.c @@ -350,7 +350,8 @@ * Except when the rq is capped by uclamp_max. */ if (!uclamp_rq_is_capped(cpu_rq(sg_cpu->cpu)) && - sugov_cpu_is_busy(sg_cpu) && next_f < sg_policy->next_freq) { + sugov_cpu_is_busy(sg_cpu) && next_f < sg_policy->next_freq && + !sg_policy->need_freq_update) { next_f = sg_policy->next_freq; /* Restore cached freq as next_freq has changed */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/sched/deadline.c +++ linux-aws-6.5-6.5.0/kernel/sched/deadline.c @@ -2449,9 +2449,11 @@ double_unlock_balance(this_rq, src_rq); if (push_task) { + preempt_disable(); raw_spin_rq_unlock(this_rq); stop_one_cpu_nowait(src_rq->cpu, push_cpu_stop, push_task, &src_rq->push_work); + preempt_enable(); raw_spin_rq_lock(this_rq); } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/sched/topology.c +++ linux-aws-6.5-6.5.0/kernel/sched/topology.c @@ -2113,12 +2113,16 @@ */ int sched_numa_find_nth_cpu(const struct cpumask *cpus, int cpu, int node) { - struct __cmp_key k = { .cpus = cpus, .node = node, .cpu = cpu }; + struct __cmp_key k = { .cpus = cpus, .cpu = cpu }; struct cpumask ***hop_masks; int hop, ret = nr_cpu_ids; rcu_read_lock(); + /* CPU-less node entries are uninitialized in sched_domains_numa_masks */ + node = numa_nearest_node(node, N_CPU); + k.node = node; + k.masks = rcu_dereference(sched_domains_numa_masks); if (!k.masks) goto unlock; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/smp.c +++ linux-aws-6.5-6.5.0/kernel/smp.c @@ -168,6 +168,8 @@ static ulong csd_lock_timeout = 5000; /* CSD lock timeout in milliseconds. */ module_param(csd_lock_timeout, ulong, 0444); +static int panic_on_ipistall; /* CSD panic timeout in milliseconds, 300000 for five minutes. */ +module_param(panic_on_ipistall, int, 0444); static atomic_t csd_bug_count = ATOMIC_INIT(0); @@ -228,6 +230,7 @@ } ts2 = sched_clock(); + /* How long since we last checked for a stuck CSD lock.*/ ts_delta = ts2 - *ts1; if (likely(ts_delta <= csd_lock_timeout_ns || csd_lock_timeout_ns == 0)) return false; @@ -241,9 +244,17 @@ else cpux = cpu; cpu_cur_csd = smp_load_acquire(&per_cpu(cur_csd, cpux)); /* Before func and info. */ + /* How long since this CSD lock was stuck. */ + ts_delta = ts2 - ts0; pr_alert("csd: %s non-responsive CSD lock (#%d) on CPU#%d, waiting %llu ns for CPU#%02d %pS(%ps).\n", - firsttime ? "Detected" : "Continued", *bug_id, raw_smp_processor_id(), ts2 - ts0, + firsttime ? "Detected" : "Continued", *bug_id, raw_smp_processor_id(), ts_delta, cpu, csd->func, csd->info); + /* + * If the CSD lock is still stuck after 5 minutes, it is unlikely + * to become unstuck. Use a signed comparison to avoid triggering + * on underflows when the TSC is out of sync between sockets. + */ + BUG_ON(panic_on_ipistall > 0 && (s64)ts_delta > ((s64)panic_on_ipistall * NSEC_PER_MSEC)); if (cpu_cur_csd && csd != cpu_cur_csd) { pr_alert("\tcsd: CSD lock (#%d) handling prior %pS(%ps) request.\n", *bug_id, READ_ONCE(per_cpu(cur_csd_func, cpux)), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/time/hrtimer.c +++ linux-aws-6.5-6.5.0/kernel/time/hrtimer.c @@ -2219,29 +2219,22 @@ } } -int hrtimers_dead_cpu(unsigned int scpu) +int hrtimers_cpu_dying(unsigned int dying_cpu) { struct hrtimer_cpu_base *old_base, *new_base; - int i; + int i, ncpu = cpumask_first(cpu_active_mask); - BUG_ON(cpu_online(scpu)); - tick_cancel_sched_timer(scpu); + tick_cancel_sched_timer(dying_cpu); + + old_base = this_cpu_ptr(&hrtimer_bases); + new_base = &per_cpu(hrtimer_bases, ncpu); - /* - * this BH disable ensures that raise_softirq_irqoff() does - * not wakeup ksoftirqd (and acquire the pi-lock) while - * holding the cpu_base lock - */ - local_bh_disable(); - local_irq_disable(); - old_base = &per_cpu(hrtimer_bases, scpu); - new_base = this_cpu_ptr(&hrtimer_bases); /* * The caller is globally serialized and nobody else * takes two locks at once, deadlock is not possible. */ - raw_spin_lock(&new_base->lock); - raw_spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING); + raw_spin_lock(&old_base->lock); + raw_spin_lock_nested(&new_base->lock, SINGLE_DEPTH_NESTING); for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { migrate_hrtimer_list(&old_base->clock_base[i], @@ -2252,15 +2245,13 @@ * The migration might have changed the first expiring softirq * timer on this CPU. Update it. */ - hrtimer_update_softirq_timer(new_base, false); + __hrtimer_get_next_event(new_base, HRTIMER_ACTIVE_SOFT); + /* Tell the other CPU to retrigger the next event */ + smp_call_function_single(ncpu, retrigger_next_event, NULL, 0); - raw_spin_unlock(&old_base->lock); raw_spin_unlock(&new_base->lock); + raw_spin_unlock(&old_base->lock); - /* Check, if we got expired work to do */ - __hrtimer_peek_ahead_timers(); - local_irq_enable(); - local_bh_enable(); return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/torture.c +++ linux-aws-6.5-6.5.0/kernel/torture.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "rcu/rcu.h" MODULE_LICENSE("GPL"); @@ -83,14 +84,15 @@ * nanosecond random fuzz. This function and its friends desynchronize * testing from the timer wheel. */ -int torture_hrtimeout_ns(ktime_t baset_ns, u32 fuzzt_ns, struct torture_random_state *trsp) +int torture_hrtimeout_ns(ktime_t baset_ns, u32 fuzzt_ns, const enum hrtimer_mode mode, + struct torture_random_state *trsp) { ktime_t hto = baset_ns; if (trsp) hto += (torture_random(trsp) >> 3) % fuzzt_ns; - set_current_state(TASK_UNINTERRUPTIBLE); - return schedule_hrtimeout(&hto, HRTIMER_MODE_REL); + set_current_state(TASK_IDLE); + return schedule_hrtimeout(&hto, mode); } EXPORT_SYMBOL_GPL(torture_hrtimeout_ns); @@ -102,7 +104,7 @@ { ktime_t baset_ns = baset_us * NSEC_PER_USEC; - return torture_hrtimeout_ns(baset_ns, fuzzt_ns, trsp); + return torture_hrtimeout_ns(baset_ns, fuzzt_ns, HRTIMER_MODE_REL, trsp); } EXPORT_SYMBOL_GPL(torture_hrtimeout_us); @@ -119,7 +121,7 @@ fuzzt_ns = (u32)~0U; else fuzzt_ns = fuzzt_us * NSEC_PER_USEC; - return torture_hrtimeout_ns(baset_ns, fuzzt_ns, trsp); + return torture_hrtimeout_ns(baset_ns, fuzzt_ns, HRTIMER_MODE_REL, trsp); } EXPORT_SYMBOL_GPL(torture_hrtimeout_ms); @@ -132,7 +134,7 @@ { ktime_t baset_ns = jiffies_to_nsecs(baset_j); - return torture_hrtimeout_ns(baset_ns, jiffies_to_nsecs(1), trsp); + return torture_hrtimeout_ns(baset_ns, jiffies_to_nsecs(1), HRTIMER_MODE_REL, trsp); } EXPORT_SYMBOL_GPL(torture_hrtimeout_jiffies); @@ -149,7 +151,7 @@ fuzzt_ns = (u32)~0U; else fuzzt_ns = fuzzt_ms * NSEC_PER_MSEC; - return torture_hrtimeout_ns(baset_ns, fuzzt_ns, trsp); + return torture_hrtimeout_ns(baset_ns, fuzzt_ns, HRTIMER_MODE_REL, trsp); } EXPORT_SYMBOL_GPL(torture_hrtimeout_s); @@ -711,7 +713,7 @@ * suddenly applied to or removed from the system. */ static struct task_struct *stutter_task; -static int stutter_pause_test; +static ktime_t stutter_till_abs_time; static int stutter; static int stutter_gap; @@ -721,30 +723,16 @@ */ bool stutter_wait(const char *title) { - unsigned int i = 0; bool ret = false; - int spt; + ktime_t till_ns; cond_resched_tasks_rcu_qs(); - spt = READ_ONCE(stutter_pause_test); - for (; spt; spt = READ_ONCE(stutter_pause_test)) { - if (!ret) { - sched_set_normal(current, MAX_NICE); - ret = true; - } - if (spt == 1) { - schedule_timeout_interruptible(1); - } else if (spt == 2) { - while (READ_ONCE(stutter_pause_test)) { - if (!(i++ & 0xffff)) - torture_hrtimeout_us(10, 0, NULL); - cond_resched(); - } - } else { - schedule_timeout_interruptible(round_jiffies_relative(HZ)); - } - torture_shutdown_absorb(title); + till_ns = READ_ONCE(stutter_till_abs_time); + if (till_ns && ktime_before(ktime_get(), till_ns)) { + torture_hrtimeout_ns(till_ns, 0, HRTIMER_MODE_ABS, NULL); + ret = true; } + torture_shutdown_absorb(title); return ret; } EXPORT_SYMBOL_GPL(stutter_wait); @@ -755,23 +743,16 @@ */ static int torture_stutter(void *arg) { - DEFINE_TORTURE_RANDOM(rand); - int wtime; + ktime_t till_ns; VERBOSE_TOROUT_STRING("torture_stutter task started"); do { if (!torture_must_stop() && stutter > 1) { - wtime = stutter; - if (stutter > 2) { - WRITE_ONCE(stutter_pause_test, 1); - wtime = stutter - 3; - torture_hrtimeout_jiffies(wtime, &rand); - wtime = 2; - } - WRITE_ONCE(stutter_pause_test, 2); - torture_hrtimeout_jiffies(wtime, NULL); + till_ns = ktime_add_ns(ktime_get(), + jiffies_to_nsecs(stutter)); + WRITE_ONCE(stutter_till_abs_time, till_ns); + torture_hrtimeout_jiffies(stutter - 1, NULL); } - WRITE_ONCE(stutter_pause_test, 0); if (!torture_must_stop()) torture_hrtimeout_jiffies(stutter_gap, NULL); torture_shutdown_absorb("torture_stutter"); @@ -926,7 +907,7 @@ * it starts, you will need to open-code your own. */ int _torture_create_kthread(int (*fn)(void *arg), void *arg, char *s, char *m, - char *f, struct task_struct **tp) + char *f, struct task_struct **tp, void (*cbf)(struct task_struct *tp)) { int ret = 0; @@ -938,6 +919,10 @@ *tp = NULL; return ret; } + + if (cbf) + cbf(*tp); + wake_up_process(*tp); // Process is sleeping, so ordering provided. torture_shuffle_task_register(*tp); return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/trace/fprobe.c +++ linux-aws-6.5-6.5.0/kernel/trace/fprobe.c @@ -189,7 +189,7 @@ { int i, size; - if (num < 0) + if (num <= 0) return -EINVAL; if (!fp->exit_handler) { @@ -202,8 +202,8 @@ size = fp->nr_maxactive; else size = num * num_possible_cpus() * 2; - if (size < 0) - return -E2BIG; + if (size <= 0) + return -EINVAL; fp->rethook = rethook_alloc((void *)fp, fprobe_exit_handler); if (!fp->rethook) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/trace/rethook.c +++ linux-aws-6.5-6.5.0/kernel/trace/rethook.c @@ -63,7 +63,7 @@ */ void rethook_stop(struct rethook *rh) { - WRITE_ONCE(rh->handler, NULL); + rcu_assign_pointer(rh->handler, NULL); } /** @@ -78,11 +78,17 @@ */ void rethook_free(struct rethook *rh) { - WRITE_ONCE(rh->handler, NULL); + rethook_stop(rh); call_rcu(&rh->rcu, rethook_free_rcu); } +static inline rethook_handler_t rethook_get_handler(struct rethook *rh) +{ + return (rethook_handler_t)rcu_dereference_check(rh->handler, + rcu_read_lock_any_held()); +} + /** * rethook_alloc() - Allocate struct rethook. * @data: a data to pass the @handler when hooking the return. @@ -102,7 +108,7 @@ } rh->data = data; - rh->handler = handler; + rcu_assign_pointer(rh->handler, handler); rh->pool.head = NULL; refcount_set(&rh->ref, 1); @@ -142,9 +148,10 @@ */ void rethook_recycle(struct rethook_node *node) { - lockdep_assert_preemption_disabled(); + rethook_handler_t handler; - if (likely(READ_ONCE(node->rethook->handler))) + handler = rethook_get_handler(node->rethook); + if (likely(handler)) freelist_add(&node->freelist, &node->rethook->pool); else call_rcu(&node->rcu, free_rethook_node_rcu); @@ -160,11 +167,9 @@ */ struct rethook_node *rethook_try_get(struct rethook *rh) { - rethook_handler_t handler = READ_ONCE(rh->handler); + rethook_handler_t handler = rethook_get_handler(rh); struct freelist_node *fn; - lockdep_assert_preemption_disabled(); - /* Check whether @rh is going to be freed. */ if (unlikely(!handler)) return NULL; @@ -312,7 +317,7 @@ rhn = container_of(first, struct rethook_node, llist); if (WARN_ON_ONCE(rhn->frame != frame)) break; - handler = READ_ONCE(rhn->rethook->handler); + handler = rethook_get_handler(rhn->rethook); if (handler) handler(rhn, rhn->rethook->data, correct_ret_addr, regs); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/trace/trace_events_filter.c +++ linux-aws-6.5-6.5.0/kernel/trace/trace_events_filter.c @@ -2088,6 +2088,9 @@ struct event_filter *filter = NULL; int err; + if (file->flags & EVENT_FILE_FL_FREED) + return -ENODEV; + if (!strcmp(strstrip(filter_string), "0")) { filter_disable(file); filter = event_filter(file); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/trace/trace_kprobe.c +++ linux-aws-6.5-6.5.0/kernel/trace/trace_kprobe.c @@ -705,6 +705,41 @@ .priority = 1 /* Invoked after kprobe module callback */ }; +static int count_symbols(void *data, unsigned long unused) +{ + unsigned int *count = data; + + (*count)++; + + return 0; +} + +struct sym_count_ctx { + unsigned int count; + const char *name; +}; + +static int count_mod_symbols(void *data, const char *name, unsigned long unused) +{ + struct sym_count_ctx *ctx = data; + + if (strcmp(name, ctx->name) == 0) + ctx->count++; + + return 0; +} + +static unsigned int number_of_same_symbols(char *func_name) +{ + struct sym_count_ctx ctx = { .count = 0, .name = func_name }; + + kallsyms_on_each_match_symbol(count_symbols, func_name, &ctx.count); + + module_kallsyms_on_each_symbol(NULL, count_mod_symbols, &ctx); + + return ctx.count; +} + static int __trace_kprobe_create(int argc, const char *argv[]) { /* @@ -836,6 +871,31 @@ } } + if (symbol && !strchr(symbol, ':')) { + unsigned int count; + + count = number_of_same_symbols(symbol); + if (count > 1) { + /* + * Users should use ADDR to remove the ambiguity of + * using KSYM only. + */ + trace_probe_log_err(0, NON_UNIQ_SYMBOL); + ret = -EADDRNOTAVAIL; + + goto error; + } else if (count == 0) { + /* + * We can return ENOENT earlier than when register the + * kprobe. + */ + trace_probe_log_err(0, BAD_PROBE_ADDR); + ret = -ENOENT; + + goto error; + } + } + trace_probe_log_set_index(0); if (event) { ret = traceprobe_parse_event_name(&event, &group, gbuf, @@ -959,10 +1019,10 @@ /** * __kprobe_event_gen_cmd_start - Generate a kprobe event command from arg list * @cmd: A pointer to the dynevent_cmd struct representing the new event + * @kretprobe: Is this a return probe? * @name: The name of the kprobe event * @loc: The location of the kprobe event - * @kretprobe: Is this a return probe? - * @args: Variable number of arg (pairs), one pair for each field + * @...: Variable number of arg (pairs), one pair for each field * * NOTE: Users normally won't want to call this function directly, but * rather use the kprobe_event_gen_cmd_start() wrapper, which automatically @@ -1035,7 +1095,7 @@ /** * __kprobe_event_add_fields - Add probe fields to a kprobe command from arg list * @cmd: A pointer to the dynevent_cmd struct representing the new event - * @args: Variable number of arg (pairs), one pair for each field + * @...: Variable number of arg (pairs), one pair for each field * * NOTE: Users normally won't want to call this function directly, but * rather use the kprobe_event_add_fields() wrapper, which @@ -1699,6 +1759,7 @@ } #ifdef CONFIG_PERF_EVENTS + /* create a trace_kprobe, but don't add it to global lists */ struct trace_event_call * create_local_trace_kprobe(char *func, void *addr, unsigned long offs, @@ -1709,6 +1770,24 @@ int ret; char *event; + if (func) { + unsigned int count; + + count = number_of_same_symbols(func); + if (count > 1) + /* + * Users should use addr to remove the ambiguity of + * using func only. + */ + return ERR_PTR(-EADDRNOTAVAIL); + else if (count == 0) + /* + * We can return ENOENT earlier than when register the + * kprobe. + */ + return ERR_PTR(-ENOENT); + } + /* * local trace_kprobes are not added to dyn_event, so they are never * searched in find_trace_kprobe(). Therefore, there is no concern of only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/trace/trace_probe.h +++ linux-aws-6.5-6.5.0/kernel/trace/trace_probe.h @@ -438,6 +438,7 @@ C(BAD_MAXACT, "Invalid maxactive number"), \ C(MAXACT_TOO_BIG, "Maxactive is too big"), \ C(BAD_PROBE_ADDR, "Invalid probed address or symbol"), \ + C(NON_UNIQ_SYMBOL, "The symbol is not unique"), \ C(BAD_RETPROBE, "Retprobe address must be an function entry"), \ C(NO_TRACEPOINT, "Tracepoint is not found"), \ C(BAD_ADDR_SUFFIX, "Invalid probed address suffix"), \ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/kernel/watch_queue.c +++ linux-aws-6.5-6.5.0/kernel/watch_queue.c @@ -331,7 +331,7 @@ filter.__reserved != 0) return -EINVAL; - tf = memdup_user(_filter->filters, filter.nr_filters * sizeof(*tf)); + tf = memdup_array_user(_filter->filters, filter.nr_filters, sizeof(*tf)); if (IS_ERR(tf)) return PTR_ERR(tf); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/lib/errname.c +++ linux-aws-6.5-6.5.0/lib/errname.c @@ -111,9 +111,6 @@ E(ENOSPC), E(ENOSR), E(ENOSTR), -#ifdef ENOSYM - E(ENOSYM), -#endif E(ENOSYS), E(ENOTBLK), E(ENOTCONN), @@ -144,9 +141,6 @@ #endif E(EREMOTE), E(EREMOTEIO), -#ifdef EREMOTERELEASE - E(EREMOTERELEASE), -#endif E(ERESTART), E(ERFKILL), E(EROFS), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/lib/generic-radix-tree.c +++ linux-aws-6.5-6.5.0/lib/generic-radix-tree.c @@ -166,6 +166,10 @@ struct genradix_root *r; struct genradix_node *n; unsigned level, i; + + if (iter->offset == SIZE_MAX) + return NULL; + restart: r = READ_ONCE(radix->root); if (!r) @@ -184,10 +188,17 @@ (GENRADIX_ARY - 1); while (!n->children[i]) { + size_t objs_per_ptr = genradix_depth_size(level); + + if (iter->offset + objs_per_ptr < iter->offset) { + iter->offset = SIZE_MAX; + iter->pos = SIZE_MAX; + return NULL; + } + i++; - iter->offset = round_down(iter->offset + - genradix_depth_size(level), - genradix_depth_size(level)); + iter->offset = round_down(iter->offset + objs_per_ptr, + objs_per_ptr); iter->pos = (iter->offset >> PAGE_SHIFT) * objs_per_page; if (i == GENRADIX_ARY) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/lib/group_cpus.c +++ linux-aws-6.5-6.5.0/lib/group_cpus.c @@ -366,13 +366,25 @@ if (!masks) goto fail_node_to_cpumask; - /* Stabilize the cpumasks */ - cpus_read_lock(); build_node_to_cpumask(node_to_cpumask); + /* + * Make a local cache of 'cpu_present_mask', so the two stages + * spread can observe consistent 'cpu_present_mask' without holding + * cpu hotplug lock, then we can reduce deadlock risk with cpu + * hotplug code. + * + * Here CPU hotplug may happen when reading `cpu_present_mask`, and + * we can live with the case because it only affects that hotplug + * CPU is handled in the 1st or 2nd stage, and either way is correct + * from API user viewpoint since 2-stage spread is sort of + * optimization. + */ + cpumask_copy(npresmsk, data_race(cpu_present_mask)); + /* grouping present CPUs first */ ret = __group_cpus_evenly(curgrp, numgrps, node_to_cpumask, - cpu_present_mask, nmsk, masks); + npresmsk, nmsk, masks); if (ret < 0) goto fail_build_affinity; nr_present = ret; @@ -387,15 +399,13 @@ curgrp = 0; else curgrp = nr_present; - cpumask_andnot(npresmsk, cpu_possible_mask, cpu_present_mask); + cpumask_andnot(npresmsk, cpu_possible_mask, npresmsk); ret = __group_cpus_evenly(curgrp, numgrps, node_to_cpumask, npresmsk, nmsk, masks); if (ret >= 0) nr_others = ret; fail_build_affinity: - cpus_read_unlock(); - if (ret >= 0) WARN_ON(nr_present + nr_others < numgrps); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/lib/kunit/executor.c +++ linux-aws-6.5-6.5.0/lib/kunit/executor.c @@ -102,8 +102,10 @@ { struct kunit_suite * const *suites; - for (suites = suite_set.start; suites < suite_set.end; suites++) + for (suites = suite_set.start; suites < suite_set.end; suites++) { + kfree((*suites)->test_cases); kfree(*suites); + } kfree(suite_set.start); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/lib/zstd/common/fse_decompress.c +++ linux-aws-6.5-6.5.0/lib/zstd/common/fse_decompress.c @@ -312,7 +312,7 @@ typedef struct { short ncount[FSE_MAX_SYMBOL_VALUE + 1]; - FSE_DTable dtable[1]; /* Dynamically sized */ + FSE_DTable dtable[]; /* Dynamically sized */ } FSE_DecompressWksp; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/cma.c +++ linux-aws-6.5-6.5.0/mm/cma.c @@ -501,7 +501,7 @@ */ if (page) { for (i = 0; i < count; i++) - page_kasan_tag_reset(page + i); + page_kasan_tag_reset(nth_page(page, i)); } if (ret && !no_warn) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/damon/core.c +++ linux-aws-6.5-6.5.0/mm/damon/core.c @@ -476,20 +476,14 @@ static unsigned int damon_accesses_bp_to_nr_accesses( unsigned int accesses_bp, struct damon_attrs *attrs) { - unsigned int max_nr_accesses = - attrs->aggr_interval / attrs->sample_interval; - - return accesses_bp * max_nr_accesses / 10000; + return accesses_bp * damon_max_nr_accesses(attrs) / 10000; } /* convert nr_accesses to access ratio in bp (per 10,000) */ static unsigned int damon_nr_accesses_to_accesses_bp( unsigned int nr_accesses, struct damon_attrs *attrs) { - unsigned int max_nr_accesses = - attrs->aggr_interval / attrs->sample_interval; - - return nr_accesses * 10000 / max_nr_accesses; + return nr_accesses * 10000 / damon_max_nr_accesses(attrs); } static unsigned int damon_nr_accesses_for_new_attrs(unsigned int nr_accesses, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/damon/lru_sort.c +++ linux-aws-6.5-6.5.0/mm/damon/lru_sort.c @@ -193,9 +193,7 @@ if (err) return err; - /* aggr_interval / sample_interval is the maximum nr_accesses */ - hot_thres = damon_lru_sort_mon_attrs.aggr_interval / - damon_lru_sort_mon_attrs.sample_interval * + hot_thres = damon_max_nr_accesses(&damon_lru_sort_mon_attrs) * hot_thres_access_freq / 1000; scheme = damon_lru_sort_new_hot_scheme(hot_thres); if (!scheme) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/damon/ops-common.c +++ linux-aws-6.5-6.5.0/mm/damon/ops-common.c @@ -73,7 +73,6 @@ int damon_hot_score(struct damon_ctx *c, struct damon_region *r, struct damos *s) { - unsigned int max_nr_accesses; int freq_subscore; unsigned int age_in_sec; int age_in_log, age_subscore; @@ -81,8 +80,8 @@ unsigned int age_weight = s->quota.weight_age; int hotness; - max_nr_accesses = c->attrs.aggr_interval / c->attrs.sample_interval; - freq_subscore = r->nr_accesses * DAMON_MAX_SUBSCORE / max_nr_accesses; + freq_subscore = r->nr_accesses * DAMON_MAX_SUBSCORE / + damon_max_nr_accesses(&c->attrs); age_in_sec = (unsigned long)r->age * c->attrs.aggr_interval / 1000000; for (age_in_log = 0; age_in_log < DAMON_MAX_AGE_IN_LOG && age_in_sec; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/damon/sysfs-schemes.c +++ linux-aws-6.5-6.5.0/mm/damon/sysfs-schemes.c @@ -125,6 +125,9 @@ struct damon_sysfs_scheme_regions *regions = kmalloc(sizeof(*regions), GFP_KERNEL); + if (!regions) + return NULL; + regions->kobj = (struct kobject){}; INIT_LIST_HEAD(®ions->regions_list); regions->nr_regions = 0; @@ -1649,6 +1652,8 @@ sysfs_regions = sysfs_schemes->schemes_arr[schemes_idx]->tried_regions; region = damon_sysfs_scheme_region_alloc(r); + if (!region) + return 0; list_add_tail(®ion->list, &sysfs_regions->regions_list); sysfs_regions->nr_regions++; if (kobject_init_and_add(®ion->kobj, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/damon/sysfs.c +++ linux-aws-6.5-6.5.0/mm/damon/sysfs.c @@ -1144,64 +1144,83 @@ return err; } -/* - * Search a target in a context that corresponds to the sysfs target input. - * - * Return: pointer to the target if found, NULL if not found, or negative - * error code if the search failed. - */ -static struct damon_target *damon_sysfs_existing_target( - struct damon_sysfs_target *sys_target, struct damon_ctx *ctx) +static int damon_sysfs_update_target_pid(struct damon_target *target, int pid) { - struct pid *pid; - struct damon_target *t; + struct pid *pid_new; - if (!damon_target_has_pid(ctx)) { - /* Up to only one target for paddr could exist */ - damon_for_each_target(t, ctx) - return t; - return NULL; - } - - /* ops.id should be DAMON_OPS_VADDR or DAMON_OPS_FVADDR */ - pid = find_get_pid(sys_target->pid); - if (!pid) - return ERR_PTR(-EINVAL); - damon_for_each_target(t, ctx) { - if (t->pid == pid) { - put_pid(pid); - return t; - } + pid_new = find_get_pid(pid); + if (!pid_new) + return -EINVAL; + + if (pid_new == target->pid) { + put_pid(pid_new); + return 0; + } + + put_pid(target->pid); + target->pid = pid_new; + return 0; +} + +static int damon_sysfs_update_target(struct damon_target *target, + struct damon_ctx *ctx, + struct damon_sysfs_target *sys_target) +{ + int err = 0; + + if (damon_target_has_pid(ctx)) { + err = damon_sysfs_update_target_pid(target, sys_target->pid); + if (err) + return err; } - put_pid(pid); - return NULL; + + /* + * Do monitoring target region boundary update only if one or more + * regions are set by the user. This is for keeping current monitoring + * target results and range easier, especially for dynamic monitoring + * target regions update ops like 'vaddr'. + */ + if (sys_target->regions->nr) + err = damon_sysfs_set_regions(target, sys_target->regions); + return err; } static int damon_sysfs_set_targets(struct damon_ctx *ctx, struct damon_sysfs_targets *sysfs_targets) { - int i, err; + struct damon_target *t, *next; + int i = 0, err; /* Multiple physical address space monitoring targets makes no sense */ if (ctx->ops.id == DAMON_OPS_PADDR && sysfs_targets->nr > 1) return -EINVAL; - for (i = 0; i < sysfs_targets->nr; i++) { + damon_for_each_target_safe(t, next, ctx) { + if (i < sysfs_targets->nr) { + err = damon_sysfs_update_target(t, ctx, + sysfs_targets->targets_arr[i]); + if (err) + return err; + } else { + if (damon_target_has_pid(ctx)) + put_pid(t->pid); + damon_destroy_target(t); + } + i++; + } + + for (; i < sysfs_targets->nr; i++) { struct damon_sysfs_target *st = sysfs_targets->targets_arr[i]; - struct damon_target *t = damon_sysfs_existing_target(st, ctx); - if (IS_ERR(t)) - return PTR_ERR(t); - if (!t) - err = damon_sysfs_add_target(st, ctx); - else - err = damon_sysfs_set_regions(t, st->regions); + err = damon_sysfs_add_target(st, ctx); if (err) return err; } return 0; } +static bool damon_sysfs_schemes_regions_updating; + static void damon_sysfs_before_terminate(struct damon_ctx *ctx) { struct damon_target *t, *next; @@ -1209,10 +1228,12 @@ /* damon_sysfs_schemes_update_regions_stop() might not yet called */ kdamond = damon_sysfs_cmd_request.kdamond; - if (kdamond && damon_sysfs_cmd_request.cmd == + if (kdamond && (damon_sysfs_cmd_request.cmd == DAMON_SYSFS_CMD_UPDATE_SCHEMES_TRIED_REGIONS && + damon_sysfs_schemes_regions_updating) && ctx == kdamond->damon_ctx) { damon_sysfs_schemes_update_regions_stop(ctx); + damon_sysfs_schemes_regions_updating = false; mutex_unlock(&damon_sysfs_lock); } @@ -1331,7 +1352,6 @@ static int damon_sysfs_cmd_request_callback(struct damon_ctx *c) { struct damon_sysfs_kdamond *kdamond; - static bool damon_sysfs_schemes_regions_updating; int err = 0; /* avoid deadlock due to concurrent state_store('off') */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/filemap.c +++ linux-aws-6.5-6.5.0/mm/filemap.c @@ -3428,7 +3428,7 @@ } } - if (pmd_none(*vmf->pmd)) + if (pmd_none(*vmf->pmd) && vmf->prealloc_pte) pmd_install(mm, vmf->pmd, &vmf->prealloc_pte); return false; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/huge_memory.c +++ linux-aws-6.5-6.5.0/mm/huge_memory.c @@ -2759,13 +2759,15 @@ int nr = folio_nr_pages(folio); xas_split(&xas, folio, folio_order(folio)); - if (folio_test_swapbacked(folio)) { - __lruvec_stat_mod_folio(folio, NR_SHMEM_THPS, - -nr); - } else { - __lruvec_stat_mod_folio(folio, NR_FILE_THPS, - -nr); - filemap_nr_thps_dec(mapping); + if (folio_test_pmd_mappable(folio)) { + if (folio_test_swapbacked(folio)) { + __lruvec_stat_mod_folio(folio, + NR_SHMEM_THPS, -nr); + } else { + __lruvec_stat_mod_folio(folio, + NR_FILE_THPS, -nr); + filemap_nr_thps_dec(mapping); + } } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/hugetlb.c +++ linux-aws-6.5-6.5.0/mm/hugetlb.c @@ -96,6 +96,7 @@ static void __hugetlb_vma_unlock_write_free(struct vm_area_struct *vma); static void hugetlb_unshare_pmds(struct vm_area_struct *vma, unsigned long start, unsigned long end); +static struct resv_map *vma_resv_map(struct vm_area_struct *vma); static inline bool subpool_is_free(struct hugepage_subpool *spool) { @@ -266,6 +267,10 @@ struct hugetlb_vma_lock *vma_lock = vma->vm_private_data; down_read(&vma_lock->rw_sema); + } else if (__vma_private_lock(vma)) { + struct resv_map *resv_map = vma_resv_map(vma); + + down_read(&resv_map->rw_sema); } } @@ -275,6 +280,10 @@ struct hugetlb_vma_lock *vma_lock = vma->vm_private_data; up_read(&vma_lock->rw_sema); + } else if (__vma_private_lock(vma)) { + struct resv_map *resv_map = vma_resv_map(vma); + + up_read(&resv_map->rw_sema); } } @@ -284,6 +293,10 @@ struct hugetlb_vma_lock *vma_lock = vma->vm_private_data; down_write(&vma_lock->rw_sema); + } else if (__vma_private_lock(vma)) { + struct resv_map *resv_map = vma_resv_map(vma); + + down_write(&resv_map->rw_sema); } } @@ -293,17 +306,27 @@ struct hugetlb_vma_lock *vma_lock = vma->vm_private_data; up_write(&vma_lock->rw_sema); + } else if (__vma_private_lock(vma)) { + struct resv_map *resv_map = vma_resv_map(vma); + + up_write(&resv_map->rw_sema); } } int hugetlb_vma_trylock_write(struct vm_area_struct *vma) { - struct hugetlb_vma_lock *vma_lock = vma->vm_private_data; - if (!__vma_shareable_lock(vma)) - return 1; + if (__vma_shareable_lock(vma)) { + struct hugetlb_vma_lock *vma_lock = vma->vm_private_data; - return down_write_trylock(&vma_lock->rw_sema); + return down_write_trylock(&vma_lock->rw_sema); + } else if (__vma_private_lock(vma)) { + struct resv_map *resv_map = vma_resv_map(vma); + + return down_write_trylock(&resv_map->rw_sema); + } + + return 1; } void hugetlb_vma_assert_locked(struct vm_area_struct *vma) @@ -312,6 +335,10 @@ struct hugetlb_vma_lock *vma_lock = vma->vm_private_data; lockdep_assert_held(&vma_lock->rw_sema); + } else if (__vma_private_lock(vma)) { + struct resv_map *resv_map = vma_resv_map(vma); + + lockdep_assert_held(&resv_map->rw_sema); } } @@ -344,6 +371,11 @@ struct hugetlb_vma_lock *vma_lock = vma->vm_private_data; __hugetlb_vma_unlock_write_put(vma_lock); + } else if (__vma_private_lock(vma)) { + struct resv_map *resv_map = vma_resv_map(vma); + + /* no free for anon vmas, but still need to unlock */ + up_write(&resv_map->rw_sema); } } @@ -1062,6 +1094,7 @@ kref_init(&resv_map->refs); spin_lock_init(&resv_map->lock); INIT_LIST_HEAD(&resv_map->regions); + init_rwsem(&resv_map->rw_sema); resv_map->adds_in_progress = 0; /* @@ -1132,8 +1165,7 @@ VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma); VM_BUG_ON_VMA(vma->vm_flags & VM_MAYSHARE, vma); - set_vma_private_data(vma, (get_vma_private_data(vma) & - HPAGE_RESV_MASK) | (unsigned long)map); + set_vma_private_data(vma, (unsigned long)map); } static void set_vma_resv_flags(struct vm_area_struct *vma, unsigned long flags) @@ -1151,6 +1183,13 @@ return (get_vma_private_data(vma) & flag) != 0; } +bool __vma_private_lock(struct vm_area_struct *vma) +{ + return !(vma->vm_flags & VM_MAYSHARE) && + get_vma_private_data(vma) & ~HPAGE_RESV_MASK && + is_vma_resv_set(vma, HPAGE_RESV_OWNER); +} + void hugetlb_dup_vma_private(struct vm_area_struct *vma) { VM_BUG_ON_VMA(!is_vm_hugetlb_page(vma), vma); @@ -6489,13 +6528,7 @@ struct page *page = NULL; spinlock_t *ptl; pte_t *pte, entry; - - /* - * FOLL_PIN is not supported for follow_page(). Ordinary GUP goes via - * follow_hugetlb_page(). - */ - if (WARN_ON_ONCE(flags & FOLL_PIN)) - return NULL; + int ret; hugetlb_vma_lock_read(vma); pte = hugetlb_walk(vma, haddr, huge_page_size(h)); @@ -6505,8 +6538,23 @@ ptl = huge_pte_lock(h, mm, pte); entry = huge_ptep_get(pte); if (pte_present(entry)) { - page = pte_page(entry) + - ((address & ~huge_page_mask(h)) >> PAGE_SHIFT); + page = pte_page(entry); + + if (!huge_pte_write(entry)) { + if (flags & FOLL_WRITE) { + page = NULL; + goto out; + } + + if (gup_must_unshare(vma, flags, page)) { + /* Tell the caller to do unsharing */ + page = ERR_PTR(-EMLINK); + goto out; + } + } + + page = nth_page(page, ((address & ~huge_page_mask(h)) >> PAGE_SHIFT)); + /* * Note that page may be a sub-page, and with vmemmap * optimizations the page struct may be read only. @@ -6516,8 +6564,10 @@ * try_grab_page() should always be able to get the page here, * because we hold the ptl lock and have verified pte_present(). */ - if (try_grab_page(page, flags)) { - page = NULL; + ret = try_grab_page(page, flags); + + if (WARN_ON_ONCE(ret)) { + page = ERR_PTR(ret); goto out; } } @@ -7015,8 +7065,10 @@ */ if (chg >= 0 && add < 0) region_abort(resv_map, from, to, regions_needed); - if (vma && is_vma_resv_set(vma, HPAGE_RESV_OWNER)) + if (vma && is_vma_resv_set(vma, HPAGE_RESV_OWNER)) { kref_put(&resv_map->refs, resv_map_release); + set_vma_resv_map(vma, NULL); + } return false; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/kasan/report.c +++ linux-aws-6.5-6.5.0/mm/kasan/report.c @@ -621,9 +621,8 @@ } #endif /* CONFIG_KASAN_HW_TAGS */ -#ifdef CONFIG_KASAN_INLINE /* - * With CONFIG_KASAN_INLINE, accesses to bogus pointers (outside the high + * With CONFIG_KASAN, accesses to bogus pointers (outside the high * canonical half of the address space) cause out-of-bounds shadow memory reads * before the actual access. For addresses in the low canonical half of the * address space, as well as most non-canonical addresses, that out-of-bounds @@ -659,4 +658,3 @@ pr_alert("KASAN: %s in range [0x%016lx-0x%016lx]\n", bug_type, orig_addr, orig_addr + KASAN_GRANULE_SIZE - 1); } -#endif only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/memory_hotplug.c +++ linux-aws-6.5-6.5.0/mm/memory_hotplug.c @@ -1063,6 +1063,9 @@ kasan_remove_zero_shadow(__va(PFN_PHYS(pfn)), PFN_PHYS(nr_pages)); } +/* + * Must be called with mem_hotplug_lock in write mode. + */ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, struct zone *zone, struct memory_group *group) { @@ -1083,7 +1086,6 @@ !IS_ALIGNED(pfn + nr_pages, PAGES_PER_SECTION))) return -EINVAL; - mem_hotplug_begin(); /* associate pfn range with the zone */ move_pfn_range_to_zone(zone, pfn, nr_pages, NULL, MIGRATE_ISOLATE); @@ -1142,7 +1144,6 @@ writeback_set_ratelimit(); memory_notify(MEM_ONLINE, &arg); - mem_hotplug_done(); return 0; failed_addition: @@ -1151,7 +1152,6 @@ (((unsigned long long) pfn + nr_pages) << PAGE_SHIFT) - 1); memory_notify(MEM_CANCEL_ONLINE, &arg); remove_pfn_range_from_zone(zone, pfn, nr_pages); - mem_hotplug_done(); return ret; } @@ -1357,7 +1357,7 @@ ret = create_memory_block_devices(start, size, mhp_altmap.alloc, group); if (ret) { - arch_remove_memory(start, size, NULL); + arch_remove_memory(start, size, params.altmap); goto error; } @@ -1586,7 +1586,7 @@ */ if (HPageMigratable(head)) goto found; - skip = compound_nr(head) - (page - head); + skip = compound_nr(head) - (pfn - page_to_pfn(head)); pfn += skip - 1; } return -ENOENT; @@ -1760,6 +1760,9 @@ return 0; } +/* + * Must be called with mem_hotplug_lock in write mode. + */ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages, struct zone *zone, struct memory_group *group) { @@ -1782,8 +1785,6 @@ !IS_ALIGNED(start_pfn + nr_pages, PAGES_PER_SECTION))) return -EINVAL; - mem_hotplug_begin(); - /* * Don't allow to offline memory blocks that contain holes. * Consequently, memory blocks with holes can never get onlined @@ -1919,7 +1920,6 @@ memory_notify(MEM_OFFLINE, &arg); remove_pfn_range_from_zone(zone, start_pfn, nr_pages); - mem_hotplug_done(); return 0; failed_removal_isolated: @@ -1934,7 +1934,6 @@ (unsigned long long) start_pfn << PAGE_SHIFT, ((unsigned long long) end_pfn << PAGE_SHIFT) - 1, reason); - mem_hotplug_done(); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/migrate.c +++ linux-aws-6.5-6.5.0/mm/migrate.c @@ -2160,6 +2160,7 @@ const int __user *nodes, int __user *status, int flags) { + compat_uptr_t __user *compat_pages = (void __user *)pages; int current_node = NUMA_NO_NODE; LIST_HEAD(pagelist); int start, i; @@ -2172,8 +2173,17 @@ int node; err = -EFAULT; - if (get_user(p, pages + i)) - goto out_flush; + if (in_compat_syscall()) { + compat_uptr_t cp; + + if (get_user(cp, compat_pages + i)) + goto out_flush; + + p = compat_ptr(cp); + } else { + if (get_user(p, pages + i)) + goto out_flush; + } if (get_user(node, nodes + i)) goto out_flush; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/page-writeback.c +++ linux-aws-6.5-6.5.0/mm/page-writeback.c @@ -3131,7 +3131,7 @@ */ void folio_wait_stable(struct folio *folio) { - if (folio_inode(folio)->i_sb->s_iflags & SB_I_STABLE_WRITES) + if (mapping_stable_writes(folio_mapping(folio))) folio_wait_writeback(folio); } EXPORT_SYMBOL_GPL(folio_wait_stable); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/mm/readahead.c +++ linux-aws-6.5-6.5.0/mm/readahead.c @@ -748,7 +748,8 @@ */ ret = -EINVAL; if (!f.file->f_mapping || !f.file->f_mapping->a_ops || - !S_ISREG(file_inode(f.file)->i_mode)) + (!S_ISREG(file_inode(f.file)->i_mode) && + !S_ISBLK(file_inode(f.file)->i_mode))) goto out; ret = vfs_fadvise(f.file, offset, count, POSIX_FADV_WILLNEED); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/9p/client.c +++ linux-aws-6.5-6.5.0/net/9p/client.c @@ -540,12 +540,14 @@ return 0; if (!p9_is_proto_dotl(c)) { - char *ename; + char *ename = NULL; err = p9pdu_readf(&req->rc, c->proto_version, "s?d", &ename, &ecode); - if (err) + if (err) { + kfree(ename); goto out_err; + } if (p9_is_proto_dotu(c) && ecode < 512) err = -ecode; @@ -1979,7 +1981,7 @@ goto error; } p9_debug(P9_DEBUG_9P, - ">>> TXATTRWALK file_fid %d, attr_fid %d name %s\n", + ">>> TXATTRWALK file_fid %d, attr_fid %d name '%s'\n", file_fid->fid, attr_fid->fid, attr_name); req = p9_client_rpc(clnt, P9_TXATTRWALK, "dds", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/bluetooth/af_bluetooth.c +++ linux-aws-6.5-6.5.0/net/bluetooth/af_bluetooth.c @@ -264,11 +264,14 @@ if (flags & MSG_OOB) return -EOPNOTSUPP; + lock_sock(sk); + skb = skb_recv_datagram(sk, flags, &err); if (!skb) { if (sk->sk_shutdown & RCV_SHUTDOWN) - return 0; + err = 0; + release_sock(sk); return err; } @@ -294,6 +297,8 @@ skb_free_datagram(sk, skb); + release_sock(sk); + if (flags & MSG_TRUNC) copied = skblen; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/bluetooth/amp.c +++ linux-aws-6.5-6.5.0/net/bluetooth/amp.c @@ -109,7 +109,7 @@ struct hci_conn *hcon; u8 role = out ? HCI_ROLE_MASTER : HCI_ROLE_SLAVE; - hcon = hci_conn_add(hdev, AMP_LINK, dst, role); + hcon = hci_conn_add(hdev, AMP_LINK, dst, role, __next_handle(mgr)); if (!hcon) return NULL; @@ -117,7 +117,6 @@ hcon->state = BT_CONNECT; hcon->attempt++; - hcon->handle = __next_handle(mgr); hcon->remote_id = remote_id; hcon->amp_mgr = amp_mgr_get(mgr); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/bluetooth/hci_sock.c +++ linux-aws-6.5-6.5.0/net/bluetooth/hci_sock.c @@ -439,7 +439,8 @@ ni->type = hdev->dev_type; ni->bus = hdev->bus; bacpy(&ni->bdaddr, &hdev->bdaddr); - memcpy(ni->name, hdev->name, 8); + memcpy_and_pad(ni->name, sizeof(ni->name), hdev->name, + strnlen(hdev->name, sizeof(ni->name)), '\0'); opcode = cpu_to_le16(HCI_MON_NEW_INDEX); break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/bluetooth/hci_sysfs.c +++ linux-aws-6.5-6.5.0/net/bluetooth/hci_sysfs.c @@ -35,7 +35,7 @@ { struct hci_dev *hdev = conn->hdev; - BT_DBG("conn %p", conn); + bt_dev_dbg(hdev, "conn %p", conn); conn->dev.type = &bt_link; conn->dev.class = &bt_class; @@ -48,27 +48,30 @@ { struct hci_dev *hdev = conn->hdev; - BT_DBG("conn %p", conn); + bt_dev_dbg(hdev, "conn %p", conn); if (device_is_registered(&conn->dev)) return; dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle); - if (device_add(&conn->dev) < 0) { + if (device_add(&conn->dev) < 0) bt_dev_err(hdev, "failed to register connection device"); - return; - } - - hci_dev_hold(hdev); } void hci_conn_del_sysfs(struct hci_conn *conn) { struct hci_dev *hdev = conn->hdev; - if (!device_is_registered(&conn->dev)) + bt_dev_dbg(hdev, "conn %p", conn); + + if (!device_is_registered(&conn->dev)) { + /* If device_add() has *not* succeeded, use *only* put_device() + * to drop the reference count. + */ + put_device(&conn->dev); return; + } while (1) { struct device *dev; @@ -80,9 +83,7 @@ put_device(dev); } - device_del(&conn->dev); - - hci_dev_put(hdev); + device_unregister(&conn->dev); } static void bt_host_release(struct device *dev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/bluetooth/l2cap_core.c +++ linux-aws-6.5-6.5.0/net/bluetooth/l2cap_core.c @@ -6492,6 +6492,14 @@ kfree_skb(skb); } +static inline void l2cap_sig_send_rej(struct l2cap_conn *conn, u16 ident) +{ + struct l2cap_cmd_rej_unk rej; + + rej.reason = cpu_to_le16(L2CAP_REJ_NOT_UNDERSTOOD); + l2cap_send_cmd(conn, ident, L2CAP_COMMAND_REJ, sizeof(rej), &rej); +} + static inline void l2cap_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb) { @@ -6517,23 +6525,24 @@ if (len > skb->len || !cmd->ident) { BT_DBG("corrupted command"); + l2cap_sig_send_rej(conn, cmd->ident); break; } err = l2cap_bredr_sig_cmd(conn, cmd, len, skb->data); if (err) { - struct l2cap_cmd_rej_unk rej; - BT_ERR("Wrong link type (%d)", err); - - rej.reason = cpu_to_le16(L2CAP_REJ_NOT_UNDERSTOOD); - l2cap_send_cmd(conn, cmd->ident, L2CAP_COMMAND_REJ, - sizeof(rej), &rej); + l2cap_sig_send_rej(conn, cmd->ident); } skb_pull(skb, len); } + if (skb->len > 0) { + BT_DBG("corrupted command"); + l2cap_sig_send_rej(conn, 0); + } + drop: kfree_skb(skb); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/bridge/netfilter/nf_conntrack_bridge.c +++ linux-aws-6.5-6.5.0/net/bridge/netfilter/nf_conntrack_bridge.c @@ -37,7 +37,7 @@ ktime_t tstamp = skb->tstamp; struct ip_frag_state state; struct iphdr *iph; - int err; + int err = 0; /* for offloaded checksums cleanup checksum before fragmentation */ if (skb->ip_summed == CHECKSUM_PARTIAL && only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/core/dev.h +++ linux-aws-6.5-6.5.0/net/core/dev.h @@ -62,6 +62,9 @@ int netdev_get_name(struct net *net, char *name, int ifindex); int dev_change_name(struct net_device *dev, const char *newname); +#define netdev_for_each_altname(dev, namenode) \ + list_for_each_entry((namenode), &(dev)->name_node->list, list) + int netdev_name_node_alt_create(struct net_device *dev, const char *name); int netdev_name_node_alt_destroy(struct net_device *dev, const char *name); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/core/drop_monitor.c +++ linux-aws-6.5-6.5.0/net/core/drop_monitor.c @@ -183,7 +183,7 @@ } static const struct genl_multicast_group dropmon_mcgrps[] = { - { .name = "events", }, + { .name = "events", .cap_sys_admin = 1 }, }; static void send_dm_alert(struct work_struct *work) @@ -1619,11 +1619,13 @@ .cmd = NET_DM_CMD_START, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = net_dm_cmd_trace, + .flags = GENL_ADMIN_PERM, }, { .cmd = NET_DM_CMD_STOP, .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = net_dm_cmd_trace, + .flags = GENL_ADMIN_PERM, }, { .cmd = NET_DM_CMD_CONFIG_GET, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/core/page_pool.c +++ linux-aws-6.5-6.5.0/net/core/page_pool.c @@ -210,8 +210,12 @@ return -ENOMEM; #endif - if (ptr_ring_init(&pool->ring, ring_qsize, GFP_KERNEL) < 0) + if (ptr_ring_init(&pool->ring, ring_qsize, GFP_KERNEL) < 0) { +#ifdef CONFIG_PAGE_POOL_STATS + free_percpu(pool->recycle_stats); +#endif return -ENOMEM; + } atomic_set(&pool->pages_state_release_cnt, 0); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/core/pktgen.c +++ linux-aws-6.5-6.5.0/net/core/pktgen.c @@ -669,19 +669,19 @@ seq_puts(seq, " Flags: "); for (i = 0; i < NR_PKT_FLAGS; i++) { - if (i == F_FLOW_SEQ) + if (i == FLOW_SEQ_SHIFT) if (!pkt_dev->cflows) continue; - if (pkt_dev->flags & (1 << i)) + if (pkt_dev->flags & (1 << i)) { seq_printf(seq, "%s ", pkt_flag_names[i]); - else if (i == F_FLOW_SEQ) - seq_puts(seq, "FLOW_RND "); - #ifdef CONFIG_XFRM - if (i == F_IPSEC && pkt_dev->spi) - seq_printf(seq, "spi:%u", pkt_dev->spi); + if (i == IPSEC_SHIFT && pkt_dev->spi) + seq_printf(seq, "spi:%u ", pkt_dev->spi); #endif + } else if (i == FLOW_SEQ_SHIFT) { + seq_puts(seq, "FLOW_RND "); + } } seq_puts(seq, "\n"); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/core/rtnetlink.c +++ linux-aws-6.5-6.5.0/net/core/rtnetlink.c @@ -5504,13 +5504,11 @@ rtnl_offload_xstats_get_size_hw_s_info_one(const struct net_device *dev, enum netdev_offload_xstats_type type) { - bool enabled = netdev_offload_xstats_enabled(dev, type); - return nla_total_size(0) + /* IFLA_OFFLOAD_XSTATS_HW_S_INFO_REQUEST */ nla_total_size(sizeof(u8)) + /* IFLA_OFFLOAD_XSTATS_HW_S_INFO_USED */ - (enabled ? nla_total_size(sizeof(u8)) : 0) + + nla_total_size(sizeof(u8)) + 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/core/stream.c +++ linux-aws-6.5-6.5.0/net/core/stream.c @@ -117,7 +117,7 @@ */ int sk_stream_wait_memory(struct sock *sk, long *timeo_p) { - int err = 0; + int ret, err = 0; long vm_wait = 0; long current_timeo = *timeo_p; DEFINE_WAIT_FUNC(wait, woken_wake_function); @@ -142,11 +142,13 @@ set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); sk->sk_write_pending++; - sk_wait_event(sk, ¤t_timeo, READ_ONCE(sk->sk_err) || - (READ_ONCE(sk->sk_shutdown) & SEND_SHUTDOWN) || - (sk_stream_memory_free(sk) && - !vm_wait), &wait); + ret = sk_wait_event(sk, ¤t_timeo, READ_ONCE(sk->sk_err) || + (READ_ONCE(sk->sk_shutdown) & SEND_SHUTDOWN) || + (sk_stream_memory_free(sk) && !vm_wait), + &wait); sk->sk_write_pending--; + if (ret < 0) + goto do_error; if (vm_wait) { vm_wait -= current_timeo; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ethtool/netlink.c +++ linux-aws-6.5-6.5.0/net/ethtool/netlink.c @@ -531,6 +531,7 @@ idx++; } + ret = 0; } rtnl_unlock(); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/af_inet.c +++ linux-aws-6.5-6.5.0/net/ipv4/af_inet.c @@ -587,7 +587,6 @@ add_wait_queue(sk_sleep(sk), &wait); sk->sk_write_pending += writebias; - sk->sk_wait_pending++; /* Basic assumption: if someone sets sk->sk_err, he _must_ * change state of the socket from TCP_SYN_*. @@ -603,7 +602,6 @@ } remove_wait_queue(sk_sleep(sk), &wait); sk->sk_write_pending -= writebias; - sk->sk_wait_pending--; return timeo; } @@ -632,6 +630,7 @@ return -EINVAL; if (uaddr->sa_family == AF_UNSPEC) { + sk->sk_disconnects++; err = sk->sk_prot->disconnect(sk, flags); sock->state = err ? SS_DISCONNECTING : SS_UNCONNECTED; goto out; @@ -686,6 +685,7 @@ int writebias = (sk->sk_protocol == IPPROTO_TCP) && tcp_sk(sk)->fastopen_req && tcp_sk(sk)->fastopen_req->data ? 1 : 0; + int dis = sk->sk_disconnects; /* Error code is set above */ if (!timeo || !inet_wait_for_connect(sk, timeo, writebias)) @@ -694,6 +694,11 @@ err = sock_intr_errno(timeo); if (signal_pending(current)) goto out; + + if (dis != sk->sk_disconnects) { + err = -EPIPE; + goto out; + } } /* Connection was closed by RST, timeout, ICMP error @@ -715,6 +720,7 @@ sock_error: err = sock_error(sk) ? : -ECONNABORTED; sock->state = SS_UNCONNECTED; + sk->sk_disconnects++; if (sk->sk_prot->disconnect(sk, flags)) sock->state = SS_DISCONNECTING; goto out; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/esp4.c +++ linux-aws-6.5-6.5.0/net/ipv4/esp4.c @@ -732,7 +732,9 @@ skb->csum = csum_block_sub(skb->csum, csumdiff, skb->len - trimlen); } - pskb_trim(skb, skb->len - trimlen); + ret = pskb_trim(skb, skb->len - trimlen); + if (unlikely(ret)) + return ret; ret = nexthdr[1]; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/inet_connection_sock.c +++ linux-aws-6.5-6.5.0/net/ipv4/inet_connection_sock.c @@ -1145,7 +1145,6 @@ if (newsk) { struct inet_connection_sock *newicsk = inet_csk(newsk); - newsk->sk_wait_pending = 0; inet_sk_set_state(newsk, TCP_SYN_RECV); newicsk->icsk_bind_hash = NULL; newicsk->icsk_bind2_hash = NULL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/ip_gre.c +++ linux-aws-6.5-6.5.0/net/ipv4/ip_gre.c @@ -635,15 +635,18 @@ } if (dev->header_ops) { + int pull_len = tunnel->hlen + sizeof(struct iphdr); + if (skb_cow_head(skb, 0)) goto free_skb; tnl_params = (const struct iphdr *)skb->data; - /* Pull skb since ip_tunnel_xmit() needs skb->data pointing - * to gre header. - */ - skb_pull(skb, tunnel->hlen + sizeof(struct iphdr)); + if (!pskb_network_may_pull(skb, pull_len)) + goto free_skb; + + /* ip_tunnel_xmit() needs skb->data pointing to gre header. */ + skb_pull(skb, pull_len); skb_reset_mac_header(skb); if (skb->ip_summed == CHECKSUM_PARTIAL && only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/syncookies.c +++ linux-aws-6.5-6.5.0/net/ipv4/syncookies.c @@ -41,7 +41,6 @@ * requested/supported by the syn/synack exchange. */ #define TSBITS 6 -#define TSMASK (((__u32)1 << TSBITS) - 1) static u32 cookie_hash(__be32 saddr, __be32 daddr, __be16 sport, __be16 dport, u32 count, int c) @@ -62,27 +61,22 @@ */ u64 cookie_init_timestamp(struct request_sock *req, u64 now) { - struct inet_request_sock *ireq; - u32 ts, ts_now = tcp_ns_to_ts(now); + const struct inet_request_sock *ireq = inet_rsk(req); + u64 ts, ts_now = tcp_ns_to_ts(now); u32 options = 0; - ireq = inet_rsk(req); - options = ireq->wscale_ok ? ireq->snd_wscale : TS_OPT_WSCALE_MASK; if (ireq->sack_ok) options |= TS_OPT_SACK; if (ireq->ecn_ok) options |= TS_OPT_ECN; - ts = ts_now & ~TSMASK; + ts = (ts_now >> TSBITS) << TSBITS; ts |= options; - if (ts > ts_now) { - ts >>= TSBITS; - ts--; - ts <<= TSBITS; - ts |= options; - } - return (u64)ts * (NSEC_PER_SEC / TCP_TS_HZ); + if (ts > ts_now) + ts -= (1UL << TSBITS); + + return ts * (NSEC_PER_SEC / TCP_TS_HZ); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/tcp_ipv4.c +++ linux-aws-6.5-6.5.0/net/ipv4/tcp_ipv4.c @@ -1869,6 +1869,7 @@ #ifdef CONFIG_TLS_DEVICE tail->decrypted != skb->decrypted || #endif + !mptcp_skb_can_collapse(tail, skb) || thtail->doff != th->doff || memcmp(thtail + 1, th + 1, hdrlen - sizeof(*th))) goto no_coalesce; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/tcp_metrics.c +++ linux-aws-6.5-6.5.0/net/ipv4/tcp_metrics.c @@ -470,11 +470,15 @@ u32 val, crtt = 0; /* cached RTT scaled by 8 */ sk_dst_confirm(sk); + /* ssthresh may have been reduced unnecessarily during. + * 3WHS. Restore it back to its initial default. + */ + tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; if (!dst) goto reset; rcu_read_lock(); - tm = tcp_get_metrics(sk, dst, true); + tm = tcp_get_metrics(sk, dst, false); if (!tm) { rcu_read_unlock(); goto reset; @@ -489,11 +493,6 @@ tp->snd_ssthresh = val; if (tp->snd_ssthresh > tp->snd_cwnd_clamp) tp->snd_ssthresh = tp->snd_cwnd_clamp; - } else { - /* ssthresh may have been reduced unnecessarily during. - * 3WHS. Restore it back to its initial default. - */ - tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; } val = tcp_metric_get(tm, TCP_METRIC_REORDERING); if (val && tp->reordering != val) @@ -908,7 +907,7 @@ match = net ? net_eq(tm_net(tm), net) : !refcount_read(&tm_net(tm)->ns.count); if (match) { - *pp = tm->tcpm_next; + rcu_assign_pointer(*pp, tm->tcpm_next); kfree_rcu(tm, rcu_head); } else { pp = &tm->tcpm_next; @@ -949,7 +948,7 @@ if (addr_same(&tm->tcpm_daddr, &daddr) && (!src || addr_same(&tm->tcpm_saddr, &saddr)) && net_eq(tm_net(tm), net)) { - *pp = tm->tcpm_next; + rcu_assign_pointer(*pp, tm->tcpm_next); kfree_rcu(tm, rcu_head); found = true; } else { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/tcp_recovery.c +++ linux-aws-6.5-6.5.0/net/ipv4/tcp_recovery.c @@ -104,7 +104,7 @@ tp->rack.advanced = 0; tcp_rack_detect_loss(sk, &timeout); if (timeout) { - timeout = usecs_to_jiffies(timeout) + TCP_TIMEOUT_MIN; + timeout = usecs_to_jiffies(timeout + TCP_TIMEOUT_MIN_US); inet_csk_reset_xmit_timer(sk, ICSK_TIME_REO_TIMEOUT, timeout, inet_csk(sk)->icsk_rto); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/udp_offload.c +++ linux-aws-6.5-6.5.0/net/ipv4/udp_offload.c @@ -557,10 +557,10 @@ NAPI_GRO_CB(skb)->is_flist = 0; if (!sk || !udp_sk(sk)->gro_receive) { if (skb->dev->features & NETIF_F_GRO_FRAGLIST) - NAPI_GRO_CB(skb)->is_flist = sk ? !udp_sk(sk)->gro_enabled : 1; + NAPI_GRO_CB(skb)->is_flist = sk ? !udp_test_bit(GRO_ENABLED, sk) : 1; if ((!sk && (skb->dev->features & NETIF_F_GRO_UDP_FWD)) || - (sk && udp_sk(sk)->gro_enabled) || NAPI_GRO_CB(skb)->is_flist) + (sk && udp_test_bit(GRO_ENABLED, sk)) || NAPI_GRO_CB(skb)->is_flist) return call_gro_receive(udp_gro_receive_segment, head, skb); /* no GRO, be sure flush the current packet */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/udp_tunnel_core.c +++ linux-aws-6.5-6.5.0/net/ipv4/udp_tunnel_core.c @@ -78,7 +78,7 @@ udp_sk(sk)->gro_receive = cfg->gro_receive; udp_sk(sk)->gro_complete = cfg->gro_complete; - udp_tunnel_encap_enable(sock); + udp_tunnel_encap_enable(sk); } EXPORT_SYMBOL_GPL(setup_udp_tunnel_sock); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/udplite.c +++ linux-aws-6.5-6.5.0/net/ipv4/udplite.c @@ -21,7 +21,6 @@ static int udplite_sk_init(struct sock *sk) { udp_init_sock(sk); - udp_sk(sk)->pcflag = UDPLITE_BIT; pr_warn_once("UDP-Lite is deprecated and scheduled to be removed in 2025, " "please contact the netdev mailing list\n"); return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv4/xfrm4_input.c +++ linux-aws-6.5-6.5.0/net/ipv4/xfrm4_input.c @@ -85,11 +85,11 @@ struct udphdr *uh; struct iphdr *iph; int iphlen, len; - __u8 *udpdata; __be32 *udpdata32; - __u16 encap_type = up->encap_type; + u16 encap_type; + encap_type = READ_ONCE(up->encap_type); /* if this is not encapsulated socket, then just return now */ if (!encap_type) return 1; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv6/esp6.c +++ linux-aws-6.5-6.5.0/net/ipv6/esp6.c @@ -770,7 +770,9 @@ skb->csum = csum_block_sub(skb->csum, csumdiff, skb->len - trimlen); } - pskb_trim(skb, skb->len - trimlen); + ret = pskb_trim(skb, skb->len - trimlen); + if (unlikely(ret)) + return ret; ret = nexthdr[1]; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv6/ip6_fib.c +++ linux-aws-6.5-6.5.0/net/ipv6/ip6_fib.c @@ -1501,13 +1501,9 @@ if (!pn_leaf && !(pn->fn_flags & RTN_RTINFO)) { pn_leaf = fib6_find_prefix(info->nl_net, table, pn); -#if RT6_DEBUG >= 2 - if (!pn_leaf) { - WARN_ON(!pn_leaf); + if (!pn_leaf) pn_leaf = info->nl_net->ipv6.fib6_null_entry; - } -#endif fib6_info_hold(pn_leaf); rcu_assign_pointer(pn->leaf, pn_leaf); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv6/syncookies.c +++ linux-aws-6.5-6.5.0/net/ipv6/syncookies.c @@ -180,14 +180,15 @@ treq = tcp_rsk(req); treq->tfo_listener = false; - if (security_inet_conn_request(sk, skb, req)) - goto out_free; - req->mss = mss; ireq->ir_rmt_port = th->source; ireq->ir_num = ntohs(th->dest); ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr; ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr; + + if (security_inet_conn_request(sk, skb, req)) + goto out_free; + if (ipv6_opt_accepted(sk, skb, &TCP_SKB_CB(skb)->header.h6) || np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv6/xfrm6_input.c +++ linux-aws-6.5-6.5.0/net/ipv6/xfrm6_input.c @@ -81,14 +81,14 @@ struct ipv6hdr *ip6h; int len; int ip6hlen = sizeof(struct ipv6hdr); - __u8 *udpdata; __be32 *udpdata32; - __u16 encap_type = up->encap_type; + u16 encap_type; if (skb->protocol == htons(ETH_P_IP)) return xfrm4_udp_encap_rcv(sk, skb); + encap_type = READ_ONCE(up->encap_type); /* if this is not encapsulated socket, then just return now */ if (!encap_type) return 1; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/ipv6/xfrm6_policy.c +++ linux-aws-6.5-6.5.0/net/ipv6/xfrm6_policy.c @@ -117,10 +117,10 @@ { struct xfrm_dst *xdst = (struct xfrm_dst *)dst; - if (likely(xdst->u.rt6.rt6i_idev)) - in6_dev_put(xdst->u.rt6.rt6i_idev); dst_destroy_metrics_generic(dst); rt6_uncached_list_del(&xdst->u.rt6); + if (likely(xdst->u.rt6.rt6i_idev)) + in6_dev_put(xdst->u.rt6.rt6i_idev); xfrm_dst_destroy(xdst); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/l2tp/l2tp_core.c +++ linux-aws-6.5-6.5.0/net/l2tp/l2tp_core.c @@ -1139,9 +1139,9 @@ switch (tunnel->encap) { case L2TP_ENCAPTYPE_UDP: /* No longer an encapsulation socket. See net/ipv4/udp.c */ - (udp_sk(sk))->encap_type = 0; - (udp_sk(sk))->encap_rcv = NULL; - (udp_sk(sk))->encap_destroy = NULL; + WRITE_ONCE(udp_sk(sk)->encap_type, 0); + udp_sk(sk)->encap_rcv = NULL; + udp_sk(sk)->encap_destroy = NULL; break; case L2TP_ENCAPTYPE_IP: break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/llc/llc_input.c +++ linux-aws-6.5-6.5.0/net/llc/llc_input.c @@ -127,8 +127,14 @@ skb->transport_header += llc_len; skb_pull(skb, llc_len); if (skb->protocol == htons(ETH_P_802_2)) { - __be16 pdulen = eth_hdr(skb)->h_proto; - s32 data_size = ntohs(pdulen) - llc_len; + __be16 pdulen; + s32 data_size; + + if (skb->mac_len < ETH_HLEN) + return 0; + + pdulen = eth_hdr(skb)->h_proto; + data_size = ntohs(pdulen) - llc_len; if (data_size < 0 || !pskb_may_pull(skb, data_size)) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/llc/llc_s_ac.c +++ linux-aws-6.5-6.5.0/net/llc/llc_s_ac.c @@ -153,6 +153,9 @@ int rc = 1; u32 data_size; + if (skb->mac_len < ETH_HLEN) + return 1; + llc_pdu_decode_sa(skb, mac_da); llc_pdu_decode_da(skb, mac_sa); llc_pdu_decode_ssap(skb, &dsap); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/llc/llc_station.c +++ linux-aws-6.5-6.5.0/net/llc/llc_station.c @@ -76,6 +76,9 @@ u32 data_size; struct sk_buff *nskb; + if (skb->mac_len < ETH_HLEN) + goto out; + /* The test request command is type U (llc_len = 3) */ data_size = ntohs(eth_hdr(skb)->h_proto) - 3; nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, data_size); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/driver-ops.c +++ linux-aws-6.5-6.5.0/net/mac80211/driver-ops.c @@ -510,10 +510,13 @@ if (ret) return ret; - for_each_set_bit(link_id, &links_to_add, IEEE80211_MLD_MAX_NUM_LINKS) { - link = rcu_access_pointer(sdata->link[link_id]); + if (!local->in_reconfig) { + for_each_set_bit(link_id, &links_to_add, + IEEE80211_MLD_MAX_NUM_LINKS) { + link = rcu_access_pointer(sdata->link[link_id]); - ieee80211_link_debugfs_drv_add(link); + ieee80211_link_debugfs_drv_add(link); + } } return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/driver-ops.h +++ linux-aws-6.5-6.5.0/net/mac80211/driver-ops.h @@ -23,7 +23,7 @@ static inline struct ieee80211_sub_if_data * get_bss_sdata(struct ieee80211_sub_if_data *sdata) { - if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) + if (sdata && sdata->vif.type == NL80211_IFTYPE_AP_VLAN) sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, u.ap); @@ -638,10 +638,13 @@ struct ieee80211_sub_if_data *sdata, u32 queues, bool drop) { - struct ieee80211_vif *vif = sdata ? &sdata->vif : NULL; + struct ieee80211_vif *vif; might_sleep(); + sdata = get_bss_sdata(sdata); + vif = sdata ? &sdata->vif : NULL; + if (sdata && !check_sdata_in_driver(sdata)) return; @@ -657,6 +660,8 @@ { might_sleep(); + sdata = get_bss_sdata(sdata); + if (sdata && !check_sdata_in_driver(sdata)) return; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/drop.h +++ linux-aws-6.5-6.5.0/net/mac80211/drop.h @@ -53,4 +53,7 @@ #undef DEF }; +#define RX_RES_IS_UNUSABLE(result) \ + (((__force u32)(result) & SKB_DROP_REASON_SUBSYS_MASK) == ___RX_DROP_UNUSABLE) + #endif /* MAC80211_DROP_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/ibss.c +++ linux-aws-6.5-6.5.0/net/mac80211/ibss.c @@ -1072,7 +1072,7 @@ &chandef); memcpy(&cap_ie, elems->vht_cap_elem, sizeof(cap_ie)); ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, - &cap_ie, + &cap_ie, NULL, &sta->deflink); if (memcmp(&cap, &sta->sta.deflink.vht_cap, sizeof(cap))) rates_updated |= true; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/iface.c +++ linux-aws-6.5-6.5.0/net/mac80211/iface.c @@ -691,7 +691,7 @@ ieee80211_recalc_ps(local); if (cancel_scan) - flush_delayed_work(&local->scan_work); + wiphy_delayed_work_flush(local->hw.wiphy, &local->scan_work); if (local->open_count == 0) { ieee80211_stop_device(local); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/link.c +++ linux-aws-6.5-6.5.0/net/mac80211/link.c @@ -195,7 +195,7 @@ memset(to_free, 0, sizeof(links)); - if (old_links == new_links) + if (old_links == new_links && dormant_links == sdata->vif.dormant_links) return 0; /* if there were no old links, need to clear the pointers to deflink */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/main.c +++ linux-aws-6.5-6.5.0/net/mac80211/main.c @@ -335,10 +335,7 @@ struct ieee80211_sub_if_data *sdata; int ret; - /* wait for scan work complete */ flush_workqueue(local->workqueue); - flush_work(&local->sched_scan_stopped_work); - flush_work(&local->radar_detected_work); rtnl_lock(); /* we might do interface manipulations, so need both */ @@ -379,8 +376,8 @@ ieee80211_scan_cancel(local); /* make sure any new ROC will consider local->in_reconfig */ - flush_delayed_work(&local->roc_work); - flush_work(&local->hw_roc_done); + wiphy_delayed_work_flush(local->hw.wiphy, &local->roc_work); + wiphy_work_flush(local->hw.wiphy, &local->hw_roc_done); /* wait for all packet processing to be done */ synchronize_net(); @@ -809,12 +806,12 @@ INIT_LIST_HEAD(&local->chanctx_list); mutex_init(&local->chanctx_mtx); - INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work); + wiphy_delayed_work_init(&local->scan_work, ieee80211_scan_work); INIT_WORK(&local->restart_work, ieee80211_restart_work); - INIT_WORK(&local->radar_detected_work, - ieee80211_dfs_radar_detected_work); + wiphy_work_init(&local->radar_detected_work, + ieee80211_dfs_radar_detected_work); INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter); local->smps_mode = IEEE80211_SMPS_OFF; @@ -825,8 +822,8 @@ ieee80211_dynamic_ps_disable_work); timer_setup(&local->dynamic_ps_timer, ieee80211_dynamic_ps_timer, 0); - INIT_WORK(&local->sched_scan_stopped_work, - ieee80211_sched_scan_stopped_work); + wiphy_work_init(&local->sched_scan_stopped_work, + ieee80211_sched_scan_stopped_work); spin_lock_init(&local->ack_status_lock); idr_init(&local->ack_status_frames); @@ -1482,13 +1479,15 @@ */ ieee80211_remove_interfaces(local); + wiphy_lock(local->hw.wiphy); + wiphy_delayed_work_cancel(local->hw.wiphy, &local->roc_work); + wiphy_work_cancel(local->hw.wiphy, &local->sched_scan_stopped_work); + wiphy_work_cancel(local->hw.wiphy, &local->radar_detected_work); + wiphy_unlock(local->hw.wiphy); rtnl_unlock(); - cancel_delayed_work_sync(&local->roc_work); cancel_work_sync(&local->restart_work); cancel_work_sync(&local->reconfig_filter); - flush_work(&local->sched_scan_stopped_work); - flush_work(&local->radar_detected_work); ieee80211_clear_tx_pending(local); rate_control_deinitialize(local); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/mesh_pathtbl.c +++ linux-aws-6.5-6.5.0/net/mac80211/mesh_pathtbl.c @@ -648,7 +648,7 @@ cache = &sdata->u.mesh.tx_cache; spin_lock_bh(&cache->walk_lock); - entry = rhashtable_lookup(&cache->rht, addr, fast_tx_rht_params); + entry = rhashtable_lookup_fast(&cache->rht, addr, fast_tx_rht_params); if (entry) mesh_fast_tx_entry_free(cache, entry); spin_unlock_bh(&cache->walk_lock); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/mesh_plink.c +++ linux-aws-6.5-6.5.0/net/mac80211/mesh_plink.c @@ -451,7 +451,7 @@ changed |= IEEE80211_RC_BW_CHANGED; ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, - elems->vht_cap_elem, + elems->vht_cap_elem, NULL, &sta->deflink); ieee80211_he_cap_ie_to_sta_he_cap(sdata, sband, elems->he_cap, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/offchannel.c +++ linux-aws-6.5-6.5.0/net/mac80211/offchannel.c @@ -230,7 +230,7 @@ if (dur == LONG_MAX) return false; - mod_delayed_work(local->workqueue, &local->roc_work, dur); + wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, dur); return true; } @@ -258,7 +258,7 @@ roc->notified = true; } -static void ieee80211_hw_roc_start(struct work_struct *work) +static void ieee80211_hw_roc_start(struct wiphy *wiphy, struct wiphy_work *work) { struct ieee80211_local *local = container_of(work, struct ieee80211_local, hw_roc_start); @@ -285,7 +285,7 @@ trace_api_ready_on_channel(local); - ieee80211_queue_work(hw, &local->hw_roc_start); + wiphy_work_queue(hw->wiphy, &local->hw_roc_start); } EXPORT_SYMBOL_GPL(ieee80211_ready_on_channel); @@ -338,7 +338,7 @@ tmp->started = true; tmp->abort = true; } - ieee80211_queue_work(&local->hw, &local->hw_roc_done); + wiphy_work_queue(local->hw.wiphy, &local->hw_roc_done); return; } @@ -368,8 +368,8 @@ ieee80211_hw_config(local, 0); } - ieee80211_queue_delayed_work(&local->hw, &local->roc_work, - msecs_to_jiffies(min_dur)); + wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, + msecs_to_jiffies(min_dur)); /* tell userspace or send frame(s) */ list_for_each_entry(tmp, &local->roc_list, list) { @@ -407,8 +407,8 @@ _ieee80211_start_next_roc(local); } else { /* delay it a bit */ - ieee80211_queue_delayed_work(&local->hw, &local->roc_work, - round_jiffies_relative(HZ/2)); + wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, + round_jiffies_relative(HZ / 2)); } } @@ -451,7 +451,7 @@ } } -static void ieee80211_roc_work(struct work_struct *work) +static void ieee80211_roc_work(struct wiphy *wiphy, struct wiphy_work *work) { struct ieee80211_local *local = container_of(work, struct ieee80211_local, roc_work.work); @@ -461,7 +461,7 @@ mutex_unlock(&local->mtx); } -static void ieee80211_hw_roc_done(struct work_struct *work) +static void ieee80211_hw_roc_done(struct wiphy *wiphy, struct wiphy_work *work) { struct ieee80211_local *local = container_of(work, struct ieee80211_local, hw_roc_done); @@ -482,7 +482,7 @@ trace_api_remain_on_channel_expired(local); - ieee80211_queue_work(hw, &local->hw_roc_done); + wiphy_work_queue(hw->wiphy, &local->hw_roc_done); } EXPORT_SYMBOL_GPL(ieee80211_remain_on_channel_expired); @@ -586,8 +586,8 @@ /* if not HW assist, just queue & schedule work */ if (!local->ops->remain_on_channel) { list_add_tail(&roc->list, &local->roc_list); - ieee80211_queue_delayed_work(&local->hw, - &local->roc_work, 0); + wiphy_delayed_work_queue(local->hw.wiphy, + &local->roc_work, 0); } else { /* otherwise actually kick it off here * (for error handling) @@ -695,7 +695,7 @@ if (!cookie) return -ENOENT; - flush_work(&local->hw_roc_start); + wiphy_work_flush(local->hw.wiphy, &local->hw_roc_start); mutex_lock(&local->mtx); list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { @@ -745,7 +745,7 @@ } else { /* go through work struct to return to the operating channel */ found->abort = true; - mod_delayed_work(local->workqueue, &local->roc_work, 0); + wiphy_delayed_work_queue(local->hw.wiphy, &local->roc_work, 0); } out_unlock: @@ -994,9 +994,9 @@ void ieee80211_roc_setup(struct ieee80211_local *local) { - INIT_WORK(&local->hw_roc_start, ieee80211_hw_roc_start); - INIT_WORK(&local->hw_roc_done, ieee80211_hw_roc_done); - INIT_DELAYED_WORK(&local->roc_work, ieee80211_roc_work); + wiphy_work_init(&local->hw_roc_start, ieee80211_hw_roc_start); + wiphy_work_init(&local->hw_roc_done, ieee80211_hw_roc_done); + wiphy_delayed_work_init(&local->roc_work, ieee80211_roc_work); INIT_LIST_HEAD(&local->roc_list); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/scan.c +++ linux-aws-6.5-6.5.0/net/mac80211/scan.c @@ -274,8 +274,8 @@ * the beacon/proberesp rx gives us an opportunity to upgrade * to active scan */ - set_bit(SCAN_BEACON_DONE, &local->scanning); - ieee80211_queue_delayed_work(&local->hw, &local->scan_work, 0); + set_bit(SCAN_BEACON_DONE, &local->scanning); + wiphy_delayed_work_queue(local->hw.wiphy, &local->scan_work, 0); } if (ieee80211_is_probe_resp(mgmt->frame_control)) { @@ -505,7 +505,7 @@ memcpy(&local->scan_info, info, sizeof(*info)); - ieee80211_queue_delayed_work(&local->hw, &local->scan_work, 0); + wiphy_delayed_work_queue(local->hw.wiphy, &local->scan_work, 0); } EXPORT_SYMBOL(ieee80211_scan_completed); @@ -545,8 +545,7 @@ /* We need to set power level at maximum rate for scanning. */ ieee80211_hw_config(local, 0); - ieee80211_queue_delayed_work(&local->hw, - &local->scan_work, 0); + wiphy_delayed_work_queue(local->hw.wiphy, &local->scan_work, 0); return 0; } @@ -603,8 +602,8 @@ lockdep_is_held(&local->mtx)))) return; - ieee80211_queue_delayed_work(&local->hw, &local->scan_work, - round_jiffies_relative(0)); + wiphy_delayed_work_queue(local->hw.wiphy, &local->scan_work, + round_jiffies_relative(0)); } static void ieee80211_send_scan_probe_req(struct ieee80211_sub_if_data *sdata, @@ -795,8 +794,8 @@ } /* Now, just wait a bit and we are all done! */ - ieee80211_queue_delayed_work(&local->hw, &local->scan_work, - next_delay); + wiphy_delayed_work_queue(local->hw.wiphy, &local->scan_work, + next_delay); return 0; } else { /* Do normal software scan */ @@ -1043,7 +1042,7 @@ local->next_scan_state = SCAN_SET_CHANNEL; } -void ieee80211_scan_work(struct work_struct *work) +void ieee80211_scan_work(struct wiphy *wiphy, struct wiphy_work *work) { struct ieee80211_local *local = container_of(work, struct ieee80211_local, scan_work.work); @@ -1137,7 +1136,8 @@ } } while (next_delay == 0); - ieee80211_queue_delayed_work(&local->hw, &local->scan_work, next_delay); + wiphy_delayed_work_queue(local->hw.wiphy, &local->scan_work, + next_delay); goto out; out_complete: @@ -1280,12 +1280,7 @@ goto out; } - /* - * If the work is currently running, it must be blocked on - * the mutex, but we'll set scan_sdata = NULL and it'll - * simply exit once it acquires the mutex. - */ - cancel_delayed_work(&local->scan_work); + wiphy_delayed_work_cancel(local->hw.wiphy, &local->scan_work); /* and clean up */ memset(&local->scan_info, 0, sizeof(local->scan_info)); __ieee80211_scan_completed(&local->hw, true); @@ -1427,10 +1422,11 @@ mutex_unlock(&local->mtx); - cfg80211_sched_scan_stopped(local->hw.wiphy, 0); + cfg80211_sched_scan_stopped_locked(local->hw.wiphy, 0); } -void ieee80211_sched_scan_stopped_work(struct work_struct *work) +void ieee80211_sched_scan_stopped_work(struct wiphy *wiphy, + struct wiphy_work *work) { struct ieee80211_local *local = container_of(work, struct ieee80211_local, @@ -1453,6 +1449,6 @@ if (local->in_reconfig) return; - schedule_work(&local->sched_scan_stopped_work); + wiphy_work_queue(hw->wiphy, &local->sched_scan_stopped_work); } EXPORT_SYMBOL(ieee80211_sched_scan_stopped); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/sta_info.c +++ linux-aws-6.5-6.5.0/net/mac80211/sta_info.c @@ -2990,7 +2990,7 @@ WLAN_EXT_CAPA9_MAX_MSDU_IN_AMSDU_MSB) << 1; if (val) - sta->sta.max_amsdu_subframes = 4 << val; + sta->sta.max_amsdu_subframes = 4 << (4 - val); } #ifdef CONFIG_LOCKDEP only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/tx.c +++ linux-aws-6.5-6.5.0/net/mac80211/tx.c @@ -665,7 +665,8 @@ } if (unlikely(tx->key && tx->key->flags & KEY_FLAG_TAINTED && - !ieee80211_is_deauth(hdr->frame_control))) + !ieee80211_is_deauth(hdr->frame_control)) && + tx->skb->protocol != tx->sdata->control_port_protocol) return TX_DROP; if (!skip_hw && tx->key && only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/util.c +++ linux-aws-6.5-6.5.0/net/mac80211/util.c @@ -2340,8 +2340,8 @@ */ if (aborted) set_bit(SCAN_ABORTED, &local->scanning); - ieee80211_queue_delayed_work(&local->hw, &local->scan_work, 0); - flush_delayed_work(&local->scan_work); + wiphy_delayed_work_queue(local->hw.wiphy, &local->scan_work, 0); + wiphy_delayed_work_flush(local->hw.wiphy, &local->scan_work); } } @@ -4356,7 +4356,8 @@ mutex_unlock(&local->mtx); } -void ieee80211_dfs_radar_detected_work(struct work_struct *work) +void ieee80211_dfs_radar_detected_work(struct wiphy *wiphy, + struct wiphy_work *work) { struct ieee80211_local *local = container_of(work, struct ieee80211_local, radar_detected_work); @@ -4374,9 +4375,7 @@ } mutex_unlock(&local->chanctx_mtx); - wiphy_lock(local->hw.wiphy); ieee80211_dfs_cac_cancel(local); - wiphy_unlock(local->hw.wiphy); if (num_chanctx > 1) /* XXX: multi-channel is not supported yet */ @@ -4391,7 +4390,7 @@ trace_api_radar_detected(local); - schedule_work(&local->radar_detected_work); + wiphy_work_queue(hw->wiphy, &local->radar_detected_work); } EXPORT_SYMBOL(ieee80211_radar_detected); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mac80211/vht.c +++ linux-aws-6.5-6.5.0/net/mac80211/vht.c @@ -4,7 +4,7 @@ * * Portions of this file * Copyright(c) 2015 - 2016 Intel Deutschland GmbH - * Copyright (C) 2018 - 2022 Intel Corporation + * Copyright (C) 2018 - 2023 Intel Corporation */ #include @@ -116,12 +116,14 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, struct ieee80211_supported_band *sband, const struct ieee80211_vht_cap *vht_cap_ie, + const struct ieee80211_vht_cap *vht_cap_ie2, struct link_sta_info *link_sta) { struct ieee80211_sta_vht_cap *vht_cap = &link_sta->pub->vht_cap; struct ieee80211_sta_vht_cap own_cap; u32 cap_info, i; bool have_80mhz; + u32 mpdu_len; memset(vht_cap, 0, sizeof(*vht_cap)); @@ -318,10 +320,20 @@ link_sta->pub->bandwidth = ieee80211_sta_cur_vht_bw(link_sta); /* + * Work around the Cisco 9115 FW 17.3 bug by taking the min of + * both reported MPDU lengths. + */ + mpdu_len = vht_cap->cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK; + if (vht_cap_ie2) + mpdu_len = min_t(u32, mpdu_len, + le32_get_bits(vht_cap_ie2->vht_cap_info, + IEEE80211_VHT_CAP_MAX_MPDU_MASK)); + + /* * FIXME - should the amsdu len be per link? store per link * and maintain a minimum? */ - switch (vht_cap->cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK) { + switch (mpdu_len) { case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454: link_sta->pub->agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_11454; break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mptcp/fastopen.c +++ linux-aws-6.5-6.5.0/net/mptcp/fastopen.c @@ -52,6 +52,7 @@ mptcp_set_owner_r(skb, sk); __skb_queue_tail(&sk->sk_receive_queue, skb); + mptcp_sk(sk)->bytes_received += skb->len; sk->sk_data_ready(sk); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mptcp/pm_netlink.c +++ linux-aws-6.5-6.5.0/net/mptcp/pm_netlink.c @@ -1537,8 +1537,9 @@ struct mptcp_pm_addr_entry *entry; list_for_each_entry(entry, rm_list, list) { - remove_anno_list_by_saddr(msk, &entry->addr); - if (alist.nr < MPTCP_RM_IDS_MAX) + if ((remove_anno_list_by_saddr(msk, &entry->addr) || + lookup_subflow_by_saddr(&msk->conn_list, &entry->addr)) && + alist.nr < MPTCP_RM_IDS_MAX) alist.ids[alist.nr++] = entry->addr.id; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/mptcp/sockopt.c +++ linux-aws-6.5-6.5.0/net/mptcp/sockopt.c @@ -737,8 +737,11 @@ val = inet_sk(sk)->tos; mptcp_for_each_subflow(msk, subflow) { struct sock *ssk = mptcp_subflow_tcp_sock(subflow); + bool slow; + slow = lock_sock_fast(ssk); __ip_sock_set_tos(ssk, val); + unlock_sock_fast(ssk, slow); } release_sock(sk); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/netfilter/nf_flow_table_core.c +++ linux-aws-6.5-6.5.0/net/netfilter/nf_flow_table_core.c @@ -316,12 +316,6 @@ } EXPORT_SYMBOL_GPL(flow_offload_refresh); -static bool nf_flow_is_outdated(const struct flow_offload *flow) -{ - return test_bit(IPS_SEEN_REPLY_BIT, &flow->ct->status) && - !test_bit(NF_FLOW_HW_ESTABLISHED, &flow->flags); -} - static inline bool nf_flow_has_expired(const struct flow_offload *flow) { return nf_flow_timeout_delta(flow->timeout) <= 0; @@ -407,12 +401,18 @@ return err; } +static bool nf_flow_custom_gc(struct nf_flowtable *flow_table, + const struct flow_offload *flow) +{ + return flow_table->type->gc && flow_table->type->gc(flow); +} + static void nf_flow_offload_gc_step(struct nf_flowtable *flow_table, struct flow_offload *flow, void *data) { if (nf_flow_has_expired(flow) || nf_ct_is_dying(flow->ct) || - nf_flow_is_outdated(flow)) + nf_flow_custom_gc(flow_table, flow)) flow_offload_teardown(flow); if (test_bit(NF_FLOW_TEARDOWN, &flow->flags)) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/netfilter/nf_nat_redirect.c +++ linux-aws-6.5-6.5.0/net/netfilter/nf_nat_redirect.c @@ -80,6 +80,26 @@ static const struct in6_addr loopback_addr = IN6ADDR_LOOPBACK_INIT; +static bool nf_nat_redirect_ipv6_usable(const struct inet6_ifaddr *ifa, unsigned int scope) +{ + unsigned int ifa_addr_type = ipv6_addr_type(&ifa->addr); + + if (ifa_addr_type & IPV6_ADDR_MAPPED) + return false; + + if ((ifa->flags & IFA_F_TENTATIVE) && (!(ifa->flags & IFA_F_OPTIMISTIC))) + return false; + + if (scope) { + unsigned int ifa_scope = ifa_addr_type & IPV6_ADDR_SCOPE_MASK; + + if (!(scope & ifa_scope)) + return false; + } + + return true; +} + unsigned int nf_nat_redirect_ipv6(struct sk_buff *skb, const struct nf_nat_range2 *range, unsigned int hooknum) @@ -89,14 +109,19 @@ if (hooknum == NF_INET_LOCAL_OUT) { newdst.in6 = loopback_addr; } else { + unsigned int scope = ipv6_addr_scope(&ipv6_hdr(skb)->daddr); struct inet6_dev *idev; - struct inet6_ifaddr *ifa; bool addr = false; idev = __in6_dev_get(skb->dev); if (idev != NULL) { + const struct inet6_ifaddr *ifa; + read_lock_bh(&idev->lock); list_for_each_entry(ifa, &idev->addr_list, if_list) { + if (!nf_nat_redirect_ipv6_usable(ifa, scope)) + continue; + newdst.in6 = ifa->addr; addr = true; break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/netfilter/nfnetlink_log.c +++ linux-aws-6.5-6.5.0/net/netfilter/nfnetlink_log.c @@ -700,8 +700,8 @@ unsigned int plen = 0; struct nfnl_log_net *log = nfnl_log_pernet(net); const struct nfnl_ct_hook *nfnl_ct = NULL; + enum ip_conntrack_info ctinfo = 0; struct nf_conn *ct = NULL; - enum ip_conntrack_info ctinfo; if (li_user && li_user->type == NF_LOG_TYPE_ULOG) li = li_user; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/netfilter/nft_byteorder.c +++ linux-aws-6.5-6.5.0/net/netfilter/nft_byteorder.c @@ -38,13 +38,14 @@ switch (priv->size) { case 8: { + u64 *dst64 = (void *)dst; u64 src64; switch (priv->op) { case NFT_BYTEORDER_NTOH: for (i = 0; i < priv->len / 8; i++) { src64 = nft_reg_load64(&src[i]); - nft_reg_store64(&dst[i], + nft_reg_store64(&dst64[i], be64_to_cpu((__force __be64)src64)); } break; @@ -52,7 +53,7 @@ for (i = 0; i < priv->len / 8; i++) { src64 = (__force __u64) cpu_to_be64(nft_reg_load64(&src[i])); - nft_reg_store64(&dst[i], src64); + nft_reg_store64(&dst64[i], src64); } break; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/netfilter/nft_fib.c +++ linux-aws-6.5-6.5.0/net/netfilter/nft_fib.c @@ -144,11 +144,15 @@ switch (priv->result) { case NFT_FIB_RESULT_OIF: index = dev ? dev->ifindex : 0; - *dreg = (priv->flags & NFTA_FIB_F_PRESENT) ? !!index : index; + if (priv->flags & NFTA_FIB_F_PRESENT) + nft_reg_store8(dreg, !!index); + else + *dreg = index; + break; case NFT_FIB_RESULT_OIFNAME: if (priv->flags & NFTA_FIB_F_PRESENT) - *dreg = !!dev; + nft_reg_store8(dreg, !!dev); else strncpy(reg, dev ? dev->name : "", IFNAMSIZ); break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/netfilter/xt_owner.c +++ linux-aws-6.5-6.5.0/net/netfilter/xt_owner.c @@ -76,18 +76,23 @@ */ return false; - filp = sk->sk_socket->file; - if (filp == NULL) + read_lock_bh(&sk->sk_callback_lock); + filp = sk->sk_socket ? sk->sk_socket->file : NULL; + if (filp == NULL) { + read_unlock_bh(&sk->sk_callback_lock); return ((info->match ^ info->invert) & (XT_OWNER_UID | XT_OWNER_GID)) == 0; + } if (info->match & XT_OWNER_UID) { kuid_t uid_min = make_kuid(net->user_ns, info->uid_min); kuid_t uid_max = make_kuid(net->user_ns, info->uid_max); if ((uid_gte(filp->f_cred->fsuid, uid_min) && uid_lte(filp->f_cred->fsuid, uid_max)) ^ - !(info->invert & XT_OWNER_UID)) + !(info->invert & XT_OWNER_UID)) { + read_unlock_bh(&sk->sk_callback_lock); return false; + } } if (info->match & XT_OWNER_GID) { @@ -112,10 +117,13 @@ } } - if (match ^ !(info->invert & XT_OWNER_GID)) + if (match ^ !(info->invert & XT_OWNER_GID)) { + read_unlock_bh(&sk->sk_callback_lock); return false; + } } + read_unlock_bh(&sk->sk_callback_lock); return true; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/netfilter/xt_recent.c +++ linux-aws-6.5-6.5.0/net/netfilter/xt_recent.c @@ -561,7 +561,7 @@ { struct recent_table *t = pde_data(file_inode(file)); struct recent_entry *e; - char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")]; + char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:255.255.255.255")]; const char *c = buf; union nf_inet_addr addr = {}; u_int16_t family; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/netlink/genetlink.c +++ linux-aws-6.5-6.5.0/net/netlink/genetlink.c @@ -1693,6 +1693,9 @@ if ((grp->flags & GENL_UNS_ADMIN_PERM) && !ns_capable(net->user_ns, CAP_NET_ADMIN)) ret = -EPERM; + if (grp->cap_sys_admin && + !ns_capable(net->user_ns, CAP_SYS_ADMIN)) + ret = -EPERM; break; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/nfc/nci/spi.c +++ linux-aws-6.5-6.5.0/net/nfc/nci/spi.c @@ -151,6 +151,8 @@ int ret; skb = nci_skb_alloc(nspi->ndev, 0, GFP_KERNEL); + if (!skb) + return -ENOMEM; /* add the NCI SPI header to the start of the buffer */ hdr = skb_push(skb, NCI_SPI_HDR_LEN); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/openvswitch/conntrack.c +++ linux-aws-6.5-6.5.0/net/openvswitch/conntrack.c @@ -1043,7 +1043,7 @@ if (err) return err; - nf_conn_act_ct_ext_add(ct); + nf_conn_act_ct_ext_add(skb, ct, ctinfo); } else if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) && labels_nonzero(&info->labels.mask)) { err = ovs_ct_set_labels(ct, key, &info->labels.value, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/packet/internal.h +++ linux-aws-6.5-6.5.0/net/packet/internal.h @@ -122,7 +122,7 @@ __be16 num; struct packet_rollover *rollover; struct packet_mclist *mclist; - atomic_t mapped; + atomic_long_t mapped; enum tpacket_versions tp_version; unsigned int tp_hdrlen; unsigned int tp_reserve; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/psample/psample.c +++ linux-aws-6.5-6.5.0/net/psample/psample.c @@ -31,7 +31,8 @@ static const struct genl_multicast_group psample_nl_mcgrps[] = { [PSAMPLE_NL_MCGRP_CONFIG] = { .name = PSAMPLE_NL_MCGRP_CONFIG_NAME }, - [PSAMPLE_NL_MCGRP_SAMPLE] = { .name = PSAMPLE_NL_MCGRP_SAMPLE_NAME }, + [PSAMPLE_NL_MCGRP_SAMPLE] = { .name = PSAMPLE_NL_MCGRP_SAMPLE_NAME, + .flags = GENL_UNS_ADMIN_PERM }, }; static struct genl_family psample_nl_family __ro_after_init; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/rfkill/rfkill-gpio.c +++ linux-aws-6.5-6.5.0/net/rfkill/rfkill-gpio.c @@ -108,13 +108,13 @@ rfkill->clk = devm_clk_get(&pdev->dev, NULL); - gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); + gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_ASIS); if (IS_ERR(gpio)) return PTR_ERR(gpio); rfkill->reset_gpio = gpio; - gpio = devm_gpiod_get_optional(&pdev->dev, "shutdown", GPIOD_OUT_LOW); + gpio = devm_gpiod_get_optional(&pdev->dev, "shutdown", GPIOD_ASIS); if (IS_ERR(gpio)) return PTR_ERR(gpio); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/rose/af_rose.c +++ linux-aws-6.5-6.5.0/net/rose/af_rose.c @@ -1315,9 +1315,11 @@ case TIOCINQ: { struct sk_buff *skb; long amount = 0L; - /* These two are safe on a single CPU system as only user tasks fiddle here */ + + spin_lock_irq(&sk->sk_receive_queue.lock); if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) amount = skb->len; + spin_unlock_irq(&sk->sk_receive_queue.lock); return put_user(amount, (unsigned int __user *) argp); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/rxrpc/conn_object.c +++ linux-aws-6.5-6.5.0/net/rxrpc/conn_object.c @@ -212,7 +212,7 @@ conn->idle_timestamp = jiffies; if (atomic_dec_and_test(&conn->active)) rxrpc_set_service_reap_timer(conn->rxnet, - jiffies + rxrpc_connection_expiry); + jiffies + rxrpc_connection_expiry * HZ); } rxrpc_put_call(call, rxrpc_call_put_io_thread); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/rxrpc/input.c +++ linux-aws-6.5-6.5.0/net/rxrpc/input.c @@ -643,12 +643,8 @@ clear_bit(i + RXRPC_CALL_RTT_PEND_SHIFT, &call->rtt_avail); smp_mb(); /* Read data before setting avail bit */ set_bit(i, &call->rtt_avail); - if (type != rxrpc_rtt_rx_cancel) - rxrpc_peer_add_rtt(call, type, i, acked_serial, ack_serial, - sent_at, resp_time); - else - trace_rxrpc_rtt_rx(call, rxrpc_rtt_rx_cancel, i, - orig_serial, acked_serial, 0, 0); + rxrpc_peer_add_rtt(call, type, i, acked_serial, ack_serial, + sent_at, resp_time); matched = true; } @@ -801,28 +797,21 @@ summary.ack_reason, nr_acks); rxrpc_inc_stat(call->rxnet, stat_rx_acks[ack.reason]); - switch (ack.reason) { - case RXRPC_ACK_PING_RESPONSE: - rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial, - rxrpc_rtt_rx_ping_response); - break; - case RXRPC_ACK_REQUESTED: - rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial, - rxrpc_rtt_rx_requested_ack); - break; - default: - if (acked_serial != 0) + if (acked_serial != 0) { + switch (ack.reason) { + case RXRPC_ACK_PING_RESPONSE: rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial, - rxrpc_rtt_rx_cancel); - break; - } - - if (ack.reason == RXRPC_ACK_PING) { - rxrpc_send_ACK(call, RXRPC_ACK_PING_RESPONSE, ack_serial, - rxrpc_propose_ack_respond_to_ping); - } else if (sp->hdr.flags & RXRPC_REQUEST_ACK) { - rxrpc_send_ACK(call, RXRPC_ACK_REQUESTED, ack_serial, - rxrpc_propose_ack_respond_to_ack); + rxrpc_rtt_rx_ping_response); + break; + case RXRPC_ACK_REQUESTED: + rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial, + rxrpc_rtt_rx_requested_ack); + break; + default: + rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial, + rxrpc_rtt_rx_other_ack); + break; + } } /* If we get an EXCEEDS_WINDOW ACK from the server, it probably @@ -835,7 +824,7 @@ rxrpc_is_client_call(call)) { rxrpc_set_call_completion(call, RXRPC_CALL_REMOTELY_ABORTED, 0, -ENETRESET); - return; + goto send_response; } /* If we get an OUT_OF_SEQUENCE ACK from the server, that can also @@ -849,7 +838,7 @@ rxrpc_is_client_call(call)) { rxrpc_set_call_completion(call, RXRPC_CALL_REMOTELY_ABORTED, 0, -ENETRESET); - return; + goto send_response; } /* Discard any out-of-order or duplicate ACKs (outside lock). */ @@ -857,7 +846,7 @@ trace_rxrpc_rx_discard_ack(call->debug_id, ack_serial, first_soft_ack, call->acks_first_seq, prev_pkt, call->acks_prev_seq); - return; + goto send_response; } info.rxMTU = 0; @@ -897,7 +886,7 @@ case RXRPC_CALL_SERVER_AWAIT_ACK: break; default: - return; + goto send_response; } if (before(hard_ack, call->acks_hard_ack) || @@ -909,7 +898,7 @@ if (after(hard_ack, call->acks_hard_ack)) { if (rxrpc_rotate_tx_window(call, hard_ack, &summary)) { rxrpc_end_tx_phase(call, false, rxrpc_eproto_unexpected_ack); - return; + goto send_response; } } @@ -927,6 +916,14 @@ rxrpc_propose_ack_ping_for_lost_reply); rxrpc_congestion_management(call, skb, &summary, acked_serial); + +send_response: + if (ack.reason == RXRPC_ACK_PING) + rxrpc_send_ACK(call, RXRPC_ACK_PING_RESPONSE, ack_serial, + rxrpc_propose_ack_respond_to_ping); + else if (sp->hdr.flags & RXRPC_REQUEST_ACK) + rxrpc_send_ACK(call, RXRPC_ACK_REQUESTED, ack_serial, + rxrpc_propose_ack_respond_to_ack); } /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/rxrpc/local_object.c +++ linux-aws-6.5-6.5.0/net/rxrpc/local_object.c @@ -87,7 +87,7 @@ struct rxrpc_local *local = container_of(timer, struct rxrpc_local, client_conn_reap_timer); - if (local->kill_all_client_conns && + if (!local->kill_all_client_conns && test_and_set_bit(RXRPC_CLIENT_CONN_REAP_TIMER, &local->client_conn_flags)) rxrpc_wake_up_io_thread(local); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/sched/act_ct.c +++ linux-aws-6.5-6.5.0/net/sched/act_ct.c @@ -278,7 +278,16 @@ return err; } +static bool tcf_ct_flow_is_outdated(const struct flow_offload *flow) +{ + return test_bit(IPS_SEEN_REPLY_BIT, &flow->ct->status) && + test_bit(IPS_HW_OFFLOAD_BIT, &flow->ct->status) && + !test_bit(NF_FLOW_HW_PENDING, &flow->flags) && + !test_bit(NF_FLOW_HW_ESTABLISHED, &flow->flags); +} + static struct nf_flowtable_type flowtable_ct = { + .gc = tcf_ct_flow_is_outdated, .action = tcf_ct_flow_table_fill_actions, .owner = THIS_MODULE, }; @@ -367,6 +376,17 @@ entry->tuplehash[dir].tuple.tc.iifidx = act_ct_ext->ifindex[dir]; } +static void tcf_ct_flow_ct_ext_ifidx_update(struct flow_offload *entry) +{ + struct nf_conn_act_ct_ext *act_ct_ext; + + act_ct_ext = nf_conn_act_ct_ext_find(entry->ct); + if (act_ct_ext) { + tcf_ct_flow_tc_ifidx(entry, act_ct_ext, FLOW_OFFLOAD_DIR_ORIGINAL); + tcf_ct_flow_tc_ifidx(entry, act_ct_ext, FLOW_OFFLOAD_DIR_REPLY); + } +} + static void tcf_ct_flow_table_add(struct tcf_ct_flow_table *ct_ft, struct nf_conn *ct, bool tcp, bool bidirectional) @@ -662,6 +682,8 @@ else ctinfo = IP_CT_ESTABLISHED_REPLY; + nf_conn_act_ct_ext_fill(skb, ct, ctinfo); + tcf_ct_flow_ct_ext_ifidx_update(flow); flow_offload_refresh(nf_ft, flow, force_refresh); if (!test_bit(IPS_ASSURED_BIT, &ct->status)) { /* Process this flow in SW to allow promoting to ASSURED */ @@ -1021,7 +1043,7 @@ tcf_ct_act_set_labels(ct, p->labels, p->labels_mask); if (!nf_ct_is_confirmed(ct)) - nf_conn_act_ct_ext_add(ct); + nf_conn_act_ct_ext_add(skb, ct, ctinfo); /* This will take care of sending queued events * even if the connection is already confirmed. @@ -1512,6 +1534,9 @@ if (bind) { struct flow_action_entry *entry = entry_data; + if (tcf_ct_helper(act)) + return -EOPNOTSUPP; + entry->id = FLOW_ACTION_CT; entry->ct.action = tcf_ct_action(act); entry->ct.zone = tcf_ct_zone(act); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/sched/cls_u32.c +++ linux-aws-6.5-6.5.0/net/sched/cls_u32.c @@ -366,7 +366,7 @@ idr_init(&root_ht->handle_idr); if (tp_c == NULL) { - tp_c = kzalloc(struct_size(tp_c, hlist->ht, 1), GFP_KERNEL); + tp_c = kzalloc(sizeof(*tp_c), GFP_KERNEL); if (tp_c == NULL) { kfree(root_ht); return -ENOBUFS; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/smc/smc.h +++ linux-aws-6.5-6.5.0/net/smc/smc.h @@ -374,4 +374,9 @@ int smc_nl_enable_hs_limitation(struct sk_buff *skb, struct genl_info *info); int smc_nl_disable_hs_limitation(struct sk_buff *skb, struct genl_info *info); +static inline void smc_sock_set_flag(struct sock *sk, enum sock_flags flag) +{ + set_bit(flag, &sk->sk_flags); +} + #endif /* __SMC_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/smc/smc_cdc.c +++ linux-aws-6.5-6.5.0/net/smc/smc_cdc.c @@ -28,13 +28,15 @@ { struct smc_cdc_tx_pend *cdcpend = (struct smc_cdc_tx_pend *)pnd_snd; struct smc_connection *conn = cdcpend->conn; + struct smc_buf_desc *sndbuf_desc; struct smc_sock *smc; int diff; + sndbuf_desc = conn->sndbuf_desc; smc = container_of(conn, struct smc_sock, conn); bh_lock_sock(&smc->sk); - if (!wc_status) { - diff = smc_curs_diff(cdcpend->conn->sndbuf_desc->len, + if (!wc_status && sndbuf_desc) { + diff = smc_curs_diff(sndbuf_desc->len, &cdcpend->conn->tx_curs_fin, &cdcpend->cursor); /* sndbuf_space is decreased in smc_sendmsg */ @@ -114,9 +116,6 @@ union smc_host_cursor cfed; int rc; - if (unlikely(!READ_ONCE(conn->sndbuf_desc))) - return -ENOBUFS; - smc_cdc_add_pending_send(conn, pend); conn->tx_cdc_seq++; @@ -385,7 +384,7 @@ smc->sk.sk_shutdown |= RCV_SHUTDOWN; if (smc->clcsock && smc->clcsock->sk) smc->clcsock->sk->sk_shutdown |= RCV_SHUTDOWN; - sock_set_flag(&smc->sk, SOCK_DONE); + smc_sock_set_flag(&smc->sk, SOCK_DONE); sock_hold(&smc->sk); /* sock_put in close_work */ if (!queue_work(smc_close_wq, &conn->close_work)) sock_put(&smc->sk); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/smc/smc_clc.c +++ linux-aws-6.5-6.5.0/net/smc/smc_clc.c @@ -986,6 +986,7 @@ u8 *eid, struct smc_init_info *ini) { struct smc_connection *conn = &smc->conn; + struct smcd_dev *smcd = conn->lgr->smcd; struct smc_clc_msg_accept_confirm *clc; struct smc_clc_first_contact_ext fce; struct smc_clc_fce_gid_ext gle; @@ -1004,17 +1005,15 @@ memcpy(clc->hdr.eyecatcher, SMCD_EYECATCHER, sizeof(SMCD_EYECATCHER)); clc->hdr.typev1 = SMC_TYPE_D; - clc->d0.gid = - conn->lgr->smcd->ops->get_local_gid(conn->lgr->smcd); - clc->d0.token = conn->rmb_desc->token; + clc->d0.gid = htonll(smcd->ops->get_local_gid(smcd)); + clc->d0.token = htonll(conn->rmb_desc->token); clc->d0.dmbe_size = conn->rmbe_size_comp; clc->d0.dmbe_idx = 0; memcpy(&clc->d0.linkid, conn->lgr->id, SMC_LGR_ID_SIZE); if (version == SMC_V1) { clc->hdr.length = htons(SMCD_CLC_ACCEPT_CONFIRM_LEN); } else { - clc_v2->d1.chid = - htons(smc_ism_get_chid(conn->lgr->smcd)); + clc_v2->d1.chid = htons(smc_ism_get_chid(smcd)); if (eid && eid[0]) memcpy(clc_v2->d1.eid, eid, SMC_MAX_EID_LEN); len = SMCD_CLC_ACCEPT_CONFIRM_LEN_V2; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/smc/smc_clc.h +++ linux-aws-6.5-6.5.0/net/smc/smc_clc.h @@ -197,8 +197,8 @@ } __packed; struct smcd_clc_msg_accept_confirm_common { /* SMCD accept/confirm */ - u64 gid; /* Sender GID */ - u64 token; /* DMB token */ + __be64 gid; /* Sender GID */ + __be64 token; /* DMB token */ u8 dmbe_idx; /* DMBE index */ #if defined(__BIG_ENDIAN_BITFIELD) u8 dmbe_size : 4, /* buf size (compressed) */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/smc/smc_close.c +++ linux-aws-6.5-6.5.0/net/smc/smc_close.c @@ -116,7 +116,8 @@ struct sock *sk = &smc->sk; release_sock(sk); - cancel_work_sync(&smc->conn.close_work); + if (cancel_work_sync(&smc->conn.close_work)) + sock_put(sk); cancel_delayed_work_sync(&smc->conn.tx_work); lock_sock(sk); } @@ -173,7 +174,7 @@ break; } - sock_set_flag(sk, SOCK_DEAD); + smc_sock_set_flag(sk, SOCK_DEAD); sk->sk_state_change(sk); if (release_clcsock) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/sunrpc/auth.c +++ linux-aws-6.5-6.5.0/net/sunrpc/auth.c @@ -769,9 +769,14 @@ * @task: controlling RPC task * @xdr: xdr_stream containing RPC Reply header * - * On success, @xdr is updated to point past the verifier and - * zero is returned. Otherwise, @xdr is in an undefined state - * and a negative errno is returned. + * Return values: + * %0: Verifier is valid. @xdr now points past the verifier. + * %-EIO: Verifier is corrupted or message ended early. + * %-EACCES: Verifier is intact but not valid. + * %-EPROTONOSUPPORT: Server does not support the requested auth type. + * + * When a negative errno is returned, @xdr is left in an undefined + * state. */ int rpcauth_checkverf(struct rpc_task *task, struct xdr_stream *xdr) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/sunrpc/auth_tls.c +++ linux-aws-6.5-6.5.0/net/sunrpc/auth_tls.c @@ -129,9 +129,9 @@ if (*p != rpc_auth_null) return -EIO; if (xdr_stream_decode_opaque_inline(xdr, &str, starttls_len) != starttls_len) - return -EIO; + return -EPROTONOSUPPORT; if (memcmp(str, starttls_token, starttls_len)) - return -EIO; + return -EPROTONOSUPPORT; return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/sunrpc/rpcb_clnt.c +++ linux-aws-6.5-6.5.0/net/sunrpc/rpcb_clnt.c @@ -769,6 +769,10 @@ child = rpcb_call_async(rpcb_clnt, map, proc); rpc_release_client(rpcb_clnt); + if (IS_ERR(child)) { + /* rpcb_map_release() has freed the arguments */ + return; + } xprt->stat.bind_count++; rpc_put_task(child); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ linux-aws-6.5-6.5.0/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c @@ -852,7 +852,8 @@ if (ret == -EINVAL) svc_rdma_send_error(rdma_xprt, ctxt, ret); svc_rdma_recv_ctxt_put(rdma_xprt, ctxt); - return ret; + svc_xprt_deferred_close(xprt); + return -ENOTCONN; out_backchannel: svc_rdma_handle_bc_reply(rqstp, ctxt); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/sunrpc/xprtsock.c +++ linux-aws-6.5-6.5.0/net/sunrpc/xprtsock.c @@ -2645,6 +2645,10 @@ rcu_read_lock(); lower_xprt = rcu_dereference(lower_clnt->cl_xprt); rcu_read_unlock(); + + if (wait_on_bit_lock(&lower_xprt->state, XPRT_LOCKED, TASK_KILLABLE)) + goto out_unlock; + status = xs_tls_handshake_sync(lower_xprt, &upper_xprt->xprtsec); if (status) { trace_rpc_tls_not_started(upper_clnt, upper_xprt); @@ -2654,6 +2658,7 @@ status = xs_tcp_tls_finish_connecting(lower_xprt, upper_transport); if (status) goto out_close; + xprt_release_write(lower_xprt, NULL); trace_rpc_socket_connect(upper_xprt, upper_transport->sock, 0); if (!xprt_test_and_set_connected(upper_xprt)) { @@ -2675,6 +2680,7 @@ return; out_close: + xprt_release_write(lower_xprt, NULL); rpc_shutdown_client(lower_clnt); /* xprt_force_disconnect() wakes tasks with a fixed tk_status code. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/tipc/link.c +++ linux-aws-6.5-6.5.0/net/tipc/link.c @@ -1446,7 +1446,7 @@ p = (struct tipc_gap_ack_blks *)msg_data(hdr); sz = ntohs(p->len); /* Sanity check */ - if (sz == struct_size(p, gacks, p->ugack_cnt + p->bgack_cnt)) { + if (sz == struct_size(p, gacks, size_add(p->ugack_cnt, p->bgack_cnt))) { /* Good, check if the desired type exists */ if ((uc && p->ugack_cnt) || (!uc && p->bgack_cnt)) goto ok; @@ -1533,7 +1533,7 @@ __tipc_build_gap_ack_blks(ga, l, ga->bgack_cnt) : 0; /* Total len */ - len = struct_size(ga, gacks, ga->bgack_cnt + ga->ugack_cnt); + len = struct_size(ga, gacks, size_add(ga->bgack_cnt, ga->ugack_cnt)); ga->len = htons(len); return len; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/tipc/netlink.c +++ linux-aws-6.5-6.5.0/net/tipc/netlink.c @@ -88,7 +88,7 @@ const struct nla_policy tipc_nl_link_policy[TIPC_NLA_LINK_MAX + 1] = { [TIPC_NLA_LINK_UNSPEC] = { .type = NLA_UNSPEC }, - [TIPC_NLA_LINK_NAME] = { .type = NLA_STRING, + [TIPC_NLA_LINK_NAME] = { .type = NLA_NUL_STRING, .len = TIPC_MAX_LINK_NAME }, [TIPC_NLA_LINK_MTU] = { .type = NLA_U32 }, [TIPC_NLA_LINK_BROADCAST] = { .type = NLA_FLAG }, @@ -125,7 +125,7 @@ const struct nla_policy tipc_nl_bearer_policy[TIPC_NLA_BEARER_MAX + 1] = { [TIPC_NLA_BEARER_UNSPEC] = { .type = NLA_UNSPEC }, - [TIPC_NLA_BEARER_NAME] = { .type = NLA_STRING, + [TIPC_NLA_BEARER_NAME] = { .type = NLA_NUL_STRING, .len = TIPC_MAX_BEARER_NAME }, [TIPC_NLA_BEARER_PROP] = { .type = NLA_NESTED }, [TIPC_NLA_BEARER_DOMAIN] = { .type = NLA_U32 } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/tipc/netlink_compat.c +++ linux-aws-6.5-6.5.0/net/tipc/netlink_compat.c @@ -102,6 +102,7 @@ return -EMSGSIZE; skb_put(skb, TLV_SPACE(len)); + memset(tlv, 0, TLV_SPACE(len)); tlv->tlv_type = htons(type); tlv->tlv_len = htons(TLV_LENGTH(len)); if (len && data) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/tls/tls_main.c +++ linux-aws-6.5-6.5.0/net/tls/tls_main.c @@ -96,8 +96,8 @@ int wait_on_pending_writer(struct sock *sk, long *timeo) { - int rc = 0; DEFINE_WAIT_FUNC(wait, woken_wake_function); + int ret, rc = 0; add_wait_queue(sk_sleep(sk), &wait); while (1) { @@ -111,9 +111,13 @@ break; } - if (sk_wait_event(sk, timeo, - !READ_ONCE(sk->sk_write_pending), &wait)) + ret = sk_wait_event(sk, timeo, + !READ_ONCE(sk->sk_write_pending), &wait); + if (ret) { + if (ret < 0) + rc = ret; break; + } } remove_wait_queue(sk_sleep(sk), &wait); return rc; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/unix/unix_bpf.c +++ linux-aws-6.5-6.5.0/net/unix/unix_bpf.c @@ -159,12 +159,17 @@ int unix_stream_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore) { + struct sock *sk_pair; + if (restore) { sk->sk_write_space = psock->saved_write_space; sock_replace_proto(sk, psock->sk_proto); return 0; } + sk_pair = unix_peer(sk); + sock_hold(sk_pair); + psock->sk_pair = sk_pair; unix_stream_bpf_check_needs_rebuild(psock->sk_proto); sock_replace_proto(sk, &unix_stream_bpf_prot); return 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/vmw_vsock/af_vsock.c +++ linux-aws-6.5-6.5.0/net/vmw_vsock/af_vsock.c @@ -89,6 +89,7 @@ #include #include #include +#include #include #include #include @@ -110,6 +111,7 @@ #include #include #include +#include static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr); static void vsock_sk_destruct(struct sock *sk); @@ -2134,6 +2136,10 @@ int err; sk = sock->sk; + + if (unlikely(flags & MSG_ERRQUEUE)) + return sock_recv_errqueue(sk, msg, len, SOL_VSOCK, VSOCK_RECVERR); + vsk = vsock_sk(sk); err = 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/vmw_vsock/virtio_transport.c +++ linux-aws-6.5-6.5.0/net/vmw_vsock/virtio_transport.c @@ -555,6 +555,11 @@ virtio_device_ready(vdev); + return 0; +} + +static void virtio_vsock_vqs_start(struct virtio_vsock *vsock) +{ mutex_lock(&vsock->tx_lock); vsock->tx_run = true; mutex_unlock(&vsock->tx_lock); @@ -569,7 +574,16 @@ vsock->event_run = true; mutex_unlock(&vsock->event_lock); - return 0; + /* virtio_transport_send_pkt() can queue packets once + * the_virtio_vsock is set, but they won't be processed until + * vsock->tx_run is set to true. We queue vsock->send_pkt_work + * when initialization finishes to send those packets queued + * earlier. + * We don't need to queue the other workers (rx, event) because + * as long as we don't fill the queues with empty buffers, the + * host can't send us any notification. + */ + queue_work(virtio_vsock_workqueue, &vsock->send_pkt_work); } static void virtio_vsock_vqs_del(struct virtio_vsock *vsock) @@ -664,6 +678,7 @@ goto out; rcu_assign_pointer(the_virtio_vsock, vsock); + virtio_vsock_vqs_start(vsock); mutex_unlock(&the_virtio_vsock_mutex); @@ -736,6 +751,7 @@ goto out; rcu_assign_pointer(the_virtio_vsock, vsock); + virtio_vsock_vqs_start(vsock); out: mutex_unlock(&the_virtio_vsock_mutex); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/vmw_vsock/virtio_transport_common.c +++ linux-aws-6.5-6.5.0/net/vmw_vsock/virtio_transport_common.c @@ -1150,11 +1150,17 @@ vsk->peer_shutdown |= RCV_SHUTDOWN; if (le32_to_cpu(hdr->flags) & VIRTIO_VSOCK_SHUTDOWN_SEND) vsk->peer_shutdown |= SEND_SHUTDOWN; - if (vsk->peer_shutdown == SHUTDOWN_MASK && - vsock_stream_has_data(vsk) <= 0 && - !sock_flag(sk, SOCK_DONE)) { - (void)virtio_transport_reset(vsk, NULL); - virtio_transport_do_close(vsk, true); + if (vsk->peer_shutdown == SHUTDOWN_MASK) { + if (vsock_stream_has_data(vsk) <= 0 && !sock_flag(sk, SOCK_DONE)) { + (void)virtio_transport_reset(vsk, NULL); + virtio_transport_do_close(vsk, true); + } + /* Remove this socket anyway because the remote peer sent + * the shutdown. This way a new connection will succeed + * if the remote peer uses the same source port, + * even if the old socket is still unreleased, but now disconnected. + */ + vsock_remove_sock(vsk); } if (le32_to_cpu(virtio_vsock_hdr(skb)->flags)) sk->sk_state_change(sk); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/wireless/scan.c +++ linux-aws-6.5-6.5.0/net/wireless/scan.c @@ -908,6 +908,10 @@ !cfg80211_find_ssid_match(ap, request)) continue; + if (!is_broadcast_ether_addr(request->bssid) && + !ether_addr_equal(request->bssid, ap->bssid)) + continue; + if (!request->n_ssids && ap->multi_bss && !ap->transmitted_bssid) continue; @@ -2121,7 +2125,7 @@ if (!res) goto drop; - rdev_inform_bss(rdev, &res->pub, ies, data->drv_data); + rdev_inform_bss(rdev, &res->pub, ies, drv_data->drv_data); if (data->bss_source == BSS_SOURCE_MBSSID) { /* this is a nontransmitting bss, we need to add it to @@ -2354,8 +2358,8 @@ /* elem might be invalid after the memmove */ next = (void *)(elem->data + elem->datalen); - elem_datalen = elem->datalen; + if (elem->id == WLAN_EID_EXTENSION) { copied = elem->datalen - 1; if (copied > data_len) @@ -2376,7 +2380,7 @@ for (elem = next; elem->data < ies + ieslen && - elem->data + elem->datalen < ies + ieslen; + elem->data + elem->datalen <= ies + ieslen; elem = next) { /* elem might be invalid after the memmove */ next = (void *)(elem->data + elem->datalen); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/wireless/sysfs.c +++ linux-aws-6.5-6.5.0/net/wireless/sysfs.c @@ -105,14 +105,14 @@ cfg80211_leave_all(rdev); cfg80211_process_rdev_events(rdev); } - cfg80211_process_wiphy_works(rdev); + cfg80211_process_wiphy_works(rdev, NULL); if (rdev->ops->suspend) ret = rdev_suspend(rdev, rdev->wiphy.wowlan_config); if (ret == 1) { /* Driver refuse to configure wowlan */ cfg80211_leave_all(rdev); cfg80211_process_rdev_events(rdev); - cfg80211_process_wiphy_works(rdev); + cfg80211_process_wiphy_works(rdev, NULL); ret = rdev_suspend(rdev, NULL); } if (ret == 0) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/xdp/xsk.c +++ linux-aws-6.5-6.5.0/net/xdp/xsk.c @@ -723,7 +723,7 @@ rcu_read_lock(); if (xsk_check_common(xs)) - goto skip_tx; + goto out; pool = xs->pool; @@ -735,12 +735,11 @@ xsk_generic_xmit(sk); } -skip_tx: if (xs->rx && !xskq_prod_is_empty(xs->rx)) mask |= EPOLLIN | EPOLLRDNORM; if (xs->tx && xsk_tx_writeable(xs)) mask |= EPOLLOUT | EPOLLWRNORM; - +out: rcu_read_unlock(); return mask; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/xfrm/xfrm_interface_core.c +++ linux-aws-6.5-6.5.0/net/xfrm/xfrm_interface_core.c @@ -380,8 +380,8 @@ skb->dev = dev; if (err) { - dev->stats.rx_errors++; - dev->stats.rx_dropped++; + DEV_STATS_INC(dev, rx_errors); + DEV_STATS_INC(dev, rx_dropped); return 0; } @@ -426,7 +426,6 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) { struct xfrm_if *xi = netdev_priv(dev); - struct net_device_stats *stats = &xi->dev->stats; struct dst_entry *dst = skb_dst(skb); unsigned int length = skb->len; struct net_device *tdev; @@ -473,7 +472,7 @@ tdev = dst->dev; if (tdev == dev) { - stats->collisions++; + DEV_STATS_INC(dev, collisions); net_warn_ratelimited("%s: Local routing loop detected!\n", dev->name); goto tx_err_dst_release; @@ -512,13 +511,13 @@ if (net_xmit_eval(err) == 0) { dev_sw_netstats_tx_add(dev, 1, length); } else { - stats->tx_errors++; - stats->tx_aborted_errors++; + DEV_STATS_INC(dev, tx_errors); + DEV_STATS_INC(dev, tx_aborted_errors); } return 0; tx_err_link_failure: - stats->tx_carrier_errors++; + DEV_STATS_INC(dev, tx_carrier_errors); dst_link_failure(skb); tx_err_dst_release: dst_release(dst); @@ -528,7 +527,6 @@ static netdev_tx_t xfrmi_xmit(struct sk_buff *skb, struct net_device *dev) { struct xfrm_if *xi = netdev_priv(dev); - struct net_device_stats *stats = &xi->dev->stats; struct dst_entry *dst = skb_dst(skb); struct flowi fl; int ret; @@ -545,7 +543,7 @@ dst = ip6_route_output(dev_net(dev), NULL, &fl.u.ip6); if (dst->error) { dst_release(dst); - stats->tx_carrier_errors++; + DEV_STATS_INC(dev, tx_carrier_errors); goto tx_err; } skb_dst_set(skb, dst); @@ -561,7 +559,7 @@ fl.u.ip4.flowi4_flags |= FLOWI_FLAG_ANYSRC; rt = __ip_route_output_key(dev_net(dev), &fl.u.ip4); if (IS_ERR(rt)) { - stats->tx_carrier_errors++; + DEV_STATS_INC(dev, tx_carrier_errors); goto tx_err; } skb_dst_set(skb, &rt->dst); @@ -580,8 +578,8 @@ return NETDEV_TX_OK; tx_err: - stats->tx_errors++; - stats->tx_dropped++; + DEV_STATS_INC(dev, tx_errors); + DEV_STATS_INC(dev, tx_dropped); kfree_skb(skb); return NETDEV_TX_OK; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/net/xfrm/xfrm_policy.c +++ linux-aws-6.5-6.5.0/net/xfrm/xfrm_policy.c @@ -851,7 +851,7 @@ struct hlist_node *newpos = NULL; bool matches_s, matches_d; - if (!policy->bydst_reinsert) + if (policy->walk.dead || !policy->bydst_reinsert) continue; WARN_ON_ONCE(policy->family != family); @@ -1256,8 +1256,11 @@ struct xfrm_pol_inexact_bin *bin; u8 dbits, sbits; + if (policy->walk.dead) + continue; + dir = xfrm_policy_id2dir(policy->index); - if (policy->walk.dead || dir >= XFRM_POLICY_MAX) + if (dir >= XFRM_POLICY_MAX) continue; if ((dir & XFRM_POLICY_MASK) == XFRM_POLICY_OUT) { @@ -1372,8 +1375,6 @@ * of an absolute inpredictability of ordering of rules. This will not pass. */ static u32 xfrm_gen_index(struct net *net, int dir, u32 index) { - static u32 idx_generator; - for (;;) { struct hlist_head *list; struct xfrm_policy *p; @@ -1381,8 +1382,8 @@ int found; if (!index) { - idx = (idx_generator | dir); - idx_generator += 8; + idx = (net->xfrm.idx_generator | dir); + net->xfrm.idx_generator += 8; } else { idx = index; index = 0; @@ -1823,9 +1824,11 @@ again: list_for_each_entry(pol, &net->xfrm.policy_all, walk.all) { + if (pol->walk.dead) + continue; + dir = xfrm_policy_id2dir(pol->index); - if (pol->walk.dead || - dir >= XFRM_POLICY_MAX || + if (dir >= XFRM_POLICY_MAX || pol->type != type) continue; @@ -1862,9 +1865,11 @@ again: list_for_each_entry(pol, &net->xfrm.policy_all, walk.all) { + if (pol->walk.dead) + continue; + dir = xfrm_policy_id2dir(pol->index); - if (pol->walk.dead || - dir >= XFRM_POLICY_MAX || + if (dir >= XFRM_POLICY_MAX || pol->xdo.dev != dev) continue; @@ -3215,7 +3220,7 @@ } for (i = 0; i < num_pols; i++) - pols[i]->curlft.use_time = ktime_get_real_seconds(); + WRITE_ONCE(pols[i]->curlft.use_time, ktime_get_real_seconds()); if (num_xfrms < 0) { /* Prohibit the flow */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/rust/Makefile +++ linux-aws-6.5-6.5.0/rust/Makefile @@ -1,5 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 +# Where to place rustdoc generated documentation +rustdoc_output := $(objtree)/Documentation/output/rust/rustdoc + obj-$(CONFIG_RUST) += core.o compiler_builtins.o always-$(CONFIG_RUST) += exports_core_generated.h @@ -65,7 +68,7 @@ OBJTREE=$(abspath $(objtree)) \ $(RUSTDOC) $(if $(rustdoc_host),$(rust_common_flags),$(rust_flags)) \ $(rustc_target_flags) -L$(objtree)/$(obj) \ - --output $(objtree)/$(obj)/doc \ + --output $(rustdoc_output) \ --crate-name $(subst rustdoc-,,$@) \ @$(objtree)/include/generated/rustc_cfg $< @@ -82,15 +85,14 @@ # and then retouch the generated files. rustdoc: rustdoc-core rustdoc-macros rustdoc-compiler_builtins \ rustdoc-alloc rustdoc-kernel - $(Q)cp $(srctree)/Documentation/images/logo.svg $(objtree)/$(obj)/doc - $(Q)cp $(srctree)/Documentation/images/COPYING-logo $(objtree)/$(obj)/doc - $(Q)find $(objtree)/$(obj)/doc -name '*.html' -type f -print0 | xargs -0 sed -Ei \ - -e 's:rust-logo\.svg:logo.svg:g' \ - -e 's:rust-logo\.png:logo.svg:g' \ - -e 's:favicon\.svg:logo.svg:g' \ - -e 's:::g' - $(Q)echo '.logo-container > img { object-fit: contain; }' \ - >> $(objtree)/$(obj)/doc/rustdoc.css + $(Q)cp $(srctree)/Documentation/images/logo.svg $(rustdoc_output)/static.files/ + $(Q)cp $(srctree)/Documentation/images/COPYING-logo $(rustdoc_output)/static.files/ + $(Q)find $(rustdoc_output) -name '*.html' -type f -print0 | xargs -0 sed -Ei \ + -e 's:rust-logo-[0-9a-f]+\.svg:logo.svg:g' \ + -e 's:favicon-[0-9a-f]+\.svg:logo.svg:g' \ + -e 's:::g' + $(Q)for f in $(rustdoc_output)/static.files/rustdoc-*.css; do \ + echo ".logo-container > img { object-fit: contain; }" >> $$f; done rustdoc-macros: private rustdoc_host = yes rustdoc-macros: private rustc_target_flags = --crate-type proc-macro \ @@ -154,7 +156,7 @@ @$(objtree)/include/generated/rustc_cfg \ $(rustc_target_flags) $(rustdoc_test_target_flags) \ --sysroot $(objtree)/$(obj)/test/sysroot $(rustdoc_test_quiet) \ - -L$(objtree)/$(obj)/test --output $(objtree)/$(obj)/doc \ + -L$(objtree)/$(obj)/test --output $(rustdoc_output) \ --crate-name $(subst rusttest-,,$@) $< # We cannot use `-Zpanic-abort-tests` because some tests are dynamic, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/rust/kernel/error.rs +++ linux-aws-6.5-6.5.0/rust/kernel/error.rs @@ -37,7 +37,7 @@ declare_err!(E2BIG, "Argument list too long."); declare_err!(ENOEXEC, "Exec format error."); declare_err!(EBADF, "Bad file number."); - declare_err!(ECHILD, "Exec format error."); + declare_err!(ECHILD, "No child processes."); declare_err!(EAGAIN, "Try again."); declare_err!(ENOMEM, "Out of memory."); declare_err!(EACCES, "Permission denied."); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/rust/kernel/types.rs +++ linux-aws-6.5-6.5.0/rust/kernel/types.rs @@ -6,7 +6,7 @@ use alloc::boxed::Box; use core::{ cell::UnsafeCell, - marker::PhantomData, + marker::{PhantomData, PhantomPinned}, mem::MaybeUninit, ops::{Deref, DerefMut}, ptr::NonNull, @@ -206,17 +206,26 @@ /// /// This is meant to be used with FFI objects that are never interpreted by Rust code. #[repr(transparent)] -pub struct Opaque(MaybeUninit>); +pub struct Opaque { + value: UnsafeCell>, + _pin: PhantomPinned, +} impl Opaque { /// Creates a new opaque value. pub const fn new(value: T) -> Self { - Self(MaybeUninit::new(UnsafeCell::new(value))) + Self { + value: UnsafeCell::new(MaybeUninit::new(value)), + _pin: PhantomPinned, + } } /// Creates an uninitialised value. pub const fn uninit() -> Self { - Self(MaybeUninit::uninit()) + Self { + value: UnsafeCell::new(MaybeUninit::uninit()), + _pin: PhantomPinned, + } } /// Creates a pin-initializer from the given initializer closure. @@ -240,7 +249,7 @@ /// Returns a raw pointer to the opaque data. pub fn get(&self) -> *mut T { - UnsafeCell::raw_get(self.0.as_ptr()) + UnsafeCell::get(&self.value).cast::() } /// Gets the value behind `this`. @@ -248,7 +257,7 @@ /// This function is useful to get access to the value without creating intermediate /// references. pub const fn raw_get(this: *const Self) -> *mut T { - UnsafeCell::raw_get(this.cast::>()) + UnsafeCell::raw_get(this.cast::>>()).cast::() } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/samples/bpf/syscall_tp_user.c +++ linux-aws-6.5-6.5.0/samples/bpf/syscall_tp_user.c @@ -17,9 +17,9 @@ static void usage(const char *cmd) { - printf("USAGE: %s [-i num_progs] [-h]\n", cmd); - printf(" -i num_progs # number of progs of the test\n"); - printf(" -h # help\n"); + printf("USAGE: %s [-i nr_tests] [-h]\n", cmd); + printf(" -i nr_tests # rounds of test to run\n"); + printf(" -h # help\n"); } static void verify_map(int map_id) @@ -45,14 +45,14 @@ } } -static int test(char *filename, int num_progs) +static int test(char *filename, int nr_tests) { - int map0_fds[num_progs], map1_fds[num_progs], fd, i, j = 0; - struct bpf_link *links[num_progs * 4]; - struct bpf_object *objs[num_progs]; + int map0_fds[nr_tests], map1_fds[nr_tests], fd, i, j = 0; + struct bpf_link **links = NULL; + struct bpf_object *objs[nr_tests]; struct bpf_program *prog; - for (i = 0; i < num_progs; i++) { + for (i = 0; i < nr_tests; i++) { objs[i] = bpf_object__open_file(filename, NULL); if (libbpf_get_error(objs[i])) { fprintf(stderr, "opening BPF object file failed\n"); @@ -60,6 +60,19 @@ goto cleanup; } + /* One-time initialization */ + if (!links) { + int nr_progs = 0; + + bpf_object__for_each_program(prog, objs[i]) + nr_progs += 1; + + links = calloc(nr_progs * nr_tests, sizeof(struct bpf_link *)); + + if (!links) + goto cleanup; + } + /* load BPF program */ if (bpf_object__load(objs[i])) { fprintf(stderr, "loading BPF object file failed\n"); @@ -101,14 +114,18 @@ close(fd); /* verify the map */ - for (i = 0; i < num_progs; i++) { + for (i = 0; i < nr_tests; i++) { verify_map(map0_fds[i]); verify_map(map1_fds[i]); } cleanup: - for (j--; j >= 0; j--) - bpf_link__destroy(links[j]); + if (links) { + for (j--; j >= 0; j--) + bpf_link__destroy(links[j]); + + free(links); + } for (i--; i >= 0; i--) bpf_object__close(objs[i]); @@ -117,13 +134,13 @@ int main(int argc, char **argv) { - int opt, num_progs = 1; + int opt, nr_tests = 1; char filename[256]; while ((opt = getopt(argc, argv, "i:h")) != -1) { switch (opt) { case 'i': - num_progs = atoi(optarg); + nr_tests = atoi(optarg); break; case 'h': default: @@ -134,5 +151,5 @@ snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]); - return test(filename, num_progs); + return test(filename, nr_tests); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/scripts/Makefile.vmlinux +++ linux-aws-6.5-6.5.0/scripts/Makefile.vmlinux @@ -19,6 +19,7 @@ ifdef CONFIG_MODULES KASAN_SANITIZE_.vmlinux.export.o := n +KCSAN_SANITIZE_.vmlinux.export.o := n GCOV_PROFILE_.vmlinux.export.o := n targets += .vmlinux.export.o vmlinux: .vmlinux.export.o only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/scripts/Makefile.vmlinux_o +++ linux-aws-6.5-6.5.0/scripts/Makefile.vmlinux_o @@ -37,7 +37,8 @@ vmlinux-objtool-args-$(delay-objtool) += $(objtool-args-y) vmlinux-objtool-args-$(CONFIG_GCOV_KERNEL) += --no-unreachable -vmlinux-objtool-args-$(CONFIG_NOINSTR_VALIDATION) += --noinstr $(if $(CONFIG_CPU_UNRET_ENTRY), --unret) +vmlinux-objtool-args-$(CONFIG_NOINSTR_VALIDATION) += --noinstr \ + $(if $(or $(CONFIG_CPU_UNRET_ENTRY),$(CONFIG_CPU_SRSO)), --unret) objtool-args = $(vmlinux-objtool-args-y) --link only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/scripts/checkstack.pl +++ linux-aws-6.5-6.5.0/scripts/checkstack.pl @@ -139,15 +139,11 @@ while (my $line = ) { if ($line =~ m/$funcre/) { $func = $1; - next if $line !~ m/^($xs*)/; + next if $line !~ m/^($x*)/; if ($total_size > $min_stack) { push @stack, "$intro$total_size\n"; } - - $addr = $1; - $addr =~ s/ /0/g; - $addr = "0x$addr"; - + $addr = "0x$1"; $intro = "$addr $func [$file]:"; my $padlen = 56 - length($intro); while ($padlen > 0) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/scripts/dtc/dt-extract-compatibles +++ linux-aws-6.5-6.5.0/scripts/dtc/dt-extract-compatibles @@ -1,8 +1,8 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only +import fnmatch import os -import glob import re import argparse @@ -49,6 +49,24 @@ else: print(*compatibles, sep='\n') +def glob_without_symlinks(root, glob): + for path, dirs, files in os.walk(root): + # Ignore hidden directories + for d in dirs: + if fnmatch.fnmatch(d, ".*"): + dirs.remove(d) + for f in files: + if fnmatch.fnmatch(f, glob): + yield os.path.join(path, f) + +def files_to_parse(path_args): + for f in path_args: + if os.path.isdir(f): + for filename in glob_without_symlinks(f, "*.c"): + yield filename + else: + yield f + show_filename = False if __name__ == "__main__": @@ -59,11 +77,6 @@ show_filename = args.with_filename - for f in args.cfile: - if os.path.isdir(f): - for filename in glob.iglob(f + "/**/*.c", recursive=True): - compat_list = parse_compatibles(filename) - print_compat(filename, compat_list) - else: - compat_list = parse_compatibles(f) - print_compat(f, compat_list) + for f in files_to_parse(args.cfile): + compat_list = parse_compatibles(f) + print_compat(f, compat_list) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/scripts/gcc-plugins/randomize_layout_plugin.c +++ linux-aws-6.5-6.5.0/scripts/gcc-plugins/randomize_layout_plugin.c @@ -191,12 +191,14 @@ static void performance_shuffle(tree *newtree, unsigned long length, ranctx *prng_state) { - unsigned long i, x; + unsigned long i, x, index; struct partition_group size_group[length]; unsigned long num_groups = 0; unsigned long randnum; partition_struct(newtree, length, (struct partition_group *)&size_group, &num_groups); + + /* FIXME: this group shuffle is currently a no-op. */ for (i = num_groups - 1; i > 0; i--) { struct partition_group tmp; randnum = ranval(prng_state) % (i + 1); @@ -206,11 +208,14 @@ } for (x = 0; x < num_groups; x++) { - for (i = size_group[x].start + size_group[x].length - 1; i > size_group[x].start; i--) { + for (index = size_group[x].length - 1; index > 0; index--) { tree tmp; + + i = size_group[x].start + index; if (DECL_BIT_FIELD_TYPE(newtree[i])) continue; - randnum = ranval(prng_state) % (i + 1); + randnum = ranval(prng_state) % (index + 1); + randnum += size_group[x].start; // we could handle this case differently if desired if (DECL_BIT_FIELD_TYPE(newtree[randnum])) continue; @@ -273,8 +278,6 @@ { const_tree fieldtype; const_tree typesize; - const_tree elemtype; - const_tree elemsize; fieldtype = TREE_TYPE(field); typesize = TYPE_SIZE(fieldtype); @@ -282,20 +285,12 @@ if (TREE_CODE(fieldtype) != ARRAY_TYPE) return false; - elemtype = TREE_TYPE(fieldtype); - elemsize = TYPE_SIZE(elemtype); - /* size of type is represented in bits */ if (typesize == NULL_TREE && TYPE_DOMAIN(fieldtype) != NULL_TREE && TYPE_MAX_VALUE(TYPE_DOMAIN(fieldtype)) == NULL_TREE) return true; - if (typesize != NULL_TREE && - (TREE_CONSTANT(typesize) && (!tree_to_uhwi(typesize) || - tree_to_uhwi(typesize) == tree_to_uhwi(elemsize)))) - return true; - return false; } @@ -344,8 +339,7 @@ /* * enforce that we don't randomize the layout of the last - * element of a struct if it's a 0 or 1-length array - * or a proper flexible array + * element of a struct if it's a proper flexible array */ if (is_flexible_array(newtree[num_fields - 1])) { has_flexarray = true; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/scripts/gdb/linux/device.py +++ linux-aws-6.5-6.5.0/scripts/gdb/linux/device.py @@ -36,26 +36,26 @@ for kobj in kset_for_each_object(gdb.parse_and_eval('bus_kset')): subsys = container_of(kobj, kset_type.get_type().pointer(), 'kobj') subsys_priv = container_of(subsys, subsys_private_type.get_type().pointer(), 'subsys') - yield subsys_priv['bus'] + yield subsys_priv def for_each_class(): for kobj in kset_for_each_object(gdb.parse_and_eval('class_kset')): subsys = container_of(kobj, kset_type.get_type().pointer(), 'kobj') subsys_priv = container_of(subsys, subsys_private_type.get_type().pointer(), 'subsys') - yield subsys_priv['class'] + yield subsys_priv def get_bus_by_name(name): for item in for_each_bus(): - if item['name'].string() == name: + if item['bus']['name'].string() == name: return item raise gdb.GdbError("Can't find bus type {!r}".format(name)) def get_class_by_name(name): for item in for_each_class(): - if item['name'].string() == name: + if item['class']['name'].string() == name: return item raise gdb.GdbError("Can't find device class {!r}".format(name)) @@ -70,13 +70,13 @@ def bus_for_each_device(bus): - for kn in klist_for_each(bus['p']['klist_devices']): + for kn in klist_for_each(bus['klist_devices']): dp = container_of(kn, device_private_type.get_type().pointer(), 'knode_bus') yield dp['device'] def class_for_each_device(cls): - for kn in klist_for_each(cls['p']['klist_devices']): + for kn in klist_for_each(cls['klist_devices']): dp = container_of(kn, device_private_type.get_type().pointer(), 'knode_class') yield dp['device'] @@ -103,7 +103,7 @@ def invoke(self, arg, from_tty): if not arg: for bus in for_each_bus(): - gdb.write('bus {}:\t{}\n'.format(bus['name'].string(), bus)) + gdb.write('bus {}:\t{}\n'.format(bus['bus']['name'].string(), bus)) for dev in bus_for_each_device(bus): _show_device(dev, level=1) else: @@ -123,7 +123,7 @@ def invoke(self, arg, from_tty): if not arg: for cls in for_each_class(): - gdb.write("class {}:\t{}\n".format(cls['name'].string(), cls)) + gdb.write("class {}:\t{}\n".format(cls['class']['name'].string(), cls)) for dev in class_for_each_device(cls): _show_device(dev, level=1) else: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/scripts/kconfig/symbol.c +++ linux-aws-6.5-6.5.0/scripts/kconfig/symbol.c @@ -122,9 +122,9 @@ static void sym_validate_range(struct symbol *sym) { struct property *prop; + struct symbol *range_sym; int base; long long val, val2; - char str[64]; switch (sym->type) { case S_INT: @@ -140,17 +140,15 @@ if (!prop) return; val = strtoll(sym->curr.val, NULL, base); - val2 = sym_get_range_val(prop->expr->left.sym, base); + range_sym = prop->expr->left.sym; + val2 = sym_get_range_val(range_sym, base); if (val >= val2) { - val2 = sym_get_range_val(prop->expr->right.sym, base); + range_sym = prop->expr->right.sym; + val2 = sym_get_range_val(range_sym, base); if (val <= val2) return; } - if (sym->type == S_INT) - sprintf(str, "%lld", val2); - else - sprintf(str, "0x%llx", val2); - sym->curr.val = xstrdup(str); + sym->curr.val = range_sym->curr.val; } static void sym_set_changed(struct symbol *sym) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/security/integrity/iint.c +++ linux-aws-6.5-6.5.0/security/integrity/iint.c @@ -66,9 +66,32 @@ return iint; } -static void iint_free(struct integrity_iint_cache *iint) +#define IMA_MAX_NESTING (FILESYSTEM_MAX_STACK_DEPTH+1) + +/* + * It is not clear that IMA should be nested at all, but as long is it measures + * files both on overlayfs and on underlying fs, we need to annotate the iint + * mutex to avoid lockdep false positives related to IMA + overlayfs. + * See ovl_lockdep_annotate_inode_mutex_key() for more details. + */ +static inline void iint_lockdep_annotate(struct integrity_iint_cache *iint, + struct inode *inode) +{ +#ifdef CONFIG_LOCKDEP + static struct lock_class_key iint_mutex_key[IMA_MAX_NESTING]; + + int depth = inode->i_sb->s_stack_depth; + + if (WARN_ON_ONCE(depth < 0 || depth >= IMA_MAX_NESTING)) + depth = 0; + + lockdep_set_class(&iint->mutex, &iint_mutex_key[depth]); +#endif +} + +static void iint_init_always(struct integrity_iint_cache *iint, + struct inode *inode) { - kfree(iint->ima_hash); iint->ima_hash = NULL; iint->version = 0; iint->flags = 0UL; @@ -80,6 +103,14 @@ iint->ima_creds_status = INTEGRITY_UNKNOWN; iint->evm_status = INTEGRITY_UNKNOWN; iint->measured_pcrs = 0; + mutex_init(&iint->mutex); + iint_lockdep_annotate(iint, inode); +} + +static void iint_free(struct integrity_iint_cache *iint) +{ + kfree(iint->ima_hash); + mutex_destroy(&iint->mutex); kmem_cache_free(iint_cache, iint); } @@ -104,6 +135,8 @@ if (!iint) return NULL; + iint_init_always(iint, inode); + write_lock(&integrity_iint_lock); p = &integrity_iint_tree.rb_node; @@ -153,25 +186,18 @@ iint_free(iint); } -static void init_once(void *foo) +static void iint_init_once(void *foo) { struct integrity_iint_cache *iint = (struct integrity_iint_cache *) foo; memset(iint, 0, sizeof(*iint)); - iint->ima_file_status = INTEGRITY_UNKNOWN; - iint->ima_mmap_status = INTEGRITY_UNKNOWN; - iint->ima_bprm_status = INTEGRITY_UNKNOWN; - iint->ima_read_status = INTEGRITY_UNKNOWN; - iint->ima_creds_status = INTEGRITY_UNKNOWN; - iint->evm_status = INTEGRITY_UNKNOWN; - mutex_init(&iint->mutex); } static int __init integrity_iintcache_init(void) { iint_cache = kmem_cache_create("iint_cache", sizeof(struct integrity_iint_cache), - 0, SLAB_PANIC, init_once); + 0, SLAB_PANIC, iint_init_once); return 0; } DEFINE_LSM(integrity) = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/security/integrity/integrity.h +++ linux-aws-6.5-6.5.0/security/integrity/integrity.h @@ -164,6 +164,8 @@ unsigned long flags; unsigned long measured_pcrs; unsigned long atomic_flags; + unsigned long real_ino; + dev_t real_dev; enum integrity_status ima_file_status:4; enum integrity_status ima_mmap_status:4; enum integrity_status ima_bprm_status:4; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/security/keys/trusted-keys/trusted_tee.c +++ linux-aws-6.5-6.5.0/security/keys/trusted-keys/trusted_tee.c @@ -65,24 +65,16 @@ int ret; struct tee_ioctl_invoke_arg inv_arg; struct tee_param param[4]; - struct tee_shm *reg_shm_in = NULL, *reg_shm_out = NULL; + struct tee_shm *reg_shm = NULL; memset(&inv_arg, 0, sizeof(inv_arg)); memset(¶m, 0, sizeof(param)); - reg_shm_in = tee_shm_register_kernel_buf(pvt_data.ctx, p->key, - p->key_len); - if (IS_ERR(reg_shm_in)) { - dev_err(pvt_data.dev, "key shm register failed\n"); - return PTR_ERR(reg_shm_in); - } - - reg_shm_out = tee_shm_register_kernel_buf(pvt_data.ctx, p->blob, - sizeof(p->blob)); - if (IS_ERR(reg_shm_out)) { - dev_err(pvt_data.dev, "blob shm register failed\n"); - ret = PTR_ERR(reg_shm_out); - goto out; + reg_shm = tee_shm_register_kernel_buf(pvt_data.ctx, p->key, + sizeof(p->key) + sizeof(p->blob)); + if (IS_ERR(reg_shm)) { + dev_err(pvt_data.dev, "shm register failed\n"); + return PTR_ERR(reg_shm); } inv_arg.func = TA_CMD_SEAL; @@ -90,13 +82,13 @@ inv_arg.num_params = 4; param[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT; - param[0].u.memref.shm = reg_shm_in; + param[0].u.memref.shm = reg_shm; param[0].u.memref.size = p->key_len; param[0].u.memref.shm_offs = 0; param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT; - param[1].u.memref.shm = reg_shm_out; + param[1].u.memref.shm = reg_shm; param[1].u.memref.size = sizeof(p->blob); - param[1].u.memref.shm_offs = 0; + param[1].u.memref.shm_offs = sizeof(p->key); ret = tee_client_invoke_func(pvt_data.ctx, &inv_arg, param); if ((ret < 0) || (inv_arg.ret != 0)) { @@ -107,11 +99,7 @@ p->blob_len = param[1].u.memref.size; } -out: - if (reg_shm_out) - tee_shm_free(reg_shm_out); - if (reg_shm_in) - tee_shm_free(reg_shm_in); + tee_shm_free(reg_shm); return ret; } @@ -124,24 +112,16 @@ int ret; struct tee_ioctl_invoke_arg inv_arg; struct tee_param param[4]; - struct tee_shm *reg_shm_in = NULL, *reg_shm_out = NULL; + struct tee_shm *reg_shm = NULL; memset(&inv_arg, 0, sizeof(inv_arg)); memset(¶m, 0, sizeof(param)); - reg_shm_in = tee_shm_register_kernel_buf(pvt_data.ctx, p->blob, - p->blob_len); - if (IS_ERR(reg_shm_in)) { - dev_err(pvt_data.dev, "blob shm register failed\n"); - return PTR_ERR(reg_shm_in); - } - - reg_shm_out = tee_shm_register_kernel_buf(pvt_data.ctx, p->key, - sizeof(p->key)); - if (IS_ERR(reg_shm_out)) { - dev_err(pvt_data.dev, "key shm register failed\n"); - ret = PTR_ERR(reg_shm_out); - goto out; + reg_shm = tee_shm_register_kernel_buf(pvt_data.ctx, p->key, + sizeof(p->key) + sizeof(p->blob)); + if (IS_ERR(reg_shm)) { + dev_err(pvt_data.dev, "shm register failed\n"); + return PTR_ERR(reg_shm); } inv_arg.func = TA_CMD_UNSEAL; @@ -149,11 +129,11 @@ inv_arg.num_params = 4; param[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT; - param[0].u.memref.shm = reg_shm_in; + param[0].u.memref.shm = reg_shm; param[0].u.memref.size = p->blob_len; - param[0].u.memref.shm_offs = 0; + param[0].u.memref.shm_offs = sizeof(p->key); param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT; - param[1].u.memref.shm = reg_shm_out; + param[1].u.memref.shm = reg_shm; param[1].u.memref.size = sizeof(p->key); param[1].u.memref.shm_offs = 0; @@ -166,11 +146,7 @@ p->key_len = param[1].u.memref.size; } -out: - if (reg_shm_out) - tee_shm_free(reg_shm_out); - if (reg_shm_in) - tee_shm_free(reg_shm_in); + tee_shm_free(reg_shm); return ret; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/core/info.c +++ linux-aws-6.5-6.5.0/sound/core/info.c @@ -56,7 +56,7 @@ }; static int snd_info_version_init(void); -static void snd_info_disconnect(struct snd_info_entry *entry); +static void snd_info_clear_entries(struct snd_info_entry *entry); /* @@ -569,11 +569,16 @@ { if (!card) return; - mutex_lock(&info_mutex); + proc_remove(card->proc_root_link); - card->proc_root_link = NULL; if (card->proc_root) - snd_info_disconnect(card->proc_root); + proc_remove(card->proc_root->p); + + mutex_lock(&info_mutex); + if (card->proc_root) + snd_info_clear_entries(card->proc_root); + card->proc_root_link = NULL; + card->proc_root = NULL; mutex_unlock(&info_mutex); } @@ -745,15 +750,14 @@ } EXPORT_SYMBOL(snd_info_create_card_entry); -static void snd_info_disconnect(struct snd_info_entry *entry) +static void snd_info_clear_entries(struct snd_info_entry *entry) { struct snd_info_entry *p; if (!entry->p) return; list_for_each_entry(p, &entry->children, list) - snd_info_disconnect(p); - proc_remove(entry->p); + snd_info_clear_entries(p); entry->p = NULL; } @@ -770,8 +774,9 @@ if (!entry) return; if (entry->p) { + proc_remove(entry->p); mutex_lock(&info_mutex); - snd_info_disconnect(entry); + snd_info_clear_entries(entry); mutex_unlock(&info_mutex); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/core/pcm.c +++ linux-aws-6.5-6.5.0/sound/core/pcm.c @@ -253,6 +253,7 @@ STATE(DRAINING), STATE(PAUSED), STATE(SUSPENDED), + STATE(DISCONNECTED), }; static const char * const snd_pcm_access_names[] = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/hda/hdac_stream.c +++ linux-aws-6.5-6.5.0/sound/hda/hdac_stream.c @@ -354,8 +354,10 @@ struct hdac_stream *res = NULL; /* make a non-zero unique key for the substream */ - int key = (substream->pcm->device << 16) | (substream->number << 2) | - (substream->stream + 1); + int key = (substream->number << 2) | (substream->stream + 1); + + if (substream->pcm) + key |= (substream->pcm->device << 16); spin_lock_irq(&bus->reg_lock); list_for_each_entry(azx_dev, &bus->stream_list, list) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/codecs/da7219-aad.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/da7219-aad.c @@ -59,9 +59,6 @@ bool micbias_up = false; int retries = 0; - /* Disable ground switch */ - snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00); - /* Drive headphones/lineout */ snd_soc_component_update_bits(component, DA7219_HP_L_CTRL, DA7219_HP_L_AMP_OE_MASK, @@ -155,9 +152,6 @@ tonegen_freq_hptest = cpu_to_le16(DA7219_AAD_HPTEST_RAMP_FREQ_INT_OSC); } - /* Disable ground switch */ - snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00); - /* Ensure gain ramping at fastest rate */ gain_ramp_ctrl = snd_soc_component_read(component, DA7219_GAIN_RAMP_CTRL); snd_soc_component_write(component, DA7219_GAIN_RAMP_CTRL, DA7219_GAIN_RAMP_RATE_X8); @@ -421,6 +415,11 @@ * handle a removal, and we can check at the end of * hptest if we have a valid result or not. */ + + cancel_delayed_work_sync(&da7219_aad->jack_det_work); + /* Disable ground switch */ + snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00); + if (statusa & DA7219_JACK_TYPE_STS_MASK) { report |= SND_JACK_HEADSET; mask |= SND_JACK_HEADSET | SND_JACK_LINEOUT; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/codecs/lpass-tx-macro.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/lpass-tx-macro.c @@ -2021,6 +2021,11 @@ tx->dev = dev; + /* Set active_decimator default value */ + tx->active_decimator[TX_MACRO_AIF1_CAP] = -1; + tx->active_decimator[TX_MACRO_AIF2_CAP] = -1; + tx->active_decimator[TX_MACRO_AIF3_CAP] = -1; + /* set MCLK and NPL rates */ clk_set_rate(tx->mclk, MCLK_FREQ); clk_set_rate(tx->npl, MCLK_FREQ); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/codecs/lpass-wsa-macro.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/lpass-wsa-macro.c @@ -1685,6 +1685,9 @@ boost_path_cfg1 = CDC_WSA_RX1_RX_PATH_CFG1; reg = CDC_WSA_RX1_RX_PATH_CTL; reg_mix = CDC_WSA_RX1_RX_PATH_MIX_CTL; + } else { + dev_warn(component->dev, "Incorrect widget name in the driver\n"); + return -EINVAL; } switch (event) { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/codecs/rt5645.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/rt5645.c @@ -3251,6 +3251,8 @@ RT5645_GP1_PIN_IRQ, RT5645_GP1_PIN_IRQ); regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL1, RT5645_DIG_GATE_CTRL, RT5645_DIG_GATE_CTRL); + regmap_update_bits(rt5645->regmap, RT5645_DEPOP_M1, + RT5645_HP_CB_MASK, RT5645_HP_CB_PU); } rt5645_irq(0, rt5645); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/codecs/tas2780.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/tas2780.c @@ -39,7 +39,7 @@ usleep_range(2000, 2050); } - snd_soc_component_write(tas2780->component, TAS2780_SW_RST, + ret = snd_soc_component_write(tas2780->component, TAS2780_SW_RST, TAS2780_RST); if (ret) dev_err(tas2780->dev, "%s:errCode:0x%x Reset error!\n", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/codecs/tlv320adc3xxx.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/tlv320adc3xxx.c @@ -293,7 +293,7 @@ #define ADC3XXX_BYPASS_RPGA 0x80 /* MICBIAS control bits */ -#define ADC3XXX_MICBIAS_MASK 0x2 +#define ADC3XXX_MICBIAS_MASK 0x3 #define ADC3XXX_MICBIAS1_SHIFT 5 #define ADC3XXX_MICBIAS2_SHIFT 3 @@ -1099,7 +1099,7 @@ unsigned int val; if (!of_property_read_u32(np, propname, &val)) { - if (val >= ADC3XXX_MICBIAS_AVDD) { + if (val > ADC3XXX_MICBIAS_AVDD) { dev_err(dev, "Invalid property value for '%s'\n", propname); return -EINVAL; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/codecs/wcd938x-sdw.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/wcd938x-sdw.c @@ -1278,7 +1278,31 @@ pm_runtime_set_active(dev); pm_runtime_enable(dev); - return component_add(dev, &wcd938x_sdw_component_ops); + ret = component_add(dev, &wcd938x_sdw_component_ops); + if (ret) + goto err_disable_rpm; + + return 0; + +err_disable_rpm: + pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); + pm_runtime_dont_use_autosuspend(dev); + + return ret; +} + +static int wcd9380_remove(struct sdw_slave *pdev) +{ + struct device *dev = &pdev->dev; + + component_del(dev, &wcd938x_sdw_component_ops); + + pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); + pm_runtime_dont_use_autosuspend(dev); + + return 0; } static const struct sdw_device_id wcd9380_slave_id[] = { @@ -1320,6 +1344,7 @@ static struct sdw_driver wcd9380_codec_driver = { .probe = wcd9380_probe, + .remove = wcd9380_remove, .ops = &wcd9380_slave_ops, .id_table = wcd9380_slave_id, .driver = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/codecs/wcd938x.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/wcd938x.c @@ -3325,8 +3325,10 @@ return dev_err_probe(dev, ret, "Failed to get supplies\n"); ret = regulator_bulk_enable(WCD938X_MAX_SUPPLY, wcd938x->supplies); - if (ret) + if (ret) { + regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); return dev_err_probe(dev, ret, "Failed to enable supplies\n"); + } wcd938x_dt_parse_micbias_info(dev, wcd938x); @@ -3435,7 +3437,8 @@ wcd938x->rxdev = wcd938x_sdw_device_get(wcd938x->rxnode); if (!wcd938x->rxdev) { dev_err(dev, "could not find slave with matching of node\n"); - return -EINVAL; + ret = -EINVAL; + goto err_unbind; } wcd938x->sdw_priv[AIF1_PB] = dev_get_drvdata(wcd938x->rxdev); wcd938x->sdw_priv[AIF1_PB]->wcd938x = wcd938x; @@ -3443,46 +3446,47 @@ wcd938x->txdev = wcd938x_sdw_device_get(wcd938x->txnode); if (!wcd938x->txdev) { dev_err(dev, "could not find txslave with matching of node\n"); - return -EINVAL; + ret = -EINVAL; + goto err_put_rxdev; } wcd938x->sdw_priv[AIF1_CAP] = dev_get_drvdata(wcd938x->txdev); wcd938x->sdw_priv[AIF1_CAP]->wcd938x = wcd938x; wcd938x->tx_sdw_dev = dev_to_sdw_dev(wcd938x->txdev); - if (!wcd938x->tx_sdw_dev) { - dev_err(dev, "could not get txslave with matching of dev\n"); - return -EINVAL; - } /* As TX is main CSR reg interface, which should not be suspended first. * expicilty add the dependency link */ if (!device_link_add(wcd938x->rxdev, wcd938x->txdev, DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME)) { dev_err(dev, "could not devlink tx and rx\n"); - return -EINVAL; + ret = -EINVAL; + goto err_put_txdev; } if (!device_link_add(dev, wcd938x->txdev, DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME)) { dev_err(dev, "could not devlink wcd and tx\n"); - return -EINVAL; + ret = -EINVAL; + goto err_remove_rxtx_link; } if (!device_link_add(dev, wcd938x->rxdev, DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME)) { dev_err(dev, "could not devlink wcd and rx\n"); - return -EINVAL; + ret = -EINVAL; + goto err_remove_tx_link; } wcd938x->regmap = dev_get_regmap(&wcd938x->tx_sdw_dev->dev, NULL); if (!wcd938x->regmap) { dev_err(dev, "could not get TX device regmap\n"); - return -EINVAL; + ret = -EINVAL; + goto err_remove_rx_link; } ret = wcd938x_irq_init(wcd938x, dev); if (ret) { dev_err(dev, "%s: IRQ init failed: %d\n", __func__, ret); - return ret; + goto err_remove_rx_link; } wcd938x->sdw_priv[AIF1_PB]->slave_irq = wcd938x->virq; @@ -3491,27 +3495,45 @@ ret = wcd938x_set_micbias_data(wcd938x); if (ret < 0) { dev_err(dev, "%s: bad micbias pdata\n", __func__); - return ret; + goto err_remove_rx_link; } ret = snd_soc_register_component(dev, &soc_codec_dev_wcd938x, wcd938x_dais, ARRAY_SIZE(wcd938x_dais)); - if (ret) + if (ret) { dev_err(dev, "%s: Codec registration failed\n", __func__); + goto err_remove_rx_link; + } - return ret; + return 0; +err_remove_rx_link: + device_link_remove(dev, wcd938x->rxdev); +err_remove_tx_link: + device_link_remove(dev, wcd938x->txdev); +err_remove_rxtx_link: + device_link_remove(wcd938x->rxdev, wcd938x->txdev); +err_put_txdev: + put_device(wcd938x->txdev); +err_put_rxdev: + put_device(wcd938x->rxdev); +err_unbind: + component_unbind_all(dev, wcd938x); + + return ret; } static void wcd938x_unbind(struct device *dev) { struct wcd938x_priv *wcd938x = dev_get_drvdata(dev); + snd_soc_unregister_component(dev); device_link_remove(dev, wcd938x->txdev); device_link_remove(dev, wcd938x->rxdev); device_link_remove(wcd938x->rxdev, wcd938x->txdev); - snd_soc_unregister_component(dev); + put_device(wcd938x->txdev); + put_device(wcd938x->rxdev); component_unbind_all(dev, wcd938x); } @@ -3572,13 +3594,13 @@ ret = wcd938x_add_slave_components(wcd938x, dev, &match); if (ret) - return ret; + goto err_disable_regulators; wcd938x_reset(wcd938x); ret = component_master_add_with_match(dev, &wcd938x_comp_ops, match); if (ret) - return ret; + goto err_disable_regulators; pm_runtime_set_autosuspend_delay(dev, 1000); pm_runtime_use_autosuspend(dev); @@ -3588,11 +3610,27 @@ pm_runtime_idle(dev); return 0; + +err_disable_regulators: + regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies); + regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); + + return ret; } static void wcd938x_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &wcd938x_comp_ops); + struct device *dev = &pdev->dev; + struct wcd938x_priv *wcd938x = dev_get_drvdata(dev); + + component_master_del(dev, &wcd938x_comp_ops); + + pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); + pm_runtime_dont_use_autosuspend(dev); + + regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies); + regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); } #if defined(CONFIG_OF) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/codecs/wsa883x.c +++ linux-aws-6.5-6.5.0/sound/soc/codecs/wsa883x.c @@ -1203,9 +1203,6 @@ break; } - snd_soc_component_write_field(component, WSA883X_DRE_CTL_1, - WSA883X_DRE_GAIN_EN_MASK, - WSA883X_DRE_GAIN_FROM_CSR); if (wsa883x->port_enable[WSA883X_PORT_COMP]) snd_soc_component_write_field(component, WSA883X_DRE_CTL_0, WSA883X_DRE_OFFSET_MASK, @@ -1218,9 +1215,6 @@ snd_soc_component_write_field(component, WSA883X_PDM_WD_CTL, WSA883X_PDM_EN_MASK, WSA883X_PDM_ENABLE); - snd_soc_component_write_field(component, WSA883X_PA_FSM_CTL, - WSA883X_GLOBAL_PA_EN_MASK, - WSA883X_GLOBAL_PA_ENABLE); break; case SND_SOC_DAPM_PRE_PMD: @@ -1346,6 +1340,7 @@ .hw_free = wsa883x_hw_free, .mute_stream = wsa883x_digital_mute, .set_stream = wsa883x_set_sdw_stream, + .mute_unmute_on_trigger = true, }; static struct snd_soc_dai_driver wsa883x_dais[] = { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/fsl/fsl-asoc-card.c +++ linux-aws-6.5-6.5.0/sound/soc/fsl/fsl-asoc-card.c @@ -41,6 +41,7 @@ /** * struct codec_priv - CODEC private data + * @mclk: Main clock of the CODEC * @mclk_freq: Clock rate of MCLK * @free_freq: Clock rate of MCLK for hw_free() * @mclk_id: MCLK (or main clock) id for set_sysclk() @@ -52,8 +53,8 @@ unsigned long mclk_freq; unsigned long free_freq; u32 mclk_id; - u32 fll_id; - u32 pll_id; + int fll_id; + int pll_id; }; /** @@ -206,7 +207,7 @@ } /* Specific configuration for PLL */ - if (codec_priv->pll_id && codec_priv->fll_id) { + if (codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) { if (priv->sample_format == SNDRV_PCM_FORMAT_S24_LE) pll_out = priv->sample_rate * 384; else @@ -248,7 +249,7 @@ priv->streams &= ~BIT(substream->stream); - if (!priv->streams && codec_priv->pll_id && codec_priv->fll_id) { + if (!priv->streams && codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) { /* Force freq to be free_freq to avoid error message in codec */ ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0), codec_priv->mclk_id, @@ -621,6 +622,10 @@ priv->card.dapm_routes = audio_map; priv->card.num_dapm_routes = ARRAY_SIZE(audio_map); priv->card.driver_name = DRIVER_NAME; + + priv->codec_priv.fll_id = -1; + priv->codec_priv.pll_id = -1; + /* Diversify the card configurations */ if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) { codec_dai_name = "cs42888"; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/fsl/fsl_easrc.c +++ linux-aws-6.5-6.5.0/sound/soc/fsl/fsl_easrc.c @@ -1966,17 +1966,21 @@ &fsl_easrc_dai, 1); if (ret) { dev_err(dev, "failed to register ASoC DAI\n"); - return ret; + goto err_pm_disable; } ret = devm_snd_soc_register_component(dev, &fsl_asrc_component, NULL, 0); if (ret) { dev_err(&pdev->dev, "failed to register ASoC platform\n"); - return ret; + goto err_pm_disable; } return 0; + +err_pm_disable: + pm_runtime_disable(&pdev->dev); + return ret; } static void fsl_easrc_remove(struct platform_device *pdev) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/fsl/mpc5200_dma.c +++ linux-aws-6.5-6.5.0/sound/soc/fsl/mpc5200_dma.c @@ -100,6 +100,9 @@ /** * psc_dma_trigger: start and stop the DMA transfer. + * @component: triggered component + * @substream: triggered substream + * @cmd: triggered command * * This function is called by ALSA to start, stop, pause, and resume the DMA * transfer of data. only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/generic/simple-card.c +++ linux-aws-6.5-6.5.0/sound/soc/generic/simple-card.c @@ -701,10 +701,12 @@ struct snd_soc_dai_link *dai_link = priv->dai_link; struct simple_dai_props *dai_props = priv->dai_props; + ret = -EINVAL; + cinfo = dev->platform_data; if (!cinfo) { dev_err(dev, "no info for asoc-simple-card\n"); - return -EINVAL; + goto err; } if (!cinfo->name || @@ -713,7 +715,7 @@ !cinfo->platform || !cinfo->cpu_dai.name) { dev_err(dev, "insufficient asoc_simple_card_info settings\n"); - return -EINVAL; + goto err; } cpus = dai_link->cpus; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/intel/common/soc-acpi-intel-cht-match.c +++ linux-aws-6.5-6.5.0/sound/soc/intel/common/soc-acpi-intel-cht-match.c @@ -75,6 +75,39 @@ return arg; } +/* + * The Lenovo Yoga Tab 3 Pro YT3-X90, with Android factory OS has a buggy DSDT + * with the coded not being listed at all. + */ +static const struct dmi_system_id lenovo_yoga_tab3_x90[] = { + { + /* Lenovo Yoga Tab 3 Pro YT3-X90, codec missing from DSDT */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"), + }, + }, + { } +}; + +static struct snd_soc_acpi_mach cht_lenovo_yoga_tab3_x90_mach = { + .id = "10WM5102", + .drv_name = "bytcr_wm5102", + .fw_filename = "intel/fw_sst_22a8.bin", + .board = "bytcr_wm5102", + .sof_tplg_filename = "sof-cht-wm5102.tplg", +}; + +static struct snd_soc_acpi_mach *lenovo_yt3_x90_quirk(void *arg) +{ + if (dmi_check_system(lenovo_yoga_tab3_x90)) + return &cht_lenovo_yoga_tab3_x90_mach; + + /* Skip wildcard match snd_soc_acpi_intel_cherrytrail_machines[] entry */ + return NULL; +} + static const struct snd_soc_acpi_codecs rt5640_comp_ids = { .num_codecs = 2, .codecs = { "10EC5640", "10EC3276" }, @@ -175,6 +208,16 @@ .drv_name = "sof_pcm512x", .sof_tplg_filename = "sof-cht-src-50khz-pcm512x.tplg", }, + /* + * Special case for the Lenovo Yoga Tab 3 Pro YT3-X90 where the DSDT + * misses the codec. Match on the SST id instead, lenovo_yt3_x90_quirk() + * will return a YT3 specific mach or NULL when called on other hw, + * skipping this entry. + */ + { + .id = "808622A8", + .machine_quirk = lenovo_yt3_x90_quirk, + }, #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/intel/skylake/skl-sst-utils.c +++ linux-aws-6.5-6.5.0/sound/soc/intel/skylake/skl-sst-utils.c @@ -299,6 +299,7 @@ module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL); if (!module->instance_id) { ret = -ENOMEM; + kfree(module); goto free_uuid_list; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c +++ linux-aws-6.5-6.5.0/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c @@ -1179,7 +1179,7 @@ playback_codec = of_get_child_by_name(pdev->dev.of_node, "playback-codecs"); if (!playback_codec) { ret = -EINVAL; - dev_err_probe(&pdev->dev, ret, "Property 'speaker-codecs' missing or invalid\n"); + dev_err_probe(&pdev->dev, ret, "Property 'playback-codecs' missing or invalid\n"); goto err_playback_codec; } @@ -1193,7 +1193,7 @@ for_each_card_prelinks(card, i, dai_link) { ret = mt8186_mt6366_card_set_be_link(card, dai_link, playback_codec, "I2S3"); if (ret) { - dev_err_probe(&pdev->dev, ret, "%s set speaker_codec fail\n", + dev_err_probe(&pdev->dev, ret, "%s set playback_codec fail\n", dai_link->name); goto err_probe; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/mediatek/mt8188/mt8188-mt6359.c +++ linux-aws-6.5-6.5.0/sound/soc/mediatek/mt8188/mt8188-mt6359.c @@ -246,6 +246,11 @@ SND_SOC_DAPM_MIC("Headset Mic", NULL), SND_SOC_DAPM_SINK("HDMI"), SND_SOC_DAPM_SINK("DP"), + + /* dynamic pinctrl */ + SND_SOC_DAPM_PINCTRL("ETDM_SPK_PIN", "aud_etdm_spk_on", "aud_etdm_spk_off"), + SND_SOC_DAPM_PINCTRL("ETDM_HP_PIN", "aud_etdm_hp_on", "aud_etdm_hp_off"), + SND_SOC_DAPM_PINCTRL("MTKAIF_PIN", "aud_mtkaif_on", "aud_mtkaif_off"), }; static const struct snd_kcontrol_new mt8188_mt6359_controls[] = { @@ -267,6 +272,7 @@ snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); struct snd_soc_component *cmpnt_codec = asoc_rtd_to_codec(rtd, 0)->component; + struct snd_soc_dapm_widget *pin_w = NULL, *w; struct mtk_base_afe *afe; struct mt8188_afe_private *afe_priv; struct mtkaif_param *param; @@ -306,6 +312,18 @@ return 0; } + for_each_card_widgets(rtd->card, w) { + if (!strcmp(w->name, "MTKAIF_PIN")) { + pin_w = w; + break; + } + } + + if (pin_w) + dapm_pinctrl_event(pin_w, NULL, SND_SOC_DAPM_PRE_PMU); + else + dev_dbg(afe->dev, "%s(), no pinmux widget, please check if default on\n", __func__); + pm_runtime_get_sync(afe->dev); mt6359_mtkaif_calibration_enable(cmpnt_codec); @@ -403,6 +421,9 @@ for (i = 0; i < MT8188_MTKAIF_MISO_NUM; i++) param->mtkaif_phase_cycle[i] = mtkaif_phase_cycle[i]; + if (pin_w) + dapm_pinctrl_event(pin_w, NULL, SND_SOC_DAPM_POST_PMD); + dev_dbg(afe->dev, "%s(), end, calibration ok %d\n", __func__, param->mtkaif_calibration_ok); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/pxa/pxa-ssp.c +++ linux-aws-6.5-6.5.0/sound/soc/pxa/pxa-ssp.c @@ -779,7 +779,7 @@ if (IS_ERR(priv->extclk)) { ret = PTR_ERR(priv->extclk); if (ret == -EPROBE_DEFER) - return ret; + goto err_priv; priv->extclk = NULL; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/qcom/sc8280xp.c +++ linux-aws-6.5-6.5.0/sound/soc/qcom/sc8280xp.c @@ -27,6 +27,23 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd) { struct sc8280xp_snd_data *data = snd_soc_card_get_drvdata(rtd->card); + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); + struct snd_soc_card *card = rtd->card; + + switch (cpu_dai->id) { + case WSA_CODEC_DMA_RX_0: + case WSA_CODEC_DMA_RX_1: + /* + * set limit of 0dB on Digital Volume for Speakers, + * this can prevent damage of speakers to some extent without + * active speaker protection + */ + snd_soc_limit_volume(card, "WSA_RX0 Digital Volume", 84); + snd_soc_limit_volume(card, "WSA_RX1 Digital Volume", 84); + break; + default: + break; + } return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/soc-component.c +++ linux-aws-6.5-6.5.0/sound/soc/soc-component.c @@ -242,6 +242,7 @@ char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; struct snd_kcontrol *kctl; + /* When updating, change also snd_soc_dapm_widget_name_cmp() */ if (component->name_prefix) snprintf(name, ARRAY_SIZE(name), "%s %s", component->name_prefix, ctl); else only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/soc-core.c +++ linux-aws-6.5-6.5.0/sound/soc/soc-core.c @@ -1259,7 +1259,7 @@ snd_soc_runtime_get_dai_fmt(rtd); ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); if (ret) - return ret; + goto err; /* add DPCM sysfs entries */ soc_dpcm_debugfs_add(rtd); @@ -1284,17 +1284,26 @@ /* create compress_device if possible */ ret = snd_soc_dai_compress_new(cpu_dai, rtd, num); if (ret != -ENOTSUPP) - return ret; + goto err; /* create the pcm */ ret = soc_new_pcm(rtd, num); if (ret < 0) { dev_err(card->dev, "ASoC: can't create pcm %s :%d\n", dai_link->stream_name, ret); - return ret; + goto err; } - return snd_soc_pcm_dai_new(rtd); + ret = snd_soc_pcm_dai_new(rtd); + if (ret < 0) + goto err; + + rtd->initialized = true; + + return 0; +err: + snd_soc_link_exit(rtd); + return ret; } static void soc_set_name_prefix(struct snd_soc_card *card, @@ -1892,7 +1901,8 @@ /* release machine specific resources */ for_each_card_rtds(card, rtd) - snd_soc_link_exit(rtd); + if (rtd->initialized) + snd_soc_link_exit(rtd); /* remove and free each DAI */ soc_remove_link_dais(card); soc_remove_link_components(card); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/soc-dai.c +++ linux-aws-6.5-6.5.0/sound/soc/soc-dai.c @@ -641,6 +641,10 @@ ret = soc_dai_trigger(dai, substream, cmd); if (ret < 0) break; + + if (dai->driver->ops && dai->driver->ops->mute_unmute_on_trigger) + snd_soc_dai_digital_mute(dai, 0, substream->stream); + soc_dai_mark_push(dai, substream, trigger); } break; @@ -651,6 +655,9 @@ if (rollback && !soc_dai_mark_match(dai, substream, trigger)) continue; + if (dai->driver->ops && dai->driver->ops->mute_unmute_on_trigger) + snd_soc_dai_digital_mute(dai, 1, substream->stream); + r = soc_dai_trigger(dai, substream, cmd); if (r < 0) ret = r; /* use last ret */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/soc-dapm.c +++ linux-aws-6.5-6.5.0/sound/soc/soc-dapm.c @@ -2726,6 +2726,18 @@ } EXPORT_SYMBOL_GPL(snd_soc_dapm_update_dai); +int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s) +{ + struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); + const char *wname = widget->name; + + if (component->name_prefix) + wname += strlen(component->name_prefix) + 1; /* plus space */ + + return strcmp(wname, s); +} +EXPORT_SYMBOL_GPL(snd_soc_dapm_widget_name_cmp); + /* * dapm_update_widget_flags() - Re-compute widget sink and source flags * @w: The widget for which to update the flags @@ -3656,7 +3668,7 @@ dapm_pinctrl_event(w, NULL, SND_SOC_DAPM_POST_PMD); break; case snd_soc_dapm_clock_supply: - w->clk = devm_clk_get(dapm->dev, w->name); + w->clk = devm_clk_get(dapm->dev, widget->name); if (IS_ERR(w->clk)) { ret = PTR_ERR(w->clk); goto request_failed; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/soc-ops.c +++ linux-aws-6.5-6.5.0/sound/soc/soc-ops.c @@ -661,7 +661,7 @@ kctl = snd_soc_card_get_kcontrol(card, name); if (kctl) { struct soc_mixer_control *mc = (struct soc_mixer_control *)kctl->private_value; - if (max <= mc->max) { + if (max <= mc->max - mc->min) { mc->platform_max = max; ret = 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/soc-pcm.c +++ linux-aws-6.5-6.5.0/sound/soc/soc-pcm.c @@ -698,14 +698,12 @@ if (!rollback) { snd_soc_runtime_deactivate(rtd, substream->stream); - /* clear the corresponding DAIs parameters when going to be inactive */ - for_each_rtd_dais(rtd, i, dai) { - if (snd_soc_dai_active(dai) == 0) - soc_pcm_set_dai_params(dai, NULL); - if (snd_soc_dai_stream_active(dai, substream->stream) == 0) - snd_soc_dai_digital_mute(dai, 1, substream->stream); - } + /* Make sure DAI parameters cleared if the DAI becomes inactive */ + for_each_rtd_dais(rtd, i, dai) + if (snd_soc_dai_active(dai) == 0 && + (dai->rate || dai->channels || dai->sample_bits)) + soc_pcm_set_dai_params(dai, NULL); } for_each_rtd_dais(rtd, i, dai) @@ -898,8 +896,10 @@ snd_soc_dapm_stream_event(rtd, substream->stream, SND_SOC_DAPM_STREAM_START); - for_each_rtd_dais(rtd, i, dai) - snd_soc_dai_digital_mute(dai, 0, substream->stream); + for_each_rtd_dais(rtd, i, dai) { + if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger) + snd_soc_dai_digital_mute(dai, 0, substream->stream); + } out: return soc_pcm_ret(rtd, ret); @@ -936,6 +936,17 @@ snd_soc_dpcm_mutex_assert_held(rtd); + /* clear the corresponding DAIs parameters when going to be inactive */ + for_each_rtd_dais(rtd, i, dai) { + if (snd_soc_dai_active(dai) == 1) + soc_pcm_set_dai_params(dai, NULL); + + if (snd_soc_dai_stream_active(dai, substream->stream) == 1) { + if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger) + snd_soc_dai_digital_mute(dai, 1, substream->stream); + } + } + /* run the stream event */ snd_soc_dapm_stream_stop(rtd, substream->stream); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/sof/ipc4.c +++ linux-aws-6.5-6.5.0/sound/soc/sof/ipc4.c @@ -614,6 +614,9 @@ case SOF_IPC4_NOTIFY_LOG_BUFFER_STATUS: sof_ipc4_mtrace_update_pos(sdev, SOF_IPC4_LOG_CORE_GET(ipc4_msg->primary)); break; + case SOF_IPC4_NOTIFY_EXCEPTION_CAUGHT: + snd_sof_dsp_panic(sdev, 0, true); + break; default: dev_dbg(sdev->dev, "Unhandled DSP message: %#x|%#x\n", ipc4_msg->primary, ipc4_msg->extension); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/sof/sof-pci-dev.c +++ linux-aws-6.5-6.5.0/sound/soc/sof/sof-pci-dev.c @@ -145,6 +145,13 @@ DMI_MATCH(DMI_PRODUCT_FAMILY, "Google"), } }, + { + .ident = "Google firmware", + .callback = chromebook_use_community_key, + .matches = { + DMI_MATCH(DMI_BIOS_VERSION, "Google"), + } + }, {}, }; @@ -214,6 +221,14 @@ return ret; sof_pdata->name = pci_name(pci); + + /* PCI defines a vendor ID of 0xFFFF as invalid. */ + if (pci->subsystem_vendor != 0xFFFF) { + sof_pdata->subsystem_vendor = pci->subsystem_vendor; + sof_pdata->subsystem_device = pci->subsystem_device; + sof_pdata->subsystem_id_set = true; + } + sof_pdata->desc = desc; sof_pdata->dev = dev; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/ti/ams-delta.c +++ linux-aws-6.5-6.5.0/sound/soc/ti/ams-delta.c @@ -303,7 +303,7 @@ static void cx81801_close(struct tty_struct *tty) { struct snd_soc_component *component = tty->disc_data; - struct snd_soc_dapm_context *dapm = &component->card->dapm; + struct snd_soc_dapm_context *dapm; del_timer_sync(&cx81801_timer); @@ -315,6 +315,8 @@ v253_ops.close(tty); + dapm = &component->card->dapm; + /* Revert back to default audio input/output constellation */ snd_soc_dapm_mutex_lock(dapm); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/soc/ti/omap-mcbsp.c +++ linux-aws-6.5-6.5.0/sound/soc/ti/omap-mcbsp.c @@ -74,14 +74,16 @@ return -EINVAL; } - pm_runtime_put_sync(mcbsp->dev); + if (mcbsp->active) + pm_runtime_put_sync(mcbsp->dev); r = clk_set_parent(mcbsp->fclk, fck_src); if (r) dev_err(mcbsp->dev, "CLKS: could not clk_set_parent() to %s\n", src); - pm_runtime_get_sync(mcbsp->dev); + if (mcbsp->active) + pm_runtime_get_sync(mcbsp->dev); clk_put(fck_src); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/sound/usb/mixer_quirks.c +++ linux-aws-6.5-6.5.0/sound/usb/mixer_quirks.c @@ -2978,6 +2978,7 @@ #define SND_DJM_850_IDX 0x2 #define SND_DJM_900NXS2_IDX 0x3 #define SND_DJM_750MK2_IDX 0x4 +#define SND_DJM_450_IDX 0x5 #define SND_DJM_CTL(_name, suffix, _default_value, _windex) { \ @@ -3108,6 +3109,31 @@ }; +// DJM-450 +static const u16 snd_djm_opts_450_cap1[] = { + 0x0103, 0x0100, 0x0106, 0x0107, 0x0108, 0x0109, 0x010d, 0x010a }; + +static const u16 snd_djm_opts_450_cap2[] = { + 0x0203, 0x0200, 0x0206, 0x0207, 0x0208, 0x0209, 0x020d, 0x020a }; + +static const u16 snd_djm_opts_450_cap3[] = { + 0x030a, 0x0311, 0x0312, 0x0307, 0x0308, 0x0309, 0x030d }; + +static const u16 snd_djm_opts_450_pb1[] = { 0x0100, 0x0101, 0x0104 }; +static const u16 snd_djm_opts_450_pb2[] = { 0x0200, 0x0201, 0x0204 }; +static const u16 snd_djm_opts_450_pb3[] = { 0x0300, 0x0301, 0x0304 }; + +static const struct snd_djm_ctl snd_djm_ctls_450[] = { + SND_DJM_CTL("Capture Level", cap_level, 0, SND_DJM_WINDEX_CAPLVL), + SND_DJM_CTL("Ch1 Input", 450_cap1, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch2 Input", 450_cap2, 2, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch3 Input", 450_cap3, 0, SND_DJM_WINDEX_CAP), + SND_DJM_CTL("Ch1 Output", 450_pb1, 0, SND_DJM_WINDEX_PB), + SND_DJM_CTL("Ch2 Output", 450_pb2, 1, SND_DJM_WINDEX_PB), + SND_DJM_CTL("Ch3 Output", 450_pb3, 2, SND_DJM_WINDEX_PB) +}; + + // DJM-750 static const u16 snd_djm_opts_750_cap1[] = { 0x0101, 0x0103, 0x0106, 0x0107, 0x0108, 0x0109, 0x010a, 0x010f }; @@ -3203,6 +3229,7 @@ [SND_DJM_850_IDX] = SND_DJM_DEVICE(850), [SND_DJM_900NXS2_IDX] = SND_DJM_DEVICE(900nxs2), [SND_DJM_750MK2_IDX] = SND_DJM_DEVICE(750mk2), + [SND_DJM_450_IDX] = SND_DJM_DEVICE(450), }; @@ -3449,6 +3476,9 @@ case USB_ID(0x2b73, 0x0017): /* Pioneer DJ DJM-250MK2 */ err = snd_djm_controls_create(mixer, SND_DJM_250MK2_IDX); break; + case USB_ID(0x2b73, 0x0013): /* Pioneer DJ DJM-450 */ + err = snd_djm_controls_create(mixer, SND_DJM_450_IDX); + break; case USB_ID(0x08e4, 0x017f): /* Pioneer DJ DJM-750 */ err = snd_djm_controls_create(mixer, SND_DJM_750_IDX); break; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/arch/parisc/include/uapi/asm/errno.h +++ linux-aws-6.5-6.5.0/tools/arch/parisc/include/uapi/asm/errno.h @@ -75,7 +75,6 @@ /* We now return you to your regularly scheduled HPUX. */ -#define ENOSYM 215 /* symbol does not exist in executable */ #define ENOTSOCK 216 /* Socket operation on non-socket */ #define EDESTADDRREQ 217 /* Destination address required */ #define EMSGSIZE 218 /* Message too long */ @@ -101,7 +100,6 @@ #define ETIMEDOUT 238 /* Connection timed out */ #define ECONNREFUSED 239 /* Connection refused */ #define EREFUSED ECONNREFUSED /* for HP's NFS apparently */ -#define EREMOTERELEASE 240 /* Remote peer released connection */ #define EHOSTDOWN 241 /* Host is down */ #define EHOSTUNREACH 242 /* No route to host */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/include/linux/rwsem.h +++ linux-aws-6.5-6.5.0/tools/include/linux/rwsem.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +#ifndef _TOOLS__RWSEM_H +#define _TOOLS__RWSEM_H + +#include + +struct rw_semaphore { + pthread_rwlock_t lock; +}; + +static inline int init_rwsem(struct rw_semaphore *sem) +{ + return pthread_rwlock_init(&sem->lock, NULL); +} + +static inline int exit_rwsem(struct rw_semaphore *sem) +{ + return pthread_rwlock_destroy(&sem->lock); +} + +static inline int down_read(struct rw_semaphore *sem) +{ + return pthread_rwlock_rdlock(&sem->lock); +} + +static inline int up_read(struct rw_semaphore *sem) +{ + return pthread_rwlock_unlock(&sem->lock); +} + +static inline int down_write(struct rw_semaphore *sem) +{ + return pthread_rwlock_wrlock(&sem->lock); +} + +static inline int up_write(struct rw_semaphore *sem) +{ + return pthread_rwlock_unlock(&sem->lock); +} +#endif /* _TOOLS_RWSEM_H */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/include/uapi/linux/prctl.h +++ linux-aws-6.5-6.5.0/tools/include/uapi/linux/prctl.h @@ -283,7 +283,8 @@ /* Memory deny write / execute */ #define PR_SET_MDWE 65 -# define PR_MDWE_REFUSE_EXEC_GAIN 1 +# define PR_MDWE_REFUSE_EXEC_GAIN (1UL << 0) +# define PR_MDWE_NO_INHERIT (1UL << 1) #define PR_GET_MDWE 66 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/lib/perf/include/internal/rc_check.h +++ linux-aws-6.5-6.5.0/tools/lib/perf/include/internal/rc_check.h @@ -9,8 +9,12 @@ * Enable reference count checking implicitly with leak checking, which is * integrated into address sanitizer. */ -#if defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER) +#if defined(__SANITIZE_ADDRESS__) || defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER) #define REFCNT_CHECKING 1 +#elif defined(__has_feature) +#if __has_feature(address_sanitizer) || __has_feature(leak_sanitizer) +#define REFCNT_CHECKING 1 +#endif #endif /* only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/objtool/objtool.c +++ linux-aws-6.5-6.5.0/tools/objtool/objtool.c @@ -146,7 +146,5 @@ exec_cmd_init("objtool", UNUSED, UNUSED, UNUSED); pager_init(UNUSED); - objtool_run(argc, argv); - - return 0; + return objtool_run(argc, argv); } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/Documentation/perf-kwork.txt +++ linux-aws-6.5-6.5.0/tools/perf/Documentation/perf-kwork.txt @@ -8,7 +8,7 @@ SYNOPSIS -------- [verse] -'perf kwork' {record} +'perf kwork' {record|report|latency|timehist} DESCRIPTION ----------- only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/arch/arm64/util/mem-events.c +++ linux-aws-6.5-6.5.0/tools/perf/arch/arm64/util/mem-events.c @@ -20,7 +20,7 @@ return &perf_mem_events[i]; } -char *perf_mem_events__name(int i, char *pmu_name __maybe_unused) +const char *perf_mem_events__name(int i, const char *pmu_name __maybe_unused) { struct perf_mem_event *e = perf_mem_events__ptr(i); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/arch/powerpc/util/mem-events.c +++ linux-aws-6.5-6.5.0/tools/perf/arch/powerpc/util/mem-events.c @@ -3,10 +3,10 @@ #include "mem-events.h" /* PowerPC does not support 'ldlat' parameter. */ -char *perf_mem_events__name(int i, char *pmu_name __maybe_unused) +const char *perf_mem_events__name(int i, const char *pmu_name __maybe_unused) { if (i == PERF_MEM_EVENTS__LOAD) - return (char *) "cpu/mem-loads/"; + return "cpu/mem-loads/"; - return (char *) "cpu/mem-stores/"; + return "cpu/mem-stores/"; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/arch/x86/util/mem-events.c +++ linux-aws-6.5-6.5.0/tools/perf/arch/x86/util/mem-events.c @@ -52,7 +52,7 @@ return leader->core.attr.config == MEM_LOADS_AUX; } -char *perf_mem_events__name(int i, char *pmu_name) +const char *perf_mem_events__name(int i, const char *pmu_name) { struct perf_mem_event *e = perf_mem_events__ptr(i); @@ -65,7 +65,7 @@ if (!pmu_name) { mem_loads_name__init = true; - pmu_name = (char *)"cpu"; + pmu_name = "cpu"; } if (perf_pmus__have_event(pmu_name, "mem-loads-aux")) { @@ -82,12 +82,12 @@ if (i == PERF_MEM_EVENTS__STORE) { if (!pmu_name) - pmu_name = (char *)"cpu"; + pmu_name = "cpu"; scnprintf(mem_stores_name, sizeof(mem_stores_name), e->name, pmu_name); return mem_stores_name; } - return (char *)e->name; + return e->name; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/arch/x86/util/pmu.c +++ linux-aws-6.5-6.5.0/tools/perf/arch/x86/util/pmu.c @@ -126,7 +126,7 @@ return ret; } -static char *__pmu_find_real_name(const char *name) +static const char *__pmu_find_real_name(const char *name) { struct pmu_alias *pmu_alias; @@ -135,10 +135,10 @@ return pmu_alias->name; } - return (char *)name; + return name; } -char *pmu_find_real_name(const char *name) +const char *pmu_find_real_name(const char *name) { if (cached_list) return __pmu_find_real_name(name); @@ -149,7 +149,7 @@ return __pmu_find_real_name(name); } -static char *__pmu_find_alias_name(const char *name) +static const char *__pmu_find_alias_name(const char *name) { struct pmu_alias *pmu_alias; @@ -160,7 +160,7 @@ return NULL; } -char *pmu_find_alias_name(const char *name) +const char *pmu_find_alias_name(const char *name) { if (cached_list) return __pmu_find_alias_name(name); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/builtin-kwork.c +++ linux-aws-6.5-6.5.0/tools/perf/builtin-kwork.c @@ -406,12 +406,14 @@ work = work_findnew(&class->work_root, &key, &kwork->cmp_id); if (work == NULL) { - free(atom); + atom_free(atom); return -1; } - if (!profile_event_match(kwork, work, sample)) + if (!profile_event_match(kwork, work, sample)) { + atom_free(atom); return 0; + } if (dst_type < KWORK_TRACE_MAX) { dst_atom = list_last_entry_or_null(&work->atom_list[dst_type], @@ -1692,9 +1694,10 @@ static struct perf_kwork kwork = { .class_list = LIST_HEAD_INIT(kwork.class_list), .tool = { - .mmap = perf_event__process_mmap, - .mmap2 = perf_event__process_mmap2, - .sample = perf_kwork__process_tracepoint_sample, + .mmap = perf_event__process_mmap, + .mmap2 = perf_event__process_mmap2, + .sample = perf_kwork__process_tracepoint_sample, + .ordered_events = true, }, .atom_page_list = LIST_HEAD_INIT(kwork.atom_page_list), .sort_list = LIST_HEAD_INIT(kwork.sort_list), only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/builtin-list.c +++ linux-aws-6.5-6.5.0/tools/perf/builtin-list.c @@ -502,7 +502,7 @@ ret = -1; goto out; } - default_ps.pmu_glob = pmu->name; + default_ps.pmu_glob = strdup(pmu->name); } } print_cb.print_start(ps); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/builtin-stat.c +++ linux-aws-6.5-6.5.0/tools/perf/builtin-stat.c @@ -1622,7 +1622,7 @@ * taking the highest cpu number to be the size of * the aggregation translate cpumap. */ - if (evsel_list->core.user_requested_cpus) + if (!perf_cpu_map__empty(evsel_list->core.user_requested_cpus)) nr = perf_cpu_map__max(evsel_list->core.user_requested_cpus).cpu; else nr = 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/examples/bpf/augmented_raw_syscalls.c +++ linux-aws-6.5-6.5.0/tools/perf/examples/bpf/augmented_raw_syscalls.c @@ -147,7 +147,7 @@ unsigned int augmented_arg__read_str(struct augmented_arg *augmented_arg, const void *arg, unsigned int arg_len) { unsigned int augmented_len = sizeof(*augmented_arg); - int string_len = bpf_probe_read_str(&augmented_arg->value, arg_len, arg); + int string_len = bpf_probe_read_user_str(&augmented_arg->value, arg_len, arg); augmented_arg->size = augmented_arg->err = 0; /* @@ -196,7 +196,7 @@ if (socklen > sizeof(augmented_args->saddr)) socklen = sizeof(augmented_args->saddr); - bpf_probe_read(&augmented_args->saddr, socklen, sockaddr_arg); + bpf_probe_read_user(&augmented_args->saddr, socklen, sockaddr_arg); return augmented__output(args, augmented_args, len + socklen); } @@ -215,7 +215,7 @@ if (socklen > sizeof(augmented_args->saddr)) socklen = sizeof(augmented_args->saddr); - bpf_probe_read(&augmented_args->saddr, socklen, sockaddr_arg); + bpf_probe_read_user(&augmented_args->saddr, socklen, sockaddr_arg); return augmented__output(args, augmented_args, len + socklen); } @@ -305,7 +305,7 @@ if (augmented_args == NULL) goto failure; - if (bpf_probe_read(&augmented_args->__data, sizeof(*attr), attr) < 0) + if (bpf_probe_read_user(&augmented_args->__data, sizeof(*attr), attr) < 0) goto failure; attr_read = (const struct perf_event_attr_size *)augmented_args->__data; @@ -319,7 +319,7 @@ goto failure; // Now that we read attr->size and tested it against the size limits, read it completely - if (bpf_probe_read(&augmented_args->__data, size, attr) < 0) + if (bpf_probe_read_user(&augmented_args->__data, size, attr) < 0) goto failure; return augmented__output(args, augmented_args, len + size); @@ -341,7 +341,7 @@ if (size > sizeof(augmented_args->__data)) goto failure; - bpf_probe_read(&augmented_args->__data, size, rqtp_arg); + bpf_probe_read_user(&augmented_args->__data, size, rqtp_arg); return augmented__output(args, augmented_args, len + size); failure: @@ -380,7 +380,7 @@ if (augmented_args == NULL) return 1; - bpf_probe_read(&augmented_args->args, sizeof(augmented_args->args), args); + bpf_probe_read_kernel(&augmented_args->args, sizeof(augmented_args->args), args); /* * Jump to syscall specific augmenter, even if the default one, @@ -401,7 +401,7 @@ if (pid_filter__has(&pids_filtered, getpid())) return 0; - bpf_probe_read(&exit_args, sizeof(exit_args), args); + bpf_probe_read_kernel(&exit_args, sizeof(exit_args), args); /* * Jump to syscall specific return augmenter, even if the default one, * "!raw_syscalls:unaugmented" that will just return 1 to return the only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/pmu-events/arch/x86/broadwellde/bdwde-metrics.json +++ linux-aws-6.5-6.5.0/tools/perf/pmu-events/arch/x86/broadwellde/bdwde-metrics.json @@ -49,6 +49,12 @@ "ScaleUnit": "100%" }, { + "BriefDescription": "Uncore frequency per die [GHZ]", + "MetricExpr": "tma_info_system_socket_clks / #num_dies / duration_time / 1e9", + "MetricGroup": "SoC", + "MetricName": "UNCORE_FREQ" + }, + { "BriefDescription": "Percentage of cycles spent in System Management Interrupts.", "MetricExpr": "((msr@aperf@ - cycles) / msr@aperf@ if msr@smi@ > 0 else 0)", "MetricGroup": "smi", @@ -652,7 +658,7 @@ }, { "BriefDescription": "Average external Memory Bandwidth Use for reads and writes [GB / sec]", - "MetricExpr": "64 * (arb@event\\=0x81\\,umask\\=0x1@ + arb@event\\=0x84\\,umask\\=0x1@) / 1e6 / duration_time / 1e3", + "MetricExpr": "64 * (UNC_M_CAS_COUNT.RD + UNC_M_CAS_COUNT.WR) / 1e9 / duration_time", "MetricGroup": "HPC;Mem;MemoryBW;SoC;tma_issueBW", "MetricName": "tma_info_system_dram_bw_use", "PublicDescription": "Average external Memory Bandwidth Use for reads and writes [GB / sec]. Related metrics: tma_fb_full, tma_mem_bandwidth, tma_sq_full" @@ -691,6 +697,12 @@ "MetricName": "tma_info_system_smt_2t_utilization" }, { + "BriefDescription": "Socket actual clocks when any core is active on that socket", + "MetricExpr": "cbox_0@event\\=0x0@", + "MetricGroup": "SoC", + "MetricName": "tma_info_system_socket_clks" + }, + { "BriefDescription": "Average Frequency Utilization relative nominal frequency", "MetricExpr": "tma_info_thread_clks / CPU_CLK_UNHALTED.REF_TSC", "MetricGroup": "Power", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/tests/pmu-events.c +++ linux-aws-6.5-6.5.0/tools/perf/tests/pmu-events.c @@ -508,7 +508,7 @@ } /* Verify aliases are as expected */ -static int __test_core_pmu_event_aliases(char *pmu_name, int *count) +static int __test_core_pmu_event_aliases(const char *pmu_name, int *count) { struct perf_pmu_test_event const **test_event_table; struct perf_pmu *pmu; @@ -635,7 +635,7 @@ static struct perf_pmu_test_pmu test_pmus[] = { { .pmu = { - .name = (char *)"hisi_sccl1_ddrc2", + .name = "hisi_sccl1_ddrc2", .is_uncore = 1, }, .aliases = { @@ -644,7 +644,7 @@ }, { .pmu = { - .name = (char *)"uncore_cbox_0", + .name = "uncore_cbox_0", .is_uncore = 1, }, .aliases = { @@ -655,7 +655,7 @@ }, { .pmu = { - .name = (char *)"hisi_sccl3_l3c7", + .name = "hisi_sccl3_l3c7", .is_uncore = 1, }, .aliases = { @@ -664,7 +664,7 @@ }, { .pmu = { - .name = (char *)"uncore_imc_free_running_0", + .name = "uncore_imc_free_running_0", .is_uncore = 1, }, .aliases = { @@ -673,7 +673,7 @@ }, { .pmu = { - .name = (char *)"uncore_imc_0", + .name = "uncore_imc_0", .is_uncore = 1, }, .aliases = { @@ -682,7 +682,7 @@ }, { .pmu = { - .name = (char *)"uncore_sys_ddr_pmu0", + .name = "uncore_sys_ddr_pmu0", .is_uncore = 1, .id = (char *)"v8", }, @@ -692,7 +692,7 @@ }, { .pmu = { - .name = (char *)"uncore_sys_ccn_pmu4", + .name = "uncore_sys_ccn_pmu4", .is_uncore = 1, .id = (char *)"0x01", }, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/bpf_off_cpu.c +++ linux-aws-6.5-6.5.0/tools/perf/util/bpf_off_cpu.c @@ -98,7 +98,7 @@ /* v5.18 kernel added prev_state arg, so it needs to check the signature */ static void check_sched_switch_args(void) { - const struct btf *btf = bpf_object__btf(skel->obj); + const struct btf *btf = btf__load_vmlinux_btf(); const struct btf_type *t1, *t2, *t3; u32 type_id; @@ -116,7 +116,8 @@ return; t3 = btf__type_by_id(btf, t2->type); - if (t3 && btf_is_func_proto(t3) && btf_vlen(t3) == 4) { + /* btf_trace func proto has one more argument for the context */ + if (t3 && btf_is_func_proto(t3) && btf_vlen(t3) == 5) { /* new format: pass prev_state as 4th arg */ skel->rodata->has_prev_state = true; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/env.c +++ linux-aws-6.5-6.5.0/tools/perf/util/env.c @@ -324,11 +324,9 @@ u32 pmu_num = 0; struct strbuf sb; - while ((pmu = perf_pmus__scan(pmu))) { - if (!pmu->name) - continue; + while ((pmu = perf_pmus__scan(pmu))) pmu_num++; - } + if (!pmu_num) { pr_debug("pmu mappings not available\n"); return -ENOENT; @@ -339,8 +337,6 @@ return -ENOMEM; while ((pmu = perf_pmus__scan(pmu))) { - if (!pmu->name) - continue; if (strbuf_addf(&sb, "%u:%s", pmu->type, pmu->name) < 0) goto error; /* include a NULL character at the end */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/evlist.c +++ linux-aws-6.5-6.5.0/tools/perf/util/evlist.c @@ -251,6 +251,9 @@ .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_DUMMY, .size = sizeof(attr), /* to capture ABI version */ + /* Avoid frequency mode for dummy events to avoid associated timers. */ + .freq = 0, + .sample_period = 1, }; return evsel__new_idx(&attr, evlist->core.nr_entries); @@ -277,8 +280,6 @@ evsel->core.attr.exclude_kernel = 1; evsel->core.attr.exclude_guest = 1; evsel->core.attr.exclude_hv = 1; - evsel->core.attr.freq = 0; - evsel->core.attr.sample_period = 1; evsel->core.system_wide = system_wide; evsel->no_aux_samples = true; evsel->name = strdup("dummy:u"); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/hist.c +++ linux-aws-6.5-6.5.0/tools/perf/util/hist.c @@ -2676,8 +2676,6 @@ /* If we have branch cycles always annotate them. */ if (bs && bs->nr && entries[0].flags.cycles) { - int i; - bi = sample__resolve_bstack(sample, al); if (bi) { struct addr_map_symbol *prev = NULL; @@ -2692,7 +2690,7 @@ * Note that perf stores branches reversed from * program order! */ - for (i = bs->nr - 1; i >= 0; i--) { + for (int i = bs->nr - 1; i >= 0; i--) { addr_map_symbol__account_cycles(&bi[i].from, nonany_branch_mode ? NULL : prev, bi[i].flags.cycles); @@ -2701,6 +2699,12 @@ if (total_cycles) *total_cycles += bi[i].flags.cycles; } + for (unsigned int i = 0; i < bs->nr; i++) { + map__put(bi[i].to.ms.map); + maps__put(bi[i].to.ms.maps); + map__put(bi[i].from.ms.map); + maps__put(bi[i].from.ms.maps); + } free(bi); } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/intel-pt.c +++ linux-aws-6.5-6.5.0/tools/perf/util/intel-pt.c @@ -1512,9 +1512,11 @@ } else if (ptq->state->flags & INTEL_PT_ASYNC) { if (!ptq->state->to_ip) ptq->flags = PERF_IP_FLAG_BRANCH | + PERF_IP_FLAG_ASYNC | PERF_IP_FLAG_TRACE_END; else if (ptq->state->from_nr && !ptq->state->to_nr) ptq->flags = PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CALL | + PERF_IP_FLAG_ASYNC | PERF_IP_FLAG_VMEXIT; else ptq->flags = PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CALL | only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/machine.c +++ linux-aws-6.5-6.5.0/tools/perf/util/machine.c @@ -2622,16 +2622,18 @@ save_lbr_cursor_node(thread, cursor, i); } - /* Add LBR ip from first entries.to */ - ip = entries[0].to; - flags = &entries[0].flags; - *branch_from = entries[0].from; - err = add_callchain_ip(thread, cursor, parent, - root_al, &cpumode, ip, - true, flags, NULL, - *branch_from); - if (err) - return err; + if (lbr_nr > 0) { + /* Add LBR ip from first entries.to */ + ip = entries[0].to; + flags = &entries[0].flags; + *branch_from = entries[0].from; + err = add_callchain_ip(thread, cursor, parent, + root_al, &cpumode, ip, + true, flags, NULL, + *branch_from); + if (err) + return err; + } return 0; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/mem-events.c +++ linux-aws-6.5-6.5.0/tools/perf/util/mem-events.c @@ -37,7 +37,7 @@ return &perf_mem_events[i]; } -char * __weak perf_mem_events__name(int i, char *pmu_name __maybe_unused) +const char * __weak perf_mem_events__name(int i, const char *pmu_name __maybe_unused) { struct perf_mem_event *e = perf_mem_events__ptr(i); @@ -53,7 +53,7 @@ return mem_loads_name; } - return (char *)e->name; + return e->name; } __weak bool is_mem_loads_aux_event(struct evsel *leader __maybe_unused) @@ -185,8 +185,6 @@ { int i = *argv_nr, k = 0; struct perf_mem_event *e; - struct perf_pmu *pmu; - char *s; for (int j = 0; j < PERF_MEM_EVENTS__MAX; j++) { e = perf_mem_events__ptr(j); @@ -203,21 +201,24 @@ rec_argv[i++] = "-e"; rec_argv[i++] = perf_mem_events__name(j, NULL); } else { + struct perf_pmu *pmu = NULL; + if (!e->supported) { perf_mem_events__print_unsupport_hybrid(e, j); return -1; } while ((pmu = perf_pmus__scan(pmu)) != NULL) { + const char *s = perf_mem_events__name(j, pmu->name); + rec_argv[i++] = "-e"; - s = perf_mem_events__name(j, pmu->name); if (s) { - s = strdup(s); - if (!s) + char *copy = strdup(s); + if (!copy) return -1; - rec_argv[i++] = s; - rec_tmp[k++] = s; + rec_argv[i++] = copy; + rec_tmp[k++] = copy; } } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/mem-events.h +++ linux-aws-6.5-6.5.0/tools/perf/util/mem-events.h @@ -38,7 +38,7 @@ int perf_mem_events__parse(const char *str); int perf_mem_events__init(void); -char *perf_mem_events__name(int i, char *pmu_name); +const char *perf_mem_events__name(int i, const char *pmu_name); struct perf_mem_event *perf_mem_events__ptr(int i); bool is_mem_loads_aux_event(struct evsel *leader); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/metricgroup.c +++ linux-aws-6.5-6.5.0/tools/perf/util/metricgroup.c @@ -225,7 +225,7 @@ m->pmu = pm->pmu ?: "cpu"; m->metric_name = pm->metric_name; - m->default_metricgroup_name = pm->default_metricgroup_name; + m->default_metricgroup_name = pm->default_metricgroup_name ?: ""; m->modifier = NULL; if (modifier) { m->modifier = strdup(modifier); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/parse-events.h +++ linux-aws-6.5-6.5.0/tools/perf/util/parse-events.h @@ -190,7 +190,7 @@ u64 addr, char *type, u64 len, struct list_head *head_config); int parse_events_add_pmu(struct parse_events_state *parse_state, - struct list_head *list, char *name, + struct list_head *list, const char *name, struct list_head *head_config, bool auto_merge_stats); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/parse-events.l +++ linux-aws-6.5-6.5.0/tools/perf/util/parse-events.l @@ -175,7 +175,6 @@ %x mem %s config %x event -%x array group [^,{}/]*[{][^}]*[}][^,{}/]* event_pmu [^,{}/]+[/][^/]*[/][^,{}/]* @@ -251,14 +250,6 @@ } } -{ -"]" { BEGIN(config); return ']'; } -{num_dec} { return value(yyscanner, 10); } -{num_hex} { return value(yyscanner, 16); } -, { return ','; } -"\.\.\." { return PE_ARRAY_RANGE; } -} - { /* * Please update config_term_names when new static term is added. @@ -302,8 +293,6 @@ {lc_type}-{lc_op_result} { return lc_str(yyscanner, _parse_state); } {lc_type}-{lc_op_result}-{lc_op_result} { return lc_str(yyscanner, _parse_state); } {name_minus} { return str(yyscanner, PE_NAME); } -\[all\] { return PE_ARRAY_ALL; } -"[" { BEGIN(array); return '['; } @{drv_cfg_term} { return drv_str(yyscanner, PE_DRV_CFG_TERM); } } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/perf/util/pmu.h +++ linux-aws-6.5-6.5.0/tools/perf/util/pmu.h @@ -39,7 +39,7 @@ */ struct perf_pmu { /** @name: The name of the PMU such as "cpu". */ - char *name; + const char *name; /** * @alias_name: Optional alternate name for the PMU determined in * architecture specific code. @@ -275,10 +275,10 @@ const char *config_name); void perf_pmu__warn_invalid_formats(struct perf_pmu *pmu); -int perf_pmu__match(char *pattern, char *name, char *tok); +int perf_pmu__match(const char *pattern, const char *name, const char *tok); -char *pmu_find_real_name(const char *name); -char *pmu_find_alias_name(const char *name); +const char *pmu_find_real_name(const char *name); +const char *pmu_find_alias_name(const char *name); double perf_pmu__cpu_slots_per_cycle(void); int perf_pmu__event_source_devices_scnprintf(char *pathname, size_t size); int perf_pmu__pathname_scnprintf(char *buf, size_t size, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/power/cpupower/man/cpupower-powercap-info.1 +++ linux-aws-6.5-6.5.0/tools/power/cpupower/man/cpupower-powercap-info.1 @@ -17,7 +17,7 @@ .SH "DOCUMENTATION" kernel sources: -Documentation/power/powercap/powercap.txt +Documentation/power/powercap/powercap.rst .SH "SEE ALSO" only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/power/pm-graph/sleepgraph.py +++ linux-aws-6.5-6.5.0/tools/power/pm-graph/sleepgraph.py @@ -4151,7 +4151,7 @@ elif(re.match('Enabling non-boot CPUs .*', msg)): # start of first cpu resume cpu_start = ktime - elif(re.match('smpboot: CPU (?P[0-9]*) is now offline', msg)) \ + elif(re.match('smpboot: CPU (?P[0-9]*) is now offline', msg) \ or re.match('psci: CPU(?P[0-9]*) killed.*', msg)): # end of a cpu suspend, start of the next m = re.match('smpboot: CPU (?P[0-9]*) is now offline', msg) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/power/x86/turbostat/turbostat.c +++ linux-aws-6.5-6.5.0/tools/power/x86/turbostat/turbostat.c @@ -2180,7 +2180,7 @@ if ((DO_BIC(BIC_CPU_c6) || soft_c1_residency_display(BIC_CPU_c6)) && !do_knl_cstates) { if (get_msr(cpu, MSR_CORE_C6_RESIDENCY, &c->c6)) return -7; - } else if (do_knl_cstates || soft_c1_residency_display(BIC_CPU_c6)) { + } else if (do_knl_cstates && soft_c1_residency_display(BIC_CPU_c6)) { if (get_msr(cpu, MSR_KNL_CORE_C6_RESIDENCY, &c->c6)) return -7; } @@ -5790,6 +5790,7 @@ rapl_probe(family, model); perf_limit_reasons_probe(family, model); automatic_cstate_conversion_probe(family, model); + prewake_cstate_probe(family, model); check_tcc_offset(model_orig); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/cxl/test/cxl.c +++ linux-aws-6.5-6.5.0/tools/testing/cxl/test/cxl.c @@ -831,7 +831,7 @@ cxld->interleave_ways = 2; else cxld->interleave_ways = 1; - cxld->interleave_granularity = 256; + cxld->interleave_granularity = 4096; cxld->hpa_range = (struct range) { .start = base, .end = base + size - 1, only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/cxl/test/mem.c +++ linux-aws-6.5-6.5.0/tools/testing/cxl/test/mem.c @@ -1450,11 +1450,11 @@ mdata->mes.mds = mds; cxl_mock_add_event_logs(&mdata->mes); - cxlmd = devm_cxl_add_memdev(cxlds); + cxlmd = devm_cxl_add_memdev(&pdev->dev, cxlds); if (IS_ERR(cxlmd)) return PTR_ERR(cxlmd); - rc = cxl_memdev_setup_fw_upload(mds); + rc = devm_cxl_setup_fw_upload(&pdev->dev, mds); if (rc) return rc; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/arm64/fp/za-fork.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/arm64/fp/za-fork.c @@ -85,7 +85,7 @@ */ ret = open("/proc/sys/abi/sme_default_vector_length", O_RDONLY, 0); if (ret >= 0) { - ksft_test_result(fork_test(), "fork_test"); + ksft_test_result(fork_test(), "fork_test\n"); } else { ksft_print_msg("SME not supported\n"); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c @@ -61,6 +61,11 @@ int link_fd[2] = {}; __s32 btf_id[2] = {}; + if (!env.has_testmod) { + test__skip(); + return; + } + LIBBPF_OPTS(bpf_prog_load_opts, load_opts, .expected_attach_type = BPF_TRACE_FENTRY, ); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/bpf/prog_tests/tailcalls.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/bpf/prog_tests/tailcalls.c @@ -271,11 +271,11 @@ data_map = bpf_object__find_map_by_name(obj, "tailcall.bss"); if (CHECK_FAIL(!data_map || !bpf_map__is_internal(data_map))) - return; + goto out; data_fd = bpf_map__fd(data_map); - if (CHECK_FAIL(map_fd < 0)) - return; + if (CHECK_FAIL(data_fd < 0)) + goto out; i = 0; err = bpf_map_lookup_elem(data_fd, &i, &val); @@ -352,11 +352,11 @@ data_map = bpf_object__find_map_by_name(obj, "tailcall.bss"); if (CHECK_FAIL(!data_map || !bpf_map__is_internal(data_map))) - return; + goto out; data_fd = bpf_map__fd(data_map); - if (CHECK_FAIL(map_fd < 0)) - return; + if (CHECK_FAIL(data_fd < 0)) + goto out; for (i = 0; i < bpf_map__max_entries(prog_array); i++) { snprintf(prog_name, sizeof(prog_name), "classifier_%d", i); @@ -442,11 +442,11 @@ data_map = bpf_object__find_map_by_name(obj, "tailcall.bss"); if (CHECK_FAIL(!data_map || !bpf_map__is_internal(data_map))) - return; + goto out; data_fd = bpf_map__fd(data_map); - if (CHECK_FAIL(map_fd < 0)) - return; + if (CHECK_FAIL(data_fd < 0)) + goto out; for (i = 0; i < bpf_map__max_entries(prog_array); i++) { snprintf(prog_name, sizeof(prog_name), "classifier_%d", i); @@ -631,11 +631,11 @@ data_map = bpf_object__find_map_by_name(obj, "tailcall.bss"); if (CHECK_FAIL(!data_map || !bpf_map__is_internal(data_map))) - return; + goto out; data_fd = bpf_map__fd(data_map); - if (CHECK_FAIL(map_fd < 0)) - return; + if (CHECK_FAIL(data_fd < 0)) + goto out; i = 0; err = bpf_map_lookup_elem(data_fd, &i, &val); @@ -805,11 +805,11 @@ data_map = bpf_object__find_map_by_name(obj, "tailcall.bss"); if (CHECK_FAIL(!data_map || !bpf_map__is_internal(data_map))) - return; + goto out; data_fd = bpf_map__fd(data_map); - if (CHECK_FAIL(map_fd < 0)) - return; + if (CHECK_FAIL(data_fd < 0)) + goto out; i = 0; val.noise = noise; @@ -872,7 +872,7 @@ ASSERT_EQ(topts.retval, 0, "tailcall retval"); data_fd = bpf_map__fd(obj->maps.bss); - if (!ASSERT_GE(map_fd, 0, "bss map fd")) + if (!ASSERT_GE(data_fd, 0, "bss map fd")) goto out; i = 0; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/bpf/verifier/ld_imm64.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/bpf/verifier/ld_imm64.c @@ -9,8 +9,8 @@ BPF_MOV64_IMM(BPF_REG_0, 2), BPF_EXIT_INSN(), }, - .errstr = "invalid BPF_LD_IMM insn", - .errstr_unpriv = "R1 pointer comparison", + .errstr = "jump into the middle of ldimm64 insn 1", + .errstr_unpriv = "jump into the middle of ldimm64 insn 1", .result = REJECT, }, { @@ -23,8 +23,8 @@ BPF_LD_IMM64(BPF_REG_0, 1), BPF_EXIT_INSN(), }, - .errstr = "invalid BPF_LD_IMM insn", - .errstr_unpriv = "R1 pointer comparison", + .errstr = "jump into the middle of ldimm64 insn 1", + .errstr_unpriv = "jump into the middle of ldimm64 insn 1", .result = REJECT, }, { only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/clone3/clone3.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/clone3/clone3.c @@ -196,7 +196,12 @@ CLONE3_ARGS_NO_TEST); /* Do a clone3() in a new time namespace */ - test_clone3(CLONE_NEWTIME, 0, 0, CLONE3_ARGS_NO_TEST); + if (access("/proc/self/ns/time", F_OK) == 0) { + test_clone3(CLONE_NEWTIME, 0, 0, CLONE3_ARGS_NO_TEST); + } else { + ksft_print_msg("Time namespaces are not supported\n"); + ksft_test_result_skip("Skipping clone3() with CLONE_NEWTIME\n"); + } /* Do a clone3() with exit signal (SIGCHLD) in flags */ test_clone3(SIGCHLD, 0, -EINVAL, CLONE3_ARGS_NO_TEST); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/efivarfs/create-read.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/efivarfs/create-read.c @@ -32,8 +32,10 @@ rc = read(fd, buf, sizeof(buf)); if (rc != 0) { fprintf(stderr, "Reading a new var should return EOF\n"); + close(fd); return EXIT_FAILURE; } + close(fd); return EXIT_SUCCESS; } only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc +++ linux-aws-6.5-6.5.0/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc @@ -0,0 +1,13 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Test failure of registering kprobe on non unique symbol +# requires: kprobe_events + +SYMBOL='name_show' + +# We skip this test on kernel where SYMBOL is unique or does not exist. +if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}" /proc/kallsyms)" -le '1' ]; then + exit_unsupported +fi + +! echo "p:test_non_unique ${SYMBOL}" > kprobe_events only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/lkdtm/config +++ linux-aws-6.5-6.5.0/tools/testing/selftests/lkdtm/config @@ -9,7 +9,6 @@ CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y CONFIG_UBSAN=y CONFIG_UBSAN_BOUNDS=y -CONFIG_UBSAN_TRAP=y CONFIG_STACKPROTECTOR_STRONG=y CONFIG_SLUB_DEBUG=y CONFIG_SLUB_DEBUG_ON=y only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/lkdtm/tests.txt +++ linux-aws-6.5-6.5.0/tools/testing/selftests/lkdtm/tests.txt @@ -7,7 +7,7 @@ #EXHAUST_STACK Corrupts memory on failure #CORRUPT_STACK Crashes entire system on success #CORRUPT_STACK_STRONG Crashes entire system on success -ARRAY_BOUNDS +ARRAY_BOUNDS call trace:|UBSAN: array-index-out-of-bounds CORRUPT_LIST_ADD list_add corruption CORRUPT_LIST_DEL list_del corruption STACK_GUARD_PAGE_LEADING only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/mm/mdwe_test.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/mm/mdwe_test.c @@ -168,13 +168,10 @@ self->p = mmap(NULL, self->size, PROT_READ, self->flags, 0, 0); ASSERT_NE(self->p, MAP_FAILED); - p = mmap(self->p + self->size, self->size, PROT_READ | PROT_EXEC, + /* MAP_FIXED unmaps the existing page before mapping which is allowed */ + p = mmap(self->p, self->size, PROT_READ | PROT_EXEC, self->flags | MAP_FIXED, 0, 0); - if (variant->enabled) { - EXPECT_EQ(p, MAP_FAILED); - } else { - EXPECT_EQ(p, self->p); - } + EXPECT_EQ(p, self->p); } TEST_F(mdwe, arm64_BTI) only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/mm/mremap_dontunmap.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/mm/mremap_dontunmap.c @@ -7,6 +7,7 @@ */ #define _GNU_SOURCE #include +#include #include #include #include only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/net/af_unix/diag_uid.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/net/af_unix/diag_uid.c @@ -148,7 +148,6 @@ .msg_iov = &iov, .msg_iovlen = 1 }; - struct unix_diag_req *udr; struct nlmsghdr *nlh; int ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/net/cmsg_sender.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/net/cmsg_sender.c @@ -416,9 +416,9 @@ { struct addrinfo hints, *ai; struct iovec iov[1]; + unsigned char *buf; struct msghdr msg; char cbuf[1024]; - char *buf; int err; int fd; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/net/ipsec.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/net/ipsec.c @@ -2263,7 +2263,7 @@ int main(int argc, char **argv) { - unsigned int nr_process = 1; + long nr_process = 1; int route_sock = -1, ret = KSFT_SKIP; int test_desc_fd[2]; uint32_t route_seq; @@ -2284,7 +2284,7 @@ exit_usage(argv); } - if (nr_process > MAX_PROCESSES || !nr_process) { + if (nr_process > MAX_PROCESSES || nr_process < 1) { printk("nr_process should be between [1; %u]", MAX_PROCESSES); exit_usage(argv); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -1125,15 +1126,11 @@ static void init_rng(void) { - int fd = open("/dev/urandom", O_RDONLY); unsigned int foo; - if (fd > 0) { - int ret = read(fd, &foo, sizeof(foo)); - - if (ret < 0) - srand(fd + foo); - close(fd); + if (getrandom(&foo, sizeof(foo), 0) == -1) { + perror("getrandom"); + exit(1); } srand(foo); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/net/mptcp/mptcp_inq.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/net/mptcp/mptcp_inq.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -519,15 +520,11 @@ static void init_rng(void) { - int fd = open("/dev/urandom", O_RDONLY); unsigned int foo; - if (fd > 0) { - int ret = read(fd, &foo, sizeof(foo)); - - if (ret < 0) - srand(fd + foo); - close(fd); + if (getrandom(&foo, sizeof(foo), 0) == -1) { + perror("getrandom"); + exit(1); } srand(foo); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ linux-aws-6.5-6.5.0/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -1383,7 +1383,9 @@ count=$(get_counter ${ns_tx} "MPTcpExtMPRstTx") if [ -z "$count" ]; then echo -n "[skip]" - elif [ $count -lt $rst_tx ]; then + # accept more rst than expected except if we don't expect any + elif { [ $rst_tx -ne 0 ] && [ $count -lt $rst_tx ]; } || + { [ $rst_tx -eq 0 ] && [ $count -ne 0 ]; }; then echo "[fail] got $count MP_RST[s] TX expected $rst_tx" fail_test else @@ -1394,7 +1396,9 @@ count=$(get_counter ${ns_rx} "MPTcpExtMPRstRx") if [ -z "$count" ]; then echo -n "[skip]" - elif [ "$count" -lt "$rst_rx" ]; then + # accept more rst than expected except if we don't expect any + elif { [ $rst_rx -ne 0 ] && [ $count -lt $rst_rx ]; } || + { [ $rst_rx -eq 0 ] && [ $count -ne 0 ]; }; then echo "[fail] got $count MP_RST[s] RX expected $rst_rx" fail_test else @@ -2282,6 +2286,7 @@ chk_join_nr 1 1 1 chk_rm_tx_nr 1 chk_rm_nr 1 1 + chk_rst_nr 0 0 fi # multiple subflows, remove @@ -2294,6 +2299,7 @@ run_tests $ns1 $ns2 10.0.1.1 slow chk_join_nr 2 2 2 chk_rm_nr 2 2 + chk_rst_nr 0 0 fi # single address, remove @@ -2306,6 +2312,7 @@ chk_join_nr 1 1 1 chk_add_nr 1 1 chk_rm_nr 1 1 invert + chk_rst_nr 0 0 fi # subflow and signal, remove @@ -2319,6 +2326,7 @@ chk_join_nr 2 2 2 chk_add_nr 1 1 chk_rm_nr 1 1 + chk_rst_nr 0 0 fi # subflows and signal, remove @@ -2333,6 +2341,7 @@ chk_join_nr 3 3 3 chk_add_nr 1 1 chk_rm_nr 2 2 + chk_rst_nr 0 0 fi # addresses remove @@ -2347,6 +2356,7 @@ chk_join_nr 3 3 3 chk_add_nr 3 3 chk_rm_nr 3 3 invert + chk_rst_nr 0 0 fi # invalid addresses remove @@ -2361,6 +2371,7 @@ chk_join_nr 1 1 1 chk_add_nr 3 3 chk_rm_nr 3 1 invert + chk_rst_nr 0 0 fi # subflows and signal, flush @@ -2375,6 +2386,7 @@ chk_join_nr 3 3 3 chk_add_nr 1 1 chk_rm_nr 1 3 invert simult + chk_rst_nr 0 0 fi # subflows flush @@ -2394,6 +2406,7 @@ else chk_rm_nr 3 3 fi + chk_rst_nr 0 0 fi # addresses flush @@ -2408,6 +2421,7 @@ chk_join_nr 3 3 3 chk_add_nr 3 3 chk_rm_nr 3 3 invert simult + chk_rst_nr 0 0 fi # invalid addresses flush @@ -2422,6 +2436,7 @@ chk_join_nr 1 1 1 chk_add_nr 3 3 chk_rm_nr 3 1 invert + chk_rst_nr 0 0 fi # remove id 0 subflow @@ -2433,6 +2448,7 @@ run_tests $ns1 $ns2 10.0.1.1 slow chk_join_nr 1 1 1 chk_rm_nr 1 1 + chk_rst_nr 0 0 fi # remove id 0 address @@ -2445,6 +2461,7 @@ chk_join_nr 1 1 1 chk_add_nr 1 1 chk_rm_nr 1 1 invert + chk_rst_nr 0 0 invert fi } @@ -3190,7 +3207,7 @@ if reset_check_counter "fastclose server test" "MPTcpExtMPFastcloseRx"; then test_linkfail=1024 addr_nr_ns2=fastclose_server \ run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 + chk_join_nr 0 0 0 0 0 0 1 chk_fclose_nr 1 1 invert chk_rst_nr 1 1 fi @@ -3242,6 +3259,7 @@ local addr=$1 local id=$2 local tk sp da dp + local cnt_addr cnt_sf tk=$(grep "type:1," "$evts_ns1" | sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q') @@ -3251,11 +3269,13 @@ sed -n 's/.*\(daddr6:\)\([0-9a-f:.]*\).*$/\2/p;q') dp=$(grep "type:10" "$evts_ns1" | sed -n 's/.*\(dport:\)\([[:digit:]]*\).*$/\2/p;q') + cnt_addr=$(rm_addr_count ${ns1}) + cnt_sf=$(rm_sf_count ${ns1}) ip netns exec $ns1 ./pm_nl_ctl rem token $tk id $id ip netns exec $ns1 ./pm_nl_ctl dsf lip "::ffff:$addr" \ lport $sp rip $da rport $dp token $tk - wait_rm_addr $ns1 1 - wait_rm_sf $ns1 1 + wait_rm_addr $ns1 "${cnt_addr}" + wait_rm_sf $ns1 "${cnt_sf}" } userspace_pm_add_sf() @@ -3277,17 +3297,20 @@ local addr=$1 local id=$2 local tk da dp sp + local cnt_addr cnt_sf tk=$(sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") da=$(sed -n 's/.*\(daddr4:\)\([0-9.]*\).*$/\2/p;q' "$evts_ns2") dp=$(sed -n 's/.*\(dport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") sp=$(grep "type:10" "$evts_ns2" | sed -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q') + cnt_addr=$(rm_addr_count ${ns2}) + cnt_sf=$(rm_sf_count ${ns2}) ip netns exec $ns2 ./pm_nl_ctl rem token $tk id $id ip netns exec $ns2 ./pm_nl_ctl dsf lip $addr lport $sp \ rip $da rport $dp token $tk - wait_rm_addr $ns2 1 - wait_rm_sf $ns2 1 + wait_rm_addr $ns2 "${cnt_addr}" + wait_rm_sf $ns2 "${cnt_sf}" } userspace_tests() only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/net/openvswitch/openvswitch.sh +++ linux-aws-6.5-6.5.0/tools/testing/selftests/net/openvswitch/openvswitch.sh @@ -3,6 +3,8 @@ # # OVS kernel module self tests +trap ovs_exit_sig EXIT TERM INT ERR + # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 @@ -202,7 +204,7 @@ fi if python3 ovs-dpctl.py -h 2>&1 | \ - grep "Need to install the python" >/dev/null 2>&1; then + grep -E "Need to (install|upgrade) the python" >/dev/null 2>&1; then stdbuf -o0 printf "TEST: %-60s [PYLIB]\n" "${tdesc}" return $ksft_skip fi only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/net/openvswitch/ovs-dpctl.py +++ linux-aws-6.5-6.5.0/tools/testing/selftests/net/openvswitch/ovs-dpctl.py @@ -25,8 +25,10 @@ from pyroute2.netlink import nlmsg_atoms from pyroute2.netlink.exceptions import NetlinkError from pyroute2.netlink.generic import GenericNetlinkSocket + import pyroute2 + except ModuleNotFoundError: - print("Need to install the python pyroute2 package.") + print("Need to install the python pyroute2 package >= 0.6.") sys.exit(0) @@ -732,12 +734,14 @@ "src", lambda x: str(ipaddress.IPv4Address(x)), int, + convert_ipv4, ), ( "dst", "dst", - lambda x: str(ipaddress.IPv6Address(x)), + lambda x: str(ipaddress.IPv4Address(x)), int, + convert_ipv4, ), ("tp_src", "tp_src", "%d", int), ("tp_dst", "tp_dst", "%d", int), @@ -1457,6 +1461,12 @@ nlmsg_atoms.ovskey = ovskey nlmsg_atoms.ovsactions = ovsactions + # version check for pyroute2 + prverscheck = pyroute2.__version__.split(".") + if int(prverscheck[0]) == 0 and int(prverscheck[1]) < 6: + print("Need to upgrade the python pyroute2 package to >= 0.6.") + sys.exit(0) + parser = argparse.ArgumentParser() parser.add_argument( "-v", only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/net/pmtu.sh +++ linux-aws-6.5-6.5.0/tools/testing/selftests/net/pmtu.sh @@ -2048,7 +2048,7 @@ case $ret in 0) all_skipped=false - [ $exitcode=$ksft_skip ] && exitcode=0 + [ $exitcode -eq $ksft_skip ] && exitcode=0 ;; $ksft_skip) [ $all_skipped = true ] && exitcode=$ksft_skip only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/netfilter/conntrack_sctp_collision.sh +++ linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/conntrack_sctp_collision.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Testing For SCTP COLLISION SCENARIO as Below: +# +# 14:35:47.655279 IP CLIENT_IP.PORT > SERVER_IP.PORT: sctp (1) [INIT] [init tag: 2017837359] +# 14:35:48.353250 IP SERVER_IP.PORT > CLIENT_IP.PORT: sctp (1) [INIT] [init tag: 1187206187] +# 14:35:48.353275 IP CLIENT_IP.PORT > SERVER_IP.PORT: sctp (1) [INIT ACK] [init tag: 2017837359] +# 14:35:48.353283 IP SERVER_IP.PORT > CLIENT_IP.PORT: sctp (1) [COOKIE ECHO] +# 14:35:48.353977 IP CLIENT_IP.PORT > SERVER_IP.PORT: sctp (1) [COOKIE ACK] +# 14:35:48.855335 IP SERVER_IP.PORT > CLIENT_IP.PORT: sctp (1) [INIT ACK] [init tag: 164579970] +# +# TOPO: SERVER_NS (link0)<--->(link1) ROUTER_NS (link2)<--->(link3) CLIENT_NS + +CLIENT_NS=$(mktemp -u client-XXXXXXXX) +CLIENT_IP="198.51.200.1" +CLIENT_PORT=1234 + +SERVER_NS=$(mktemp -u server-XXXXXXXX) +SERVER_IP="198.51.100.1" +SERVER_PORT=1234 + +ROUTER_NS=$(mktemp -u router-XXXXXXXX) +CLIENT_GW="198.51.200.2" +SERVER_GW="198.51.100.2" + +# setup the topo +setup() { + ip net add $CLIENT_NS + ip net add $SERVER_NS + ip net add $ROUTER_NS + ip -n $SERVER_NS link add link0 type veth peer name link1 netns $ROUTER_NS + ip -n $CLIENT_NS link add link3 type veth peer name link2 netns $ROUTER_NS + + ip -n $SERVER_NS link set link0 up + ip -n $SERVER_NS addr add $SERVER_IP/24 dev link0 + ip -n $SERVER_NS route add $CLIENT_IP dev link0 via $SERVER_GW + + ip -n $ROUTER_NS link set link1 up + ip -n $ROUTER_NS link set link2 up + ip -n $ROUTER_NS addr add $SERVER_GW/24 dev link1 + ip -n $ROUTER_NS addr add $CLIENT_GW/24 dev link2 + ip net exec $ROUTER_NS sysctl -wq net.ipv4.ip_forward=1 + + ip -n $CLIENT_NS link set link3 up + ip -n $CLIENT_NS addr add $CLIENT_IP/24 dev link3 + ip -n $CLIENT_NS route add $SERVER_IP dev link3 via $CLIENT_GW + + # simulate the delay on OVS upcall by setting up a delay for INIT_ACK with + # tc on $SERVER_NS side + tc -n $SERVER_NS qdisc add dev link0 root handle 1: htb + tc -n $SERVER_NS class add dev link0 parent 1: classid 1:1 htb rate 100mbit + tc -n $SERVER_NS filter add dev link0 parent 1: protocol ip u32 match ip protocol 132 \ + 0xff match u8 2 0xff at 32 flowid 1:1 + tc -n $SERVER_NS qdisc add dev link0 parent 1:1 handle 10: netem delay 1200ms + + # simulate the ctstate check on OVS nf_conntrack + ip net exec $ROUTER_NS iptables -A FORWARD -m state --state INVALID,UNTRACKED -j DROP + ip net exec $ROUTER_NS iptables -A INPUT -p sctp -j DROP + + # use a smaller number for assoc's max_retrans to reproduce the issue + modprobe sctp + ip net exec $CLIENT_NS sysctl -wq net.sctp.association_max_retrans=3 +} + +cleanup() { + ip net exec $CLIENT_NS pkill sctp_collision 2>&1 >/dev/null + ip net exec $SERVER_NS pkill sctp_collision 2>&1 >/dev/null + ip net del "$CLIENT_NS" + ip net del "$SERVER_NS" + ip net del "$ROUTER_NS" +} + +do_test() { + ip net exec $SERVER_NS ./sctp_collision server \ + $SERVER_IP $SERVER_PORT $CLIENT_IP $CLIENT_PORT & + ip net exec $CLIENT_NS ./sctp_collision client \ + $CLIENT_IP $CLIENT_PORT $SERVER_IP $SERVER_PORT +} + +# NOTE: one way to work around the issue is set a smaller hb_interval +# ip net exec $CLIENT_NS sysctl -wq net.sctp.hb_interval=3500 + +# run the test case +trap cleanup EXIT +setup && \ +echo "Test for SCTP Collision in nf_conntrack:" && \ +do_test && echo "PASS!" +exit $? only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/netfilter/sctp_collision.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/sctp_collision.c @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + struct sockaddr_in saddr = {}, daddr = {}; + int sd, ret, len = sizeof(daddr); + struct timeval tv = {25, 0}; + char buf[] = "hello"; + + if (argc != 6 || (strcmp(argv[1], "server") && strcmp(argv[1], "client"))) { + printf("%s \n", + argv[0]); + return -1; + } + + sd = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); + if (sd < 0) { + printf("Failed to create sd\n"); + return -1; + } + + saddr.sin_family = AF_INET; + saddr.sin_addr.s_addr = inet_addr(argv[2]); + saddr.sin_port = htons(atoi(argv[3])); + + ret = bind(sd, (struct sockaddr *)&saddr, sizeof(saddr)); + if (ret < 0) { + printf("Failed to bind to address\n"); + goto out; + } + + ret = listen(sd, 5); + if (ret < 0) { + printf("Failed to listen on port\n"); + goto out; + } + + daddr.sin_family = AF_INET; + daddr.sin_addr.s_addr = inet_addr(argv[4]); + daddr.sin_port = htons(atoi(argv[5])); + + /* make test shorter than 25s */ + ret = setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); + if (ret < 0) { + printf("Failed to setsockopt SO_RCVTIMEO\n"); + goto out; + } + + if (!strcmp(argv[1], "server")) { + sleep(1); /* wait a bit for client's INIT */ + ret = connect(sd, (struct sockaddr *)&daddr, len); + if (ret < 0) { + printf("Failed to connect to peer\n"); + goto out; + } + ret = recvfrom(sd, buf, sizeof(buf), 0, (struct sockaddr *)&daddr, &len); + if (ret < 0) { + printf("Failed to recv msg %d\n", ret); + goto out; + } + ret = sendto(sd, buf, strlen(buf) + 1, 0, (struct sockaddr *)&daddr, len); + if (ret < 0) { + printf("Failed to send msg %d\n", ret); + goto out; + } + printf("Server: sent! %d\n", ret); + } + + if (!strcmp(argv[1], "client")) { + usleep(300000); /* wait a bit for server's listening */ + ret = connect(sd, (struct sockaddr *)&daddr, len); + if (ret < 0) { + printf("Failed to connect to peer\n"); + goto out; + } + sleep(1); /* wait a bit for server's delayed INIT_ACK to reproduce the issue */ + ret = sendto(sd, buf, strlen(buf) + 1, 0, (struct sockaddr *)&daddr, len); + if (ret < 0) { + printf("Failed to send msg %d\n", ret); + goto out; + } + ret = recvfrom(sd, buf, sizeof(buf), 0, (struct sockaddr *)&daddr, &len); + if (ret < 0) { + printf("Failed to recv msg %d\n", ret); + goto out; + } + printf("Client: rcvd! %d\n", ret); + } + ret = 0; +out: + close(sd); + return ret; +} only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/netfilter/xt_string.sh +++ linux-aws-6.5-6.5.0/tools/testing/selftests/netfilter/xt_string.sh @@ -0,0 +1,128 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +# return code to signal skipped test +ksft_skip=4 +rc=0 + +if ! iptables --version >/dev/null 2>&1; then + echo "SKIP: Test needs iptables" + exit $ksft_skip +fi +if ! ip -V >/dev/null 2>&1; then + echo "SKIP: Test needs iproute2" + exit $ksft_skip +fi +if ! nc -h >/dev/null 2>&1; then + echo "SKIP: Test needs netcat" + exit $ksft_skip +fi + +pattern="foo bar baz" +patlen=11 +hdrlen=$((20 + 8)) # IPv4 + UDP +ns="ns-$(mktemp -u XXXXXXXX)" +trap 'ip netns del $ns' EXIT +ip netns add "$ns" +ip -net "$ns" link add d0 type dummy +ip -net "$ns" link set d0 up +ip -net "$ns" addr add 10.1.2.1/24 dev d0 + +#ip netns exec "$ns" tcpdump -npXi d0 & +#tcpdump_pid=$! +#trap 'kill $tcpdump_pid; ip netns del $ns' EXIT + +add_rule() { # (alg, from, to) + ip netns exec "$ns" \ + iptables -A OUTPUT -o d0 -m string \ + --string "$pattern" --algo $1 --from $2 --to $3 +} +showrules() { # () + ip netns exec "$ns" iptables -v -S OUTPUT | grep '^-A' +} +zerorules() { + ip netns exec "$ns" iptables -Z OUTPUT +} +countrule() { # (pattern) + showrules | grep -c -- "$*" +} +send() { # (offset) + ( for ((i = 0; i < $1 - $hdrlen; i++)); do + printf " " + done + printf "$pattern" + ) | ip netns exec "$ns" nc -w 1 -u 10.1.2.2 27374 +} + +add_rule bm 1000 1500 +add_rule bm 1400 1600 +add_rule kmp 1000 1500 +add_rule kmp 1400 1600 + +zerorules +send 0 +send $((1000 - $patlen)) +if [ $(countrule -c 0 0) -ne 4 ]; then + echo "FAIL: rules match data before --from" + showrules + ((rc--)) +fi + +zerorules +send 1000 +send $((1400 - $patlen)) +if [ $(countrule -c 2) -ne 2 ]; then + echo "FAIL: only two rules should match at low offset" + showrules + ((rc--)) +fi + +zerorules +send $((1500 - $patlen)) +if [ $(countrule -c 1) -ne 4 ]; then + echo "FAIL: all rules should match at end of packet" + showrules + ((rc--)) +fi + +zerorules +send 1495 +if [ $(countrule -c 1) -ne 1 ]; then + echo "FAIL: only kmp with proper --to should match pattern spanning fragments" + showrules + ((rc--)) +fi + +zerorules +send 1500 +if [ $(countrule -c 1) -ne 2 ]; then + echo "FAIL: two rules should match pattern at start of second fragment" + showrules + ((rc--)) +fi + +zerorules +send $((1600 - $patlen)) +if [ $(countrule -c 1) -ne 2 ]; then + echo "FAIL: two rules should match pattern at end of largest --to" + showrules + ((rc--)) +fi + +zerorules +send $((1600 - $patlen + 1)) +if [ $(countrule -c 1) -ne 0 ]; then + echo "FAIL: no rules should match pattern extending largest --to" + showrules + ((rc--)) +fi + +zerorules +send 1600 +if [ $(countrule -c 1) -ne 0 ]; then + echo "FAIL: no rule should match pattern past largest --to" + showrules + ((rc--)) +fi + +exit $rc only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c @@ -62,7 +62,7 @@ break; case PIDFD_PASS: - ksft_test_result_pass("%s test: Passed\n"); + ksft_test_result_pass("%s test: Passed\n", test_name); break; default: only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/pidfd/pidfd_test.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/pidfd/pidfd_test.c @@ -381,13 +381,13 @@ static void *test_pidfd_poll_exec_thread(void *priv) { - ksft_print_msg("Child Thread: starting. pid %d tid %d ; and sleeping\n", + ksft_print_msg("Child Thread: starting. pid %d tid %ld ; and sleeping\n", getpid(), syscall(SYS_gettid)); ksft_print_msg("Child Thread: doing exec of sleep\n"); execl("/bin/sleep", "sleep", str(CHILD_THREAD_MIN_WAIT), (char *)NULL); - ksft_print_msg("Child Thread: DONE. pid %d tid %d\n", + ksft_print_msg("Child Thread: DONE. pid %d tid %ld\n", getpid(), syscall(SYS_gettid)); return NULL; } @@ -427,7 +427,7 @@ { pthread_t t1; - ksft_print_msg("Child (pidfd): starting. pid %d tid %d\n", getpid(), + ksft_print_msg("Child (pidfd): starting. pid %d tid %ld\n", getpid(), syscall(SYS_gettid)); pthread_create(&t1, NULL, test_pidfd_poll_exec_thread, NULL); /* @@ -480,10 +480,10 @@ static void *test_pidfd_poll_leader_exit_thread(void *priv) { - ksft_print_msg("Child Thread: starting. pid %d tid %d ; and sleeping\n", + ksft_print_msg("Child Thread: starting. pid %d tid %ld ; and sleeping\n", getpid(), syscall(SYS_gettid)); sleep(CHILD_THREAD_MIN_WAIT); - ksft_print_msg("Child Thread: DONE. pid %d tid %d\n", getpid(), syscall(SYS_gettid)); + ksft_print_msg("Child Thread: DONE. pid %d tid %ld\n", getpid(), syscall(SYS_gettid)); return NULL; } @@ -492,7 +492,7 @@ { pthread_t t1, t2; - ksft_print_msg("Child: starting. pid %d tid %d\n", getpid(), syscall(SYS_gettid)); + ksft_print_msg("Child: starting. pid %d tid %ld\n", getpid(), syscall(SYS_gettid)); pthread_create(&t1, NULL, test_pidfd_poll_leader_exit_thread, NULL); pthread_create(&t2, NULL, test_pidfd_poll_leader_exit_thread, NULL); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/resctrl/cmt_test.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/cmt_test.c @@ -90,9 +90,6 @@ if (ret) return ret; - if (!validate_resctrl_feature_request(CMT_STR)) - return -1; - ret = get_cbm_mask("L3", cbm_mask); if (ret) return ret; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/resctrl/mba_test.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/mba_test.c @@ -12,7 +12,7 @@ #define RESULT_FILE_NAME "result_mba" #define NUM_OF_RUNS 5 -#define MAX_DIFF_PERCENT 5 +#define MAX_DIFF_PERCENT 8 #define ALLOCATION_MAX 100 #define ALLOCATION_MIN 10 #define ALLOCATION_STEP 10 only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/resctrl/mbm_test.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/mbm_test.c @@ -11,7 +11,7 @@ #include "resctrl.h" #define RESULT_FILE_NAME "result_mbm" -#define MAX_DIFF_PERCENT 5 +#define MAX_DIFF_PERCENT 8 #define NUM_OF_RUNS 5 static int only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/resctrl/resctrl_tests.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/resctrl_tests.c @@ -224,9 +224,14 @@ return ksft_exit_skip("Not running as root. Skipping...\n"); if (has_ben) { + if (argc - ben_ind >= BENCHMARK_ARGS) + ksft_exit_fail_msg("Too long benchmark command.\n"); + /* Extract benchmark command from command line. */ for (i = ben_ind; i < argc; i++) { benchmark_cmd[i - ben_ind] = benchmark_cmd_area[i]; + if (strlen(argv[i]) >= BENCHMARK_ARG_SIZE) + ksft_exit_fail_msg("Too long benchmark command argument.\n"); sprintf(benchmark_cmd[i - ben_ind], "%s", argv[i]); } benchmark_cmd[ben_count] = NULL; only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/resctrl/resctrl_val.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/resctrl/resctrl_val.c @@ -482,7 +482,7 @@ */ int signal_handler_register(void) { - struct sigaction sigact; + struct sigaction sigact = {}; int ret = 0; sigact.sa_sigaction = ctrlc_handler; @@ -504,7 +504,7 @@ */ void signal_handler_unregister(void) { - struct sigaction sigact; + struct sigaction sigact = {}; sigact.sa_handler = SIG_DFL; sigemptyset(&sigact.sa_mask); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/selftests/x86/lam.c +++ linux-aws-6.5-6.5.0/tools/testing/selftests/x86/lam.c @@ -573,7 +573,7 @@ char path[PATH_MAX] = {0}; /* get current process path */ - if (readlink("/proc/self/exe", path, PATH_MAX) <= 0) + if (readlink("/proc/self/exe", path, PATH_MAX - 1) <= 0) return 1; int file_fd = open(path, O_RDONLY); @@ -680,14 +680,14 @@ perror("Fork failed."); ret = 1; } else if (pid == 0) { - char path[PATH_MAX]; + char path[PATH_MAX] = {0}; /* Set LAM mode in parent process */ if (set_lam(lam) != 0) return 1; /* Get current binary's path and the binary was run by execve */ - if (readlink("/proc/self/exe", path, PATH_MAX) <= 0) + if (readlink("/proc/self/exe", path, PATH_MAX - 1) <= 0) exit(-1); /* run binary to get LAM mode and return to parent process */ only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/testing/vsock/vsock_test.c +++ linux-aws-6.5-6.5.0/tools/testing/vsock/vsock_test.c @@ -285,11 +285,12 @@ } #define SOCK_BUF_SIZE (2 * 1024 * 1024) -#define MAX_MSG_SIZE (32 * 1024) +#define MAX_MSG_PAGES 4 static void test_seqpacket_msg_bounds_client(const struct test_opts *opts) { unsigned long curr_hash; + size_t max_msg_size; int page_size; int msg_count; int fd; @@ -305,7 +306,8 @@ curr_hash = 0; page_size = getpagesize(); - msg_count = SOCK_BUF_SIZE / MAX_MSG_SIZE; + max_msg_size = MAX_MSG_PAGES * page_size; + msg_count = SOCK_BUF_SIZE / max_msg_size; for (int i = 0; i < msg_count; i++) { ssize_t send_size; @@ -316,7 +318,7 @@ /* Use "small" buffers and "big" buffers. */ if (i & 1) buf_size = page_size + - (rand() % (MAX_MSG_SIZE - page_size)); + (rand() % (max_msg_size - page_size)); else buf_size = 1 + (rand() % page_size); @@ -372,7 +374,6 @@ unsigned long remote_hash; unsigned long curr_hash; int fd; - char buf[MAX_MSG_SIZE]; struct msghdr msg = {0}; struct iovec iov = {0}; @@ -400,8 +401,13 @@ control_writeln("SRVREADY"); /* Wait, until peer sends whole data. */ control_expectln("SENDDONE"); - iov.iov_base = buf; - iov.iov_len = sizeof(buf); + iov.iov_len = MAX_MSG_PAGES * getpagesize(); + iov.iov_base = malloc(iov.iov_len); + if (!iov.iov_base) { + perror("malloc"); + exit(EXIT_FAILURE); + } + msg.msg_iov = &iov; msg.msg_iovlen = 1; @@ -426,6 +432,7 @@ curr_hash += hash_djb2(msg.msg_iov[0].iov_base, recv_size); } + free(iov.iov_base); close(fd); remote_hash = control_readulong(); only in patch2: unchanged: --- linux-aws-6.5-6.5.0.orig/tools/tracing/rtla/src/utils.c +++ linux-aws-6.5-6.5.0/tools/tracing/rtla/src/utils.c @@ -538,7 +538,7 @@ { char mount_point[MAX_PATH]; char type[100]; - int found; + int found = 0; FILE *fp; fp = fopen("/proc/mounts", "r");