]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 10:45:39 +0000 (12:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 10:45:39 +0000 (12:45 +0200)
added patches:
arm-cns3xxx-fix-refcount-leak-in-cns3xxx_init.patch
arm-dts-bcm2711-rpi-400-fix-gpio-line-names.patch
arm-dts-imx6qdl-correct-pu-regulator-ramp-delay.patch
arm-dts-imx7-move-hsic_phy-power-domain-to-hsic-phy-node.patch
arm-exynos-fix-refcount-leak-in-exynos_map_pmu.patch
arm-fix-refcount-leak-in-axxia_boot_secondary.patch
arm64-dts-exynos-correct-uart-clocks-on-exynos7885.patch
arm64-dts-ti-k3-am64-main-remove-support-for-hs400-speed-mode.patch
dma-direct-use-the-correct-size-for-dma_set_encrypted.patch
kbuild-link-vmlinux-only-once-for-config_trim_unused_ksyms-2nd-attempt.patch
memory-mtk-smi-add-missing-put_device-call-in-mtk_smi_device_link_common.patch
memory-samsung-exynos5422-dmc-fix-refcount-leak-in-of_get_dram_timings.patch
modpost-fix-section-mismatch-check-for-exported-init-exit-sections.patch
perf-build-id-fix-caching-files-with-a-wrong-build-id.patch
random-update-comment-from-copy_to_user-copy_to_iter.patch
smb3-fix-empty-netname-context-on-secondary-channels.patch
smb3-use-netname-when-available-on-secondary-channels.patch
soc-bcm-brcmstb-pm-pm-arm-fix-refcount-leak-in-brcmstb_pm_probe.patch

19 files changed:
queue-5.18/arm-cns3xxx-fix-refcount-leak-in-cns3xxx_init.patch [new file with mode: 0644]
queue-5.18/arm-dts-bcm2711-rpi-400-fix-gpio-line-names.patch [new file with mode: 0644]
queue-5.18/arm-dts-imx6qdl-correct-pu-regulator-ramp-delay.patch [new file with mode: 0644]
queue-5.18/arm-dts-imx7-move-hsic_phy-power-domain-to-hsic-phy-node.patch [new file with mode: 0644]
queue-5.18/arm-exynos-fix-refcount-leak-in-exynos_map_pmu.patch [new file with mode: 0644]
queue-5.18/arm-fix-refcount-leak-in-axxia_boot_secondary.patch [new file with mode: 0644]
queue-5.18/arm64-dts-exynos-correct-uart-clocks-on-exynos7885.patch [new file with mode: 0644]
queue-5.18/arm64-dts-ti-k3-am64-main-remove-support-for-hs400-speed-mode.patch [new file with mode: 0644]
queue-5.18/dma-direct-use-the-correct-size-for-dma_set_encrypted.patch [new file with mode: 0644]
queue-5.18/kbuild-link-vmlinux-only-once-for-config_trim_unused_ksyms-2nd-attempt.patch [new file with mode: 0644]
queue-5.18/memory-mtk-smi-add-missing-put_device-call-in-mtk_smi_device_link_common.patch [new file with mode: 0644]
queue-5.18/memory-samsung-exynos5422-dmc-fix-refcount-leak-in-of_get_dram_timings.patch [new file with mode: 0644]
queue-5.18/modpost-fix-section-mismatch-check-for-exported-init-exit-sections.patch [new file with mode: 0644]
queue-5.18/perf-build-id-fix-caching-files-with-a-wrong-build-id.patch [new file with mode: 0644]
queue-5.18/random-update-comment-from-copy_to_user-copy_to_iter.patch [new file with mode: 0644]
queue-5.18/series
queue-5.18/smb3-fix-empty-netname-context-on-secondary-channels.patch [new file with mode: 0644]
queue-5.18/smb3-use-netname-when-available-on-secondary-channels.patch [new file with mode: 0644]
queue-5.18/soc-bcm-brcmstb-pm-pm-arm-fix-refcount-leak-in-brcmstb_pm_probe.patch [new file with mode: 0644]

diff --git a/queue-5.18/arm-cns3xxx-fix-refcount-leak-in-cns3xxx_init.patch b/queue-5.18/arm-cns3xxx-fix-refcount-leak-in-cns3xxx_init.patch
new file mode 100644 (file)
index 0000000..45203ea
--- /dev/null
@@ -0,0 +1,40 @@
+From 1ba904b6b16e08de5aed7c1349838d9cd0d178c5 Mon Sep 17 00:00:00 2001
+From: Miaoqian Lin <linmq006@gmail.com>
+Date: Sun, 5 Jun 2022 11:58:41 +0400
+Subject: ARM: cns3xxx: Fix refcount leak in cns3xxx_init
+
+From: Miaoqian Lin <linmq006@gmail.com>
+
+commit 1ba904b6b16e08de5aed7c1349838d9cd0d178c5 upstream.
+
+of_find_compatible_node() returns a node pointer with refcount
+incremented, we should use of_node_put() on it when done.
+Add missing of_node_put() to avoid refcount leak.
+
+Fixes: 415f59142d9d ("ARM: cns3xxx: initial DT support")
+Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
+Acked-by: Krzysztof Halasa <khalasa@piap.pl>
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm/mach-cns3xxx/core.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/arm/mach-cns3xxx/core.c
++++ b/arch/arm/mach-cns3xxx/core.c
+@@ -372,6 +372,7 @@ static void __init cns3xxx_init(void)
+               /* De-Asscer SATA Reset */
+               cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA));
+       }
++      of_node_put(dn);
+       dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci");
+       if (of_device_is_available(dn)) {
+@@ -385,6 +386,7 @@ static void __init cns3xxx_init(void)
+               cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
+               cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO));
+       }
++      of_node_put(dn);
+       pm_power_off = cns3xxx_power_off;
diff --git a/queue-5.18/arm-dts-bcm2711-rpi-400-fix-gpio-line-names.patch b/queue-5.18/arm-dts-bcm2711-rpi-400-fix-gpio-line-names.patch
new file mode 100644 (file)
index 0000000..d52d8ea
--- /dev/null
@@ -0,0 +1,39 @@
+From b9b6d4c925604b70d007feb4c77b8cc4c038d2da Mon Sep 17 00:00:00 2001
+From: Stefan Wahren <stefan.wahren@i2se.com>
+Date: Wed, 15 Jun 2022 23:05:34 +0200
+Subject: ARM: dts: bcm2711-rpi-400: Fix GPIO line names
+
+From: Stefan Wahren <stefan.wahren@i2se.com>
+
+commit b9b6d4c925604b70d007feb4c77b8cc4c038d2da upstream.
+
+The GPIO expander line names has been fixed in the vendor tree last year,
+so upstream these changes.
+
+Fixes: 1c701accecf2 ("ARM: dts: Add Raspberry Pi 400 support")
+Reported-by: Ivan T. Ivanov <iivanov@suse.de>
+Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm/boot/dts/bcm2711-rpi-400.dts |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2711-rpi-400.dts
++++ b/arch/arm/boot/dts/bcm2711-rpi-400.dts
+@@ -28,12 +28,12 @@
+ &expgpio {
+       gpio-line-names = "BT_ON",
+                         "WL_ON",
+-                        "",
++                        "PWR_LED_OFF",
+                         "GLOBAL_RESET",
+                         "VDD_SD_IO_SEL",
+-                        "CAM_GPIO",
++                        "GLOBAL_SHUTDOWN",
+                         "SD_PWR_ON",
+-                        "SD_OC_N";
++                        "SHUTDOWN_REQUEST";
+ };
+ &genet_mdio {
diff --git a/queue-5.18/arm-dts-imx6qdl-correct-pu-regulator-ramp-delay.patch b/queue-5.18/arm-dts-imx6qdl-correct-pu-regulator-ramp-delay.patch
new file mode 100644 (file)
index 0000000..be67ae6
--- /dev/null
@@ -0,0 +1,47 @@
+From 93a8ba2a619816d631bd69e9ce2172b4d7a481b8 Mon Sep 17 00:00:00 2001
+From: Lucas Stach <l.stach@pengutronix.de>
+Date: Wed, 11 May 2022 18:08:23 +0200
+Subject: ARM: dts: imx6qdl: correct PU regulator ramp delay
+
+From: Lucas Stach <l.stach@pengutronix.de>
+
+commit 93a8ba2a619816d631bd69e9ce2172b4d7a481b8 upstream.
+
+Contrary to what was believed at the time, the ramp delay of 150us is not
+plenty for the PU LDO with the default step time of 512 pulses of the 24MHz
+clock. Measurements have shown that after enabling the LDO the voltage on
+VDDPU_CAP jumps to ~750mV in the first step and after that the regulator
+executes the normal ramp up as defined by the step size control.
+
+This means it takes the regulator between 360us and 370us to ramp up to
+the nominal 1.15V voltage for this power domain. With the old setting of
+the ramp delay the power up of the PU GPC domain would happen in the middle
+of the regulator ramp with the voltage being at around 900mV. Apparently
+this was enough for most units to properly power up the peripherals in the
+domain and execute the reset. Some units however, fail to power up properly,
+especially when the chip is at a low temperature. In that case any access
+to the GPU registers would yield an incorrect result with no way to recover
+from this situation.
+
+Change the ramp delay to 380us to cover the measured ramp up time with a
+bit of additional slack.
+
+Fixes: 40130d327f72 ("ARM: dts: imx6qdl: Allow disabling the PU regulator, add a enable ramp delay")
+Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm/boot/dts/imx6qdl.dtsi |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/imx6qdl.dtsi
++++ b/arch/arm/boot/dts/imx6qdl.dtsi
+@@ -762,7 +762,7 @@
+                                       regulator-name = "vddpu";
+                                       regulator-min-microvolt = <725000>;
+                                       regulator-max-microvolt = <1450000>;
+-                                      regulator-enable-ramp-delay = <150>;
++                                      regulator-enable-ramp-delay = <380>;
+                                       anatop-reg-offset = <0x140>;
+                                       anatop-vol-bit-shift = <9>;
+                                       anatop-vol-bit-width = <5>;
diff --git a/queue-5.18/arm-dts-imx7-move-hsic_phy-power-domain-to-hsic-phy-node.patch b/queue-5.18/arm-dts-imx7-move-hsic_phy-power-domain-to-hsic-phy-node.patch
new file mode 100644 (file)
index 0000000..b00ae90
--- /dev/null
@@ -0,0 +1,41 @@
+From 552ca27929ab28b341ae9b2629f0de3a84c98ee8 Mon Sep 17 00:00:00 2001
+From: Alexander Stein <alexander.stein@ew.tq-group.com>
+Date: Tue, 10 May 2022 07:46:12 +0200
+Subject: ARM: dts: imx7: Move hsic_phy power domain to HSIC PHY node
+
+From: Alexander Stein <alexander.stein@ew.tq-group.com>
+
+commit 552ca27929ab28b341ae9b2629f0de3a84c98ee8 upstream.
+
+Move the power domain to its actual user. This keeps the power domain
+enabled even when the USB host is runtime suspended. This is necessary
+to detect any downstream events, like device attach.
+
+Fixes: 02f8eb40ef7b ("ARM: dts: imx7s: Add power domain for imx7d HSIC")
+Suggested-by: Jun Li <jun.li@nxp.com>
+Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
+Reviewed-by: Fabio Estevam <festevam@gmail.com>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm/boot/dts/imx7s.dtsi |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/imx7s.dtsi
++++ b/arch/arm/boot/dts/imx7s.dtsi
+@@ -120,6 +120,7 @@
+               compatible = "usb-nop-xceiv";
+               clocks = <&clks IMX7D_USB_HSIC_ROOT_CLK>;
+               clock-names = "main_clk";
++              power-domains = <&pgc_hsic_phy>;
+               #phy-cells = <0>;
+       };
+@@ -1153,7 +1154,6 @@
+                               compatible = "fsl,imx7d-usb", "fsl,imx27-usb";
+                               reg = <0x30b30000 0x200>;
+                               interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+-                              power-domains = <&pgc_hsic_phy>;
+                               clocks = <&clks IMX7D_USB_CTRL_CLK>;
+                               fsl,usbphy = <&usbphynop3>;
+                               fsl,usbmisc = <&usbmisc3 0>;
diff --git a/queue-5.18/arm-exynos-fix-refcount-leak-in-exynos_map_pmu.patch b/queue-5.18/arm-exynos-fix-refcount-leak-in-exynos_map_pmu.patch
new file mode 100644 (file)
index 0000000..ca6a5bf
--- /dev/null
@@ -0,0 +1,33 @@
+From c4c79525042a4a7df96b73477feaf232fe44ae81 Mon Sep 17 00:00:00 2001
+From: Miaoqian Lin <linmq006@gmail.com>
+Date: Mon, 23 May 2022 18:55:13 +0400
+Subject: ARM: exynos: Fix refcount leak in exynos_map_pmu
+
+From: Miaoqian Lin <linmq006@gmail.com>
+
+commit c4c79525042a4a7df96b73477feaf232fe44ae81 upstream.
+
+of_find_matching_node() returns a node pointer with refcount
+incremented, we should use of_node_put() on it when not need anymore.
+Add missing of_node_put() to avoid refcount leak.
+of_node_put() checks null pointer.
+
+Fixes: fce9e5bb2526 ("ARM: EXYNOS: Add support for mapping PMU base address via DT")
+Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
+Link: https://lore.kernel.org/r/20220523145513.12341-1-linmq006@gmail.com
+Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm/mach-exynos/exynos.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm/mach-exynos/exynos.c
++++ b/arch/arm/mach-exynos/exynos.c
+@@ -149,6 +149,7 @@ static void exynos_map_pmu(void)
+       np = of_find_matching_node(NULL, exynos_dt_pmu_match);
+       if (np)
+               pmu_base_addr = of_iomap(np, 0);
++      of_node_put(np);
+ }
+ static void __init exynos_init_irq(void)
diff --git a/queue-5.18/arm-fix-refcount-leak-in-axxia_boot_secondary.patch b/queue-5.18/arm-fix-refcount-leak-in-axxia_boot_secondary.patch
new file mode 100644 (file)
index 0000000..02c195e
--- /dev/null
@@ -0,0 +1,32 @@
+From 7c7ff68daa93d8c4cdea482da4f2429c0398fcde Mon Sep 17 00:00:00 2001
+From: Miaoqian Lin <linmq006@gmail.com>
+Date: Wed, 1 Jun 2022 13:05:48 +0400
+Subject: ARM: Fix refcount leak in axxia_boot_secondary
+
+From: Miaoqian Lin <linmq006@gmail.com>
+
+commit 7c7ff68daa93d8c4cdea482da4f2429c0398fcde upstream.
+
+of_find_compatible_node() returns a node pointer with refcount
+incremented, we should use of_node_put() on it when done.
+Add missing of_node_put() to avoid refcount leak.
+
+Fixes: 1d22924e1c4e ("ARM: Add platform support for LSI AXM55xx SoC")
+Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
+Link: https://lore.kernel.org/r/20220601090548.47616-1-linmq006@gmail.com'
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm/mach-axxia/platsmp.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm/mach-axxia/platsmp.c
++++ b/arch/arm/mach-axxia/platsmp.c
+@@ -39,6 +39,7 @@ static int axxia_boot_secondary(unsigned
+               return -ENOENT;
+       syscon = of_iomap(syscon_np, 0);
++      of_node_put(syscon_np);
+       if (!syscon)
+               return -ENOMEM;
diff --git a/queue-5.18/arm64-dts-exynos-correct-uart-clocks-on-exynos7885.patch b/queue-5.18/arm64-dts-exynos-correct-uart-clocks-on-exynos7885.patch
new file mode 100644 (file)
index 0000000..0fe8e35
--- /dev/null
@@ -0,0 +1,64 @@
+From f84d83d8165570380f55f4ce578bfb131a9266c5 Mon Sep 17 00:00:00 2001
+From: David Virag <virag.david003@gmail.com>
+Date: Thu, 26 May 2022 07:58:40 +0200
+Subject: arm64: dts: exynos: Correct UART clocks on Exynos7885
+
+From: David Virag <virag.david003@gmail.com>
+
+commit f84d83d8165570380f55f4ce578bfb131a9266c5 upstream.
+
+The clocks in the serial UART nodes were swapped by mistake on
+Exynos7885. This only worked correctly because of a mistake in the clock
+driver which has been fixed. With the fixed clock driver in place, the
+baudrate of the UARTs get miscalculated. Fix this by correcting the
+clocks in the dtsi.
+
+Fixes: 06874015327b ("arm64: dts: exynos: Add initial device tree support for Exynos7885 SoC")
+Signed-off-by: David Virag <virag.david003@gmail.com>
+Link: https://lore.kernel.org/r/20220526055840.45209-3-virag.david003@gmail.com
+Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/boot/dts/exynos/exynos7885.dtsi | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/exynos/exynos7885.dtsi b/arch/arm64/boot/dts/exynos/exynos7885.dtsi
+index 3170661f5b67..9c233c56558c 100644
+--- a/arch/arm64/boot/dts/exynos/exynos7885.dtsi
++++ b/arch/arm64/boot/dts/exynos/exynos7885.dtsi
+@@ -280,8 +280,8 @@ serial_0: serial@13800000 {
+                       interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&uart0_bus>;
+-                      clocks = <&cmu_peri CLK_GOUT_UART0_EXT_UCLK>,
+-                               <&cmu_peri CLK_GOUT_UART0_PCLK>;
++                      clocks = <&cmu_peri CLK_GOUT_UART0_PCLK>,
++                               <&cmu_peri CLK_GOUT_UART0_EXT_UCLK>;
+                       clock-names = "uart", "clk_uart_baud0";
+                       samsung,uart-fifosize = <64>;
+                       status = "disabled";
+@@ -293,8 +293,8 @@ serial_1: serial@13810000 {
+                       interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&uart1_bus>;
+-                      clocks = <&cmu_peri CLK_GOUT_UART1_EXT_UCLK>,
+-                               <&cmu_peri CLK_GOUT_UART1_PCLK>;
++                      clocks = <&cmu_peri CLK_GOUT_UART1_PCLK>,
++                               <&cmu_peri CLK_GOUT_UART1_EXT_UCLK>;
+                       clock-names = "uart", "clk_uart_baud0";
+                       samsung,uart-fifosize = <256>;
+                       status = "disabled";
+@@ -306,8 +306,8 @@ serial_2: serial@13820000 {
+                       interrupts = <GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&uart2_bus>;
+-                      clocks = <&cmu_peri CLK_GOUT_UART2_EXT_UCLK>,
+-                               <&cmu_peri CLK_GOUT_UART2_PCLK>;
++                      clocks = <&cmu_peri CLK_GOUT_UART2_PCLK>,
++                               <&cmu_peri CLK_GOUT_UART2_EXT_UCLK>;
+                       clock-names = "uart", "clk_uart_baud0";
+                       samsung,uart-fifosize = <256>;
+                       status = "disabled";
+-- 
+2.36.1
+
diff --git a/queue-5.18/arm64-dts-ti-k3-am64-main-remove-support-for-hs400-speed-mode.patch b/queue-5.18/arm64-dts-ti-k3-am64-main-remove-support-for-hs400-speed-mode.patch
new file mode 100644 (file)
index 0000000..f04de5e
--- /dev/null
@@ -0,0 +1,43 @@
+From 0c0af88f3f318e73237f7fadd02d0bf2b6c996bb Mon Sep 17 00:00:00 2001
+From: Aswath Govindraju <a-govindraju@ti.com>
+Date: Thu, 12 May 2022 12:18:58 +0530
+Subject: arm64: dts: ti: k3-am64-main: Remove support for HS400 speed mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Aswath Govindraju <a-govindraju@ti.com>
+
+commit 0c0af88f3f318e73237f7fadd02d0bf2b6c996bb upstream.
+
+AM64 SoC, does not support HS400 and HS200 is the maximum supported speed
+mode[1]. Therefore, fix the device tree node to reflect the same.
+
+[1] - https://www.ti.com/lit/ds/symlink/am6442.pdf
+      (SPRSP56C â€“ JANUARY 2021 â€“ REVISED FEBRUARY 2022)
+
+Fixes: 8abae9389bdb ("arm64: dts: ti: Add support for AM642 SoC")
+Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Link: https://lore.kernel.org/r/20220512064859.32059-1-a-govindraju@ti.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/boot/dts/ti/k3-am64-main.dtsi |    2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
++++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
+@@ -456,13 +456,11 @@
+               clock-names = "clk_ahb", "clk_xin";
+               mmc-ddr-1_8v;
+               mmc-hs200-1_8v;
+-              mmc-hs400-1_8v;
+               ti,trm-icp = <0x2>;
+               ti,otap-del-sel-legacy = <0x0>;
+               ti,otap-del-sel-mmc-hs = <0x0>;
+               ti,otap-del-sel-ddr52 = <0x6>;
+               ti,otap-del-sel-hs200 = <0x7>;
+-              ti,otap-del-sel-hs400 = <0x4>;
+       };
+       sdhci1: mmc@fa00000 {
diff --git a/queue-5.18/dma-direct-use-the-correct-size-for-dma_set_encrypted.patch b/queue-5.18/dma-direct-use-the-correct-size-for-dma_set_encrypted.patch
new file mode 100644 (file)
index 0000000..1167366
--- /dev/null
@@ -0,0 +1,49 @@
+From 3be4562584bba603f33863a00c1c32eecf772ee6 Mon Sep 17 00:00:00 2001
+From: Dexuan Cui <decui@microsoft.com>
+Date: Wed, 22 Jun 2022 12:14:24 -0700
+Subject: dma-direct: use the correct size for dma_set_encrypted()
+
+From: Dexuan Cui <decui@microsoft.com>
+
+commit 3be4562584bba603f33863a00c1c32eecf772ee6 upstream.
+
+The third parameter of dma_set_encrypted() is a size in bytes rather than
+the number of pages.
+
+Fixes: 4d0564785bb0 ("dma-direct: factor out dma_set_{de,en}crypted helpers")
+Signed-off-by: Dexuan Cui <decui@microsoft.com>
+Reviewed-by: Robin Murphy <robin.murphy@arm.com>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/dma/direct.c |    5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/kernel/dma/direct.c
++++ b/kernel/dma/direct.c
+@@ -357,7 +357,7 @@ void dma_direct_free(struct device *dev,
+       } else {
+               if (IS_ENABLED(CONFIG_ARCH_HAS_DMA_CLEAR_UNCACHED))
+                       arch_dma_clear_uncached(cpu_addr, size);
+-              if (dma_set_encrypted(dev, cpu_addr, 1 << page_order))
++              if (dma_set_encrypted(dev, cpu_addr, size))
+                       return;
+       }
+@@ -392,7 +392,6 @@ void dma_direct_free_pages(struct device
+               struct page *page, dma_addr_t dma_addr,
+               enum dma_data_direction dir)
+ {
+-      unsigned int page_order = get_order(size);
+       void *vaddr = page_address(page);
+       /* If cpu_addr is not from an atomic pool, dma_free_from_pool() fails */
+@@ -400,7 +399,7 @@ void dma_direct_free_pages(struct device
+           dma_free_from_pool(dev, vaddr, size))
+               return;
+-      if (dma_set_encrypted(dev, vaddr, 1 << page_order))
++      if (dma_set_encrypted(dev, vaddr, size))
+               return;
+       __dma_direct_free_pages(dev, page, size);
+ }
diff --git a/queue-5.18/kbuild-link-vmlinux-only-once-for-config_trim_unused_ksyms-2nd-attempt.patch b/queue-5.18/kbuild-link-vmlinux-only-once-for-config_trim_unused_ksyms-2nd-attempt.patch
new file mode 100644 (file)
index 0000000..6893b34
--- /dev/null
@@ -0,0 +1,49 @@
+From 53632ba87d9f302a8d97a11ec2f4f4eec7bb75ea Mon Sep 17 00:00:00 2001
+From: Masahiro Yamada <masahiroy@kernel.org>
+Date: Fri, 24 Jun 2022 04:11:47 +0900
+Subject: kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS (2nd attempt)
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+commit 53632ba87d9f302a8d97a11ec2f4f4eec7bb75ea upstream.
+
+If CONFIG_TRIM_UNUSED_KSYMS is enabled and the kernel is built from
+a pristine state, the vmlinux is linked twice.
+
+Commit 3fdc7d3fe4c0 ("kbuild: link vmlinux only once for
+CONFIG_TRIM_UNUSED_KSYMS") explains why this happens, but it did not fix
+the issue at all.
+
+Now I realized I had applied a wrong patch.
+
+In v1 patch [1], the autoksyms_recursive target correctly recurses to
+"$(MAKE) -f $(srctree)/Makefile autoksyms_recursive".
+
+In v2 patch [2], I accidentally dropped the diff line, and it recurses to
+"$(MAKE) -f $(srctree)/Makefile vmlinux".
+
+Restore the code I intended in v1.
+
+[1]: https://lore.kernel.org/linux-kbuild/1521045861-22418-8-git-send-email-yamada.masahiro@socionext.com/
+[2]: https://lore.kernel.org/linux-kbuild/1521166725-24157-8-git-send-email-yamada.masahiro@socionext.com/
+
+Fixes: 3fdc7d3fe4c0 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS")
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Tested-by: Sami Tolvanen <samitolvanen@google.com>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -1139,7 +1139,7 @@ KBUILD_MODULES := 1
+ autoksyms_recursive: descend modules.order
+       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
+-        "$(MAKE) -f $(srctree)/Makefile vmlinux"
++        "$(MAKE) -f $(srctree)/Makefile autoksyms_recursive"
+ endif
+ autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)
diff --git a/queue-5.18/memory-mtk-smi-add-missing-put_device-call-in-mtk_smi_device_link_common.patch b/queue-5.18/memory-mtk-smi-add-missing-put_device-call-in-mtk_smi_device_link_common.patch
new file mode 100644 (file)
index 0000000..f312799
--- /dev/null
@@ -0,0 +1,47 @@
+From 038ae37c510fd57cbc543ac82db1e7b23b28557a Mon Sep 17 00:00:00 2001
+From: Miaoqian Lin <linmq006@gmail.com>
+Date: Wed, 1 Jun 2022 16:01:18 +0400
+Subject: memory: mtk-smi: add missing put_device() call in mtk_smi_device_link_common
+
+From: Miaoqian Lin <linmq006@gmail.com>
+
+commit 038ae37c510fd57cbc543ac82db1e7b23b28557a upstream.
+
+The reference taken by 'of_find_device_by_node()' must be released when
+not needed anymore.
+Add the corresponding 'put_device()' in the error handling paths.
+
+Fixes: 47404757702e ("memory: mtk-smi: Add device link for smi-sub-common")
+Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
+Link: https://lore.kernel.org/r/20220601120118.60225-1-linmq006@gmail.com
+Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/memory/mtk-smi.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
+index 86a3d34f418e..4c5154e0bf00 100644
+--- a/drivers/memory/mtk-smi.c
++++ b/drivers/memory/mtk-smi.c
+@@ -404,13 +404,16 @@ static int mtk_smi_device_link_common(struct device *dev, struct device **com_de
+       of_node_put(smi_com_node);
+       if (smi_com_pdev) {
+               /* smi common is the supplier, Make sure it is ready before */
+-              if (!platform_get_drvdata(smi_com_pdev))
++              if (!platform_get_drvdata(smi_com_pdev)) {
++                      put_device(&smi_com_pdev->dev);
+                       return -EPROBE_DEFER;
++              }
+               smi_com_dev = &smi_com_pdev->dev;
+               link = device_link_add(dev, smi_com_dev,
+                                      DL_FLAG_PM_RUNTIME | DL_FLAG_STATELESS);
+               if (!link) {
+                       dev_err(dev, "Unable to link smi-common dev\n");
++                      put_device(&smi_com_pdev->dev);
+                       return -ENODEV;
+               }
+               *com_dev = smi_com_dev;
+-- 
+2.36.1
+
diff --git a/queue-5.18/memory-samsung-exynos5422-dmc-fix-refcount-leak-in-of_get_dram_timings.patch b/queue-5.18/memory-samsung-exynos5422-dmc-fix-refcount-leak-in-of_get_dram_timings.patch
new file mode 100644 (file)
index 0000000..7f35a18
--- /dev/null
@@ -0,0 +1,92 @@
+From 1332661e09304b7b8e84e5edc11811ba08d12abe Mon Sep 17 00:00:00 2001
+From: Miaoqian Lin <linmq006@gmail.com>
+Date: Thu, 2 Jun 2022 08:17:21 +0400
+Subject: memory: samsung: exynos5422-dmc: Fix refcount leak in of_get_dram_timings
+
+From: Miaoqian Lin <linmq006@gmail.com>
+
+commit 1332661e09304b7b8e84e5edc11811ba08d12abe upstream.
+
+of_parse_phandle() returns a node pointer with refcount
+incremented, we should use of_node_put() on it when not need anymore.
+This function doesn't call of_node_put() in some error paths.
+To unify the structure, Add put_node label and goto it on errors.
+
+Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422")
+Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
+Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
+Link: https://lore.kernel.org/r/20220602041721.64348-1-linmq006@gmail.com
+Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/memory/samsung/exynos5422-dmc.c |   29 ++++++++++++++++++-----------
+ 1 file changed, 18 insertions(+), 11 deletions(-)
+
+--- a/drivers/memory/samsung/exynos5422-dmc.c
++++ b/drivers/memory/samsung/exynos5422-dmc.c
+@@ -1187,33 +1187,39 @@ static int of_get_dram_timings(struct ex
+       dmc->timing_row = devm_kmalloc_array(dmc->dev, TIMING_COUNT,
+                                            sizeof(u32), GFP_KERNEL);
+-      if (!dmc->timing_row)
+-              return -ENOMEM;
++      if (!dmc->timing_row) {
++              ret = -ENOMEM;
++              goto put_node;
++      }
+       dmc->timing_data = devm_kmalloc_array(dmc->dev, TIMING_COUNT,
+                                             sizeof(u32), GFP_KERNEL);
+-      if (!dmc->timing_data)
+-              return -ENOMEM;
++      if (!dmc->timing_data) {
++              ret = -ENOMEM;
++              goto put_node;
++      }
+       dmc->timing_power = devm_kmalloc_array(dmc->dev, TIMING_COUNT,
+                                              sizeof(u32), GFP_KERNEL);
+-      if (!dmc->timing_power)
+-              return -ENOMEM;
++      if (!dmc->timing_power) {
++              ret = -ENOMEM;
++              goto put_node;
++      }
+       dmc->timings = of_lpddr3_get_ddr_timings(np_ddr, dmc->dev,
+                                                DDR_TYPE_LPDDR3,
+                                                &dmc->timings_arr_size);
+       if (!dmc->timings) {
+-              of_node_put(np_ddr);
+               dev_warn(dmc->dev, "could not get timings from DT\n");
+-              return -EINVAL;
++              ret = -EINVAL;
++              goto put_node;
+       }
+       dmc->min_tck = of_lpddr3_get_min_tck(np_ddr, dmc->dev);
+       if (!dmc->min_tck) {
+-              of_node_put(np_ddr);
+               dev_warn(dmc->dev, "could not get tck from DT\n");
+-              return -EINVAL;
++              ret = -EINVAL;
++              goto put_node;
+       }
+       /* Sorted array of OPPs with frequency ascending */
+@@ -1227,13 +1233,14 @@ static int of_get_dram_timings(struct ex
+                                            clk_period_ps);
+       }
+-      of_node_put(np_ddr);
+       /* Take the highest frequency's timings as 'bypass' */
+       dmc->bypass_timing_row = dmc->timing_row[idx - 1];
+       dmc->bypass_timing_data = dmc->timing_data[idx - 1];
+       dmc->bypass_timing_power = dmc->timing_power[idx - 1];
++put_node:
++      of_node_put(np_ddr);
+       return ret;
+ }
diff --git a/queue-5.18/modpost-fix-section-mismatch-check-for-exported-init-exit-sections.patch b/queue-5.18/modpost-fix-section-mismatch-check-for-exported-init-exit-sections.patch
new file mode 100644 (file)
index 0000000..a85a5fc
--- /dev/null
@@ -0,0 +1,37 @@
+From 28438794aba47a27e922857d27b31b74e8559143 Mon Sep 17 00:00:00 2001
+From: Masahiro Yamada <masahiroy@kernel.org>
+Date: Sat, 11 Jun 2022 03:32:30 +0900
+Subject: modpost: fix section mismatch check for exported init/exit sections
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+commit 28438794aba47a27e922857d27b31b74e8559143 upstream.
+
+Since commit f02e8a6596b7 ("module: Sort exported symbols"),
+EXPORT_SYMBOL* is placed in the individual section ___ksymtab(_gpl)+<sym>
+(3 leading underscores instead of 2).
+
+Since then, modpost cannot detect the bad combination of EXPORT_SYMBOL
+and __init/__exit.
+
+Fix the .fromsec field.
+
+Fixes: f02e8a6596b7 ("module: Sort exported symbols")
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ scripts/mod/modpost.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/scripts/mod/modpost.c
++++ b/scripts/mod/modpost.c
+@@ -1115,7 +1115,7 @@ static const struct sectioncheck section
+ },
+ /* Do not export init/exit functions or data */
+ {
+-      .fromsec = { "__ksymtab*", NULL },
++      .fromsec = { "___ksymtab*", NULL },
+       .bad_tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
+       .mismatch = EXPORT_TO_INIT_EXIT,
+       .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
diff --git a/queue-5.18/perf-build-id-fix-caching-files-with-a-wrong-build-id.patch b/queue-5.18/perf-build-id-fix-caching-files-with-a-wrong-build-id.patch
new file mode 100644 (file)
index 0000000..8cf107c
--- /dev/null
@@ -0,0 +1,103 @@
+From ab66fdace8581ef3b4e7cf5381a168ed4058d779 Mon Sep 17 00:00:00 2001
+From: Adrian Hunter <adrian.hunter@intel.com>
+Date: Tue, 21 Jun 2022 15:51:44 +0300
+Subject: perf build-id: Fix caching files with a wrong build ID
+
+From: Adrian Hunter <adrian.hunter@intel.com>
+
+commit ab66fdace8581ef3b4e7cf5381a168ed4058d779 upstream.
+
+Build ID events associate a file name with a build ID.  However, when
+using perf inject, there is no guarantee that the file on the current
+machine at the current time has that build ID. Fix by comparing the
+build IDs and skip adding to the cache if they are different.
+
+Example:
+
+  $ echo "int main() {return 0;}" > prog.c
+  $ gcc -o prog prog.c
+  $ perf record --buildid-all ./prog
+  [ perf record: Woken up 1 times to write data ]
+  [ perf record: Captured and wrote 0.019 MB perf.data ]
+  $ file-buildid() { file $1 | awk -F= '{print $2}' | awk -F, '{print $1}' ; }
+  $ file-buildid prog
+  444ad9be165d8058a48ce2ffb4e9f55854a3293e
+  $ file-buildid ~/.debug/$(pwd)/prog/444ad9be165d8058a48ce2ffb4e9f55854a3293e/elf
+  444ad9be165d8058a48ce2ffb4e9f55854a3293e
+  $ echo "int main() {return 1;}" > prog.c
+  $ gcc -o prog prog.c
+  $ file-buildid prog
+  885524d5aaa24008a3e2b06caa3ea95d013c0fc5
+
+Before:
+
+  $ perf buildid-cache --purge $(pwd)/prog
+  $ perf inject -i perf.data -o junk
+  $ file-buildid ~/.debug/$(pwd)/prog/444ad9be165d8058a48ce2ffb4e9f55854a3293e/elf
+  885524d5aaa24008a3e2b06caa3ea95d013c0fc5
+  $
+
+After:
+
+  $ perf buildid-cache --purge $(pwd)/prog
+  $ perf inject -i perf.data -o junk
+  $ file-buildid ~/.debug/$(pwd)/prog/444ad9be165d8058a48ce2ffb4e9f55854a3293e/elf
+
+  $
+
+Fixes: 454c407ec17a0c63 ("perf: add perf-inject builtin")
+Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Tom Zanussi <tzanussi@gmail.com>
+Link: https://lore.kernel.org/r/20220621125144.5623-1-adrian.hunter@intel.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/perf/util/build-id.c |   28 ++++++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+--- a/tools/perf/util/build-id.c
++++ b/tools/perf/util/build-id.c
+@@ -872,6 +872,30 @@ out_free:
+       return err;
+ }
++static int filename__read_build_id_ns(const char *filename,
++                                    struct build_id *bid,
++                                    struct nsinfo *nsi)
++{
++      struct nscookie nsc;
++      int ret;
++
++      nsinfo__mountns_enter(nsi, &nsc);
++      ret = filename__read_build_id(filename, bid);
++      nsinfo__mountns_exit(&nsc);
++
++      return ret;
++}
++
++static bool dso__build_id_mismatch(struct dso *dso, const char *name)
++{
++      struct build_id bid;
++
++      if (filename__read_build_id_ns(name, &bid, dso->nsinfo) < 0)
++              return false;
++
++      return !dso__build_id_equal(dso, &bid);
++}
++
+ static int dso__cache_build_id(struct dso *dso, struct machine *machine,
+                              void *priv __maybe_unused)
+ {
+@@ -886,6 +910,10 @@ static int dso__cache_build_id(struct ds
+               is_kallsyms = true;
+               name = machine->mmap_name;
+       }
++
++      if (!is_kallsyms && dso__build_id_mismatch(dso, name))
++              return 0;
++
+       return build_id_cache__add_b(&dso->bid, name, dso->nsinfo,
+                                    is_kallsyms, is_vdso);
+ }
diff --git a/queue-5.18/random-update-comment-from-copy_to_user-copy_to_iter.patch b/queue-5.18/random-update-comment-from-copy_to_user-copy_to_iter.patch
new file mode 100644 (file)
index 0000000..9f2b9dc
--- /dev/null
@@ -0,0 +1,30 @@
+From 63b8ea5e4f1a87dea4d3114293fc8e96a8f193d7 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Date: Mon, 20 Jun 2022 11:03:48 +0200
+Subject: random: update comment from copy_to_user() -> copy_to_iter()
+
+From: Jason A. Donenfeld <Jason@zx2c4.com>
+
+commit 63b8ea5e4f1a87dea4d3114293fc8e96a8f193d7 upstream.
+
+This comment wasn't updated when we moved from read() to read_iter(), so
+this patch makes the trivial fix.
+
+Fixes: 1b388e7765f2 ("random: convert to using fops->read_iter()")
+Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/char/random.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/char/random.c
++++ b/drivers/char/random.c
+@@ -451,7 +451,7 @@ static ssize_t get_random_bytes_user(str
+       /*
+        * Immediately overwrite the ChaCha key at index 4 with random
+-       * bytes, in case userspace causes copy_to_user() below to sleep
++       * bytes, in case userspace causes copy_to_iter() below to sleep
+        * forever, so that we still retain forward secrecy in that case.
+        */
+       crng_make_state(chacha_state, (u8 *)&chacha_state[4], CHACHA_KEY_SIZE);
index cd7d8c7a24dcde484d4821580d2ed1ae37010a8c..48ecdf2ac3fb921d465f764f4c1b5bbd6795fcad 100644 (file)
@@ -160,3 +160,21 @@ powerpc-rtas-allow-ibm-platform-dump-rtas-call-with-null-buffer-address.patch
 powerpc-powernv-wire-up-rng-during-setup_arch.patch
 mm-memory-failure-disable-unpoison-once-hw-error-happens.patch
 mm-lru_cache_disable-use-synchronize_rcu_expedited.patch
+arm-dts-imx7-move-hsic_phy-power-domain-to-hsic-phy-node.patch
+arm-dts-imx6qdl-correct-pu-regulator-ramp-delay.patch
+arm64-dts-ti-k3-am64-main-remove-support-for-hs400-speed-mode.patch
+arm-exynos-fix-refcount-leak-in-exynos_map_pmu.patch
+arm64-dts-exynos-correct-uart-clocks-on-exynos7885.patch
+soc-bcm-brcmstb-pm-pm-arm-fix-refcount-leak-in-brcmstb_pm_probe.patch
+arm-fix-refcount-leak-in-axxia_boot_secondary.patch
+memory-mtk-smi-add-missing-put_device-call-in-mtk_smi_device_link_common.patch
+memory-samsung-exynos5422-dmc-fix-refcount-leak-in-of_get_dram_timings.patch
+arm-cns3xxx-fix-refcount-leak-in-cns3xxx_init.patch
+modpost-fix-section-mismatch-check-for-exported-init-exit-sections.patch
+arm-dts-bcm2711-rpi-400-fix-gpio-line-names.patch
+smb3-fix-empty-netname-context-on-secondary-channels.patch
+random-update-comment-from-copy_to_user-copy_to_iter.patch
+perf-build-id-fix-caching-files-with-a-wrong-build-id.patch
+smb3-use-netname-when-available-on-secondary-channels.patch
+dma-direct-use-the-correct-size-for-dma_set_encrypted.patch
+kbuild-link-vmlinux-only-once-for-config_trim_unused_ksyms-2nd-attempt.patch
diff --git a/queue-5.18/smb3-fix-empty-netname-context-on-secondary-channels.patch b/queue-5.18/smb3-fix-empty-netname-context-on-secondary-channels.patch
new file mode 100644 (file)
index 0000000..a330b41
--- /dev/null
@@ -0,0 +1,49 @@
+From 73130a7b1ac92c9f30e0a255951129f4851c5794 Mon Sep 17 00:00:00 2001
+From: Steve French <stfrench@microsoft.com>
+Date: Sat, 18 Jun 2022 17:24:23 -0500
+Subject: smb3: fix empty netname context on secondary channels
+
+From: Steve French <stfrench@microsoft.com>
+
+commit 73130a7b1ac92c9f30e0a255951129f4851c5794 upstream.
+
+Some servers do not allow null netname contexts, which would cause
+multichannel to revert to single channel when mounting to some
+servers (e.g. Azure xSMB).
+
+Fixes: 4c14d7043fede ("cifs: populate empty hostnames for extra channels")
+Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
+Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/cifs/smb2pdu.c |   14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+--- a/fs/cifs/smb2pdu.c
++++ b/fs/cifs/smb2pdu.c
+@@ -570,16 +570,18 @@ assemble_neg_contexts(struct smb2_negoti
+       *total_len += ctxt_len;
+       pneg_ctxt += ctxt_len;
+-      ctxt_len = build_netname_ctxt((struct smb2_netname_neg_context *)pneg_ctxt,
+-                                      server->hostname);
+-      *total_len += ctxt_len;
+-      pneg_ctxt += ctxt_len;
+-
+       build_posix_ctxt((struct smb2_posix_neg_context *)pneg_ctxt);
+       *total_len += sizeof(struct smb2_posix_neg_context);
+       pneg_ctxt += sizeof(struct smb2_posix_neg_context);
+-      neg_context_count = 4;
++      if (server->hostname && (server->hostname[0] != 0)) {
++              ctxt_len = build_netname_ctxt((struct smb2_netname_neg_context *)pneg_ctxt,
++                                      server->hostname);
++              *total_len += ctxt_len;
++              pneg_ctxt += ctxt_len;
++              neg_context_count = 4;
++      } else /* second channels do not have a hostname */
++              neg_context_count = 3;
+       if (server->compress_algorithm) {
+               build_compression_ctxt((struct smb2_compression_capabilities_context *)
diff --git a/queue-5.18/smb3-use-netname-when-available-on-secondary-channels.patch b/queue-5.18/smb3-use-netname-when-available-on-secondary-channels.patch
new file mode 100644 (file)
index 0000000..eed5438
--- /dev/null
@@ -0,0 +1,59 @@
+From 9de74996a739bf0b7b5d8c260bd207ad6007442b Mon Sep 17 00:00:00 2001
+From: Shyam Prasad N <sprasad@microsoft.com>
+Date: Wed, 22 Jun 2022 12:36:36 -0500
+Subject: smb3: use netname when available on secondary channels
+
+From: Shyam Prasad N <sprasad@microsoft.com>
+
+commit 9de74996a739bf0b7b5d8c260bd207ad6007442b upstream.
+
+Some servers do not allow null netname contexts, which would cause
+multichannel to revert to single channel when mounting to some
+servers (e.g. Azure xSMB). The previous patch fixed that by avoiding
+incorrectly sending the netname context when there would be a null
+hostname sent in the netname context, while this patch fixes the null
+hostname for the secondary channel by using the hostname of the
+primary channel for the secondary channel.
+
+Fixes: 4c14d7043fede ("cifs: populate empty hostnames for extra channels")
+Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
+Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/cifs/smb2pdu.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
+index 5e8c4737b183..12b4dddaedb0 100644
+--- a/fs/cifs/smb2pdu.c
++++ b/fs/cifs/smb2pdu.c
+@@ -543,6 +543,7 @@ assemble_neg_contexts(struct smb2_negotiate_req *req,
+                     struct TCP_Server_Info *server, unsigned int *total_len)
+ {
+       char *pneg_ctxt;
++      char *hostname = NULL;
+       unsigned int ctxt_len, neg_context_count;
+       if (*total_len > 200) {
+@@ -574,9 +575,15 @@ assemble_neg_contexts(struct smb2_negotiate_req *req,
+       *total_len += sizeof(struct smb2_posix_neg_context);
+       pneg_ctxt += sizeof(struct smb2_posix_neg_context);
+-      if (server->hostname && (server->hostname[0] != 0)) {
++      /*
++       * secondary channels don't have the hostname field populated
++       * use the hostname field in the primary channel instead
++       */
++      hostname = CIFS_SERVER_IS_CHAN(server) ?
++              server->primary_server->hostname : server->hostname;
++      if (hostname && (hostname[0] != 0)) {
+               ctxt_len = build_netname_ctxt((struct smb2_netname_neg_context *)pneg_ctxt,
+-                                      server->hostname);
++                                            hostname);
+               *total_len += ctxt_len;
+               pneg_ctxt += ctxt_len;
+               neg_context_count = 4;
+-- 
+2.36.1
+
diff --git a/queue-5.18/soc-bcm-brcmstb-pm-pm-arm-fix-refcount-leak-in-brcmstb_pm_probe.patch b/queue-5.18/soc-bcm-brcmstb-pm-pm-arm-fix-refcount-leak-in-brcmstb_pm_probe.patch
new file mode 100644 (file)
index 0000000..0a2299b
--- /dev/null
@@ -0,0 +1,37 @@
+From 37d838de369b07b596c19ff3662bf0293fdb09ee Mon Sep 17 00:00:00 2001
+From: Miaoqian Lin <linmq006@gmail.com>
+Date: Thu, 26 May 2022 11:53:22 +0400
+Subject: soc: bcm: brcmstb: pm: pm-arm: Fix refcount leak in brcmstb_pm_probe
+
+From: Miaoqian Lin <linmq006@gmail.com>
+
+commit 37d838de369b07b596c19ff3662bf0293fdb09ee upstream.
+
+of_find_matching_node() returns a node pointer with refcount
+incremented, we should use of_node_put() on it when not need anymore.
+Add missing of_node_put() to avoid refcount leak.
+
+In brcmstb_init_sram, it pass dn to of_address_to_resource(),
+of_address_to_resource() will call of_find_device_by_node() to take
+reference, so we should release the reference returned by
+of_find_matching_node().
+
+Fixes: 0b741b8234c8 ("soc: bcm: brcmstb: Add support for S2/S3/S5 suspend states (ARM)")
+Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/soc/bcm/brcmstb/pm/pm-arm.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c
++++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
+@@ -783,6 +783,7 @@ static int brcmstb_pm_probe(struct platf
+       }
+       ret = brcmstb_init_sram(dn);
++      of_node_put(dn);
+       if (ret) {
+               pr_err("error setting up SRAM for PM\n");
+               return ret;