From ce2b361bdc2c72c4d541f31fbe93b94e480b0fea Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 16 Jun 2022 15:12:51 +0200 Subject: [PATCH] 5.10-stable patches added patches: arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch --- ...mx8mm-beacon-enable-rts-cts-on-uart3.patch | 39 ++++++++++++++ ...-cost-calculation-in-stack_map_alloc.patch | 52 +++++++++++++++++++ queue-5.10/series | 2 + 3 files changed, 93 insertions(+) create mode 100644 queue-5.10/arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch create mode 100644 queue-5.10/bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch diff --git a/queue-5.10/arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch b/queue-5.10/arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch new file mode 100644 index 00000000000..13bb3fe9415 --- /dev/null +++ b/queue-5.10/arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch @@ -0,0 +1,39 @@ +From 4ce01ce36d77137cf60776b320babed89de6bd4c Mon Sep 17 00:00:00 2001 +From: Adam Ford +Date: Tue, 26 Apr 2022 15:51:43 -0500 +Subject: arm64: dts: imx8mm-beacon: Enable RTS-CTS on UART3 + +From: Adam Ford + +commit 4ce01ce36d77137cf60776b320babed89de6bd4c upstream. + +There is a header for a DB9 serial port, but any attempts to use +hardware handshaking fail. Enable RTS and CTS pin muxing and enable +handshaking in the uart node. + +Signed-off-by: Adam Ford +Signed-off-by: Shawn Guo +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi ++++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi +@@ -167,6 +167,7 @@ + pinctrl-0 = <&pinctrl_uart3>; + assigned-clocks = <&clk IMX8MM_CLK_UART3>; + assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>; ++ uart-has-rtscts; + status = "okay"; + }; + +@@ -237,6 +238,8 @@ + fsl,pins = < + MX8MM_IOMUXC_ECSPI1_SCLK_UART3_DCE_RX 0x40 + MX8MM_IOMUXC_ECSPI1_MOSI_UART3_DCE_TX 0x40 ++ MX8MM_IOMUXC_ECSPI1_MISO_UART3_DCE_CTS_B 0x40 ++ MX8MM_IOMUXC_ECSPI1_SS0_UART3_DCE_RTS_B 0x40 + >; + }; + diff --git a/queue-5.10/bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch b/queue-5.10/bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch new file mode 100644 index 00000000000..ce70b3593c6 --- /dev/null +++ b/queue-5.10/bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch @@ -0,0 +1,52 @@ +From ytcoode@gmail.com Thu Jun 16 15:08:23 2022 +From: Yuntao Wang +Date: Tue, 14 Jun 2022 22:26:22 +0800 +Subject: bpf: Fix incorrect memory charge cost calculation in stack_map_alloc() +To: gregkh@linuxfoundation.org +Cc: daniel@iogearbox.net, linux-kernel@vger.kernel.org, pavel@denx.de, sashal@kernel.org, stable@vger.kernel.org, ytcoode@gmail.com, ast@kernel.org, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, bpf@vger.kernel.org +Message-ID: <20220614142622.998611-1-ytcoode@gmail.com> + +From: Yuntao Wang + +commit b45043192b3e481304062938a6561da2ceea46a6 upstream. + +This is a backport of the original upstream patch for 5.4/5.10. + +The original upstream patch has been applied to 5.4/5.10 branches, which +simply removed the line: + + cost += n_buckets * (value_size + sizeof(struct stack_map_bucket)); + +This is correct for upstream branch but incorrect for 5.4/5.10 branches, +as the 5.4/5.10 branches do not have the commit 370868107bf6 ("bpf: +Eliminate rlimit-based memory accounting for stackmap maps"), so the +bpf_map_charge_init() function has not been removed. + +Currently the bpf_map_charge_init() function in 5.4/5.10 branches takes a +wrong memory charge cost, the + + attr->max_entries * (sizeof(struct stack_map_bucket) + (u64)value_size)) + +part is missing, let's fix it. + +Cc: # 5.4.y +Cc: # 5.10.y +Signed-off-by: Yuntao Wang +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/bpf/stackmap.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/kernel/bpf/stackmap.c ++++ b/kernel/bpf/stackmap.c +@@ -121,7 +121,8 @@ static struct bpf_map *stack_map_alloc(u + return ERR_PTR(-E2BIG); + + cost = n_buckets * sizeof(struct stack_map_bucket *) + sizeof(*smap); +- err = bpf_map_charge_init(&mem, cost); ++ err = bpf_map_charge_init(&mem, cost + attr->max_entries * ++ (sizeof(struct stack_map_bucket) + (u64)value_size)); + if (err) + return ERR_PTR(err); + diff --git a/queue-5.10/series b/queue-5.10/series index 5f36fa4a4c6..b934ea3f88d 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -1,2 +1,4 @@ 9p-missing-chunk-of-fs-9p-don-t-update-file-type-when-updating-file-attributes.patch nfsd-replace-use-of-rwsem-with-errseq_t.patch +bpf-fix-incorrect-memory-charge-cost-calculation-in-stack_map_alloc.patch +arm64-dts-imx8mm-beacon-enable-rts-cts-on-uart3.patch -- 2.47.3