From 7d3e16ab3520ba5a46f2053d7eb1eef879b162d9 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 10 Dec 2023 14:38:54 -0500 Subject: [PATCH] Fixes for 5.15 Signed-off-by: Sasha Levin --- ...ts-mediatek-add-missing-space-before.patch | 277 ++++++++++++ ...ek-align-thermal-zone-node-names-wit.patch | 53 +++ ...ek-mt8183-move-thermal-zones-to-the-.patch | 282 ++++++++++++ ...-kukui-fix-underscores-in-node-names.patch | 405 ++++++++++++++++++ ...m4x-make-etm4_remove_dev-return-void.patch | 67 +++ ...remove-bogous-__exit-annotation-for-.patch | 72 ++++ ...c-fix-problem-of-return-eoverflow-in.patch | 38 ++ ...c-return-negative-error-code-in-mei_.patch | 37 ++ ...-filemap_map_pmd-without-prealloc_pt.patch | 67 +++ .../mm-introduce-pmd_install-helper.patch | 137 ++++++ ...5b-pause-frames-blasting-when-suspen.patch | 74 ++++ ...e-absolute-timestamp-on-discard-of-e.patch | 71 +++ queue-5.15/series | 14 + ...actual-size-after-ring-buffer-resize.patch | 70 +++ ...-current-tracer-when-resizing-buffer.patch | 73 ++++ 15 files changed, 1737 insertions(+) create mode 100644 queue-5.15/arm64-dts-mediatek-add-missing-space-before.patch create mode 100644 queue-5.15/arm64-dts-mediatek-align-thermal-zone-node-names-wit.patch create mode 100644 queue-5.15/arm64-dts-mediatek-mt8183-move-thermal-zones-to-the-.patch create mode 100644 queue-5.15/arm64-dts-mt8183-kukui-fix-underscores-in-node-names.patch create mode 100644 queue-5.15/coresight-etm4x-make-etm4_remove_dev-return-void.patch create mode 100644 queue-5.15/coresight-etm4x-remove-bogous-__exit-annotation-for-.patch create mode 100644 queue-5.15/misc-mei-client.c-fix-problem-of-return-eoverflow-in.patch create mode 100644 queue-5.15/misc-mei-client.c-return-negative-error-code-in-mei_.patch create mode 100644 queue-5.15/mm-fix-oops-when-filemap_map_pmd-without-prealloc_pt.patch create mode 100644 queue-5.15/mm-introduce-pmd_install-helper.patch create mode 100644 queue-5.15/r8169-fix-rtl8125b-pause-frames-blasting-when-suspen.patch create mode 100644 queue-5.15/ring-buffer-force-absolute-timestamp-on-discard-of-e.patch create mode 100644 queue-5.15/tracing-set-actual-size-after-ring-buffer-resize.patch create mode 100644 queue-5.15/tracing-stop-current-tracer-when-resizing-buffer.patch diff --git a/queue-5.15/arm64-dts-mediatek-add-missing-space-before.patch b/queue-5.15/arm64-dts-mediatek-add-missing-space-before.patch new file mode 100644 index 00000000000..3c88898074d --- /dev/null +++ b/queue-5.15/arm64-dts-mediatek-add-missing-space-before.patch @@ -0,0 +1,277 @@ +From 9acf6a037a98ef40d007ac10902437abd08d4454 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Jul 2023 17:00:06 +0200 +Subject: arm64: dts: mediatek: add missing space before { + +From: Krzysztof Kozlowski + +[ Upstream commit a9c740c57f977deb41bc53c02d0dae3d0e2f191a ] + +Add missing whitespace between node name/label and opening {. + +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20230705150006.293690-2-krzysztof.kozlowski@linaro.org +Signed-off-by: Krzysztof Kozlowski +Stable-dep-of: 8980c30141d3 ("arm64: dts: mt8183: kukui: Fix underscores in node names") +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt8183-evb.dts | 48 +++++++++---------- + .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 12 ++--- + .../boot/dts/mediatek/mt8183-pumpkin.dts | 12 ++--- + 3 files changed, 36 insertions(+), 36 deletions(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8183-evb.dts b/arch/arm64/boot/dts/mediatek/mt8183-evb.dts +index 3023bef2200aa..69aee79d36d48 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183-evb.dts ++++ b/arch/arm64/boot/dts/mediatek/mt8183-evb.dts +@@ -131,8 +131,8 @@ &mmc1 { + }; + + &pio { +- i2c_pins_0: i2c0{ +- pins_i2c{ ++ i2c_pins_0: i2c0 { ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -140,8 +140,8 @@ pins_i2c{ + }; + }; + +- i2c_pins_1: i2c1{ +- pins_i2c{ ++ i2c_pins_1: i2c1 { ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -149,8 +149,8 @@ pins_i2c{ + }; + }; + +- i2c_pins_2: i2c2{ +- pins_i2c{ ++ i2c_pins_2: i2c2 { ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -158,8 +158,8 @@ pins_i2c{ + }; + }; + +- i2c_pins_3: i2c3{ +- pins_i2c{ ++ i2c_pins_3: i2c3 { ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -167,8 +167,8 @@ pins_i2c{ + }; + }; + +- i2c_pins_4: i2c4{ +- pins_i2c{ ++ i2c_pins_4: i2c4 { ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -176,8 +176,8 @@ pins_i2c{ + }; + }; + +- i2c_pins_5: i2c5{ +- pins_i2c{ ++ i2c_pins_5: i2c5 { ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -185,8 +185,8 @@ pins_i2c{ + }; + }; + +- spi_pins_0: spi0{ +- pins_spi{ ++ spi_pins_0: spi0 { ++ pins_spi { + pinmux = , + , + , +@@ -300,8 +300,8 @@ pins_clk { + }; + }; + +- spi_pins_1: spi1{ +- pins_spi{ ++ spi_pins_1: spi1 { ++ pins_spi { + pinmux = , + , + , +@@ -310,8 +310,8 @@ pins_spi{ + }; + }; + +- spi_pins_2: spi2{ +- pins_spi{ ++ spi_pins_2: spi2 { ++ pins_spi { + pinmux = , + , + , +@@ -320,8 +320,8 @@ pins_spi{ + }; + }; + +- spi_pins_3: spi3{ +- pins_spi{ ++ spi_pins_3: spi3 { ++ pins_spi { + pinmux = , + , + , +@@ -330,8 +330,8 @@ pins_spi{ + }; + }; + +- spi_pins_4: spi4{ +- pins_spi{ ++ spi_pins_4: spi4 { ++ pins_spi { + pinmux = , + , + , +@@ -340,8 +340,8 @@ pins_spi{ + }; + }; + +- spi_pins_5: spi5{ +- pins_spi{ ++ spi_pins_5: spi5 { ++ pins_spi { + pinmux = , + , + , +diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +index 5950601813196..bc583a1da9060 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +@@ -619,7 +619,7 @@ pins_scp_uart { + }; + + spi0_pins: spi0 { +- pins_spi{ ++ pins_spi { + pinmux = , + , + , +@@ -629,7 +629,7 @@ pins_spi{ + }; + + spi1_pins: spi1 { +- pins_spi{ ++ pins_spi { + pinmux = , + , + , +@@ -639,7 +639,7 @@ pins_spi{ + }; + + spi2_pins: spi2 { +- pins_spi{ ++ pins_spi { + pinmux = , + , + ; +@@ -652,7 +652,7 @@ pins_spi_mi { + }; + + spi3_pins: spi3 { +- pins_spi{ ++ pins_spi { + pinmux = , + , + , +@@ -662,7 +662,7 @@ pins_spi{ + }; + + spi4_pins: spi4 { +- pins_spi{ ++ pins_spi { + pinmux = , + , + , +@@ -672,7 +672,7 @@ pins_spi{ + }; + + spi5_pins: spi5 { +- pins_spi{ ++ pins_spi { + pinmux = , + , + , +diff --git a/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts b/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts +index ee912825cfc60..b7f3c266d3dd2 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts ++++ b/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts +@@ -165,7 +165,7 @@ &mmc1 { + + &pio { + i2c_pins_0: i2c0 { +- pins_i2c{ ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -174,7 +174,7 @@ pins_i2c{ + }; + + i2c_pins_1: i2c1 { +- pins_i2c{ ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -183,7 +183,7 @@ pins_i2c{ + }; + + i2c_pins_2: i2c2 { +- pins_i2c{ ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -192,7 +192,7 @@ pins_i2c{ + }; + + i2c_pins_3: i2c3 { +- pins_i2c{ ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -201,7 +201,7 @@ pins_i2c{ + }; + + i2c_pins_4: i2c4 { +- pins_i2c{ ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -210,7 +210,7 @@ pins_i2c{ + }; + + i2c_pins_5: i2c5 { +- pins_i2c{ ++ pins_i2c { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +-- +2.42.0 + diff --git a/queue-5.15/arm64-dts-mediatek-align-thermal-zone-node-names-wit.patch b/queue-5.15/arm64-dts-mediatek-align-thermal-zone-node-names-wit.patch new file mode 100644 index 00000000000..375285ad3c9 --- /dev/null +++ b/queue-5.15/arm64-dts-mediatek-align-thermal-zone-node-names-wit.patch @@ -0,0 +1,53 @@ +From f130164a1f1003bde650a7a5d4ac4d53c5fd77cd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Apr 2022 12:05:20 +0200 +Subject: arm64: dts: mediatek: align thermal zone node names with dtschema + +From: Krzysztof Kozlowski + +[ Upstream commit 624f1806a7c3f8061641a1f3e7c0dfa73e82fb10 ] + +Align the name of thermal zone node to dtschema to fix warnings like: + + arch/arm64/boot/dts/mediatek/mt8173-elm.dt.yaml: + thermal-zones: 'cpu_thermal' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-]{1,12}-thermal$', 'pinctrl-[0-9]+' + +Signed-off-by: Krzysztof Kozlowski +Link: https://lore.kernel.org/r/20210820081616.83674-2-krzysztof.kozlowski@canonical.com +Signed-off-by: Matthias Brugger +Stable-dep-of: 5a60d6343969 ("arm64: dts: mediatek: mt8183: Move thermal-zones to the root node") +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt8173.dtsi | 2 +- + arch/arm64/boot/dts/mediatek/mt8183.dtsi | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi +index d9e005ae5bb09..c71a5155702d2 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi +@@ -273,7 +273,7 @@ cpum_ck: oscillator2 { + }; + + thermal-zones { +- cpu_thermal: cpu_thermal { ++ cpu_thermal: cpu-thermal { + polling-delay-passive = <1000>; /* milliseconds */ + polling-delay = <1000>; /* milliseconds */ + +diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi +index 81fde34ffd52a..ac05284cce867 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi +@@ -767,7 +767,7 @@ thermal: thermal@1100b000 { + }; + + thermal_zones: thermal-zones { +- cpu_thermal: cpu_thermal { ++ cpu_thermal: cpu-thermal { + polling-delay-passive = <100>; + polling-delay = <500>; + thermal-sensors = <&thermal 0>; +-- +2.42.0 + diff --git a/queue-5.15/arm64-dts-mediatek-mt8183-move-thermal-zones-to-the-.patch b/queue-5.15/arm64-dts-mediatek-mt8183-move-thermal-zones-to-the-.patch new file mode 100644 index 00000000000..5a64a507bf2 --- /dev/null +++ b/queue-5.15/arm64-dts-mediatek-mt8183-move-thermal-zones-to-the-.patch @@ -0,0 +1,282 @@ +From 219fabf89b08a6bd3a4dc18504dedb5084c62731 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 25 Oct 2023 11:38:16 +0200 +Subject: arm64: dts: mediatek: mt8183: Move thermal-zones to the root node + +From: AngeloGioacchino Del Regno + +[ Upstream commit 5a60d63439694590cd5ab1f998fc917ff7ba1c1d ] + +The thermal zones are not a soc bus device: move it to the root +node to solve simple_bus_reg warnings. + +Cc: stable@vger.kernel.org +Fixes: b325ce39785b ("arm64: dts: mt8183: add thermal zone node") +Link: https://lore.kernel.org/r/20231025093816.44327-9-angelogioacchino.delregno@collabora.com +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt8183.dtsi | 242 +++++++++++------------ + 1 file changed, 121 insertions(+), 121 deletions(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi +index ac05284cce867..2d33f4a583b48 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi +@@ -766,127 +766,6 @@ thermal: thermal@1100b000 { + 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>; +@@ -1495,4 +1374,125 @@ larb3: larb@1a002000 { + 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 {}; ++ }; ++ }; + }; +-- +2.42.0 + diff --git a/queue-5.15/arm64-dts-mt8183-kukui-fix-underscores-in-node-names.patch b/queue-5.15/arm64-dts-mt8183-kukui-fix-underscores-in-node-names.patch new file mode 100644 index 00000000000..f11876aa046 --- /dev/null +++ b/queue-5.15/arm64-dts-mt8183-kukui-fix-underscores-in-node-names.patch @@ -0,0 +1,405 @@ +From 4536c23142af0b7d3e16dc8c08d8ea39ca211f3d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Oct 2023 12:09:10 -0700 +Subject: arm64: dts: mt8183: kukui: Fix underscores in node names + +From: Hsin-Yi Wang + +[ Upstream commit 8980c30141d3986beab815d85762b9c67196ed72 ] + +Replace underscores with hyphens in pinctrl node names both for consistency +and to adhere to the bindings. + +Cc: stable@vger.kernel.org +Fixes: cd894e274b74 ("arm64: dts: mt8183: Add krane-sku176 board") +Fixes: 1652dbf7363a ("arm64: dts: mt8183: add scp node") +Fixes: 27eaf34df364 ("arm64: dts: mt8183: config dsi node") +Signed-off-by: Hsin-Yi Wang +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20231026191343.3345279-2-hsinyi@chromium.org +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + .../dts/mediatek/mt8183-kukui-jacuzzi.dtsi | 6 +- + .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 88 +++++++++---------- + 2 files changed, 47 insertions(+), 47 deletions(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi +index a374b809adec9..c1153580ef958 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi +@@ -440,20 +440,20 @@ pins2 { + }; + + 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 */ +diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +index bc583a1da9060..6b7a42c5d5153 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +@@ -407,13 +407,13 @@ &mt6358_vsim2_reg { + + &pio { + 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; +@@ -421,7 +421,7 @@ pins1 { + }; + }; + +- h1_int_od_l: h1_int_od_l { ++ h1_int_od_l: h1-int-od-l { + pins1 { + pinmux = ; + input-enable; +@@ -429,7 +429,7 @@ pins1 { + }; + + i2c0_pins: i2c0 { +- pins_bus { ++ pins-bus { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -438,7 +438,7 @@ pins_bus { + }; + + i2c1_pins: i2c1 { +- pins_bus { ++ pins-bus { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -447,7 +447,7 @@ pins_bus { + }; + + i2c2_pins: i2c2 { +- pins_bus { ++ pins-bus { + pinmux = , + ; + bias-disable; +@@ -456,7 +456,7 @@ pins_bus { + }; + + i2c3_pins: i2c3 { +- pins_bus { ++ pins-bus { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -465,7 +465,7 @@ pins_bus { + }; + + i2c4_pins: i2c4 { +- pins_bus { ++ pins-bus { + pinmux = , + ; + bias-disable; +@@ -474,7 +474,7 @@ pins_bus { + }; + + i2c5_pins: i2c5 { +- pins_bus { ++ pins-bus { + pinmux = , + ; + mediatek,pull-up-adv = <3>; +@@ -483,7 +483,7 @@ pins_bus { + }; + + i2c6_pins: i2c6 { +- pins_bus { ++ pins-bus { + pinmux = , + ; + bias-disable; +@@ -491,7 +491,7 @@ pins_bus { + }; + + mmc0_pins_default: mmc0-pins-default { +- pins_cmd_dat { ++ pins-cmd-dat { + pinmux = , + , + , +@@ -506,13 +506,13 @@ pins_cmd_dat { + 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>; +@@ -520,7 +520,7 @@ pins_rst { + }; + + mmc0_pins_uhs: mmc0-pins-uhs { +- pins_cmd_dat { ++ pins-cmd-dat { + pinmux = , + , + , +@@ -535,19 +535,19 @@ pins_cmd_dat { + 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>; +@@ -555,7 +555,7 @@ pins_rst { + }; + + mmc1_pins_default: mmc1-pins-default { +- pins_cmd_dat { ++ pins-cmd-dat { + pinmux = , + , + , +@@ -565,7 +565,7 @@ pins_cmd_dat { + mediatek,pull-up-adv = <10>; + }; + +- pins_clk { ++ pins-clk { + pinmux = ; + input-enable; + mediatek,pull-down-adv = <10>; +@@ -573,7 +573,7 @@ pins_clk { + }; + + mmc1_pins_uhs: mmc1-pins-uhs { +- pins_cmd_dat { ++ pins-cmd-dat { + pinmux = , + , + , +@@ -584,7 +584,7 @@ pins_cmd_dat { + mediatek,pull-up-adv = <10>; + }; + +- pins_clk { ++ pins-clk { + pinmux = ; + drive-strength = ; + mediatek,pull-down-adv = <10>; +@@ -592,15 +592,15 @@ pins_clk { + }; + }; + +- 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; +@@ -612,14 +612,14 @@ pins2 { + }; + + scp_pins: scp { +- pins_scp_uart { ++ pins-scp-uart { + pinmux = , + ; + }; + }; + + spi0_pins: spi0 { +- pins_spi { ++ pins-spi { + pinmux = , + , + , +@@ -629,7 +629,7 @@ pins_spi { + }; + + spi1_pins: spi1 { +- pins_spi { ++ pins-spi { + pinmux = , + , + , +@@ -639,20 +639,20 @@ pins_spi { + }; + + 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 = , + , + , +@@ -662,7 +662,7 @@ pins_spi { + }; + + spi4_pins: spi4 { +- pins_spi { ++ pins-spi { + pinmux = , + , + , +@@ -672,7 +672,7 @@ pins_spi { + }; + + spi5_pins: spi5 { +- pins_spi { ++ pins-spi { + pinmux = , + , + , +@@ -682,63 +682,63 @@ pins_spi { + }; + + 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; + }; +-- +2.42.0 + diff --git a/queue-5.15/coresight-etm4x-make-etm4_remove_dev-return-void.patch b/queue-5.15/coresight-etm4x-make-etm4_remove_dev-return-void.patch new file mode 100644 index 00000000000..b5d8952a3c7 --- /dev/null +++ b/queue-5.15/coresight-etm4x-make-etm4_remove_dev-return-void.patch @@ -0,0 +1,67 @@ +From 218e9f63a296c77ec4f586024005e89439786b60 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 18 May 2023 22:16:29 +0200 +Subject: coresight: etm4x: Make etm4_remove_dev() return void +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +[ Upstream commit c5f231f1a7e18d28e02b282d33541d31358360e4 ] + +etm4_remove_dev() returned zero unconditionally. Make it return void +instead, which makes it clear in the callers that there is no error to +handle. Simplify etm4_remove_platform_dev() accordingly. + +Signed-off-by: Uwe Kleine-König +Reviewed-by: Anshuman Khandual +Signed-off-by: Suzuki K Poulose +Link: https://lore.kernel.org/r/20230518201629.260672-1-u.kleine-koenig@pengutronix.de +Stable-dep-of: 348ddab81f7b ("coresight: etm4x: Remove bogous __exit annotation for some functions") +Signed-off-by: Sasha Levin +--- + drivers/hwtracing/coresight/coresight-etm4x-core.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c +index 2b22343918d69..e2cccd6ea1f1d 100644 +--- a/drivers/hwtracing/coresight/coresight-etm4x-core.c ++++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c +@@ -2041,7 +2041,7 @@ static void clear_etmdrvdata(void *info) + etmdrvdata[cpu] = NULL; + } + +-static int __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) ++static void __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) + { + etm_perf_symlink(drvdata->csdev, false); + /* +@@ -2062,8 +2062,6 @@ static int __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) + + cscfg_unregister_csdev(drvdata->csdev); + coresight_unregister(drvdata->csdev); +- +- return 0; + } + + static void __exit etm4_remove_amba(struct amba_device *adev) +@@ -2076,13 +2074,12 @@ static void __exit etm4_remove_amba(struct amba_device *adev) + + static int __exit etm4_remove_platform_dev(struct platform_device *pdev) + { +- int ret = 0; + struct etmv4_drvdata *drvdata = dev_get_drvdata(&pdev->dev); + + if (drvdata) +- ret = etm4_remove_dev(drvdata); ++ etm4_remove_dev(drvdata); + pm_runtime_disable(&pdev->dev); +- return ret; ++ return 0; + } + + static const struct amba_id etm4_ids[] = { +-- +2.42.0 + diff --git a/queue-5.15/coresight-etm4x-remove-bogous-__exit-annotation-for-.patch b/queue-5.15/coresight-etm4x-remove-bogous-__exit-annotation-for-.patch new file mode 100644 index 00000000000..0abb5ccf52e --- /dev/null +++ b/queue-5.15/coresight-etm4x-remove-bogous-__exit-annotation-for-.patch @@ -0,0 +1,72 @@ +From e4ba6ce7761d7d20e162fb8670875e3311dc9186 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 29 Sep 2023 10:16:37 +0200 +Subject: coresight: etm4x: Remove bogous __exit annotation for some functions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +[ Upstream commit 348ddab81f7b0983d9fb158df910254f08d3f887 ] + +etm4_platform_driver (which lives in ".data" contains a reference to +etm4_remove_platform_dev(). So the latter must not be marked with __exit +which results in the function being discarded for a build with +CONFIG_CORESIGHT_SOURCE_ETM4X=y which in turn makes the remove pointer +contain invalid data. + +etm4x_amba_driver referencing etm4_remove_amba() has the same issue. + +Drop the __exit annotations for the two affected functions and a third +one that is called by the other two. + +For reasons I don't understand this isn't catched by building with +CONFIG_DEBUG_SECTION_MISMATCH=y. + +Fixes: c23bc382ef0e ("coresight: etm4x: Refactor probing routine") +Fixes: 5214b563588e ("coresight: etm4x: Add support for sysreg only devices") +Signed-off-by: Uwe Kleine-König +Reviewed-by: James Clark +Link: https://lore.kernel.org/all/20230929081540.yija47lsj35xtj4v@pengutronix.de/ +Link: https://lore.kernel.org/r/20230929081637.2377335-1-u.kleine-koenig@pengutronix.de +Signed-off-by: Suzuki K Poulose +Signed-off-by: Sasha Levin +--- + drivers/hwtracing/coresight/coresight-etm4x-core.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c +index e2cccd6ea1f1d..26d0d4485ae99 100644 +--- a/drivers/hwtracing/coresight/coresight-etm4x-core.c ++++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c +@@ -2041,7 +2041,7 @@ static void clear_etmdrvdata(void *info) + etmdrvdata[cpu] = NULL; + } + +-static void __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) ++static void etm4_remove_dev(struct etmv4_drvdata *drvdata) + { + etm_perf_symlink(drvdata->csdev, false); + /* +@@ -2064,7 +2064,7 @@ static void __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) + coresight_unregister(drvdata->csdev); + } + +-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); + +@@ -2072,7 +2072,7 @@ static void __exit etm4_remove_amba(struct amba_device *adev) + 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); + +-- +2.42.0 + diff --git a/queue-5.15/misc-mei-client.c-fix-problem-of-return-eoverflow-in.patch b/queue-5.15/misc-mei-client.c-fix-problem-of-return-eoverflow-in.patch new file mode 100644 index 00000000000..65eb488e515 --- /dev/null +++ b/queue-5.15/misc-mei-client.c-fix-problem-of-return-eoverflow-in.patch @@ -0,0 +1,38 @@ +From c4ea0c6edad9ac158155593d9289d08cbf969cb0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Nov 2023 17:55:26 +0800 +Subject: misc: mei: client.c: fix problem of return '-EOVERFLOW' in + mei_cl_write + +From: Su Hui + +[ Upstream commit ee6236027218f8531916f1c5caa5dc330379f287 ] + +Clang static analyzer complains that value stored to 'rets' is never +read.Let 'buf_len = -EOVERFLOW' to make sure we can return '-EOVERFLOW'. + +Fixes: 8c8d964ce90f ("mei: move hbuf_depth from the mei device to the hw modules") +Signed-off-by: Su Hui +Link: https://lore.kernel.org/r/20231120095523.178385-2-suhui@nfschina.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/misc/mei/client.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c +index 9fc58e4032295..d179273586be8 100644 +--- a/drivers/misc/mei/client.c ++++ b/drivers/misc/mei/client.c +@@ -1999,7 +1999,7 @@ ssize_t mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb) + + hbuf_slots = mei_hbuf_empty_slots(dev); + if (hbuf_slots < 0) { +- rets = -EOVERFLOW; ++ buf_len = -EOVERFLOW; + goto out; + } + +-- +2.42.0 + diff --git a/queue-5.15/misc-mei-client.c-return-negative-error-code-in-mei_.patch b/queue-5.15/misc-mei-client.c-return-negative-error-code-in-mei_.patch new file mode 100644 index 00000000000..0746fed13fe --- /dev/null +++ b/queue-5.15/misc-mei-client.c-return-negative-error-code-in-mei_.patch @@ -0,0 +1,37 @@ +From b87734ba73ee7264317ee5e06df6183acd346d41 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Nov 2023 17:55:23 +0800 +Subject: misc: mei: client.c: return negative error code in mei_cl_write + +From: Su Hui + +[ Upstream commit 8f06aee8089cf42fd99a20184501bd1347ce61b9 ] + +mei_msg_hdr_init() return negative error code, rets should be +'PTR_ERR(mei_hdr)' rather than '-PTR_ERR(mei_hdr)'. + +Fixes: 0cd7c01a60f8 ("mei: add support for mei extended header.") +Signed-off-by: Su Hui +Link: https://lore.kernel.org/r/20231120095523.178385-1-suhui@nfschina.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/misc/mei/client.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c +index 96f4e59c32a54..9fc58e4032295 100644 +--- a/drivers/misc/mei/client.c ++++ b/drivers/misc/mei/client.c +@@ -1975,7 +1975,7 @@ ssize_t mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb) + + 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; + } +-- +2.42.0 + diff --git a/queue-5.15/mm-fix-oops-when-filemap_map_pmd-without-prealloc_pt.patch b/queue-5.15/mm-fix-oops-when-filemap_map_pmd-without-prealloc_pt.patch new file mode 100644 index 00000000000..c3bbfacec89 --- /dev/null +++ b/queue-5.15/mm-fix-oops-when-filemap_map_pmd-without-prealloc_pt.patch @@ -0,0 +1,67 @@ +From ad7560171c6f2898fc8fa8e05730a978de531778 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Nov 2023 00:49:18 -0800 +Subject: mm: fix oops when filemap_map_pmd() without prealloc_pte +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Hugh Dickins + +[ Upstream commit 9aa1345d66b8132745ffb99b348b1492088da9e2 ] + +syzbot reports oops in lockdep's __lock_acquire(), called from +__pte_offset_map_lock() called from filemap_map_pages(); or when I run the +repro, the oops comes in pmd_install(), called from filemap_map_pmd() +called from filemap_map_pages(), just before the __pte_offset_map_lock(). + +The problem is that filemap_map_pmd() has been assuming that when it finds +pmd_none(), a page table has already been prepared in prealloc_pte; and +indeed do_fault_around() has been careful to preallocate one there, when +it finds pmd_none(): but what if *pmd became none in between? + +My 6.6 mods in mm/khugepaged.c, avoiding mmap_lock for write, have made it +easy for *pmd to be cleared while servicing a page fault; but even before +those, a huge *pmd might be zapped while a fault is serviced. + +The difference in symptomatic stack traces comes from the "memory model" +in use: pmd_install() uses pmd_populate() uses page_to_pfn(): in some +models that is strict, and will oops on the NULL prealloc_pte; in other +models, it will construct a bogus value to be populated into *pmd, then +__pte_offset_map_lock() oops when trying to access split ptlock pointer +(or some other symptom in normal case of ptlock embedded not pointer). + +Link: https://lore.kernel.org/linux-mm/20231115065506.19780-1-jose.pekkarinen@foxhound.fi/ +Link: https://lkml.kernel.org/r/6ed0c50c-78ef-0719-b3c5-60c0c010431c@google.com +Fixes: f9ce0be71d1f ("mm: Cleanup faultaround and finish_fault() codepaths") +Signed-off-by: Hugh Dickins +Reported-and-tested-by: syzbot+89edd67979b52675ddec@syzkaller.appspotmail.com +Closes: https://lore.kernel.org/linux-mm/0000000000005e44550608a0806c@google.com/ +Reviewed-by: David Hildenbrand +Cc: Jann Horn , +Cc: José Pekkarinen +Cc: Kirill A. Shutemov +Cc: Matthew Wilcox (Oracle) +Cc: [5.12+] +Signed-off-by: Andrew Morton +Signed-off-by: Sasha Levin +--- + mm/filemap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mm/filemap.c b/mm/filemap.c +index 179eb8066c9b3..e653f2ad5aed1 100644 +--- a/mm/filemap.c ++++ b/mm/filemap.c +@@ -3209,7 +3209,7 @@ static bool filemap_map_pmd(struct vm_fault *vmf, struct page *page) + } + } + +- if (pmd_none(*vmf->pmd)) ++ if (pmd_none(*vmf->pmd) && vmf->prealloc_pte) + pmd_install(mm, vmf->pmd, &vmf->prealloc_pte); + + /* See comment in handle_pte_fault() */ +-- +2.42.0 + diff --git a/queue-5.15/mm-introduce-pmd_install-helper.patch b/queue-5.15/mm-introduce-pmd_install-helper.patch new file mode 100644 index 00000000000..e4848a778f0 --- /dev/null +++ b/queue-5.15/mm-introduce-pmd_install-helper.patch @@ -0,0 +1,137 @@ +From ff6322441eedbfaa12d55c7d7024199b50945513 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 5 Nov 2021 13:38:38 -0700 +Subject: mm: introduce pmd_install() helper + +From: Qi Zheng + +[ Upstream commit 03c4f20454e0231d2cdec4373841a3a25cf4efed ] + +Patch series "Do some code cleanups related to mm", v3. + +This patch (of 2): + +Currently we have three times the same few lines repeated in the code. +Deduplicate them by newly introduced pmd_install() helper. + +Link: https://lkml.kernel.org/r/20210901102722.47686-1-zhengqi.arch@bytedance.com +Link: https://lkml.kernel.org/r/20210901102722.47686-2-zhengqi.arch@bytedance.com +Signed-off-by: Qi Zheng +Reviewed-by: David Hildenbrand +Reviewed-by: Muchun Song +Acked-by: Kirill A. Shutemov +Cc: Thomas Gleixner +Cc: Johannes Weiner +Cc: Michal Hocko +Cc: Vladimir Davydov +Cc: Mika Penttila +Cc: Vlastimil Babka +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Stable-dep-of: 9aa1345d66b8 ("mm: fix oops when filemap_map_pmd() without prealloc_pte") +Signed-off-by: Sasha Levin +--- + mm/filemap.c | 11 ++--------- + mm/internal.h | 1 + + mm/memory.c | 34 ++++++++++++++++------------------ + 3 files changed, 19 insertions(+), 27 deletions(-) + +diff --git a/mm/filemap.c b/mm/filemap.c +index 81e28722edfaf..179eb8066c9b3 100644 +--- a/mm/filemap.c ++++ b/mm/filemap.c +@@ -3209,15 +3209,8 @@ static bool filemap_map_pmd(struct vm_fault *vmf, struct page *page) + } + } + +- if (pmd_none(*vmf->pmd)) { +- vmf->ptl = pmd_lock(mm, vmf->pmd); +- if (likely(pmd_none(*vmf->pmd))) { +- mm_inc_nr_ptes(mm); +- pmd_populate(mm, vmf->pmd, vmf->prealloc_pte); +- vmf->prealloc_pte = NULL; +- } +- spin_unlock(vmf->ptl); +- } ++ if (pmd_none(*vmf->pmd)) ++ pmd_install(mm, vmf->pmd, &vmf->prealloc_pte); + + /* See comment in handle_pte_fault() */ + if (pmd_devmap_trans_unstable(vmf->pmd)) { +diff --git a/mm/internal.h b/mm/internal.h +index cf3cb933eba3f..6c3e1a9f8c5a6 100644 +--- a/mm/internal.h ++++ b/mm/internal.h +@@ -38,6 +38,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf); + + void free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *start_vma, + unsigned long floor, unsigned long ceiling); ++void pmd_install(struct mm_struct *mm, pmd_t *pmd, pgtable_t *pte); + + static inline bool can_madv_lru_vma(struct vm_area_struct *vma) + { +diff --git a/mm/memory.c b/mm/memory.c +index 1bb01b12db532..46fcc91604814 100644 +--- a/mm/memory.c ++++ b/mm/memory.c +@@ -433,9 +433,20 @@ void free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *vma, + } + } + ++void pmd_install(struct mm_struct *mm, pmd_t *pmd, pgtable_t *pte) ++{ ++ spinlock_t *ptl = pmd_lock(mm, pmd); ++ ++ if (likely(pmd_none(*pmd))) { /* Has another populated it ? */ ++ mm_inc_nr_ptes(mm); ++ pmd_populate(mm, pmd, *pte); ++ *pte = NULL; ++ } ++ spin_unlock(ptl); ++} ++ + int __pte_alloc(struct mm_struct *mm, pmd_t *pmd) + { +- spinlock_t *ptl; + pgtable_t new = pte_alloc_one(mm); + if (!new) + return -ENOMEM; +@@ -455,13 +466,7 @@ int __pte_alloc(struct mm_struct *mm, pmd_t *pmd) + */ + smp_wmb(); /* Could be smp_wmb__xxx(before|after)_spin_lock */ + +- ptl = pmd_lock(mm, pmd); +- if (likely(pmd_none(*pmd))) { /* Has another populated it ? */ +- mm_inc_nr_ptes(mm); +- pmd_populate(mm, pmd, new); +- new = NULL; +- } +- spin_unlock(ptl); ++ pmd_install(mm, pmd, &new); + if (new) + pte_free(mm, new); + return 0; +@@ -4085,17 +4090,10 @@ vm_fault_t finish_fault(struct vm_fault *vmf) + return ret; + } + +- if (vmf->prealloc_pte) { +- vmf->ptl = pmd_lock(vma->vm_mm, vmf->pmd); +- if (likely(pmd_none(*vmf->pmd))) { +- mm_inc_nr_ptes(vma->vm_mm); +- pmd_populate(vma->vm_mm, vmf->pmd, vmf->prealloc_pte); +- vmf->prealloc_pte = NULL; +- } +- spin_unlock(vmf->ptl); +- } else if (unlikely(pte_alloc(vma->vm_mm, vmf->pmd))) { ++ if (vmf->prealloc_pte) ++ pmd_install(vma->vm_mm, vmf->pmd, &vmf->prealloc_pte); ++ else if (unlikely(pte_alloc(vma->vm_mm, vmf->pmd))) + return VM_FAULT_OOM; +- } + } + + /* +-- +2.42.0 + diff --git a/queue-5.15/r8169-fix-rtl8125b-pause-frames-blasting-when-suspen.patch b/queue-5.15/r8169-fix-rtl8125b-pause-frames-blasting-when-suspen.patch new file mode 100644 index 00000000000..4f52842e1f6 --- /dev/null +++ b/queue-5.15/r8169-fix-rtl8125b-pause-frames-blasting-when-suspen.patch @@ -0,0 +1,74 @@ +From c20bab24f544bd42dc2f713987dd218900c10fda Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Nov 2023 23:53:50 +0800 +Subject: r8169: fix rtl8125b PAUSE frames blasting when suspended + +From: ChunHao Lin + +[ Upstream commit 4b0768b6556af56ee9b7cf4e68452a2b6289ae45 ] + +When FIFO reaches near full state, device will issue pause frame. +If pause slot is enabled(set to 1), in this time, device will issue +pause frame only once. But if pause slot is disabled(set to 0), device +will keep sending pause frames until FIFO reaches near empty state. + +When pause slot is disabled, if there is no one to handle receive +packets, device FIFO will reach near full state and keep sending +pause frames. That will impact entire local area network. + +This issue can be reproduced in Chromebox (not Chromebook) in +developer mode running a test image (and v5.10 kernel): +1) ping -f $CHROMEBOX (from workstation on same local network) +2) run "powerd_dbus_suspend" from command line on the $CHROMEBOX +3) ping $ROUTER (wait until ping fails from workstation) + +Takes about ~20-30 seconds after step 2 for the local network to +stop working. + +Fix this issue by enabling pause slot to only send pause frame once +when FIFO reaches near full state. + +Fixes: f1bce4ad2f1c ("r8169: add support for RTL8125") +Reported-by: Grant Grundler +Tested-by: Grant Grundler +Cc: stable@vger.kernel.org +Signed-off-by: ChunHao Lin +Reviewed-by: Jacob Keller +Reviewed-by: Heiner Kallweit +Link: https://lore.kernel.org/r/20231129155350.5843-1-hau@realtek.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/realtek/r8169_main.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c +index d2fbd169f25b9..c0a339ff43a6b 100644 +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -205,6 +205,7 @@ enum rtl_registers { + /* 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) +@@ -2268,9 +2269,13 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp) + 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_60 ... 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; +-- +2.42.0 + diff --git a/queue-5.15/ring-buffer-force-absolute-timestamp-on-discard-of-e.patch b/queue-5.15/ring-buffer-force-absolute-timestamp-on-discard-of-e.patch new file mode 100644 index 00000000000..bc22bb145c5 --- /dev/null +++ b/queue-5.15/ring-buffer-force-absolute-timestamp-on-discard-of-e.patch @@ -0,0 +1,71 @@ +From b8adf326def20887f03dca72fe3d3ed231ab3145 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Dec 2023 10:02:44 -0500 +Subject: ring-buffer: Force absolute timestamp on discard of event + +From: Steven Rostedt (Google) + +[ Upstream commit b2dd797543cfa6580eac8408dd67fa02164d9e56 ] + +There's a race where if an event is discarded from the ring buffer and an +interrupt were to happen at that time and insert an event, the time stamp +is still used from the discarded event as an offset. This can screw up the +timings. + +If the event is going to be discarded, set the "before_stamp" to zero. +When a new event comes in, it compares the "before_stamp" with the +"write_stamp" and if they are not equal, it will insert an absolute +timestamp. This will prevent the timings from getting out of sync due to +the discarded event. + +Link: https://lore.kernel.org/linux-trace-kernel/20231206100244.5130f9b3@gandalf.local.home + +Cc: stable@vger.kernel.org +Cc: Masami Hiramatsu +Cc: Mark Rutland +Cc: Mathieu Desnoyers +Fixes: 6f6be606e763f ("ring-buffer: Force before_stamp and write_stamp to be different on discard") +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Sasha Levin +--- + kernel/trace/ring_buffer.c | 19 ++++++++----------- + 1 file changed, 8 insertions(+), 11 deletions(-) + +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c +index a930a9d7d834d..16fce72a7601c 100644 +--- a/kernel/trace/ring_buffer.c ++++ b/kernel/trace/ring_buffer.c +@@ -2982,22 +2982,19 @@ rb_try_to_discard(struct ring_buffer_per_cpu *cpu_buffer, + 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 0; + +- /* +- * 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 +-- +2.42.0 + diff --git a/queue-5.15/series b/queue-5.15/series index 98bb4f5ec98..f79ccd17a6c 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -96,3 +96,17 @@ arm64-dts-mediatek-mt8183-fix-unit-address-for-scp-reserved-memory.patch binder-fix-memory-leaks-of-spam-and-pending-work.patch kallsyms-make-kallsyms_on_each_symbol-generally-avai.patch tracing-kprobes-return-eaddrnotavail-when-func-match.patch +coresight-etm4x-make-etm4_remove_dev-return-void.patch +coresight-etm4x-remove-bogous-__exit-annotation-for-.patch +misc-mei-client.c-return-negative-error-code-in-mei_.patch +misc-mei-client.c-fix-problem-of-return-eoverflow-in.patch +ring-buffer-force-absolute-timestamp-on-discard-of-e.patch +tracing-set-actual-size-after-ring-buffer-resize.patch +tracing-stop-current-tracer-when-resizing-buffer.patch +r8169-fix-rtl8125b-pause-frames-blasting-when-suspen.patch +mm-introduce-pmd_install-helper.patch +mm-fix-oops-when-filemap_map_pmd-without-prealloc_pt.patch +arm64-dts-mediatek-align-thermal-zone-node-names-wit.patch +arm64-dts-mediatek-mt8183-move-thermal-zones-to-the-.patch +arm64-dts-mediatek-add-missing-space-before.patch +arm64-dts-mt8183-kukui-fix-underscores-in-node-names.patch diff --git a/queue-5.15/tracing-set-actual-size-after-ring-buffer-resize.patch b/queue-5.15/tracing-set-actual-size-after-ring-buffer-resize.patch new file mode 100644 index 00000000000..09dd324444d --- /dev/null +++ b/queue-5.15/tracing-set-actual-size-after-ring-buffer-resize.patch @@ -0,0 +1,70 @@ +From 175023fde4b0ed08e81335c40052bfc18da0dbd9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Jul 2023 08:27:05 +0800 +Subject: tracing: Set actual size after ring buffer resize + +From: Zheng Yejian + +[ Upstream commit 6d98a0f2ac3c021d21be66fa34e992137cd25bcb ] + +Currently we can resize trace ringbuffer by writing a value into file +'buffer_size_kb', then by reading the file, we get the value that is +usually what we wrote. However, this value may be not actual size of +trace ring buffer because of the round up when doing resize in kernel, +and the actual size would be more useful. + +Link: https://lore.kernel.org/linux-trace-kernel/20230705002705.576633-1-zhengyejian1@huawei.com + +Cc: +Signed-off-by: Zheng Yejian +Signed-off-by: Steven Rostedt (Google) +Stable-dep-of: d78ab792705c ("tracing: Stop current tracer when resizing buffer") +Signed-off-by: Sasha Levin +--- + kernel/trace/trace.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index dc35f9150af7a..049daa6a9ad42 100644 +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -6190,6 +6190,15 @@ static void set_buffer_entries(struct array_buffer *buf, unsigned long val) + 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, +@@ -6267,18 +6276,12 @@ static int __tracing_resize_ring_buffer(struct trace_array *tr, + return ret; + } + +- 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); + + return ret; + } +-- +2.42.0 + diff --git a/queue-5.15/tracing-stop-current-tracer-when-resizing-buffer.patch b/queue-5.15/tracing-stop-current-tracer-when-resizing-buffer.patch new file mode 100644 index 00000000000..808dea76280 --- /dev/null +++ b/queue-5.15/tracing-stop-current-tracer-when-resizing-buffer.patch @@ -0,0 +1,73 @@ +From 655a00cb0dbef586b2def7ce6eea039b8cb99163 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 5 Dec 2023 16:52:10 -0500 +Subject: tracing: Stop current tracer when resizing buffer + +From: Steven Rostedt (Google) + +[ Upstream commit d78ab792705c7be1b91243b2544d1a79406a2ad7 ] + +When the ring buffer is being resized, it can cause side effects to the +running tracer. For instance, there's a race with irqsoff tracer that +swaps individual per cpu buffers between the main buffer and the snapshot +buffer. The resize operation modifies the main buffer and then the +snapshot buffer. If a swap happens in between those two operations it will +break the tracer. + +Simply stop the running tracer before resizing the buffers and enable it +again when finished. + +Link: https://lkml.kernel.org/r/20231205220010.748996423@goodmis.org + +Cc: stable@vger.kernel.org +Cc: Masami Hiramatsu +Cc: Mark Rutland +Cc: Mathieu Desnoyers +Cc: Andrew Morton +Fixes: 3928a8a2d9808 ("ftrace: make work with new ring buffer") +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Sasha Levin +--- + kernel/trace/trace.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 049daa6a9ad42..657ecb8f03545 100644 +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -6243,9 +6243,12 @@ static int __tracing_resize_ring_buffer(struct trace_array *tr, + 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->current_trace->use_max_tr) +@@ -6273,7 +6276,7 @@ static int __tracing_resize_ring_buffer(struct trace_array *tr, + WARN_ON(1); + tracing_disabled = 1; + } +- return ret; ++ goto out_start; + } + + update_buffer_entries(&tr->max_buffer, cpu); +@@ -6282,7 +6285,8 @@ static int __tracing_resize_ring_buffer(struct trace_array *tr, + #endif /* CONFIG_TRACER_MAX_TRACE */ + + update_buffer_entries(&tr->array_buffer, cpu); +- ++ out_start: ++ tracing_start_tr(tr); + return ret; + } + +-- +2.42.0 + -- 2.47.3